Documentation

DescriptiveComplexity.Problems.Hamilton.Reverse

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 #

  1. Neighbour sets. For each gadget vertex, the exact set of its DescriptiveComplexity.DGEdge-neighbours (by cases on the other vertex's tag, via dgEdge_iff). The internal vertices ⟨g1,(a,b)⟩ and ⟨g4,(a,b)⟩ have exactly two neighbours, ⟨g0/g2⟩ and ⟨g3/g5⟩ respectively.
  2. 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-g2 and g3-g4-g5 in every gadget (DescriptiveComplexity.forced_g1, DescriptiveComplexity.forced_g4).
  3. The three traversals. Propagating through g2, g3 (degree three) shows each gadget is traversed through the u-side, the v-side, or both – never neither (which would isolate it as two 6-cycles): every edge has a straight side (DescriptiveComplexity.side_straight).
  4. 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 of a's chain, or a chain-link that straightens the walked side in turn (DescriptiveComplexity.straight_of_chain_down/up). Well-founded induction along a's neighbour list puts a selector at both chain ends: a is active (DescriptiveComplexity.active_of_straight).
  5. 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.

theorem DescriptiveComplexity.gPt_val {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {t : HTag} {ht : t HTag.sel t HTag.hub} {a b : A} (h : HEdge a b) :
(gPt t ht h) = (t, ![a, b])

A gadget vertex ⟨t,(a,b)⟩ (raw form). Reconstructing a neighbour from its tag and coordinates uses this together with Subtype.ext.

Dependency graph
theorem DescriptiveComplexity.eq_gPt_of_val {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {t : HTag} {ht : t HTag.sel t HTag.hub} {a b : A} (h : HEdge a b) {q : hamInterp.MapRel A} (hqt : (↑q).1 = t) (h0 : (↑q).2 0 = a) (h1 : (↑q).2 1 = b) :
q = gPt t ht h

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

nextIdx on Fin N is Mathlib's cyclic rotation finRotate N (so it is a bijection).

Dependency graph
theorem DescriptiveComplexity.nextIdx_nextIdx_ne {N : } (hN : 3 N) (i : Fin N) :

In a cyclic enumeration nextIdx applied twice returns a different index, as soon as the cycle has length at least three.

Dependency graph
noncomputable def DescriptiveComplexity.tourSucc {H : Type} {N : } (f : Fin N H) :

The tour successor of a cyclic enumeration f, as a permutation of the universe: the vertex one step further along the tour.

Equations
Instances For
    Dependency graph
    @[simp]
    theorem DescriptiveComplexity.tourSucc_apply {H : Type} {N : } (f : Fin N H) (x : H) :
    (tourSucc f) x = f (nextIdx (f.symm x))
    Dependency graph
    def DescriptiveComplexity.TAdj {H : Type} {N : } (f : Fin N H) (x y : H) :

    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
    Instances For
      Dependency graph
      theorem DescriptiveComplexity.tourSucc_ne_symm {H : Type} {N : } (f : Fin N H) (hN : 3 N) (x : H) :

      The two tour-neighbours of x are distinct once the cycle has length ≥ 3: the successor is not the predecessor.

      Dependency graph
      theorem DescriptiveComplexity.TAdj_symm {H : Type} {N : } {f : Fin N H} {x y : H} (h : TAdj f x y) :
      TAdj f y x

      Tour-adjacency is symmetric.

      Dependency graph
      theorem DescriptiveComplexity.tadj_succ {H : Type} {N : } (f : Fin N H) (x : H) :
      TAdj f x ((tourSucc f) x)

      x is tour-adjacent to its successor and to its predecessor.

      Dependency graph
      theorem DescriptiveComplexity.tadj_pred {H : Type} {N : } (f : Fin N H) (x : H) :
      TAdj f x ((Equiv.symm (tourSucc f)) x)
      Dependency graph
      theorem DescriptiveComplexity.tadj_eq {H : Type} {N : } {f : Fin N H} {x y : H} (h : TAdj f x y) :
      y = (tourSucc f) x y = (Equiv.symm (tourSucc f)) x

      Every tour-neighbour of x is its successor or its predecessor.

      Dependency graph
      theorem DescriptiveComplexity.tadj_dgEdge {H : Type} {N : } {f : Fin N H} {R : HHProp} (hf : ∀ (i : Fin N), R (f i) (f (nextIdx i))) (hsymm : ∀ (a b : H), R a bR b a) {x y : H} (h : TAdj f x y) :
      R x y

      A tour edge is a graph edge.

      Dependency graph
      theorem DescriptiveComplexity.tourSucc_mem_of_tadj {H : Type} {N : } {f : Fin N H} {x p q : H} (hp : TAdj f x p) (hq : TAdj f x q) (hpq : p q) :
      (tourSucc f) x = p (tourSucc f) x = q

      The tour successor of x is one of its two known tour-neighbours.

      Dependency graph
      theorem DescriptiveComplexity.tadj_two {H : Type} {N : } {f : Fin N H} {x p q y : H} (hp : TAdj f x p) (hq : TAdj f x q) (hpq : p q) (hy : TAdj f x y) :
      y = p y = q

      A vertex has only two tour-neighbours: once two distinct ones are known, every tour-neighbour is one of them.

      Dependency graph
      theorem DescriptiveComplexity.all_of_succ_closed {N : } [NeZero N] (P : Fin NProp) (i₀ : Fin N) (h₀ : P i₀) (hs : ∀ (i : Fin N), P iP (i + 1)) (j : Fin N) :
      P j

      A successor-closed subset of Fin N is everything. Starting from any element, repeatedly adding one cycles through all of Fin N.

      Dependency graph
      theorem DescriptiveComplexity.tourSucc_closed_univ {H : Type} {N : } (f : Fin N H) {P : HProp} {x : H} (hx : P x) (hclosed : ∀ (y : H), P yP ((tourSucc f) y)) (z : H) :
      P z

      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
      theorem DescriptiveComplexity.tour_forced {H : Type} {N : } (f : Fin N H) {R : HHProp} (hf : ∀ (i : Fin N), R (f i) (f (nextIdx i))) (hsymm : ∀ (a b : H), R a bR b a) (hN : 3 N) {x p q : H} (hnb : ∀ (y : H), R x yy = p y = q) :
      TAdj f x p TAdj f x q

      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
      theorem DescriptiveComplexity.gPt_ne_tag {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {i j : HTag} (hij : i j) {hi : i HTag.sel i HTag.hub} {hj : j HTag.sel j HTag.hub} {a b a' b' : A} (h : HEdge a b) (h' : HEdge a' b') :
      gPt i hi h gPt j hj h'

      Gadget vertices with distinct tags are distinct (local copy, so Reverse stays independent of Forward).

      Dependency graph
      theorem DescriptiveComplexity.gPt_edge_irrel {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {t : HTag} {ht : t HTag.sel t HTag.hub} {a b : A} (h₁ h₂ : HEdge a b) :
      gPt t ht h₁ = gPt t ht h₂

      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
      theorem DescriptiveComplexity.forced_g1 {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) :
      TAdj f (gPt HTag.g1 h) (gPt HTag.g0 h) TAdj f (gPt HTag.g1 h) (gPt HTag.g2 h)

      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
      theorem DescriptiveComplexity.forced_g4 {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) :
      TAdj f (gPt HTag.g4 h) (gPt HTag.g3 h) TAdj f (gPt HTag.g4 h) (gPt HTag.g5 h)

      Forced v-path. Symmetrically, ⟨g4,(a,b)⟩ uses both ⟨g3⟩ and ⟨g5⟩.

      Dependency graph
      theorem DescriptiveComplexity.prop_g2 {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) :
      TAdj f (gPt HTag.g2 h) (gPt HTag.g3 h) TAdj f (gPt HTag.g2 h) (gPt HTag.g0 )

      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
      theorem DescriptiveComplexity.prop_g3 {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) :
      TAdj f (gPt HTag.g3 h) (gPt HTag.g2 h) TAdj f (gPt HTag.g3 h) (gPt HTag.g5 )

      Propagation at g3. Symmetrically, the tour leaves ⟨g3⟩ either straight to ⟨g2⟩ or across to the cross vertex ⟨g5,(b,a)⟩.

      Dependency graph
      theorem DescriptiveComplexity.not_both_crossed {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) (hAcross : TAdj f (gPt HTag.g2 h) (gPt HTag.g0 )) (hBcross : TAdj f (gPt HTag.g2 ) (gPt HTag.g0 h)) :

      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
      theorem DescriptiveComplexity.nbrs_gPt_g0 {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {a b : A} (h : HEdge a b) (q : hamInterp.MapRel A) :
      DGEdge (gPt HTag.g0 h) q q = gPt HTag.g1 h q = gPt HTag.g2 (∃ (c : A) (hc : HEdge a c), c < b (∀ (d : A), HEdge a dd c b d) q = gPt HTag.g5 hc) (∀ (d : A), HEdge a db d) ∃ (m : A) (hm : MGMarked m), q = selPt hm

      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
      theorem DescriptiveComplexity.nbrs_gPt_g5 {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {a b : A} (h : HEdge a b) (q : hamInterp.MapRel A) :
      DGEdge (gPt HTag.g5 h) q q = gPt HTag.g4 h q = gPt HTag.g3 (∃ (c : A) (hc : HEdge a c), b < c (∀ (d : A), HEdge a dd b c d) q = gPt HTag.g0 hc) (∀ (d : A), HEdge a dd b) ∃ (m : A) (hm : MGMarked m), q = selPt hm

      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
      theorem DescriptiveComplexity.side_straight {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) :
      TAdj f (gPt HTag.g2 h) (gPt HTag.g3 h) TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )

      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 #

      Dependency graph
      Dependency graph
      theorem DescriptiveComplexity.g0_other {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) (hS : TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )) :
      (∀ (d : A), HEdge a db d) (isSel ((tourSucc f) (gPt HTag.g0 h)) isSel ((Equiv.symm (tourSucc f)) (gPt HTag.g0 h))) ∃ (c : A) (hc : HEdge a c), c < b TAdj f (gPt HTag.g0 h) (gPt HTag.g5 hc)

      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
      theorem DescriptiveComplexity.g5_other {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) (hS : TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )) :
      (∀ (d : A), HEdge a dd b) (isSel ((tourSucc f) (gPt HTag.g5 h)) isSel ((Equiv.symm (tourSucc f)) (gPt HTag.g5 h))) ∃ (c : A) (hc : HEdge a c), b < c TAdj f (gPt HTag.g5 h) (gPt HTag.g0 hc)

      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
      theorem DescriptiveComplexity.straight_of_chain_down {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b c : A} (h : HEdge a b) (hc : HEdge a c) (hch : TAdj f (gPt HTag.g0 h) (gPt HTag.g5 hc)) :
      TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )

      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
      theorem DescriptiveComplexity.straight_of_chain_up {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b c : A} (h : HEdge a b) (hc : HEdge a c) (hch : TAdj f (gPt HTag.g5 h) (gPt HTag.g0 hc)) :
      TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )

      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 #

      Dependency graph
      Dependency graph
      Dependency graph
      noncomputable def DescriptiveComplexity.minNbr {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a : A} (h : ∃ (b : A), HEdge a b) :
      A

      The least neighbour of a (the second coordinate of its chain entrance).

      Equations
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.maxNbr {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a : A} (h : ∃ (b : A), HEdge a b) :
        A

        The greatest neighbour of a (the second coordinate of its chain exit).

        Equations
        Instances For
          Dependency graph
          Dependency graph
          Dependency graph
          theorem DescriptiveComplexity.minNbr_le {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a : A} (h : ∃ (b : A), HEdge a b) {d : A} (hd : HEdge a d) :
          Dependency graph
          theorem DescriptiveComplexity.le_maxNbr {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a : A} (h : ∃ (b : A), HEdge a b) {d : A} (hd : HEdge a d) :
          Dependency graph
          Dependency graph
          Dependency graph
          theorem DescriptiveComplexity.entrancePt_inj {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a a' : A} (h : ∃ (b : A), HEdge a b) (h' : ∃ (b : A), HEdge a' b) (he : entrancePt h = entrancePt h') :
          a = a'

          Distinct owners give distinct entrances (so a ↦ entrancePt a is injective).

          Dependency graph
          theorem DescriptiveComplexity.exitPt_inj {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a a' : A} (h : ∃ (b : A), HEdge a b) (h' : ∃ (b : A), HEdge a' b) (he : exitPt h = exitPt h') :
          a = a'
          Dependency graph
          theorem DescriptiveComplexity.entrancePt_ne_exitPt {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {a a' : A} (h : ∃ (b : A), HEdge a b) (h' : ∃ (b : A), HEdge a' b) :

          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
              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
                    theorem DescriptiveComplexity.entrance_sel_of_straight {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a : A} (b : A) (h : HEdge a b) :
                    TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )isSel ((tourSucc f) (entrancePt )) isSel ((Equiv.symm (tourSucc f)) (entrancePt ))

                    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
                    theorem DescriptiveComplexity.exit_sel_of_straight {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a : A} (b : A) (h : HEdge a b) :
                    TAdj f (gPt HTag.g2 ) (gPt HTag.g3 )isSel ((tourSucc f) (exitPt )) isSel ((Equiv.symm (tourSucc f)) (exitPt ))

                    Straightness reaches the exit, symmetrically: well-founded ascent along a's neighbour list through g5_other and straight_of_chain_up.

                    Dependency graph
                    theorem DescriptiveComplexity.active_of_straight {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {u v : A} (h : HEdge u v) (hS : TAdj f (gPt HTag.g2 h) (gPt HTag.g3 h)) :
                    Active f v

                    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
                    theorem DescriptiveComplexity.cover_property {A : Type} [FirstOrder.Language.markedGraph.Structure A] [LinearOrder A] [Fintype A] {N : } (f : Fin N hamInterp.MapRel A) (hf : ∀ (i : Fin N), DGEdge (f i) (f (nextIdx i))) {a b : A} (h : HEdge a b) :
                    Active f a Active f b

                    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).

                    Dependency graph