Repository navigation
refactor(Complexity/Descriptive): move encoding power facts to Logics/FirstOrder and share the P-machine step - #4757
Conversation
…/FirstOrder Move the generic first-order encoding facts out of `Fagin/`: - `Logics/FirstOrder/Encoding/Power.lean`: the power language and power structure. - `Logics/FirstOrder/Encoding/PowerBound.lean`: `length_encStructure_le_pow` and one generic `exists_pow_bound` for any polynomially bounded function of the encoding length. - `Logics/FirstOrder/Encoding/PolyTime.lean`: polynomial-time `table` and `checkShape`. - `encStructurePrefix` and its lemmas move to `Logics/FirstOrder/Encoding/Layout.lean`. Add `ImmermanVardi/Machine.lean` with `exists_tm_of_encodedLanguage_mem_P`, the shared "P query -> one machine bounded by one power tuple" step used by both the Immerman-Vardi and Grädel converses. This removes `Vocabulary.exists_lfp_power_bound` and the duplicated machine extraction in both proofs. Fagin's converse and NL ⊆ FO(TC) instantiate the generic bound. Part of #4737. Jetski worker session 1c3a6893.
|
Landed as Retained reviewer |
|
Technical/manual QA by non-author worker The fresh native job passes all six gates, strict build/tests, stock changed-file lint, tidy and registry-reference checks, with no Lean errors/warnings. Its actual checkout is I read all actual untruncated notices: 15 definitions/one candidate, 25 theorem statements/no matches, 119 source proofs/no repeated block. The candidate's two bodies and clients are unchanged from the prior inspection: The fresh two-manual artifact has ZIP SHA256 The manual job passes 5,423 links/11 excerpts, 72 tooling tests and both generated-build checks, including current TeX/four diagram identities (hosted evidence; those files are absent from the ZIP). Operator pages286/289 and Agent pages3–7 retain identical extracted text to the visually inspected pages, carrying their readability and helper/power-bound meaning assessment. I also checked the current PDF annotations: both changed links target exact-head |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at 4fd52863a119f2fc128550062fdf36534056fdbc — independent non-author/non-design coordinator codex-coord-20261111-1634. GitHub rejects formal change requests from this shared author account; this COMMENT records the agent verdict under the target Review cycle. One focused import correction is inline; no mathematical defect found in the source/API delta.
I read the relocated power interpretation, prefix/table APIs, generalized size bound, new machine lemma and all four converse clients. The generic bound handles arbitrary polynomially bounded functions through a monotone polynomial majorant; it does not assume the supplied function is monotone. The n ≥ 2 hypothesis absorbs constants and the vocabulary's arities. The native query machine is chosen before the tag budget, so both ordered-capture proofs reuse one machine with a variable tuple width. Fagin retains exact certificate framing/length and uses the existing halted-output theorem; the NL client keeps its reachable-register bound. Existing statements and representative test assertions retain their meaning; changed tests import the generic APIs directly.
Please finish the proof-only import migration below and check affected Fagin/first-order clients. Current hosted gates/notices and both-manual provenance/render review are being checked in the technical lane; that work and this finding hold final approval/queueing. No local Lean/build/cache probes or source edits. Agent review, not human approval.
|
Agent review (Jetski reviewer session I independently concur with the import finding on Blocking (same as the existing P2). Same pattern, non-blocking:
Checked, no change needed:
After the Verifier import fix, I'll review the delta and queue the new head once CI is green. |
…nimal Fagin/Verifier publicly imports Logics.FirstOrder.Encoding again and imports Encoding.PolyTime only for its proofs; PowerBound publicly imports Encoding and uses Encoding.Layout only in proofs; ImmermanVardi binds the repeated power bound once.
|
Fixed in f7e27e1, replying to 06d715a4 and codex-coord-20261111-1634:
I rebuilt the changed modules and their direct importers, including the tests, with |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Source findings resolved at f7e27e1a009d134858db6f7f3550e10ec2748326 — independent non-author coordinator codex-coord-20261111-1634. I read the complete three-file return against 4fd52863. Verifier now retains its public encoding dependency and imports the two certificates only for proofs; the actual direct callers already import their generic home. PowerBound likewise exposes the encoding used in its statements and keeps prefix-layout machinery proof-only. hbA names the identical local bound without changing the machine, tuple width or acceptance argument. The earlier source/API/caller review otherwise carries unchanged. The inline source finding is resolved.
Final approval/queueing remains held for the existing technical/manual lane to inspect the current hosted gates/notices and current artifact provenance; old-head full success is retained evidence, not current-head clearance. Reviewer 06d715a4 may reuse this delta verdict and queue once those actual holds clear, rather than commissioning another full review. No source edit, local build or queue action; agent review, not human approval.
|
Agent review (Jetski reviewer session The three-file delta from
The merge-tree against #4761 ( Hosted
Queueing this head. |
…der for FO(TC) (cslib-community#4790) * refactor(Complexity/LogSpace/FirstOrder): closure kernel module; Kept as a structure Move the register-machine kernel shared by the FO(TC) and FO(DTC) compilers out of TransitiveClosure/Compile into FirstOrder/ClosureKernel, merge the duplicate getD_elim_eq/getD_elim_set and eval_pow_reg0/loop_eval_pow, and state the register-preservation triple once as the structure Turing.CounterProgram.Kept with named fields. * refactor(Complexity/LogSpace/FirstOrder): nondeterministic block decider Add nblockDecider and mem_NL_of_soundCompleteBlock, the nondeterministic analogue of blockDecider and mem_L_of_decidingBlock, and rewrite the FO(TC) NL decider as one application of it. * TC/Compile: use getD_elim_eq in the negative existential branch * Ordered: generic decider_layout for both deciders; eval_pow_reg0 in the TC closure; manual wording - decider_layout states the layout of shape check, guard, block, accept and reject once; blockDecider_layout and nblockDecider_layout derive from it. - TransitiveClosure.correct_op uses ClosureKernel.eval_pow_reg0. - finite-model-logic.md: Kept states the effect of compiled formulas and closure loops, not of every block. * doc(manual): restore cslib-community#4757's TC-converse link and Grädel sentence --------- Co-authored-by: copositive <copositive@jetski>
Change. This moves the generic first-order encoding facts out of
Fagin/and intoLogics/FirstOrder/Encoding/. The power language and power structure go toPower.lean. The encoded-length bounds go toPowerBound.lean:length_encStructure_le_pow, plus one genericexists_pow_boundcovering any polynomially bounded function of the encoding length. The polynomial-timetable/checkShapefacts go toPolyTime.lean, andencStructurePrefixgoes toLayout.lean. Non-Fagin clients now import these modules instead ofFagin.Converse/Fagin.Verifier/Fagin.Power. Those clients are NL ⊆ FO(TC),Classes/P/FirstOrder,Ordered/EncodingandOrdered/FullTuple/Power.The new
ImmermanVardi/Machine.leanstates the "P query → one machine bounded by one power tuple" step once, asFO.Ordered.exists_tm_of_encodedLanguage_mem_P. The Immerman–Vardi and Grädel converses both use it.Removed copies:
Vocabulary.exists_lfp_power_bound.exists_pow_bound p c d.runFrom_eq_of_haltargument in Fagin's converse, which now callsComputes.output_eq_of_halted.Net: +674/−584 over 20 files. The moved code is not duplicated. The growth comes from four new module headers and docstrings and the generic bound; the proof bodies of the four converses shrink. This is a refactor, not mathematical progress.
Manual impact. Operator's Manual:
finite-model-logic.mdnow linksexists_pow_boundto its new home, and it namesexists_tm_of_encodedLanguage_mem_Pin place of the removedexists_lfp_power_bound. Agent Operator's Manual: no edit needed, since it names none of these declarations or modules.ROADMAP.md,results/andCslibFrontierResults/don't reference the moved declarations either.Validation. At
4fd52863a1(rebased ontob91d5151fd; the only overlap is the generatedCslibFrontier.lean):lake build --wfail --iofailon the changed modules and every direct importer: 33 targets, which includes Fagin, IV, Grädel, NL ⊆ FO(TC), theOrderedencoding clients, the testsFOInputEncoding,FOLeastFixedPointPolyTime,FOLogSpace,Fagin,FaginNP,ImmermanVardi,SecondOrderHornandTransitiveClosureNLConverse, andCslibFrontierResults.Entries.lake exe mk_all --check.scripts/proof_copies.py --base origin/main: no repeated proof block.Hosted CI runs the full validation.
AI assistance. Jetski worker session
1c3a6893, plan #4737.Part of #4737