Langlib

Langlib.Automata.LinearBounded.CertifiedRowSystem.Complement.RankGraph

Ranked fixed-width rows #

The complement protocol enumerates width-n source rows as least-significant-first numerals. This file packages that enumeration as the finite vertex type Fin (|A| ^ n) and records the arithmetic facts used by the semantic proof.

@[reducible, inline]

Ranks of all width-n rows over A.

Equations
Instances For
    noncomputable def CertifiedRowSystem.Complement.rankRow {A : Type u_2} [Fintype A] [Nonempty A] (n : ) (v : RankVertex A n) :

    The row at a given rank in the protocol's canonical enumeration.

    Equations
    Instances For
      @[simp]
      noncomputable def CertifiedRowSystem.Complement.rankOfRow {A : Type u_2} [Fintype A] [Nonempty A] (n : ) (row : List A) (hlen : row.length = n) :

      Rank a row whose length is known to be n.

      Equations
      Instances For
        @[simp]
        theorem CertifiedRowSystem.Complement.rankRow_rankOfRow {A : Type u_2} [Fintype A] [Nonempty A] (n : ) (row : List A) (hlen : row.length = n) :
        rankRow n (rankOfRow n row hlen) = row
        @[simp]
        theorem CertifiedRowSystem.Complement.rankOfRow_rankRow {A : Type u_2} [Fintype A] [Nonempty A] (n : ) (v : RankVertex A n) :
        rankOfRow n (rankRow n v) = v
        noncomputable def CertifiedRowSystem.Complement.rankRowEquiv {A : Type u_2} [Fintype A] [Nonempty A] (n : ) :
        RankVertex A n { row : List A // row.length = n }

        Canonical equivalence between ranks and width-indexed list rows.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def CertifiedRowSystem.Complement.rankEdge {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] (D : CertifiedRowSystem I A Unit Q F) (n : ) :
          RankVertex A nRankVertex A nProp

          The rank graph induced by a certified row system at one fixed width.

          Equations
          Instances For
            def CertifiedRowSystem.Complement.rankFinal {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] (D : CertifiedRowSystem I A Unit Q F) (n : ) :

            The final predicate transported to ranked rows.

            Equations
            Instances For
              noncomputable def CertifiedRowSystem.Complement.sourceRank {A : Type u_2} [Fintype A] [Nonempty A] (n : ) (source : List A) (hlen : source.length = n) :

              The ranked source vertex corresponding to a concrete source row.

              Equations
              Instances For
                @[simp]
                theorem CertifiedRowSystem.Complement.rankRow_sourceRank {A : Type u_2} [Fintype A] [Nonempty A] (n : ) (source : List A) (hlen : source.length = n) :
                rankRow n (sourceRank n source hlen) = source
                @[simp]
                theorem CertifiedRowSystem.Complement.rankEdge_iff {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] (D : CertifiedRowSystem I A Unit Q F) (n : ) (old new : RankVertex A n) :
                rankEdge D n old new D.RowStep (rankRow n old) (rankRow n new)

                A ranked edge preserves the intended list-level edge exactly.

                theorem CertifiedRowSystem.Complement.rankReach_sound {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] (D : CertifiedRowSystem I A Unit Q F) (n : ) {old new : RankVertex A n} (h : Relation.ReflTransGen (rankEdge D n) old new) :

                Ranked reachability maps to source-row reachability.

                theorem CertifiedRowSystem.Complement.rankReach_complete {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] (D : CertifiedRowSystem I A Unit Q F) (n : ) {old : RankVertex A n} {row : List A} (h : Relation.ReflTransGen D.RowStep (rankRow n old) row) :
                ∃ (new : RankVertex A n), rankRow n new = row Relation.ReflTransGen (rankEdge D n) old new

                Every list-level path starting at a ranked row stays at the fixed width and can be transported back to the rank graph.

                theorem CertifiedRowSystem.Complement.rankReach_iff {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] (D : CertifiedRowSystem I A Unit Q F) (n : ) (old new : RankVertex A n) :

                Reachability between ranked endpoints is exactly list-level row reachability.

                Canonical numeral rows #

                noncomputable def CertifiedRowSystem.Complement.vertexNumeral {A : Type u_2} [Fintype A] [Nonempty A] (n k : ) :

                The canonical width-n source-alphabet numeral for the natural number k. Values outside the row capacity wrap around; semantic uses always carry an in-range proof.

                Equations
                Instances For
                  theorem CertifiedRowSystem.Complement.countNumeral_injective {A : Type u_2} [Fintype A] {n i j : } (hi : i < (Fintype.card A + 1) ^ n) (hj : j < (Fintype.card A + 1) ^ n) :

                  The larger-radix count track can represent every number up to the number of width-n source rows, provided the physical row is nonempty.

                  Count numerals are injective throughout the complete range of possible reachable vertex counts.

                  theorem CertifiedRowSystem.Complement.countNumeral_one {A : Type u_2} [Fintype A] [Nonempty A] {n : } (hn : 0 < n) :

                  The first successor of the zero count row is the boot scanner's LSD-first numeral one.

                  Prefixes of the canonical vertex enumeration #

                  The first i ranked vertices.

                  Equations
                  Instances For
                    @[simp]
                    theorem CertifiedRowSystem.Complement.mem_rankPrefix {A : Type u_2} [Fintype A] {n i : } (v : RankVertex A n) :
                    v rankPrefix n i v < i