Lax51.TuringPolytime
Polynomial-time computation by a Turing machine
concepts/Lax51/TuringPolytime.lean · lax-51
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
Definition
A total function from finite lists of natural numbers to finite lists of natural numbers is Turing-computable in polynomial time when a finite multi-tape Turing machine transforms the canonical binary encoding of every input into the canonical binary encoding of its value within a polynomial number of steps in the encoded input length.
The underlying machine and time bound are mathlib's : a bundled finite multi-stack Turing machine and a polynomial over the natural numbers. Taking forgets the computational content of the bundle and retains the proposition that such a machine exists.
Lean source view on GitHub
| 1 | import Lax51.BinaryWordEncoding |
| 2 | import Mathlib.Computability.TuringMachine.Computable |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Polynomial-time computation by a Turing machine |
| 7 | type: definition |
| 8 | --- |
| 9 | A total function from finite lists of natural numbers to finite lists of |
| 10 | natural numbers is Turing-computable in polynomial time when a finite |
| 11 | multi-tape Turing machine transforms the canonical binary encoding of every |
| 12 | input into the canonical binary encoding of its value within a polynomial |
| 13 | number of steps in the encoded input length. |
| 14 | |
| 15 | The underlying machine and time bound are mathlib's |
| 16 | `Turing.TM2ComputableInPolyTime`: a bundled finite multi-stack Turing machine |
| 17 | and a polynomial over the natural numbers. Taking `Nonempty` forgets the |
| 18 | computational content of the bundle and retains the proposition that such a |
| 19 | machine exists. |
| 20 | -/ |
| 21 | |
| 22 | namespace Lax51.TuringPolytime |
| 23 | |
| 24 | open Lax51.BinaryWordEncoding |
| 25 | |
| 26 | /-- Polynomial-time computation, on the canonical binary word encoding, by |
| 27 | a finite multi-tape Turing machine. -/ |
| 28 | def TuringPolytime (f : List ℕ → List ℕ) : Prop := |
| 29 | Nonempty (Turing.TM2ComputableInPolyTime encode encode f) |
| 30 | |
| 31 | end Lax51.TuringPolytime |
| 32 |
Builds on
From Mathlib
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments