AKS primality test
DefinitionThe primality decision problem#✓fully proved
MetaMathlibExt.Complexity.KeyTheorems.PrimesInP.primesDec
The primality decision problem is the decision problem that accepts a bitstring \(x\) exactly when decoding \(x\) with the canonical bitstring encoding of the natural numbers (Mathlib's binary encoding) yields a prime number, and rejects \(x\) otherwise.
noncomputable def primesDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := ℕ) x with
| some n => decide (Nat.Prime n)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
Uses 3 · Used by 1
Statement usesBitstring encodings · Decoding function of a bitstring encoding · Decision problems
Used byPRIMES is in P
TheoremPRIMES is in P#●ready to prove
MetaMathlibExt.Complexity.KeyTheorems.PrimesInP.primes_in_P
The primality decision problem, which accepts a bitstring exactly when it decodes to a prime number under the canonical bitstring encoding of the natural numbers, belongs to the complexity class P.
public theorem_wanted primes_in_P :
primesDec ∈ MetaMathlibExt.ComplexityTheory.P
noncomputable def primesDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := ℕ) x with
| some n => decide (Nat.Prime n)
| none => false
WantedExt/Complexity/KeyTheorems/PrimesInPWanted.lean:42
def P : DecisionComplexityClass :=
{ L | IsPolyTime L }
MathlibExt/Computability/Complexity.lean:194
Sources
Sources
- M. Agrawal, N. Kayal, and N. Saxena, "PRIMES is in P", Annals of Mathematics 160 (2004), 781-793.
Uses 4
Statement usesThe primality decision problem · Complexity classes · Decision problems · The complexity class P
1 fully proved1 ready to prove
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.