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

Independent Set with a supplied 4-sequence

Lax956329.Instances · concepts/Lax956329/Instances.lean · lax-956329

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 numbered simple graph, a contraction sequence with red degree at most 44, and a positive integer kk. The binary input contains the adjacency matrix and the equivalence matrix of every partition, including the singleton partition. A promise reduction must write the sequence on every input.

    Concept map
    7 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.

    Lean source view on GitHub

    1import Lax228581.TwinWidth
    2import Lax429075.Encoding
    3import Lax434930.NondeterministicPolynomialTime
    4import Mathlib.Combinatorics.SimpleGraph.Clique
    5
    6/-!
    7---
    8title: Independent Set with a supplied 4-sequence
    9type: definition
    10---
    11An instance consists of a numbered simple graph, a contraction sequence with red degree
    12at most 44, and a positive integer kk. The binary input contains the adjacency matrix
    13and the equivalence matrix of every partition, including the singleton partition.
    14A promise reduction must write the sequence on every input.
    15-/
    16
    17namespace Lax956329.Instances
    18
    19open Lax228581.TwinWidth Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime
    20
    21structure Graph where
    22 n : ℕ
    23 graph : SimpleGraph (Fin n)
    24
    25def DegreeLE {V : Type} (G : SimpleGraph V) (d : ℕ) : Prop :=
    26 ∀ v, (G.neighborSet v).ncard ≤ d
    27
    28abbrev Poly (f : Word → Word) := Nonempty (Turing.TM2ComputableInPolyTime id id f)
    29
    30abbrev numeral := Lax429075.Encoding.encodeNat
    31
    32noncomputable def matrix (n : ℕ) (R : Fin n → Fin n → Prop) : Word := by
    33 classical
    34 exact (List.ofFn fun i => List.ofFn fun j => decide (R i j)).flatten
    35
    36noncomputable def Graph.bits (H : Graph) : Word :=
    37 numeral H.n ++ matrix H.n H.graph.Adj
    38
    39structure Instance extends Graph where
    40 sequence : PartitionSequence graph 4
    41 k : ℕ
    42 positive : 0 < k
    43
    44noncomputable def Instance.bits (I : Instance) : Word :=
    45 numeral I.k ++ I.toGraph.bits ++ numeral I.sequence.stepCount ++
    46 (List.range (I.sequence.stepCount + 1)).flatMap fun j =>
    47 matrix I.n fun u v => ∃ B ∈ I.sequence.partition j, u ∈ B ∧ v ∈ B
    48
    49/-- A deterministic polynomial many-one reduction into the two sides of a promise. -/
    50def Hard (yes no : Instance → Prop) : Prop :=
    51 ∀ A : Language, A ∈ NP → ∃ f : Word → Word, Poly f ∧
    52 ∀ x, ∃ I : Instance, f x = I.bits ∧ (x ∈ A → yes I) ∧ (x ∉ A → no I)
    53
    54end Lax956329.Instances
    55

    Discussion

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

    Loading discussion…