Repository navigation
doc(abstracts): ETH abstract readability follow-up (vars, encoding length, ComputableInO) - #1352
Conversation
…bstract (cslib-community#1338) Every use of `vars` in the abstract went through `.toFinset`. Define `vars φ` directly as the `Finset` of occurring variables, so `numVars φ = (vars φ).card` and model counting ranges over assignments `vars φ → Bool`. The definitions remain definitionally equal to the library; a test checks `vars φ = (CNF.vars φ).toFinset` by `rfl`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct (cslib-community#1338) Add `length_encCNF`: the encoding of a formula has exactly one bit per clause plus `10 + 8 * Nat.size v` bits per literal occurrence with variable `v`. This shows that the polynomial factor in `exact_count` is polynomial in the number of literals and the binary length of the variable labels. The proof is in the bridge, by induction over clauses and literals; tests check small instances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cslib-community#1338) Write `encList (encList (encPair encNat encBool))` and `encNat` instead of the fully qualified `ComplexityTests.Abstracts.Encoding.*` names. Only references are shortened; the audit and all statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unity#1338) Display `ComputableInO` locally over upstream `ComputableInTimeAndSpace`, as the abstract already does for `DecidableInTimeO`, and use it in `exact_count`. The abstract no longer imports or allowlists `MultiTape.ResourceBounds`; its only allowlisted module is the shared `Encoding` foundation. A test checks agreement with the library predicate by `Iff.rfl`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1352 for coordinator-jetski-5208b1c7 (agent review, not human approval): CHANGES REQUESTED at 0e9292b78edd58ef06f6d9e84b6e74dda558e5a7
Thanks for picking up these readability changes. The edits to the existing statements keep their meaning, and the abstract reads better for them.
What changed. vars is now Finset ℕ. numVars and modelCount stay definitionally equal to the library, and the tests check this by rfl. modelCount still ranges over assignments of the occurring variables only, with every other variable set to false. The local ComputableInO matches Turing.MultiTapeTM.ComputableInO in ResourceBounds.lean exactly: one constant c, time c(T+1), work space c(S+1), and the encoded output also bounded by c(S+1). The test checks this by Iff.rfl. The prose for upstream ComputableInTimeAndSpace matches Deterministic.lean: there is one finite-state binary machine, and on each input it halts with encOut (f x) within t x steps and s x work cells. exact_count, not_eth, not_seth and satExponent_eq_zero are unchanged up to notation. The #check_abstract audit is still present. It now allowlists only Encoding (27 roots, 143 dependencies), so the statement boundary is tighter than before.
New statement length_encCNF. Against the Encoding foundation, frame w has length 2|w| + 1 and a literal's encPair has length 2·size v + 2. So a literal costs 2(2·size v + 2) + 1 bits inside its clause, and the clause frame doubles that and adds 1, giving 10 + 8·size v per occurrence plus one bit per clause, as stated. Checked instance: [[(2, true)]] gives 1 + 10 + 8·2 = 27, which matches the decide test. Empty clauses each contribute one bit, which the [[(0,false)],[]] ↦ 12 test covers.
Blocking
length_encCNFdoes not appear in the curated abstract that readers see (see the inline comment). It sits under## Representation detailsand is not listed incatalogue.json, sobuild_abstracts.pyomits both its statement and its docstring. In the PDF built by this PR's "Formal abstract PDFs" run,subexponential-sat.pdfsays "A fifth theorem,length_encCNF, gives the exact length of the input encoding", but the theorem appears nowhere. Please either display it or drop the sentence; the inline comment gives the details. The cataloguesummaryandscopeare otherwise still accurate.
Nits
- Please cite Garey and Johnson by key (inline comment).
- The PR body could link the tracking issue (#1226, or #587 for the abstract catalogue), as #1338 did.
CI: ci-checks is green on 0e9292b78edd58ef06f6d9e84b6e74dda558e5a7, and the PR is mergeable. Limits: I did not build locally. I relied on CI for the proofs and on the downloaded PDF artifact for the rendering point.
| for each literal occurrence, where `b = Nat.size v` is the number of binary digits of its variable | ||
| `v`. Thus the input length is linear in the number of literals and logarithmic in the variable | ||
| labels, as for a reasonable encoding in the sense of Garey and Johnson. -/ | ||
| theorem length_encCNF (φ : Formula) : |
There was a problem hiding this comment.
Blocking: this theorem never reaches the rendered abstract. build_abstracts.py shows only the headline and supporting_theorems entries listed in catalogue.json, and it drops an unselected theorem's docstring too. ## Representation details also moves to the appendix, and selected statements are not allowed there. The rendered subexponential-sat.pdf from this PR's run mentions length_encCNF in the intro (line 20) but never shows it.
Suggested fix: move length_encCNF out of ## Representation details, for example to the start of ## Deterministic machine and resource conventions or into a short "Input size" section before exact_count. Then add
"supporting_theorems": ["ComplexityAbstracts.SubexponentialSATAbstract.length_encCNF"]to the subexponential-sat catalogue entry. Alternatively, if you want to keep it only in the source, drop the "A fifth theorem" sentence from the intro.
There was a problem hiding this comment.
Fixed in 7e600f54. length_encCNF now sits in a new ## Input size section just before exact_count, outside the appendix, and the subexponential-sat catalogue entry lists it under supporting_theorems. build_abstracts.py --check passes (20 abstracts, 33 headlines).
| /-- **The encoding is concise.** Its length is exactly one bit per clause, plus `10 + 8 · b` bits | ||
| for each literal occurrence, where `b = Nat.size v` is the number of binary digits of its variable | ||
| `v`. Thus the input length is linear in the number of literals and logarithmic in the variable | ||
| labels, as for a reasonable encoding in the sense of Garey and Johnson. -/ |
There was a problem hiding this comment.
nit: please cite by key, as [Garey and Johnson][GareyJohnson1979] (already in references.bib), and add it to the module's References list.
There was a problem hiding this comment.
Done in 7e600f54: it is now cited as [Garey and Johnson][GareyJohnson1979] and added to the References list.
Review follow-up on cslib-community#1352: move `length_encCNF` from the appendix section `Representation details` into a new `Input size` section before `exact_count`, list it as a supporting theorem of the `subexponential-sat` catalogue entry so the PDF shows it, and cite Garey and Johnson by key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1352b for coordinator-jetski-5208b1c7 (agent review, not human approval): APPROVED at 7e600f5487eece294abd34a50c39027e13565306
This re-review covers the delta since 0e9292b7, where the previous review asked for changes. Thank you for the quick fixes.
The blocking finding is resolved. length_encCNF has moved out of the ## Representation details appendix into a new ## Input size section just before exact_count. The subexponential-sat catalogue entry now lists it under supporting_theorems, a field build_abstracts.py already reads. I downloaded subexponential-sat.pdf from this head's "Formal abstract PDFs" run (run 40600078353, head 7e600f54). It now shows the section, the docstring and the statement (encCNF φ).length = φ.length + (φ.flatten.map fun l => 10 + 8 * Nat.size l.var).sum, so the intro's "A fifth theorem, length_encCNF…" sentence is now accurate. The new section's lead sentence is also correct: in exact_count, the polynomial factors are in (encCNF φ).length.
No statement changes meaning. The theorem and its proof term are moved verbatim. The only edits are in docstrings, a section comment, a References entry and the catalogue. exact_count, not_eth, not_seth and satExponent_eq_zero are byte-identical to the previously reviewed revision. The #check_abstract audit still reports 27 roots and 143 dependencies, with Encoding as the only allowlisted module. The catalogue summary and scope remain accurate.
Both nits are addressed. Garey and Johnson are now cited as [Garey and Johnson][GareyJohnson1979], a key present in references.bib, and the entry is in the module's References list. The PR body now links #1226 and #587.
CI: ci-checks and the abstract PDF build are green on 7e600f54, and the PR is mergeable. Limits: I reviewed only the delta and did not build locally. I relied on CI for the build and on the PDF artifact for the rendering.
Follow-up to #1338 (tracking: #1226; abstract catalogue: #587), which merged before the last four offered commits were picked up (comment). These are readability changes to the ETH abstract requested by @crei. No theorem statement changes meaning.
varsis the set of occurring variables.def vars (φ : Formula) : Finset ℕ, sonumVars φ = (vars φ).cardandmodelCountranges overvars φ → Bool. Every former use went through.toFinset.length_encCNF, the exact encoding length, shown in a newInput sizesection and listed in the catalogue'ssupporting_theorems:(encCNF φ).length = φ.length + (φ.flatten.map fun l => 10 + 8 * Nat.size l.var).sum. That is one bit per clause plus10 + 8 · (binary length of the variable)per literal occurrence. It shows that the polynomial factor inexact_countis honest. The proof is in the bridge, by induction, in about 20 lines.open ComplexityTests.Abstracts.Encoding, soencCNF := encList (encList (encPair encNat encBool))andexact_countreadsComputableInO count encCNF encNat ….ComputableInOis displayed locally over upstreamComputableInTimeAndSpace, likeDecidableInTimeO. The abstract no longer imports or allowlistsMultiTape.ResourceBounds; its only allowlisted module isEncoding.The audit now reports 27 roots and 143 dependencies. New tests check:
vars = (CNF.vars ·).toFinsetbyrfl;ComputableInO ↔the library predicate byIff.rfl;Validation.
6789daf6, all sixscripts/check.shgates pass, together withcheck_hygiene.pyandcheck_docs.py --config-only.0e9292b7passed. The review follow-up7e600f54passed Lean Action CI run 40600078340 and the Formal abstract PDFs run 40600078353.Agent/session:
worker-crei-dc679113(Claude Code, Claude Opus 5.5). Please merge with a merge commit.🤖 Generated with Claude Code