Minimum Coloring with a witnessing 2-sequence

Lax528502.ColoringInstances · concepts/Lax528502/ColoringInstances.lean · lax-528502

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

    An instance consists of a graph GG, a positive integer kk, and a valid 22-sequence of GG. It is accepted if GG has a proper kk-coloring. The binary language contains exactly the encodings of accepted instances. The promise consists of the encodings of all instances, including negative ones.

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

    Lean source view on GitHub

    1import Lax528502.ContractionInput
    2import Lax434930.PolynomialTime
    3import Lax759944.BinaryWordEncoding
    4import Mathlib.Combinatorics.SimpleGraph.Coloring.Vertex
    5
    6/-!
    7---
    8title: Minimum Coloring with a witnessing 2-sequence
    9type: definition
    10---
    11An instance consists of a graph GG, a positive integer kk, and a valid
    1222-sequence of GG. It is accepted if GG has a proper kk-coloring.
    13The binary language contains exactly the encodings of accepted instances.
    14The promise consists of the encodings of all instances, including negative ones.
    15-/
    16
    17namespace Lax528502.ColoringInstances
    18
    19open Lax228581.TwinWidth Lax434930.PolynomialTime Lax759944.BinaryWordEncoding
    20
    21/-- Write the RAM binary encoding over 2 symbols. A separator is 1, a zero
    22digit is 00, and a one digit is 01. These codewords form a prefix code. -/
    23def binary (words : List ℕ) : Word :=
    24 (encode words).flatMap fun s => match s with
    25 | .separator => [true]
    26 | .zero => [false, false]
    27 | .one => [false, true]
    28
    29/-- A graph, a witnessing 2-sequence, and the positive number of colors supplied as input. -/
    30structure Instance where
    31 n : ℕ
    32 graph : SimpleGraph (Fin n)
    33 sequence : PartitionSequence graph 2
    34 colors : ℕ
    35 positive : 0 < colors
    36
    37noncomputable def Instance.words (I : Instance) : List ℕ :=
    38 I.colors :: ContractionInput.encode (Equiv.refl _) I.graph I.sequence
    39
    40noncomputable def Instance.bits (I : Instance) : Word := binary I.words
    41
    42/-- Encodings of all valid instances, including graphs that require more colors. -/
    43def validColoringInstances : Language := {w | ∃ I : Instance, I.bits = w}
    44
    45/-- Minimum Coloring with a given 2-sequence and the color bound as part of the input. -/
    46def minimumColoringWithTwoSequence : Language :=
    47 {w | ∃ I : Instance, I.bits = w ∧ I.graph.Colorable I.colors}
    48
    49/-- A polynomial many-one reduction whose output satisfies the promise on every input. -/
    50def PolynomialManyOneReduction (source target : Language) (withOutputsIn : Language) : Prop :=
    51 ∃ f : Word → Word, Nonempty (Turing.TM2ComputableInPolyTime id id f) ∧
    52 ∀ x, f x ∈ withOutputsIn ∧ (x ∈ source ↔ f x ∈ target)
    53
    54/-- The promise language of the coloring verifier. -/
    55abbrev wellFormed := validColoringInstances
    56
    57/-- The target language of the coloring reduction. -/
    58abbrev minimumColoring := minimumColoringWithTwoSequence
    59
    60end Lax528502.ColoringInstances
    61

    Discussion

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

    Loading discussion…