Documentation

Linglib.Phonology.Subregular.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 #

Main results #

@[reducible, inline]
abbrev 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 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 SLGrammar.mem_language {α : Type u_1} (k : ) (G : SLGrammar α) (w : List α) :
      w language k G fList.kFactors k (boundary k w), f G
      def 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 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
        theorem SLGrammar.mem_language_iff_window {α : Type u_1} {k : } {G : SLGrammar α} {w : List α} (hk : 1 k) :
        w language k G ∀ (i : ), 1 - k ii < w.lengthList.window k w i G

        Membership in an SL language, position-indexed: every window over [1 - k, w.length) is permitted.

        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 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 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_2} (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

          Suffix substitution closure #

          def Language.SuffixSubstitutionClosed {α : Type u_2} (L : Language α) (k : ) :

          L is closed under suffix substitution at width k: two members sharing a length-(k − 1) window admit the crossover of their suffixes at it.

          Equations
          • L.SuffixSubstitutionClosed k = ∀ (u₁ v₁ u₂ v₂ x : List α), x.length = k - 1u₁ ++ x ++ v₁ Lu₂ ++ x ++ v₂ Lu₁ ++ x ++ v₂ L
          Instances For
            theorem Language.IsStrictlyLocal.suffixSubstitutionClosed {α : Type u_2} {L : Language α} {k : } (h : L.IsStrictlyLocal k) :

            A strictly local language is closed under suffix substitution: every k-factor of the crossover lies in the shared left part — a factor of the first member — or in the shared window-and-right part — a factor of the second.

            theorem Language.SuffixSubstitutionClosed.isStrictlyLocal {α : Type u_2} {L : Language α} {k : } (hk : 2 k) (h : L.SuffixSubstitutionClosed k) :

            A suffix-substitution-closed language is strictly local: the canonical grammar of all licensed member-factors regenerates it, stitching a member left-to-right through the shared windows.

            theorem Language.isStrictlyLocal_iff_suffixSubstitutionClosed {α : Type u_2} {L : Language α} {k : } (hk : 2 k) :

            The suffix-substitution characterization of strict locality: for widths k ≥ 2, a language is strictly k-local if and only if it is closed under suffix substitution at k.