Langlib

Langlib.Classes.Regular.Closure.Suffix

Regular Closure Under Suffix #

Proof idea: reduce suffix closure to prefix closure by reversing twice. A suffix of a word in L reverses to a prefix of a word in L.reverse, and regular languages are closed under both reverse and prefix.

Regular Closure Under Suffix #

This file proves that regular languages are closed under the suffix operation, via the decomposition suffixLang L = reverse(prefixLang(reverse L)), and shows that the converse fails over any nontrivial alphabet.

Strategy #

We use the identity suffixLang L = (prefixLang L.reverse).reverse (proved in LanguageOperations.lean as suffixLang_eq_reverse_prefixLang_reverse), together with the already-established closure of regular languages under:

Main declarations #

Regular languages are closed under the suffix operation.

The converse of suffix closure fails over any nontrivial alphabet.