This file covers exercises 1 and 2 from exercise sheet 1 (which can be found at https://iccl.inf.tu-dresden.de/w/images/a/a1/FS2025-Blatt-01.pdf). The goal of these exercises is to show some general theorems about formal languages as well as some theorems about particular languages. Definitions and results used in the proofs can be found in lecture1.
The following three theorems show the monotonicity of union, concatenation and kleene star for languages.
In exercise sessions the solution given for 1.2b is usually somewhat informal. We just argue that every word from the languages on the left hand side and the right hand side starts and ends with an a and in between there can be arbitrary chains of a but never two bs in a row.
In section d of the exercise we show some properties of the kleene star operator:
- ∅* = {ε}
- ({ε} ∪ L)* = L*
- (L*)* = L*
in the exercise solution the inclusion (L₁* ∪ L₂*)* ⊆ (L₁ ∪ L₂)* is shown by arguing that every Word w from (L₁* ∪ L₂*)* can be seen as a concatenation of words w₁...wₙ where each wᵢ is from (L₁* ∪ L₂*). Then each wᵢ can again be expressed as a sequence of words x₁...xₙ where either each xᵢ is from L₁ or each xᵢ is from L₂. But then the original word w is a sequence of words from L₁ and L₂, so w ∈ (L₁ ∪ L₂). In Lean it is not quite as easy to switch between words and lists of words. A list of words cannot be equal to a word because the type does not match. In lecture1 we have already shown that for a language L every word from L is equal to a flattened list of words from L. The auxiliary result at the beginning of the proof for 2e does something similar, but here we need to flatten the list twice because the language contains two stars.