Skip to content

feat(MultiTapeTM): Complexity of accessors and constructors of the default encodings - #1237

Open
crei wants to merge 1 commit into
mainfrom
crei/encoding_accessors
Open

crei wants to merge 1 commit into
mainfrom
crei/encoding_accessors

Conversation

@crei

@crei crei commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Proves the complexities of various functions related to the default encodings (List, Prod, Sum, Sigma, Nat, including the binary successor). The main technical addition is a combinator that applies a subsequential transducer to the output of a Turing machine. This allows us to easily derive the complexity of functions with slightly different encodings. This gives rise to the notion of Realizes: A notion that allows us to exchange the encoding of a complexity result.

AI was used to design this PR but all docstrings were rewritten or at least verified.

the code of every `a` to the code of `f a`. The complexity of `f` relative to these encodings is
then the complexity of `g`. This is the notion of a realizer from computable analysis
[Weihrauch2000], for the special case that every value has exactly one name. -/
def Realizes (g : List Bool → List Bool) (f : α → β) (encIn : α ↪ List Bool)

@barni120400 barni120400 Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When \alpha and \beta are the same type and the encodings are the same, it's exactly Function.Semiconj.
An example for this case is encNat.
I think we should use this equivalence in such cases to gain the mathlib API

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I see the relation to Function.Semiconj but don't understand what you mean after that.

@crei
crei changed the base branch from crei/default_encodings to main November 26, 2026 12:37
@crei
crei force-pushed the crei/encoding_accessors branch 2 times, most recently from 98402ea to 3a754d7 Compare November 26, 2026 13:50
@crei crei changed the title Complexity of accessors and constructors of the default encodings. feat(MultiTapeTM): Complexity of accessors and constructors of the default encodings Nov 29, 2026
@crei
crei force-pushed the crei/encoding_accessors branch from 676c205 to e0150a3 Compare November 30, 2026 11:04
…default encodings

Show that the accessors and constructors of the default encodings of
pairs, sums, options, lists and natural numbers are computable by
multi-tape Turing machines in linear time and without additional work
space.

The generic combinator `transduceOutput` runs a machine and pipes its
output through a subsequential transducer. The result that delimiting
the output costs time `2 * t + 1` is derived from it.
@crei
crei force-pushed the crei/encoding_accessors branch from e0150a3 to 0899588 Compare November 30, 2026 11:31
@crei
crei marked this pull request as ready for review November 30, 2026 11:35
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.

2 participants