Documentation

Linglib.Core.Computability.Subregular.Language.StrictlyLocal

Strictly local languages (SL_k) #

A language L is strictly k-local when membership is determined by the length-k substrings of the boundary-augmented input: a grammar is a set G of permitted k-factors, and w ∈ L iff every k-factor of boundary k w lies in G. The forbidden-factor dual (G = Fᶜ) is finite even over an infinite alphabet.

Main definitions #

@[reducible, inline]
abbrev Subregular.SLGrammar (α : Type u_2) :
Type u_2

A strictly-local grammar over α: a set of permitted factors over the boundary-augmented alphabet Option α (none the boundary). The locality width k is supplied to language, not baked into the carrier.

Equations
Instances For
    def Subregular.SLGrammar.language {α : Type u_1} (k : ) (G : SLGrammar α) :
    Language α

    The language generated at width k: strings whose boundary-augmented form has every k-factor permitted.

    Equations
    Instances For
      @[simp]
      theorem Subregular.SLGrammar.mem_language {α : Type u_1} (k : ) (G : SLGrammar α) (w : List α) :
      w language k G fList.kFactors k (boundary k w), f G
      def Subregular.SLGrammar.ofForbidden {α : Type u_1} (forbidden : Set (Augmented α)) :

      The grammar of a forbidden-factor set is its complement: a string is accepted iff none of its k-factors are forbidden.

      Equations
      Instances For
        @[simp]
        theorem Subregular.SLGrammar.mem_ofForbidden_language {α : Type u_1} (forbidden : Set (Augmented α)) (k : ) (w : List α) :
        w language k (ofForbidden forbidden) fList.kFactors k (boundary k w), fforbidden

        Count-vector characterisation #

        Membership in a forbidden-factor SL language is a zero-test of a single linear functional of the word's k-factor count vector — the total count of forbidden factors — with unit margin on nonmembers. Strict locality is thus linearly detectable on the factor-count (cue) representation.

        theorem Subregular.SLGrammar.mem_ofForbidden_language_iff_sum_count_eq_zero {α : Type u_1} [DecidableEq α] (F : Finset (Augmented α)) (k : ) (w : List α) :
        w language k (ofForbidden F) fF, List.count f (List.kFactors k (boundary k w)) = 0

        SL membership is the vanishing of the forbidden-factor count.

        theorem Subregular.SLGrammar.one_le_sum_count_of_not_mem_ofForbidden_language {α : Type u_1} [DecidableEq α] {F : Finset (Augmented α)} {k : } {w : List α} (h : wlanguage k (ofForbidden F)) :
        1 fF, List.count f (List.kFactors k (boundary k w))

        Nonmembers score at least 1 on the forbidden-factor count: the linear detector has unit margin.

        def Language.IsStrictlyLocal {α : Type u_1} (L : Language α) (k : ) :

        A language L is strictly k-local iff some SLGrammar α generates it at width k. Witness-style, mirroring Language.IsRegular/Language.IsContextFree ("L is regular iff some DFA accepts L").

        Equations
        Instances For