Skip to content

Conversation

@BoltonBailey
Copy link
Contributor

@BoltonBailey BoltonBailey commented Oct 15, 2025

This PR implements #676: The P vs NP problem.

I have tried to keep the definitions as simple as possible to avoid misstatements. This PR defines:

  • Decision problems as functions from Lists of Bools to Bool
  • Complexity classes as sets of decision problems
  • P as the class of decision problems computable with TM2ComputableInPolyTime using a generic encoding for List Bool
  • NP using an adaptation of the definition in Arora-Barak.

As a bonus, this includes a definition of co-NP and the NP vs co-NP conjecture.

@BoltonBailey BoltonBailey marked this pull request as ready for review November 15, 2025 19:37
@BoltonBailey
Copy link
Contributor Author

Also, be advised, I took some of the code around the encodings of lists from an old Zulip thread discussing this problem, I am not sure if the person who wrote that has gone through the CLA process - should I try to get permission from them or rewrite that part of the code?

@mo271
Copy link
Collaborator

mo271 commented Nov 15, 2025

Also, be advised, I took some of the code around the encodings of lists from an old Zulip thread discussing this problem, I am not sure if the person who wrote that has gone through the CLA process - should I try to get permission from them or rewrite that part of the code?

If you think they contributed substantially, perhaps it would be good to add them as co-author by amending one of the commits with something like Co-authored-by: Foo Bar <[email protected]>. This will make the CLA bot pick it up, I suppose. But of course this is a question of your judgment on how substantial their contribution was.

Definitely nice that you link the zulip discussion in the code!

@BoltonBailey
Copy link
Contributor Author

BoltonBailey commented Nov 15, 2025

I was able to replace Daniel Weber's encodings with a more compact implementation, perhaps we can revisit it if we want a more general implementation in the future, but for now it should be fine.

mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Nov 20, 2025
This PR adds a lemma for `splitOnP`, allowing expressions where a `splitOnP` on a concatenation to be better simplified. Also golfs a relevant consequence with the new lemma.

Related to google-deepmind/formal-conjectures#1120
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Nov 20, 2025
Adds a simp lemma that allows this expression to be simplified, even if it isn't applied to an argument.

Identified in google-deepmind/formal-conjectures#1120
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