Documentation

Linglib.Phonology.Subregular.StrictlyPiecewise

Strictly piecewise languages (SP_k) #

A language L is strictly k-piecewise when membership is determined by which subsequences (scattered, non-contiguous selections) of length at most k the input contains [RHB+10]. Where SL_k constrains adjacent material via contiguous factors, SP_k constrains long-distance co-occurrence — the subregular class of unbounded-distance phonotactics. The class is the program's vocabulary for the sublist-closed languages of Linglib.Core.Computability.ShuffleIdeal: a language is SP at some width iff it is sublist-closed.

Main definitions #

Main results #

Implementation notes #

List.Sublist (<+) is mathlib's non-contiguous "is a subsequence of", exactly the SP primitive. Unlike SL no boundary augmentation is needed, since subsequences are blind to position; the "≤ k" (rather than "exactly k") bound is instead what keeps words shorter than k distinguishable, matching subseqSet.

@[reducible, inline]
abbrev SPGrammar (α : Type u_1) :
Type u_1

A strictly-piecewise grammar over α: a set of permitted subsequences [RHB+10]. Unlike SL grammars no boundary alphabet is used — subsequences are insensitive to position. The width k is supplied to language, not baked into the carrier.

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

    The language generated at width k: strings whose every subsequence of length at most k is permitted.

    Equations
    Instances For
      @[simp]
      theorem SPGrammar.mem_language {α : Type u_1} (k : ) (G : SPGrammar α) (w : List α) :
      w language k G ∀ (s : List α), s.length ks.Sublist ws G
      theorem SPGrammar.mem_language_of_sublist {α : Type u_1} {k : } {G : SPGrammar α} {v w : List α} (hvw : v.Sublist w) (hw : w language k G) :
      v language k G

      SP languages are subsequence-closed: deleting symbols cannot create a subsequence that was not already there.

      theorem SPGrammar.language_inter {α : Type u_1} (k : ) (G₁ G₂ : SPGrammar α) :
      language k (G₁ G₂) = language k G₁language k G₂

      Conjoining grammars conjoins their languages.

      theorem SPGrammar.mem_language_iff_forall_mem_sublistsLen {α : Type u_1} (k : ) (G : SPGrammar α) (w : List α) :
      w language k G jk, sList.sublistsLen j w, s G

      SP membership reduces to a check against List.sublistsLen — a decide-friendly characterisation used by the decidable-membership instance below.

      @[instance_reducible]
      instance SPGrammar.decidableMemLanguage {α : Type u_1} (k : ) (G : SPGrammar α) [DecidablePred fun (x : List α) => x G] (w : List α) :
      Decidable (w language k G)
      Equations
      def Language.IsStrictlyPiecewise {α : Type u_1} (L : Language α) (k : ) :

      A language L is strictly k-piecewise when the width-k subsequence test with L itself as the permitted set recovers L — the canonical-grammar fixed point; isStrictlyPiecewise_iff recovers the ∃-grammar form.

      Equations
      Instances For
        theorem Language.isStrictlyPiecewise_iff {α : Type u_1} {L : Language α} {k : } :
        L.IsStrictlyPiecewise k ∃ (G : SPGrammar α), SPGrammar.language k G = L

        Some grammar generates L at width k iff L is its own grammar.

        theorem Language.IsStrictlyPiecewise.mem_of_sublist {α : Type u_1} {L : Language α} {k : } (h : L.IsStrictlyPiecewise k) {v w : List α} (hvw : v.Sublist w) (hw : w L) :
        v L

        SP languages are subsequence-closed.

        theorem Language.IsStrictlyPiecewise.nil_mem {α : Type u_1} {L : Language α} {k : } (h : L.IsStrictlyPiecewise k) {w : List α} (hw : w L) :
        [] L

        A nonempty SP language contains the empty word.

        theorem Language.isStrictlyPiecewise_avoid {α : Type u_1} {k : } {p : List α} (hp : p.length k) :

        Avoiding one pattern: the complement of a shuffle ideal is strictly k-piecewise as soon as the forbidden pattern fits in the window.

        theorem Language.IsStrictlyPiecewise.succ {α : Type u_1} {L : Language α} {k : } (h : L.IsStrictlyPiecewise k) :

        SP_k ⊆ SP_(k+1): widening the window loses nothing.

        theorem Language.IsStrictlyPiecewise.toIsPiecewiseTestable {α : Type u_1} {L : Language α} {k : } (h : L.IsStrictlyPiecewise k) :

        SP_k ⊆ PT_k: the strictly-piecewise test ("every subsequence of length at most k is permitted") depends only on subseqSet k.

        theorem Language.exists_isStrictlyPiecewise_iff_isSublistClosed {α : Type u_1} {L : Language α} [Finite α] :
        (∃ (k : ), L.IsStrictlyPiecewise k) L.IsSublistClosed

        A language is strictly piecewise at some width iff it is sublist-closed [RHB+10]. Backwards, L is its own grammar at the width bounding the finite forbidden basis, so that any word outside L is already refuted by a basis word it contains.