Composition of polynomial-time algorithms
Lax218471.Combinators · concepts/Lax218471/Combinators.lean · lax-218471
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
Encoded polynomial-time functions can be used through their existential machine witnesses. Their outputs have polynomially bounded encoded size, and composition preserves polynomial time. All size measures refer to the specified encodings; the intermediate encoding is shared by both algorithms.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Lax218471.PolynomialTime |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Composition of polynomial-time algorithms |
| 6 | type: theorem |
| 7 | --- |
| 8 | Encoded polynomial-time functions can be used through their existential |
| 9 | machine witnesses. Their outputs have polynomially bounded encoded size, |
| 10 | and composition preserves polynomial time. All size measures refer to the |
| 11 | specified encodings; the intermediate encoding is shared by both algorithms. |
| 12 | -/ |
| 13 | |
| 14 | namespace Lax218471.Combinators |
| 15 | |
| 16 | open PolynomialTime |
| 17 | |
| 18 | /-- Every polynomial-time function has polynomially bounded output size. -/ |
| 19 | axiom output_size {α β A B : Type} {ea : α → List A} {eb : β → List B} {f : α → β} |
| 20 | (h : Polytime ea eb f) : |
| 21 | ∃ p : Polynomial ℕ, ∀ a, (eb (f a)).length ≤ p.eval (ea a).length |
| 22 | |
| 23 | /-- An existential polynomial-time algorithm realizes its encoded contract. -/ |
| 24 | axiom graph_realizable {α β A : Type} {ea : α → List A} {eb : β → List A} {f : α → β} |
| 25 | (h : Polytime ea eb f) : Nonempty (Implementation (Graph ea eb f)) |
| 26 | |
| 27 | /-- Sequential composition of algorithms supplied only by existence statements. -/ |
| 28 | axiom comp {α β γ A : Type} [Fintype A] [Inhabited A] |
| 29 | {ea : α → List A} {eb : β → List A} {ec : γ → List A} |
| 30 | {f : α → β} {g : β → γ} (hf : Polytime ea eb f) (hg : Polytime eb ec g) : |
| 31 | Polytime ea ec (g ∘ f) |
| 32 | |
| 33 | end Lax218471.Combinators |
| 34 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments