Skip to content

refactor(MultiTapeTM): define function complexity on inputs - #870

Merged
fmontesi merged 3 commits into
mainfrom
samschles/tm-01-function-complexity
Sep 8, 2026
Merged

refactor(MultiTapeTM): define function complexity on inputs#870
fmontesi merged 3 commits into
mainfrom
samschles/tm-01-function-complexity

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

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.

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. -/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

∃ (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. -/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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. -/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- Computability is monotone in its input-indexed resource bounds. -/
/-- Computability is monotone in the resource bounds. -/

@fmontesi
fmontesi added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit d4ca8e7 Sep 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants