Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(computability/tm_to_partrec): partrec functions are TM-computable #2792

Closed
wants to merge 6 commits into from

Conversation

digama0
Copy link
Member

@digama0 digama0 commented May 24, 2020

A construction of a Turing machine that can evaluate any partial recursive function. This PR contains the bulk of the work but the end to end theorem (which asserts that any computable function can be evaluated by a Turing machine) has not yet been stated.

@digama0 digama0 added the WIP Work in progress label May 24, 2020
@bryangingechen
Copy link
Collaborator

Zulip thread

src/computability/turing_machine.lean Outdated Show resolved Hide resolved

namespace to_partrec

inductive code
Copy link
Member

Choose a reason for hiding this comment

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

How is this related to partrec_code?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is similar in spirit, being a data type that mirrors the construction of partrec, but the basis here is different, using operations on list nat instead of nat -> nat as in partrec or vector nat n -> nat as in partrec'.

Copy link
Member

Choose a reason for hiding this comment

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

What I actually wanted to ask is whether we should merge the two codes. The difference in denotation (list/vector) shouldn't matter for the codes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see. We could push this modification of the basis up, it is true, although the proof of exists_code relies on partrec', which is a different simplification of the basis used in nat.partrec.code (so there are actually three different bases here: the one on nat ->. nat, vector nat n ->. nat and list nat ->. nat). It's not just that the denotations are different, the basic operations show some awareness of the base type: the nat -> nat version contains functions left, right, pair using the cantor pairing function, the vector -> nat version uses an n-ary composition operation, and this version uses list functions like head and cons. They are all equivalent, of course, but the point of having distinct inductives is so that we can formally state this equivalence and get a usable resulting theorem.

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok, this makes sense.

src/computability/tm_to_partrec.lean Outdated Show resolved Hide resolved
src/computability/tm_to_partrec.lean Outdated Show resolved Hide resolved
src/computability/tm_to_partrec.lean Outdated Show resolved Hide resolved
src/computability/tm_to_partrec.lean Show resolved Hide resolved
@digama0 digama0 removed the WIP Work in progress label May 26, 2020
@digama0 digama0 changed the title [WIP] feat(computability/tm_to_partrec): partrec functions are TM-computable feat(computability/tm_to_partrec): partrec functions are TM-computable May 26, 2020
@bryangingechen bryangingechen added the awaiting-review The author would like community review of the PR label May 26, 2020
@robertylewis
Copy link
Member

The changes outside of the main file look fine to me, and the docs in the main file look very nice. I didn't carefully look through the details of the formalization. @digama0 do you have more changes planned or are you happy with the current state?

@gebner
Copy link
Member

gebner commented May 26, 2020

@robertylewis The local attribute [simp] all over the place needs to be fixed. Either it's not necessary or it's hiding a major issue somewhere.

@digama0
Copy link
Member Author

digama0 commented May 26, 2020

Okay, I think I've addressed everything, and I'm happy to see this merged whenever.

@gebner
Copy link
Member

gebner commented May 27, 2020

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels May 27, 2020
bors bot pushed a commit that referenced this pull request May 27, 2020
#2792)

A construction of a Turing machine that can evaluate any partial recursive function. This PR contains the bulk of the work but the end to end theorem (which asserts that any `computable` function can be evaluated by a Turing machine) has not yet been stated.
@bors
Copy link

bors bot commented May 27, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(computability/tm_to_partrec): partrec functions are TM-computable [Merged by Bors] - feat(computability/tm_to_partrec): partrec functions are TM-computable May 27, 2020
@bors bors bot closed this May 27, 2020
@bors bors bot deleted the tm_partrec branch May 27, 2020 10:38
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
leanprover-community#2792)

A construction of a Turing machine that can evaluate any partial recursive function. This PR contains the bulk of the work but the end to end theorem (which asserts that any `computable` function can be evaluated by a Turing machine) has not yet been stated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants