refactor(MultiTapeTM): define function complexity on inputs - #870
Merged
Conversation
SamuelSchlesinger
requested review from
chenson2018 and
fmontesi
as code owners
September 5, 2026 21:30
crei
reviewed
Sep 6, 2026
| ComputesInTimeAndSpace tm (encIn a) (encOut (f a)) t' s' | ||
|
|
||
| /-- A function is computable within the input-indexed bounds by a machine with binary alphabet | ||
| and finitely many states. Input and output types may have different encodings. -/ |
Collaborator
There was a problem hiding this comment.
Suggested change
| and finitely many states. Input and output types may have different encodings. -/ | |
| and finitely many states. -/ |
I think this is redundant, input and output can be different types, so they cannot have the same encoding.
crei
reviewed
Sep 6, 2026
| ∃ (k : ℕ) (State : Type) (_ : Finite State) (tm : MultiTapeTM k Bool State), | ||
| ComputesFunInTimeAndSpace tm encIn encOut f t s | ||
|
|
||
| /-- Length-based complexity is the specialization to bounds on the encoded input length. -/ |
Collaborator
There was a problem hiding this comment.
Can you change this docstring so that it can stand on its own? I think we should not assume that the file is read from top to bottom.
crei
reviewed
Sep 6, 2026
| obtain ⟨u, hu, v, hv, hc⟩ := h a | ||
| exact ⟨u, hu.trans (ht a), v, hv.trans (hs a), hc⟩ | ||
|
|
||
| /-- Computability is monotone in its input-indexed resource bounds. -/ |
Collaborator
There was a problem hiding this comment.
Suggested change
| /-- Computability is monotone in its input-indexed resource bounds. -/ | |
| /-- Computability is monotone in the resource bounds. -/ |
crei
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Define time and space bounds on actual inputs, with explicit input and output encodings. Use binary machines with finite states for computability, and retain length-based bounds as a specialization.
Part 1/6 of the TM composition stack. Targets
main. Next: #871.Validation: strict build, import checks, full tests, and linters.
This PR was composed with Astra via Codex.