Documentation

CslibFrontier.Computability.PCP.Encoded.DegreeReduction

Executable degree reduction #

The executable construction uses every half-edge as a vertex. Each has one original edge-link and one cloud-link for every label of a fixed enumerated graph family. Original constraints retain their orientation; cloud-links use equality. The program is polynomial-time given one uniform certificate for the numerical cloud rotation.

Main definitions #

Main results #

References #

Consecutive vertex identifiers for the two ends of each numbered edge.

Numbering does not identify the two ends of a loop or distinct parallel edges.

theorem Cslib.PCP.Encoded.Graph.halfEdgeNumber_lt {p : ℕ × Bool} {edges : ℕ} (hp : p.1 < edges) :
halfEdgeNumber p < 2 * edges

Existing half-edges receive identifiers below twice the number of edges.

Edge-link labels are none; cloud-link labels are some d.

def Cslib.PCP.Encoded.Graph.degreeReduceEdge {C D : Type} (fallback : C) (rotate : ℕ × ℕ × D → ℕ × D) (g : Graph C) (dart : (ℕ × Bool) × Option D) :

The constraint descriptor is none for equality or some (reverse, original) for an original edge constraint, with its argument order retained.

def Cslib.PCP.Encoded.Graph.degreeReduce {C D : Type} (fallback : C) (rotate : ℕ × ℕ × D → ℕ × D) (labels : List D) (g : Graph C) :

Construct the entire degree-reduced graph as ordinary enumeration followed by mapping.

def Cslib.PCP.Encoded.Graph.degreeReduceEval {C α : Type} [DecidableEq α] (eval : C → α → α → Bool) (constraint : Option (Bool × C)) (a b : α) :

Evaluate an original oriented constraint or a cloud equality constraint.

@[reducible, inline]

Constraint descriptor of a degree-reduced edge (degreeReduceEdge): none, for a cloud equality, is the empty word, and some (reverse, c), for an original constraint c, is true followed by the framed orientation bit reverse and then c encoded by enc, unframed.

Enumerating all darts of degree reduction charges the full output list.

Every output edge is computed uniformly in the input graph and dart.

The whole edge-list construction is uniformly polynomial-time, including all cloud scans, searches, rotation calls, copying, and storage of the resulting graph.

theorem Cslib.PCP.Encoded.Graph.isPolyTime_degreeReduceEval {C α : Type} {enc : C ↪ List Bool} [DecidableEq α] {alphabet : α ↪ List Bool} {eval : C → α → α → Bool} (heval : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : C × α × α) => eval p.1 p.2.1 p.2.2) (Turing.MultiTapeTM.encPair enc (Turing.MultiTapeTM.encPair alphabet alphabet)) Turing.MultiTapeTM.encBool) :

Constraint evaluation remains polynomial-time, with equality implemented by comparison of encoded labels.

theorem Cslib.PCP.Encoded.Graph.length_edges_degreeReduce {C D : Type} (fallback : C) (rotate : ℕ × ℕ × D → ℕ × D) (labels : List D) (g : Graph C) :
(degreeReduce fallback rotate labels g).edges.length = 2 * g.edges.length * (1 + labels.length)

A degree-reduced edge list has the expected number of darts.

@[simp]
theorem Cslib.PCP.Encoded.Graph.mem_degreeReduceDarts_iff {C D : Type} (g : Graph C) (labels : List D) (p : (ℕ × Bool) × Option D) :
p ∈ g.degreeReduceDarts labels ↔ p.1.1 < g.edges.length ∧ (p.2 = none ∨ ∃ d ∈ labels, p.2 = some d)

Every enumerated dart comes from an existing original edge and a listed label.

theorem Cslib.PCP.Encoded.Graph.nodup_degreeReduceDarts {C D : Type} (g : Graph C) (labels : List D) (hlabels : labels.Nodup) :

Enumerating distinct labels gives one occurrence of every dart.

def Cslib.PCP.Encoded.Graph.numberDart {D : Type} {edges : ℕ} (p : (Fin edges × Bool) × (Unit ⊕ D)) :

Forget the finite index proofs in a mathematical degree-reduction dart.

def Cslib.PCP.Encoded.Graph.degreeReduceEnumeration {C D : Type} [DecidableEq D] (g : Graph C) (fallback : C) (rotate : ℕ × ℕ × D → ℕ × D) (labels : List D) (hlabels : labels.Nodup) (hmem : ∀ (d : D), d ∈ labels) :
(degreeReduce fallback rotate labels g).edges.Enumeration fun (p : (Fin g.edges.length × Bool) × (Unit ⊕ D)) => degreeReduceEdge fallback rotate g (numberDart p)

The ordered output occurrences are indexed by the mathematical degree-reduction darts. The original edge precedes the cloud edges at each half-edge.

@[simp]
theorem Cslib.PCP.Encoded.Graph.src_degreeReduceEdge {C D : Type} (fallback : C) (rotate : ℕ × ℕ × D → ℕ × D) (g : Graph C) (p : (ℕ × Bool) × Option D) :
(degreeReduceEdge fallback rotate g p).src = halfEdgeNumber p.1

The computed source is the numbered source half-edge.

theorem Cslib.PCP.Encoded.Graph.toGraph_degreeReduce {C α D : Type} (g : Graph C) (eval : C → α → α → Bool) (fallback : C) (family : (n : ℕ) → RotationMap (Fin n) D) (rotate : ℕ × ℕ × D → ℕ × D) (hrotate : ∀ (n : ℕ) (v : Fin n) (d : D), rotate (n, ↑v, d) = (↑((family n).rot (v, d)).1, ((family n).rot (v, d)).2)) [DecidableEq α] [DecidableEq D] (labels : List D) (hlabels : labels.Nodup) (hmem : ∀ (d : D), d ∈ labels) :
(degreeReduce fallback rotate labels g).toGraph (degreeReduceEval eval) = (((g.toGraph eval).degreeReduce (g.cloudFamily eval fallback family)).toConstraintGraph.map fun (p : Fin g.edges.length × Bool) => halfEdgeNumber (↑p.1, p.2)).comap ⇑(g.degreeReduceEnumeration fallback rotate labels hlabels hmem).equiv

The complete edge-list program is the existing degree reduction, with explicitly numbered vertices and the proved enumeration of its darts.

theorem Cslib.PCP.Encoded.Graph.wellFormed_degreeReduce {C D : Type} (g : Graph C) (fallback : C) (family : (n : ℕ) → RotationMap (Fin n) D) (rotate : ℕ × ℕ × D → ℕ × D) (hrotate : ∀ (n : ℕ) (v : Fin n) (d : D), rotate (n, ↑v, d) = (↑((family n).rot (v, d)).1, ((family n).rot (v, d)).2)) (labels : List D) :
(degreeReduce fallback rotate labels g).WellFormed

Every generated endpoint is in the output vertex range. The original graph's declared vertex bound is irrelevant, because its edges themselves index the new vertices.

Restricting half-edge numbering to existing edges is still injective.

theorem Cslib.PCP.Encoded.Graph.unsatVal_degreeReduce {C α D : Type} (g : Graph C) (eval : C → α → α → Bool) (fallback : C) (family : (n : ℕ) → RotationMap (Fin n) D) (rotate : ℕ × ℕ × D → ℕ × D) (hrotate : ∀ (n : ℕ) (v : Fin n) (d : D), rotate (n, ↑v, d) = (↑((family n).rot (v, d)).1, ((family n).rot (v, d)).2)) [DecidableEq α] [Nonempty α] [Fintype D] (labels : List D) (hlabels : labels.Nodup) (hmem : ∀ (d : D), d ∈ labels) :
((degreeReduce fallback rotate labels g).toGraph (degreeReduceEval eval)).unsatVal = ((g.toGraph eval).degreeReduce (g.cloudFamily eval fallback family)).toConstraintGraph.unsatVal

The executable output has exactly the value of the mathematical degree reduction.

theorem Cslib.PCP.Encoded.Graph.satisfiable_degreeReduce_iff {C α D : Type} (g : Graph C) (eval : C → α → α → Bool) (fallback : C) (family : (n : ℕ) → RotationMap (Fin n) D) (rotate : ℕ × ℕ × D → ℕ × D) (hrotate : ∀ (n : ℕ) (v : Fin n) (d : D), rotate (n, ↑v, d) = (↑((family n).rot (v, d)).1, ((family n).rot (v, d)).2)) [DecidableEq α] [Nonempty α] (labels : List D) (hlabels : labels.Nodup) (hmem : ∀ (d : D), d ∈ labels) :
((degreeReduce fallback rotate labels g).toGraph (degreeReduceEval eval)).Satisfiable ↔ ((g.toGraph eval).degreeReduce (g.cloudFamily eval fallback family)).toConstraintGraph.Satisfiable

The executable output has exactly the satisfiability of the mathematical degree reduction.

theorem Cslib.PCP.Encoded.Graph.le_unsatVal_degreeReduce {C α D : Type} (g : Graph C) (eval : C → α → α → Bool) (fallback : C) (family : (n : ℕ) → RotationMap (Fin n) D) (rotate : ℕ × ℕ × D → ℕ × D) (hrotate : ∀ (n : ℕ) (v : Fin n) (d : D), rotate (n, ↑v, d) = (↑((family n).rot (v, d)).1, ((family n).rot (v, d)).2)) [DecidableEq α] [Nonempty α] [Fintype D] (labels : List D) (hlabels : labels.Nodup) (hmem : ∀ (d : D), d ∈ labels) (μ : ℝ) (hgap : ∀ (n : ℕ), (family n).spectralExpansion ≤ μ) :
min 1 ((1 - μ) * ↑(Fintype.card D)) / (2 * (1 + ↑(Fintype.card D))) * (g.toGraph eval).unsatVal ≤ ((degreeReduce fallback rotate labels g).toGraph (degreeReduceEval eval)).unsatVal

The uniform spectral bound transfers through the computed cloud enumeration, so the existing Dinur degree-reduction gap estimate applies to the executable graph.

theorem Cslib.PCP.Encoded.Graph.one_add_card_mul_unsatVal_degreeReduce_le {C α D : Type} (g : Graph C) (eval : C → α → α → Bool) (fallback : C) (family : (n : ℕ) → RotationMap (Fin n) D) (rotate : ℕ × ℕ × D → ℕ × D) (hrotate : ∀ (n : ℕ) (v : Fin n) (d : D), rotate (n, ↑v, d) = (↑((family n).rot (v, d)).1, ((family n).rot (v, d)).2)) [DecidableEq α] [Nonempty α] [Fintype D] (labels : List D) (hlabels : labels.Nodup) (hmem : ∀ (d : D), d ∈ labels) :
(1 + ↑(Fintype.card D)) * ((degreeReduce fallback rotate labels g).toGraph (degreeReduceEval eval)).unsatVal ≤ (g.toGraph eval).unsatVal

Degree reduction does not increase the number of violations after normalizing by its degree.