Vertex Cover from a Hamilton circuit #
The reverse direction of the reduction reads a vertex cover off a Hamilton
circuit of the gadget graph. Its foundation is a precise characterization of the
neighbours of each gadget vertex (DescriptiveComplexity.dgEdge_iff /
DescriptiveComplexity.IAdjRaw).
Structure #
- Neighbour sets. For each gadget vertex, the exact set of its
DescriptiveComplexity.DGEdge-neighbours (by cases on the other vertex's tag, viadgEdge_iff). The internal vertices⟨g1,(a,b)⟩and⟨g4,(a,b)⟩have exactly two neighbours,⟨g0/g2⟩and⟨g3/g5⟩respectively. - Forced edges. In a Hamilton circuit each vertex has exactly two
tour-neighbours, both adjacent to it. So a degree-two vertex uses both its
edges, forcing the paths
g0-g1-g2andg3-g4-g5in every gadget (DescriptiveComplexity.forced_g1,DescriptiveComplexity.forced_g4). - The three traversals. Propagating through
g2,g3(degree three) shows each gadget is traversed through theu-side, thev-side, or both – never neither (which would isolate it as two 6-cycles): every edge has a straight side (DescriptiveComplexity.side_straight). - Chain propagation. A straight side
(b,a)frees the entrance and exit slots of the opposite side(a,b)from the cross edges (DescriptiveComplexity.g0_other/g5_other); the freed slot is a selector at the ends ofa's chain, or a chain-link that straightens the walked side in turn (DescriptiveComplexity.straight_of_chain_down/up). Well-founded induction alonga's neighbour list puts a selector at both chain ends:ais active (DescriptiveComplexity.active_of_straight). - The cover.
C := {a | Active f a}covers every edge (DescriptiveComplexity.cover_property), and|C| ≤ |marked|by the selector-slot injection (DescriptiveComplexity.active_ncard_le).
DescriptiveComplexity.eq_gPt_of_val below reconstructs a vertex from its tag and
coordinates (sidestepping a simp/subtype mismatch), the workhorse of step 1.
A gadget vertex ⟨t,(a,b)⟩ (raw form). Reconstructing a neighbour from its
tag and coordinates uses this together with Subtype.ext.
Dependency graph
Reconstruction: an interpreted vertex with a gadget tag t and
coordinates (a, b) is the gadget vertex gPt t _ h. This is the workhorse of
the neighbour characterizations of step 1 (it sidesteps the subtype/MapRel
definitional mismatch that blocks simp on raw destructured vertices).
Dependency graph
In a cyclic enumeration nextIdx applied twice returns a different index,
as soon as the cycle has length at least three.
Dependency graph
The tour successor of a cyclic enumeration f, as a permutation of the
universe: the vertex one step further along the tour.
Equations
- DescriptiveComplexity.tourSucc f = f.symm.trans (Equiv.trans (finRotate N) f)
Instances For
Dependency graph
Dependency graph
Two vertices are tour-adjacent when one is the tour successor of the other. This is symmetric, and every vertex has exactly two tour-neighbours.
Equations
- DescriptiveComplexity.TAdj f x y = ((DescriptiveComplexity.tourSucc f) x = y ∨ (DescriptiveComplexity.tourSucc f) y = x)
Instances For
Dependency graph
The two tour-neighbours of x are distinct once the cycle has length
≥ 3: the successor is not the predecessor.
Dependency graph
Tour-adjacency is symmetric.
Dependency graph
x is tour-adjacent to its successor and to its predecessor.
Dependency graph
Dependency graph
Every tour-neighbour of x is its successor or its predecessor.
Dependency graph
A tour edge is a graph edge.
Dependency graph
The tour successor of x is one of its two known tour-neighbours.
Dependency graph
A vertex has only two tour-neighbours: once two distinct ones are known, every tour-neighbour is one of them.
Dependency graph
A successor-closed subset of Fin N is everything. Starting from any
element, repeatedly adding one cycles through all of Fin N.
Dependency graph
The tour is a single cycle. Any nonempty subset of the universe closed
under the tour successor is the whole universe. (tourSucc is conjugate to the
N-cycle finRotate N, so it has no proper invariant subset.)
Dependency graph
Forced edges. If a vertex x in a tour has at most two graph-neighbours
(every neighbour is p or q), then p and q are exactly its two
tour-neighbours: every one of x's edges is used by the tour. (Distinctness of
the two tour-neighbours, from 3 ≤ N, forces p ≠ q and that both occur.)
Dependency graph
The neighbours of the internal vertex ⟨g1,(a,b)⟩ are exactly ⟨g0,(a,b)⟩
and ⟨g2,(a,b)⟩. So in a Hamilton circuit both its edges are forced.
Dependency graph
The neighbours of the internal vertex ⟨g4,(a,b)⟩ are exactly ⟨g3,(a,b)⟩
and ⟨g5,(a,b)⟩.
Dependency graph
The neighbours of ⟨g2,(a,b)⟩ are ⟨g1,(a,b)⟩, ⟨g3,(a,b)⟩ and the cross
neighbour ⟨g0,(b,a)⟩.
Dependency graph
The neighbours of ⟨g3,(a,b)⟩ are ⟨g2,(a,b)⟩, ⟨g4,(a,b)⟩ and the cross
neighbour ⟨g5,(b,a)⟩.
Dependency graph
From the tour to the forced gadget paths #
The gadget edge relation is symmetric (it is the undirected edge).
Dependency graph
Gadget vertices with distinct tags are distinct (local copy, so Reverse
stays independent of Forward).
Dependency graph
A gadget vertex depends on the edge only through its endpoints, not the proof (handy to normalize a doubly-symmetrized edge back to the original).
Dependency graph
A vertex tagged sel is a selector selPt hm for a marked vertex.
Dependency graph
At least three vertices. If the target universe carries an edge, its
gadget contributes twelve distinct vertices, so any cyclic enumeration has
length ≥ 3 – enough to run tour_forced.
Dependency graph
Forced u-path. The degree-two internal vertex ⟨g1,(a,b)⟩ uses both of
its edges: ⟨g0⟩ and ⟨g2⟩ are its two tour-neighbours.
Dependency graph
Forced v-path. Symmetrically, ⟨g4,(a,b)⟩ uses both ⟨g3⟩ and ⟨g5⟩.
Dependency graph
Propagation at g2. With the forced u-path, ⟨g1⟩ is one of ⟨g2⟩'s
two tour-neighbours; the other, being a graph-neighbour distinct from ⟨g1⟩, is
either ⟨g3⟩ (traverse this side straight through) or the cross vertex
⟨g0,(b,a)⟩ (hand the tour over to the other side).
Dependency graph
Propagation at g3. Symmetrically, the tour leaves ⟨g3⟩ either straight
to ⟨g2⟩ or across to the cross vertex ⟨g5,(b,a)⟩.
Dependency graph
Never neither. A gadget cannot be traversed with both sides crossed:
that would close the six vertices g0 g1 g2 of each side into a single
tour-invariant 6-cycle, which (the tour being one cycle over ≥ 12 vertices)
must be the whole universe – impossible, as ⟨g3,(a,b)⟩ lies outside it.
Dependency graph
The neighbours of a general ⟨g0,(a,b)⟩: ⟨g1,(a,b)⟩, the cross vertex
⟨g2,(b,a)⟩, the chain link ⟨g5,(a,c)⟩ back to the predecessor neighbour c < b
of b, and — when b is the least neighbour — every selector.
Dependency graph
The neighbours of a general ⟨g5,(a,b)⟩: ⟨g4,(a,b)⟩, the cross vertex
⟨g3,(b,a)⟩, the chain link ⟨g0,(a,c)⟩ on to the successor neighbour b < c,
and — when b is the greatest neighbour — every selector.
Dependency graph
At least one side is straight. Combining the g2 case split
(prop_g2) on both sides with not_both_crossed: for every edge, the tour runs
straight through the a-side gadget (g2-g3) or through the b-side gadget.
Dependency graph
Straightness propagates along the owner's chain #
Whether a vertex is a selector.
Equations
Instances For
Dependency graph
Dependency graph
The entrance slot of a straight-opposite side. When the b-side of the
edge {a, b} is straight, both tour-slots of ⟨g2,(b,a)⟩ are known, so the
cross edge into ⟨g0,(a,b)⟩ is unused: the tour-neighbour of ⟨g0,(a,b)⟩ other
than the forced ⟨g1,(a,b)⟩ is a selector (and b is a's least neighbour) or
the chain-link from the predecessor side.
Dependency graph
The exit slot of a straight-opposite side, symmetrically: the
tour-neighbour of ⟨g5,(a,b)⟩ other than the forced ⟨g4,(a,b)⟩ is a selector
(and b is a's greatest neighbour) or the chain-link to the successor side.
Dependency graph
A used chain-link straightens the earlier side. If the tour uses the
chain edge ⟨g0,(a,b)⟩–⟨g5,(a,c)⟩, both tour-slots of ⟨g5,(a,c)⟩ are known, so
its cross edge is unused and (by prop_g3) the side (c,a) is straight.
Dependency graph
A used chain-link straightens the later side, symmetrically: a tour edge
⟨g5,(a,b)⟩–⟨g0,(a,c)⟩ fills both slots of ⟨g0,(a,c)⟩, so its cross edge is
unused and (by prop_g2) the side (c,a) is straight.
Dependency graph
Counting: the active chains inject into the selectors #
The neighbours of a as a finset.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The least neighbour of a (the second coordinate of its chain entrance).
Equations
Instances For
Dependency graph
The greatest neighbour of a (the second coordinate of its chain exit).
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The chain entrance of a: ⟨g0,(a, minNbr a)⟩.
Equations
Instances For
Dependency graph
The chain exit of a: ⟨g5,(a, maxNbr a)⟩.
Equations
Instances For
Dependency graph
Distinct owners give distinct entrances (so a ↦ entrancePt a is injective).
Dependency graph
Dependency graph
Entrance and exit never coincide (different tags), even across owners.
Dependency graph
The selector tour-neighbour of v (well-defined when v has one): the tour
successor if that is the selector, else the predecessor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Which tour-slot direction of the selector s points back at the vertex.
Equations
Instances For
Dependency graph
Recover a vertex from its selector-neighbour and the slot direction.
Equations
- DescriptiveComplexity.recover f s β = if β = true then (Equiv.symm (DescriptiveComplexity.tourSucc f)) s else (DescriptiveComplexity.tourSucc f) s
Instances For
Dependency graph
The recovery is exact: v is read back from selOf v and bit v.
Dependency graph
When v has a selector tour-neighbour, selOf v is that selector.
Dependency graph
a is active in tour f: both its chain entrance and its chain exit are
tour-adjacent to a selector (so its whole chain is a selector-to-selector arc).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The entrance (d = false) or exit (d = true) of a; junk if a is isolated.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
For an active vertex, ptOf really is the entrance/exit, which has a selector
tour-neighbour; hence selOf (ptOf …) is a selector.
Dependency graph
The mark carried by selOf (ptOf …) of an active vertex is marked.
Dependency graph
The active vertices inject into the marked ones: |C| ≤ |marked|. The map
(a, entrance/exit) ↦ (selector, slot-direction) is injective — the selector and
slot pin down the entrance/exit vertex (recover_selOf), whose owner and role
(g0 vs g5) pin down a. Two chain-endpoints per active chain, two slots per
selector, so 2|C| ≤ 2|marked|.
Dependency graph
Straightness reaches the entrance. If some side (b,a) of a's chain
is straight, the entrance slot of ⟨g0,(a,b)⟩ is a selector or a chain-link
(g0_other); a chain-link keeps the walked side straight
(straight_of_chain_down), so by well-founded descent along a's neighbour
list the chain entrance has a selector tour-neighbour.
Dependency graph
Straightness reaches the exit, symmetrically: well-founded ascent along
a's neighbour list through g5_other and straight_of_chain_up.
Dependency graph
A straight side makes the opposite owner active: if the side (u,v) of
the edge {u,v} is traversed straight through g2–g3, then v's chain runs
selector to selector, so v is active.
Dependency graph
Cover property: every edge has an active endpoint. The gadget of
{a,b} is traversed straight on the a-side or the b-side (side_straight),
and a straight side activates the opposite owner (active_of_straight).