Independent Set with a supplied 4-sequence
Lax956329.Instances · concepts/Lax956329/Instances.lean · lax-956329
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
An instance consists of a numbered simple graph, a contraction sequence with red degree at most , and a positive integer . 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
Lean source view on GitHub
| 1 | import Lax228581.TwinWidth |
| 2 | import Lax429075.Encoding |
| 3 | import Lax434930.NondeterministicPolynomialTime |
| 4 | import Mathlib.Combinatorics.SimpleGraph.Clique |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Independent Set with a supplied 4-sequence |
| 9 | type: definition |
| 10 | --- |
| 11 | An instance consists of a numbered simple graph, a contraction sequence with red degree |
| 12 | at most , and a positive integer . The binary input contains the adjacency matrix |
| 13 | and the equivalence matrix of every partition, including the singleton partition. |
| 14 | A promise reduction must write the sequence on every input. |
| 15 | -/ |
| 16 | |
| 17 | namespace Lax956329.Instances |
| 18 | |
| 19 | open Lax228581.TwinWidth Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime |
| 20 | |
| 21 | structure Graph where |
| 22 | n : ℕ |
| 23 | graph : SimpleGraph (Fin n) |
| 24 | |
| 25 | def DegreeLE {V : Type} (G : SimpleGraph V) (d : ℕ) : Prop := |
| 26 | ∀ v, (G.neighborSet v).ncard ≤ d |
| 27 | |
| 28 | abbrev Poly (f : Word → Word) := Nonempty (Turing.TM2ComputableInPolyTime id id f) |
| 29 | |
| 30 | abbrev numeral := Lax429075.Encoding.encodeNat |
| 31 | |
| 32 | noncomputable 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 | |
| 36 | noncomputable def Graph.bits (H : Graph) : Word := |
| 37 | numeral H.n ++ matrix H.n H.graph.Adj |
| 38 | |
| 39 | structure Instance extends Graph where |
| 40 | sequence : PartitionSequence graph 4 |
| 41 | k : ℕ |
| 42 | positive : 0 < k |
| 43 | |
| 44 | noncomputable 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. -/ |
| 50 | def 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 | |
| 54 | end Lax956329.Instances |
| 55 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments