Langlib

Langlib.Classes.Regular.Examples.AnBn

a^n b^n is not regular #

This file proves that the language {aⁿbⁿ | n ∈ ℕ} (encoded with false = a, true = b) is not regular, using the Myhill–Nerode theorem: it is shown to have infinitely many distinct left quotients, hence is not regular.

Main declarations #

Left quotient of anbn by replicate k false contains replicate k true.

Left quotient of anbn by replicate k false does NOT contain replicate j true when j ≠ k.

The left quotients of anbn indexed by replicate k false are pairwise distinct.

The range of left quotients of anbn is infinite.

The language {aⁿbⁿ} is not regular.

theorem map_anbn_not_isRegular {T : Type u_1} {f : BoolT} (hf : Function.Injective f) :

Injective alphabet maps preserve the nonregularity of the anbn witness.