A constraint graph as a string #
An algorithm that runs Dinur's amplification has to hold a constraint graph in its hand. Over a fixed finite alphabet a graph is a small amount of data: how many vertices, and for each edge its two endpoints and its constraint. The endpoints are numbers below the vertex count, and the constraint — a predicate on two symbols — is itself one of finitely many, so it too is a number.
That is the encoding used here: the vertex count in unary, followed by a list of
records, each three unary numbers. Numbering the constraints rather than
tabulating them keeps every record a triple of numbers, so the whole toolkit of
UnaryList applies; and because the number of constraints is a constant,
reading one back is a lookup on a bounded key.
Main definitions #
Complexity.relOfCode,Complexity.codeOfRel— numbering the constraintsComplexity.encGraph— the graph as a stringComplexity.gVerts,gEdges,gTail,gHead,gCode— reading it back
Main results #
Complexity.gVerts_encGraph,gEdges_encGraph,gTail_encGraph,gHead_encGraph,gRel_encGraph— the reading inverts the writingComplexity.buildGraph_eq,Complexity.buildGraph_mem_FP— a rule for each edge writes the graph, in polynomial time
Numbering the constraints #
The constraint a code stands for; the always-false constraint for a code that is out of range.
Equations
- Complexity.relOfCode α r = if h : r < Fintype.card (α → α → Bool) then (Fintype.equivFin (α → α → Bool)).symm ⟨r, h⟩ else fun (x x_1 : α) => false
Instances For
The code of a constraint.
Equations
- Complexity.codeOfRel f = ↑((Fintype.equivFin (α → α → Bool)) f)
Instances For
The encoding #
One record for each edge: its two endpoints and the code of its constraint.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A constraint graph, as a string.
Equations
Instances For
Reading it back #
How many vertices an encoded graph has.
Equations
Instances For
How many edges.
Equations
Instances For
The first endpoint of an edge.
Equations
- Complexity.gTail z e = (Complexity.recFst (Complexity.pairSnd z) e).length
Instances For
The second endpoint.
Equations
- Complexity.gHead z e = (Complexity.recSnd (Complexity.pairSnd z) e).length
Instances For
The code of the constraint.
Equations
- Complexity.gCode z e = (Complexity.recThd (Complexity.pairSnd z) e).length
Instances For
Writing one out #
A graph assembled from a vertex count, an edge count and a rule for each edge record.
Equations
- Complexity.buildGraph nv cnt E z = Complexity.pair (nv z) (Complexity.listEncFn E (Complexity.pair (cnt z) z))
Instances For
The rule writes the graph.