While this submission is a draft, it cannot be used by other submissions.

Graphs supplied with a path decomposition

Lax833301.Instances · concepts/Lax833301/Instances.lean · lax-833301

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural 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 pp bounds each bag size by p+1p+1.

    Concept map
    8 concepts; 9 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Lax183560.PathDecomposition
    2import Lax228581.TwinWidth
    3import Lax429075.Encoding
    4import Lax434930.NondeterministicPolynomialTime
    5import Mathlib.Data.Real.Basic
    6
    7/-!
    8---
    9title: Graphs supplied with a path decomposition
    10type: definition
    11---
    12The input contains the adjacency matrix of a numbered simple graph and the
    13incidence matrix of the bags of a path decomposition. Every output of a
    14promise reduction includes the decomposition. The parameter pp bounds each
    15bag size by p+1p+1.
    16-/
    17
    18namespace Lax833301.Instances
    19
    20open Lax183560.PathDecomposition Lax228581.TwinWidth Lax434930.PolynomialTime
    21open Lax434930.NondeterministicPolynomialTime
    22
    23abbrev Poly (f : Word → Word) := Nonempty (Turing.TM2ComputableInPolyTime id id f)
    24
    25structure 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`. -/
    31def SuppliedPathDecompositionHasWidthAtMost (p : ℕ) (input : Input) : Prop :=
    32 ∀ i, (input.path.bag i).card ≤ p + 1
    33
    34abbrev Input.Bounded (J : Input) (p : ℕ) : Prop := SuppliedPathDecompositionHasWidthAtMost p J
    35
    36noncomputable 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
    44noncomputable 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
    47properties `yes` and `no`. Every output includes a decomposition satisfying `onInputs`. -/
    48def 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
    54abbrev GapHard (c : ℝ) (k p : ℕ) : Prop :=
    55 NPHardToDistinguish (SuppliedPathDecompositionHasWidthAtMost p)
    56 (fun G => twinWidth G ≤ k) (fun G => twinWidth G > c * k)
    57
    58end Lax833301.Instances
    59

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…