Graphs supplied with a path decomposition
Lax833301.Instances · concepts/Lax833301/Instances.lean · lax-833301
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The input contains the adjacency matrix of a numbered simple graph and the incidence matrix of the bags of a path decomposition. Every output of a promise reduction includes the decomposition. The parameter bounds each bag size by .
Concept map
Lean source view on GitHub
| 1 | import Lax183560.PathDecomposition |
| 2 | import Lax228581.TwinWidth |
| 3 | import Lax429075.Encoding |
| 4 | import Lax434930.NondeterministicPolynomialTime |
| 5 | import Mathlib.Data.Real.Basic |
| 6 | |
| 7 | /-! |
| 8 | --- |
| 9 | title: Graphs supplied with a path decomposition |
| 10 | type: definition |
| 11 | --- |
| 12 | The input contains the adjacency matrix of a numbered simple graph and the |
| 13 | incidence matrix of the bags of a path decomposition. Every output of a |
| 14 | promise reduction includes the decomposition. The parameter bounds each |
| 15 | bag size by . |
| 16 | -/ |
| 17 | |
| 18 | namespace Lax833301.Instances |
| 19 | |
| 20 | open Lax183560.PathDecomposition Lax228581.TwinWidth Lax434930.PolynomialTime |
| 21 | open Lax434930.NondeterministicPolynomialTime |
| 22 | |
| 23 | abbrev Poly (f : Word → Word) := Nonempty (Turing.TM2ComputableInPolyTime id id f) |
| 24 | |
| 25 | structure Input where |
| 26 | n : ℕ |
| 27 | graph : SimpleGraph (Fin n) |
| 28 | path : PathDecomposition graph |
| 29 | |
| 30 | /-- The path decomposition supplied with the input has width at most `p`. -/ |
| 31 | def SuppliedPathDecompositionHasWidthAtMost (p : ℕ) (input : Input) : Prop := |
| 32 | ∀ i, (input.path.bag i).card ≤ p + 1 |
| 33 | |
| 34 | abbrev Input.Bounded (J : Input) (p : ℕ) : Prop := SuppliedPathDecompositionHasWidthAtMost p J |
| 35 | |
| 36 | noncomputable def encode {n : ℕ} (G : SimpleGraph (Fin n)) (m : ℕ) |
| 37 | (bags : Fin m → Finset (Fin n)) : Word := by |
| 38 | classical |
| 39 | exact Lax429075.Encoding.encodeNat n ++ |
| 40 | (List.ofFn fun i => List.ofFn fun j => decide (G.Adj i j)).flatten ++ |
| 41 | Lax429075.Encoding.encodeNat m ++ |
| 42 | (List.ofFn fun i => List.ofFn fun v : Fin n => decide (v ∈ bags i)).flatten |
| 43 | |
| 44 | noncomputable def Input.bits (J : Input) : Word := encode J.graph J.path.length J.path.bag |
| 45 | |
| 46 | /-- Every language in NP reduces in polynomial time to distinguishing the graph |
| 47 | properties `yes` and `no`. Every output includes a decomposition satisfying `onInputs`. -/ |
| 48 | def NPHardToDistinguish (onInputs : Input → Prop) |
| 49 | (yes no : {n : ℕ} → SimpleGraph (Fin n) → Prop) : Prop := |
| 50 | ∀ A : Language, A ∈ NP → ∃ f : Word → Word, Poly f ∧ |
| 51 | ∀ x, ∃ input : Input, f x = input.bits ∧ onInputs input ∧ |
| 52 | (x ∈ A → yes input.graph) ∧ (x ∉ A → no input.graph) |
| 53 | |
| 54 | abbrev GapHard (c : ℝ) (k p : ℕ) : Prop := |
| 55 | NPHardToDistinguish (SuppliedPathDecompositionHasWidthAtMost p) |
| 56 | (fun G => twinWidth G ≤ k) (fun G => twinWidth G > c * k) |
| 57 | |
| 58 | end Lax833301.Instances |
| 59 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments