Lean 4 and rigorous computer-checked proof assistants exist precisely to remove the subjectivity of human peer review: the kernel checks the code, and the code speaks for itself.
As elaborated below, I personally consider the real capstone to be Rota's Entropy Theorem, formalized here as rota_all_entropy_scaled_shannon, and I also don't believe this is the first proof of P = NP. But, regardless ...
git clone -b feat/information-theory https://github.com/eabadir/EGPT.git
cd EGPT
lake exe cache get
lake build Mathlib.InformationTheory
lake env lean -e '#print axioms Mathlib.InformationTheory.rota_all_entropy_scaled_shannon'
lake env lean -e '#print axioms Mathlib.InformationTheory.P_eq_NP_info'
lake env lean -e '#print axioms Mathlib.InformationTheory.P_eq_NP'
lake env lean -e '#print axioms Mathlib.InformationTheory.P_eq_NP_info_standard'What the code says — no capstone uses sorryAx:
| Capstone | Axioms printed |
|---|---|
P_eq_NP_info |
propext, Quot.sound |
P_eq_NP |
propext, Quot.sound |
P_eq_NP_info_standard |
propext, Quot.sound |
rota_all_entropy_scaled_shannon |
propext, Quot.sound, Classical.choice |
The typical highest standard of build requirement for Lean verification is without sorryAx and without custom axioms — i.e. only dependent on propext, Quot.sound, Classical.choice.
The proofs here meet an even higher standard — they build the whole of number theory from the ground up with no use of Classical.choice except for the return map that proves equivalence to Lean's ℝ.
InformationTheory provides this with constructive EntropyNat ≃ ℕ, EntropyInt ≃ ℤ,
EntropyRat ≃ ℚ, EntropyReal ≃ ℝ.
Eventually, the Lean community will have to answer why this PR was closed by upstream maintainers without review when it clearly not only meets, but exceeds, the most stringent verification standards of Lean. (leanprover-community/mathlib4#37468)
The capstone theorem rota_all_entropy_scaled_shannon in
Mathlib/InformationTheory/EntropyNumber/RotaEntropy.lean formalizes,
for the first time in any proof assistant, Rota's Entropy Theorem —
proved but not published in the manuscript Rota taught 18.313 from.
The supporting uniqueness result lives in
Mathlib/InformationTheory/Entropy/Uniqueness.lean (rota_uniqueness,
rota_uniqueness_formula), and Entropy/Concrete.lean proves Shannon
entropy satisfies all seven Rota axioms.
The original proof is included at the repo root as
Rota_Entropy_Theorem_Original_Proof.pdf (and .tex), with a markdown
translation at RET_Paper.md and an addendum at the
end of this README.
Fork of leanprover-community/mathlib4 proposing a Mathlib.InformationTheory
subtree: 31 files adding entropy axiomatics (Rota's 7 axioms + uniqueness), an
information-theoretic number hierarchy (EntropyNat ≃ ℕ, EntropyInt ≃ ℤ,
EntropyRat ≃ ℚ, EntropyReal ≃ ℝ), three constructive proofs that P = NP,
and entropy proofs for Bose-Einstein, Fermi-Dirac, and Maxwell-Boltzmann
distributions (each = C · Shannon).
Branch: feat/information-theory
License: Apache-2.0 (inherits mathlib)
| New files | 31 under Mathlib/InformationTheory/ |
sorry count |
0 |
Classical.choice |
not used by any capstone |
| External dependencies | none beyond mathlib |
| Build | lake build |
- File:
Mathlib/InformationTheory/Complexity/PPNP.lean - Axioms:
propext,Quot.sound - Construction: Information content of a CNF
φis|φ| · k. A clause-by-clause walk extracts this information inO(n²)steps. The walk record serves as certificate, decision procedure, and entropy extraction. RECT (program complexity = information content) closes the loop.
- File:
Mathlib/InformationTheory/Complexity/SetRFL.lean - Axioms:
propext,Quot.sound - Construction: After
EntropyNat ≃ ℕandSyntacticCNF ≃ EntropyNatunfold,P_defandNP_defare syntactically identical predicates. The proof isSet.ext+Iff.rfl. Also proves Cook-Levin (L_SAT_CanonicalNP-complete) andL_SAT_in_P.
- File:
Mathlib/InformationTheory/Complexity/StandardComplexity.lean - Axioms:
propext,Quot.sound - Construction: Restates Chain 1 using
Language := Set (List Bool)and traditional polynomial-time decision / certificate-bound predicates. - Note: An earlier version of this chain depended on
Classical.choicevialinarithand nonconstructive case analysis. A subsequent refactor replaced those with constructive tactics, eliminating the dependency.
omegain place oflinarithwhere applicable.- Structural list properties (
.length) in place of well-founded recursion. - All bounds proved explicitly in
calcchains.
computeTableau in Complexity/Tableau.lean is fully computable and
extractable via Lean's code generator.
Shannon.lean—H(p) = -Σ pᵢ ln pᵢ, uniform distributions, basic propertiesAxioms.lean— Rota's 7 axioms as structuresUniqueness.lean— Rota-Khinchin: axiom-satisfying functions areC · logConcrete.lean— Shannon satisfies all 7 axioms; Gibbs; chain ruleProgram.lean—Programtype; RECT / IRECT bridgeSourceCoding.lean— SCT / ISCT; IID sources
Basic.lean—EntropyNat ≃ ℕInt.lean—EntropyInt ≃ ℤRat.lean—EntropyRat ≃ ℚReal.lean—EntropyReal ≃ ℝ;|EntropyNat| = ℵ₀,|EntropyReal| = ℶ₁Polynomial.lean— constructive polynomials;IsPolynomial,IsBoundedByPolynomialHierarchy.lean—Nat_L,Real_L,Rat_L; beth-sequence cardinalitiesRotaEntropy.lean— Rota scaling; fair-coin calibration; FTA via informationPrimeAtoms.lean—v_p(m) · log pdecompositionContinuumHypothesis.lean— CH and GCH decidable
Core.lean—PathToConstraint; entropy-number aliasesCNF.lean+CNF/— CNF syntax, encoding, prime-indexed literalsTableau.lean—SatisfyingTableau; clause-by-clause walk;n · kboundDecomposition.lean— assignment-free SAT criterion; prime-factor bridgeUTM.lean— sequentialReadHead; NDM address walk; entropy walkPPNP.lean— Chain 1 capstoneSetRFL.lean— Chain 2 capstoneStandardComplexity.lean— Chain 3 capstone
Common.lean— macrostates;H_physical_systemUniformSystems.lean— occupancy / multiset equivalenceStatisticalDistributions.lean— BE / FD / MB entropies =C · ShannonPhysicsDist.lean— weightedPhysicsDist;StatSystemTypeenum
Basic.lean—ComputerInstruction,ComputerTape, IID sources, random-walk pathsBridge.lean— time = information equivalence; three-layer equivalence
All imports are from mathlib. No external dependencies.
I, Essam Abadir, do not claim to be the first to prove P = NP. At best I am fourth. The first proof I encountered was in 1993 in Gian-Carlo Rota's MIT class 18.313. What this submission contributes is a machine-verified account of why each of the following was already a proof of P = NP:
- von Neumann and Ulam (Los Alamos, 1940s) — Monte Carlo is a working polynomial-time decision procedure over combinatorial state spaces, built from random walks and the cellular automata used to simulate neutron diffusion. The method predates the P vs NP vocabulary but is a P-time solver by construction.
- John Conway (On Numbers and Games, 1976) — Conway's bijection from the surreal numbers to the transcendentals showed that all of standard mathematics was collapsible into the computable discrete behavior of cellular automata. This was bijection, not philosophy.
- Gian-Carlo Rota (18.313, 1970s–90s) — Information is the perfect
recorded history of a particle's movement, where "perfect" means the
fewest bits in an unambiguous code — i.e. a Shannon-optimal coding.
Rota's theorem exposes that Shannon coding is strictly more stringent
than bijection: it requires the least-bits, maximally compressed
representation. Without that compression, syntactic novelty gets
conflated with semantic novelty — precisely the conflation that
Classical.choicepermits, and that every Cantor-style diagonal construction relies on. These constructions fail to respect the Fundamental Theorem of Arithmetic: flipping a digit in a sequence and landing on9does not introduce a new prime because3was already in the alphabet; spelling "cat" as "chat" does not make a new animal. Rota's entropy uniqueness theorem, formalized here inMathlib/InformationTheory/Entropy/Uniqueness.lean, is what makes this stringency machine-checkable. - Essam Abadir (this submission, 2026) — the unification through the
information-theoretic number hierarchy (
EntropyNat ≃ ℕ, …,EntropyReal ≃ ℝ) and theAbadirCompletenessTheoreminMathlib/InformationTheory/EntropyNumber/ContinuumHypothesis.lean. Completeness proves every constructible type has somebeth ncardinality, which is why the Beth staircase is integer-rigid and CH is decidable in this system.
Classical.choice is not load-bearing for any of the three P = NP
capstones. The same is true of the Completeness Theorem: the
decidability of CH arises from the constructive hierarchy itself, not
from choice. CH's independence in ZFC comes from the freedom to
postulate sets without constructive witness — which is precisely what
Classical.choice smuggles in. In a type theory that enumerates its
types, CH is a theorem, and Classical.choice should be treated as a
bug in the standard library rather than an axiom of mathematics, and
expunged wherever possible. A fourth capstone chain formalizing this
claim — that every live use of Classical.choice in mainstream mathlib
admits a constructive replacement — is in development and will be
included before this archive is finalized.
Apache-2.0, matching mathlib.
A Mathematically Precise And Universal Definition of Entropy
Transcribed by Essam Abadir, 2026-04-17.
In memory of Gian-Carlo Rota, April 27, 1932 – April 18, 1999.
The proof of Rota’s Entropy Theorem is, to my mind, the single most important proof of the latter half of the 20th century. It is also, to my knowledge, the only proof of such a major scientific theorem that is not published in any journal or book, but rather exists only in lecture notes and unpublished manuscripts.
The remainder of this section is excerpted from class text provided by Professor Gian-Carlo Rota. To my knowledge it is unpublished and uncopyrighted. "Introduction to Probability Theory, Second Preliminary Edition" manuscript circa 1993, authors are Kenneth Baclawski, Gian-Carlo Rota, & Sara Billis. It is similar to the one on the Internet Archive where the same proof is present, but I have not found this particular version online.
So far, we have discussed examples of the entropy of some random variables. Although these examples provide some motivation for our definition of entropy, they leave unanswered the more difficult question of why, out of all possible definitions, we use this one.
We will do this by finding five self-evident properties that ought to hold for any reasonable measure of information (or entropy). It then turns out that our definition of entropy is the only one that satisfies all these properties.
We begin with the most obvious of properties. As we have defined it,
We summarize the conditions on
An entropy is a function defined on sets
If
In other words,
An entropy function is continuous. The next property of entropy we consider requires the concept of conditional entropy. There are two ways to think of conditional entropy, and the fact that they are equivalent is our next property of entropy. To illustrate the ideas involved, we consider the following simple weighing problem:
We have three coins, some of which may be counterfeit (but not all). Counterfeit coins are distinguishable from normal coins by the fact that they are lighter. We are given a balance scale, and we wish to find out which, if any, of the coins are counterfeit. The sample space for this problem consists of seven sample points, one for each possible set of good coins. We denote them as follows:
Now what happens when we put the first two coins on each side of the scale? The sample space is partitioned into three blocks corresponding to the three possible outcomes of the weighing:
After recording the result of this weighing, we then place the second and third coins on the two sides of the scale. The result of this second weighing is to partition each of the blocks of the first weighing:
The combined information of the two weighings is represented by the partition into seven blocks, each with one sample point. Call this partition
Thus, in the above weighing problem, we have three conditional entropies, one for each possible outcome of the first weighing:
The conditional entropy of
On the other hand, we would like to think of information as a "quantity" that increases as we ask more and more questions about our experiment. Therefore, the conditional entropy of
If
The last property we require is one that we have already discussed. The partition having maximum entropy among all partitions with a given number of blocks is the one for which all the blocks have the same probability.
If
We are now ready for the following remarkable fact: if
If
The proof is rather technical, so we suggest omitting it on the first reading. However, it is of interest to outline the main points. To show that
1. The entropy of the partition consisting of just one block of probability
2. We define a function
Next, we consider a partition
Now fix two positive integers
We now apply the two facts about
Since
Now divide these inequalities by
Now apply the increasing function
It follows that both
Thus, for positive integers
We will define the constant
We next consider a set
By property 4, on the other hand, we have:
Combining the two expressions for
By continuity (property 3),
We leave it as an exercise to show that the above formula for entropy actually satisfies the five postulated properties. We conclude by giving an interpretation of independence of partitions in terms of conditional entropy. Intuitively, if
In terms of conditional entropy, this says that
A consequence of Entropy Property 4 of the last section is that if we wish to answer a question
The problem of finding a set of sufficient statistics for a random variable
One of the reasons that coding is so nontrivial in general is that one is usually required to answer a whole sequence of questions
C. E. Shannon, “A Mathematical Theory of Communication,” Bell System Technical Journal, 27(3), 1948.
C. E. Shannon, “A Symbolic Analysis of Relay and Switching Circuits,” Master’s thesis, MIT, 1937. (Also Transactions of the AIEE, 57(12):713–723, 1938.)
K. Baclawski, G.-C. Rota, and S. Billis, Introduction to Probability Theory, Preliminary Edition, MIT, circa 1979–1993 draft (unpublished).