Running time
Lax213208.RunningTime · concepts/Lax213208/RunningTime.lean · lax-213208
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
asserts termination within instructions, where is the binary size of the instance. The bound also supplies a sufficient word width in bits. It says nothing about solution quality.
Polynomial, quasipolynomial, and subexponential time are independent of approximation ratios. Subexponential time means : for every , a bound holds.
Concept map
Lean source view on GitHub
| 1 | import Lax213208.AlgorithmInput |
| 2 | import Lax213208.Programs |
| 3 | import Mathlib.Data.Nat.Log |
| 4 | import Mathlib.Data.Real.Archimedean |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Running time |
| 9 | type: definition |
| 10 | --- |
| 11 | `RunsInTime alg inputs T` asserts termination within instructions, |
| 12 | where is the binary size of the instance. The bound also supplies a |
| 13 | sufficient word width in bits. It says nothing about solution quality. |
| 14 | |
| 15 | Polynomial, quasipolynomial, and subexponential time are independent of |
| 16 | approximation ratios. Subexponential time means : for every |
| 17 | , a bound holds. |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax213208.RunningTime |
| 21 | |
| 22 | open OptimizationProblem AlgorithmInput Programs |
| 23 | |
| 24 | variable {Instance Solution : Type*} {problem : Problem Instance Solution} |
| 25 | |
| 26 | def RunsInTime (alg : Program) (inputs : Set Instance) (time : ℕ → ℕ) |
| 27 | (precision : Option ℕ := none) : Prop := |
| 28 | ∀ x ∈ inputs, ∃ output, |
| 29 | RunsWithin alg (inputTape problem precision x) output (time (inputSize problem x)) |
| 30 | |
| 31 | def PolynomialTime (alg : Program) (inputs : Set Instance) |
| 32 | (precision : Option ℕ := none) : Prop := |
| 33 | ∃ c d : ℕ, 0 < c ∧ 0 < d ∧ |
| 34 | RunsInTime (problem := problem) alg inputs (fun n => c * (n + 2) ^ d) precision |
| 35 | |
| 36 | def QuasipolynomialTime (alg : Program) (inputs : Set Instance) |
| 37 | (precision : Option ℕ := none) : Prop := |
| 38 | ∃ c d : ℕ, 0 < c ∧ 0 < d ∧ |
| 39 | RunsInTime (problem := problem) alg inputs |
| 40 | (fun n => 2 ^ (c * (Nat.log2 (n + 2) + 1) ^ d)) precision |
| 41 | |
| 42 | def SubexponentialTime (alg : Program) (inputs : Set Instance) |
| 43 | (precision : Option ℕ := none) : Prop := |
| 44 | ∀ δ : ℝ, 0 < δ → ∃ c : ℕ, 0 < c ∧ |
| 45 | RunsInTime (problem := problem) alg inputs (fun n => c * 2 ^ ⌈δ * n⌉₊) precision |
| 46 | |
| 47 | end Lax213208.RunningTime |
| 48 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments