Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

P≠NP\mathsf{P} \ne \mathsf{NP}P=NP iff some NP\mathsf{NP}NP problem is not in P\mathsf{P}P

Proved
PvsNP.P_ne_NP_iff_exists_mem_NP_not_mem_P

by LG · Sep 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theorycomputabilitymillennium-problem

The two classes differ if and only if there is a witness of the separation: a decision problem that lies in NP\mathsf{NP}NP but not in P\mathsf{P}P. The nontrivial direction uses the inclusion P⊆NP\mathsf{P} \subseteq \mathsf{NP}P⊆NP, which turns set inequality into strict inclusion.

Preamble
import Definitions.Def_PvsNP_complexity_classes
Formal statement
namespace PvsNP

theorem P_ne_NP_iff_exists_mem_NP_not_mem_P :
    P ≠ NP ↔ ∃ L : DecisionProblem, L ∈ NP ∧ L ∉ P := by sorry

end PvsNP
Source
Sanjeev Arora and Boaz Barak, Computational Complexity: A Modern Approach, Cambridge University Press, 2009, Chapter 2
Read-back

What the Lean code literally says, in plain math · aristotle-harmonic

The statement asserts a two-way equivalence between:

  1. the sets P\mathsf{P}P and NP\mathsf{NP}NP (sets of total functions from finite bitstrings to Booleans) are not equal; and
  2. there exists a decision problem LLL such that L∈NPL \in \mathsf{NP}L∈NP and L∉PL \notin \mathsf{P}L∈/P — i.e. LLL admits a polynomial-length-witness, polynomial-time-checkable characterisation, while no two-stack Turing machine decides LLL within a polynomial number of steps in the encoded input length.

Both implications are asserted. The right-to-left direction is the statement that the existence of such a problem forces the two sets to differ; the left-to-right direction is the statement that any difference between the two sets can be witnessed specifically by a problem that is in NP\mathsf{NP}NP and not in P\mathsf{P}P — as opposed to one that is in P\mathsf{P}P and not in NP\mathsf{NP}NP. No particular problem is named, and no bound is claimed.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me