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 #

References #

@[reducible, inline]
abbrev StrictlyLocalGrammar (α : Type u_2) :
Type u_2

A strictly-local grammar over α is a set of permitted factors over the boundary-augmented alphabet Option α, with none the boundary. The locality width k is an argument of language.

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

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

    Equations
    Instances For
      @[simp]
      theorem StrictlyLocalGrammar.mem_language {α : Type u_1} (k : ℕ) (G : StrictlyLocalGrammar α) (w : List α) :
      w ∈ language k G ↔ ∀ f ∈ List.kFactors k (boundary k w), f ∈ G
      def StrictlyLocalGrammar.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 StrictlyLocalGrammar.mem_ofForbidden_language {α : Type u_1} (forbidden : Set (Augmented α)) (k : ℕ) (w : List α) :
        w ∈ language k (ofForbidden forbidden) ↔ ∀ f ∈ List.kFactors k (boundary k w), f ∉ forbidden
        theorem StrictlyLocalGrammar.mem_language_iff_window {α : Type u_1} {k : ℕ} {G : StrictlyLocalGrammar α} {w : List α} (hk : 1 ≤ k) :
        w ∈ language k G ↔ ∀ (i : ℤ), 1 - ↑k ≤ i → i < ↑w.length → window k w i ∈ G

        A string is in an SL language iff 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 StrictlyLocalGrammar.mem_ofForbidden_language_iff_sum_count_eq_zero {α : Type u_1} [DecidableEq α] (F : Finset (Augmented α)) (k : ℕ) (w : List α) :
        w ∈ language k (ofForbidden ↑F) ↔ ∑ f ∈ F, List.count f (List.kFactors k (boundary k w)) = 0

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

        theorem StrictlyLocalGrammar.one_le_sum_count_of_not_mem_ofForbidden_language {α : Type u_1} [DecidableEq α] {F : Finset (Augmented α)} {k : ℕ} {w : List α} (h : w ∉ language k (ofForbidden ↑F)) :
        1 ≤ ∑ f ∈ F, 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 StrictlyLocalGrammar α 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 when 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 - 1 → u₁ ++ x ++ v₁ ∈ L → u₂ ++ x ++ v₂ ∈ L → u₁ ++ 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, since 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) :

            For widths k ≥ 2, a language is strictly k-local if and only if it is closed under suffix substitution at k.

            Local testability #

            theorem Language.IsStrictlyLocal.toIsLocallyTestable {α : Type u_2} {L : Language α} {k : ℕ} (h : L.IsStrictlyLocal k) :

            A strictly k-local language is locally k-testable. Padding a word with boundary markers pulls it back from the words over the augmented alphabet whose factors of length k are all permitted, and that language is locally k-testable outright.

            theorem Language.IsStrictlyLocal.isStarFree {α : Type u_2} [Finite α] {L : Language α} {k : ℕ} (h : L.IsStrictlyLocal k) :

            Over a finite alphabet strictly local languages are star-free.