Documentation

CslibFrontier.Computability.Complexity.Problems.Graph.RotationSystem.Certificate

Finite certificates for rotations of listed multigraphs #

A certificate lists the successor of each of the 2m indexed darts. Dart 2i is the first end of listed edge i, and dart 2i+1 its second end. The checker uses bounded table lookup and at most 2m iterations for orbit membership, including singleton orbits. All labels and indices use binary encodings; no loop is funded by a vertex label or a supplied table entry.

The table must be a permutation, every endpoint must be declared, and the successor orbits must be exactly the endpoint fibers. Accepted certificates decode to the existing Graph.RotationSystem; conversely every rotation on a graph with declared endpoints has a certificate. Decoding is proof-only; the Boolean checker does not execute a choice operation.

verifyGenusZero additionally checks V+F=E+2 in each nonempty edge component, counting distinct endpoint vertices, indexed edges, and all face orbits. Isolated declared vertices use the separate point-component convention V=1,E=0,F=1; they contribute no dart orbit. No face is required to carry a constraint, and repeated vertices along face orbits are allowed.

This finite representation and its correctness proofs are original. They supply no geometric realization or planarity recognition theorem.

Main definitions #

Main results #

Binary index of a dart: edge position followed by its endpoint bit.

Instances For

    Indexed darts are exactly the positions of the flattened endpoint list.

    Instances For

      The code reads exactly the original dart endpoint.

      One binary successor index for each indexed edge end, in edge/end order.

      • successor : List ℕ

        Successor table; its required length is twice the actual edge-list length.

      Instances For
        theorem Cslib.Complexity.Graph.encRotationCertificate_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List ℕ} {T0 S0 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) T0 S0) :
        Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { successor := x0 x }) encIn encRotationCertificate (fun (x : γ) => T0 x) fun (x : γ) => S0 x

        A rotation certificate is its framed list of binary successor indices.

        Instances For
          @[reducible, inline]

          The tuple of the fields of encRotationCertificate.

          Instances For
            @[reducible, inline]

            Graph, framed, followed by its successor certificate. Labels and indices are binary.

            Instances For

              Total table iteration. Missing entries return zero, even for enormous binary indices.

              Instances For

                Orbit test with a clock funded by the actual number of darts.

                Instances For

                  All declared endpoints, exact table length, permutation, and exact endpoint fibers.

                  Instances For

                    Every accepted raw rotation table has exactly one successor entry per indexed dart. Unlike length_ofRotation, this applies to supplied certificates without a generator premise.

                    theorem Cslib.Complexity.Graph.RotationCertificate.orbitBool_eq_true_iff {G : Graph} (f : Equiv.Perm G.Dart) (table : List ℕ) (ht : ∀ (d : G.Dart), table.getD d.index 0 = (f d).index) (d e : G.Dart) :

                    A bounded table orbit is the existing permutation's SameCycle, when its entries encode that permutation. The clock is the cardinality, rather than the permutation's order.

                    Decode an accepted finite table to the existing rotation-system structure. This operation is used in proofs; the native checker executes only finite list operations.

                    Instances For

                      The decoded successor is exactly the supplied table entry.

                      A table for an abstract rotation, in the canonical edge/end order.

                      Instances For
                        @[simp]

                        The canonical table has exactly two entries per listed edge.

                        Reading the canonical table recovers the rotation.

                        Every existing rotation has an accepted finite certificate when its endpoints are declared. No rotation is assumed to be geometrically planar.

                        Encoding and then decoding preserves the actual successor permutation.

                        Canonical table encoding and checked decoding recover the existing rotation structure.

                        A coarse quadratic bit bound for the canonical certificate, including all framing. The bound depends on the encoded graph length, even for sparse, very large vertex labels.

                        One breadth-first expansion, retaining the old list. Repetitions are harmless: the result is used only for membership, never as a vertex count.

                        Instances For

                          Finite reachability from a declared root, with one iteration per declared vertex record.

                          Instances For

                            Native component membership; no range up to a binary vertex label is constructed.

                            Instances For

                              Membership in the same connected component of the existing graph on declared vertices.

                              Instances For

                                A declared vertex is in its own component, including an isolated vertex.

                                Component membership is symmetric.

                                Component membership is transitive.

                                The finite expansion agrees exactly with connectedness in the existing induced graph. The path bound is the number of declared vertices, including malformed duplicate records.

                                Reverse a dart's endpoint bit without inspecting vertex labels.

                                Instances For

                                  Binary reversal agrees with reversal of the existing indexed dart.

                                  The face successor table: reverse the edge, then look up the inverse rotation. idxOf returns the table length on failure, making this total on malformed certificates.

                                  Instances For

                                    Test that this dart is the least indexed member of its face orbit, including fixed points.

                                    Instances For

                                      For any accepted raw table, its actual inverse rotation is exactly the bounded list search for the given dart index. Empty graphs have no dart premise to manufacture.

                                      The finite face table realizes exactly RotationSystem.faceNext.

                                      Componentwise Euler test. Every declared root is checked separately. For a root with no incident dart, use the point-component convention V=1,E=0,F=1, not a dart orbit. For an edge component, count distinct vertices, listed edge positions, and every face orbit.

                                      Instances For

                                        Full supplied-certificate checker: rotation validity and componentwise numerical Euler.

                                        Instances For

                                          Every dart endpoint is declared when all listed edge endpoints are declared.

                                          The two indexed ends of an edge belong to the same declared-vertex component, including when the edge is a loop. All listed endpoints must be declared.

                                          A face successor stays in the same edge component.

                                          All darts of each face orbit belong to one edge component. Thus componentwise face counts cannot split an orbit or transfer a face between disconnected edge components.

                                          The least indexed dart of a face. Fixed points qualify, so their faces are counted too.

                                          Instances For

                                            Componentwise numerical genus zero. An edge component has V+F=E+2, with distinct endpoint vertices, indexed edge records and all face orbits. An isolated declared vertex is a point component with one conventional face and no dart. This is a numerical predicate on the existing rotations, not an equivalence to geometric planarity. In particular, geometric outer faces of disconnected drawings have not been identified with these componentwise faces.

                                            Instances For

                                              Each face orbit has exactly one representative, including a one-dart fixed-point orbit.

                                              The face representative test counts exactly the existing face orbits.

                                              The executable Euler check agrees with the explicit componentwise numerical predicate on the decoded existing rotation. No geometric correspondence is used.

                                              Exact soundness and completeness for a supplied certificate. Acceptance is equivalent to an actual rotation represented by the table and satisfying componentwise numerical Euler.

                                              Every numerical genus-zero rotation has a certificate within the explicit quadratic bit bound, and every accepted such certificate supplies an actual numerical genus-zero rotation.