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

Complexity Theory #11046

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open

Complexity Theory #11046

wants to merge 45 commits into from

Conversation

BoltonBailey
Copy link
Collaborator

@BoltonBailey BoltonBailey commented Dec 25, 2021

A definition of mu-recursive functions (currently on the naturals). It's my hope that this can be the start of computational complexity in mathlib. Anyone who is interested in seeing complexity theory happen should feel welcome to contribute.

Here are a few potential TODOs:

  • Create a mapping from mu_recursive, which describes algorithms, to the functions those algorithms compute. Edit: as gebner commented, this already exists in nat.partrec_code.
  • Define a non-computable partial function to return the time a particular function takes on a particular input / a proposition to say that a particular function on a particular input terminates in a particular amount of time.
  • Prove useful lemmas for managing statements about time complexity.
  • mu-recursive functions are currently from tuples of naturals to naturals. Is there a convenient way of extending this to functions from lists of arbitrary symbols? Note: we are now working with lists of naturals instead.

Open in Gitpod

@BoltonBailey BoltonBailey added the WIP Work in progress label Dec 25, 2021
@gebner
Copy link
Member

gebner commented Dec 27, 2021

We already have (essentially) this definition, it's called nat.partrec.code.

Create a mapping from mu_recursive, which describes algorithms, to the functions those algorithms compute.

This is the nat.partrec.code.eval function.

@BoltonBailey
Copy link
Collaborator Author

We already have (essentially) this definition, it's called nat.partrec.code.

Create a mapping from mu_recursive, which describes algorithms, to the functions those algorithms compute.

This is the nat.partrec.code.eval function.

I like that this version has explicit arity, but perhaps it's better not to reinvent the wheel too much. I'm changing the title of this PR to make it more broadly complexity-theory focused.

@BoltonBailey BoltonBailey changed the title feat(complexity_theory/mu_recursive): define mu-recursive functions Complexity Theory Jan 4, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Feb 6, 2022
bors bot pushed a commit that referenced this pull request Feb 10, 2022
Add common instances for `part \alpha` to be inherited from `\alpha`. Spun off of #11046



Co-authored-by: YaelDillies <yael.dillies@gmail.com>
@leanprover-community-bot-assistant leanprover-community-bot-assistant added merge-conflict Please `git merge origin/master` then a bot will remove this label. and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Feb 10, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Feb 16, 2022
@leanprover-community-bot-assistant
Copy link
Collaborator

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 16, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 17, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 23, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 4, 2022
@BoltonBailey
Copy link
Collaborator Author

See discussion here this might not work.

@prakol16
Copy link
Collaborator

prakol16 commented Apr 3, 2022

@BoltonBailey
I've implemented this using a new definition of code here:
https://github.com/prakol16/lean_complexity_theory_polytime_defs/tree/main/src

Should I use this PR to try to merge them or do you want me to make a new one?

@BoltonBailey
Copy link
Collaborator Author

@prakol16
Seeing as how you're using a different code definition I would suggest making a new PR or PRs. Feel free to reuse any of the code here if it's useful there. I may end up eventually closing this PR without merging.

@semorrison semorrison added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
too-late This PR was ready too late for inclusion in mathlib3 WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants