Piecewise testable languages #
A language is piecewise k-testable when membership of a word depends only on the set of its
subsequences of length at most k. These are the piecewise testable events of Simon.
Main definitions #
subseqSet k w: the subsequences ofwof length at mostk.Language.IsPiecewiseTestable: membership in the language factors throughsubseqSet k.
Main results #
subseqSet_append_congr: words with the same subsequences of length at mostkstill have the same ones after concatenation.subseqSet_flatten_replicate_succ:k + 1copies of a word have the same subsequences of length at mostkaskcopies.Language.IsPiecewiseTestable.isStarFree: over a finite alphabet, piecewise testable languages are star-free.
References #
@[simp]
theorem
mem_subseqSet
{α : Type u_1}
{k : ℕ}
{s w : List α}
:
s ∈ subseqSet k w ↔ s.Sublist w ∧ s.length ≤ k
theorem
List.sublist_flatten_replicate_of_length_le
{α : Type u_1}
{w : List α}
{m : ℕ}
{s : List α}
:
s.length ≤ m → s.Sublist (replicate (m + 1) w).flatten → s.Sublist (replicate m w).flatten
A subsequence of m + 1 copies of w that is no longer than m misses one of the copies, so
it is a subsequence of m copies.
k + 1 copies of a word have the same subsequences of length at most k as k copies.
Over a finite alphabet subseqSet k takes finitely many values.
A language is piecewise k-testable when membership factors through the set subseqSet k
of subsequences of length at most k.
Equations
- L.IsPiecewiseTestable k = Function.FactorsThrough (fun (x : List α) => x ∈ L) (subseqSet k)
Instances For
theorem
Language.IsPiecewiseTestable.compl
{α : Type u_1}
{L : Language α}
{k : ℕ}
(h : L.IsPiecewiseTestable k)
:
theorem
Language.IsPiecewiseTestable.inter
{α : Type u_1}
{L M : Language α}
{k : ℕ}
(hL : L.IsPiecewiseTestable k)
(hM : M.IsPiecewiseTestable k)
:
(L ⊓ M).IsPiecewiseTestable k
theorem
Language.IsPiecewiseTestable.union
{α : Type u_1}
{L M : Language α}
{k : ℕ}
(hL : L.IsPiecewiseTestable k)
(hM : M.IsPiecewiseTestable k)
:
(L ⊔ M).IsPiecewiseTestable k
theorem
Language.IsPiecewiseTestable.isStarFree
{α : Type u_1}
{L : Language α}
{k : ℕ}
[Finite α]
(h : L.IsPiecewiseTestable k)
:
Over a finite alphabet piecewise testable languages are star-free.
theorem
Language.IsPiecewiseTestable.isRegular
{α : Type u_1}
{L : Language α}
{k : ℕ}
[Finite α]
(h : L.IsPiecewiseTestable k)
:
L.IsRegular