Documentation

CslibFrontier.Computability.Complexity.Problems.Graph.Ports

Canonical three-way ports for finite graph incidences #

Each listed edge contributes its two endpoint occurrences in order. An incidence is assigned the number of preceding equal vertex labels, reduced modulo three. When every vertex occurs at most three times, reduction does nothing and every incidence of that vertex gets a distinct port. Parallel listed edges remain distinct; a loop contributes two incidences.

Main definitions #

Main results #

Endpoints of all listed edges, counting edge occurrences rather than simple-graph degree.

Instances For
    @[simp]

    Number of endpoint occurrences is twice the edge-list length.

    The even endpoint occurrence is the first endpoint of the corresponding listed edge.

    The odd endpoint occurrence is the second endpoint of the corresponding listed edge.

    Executable port assignment; under the degree hypothesis the remainder is the rank itself.

    Instances For

      The edge-indexed finite table of canonical port pairs.

      Instances For
        @[simp]

        One canonical port pair per listed edge.

        Reading the canonical table at an existing edge returns its two incidence ports.

        For graphs with at most three incidences per vertex, no remainder reduction occurs.

        Equal vertex labels and canonical ports identify endpoint occurrences when all incidence counts are at most three.

        Endpoint label of a listed edge occurrence; false means first, true second.

        Instances For

          The endpoint occurrence index agrees with the finite flattened endpoint list.

          theorem Cslib.Complexity.Graph.endpoint_index_lt (G : Graph) {i : ℕ} (hi : i < G.edges.length) (side : Bool) :

          A listed endpoint occurrence lies in the endpoint list's index range.

          theorem Cslib.Complexity.Graph.endpoint_port_injective (G : Graph) (hdeg : ∀ (v : ℕ), List.count v G.incidenceVertices ≤ 3) {i j : ℕ} (hi : i < G.edges.length) (hj : j < G.edges.length) (left right : Bool) (hv : G.edgeEndpoint i left = G.edgeEndpoint j right) (hp : G.incidencePort (2 * i + left.toNat) = G.incidencePort (2 * j + right.toNat)) :
          i = j ∧ left = right

          Vertex and canonical port determine both the edge occurrence and which end it is.

          def Cslib.Complexity.Graph.portAt (ports : List (Fin 3 × Fin 3)) (i : ℕ) (side : Bool) :
          Fin 3

          Reading a finite port table at one end of an edge occurrence.

          Instances For
            theorem Cslib.Complexity.Graph.portAt_canonicalPorts (G : Graph) {i : ℕ} (hi : i < G.edges.length) (side : Bool) :
            portAt G.canonicalPorts i side = G.incidencePort (2 * i + side.toNat)

            The canonical table reads the corresponding incidence's occurrence-rank port.

            theorem Cslib.Complexity.Graph.edgeEndpoint_mem (G : Graph) (hG : ∀ edge ∈ G.edges, edge.1 ∈ G.vertices ∧ edge.2 ∈ G.vertices) {i : ℕ} (hi : i < G.edges.length) (side : Bool) :

            Every indexed endpoint of a graph with declared endpoints is declared.

            theorem Cslib.Complexity.Graph.canonical_index_port_ne (G : Graph) (hG : ∀ edge ∈ G.edges, edge.1 ∈ G.vertices ∧ edge.2 ∈ G.vertices) (hdeg : ∀ (v : ℕ), List.count v G.incidenceVertices ≤ 3) {i j : ℕ} (hi : i < G.edges.length) (hj : j < G.edges.length) (hij : i ≠ j) (left right : Bool) :

            Canonical vertex-position/port pairs are distinct at every pair of different listed edges.