4 Regular Language Properties
4 Regular Language Properties
Languages
COMP 455 – 002, Spring 2019
𝑥 𝑧
Start 𝑞0 𝑞
𝑥 𝑧
Start 𝑞0 𝑞
𝑖 2
Consider the language 0 , where 𝑖 ≥ 1.
We want to prove that this language is not regular.
We need to show that ∀𝑛 ∷ ൬∃𝑤: 𝑤 ∈ 𝐿 ∧ 𝑤 ≥𝑛 ∷
𝑖 2
(Reminder) 𝐿 = 0 |𝑖 ≥1
Let 𝑘 = 2. This means that 𝑥𝑦 𝑘 𝑧 has 𝑛2 + 𝑦 0s.
𝑤 has 𝑛2 0s, and any entry in 𝐿 longer than 𝑤 must
have at least 𝑛 + 1 2 0s.
𝑛2 < 𝑛2 + 1 ≤ 𝑛2 + 𝑦 ≤ 𝑛2 + 𝑛 < 𝑛2 + 2𝑛 + 1.
The length The length of The length The length of = 𝑛 + 1 2 , the length
of 𝑤 (in 𝐿) 𝑥𝑦 2 𝑧 if 𝑦 = 1. of 𝑥𝑦 2 𝑧 𝑥𝑦 2 𝑧 if 𝑦 = 𝑛. of the next string in 𝐿.
ഥ ∪ 𝑁.
Proof: 𝑀 ∩ 𝑁 = 𝑀 ഥ
A DFA for 𝐿:
An NFA with 𝜀-
transitions for 𝐿𝑅 :
q′0
Let 𝐸 be a subexpression of 𝑅.
Claim: 𝐿 ℎ 𝐸 =ℎ 𝐿 𝐸 .
We will prove this by induction on the number of
operators in 𝐸.
Base case: 𝐸 is 𝜀, ∅, or 𝐚, where 𝑎 ∈ Σ.
❖ The only interesting case is where 𝐸 is a single-
character regular expression, so ℎ 𝐿 𝐸 = ℎ 𝑎 .
❖ℎ 𝐸 is a regular expression for the same string
ℎ 𝑎 , so ℎ 𝐿 𝐸 = 𝐿 ℎ 𝐸 .
Jim Anderson (modified by Nathan Otterness) 26
Proof that 𝐿 ℎ 𝑅 = ℎ 𝐿 , continued
ℎ 𝐿 𝐸
=ℎ 𝐿 𝐹 ∪𝐿 𝐺 , since 𝐿 𝐸 = 𝐿 𝐹 ∪ 𝐿 𝐺 .
=ℎ 𝐿 𝐹 ∪ℎ 𝐿 𝐺 , since ℎ is applied to individual strings.
Proof:
Let 𝑀 = 𝑄, Δ, 𝛿, 𝑞0 , 𝐹 be a DFA accepting 𝐿.
Let ℎ: Σ → Δ∗ .
Define 𝑀′ = 𝑄, Σ, 𝛿 ′ , 𝑞0 , 𝐹 be a DFA accepting ℎ−1 𝐿 .
𝑀′ = 𝑄, Σ, 𝛿 ′ , 𝑞0 , 𝐹
On an input 𝑎 ∈ Σ, 𝑀′ simulates the behavior of 𝑀
on ℎ 𝑎 .
Formally, 𝛿 ′ 𝑞, 𝑎 = 𝛿መ 𝑞, ℎ 𝑎 .
𝐿 𝑀′ = 1