Documentation

CslibFrontier.Computability.PCP.Encoded.Constraints

Changing and tabulating constraint descriptors #

g.mapConstraints f changes the descriptor on every edge while retaining all endpoints and edge indices. At a fixed finite alphabet, g.mapConstraints eval materializes each executable constraint as its complete Boolean table, encoded with encConstraintTable. This returns successive graph transformations to the same descriptor type α → α → Bool.

Tabulation requires an efficient evaluator jointly in the descriptor and both alphabet symbols. The table certificate charges every entry; the alphabet is fixed independently of the input. No decidability or efficiency is inferred for arbitrary proposition-valued constraints.

Main definitions #

Main results #

References #

def Cslib.PCP.Encoded.Graph.mapConstraints {C C' : Type} (f : C → C') (g : Graph C) :

Change each constraint descriptor, preserving the vertex count, edge order, and endpoints.

@[simp]

Applying the identity descriptor map leaves the graph unchanged.

theorem Cslib.PCP.Encoded.Graph.mapConstraints_comp {C C' C'' : Type} (g : Graph C) (f : C → C') (h : C' → C'') :

Successive descriptor changes compose without changing graph indices.

@[simp]

The vertex count is unchanged.

@[simp]

Every original edge produces exactly one new edge.

@[simp]

Changing descriptors preserves exactly the same endpoint bounds.

theorem Cslib.PCP.Encoded.Graph.toGraph_mapConstraints {C C' α : Type} (g : Graph C) (f : C → C') (eval : C' → α → α → Bool) :
(mapConstraints f g).toGraph eval = (g.toGraph fun (c : C) => eval (f c)).comap ⇑(finCongr ⋯)

The new graph interprets each original constraint through the descriptor map. The finite edge-index cast retains its numerical index.

theorem Cslib.PCP.Encoded.Graph.unsatVal_mapConstraints {C C' α : Type} (g : Graph C) (f : C → C') (eval : C' → α → α → Bool) :
((mapConstraints f g).toGraph eval).unsatVal = (g.toGraph fun (c : C) => eval (f c)).unsatVal

Changing descriptor representation preserves the exact constraint-violation value.

theorem Cslib.PCP.Encoded.Graph.satisfiable_mapConstraints_iff {C C' α : Type} (g : Graph C) (f : C → C') (eval : C' → α → α → Bool) :
((mapConstraints f g).toGraph eval).Satisfiable ↔ (g.toGraph fun (c : C) => eval (f c)).Satisfiable

Changing descriptor representation preserves satisfiability.

theorem Cslib.PCP.Encoded.Graph.isPolyTime_mapConstraints {C C' Input : Type} {input : Input ↪ List Bool} {enc : C ↪ List Bool} {enc' : C' ↪ List Bool} {graph : Input → Graph C} {f : C → C'} (hgraph : Turing.MultiTapeTM.ComputableInPolyTime graph input (encoding enc)) (hf : Turing.MultiTapeTM.ComputableInPolyTime f enc enc') :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : Input) => mapConstraints f (graph x)) input (encoding enc')

Changing every descriptor charges the transformation, copying endpoints, and the output list.

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

Materialize every value of an efficiently evaluable constraint at a fixed finite alphabet.

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

A fixed finite alphabet lets an efficient evaluator be materialized as its entire table. The source descriptor may have unbounded encoded size.

Evaluate a stored constraint table at both runtime alphabet symbols.

The full two-dimensional constraint table has bounded encoded size, including its framing.

theorem Cslib.PCP.Encoded.Graph.length_encoding_mapConstraints_le {C C' : Type} {enc : C ↪ List Bool} {enc' : C' ↪ List Bool} (g : Graph C) (f : C → C') (bound : ℕ) (hf : ∀ (c : C), (enc' (f c)).length ≤ (enc c).length + bound) :
((encoding enc') (mapConstraints f g)).length ≤ ((encoding enc) g).length + 2 * g.edges.length * bound

Bounded growth per descriptor gives bounded total encoded growth. Both the inner edge encoding and the outer list framing are charged.

theorem Cslib.PCP.Encoded.Graph.length_encoding_tabulateConstraints_le {C α : Type} {enc : C ↪ List Bool} [Fintype α] (g : Graph C) (eval : C → α → α → Bool) :

Normalization to fixed-alphabet tables adds at most a constant number of bits per edge.