Documentation

CslibFrontier.Computability.Languages.StarFree

Star-free languages #

A star-free expression is built from ∅ and single letters by union, complement and concatenation Libkin, Definition 7.25, with complement taken relative to all words List α. A language is star-free when some star-free expression denotes it. Star-free languages are regular, by the closure properties of regular languages.

Libkin works over a finite alphabet Libkin, Section 7.4. This file allows an arbitrary alphabet, where the finiteness matters: {ε} is star-free exactly when the alphabet is finite (isStarFree_one_iff). Over a finite alphabet {ε} is the complement of ⊤ · Σ; over an infinite alphabet some letter c does not occur in a given expression, and on the words cⁿ the expression's language is all or nothing.

Other presentations start from ∅, {ε} and the letters, or from all finite languages. Over a finite alphabet they define the same class, because {ε} and every finite language are star-free in the sense above (IsStarFree.one, IsStarFree.of_finite).

Main definitions #

Main results #

References #

Star-free expressions over the alphabet α Libkin, Definition 7.25.

The language denoted by a star-free expression.

Whether the empty word belongs to the language of an expression, computed structurally.

The language of a star-free expression is regular.

The letters occurring in an expression.

theorem Cslib.Language.StarFreeExpression.replicate_mem_or_notMem {α : Type u} {c : α} (e : StarFreeExpression α) :
c ∉ e.letters → (∀ (n : ℕ), List.replicate n c ∈ e.matches') ∨ ∀ (n : ℕ), List.replicate n c ∉ e.matches'

On the words cⁿ over a letter c that does not occur in e, the language of e is all or nothing.

A language is star-free when some star-free expression denotes it Libkin, Definition 7.25.

theorem Cslib.Language.IsStarFree.add {α : Type u} {L M : Language α} (hL : IsStarFree L) (hM : IsStarFree M) :
theorem Cslib.Language.IsStarFree.mul {α : Type u} {L M : Language α} (hL : IsStarFree L) (hM : IsStarFree M) :

All words form a star-free language, the complement of ∅.

theorem Cslib.Language.IsStarFree.inf {α : Type u} {L M : Language α} (hL : IsStarFree L) (hM : IsStarFree M) :
IsStarFree (L ⊓ M)
theorem Cslib.Language.IsStarFree.iSup {α : Type u} {ι : Type u_1} [Finite ι] {L : ι → Language α} (hL : ∀ (i : ι), IsStarFree (L i)) :
IsStarFree (⨆ (i : ι), L i)

A finite union of star-free languages is star-free.

theorem Cslib.Language.IsStarFree.iInf {α : Type u} {ι : Type u_1} [Finite ι] {L : ι → Language α} (hL : ∀ (i : ι), IsStarFree (L i)) :
IsStarFree (⨅ (i : ι), L i)

A finite intersection of star-free languages is star-free.

Star-free languages are regular.

Over a finite alphabet, the words of length one form a star-free language, the finite union of the letters.

Over a finite alphabet, {ε} is star-free: it is the complement of ⊤ · Σ.

Over a finite alphabet, every one-word language {w} is star-free: {ε} is, and {a :: w} = {a} · {w}.

Over a finite alphabet, every finite language is star-free, as a finite union of one-word languages.

Over an infinite alphabet, {ε} is not star-free: an expression mentions finitely many letters, and on the powers of a letter that it does not mention its language is all or nothing.

{ε} is star-free if and only if the alphabet is finite.