feat(computability): bound complete pair-first parsing - #83
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b083a4ede
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import ComplexityTheory.Computability.PairFirstComposition.ParseFirst | ||
|
|
||
| /-! | ||
| # Complete canonical-pair parsing |
There was a problem hiding this comment.
Cite borrowed transition machinery
The new module proves parser phases using Mathlib's StateTransition.EvalsToInTime/EvalsToInTime.trans, but the module docstring does not record any authors/title/year/version or precise declaration provenance. That violates the repo's source policy and makes the borrowed execution relation impossible to audit from this public module; add the Mathlib citation near the module header before merging.
AGENTS.md reference: AGENTS.md:L42-L44
Useful? React with 👍 / 👎.
| variable {function : BitString → Bool} | ||
|
|
||
| /-- Witness clearing consumes the complete encoded second component. -/ | ||
| def evaluatesClearSecond |
There was a problem hiding this comment.
Rename proof declarations to snake_case
This public proof declaration, along with the other new evaluates…/…Time… proof names in this patch, is exported in lowerCamelCase, but proof and theorem names in this repo are required to be snake_case. Downstream users will otherwise take dependencies on nonconforming API names that need churn once the convention is enforced, so please rename these declarations before publishing the module.
AGENTS.md reference: AGENTS.md:L67-L67
Useful? React with 👍 / 👎.
| import ComplexityTheory.Computability.PairFirstComposition.ParseFirst | ||
|
|
||
| /-! | ||
| # Complete canonical-pair parsing |
There was a problem hiding this comment.
Cite borrowed transition machinery
The new module proves parser phases using Mathlib's StateTransition.EvalsToInTime/EvalsToInTime.trans, but the module docstring does not record any authors/title/year/version or precise declaration provenance. That violates the repo's source policy and makes the borrowed execution relation impossible to audit from this public module; add the Mathlib citation near the module header before merging.
Useful? React with 👍 / 👎.
| variable {function : BitString → Bool} | ||
|
|
||
| /-- Witness clearing consumes the complete encoded second component. -/ | ||
| def evaluatesClearSecond |
There was a problem hiding this comment.
Rename proof declarations to snake_case
This public proof declaration, along with the other new evaluates…/…Time… proof names in this patch, is exported in lowerCamelCase, but proof and theorem names in this repo are required to be snake_case. Downstream users will otherwise take dependencies on nonconforming API names that need churn once the convention is enforced, so please rename these declarations before publishing the module.
Useful? React with 👍 / 👎.
What does this change?
Completes the canonical pair parser by proving full witness consumption and decoded-input restoration. It proves parsing takes at most twice the complete pair length, then combines that cost with the source polynomial clock under one explicit full-input composition clock.
The bound charges the ignored witness instead of silently projecting it away. This is stack layer 7 of 8.
How was it tested?
lake build --wfailpasseslake lintpassessorryor new axioms, or this PR does not change Lean proofs