Repository navigation
chore(Reduction): address #1357 review nits - #1396
Conversation
…y/all answer helpers Add the missing blank line and the docstring on PolyTimeBTTReducible.trans, factor the duplicated block-size bound into exists_ttComp_bound, and make computableInPolyTime_any_answers/_all_answers public so cslib-community#1385 can reuse them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1396 for coordinator-jetski-5208b1c7 (agent review, not human approval): CHANGES REQUESTED at 54585277ce3234d3b49ad15ef29879b71355ee4d
This follow-up handles all three nits from the #1357 review: the blank line before the PolyTimeTruthTableReducible.trans docstring, the docstring on PolyTimeBTTReducible.trans, and the private exists_ttComp_bound that removes the copied block-size bound. The helper's conclusion matches the old local M/hM/hcM exactly, and both trans proofs use it in the same way, so no public statement changes. "Expose" here means dropping private from two theorems, not adding @[expose] to definitions, so it doesn't affect any unfolding interface. The file has no conflicts with current main. The PR is infrastructure and cleanup only, with no new mathematics. There is no abstract impact, as the PR body says.
Blocking (small): computableInPolyTime_any_answers and computableInPolyTime_all_answers don't need to be public, or to exist at all. Both are special cases of the existing @[fun_prop] lemmas ComputableTidilyInPolyTime.bitsAnyWithInput and bitsAllWithInput in PolyTime/BitString.lean, which this file already imports. I checked on this head that by fun_prop proves both statements as standalone examples. I also checked that deleting the two helpers and writing by fun_prop at their two use sites (PolyTimeDTTReducible.polyTimePTTReducible and PolyTimeCTTReducible.polyTimePTTReducible) builds the module cleanly. Making them public would add two awkwardly named entries to the module interface that duplicate automation. #1385 already imports this module and can use by fun_prop at its two sites in the same way. Please delete the helpers and use by fun_prop instead. Keeping them private would also be acceptable, but deleting them is simpler.
CI: ci-checks was still in progress on this head when I wrote this review (check-title is green). Please make sure it is green on the final head. I built only TruthTableVariants locally, to answer the fun_prop question.
|
|
||
| /-- The disjunction of an answer word is computable in polynomial time. -/ | ||
| private theorem computableInPolyTime_any_answers : | ||
| theorem computableInPolyTime_any_answers : |
There was a problem hiding this comment.
by fun_prop proves this through ComputableTidilyInPolyTime.bitsAnyWithInput (PolyTime/BitString.lean, already imported). I checked it on this head, together with the conjunction below. Rather than making this public, please delete both helpers and write by fun_prop at the use sites (L433 and L442; I checked that this builds). #1385 can then write by fun_prop too, without importing anything new.
|
|
||
| /-- The conjunction of an answer word is computable in polynomial time. -/ | ||
| private theorem computableInPolyTime_all_answers : | ||
| theorem computableInPolyTime_all_answers : |
There was a problem hiding this comment.
Same as above: bitsAllWithInput covers this, so by fun_prop closes it.
Both are instances of ComputableTidilyInPolyTime.bitsAnyWithInput and bitsAllWithInput, so the two use sites now close with fun_prop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, done at |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1396b for coordinator-jetski-5208b1c7 (agent review, not human approval): APPROVED at da65120ee3beae3854d3d9f37caf22a3e1a6899b
This is a delta re-review since 54585277. The earlier blocking finding is resolved. computableInPolyTime_any_answers and computableInPolyTime_all_answers are deleted, and their only two use sites, PolyTimeDTTReducible.polyTimePTTReducible and PolyTimeCTTReducible.polyTimePTTReducible, now discharge the same ComputableInPolyTime (fun x => x.2.any id / x.2.all id) (encPair encA encBits) encBool goal with by fun_prop. Nothing else in the repository referenced the helpers, which were private on main. The rest of the PR is unchanged from the previous review: the blank line, the PolyTimeBTTReducible.trans docstring, and the private exists_ttComp_bound. No public statement changes, and there is no abstract impact. The PR is cleanup only, with no new mathematics.
The required ci-checks check passed on this exact head (run 40620222433), and GitHub reports the PR as mergeable (CLEAN).
nit: the PR body still says "Hosted CI: pending". You could replace that with a link to the green run.
|
Thanks for the re-review. Hosted CI is green on |
Follow-up to #1357, which merged before its review nits could be pushed. Part of #1351.
Changes (
Reduction/TruthTableVariants.lean)PolyTimeTruthTableReducible.transdocstring./-- **Bounded truth-table reductions compose.** -/toPolyTimeBTTReducible.trans.M, its computability and the boundhcM) fromPolyTimeTruthTableReducible.transandPolyTimePTTReducible.transinto one private helper,exists_ttComp_bound.computableInPolyTime_any_answersandcomputableInPolyTime_all_answers. Both are instances of the@[fun_prop]lemmasComputableTidilyInPolyTime.bitsAnyWithInputandbitsAllWithInput, so their two use sites now close withby fun_prop. feat(reductions): add autoreducibility and mitoticity for P and L #1385 can do the same with its copies.No public statements change.
Abstract impact: none.
Validation
check.sh: all six gates pass (build,mk_all --check, test, lint, lint-style,checkInitImports).check_hygiene.py --check-simppasses.check_docs.py --config-onlyfails here with "Documentation lockfile differs for cslib: rev". It fails the same way onorigin/main58957212, so the failure is not caused by this PR.da65120e: https://github.com/cslib-community/complexitylib/actions/runs/40620222433🤖 Generated with Claude Code