Theory of Computation

Similar documents
Axioms of Kleene Algebra

Theory of Computation

Theory of Computation

Theory of Computation

Automata Theory and Formal Grammars: Lecture 1

5 Set Operations, Functions, and Counting

Principles of Real Analysis I Fall I. The Real Number System

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

Context-free grammars and languages

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

CS 455/555: Mathematical preliminaries

Harvard CS 121 and CSCI E-207 Lecture 6: Regular Languages and Countability

Finite Automata and Regular Languages

Math 455 Some notes on Cardinality and Transfinite Induction

Theory of Computation

16.1 Countability. CS125 Lecture 16 Fall 2014

We define the multi-step transition function T : S Σ S as follows. 1. For any s S, T (s,λ) = s. 2. For any s S, x Σ and a Σ,

CS 121, Section 2. Week of September 16, 2013

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

Chapter 1. Sets and Mappings

Introduction to Automata

Discrete Mathematics: Lectures 6 and 7 Sets, Relations, Functions and Counting Instructor: Arijit Bishnu Date: August 4 and 6, 2009

Theory of Computation

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

Proving languages to be nonregular

Theory of computation: initial remarks (Chapter 11)

Automata and Languages

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

Prof. Ila Varma HW 8 Solutions MATH 109. A B, h(i) := g(i n) if i > n. h : Z + f((i + 1)/2) if i is odd, g(i/2) if i is even.

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

CS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)

Theory of computation: initial remarks (Chapter 11)

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

1.A Sets, Relations, Graphs, and Functions 1.A.1 Set a collection of objects(element) Let A be a set and a be an elements in A, then we write a A.

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Computational Theory

Exercises for Unit VI (Infinite constructions in set theory)

Theory of Languages and Automata

DM17. Beregnelighed. Jacob Aae Mikkelsen

CSCE 551: Chin-Tser Huang. University of South Carolina

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Axioms for Set Theory

6 CARDINALITY OF SETS

Cardinality and ordinal numbers

ACS2: Decidability Decidability

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

MATH 3300 Test 1. Name: Student Id:

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Equivalence of Regular Expressions and FSMs

Decidability. William Chan

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

SETS AND FUNCTIONS JOSHUA BALLEW

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Turing Machines, diagonalization, the halting problem, reducibility

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Part 3 out of 5. Automata & languages. A primer on the Theory of Computation. Last week, we learned about closure and equivalence of regular languages

ECS 120 Lesson 18 Decidable Problems, the Halting Problem

Notes on ordinals and cardinals

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

0 Sets and Induction. Sets

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017

Economics 204 Summer/Fall 2011 Lecture 2 Tuesday July 26, 2011 N Now, on the main diagonal, change all the 0s to 1s and vice versa:

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

General Fuzzy Automata

Chapter 0 Introduction. Fourth Academic Year/ Elective Course Electrical Engineering Department College of Engineering University of Salahaddin

Decidability (What, stuff is unsolvable?)

Math Fall 2014 Final Exam Solutions

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

COMP4141 Theory of Computation

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

What we have done so far

Computational Models #1

Economics 204 Fall 2011 Problem Set 1 Suggested Solutions

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

Sets, Structures, Numbers

S15 MA 274: Exam 3 Study Questions

2. Prime and Maximal Ideals

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible

Languages, regular languages, finite automata

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

The Pumping Lemma and Closure Properties

MA/CSSE 474 Theory of Computation. Your Questions? Previous class days' material Reading Assignments

Fooling Sets and. Lecture 5

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

1. Induction on Strings

Finite and Infinite Sets

Functions. Definition 1 Let A and B be sets. A relation between A and B is any subset of A B.

INF210 Datamaskinteori (Models of Computation)

Discrete Mathematics 2007: Lecture 5 Infinite sets

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

Math 4603: Advanced Calculus I, Summer 2016 University of Minnesota Notes on Cardinality of Sets

Transcription:

Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 1: Introducing Formal Languages

Motivation I This course is about the study of a fascinating and important subject: the theory of computation.

Motivation I This course is about the study of a fascinating and important subject: the theory of computation. It comprises the fundamental mathematical properties of computer hardware, software, and certain applications thereof. We are going to determine what can and cannot be computed. If it can, we also seek to figure out on which type of computational model, how quickly, and with how much memory.

Motivation II Theory of computation has many connections with engineering practice, and, as a true science, it also comprises philosophical aspects.

Motivation II Theory of computation has many connections with engineering practice, and, as a true science, it also comprises philosophical aspects. Since formal languages are of fundamental importance to computer science, we shall start our course by having a closer look at them.

Motivation II Theory of computation has many connections with engineering practice, and, as a true science, it also comprises philosophical aspects. Since formal languages are of fundamental importance to computer science, we shall start our course by having a closer look at them. First, we clarify the subject of formal language theory.

Motivation III Generally speaking, formal language theory concerns itself with sets of strings called languages and different mechanisms for generating and recognizing them. Mechanisms for generating sets of strings are usually referred to as grammars and mechanisms for recognizing sets of strings are called acceptors or automata.

Motivation III Generally speaking, formal language theory concerns itself with sets of strings called languages and different mechanisms for generating and recognizing them. Mechanisms for generating sets of strings are usually referred to as grammars and mechanisms for recognizing sets of strings are called acceptors or automata. A mathematical theory for generating and accepting languages emerged in the later 1950 s and has been extensively developed since then. Nowadays there are elaborated theories for both computer languages and natural languages.

Motivation IV We have to restrict ourselves to the most fundamental parts of formal language theory, i.e., to the regular languages, the context-free languages, and the recursively enumerable languages. This will suffice to obtain a basic understanding of what formal language theory is all about and what are the fundamental proof techniques.

Motivation IV We have to restrict ourselves to the most fundamental parts of formal language theory, i.e., to the regular languages, the context-free languages, and the recursively enumerable languages. This will suffice to obtain a basic understanding of what formal language theory is all about and what are the fundamental proof techniques. For having a common ground, we shortly recall the mathematical background needed.

Background I For any set M, by card(m) and (M) we denote the cardinality of M and the power set of M, respectively.

Background I For any set M, by card(m) and (M) we denote the cardinality of M and the power set of M, respectively. Let X, Y be any two sets; then we use X Y, X Y and X \ Y to denote the union, intersection and difference of X and Y, respectively.

Background I For any set M, by card(m) and (M) we denote the cardinality of M and the power set of M, respectively. Let X, Y be any two sets; then we use X Y, X Y and X \ Y to denote the union, intersection and difference of X and Y, respectively. Furthermore, we denote the empty set by.

Background I For any set M, by card(m) and (M) we denote the cardinality of M and the power set of M, respectively. Let X, Y be any two sets; then we use X Y, X Y and X \ Y to denote the union, intersection and difference of X and Y, respectively. Furthermore, we denote the empty set by. By N = {0, 1, 2,...} we denote the set of all natural numbers. We set N + = N \ {0}.

Background II If we have countably many sets X 0, X 1,..., then we use i N X i to denote the union of all X i, i.e., X i = X 0 X 1 X n. (1) i N

Background II If we have countably many sets X 0, X 1,..., then we use i N X i to denote the union of all X i, i.e., X i = X 0 X 1 X n. (1) i N Analogously, we write i N X i to denote the intersection of all X i, i.e., X i = X 0 X 1 X n. (2) i N

Background III It is useful to have the following notions: Let X, Y be any sets and let f: X Y be a function. For any y Y we define f 1 (y) = {x x X, f(x) = y}. (3) We refer to f 1 (y) as to the set of pre-images of y.

Background III It is useful to have the following notions: Let X, Y be any sets and let f: X Y be a function. For any y Y we define f 1 (y) = {x x X, f(x) = y}. (3) We refer to f 1 (y) as to the set of pre-images of y. Also, we need the following definition: Definition 1 Let X, Y be any sets and let f: X Y be a function. The function f is said to be (1) injective if f(x) = f(y) implies x = y for all x, y X; (2) surjective if for every y Y there is an x X such that f(x) = y; (3) bijective if f is injective and surjective.

Background IV Next, let X and Y be any sets. We say that X and Y have the same cardinality if there exists a bijection f: X Y. If a set X has the same cardinality as the set N of natural numbers, then we say that X is countably infinite.

Background IV Next, let X and Y be any sets. We say that X and Y have the same cardinality if there exists a bijection f: X Y. If a set X has the same cardinality as the set N of natural numbers, then we say that X is countably infinite. A set X is at most countably infinite if it is finite or countably infinite. If X and X is at most countably infinite, then there exists a surjection f: N X, i.e., X = {f(0), f(1), f(2),...}. So, intuitively, we can enumerate all the elements of X (where repetitions are allowed).

Background V The following theorem is of fundamental importance: Theorem 1 (Cantor s Theorem) For every countably infinite set X the set (X) is not countably infinite.

Background V The following theorem is of fundamental importance: Theorem 1 (Cantor s Theorem) For every countably infinite set X the set (X) is not countably infinite. Since X is countably infinite, there is a bijection f: N X. Suppose that (X) is countably infinite. Then there must exist a bijection g: N (X).

Background V The following theorem is of fundamental importance: Theorem 1 (Cantor s Theorem) For every countably infinite set X the set (X) is not countably infinite. Since X is countably infinite, there is a bijection f: N X. Suppose that (X) is countably infinite. Then there must exist a bijection g: N (X). Now, we define a diagonal set D as follows: D = {f(j) j N, f(j) g(j)}. By construction, D X and hence D (X). Consequently, there must be a number d N such that D = g(d).

Background VI Now, we consider f(d). By the definition of f we know that f(d) X. Since D X, there are two possible cases, either f(d) D or f(d) D.

Background VI Now, we consider f(d). By the definition of f we know that f(d) X. Since D X, there are two possible cases, either f(d) D or f(d) D. Case 1. f(d) D. By the definition of D and d we directly get f(d) D f(d) g(d) f(d) D, since g(d) = D. This contradiction shows that Case 1 cannot happen.

Background VII Case 2. f(d) D. Again, by construction, f(d) D holds if and only if f(d) g(d) if and only if f(d) D, again a contradiction. Thus, Case 2 cannot happen either, and hence the supposition that (X) is countably infinite, cannot hold.

Relations I Let X, Y be any non-empty sets. We set X Y = {(x, y) x X and y Y}. Every ρ X Y is said to be a binary relation. We sometimes use the notation xρy instead of writing (x, y) ρ. Of special importance is the case where X = Y. If ρ X X then we also say that ρ is a binary relation over X.

Relations II Definition 2 Let X be any set, and let ρ be any binary relation over X. The relation ρ is said to be (1) reflexive if (x, x) ρ for all x X; (2) symmetric if (x, y) ρ implies (y, x) ρ for all x, y X; (3) transitive if (x, y) ρ and (y, z) ρ implies (x, z) ρ for all x, y, z X; (4) antisymmetric if (x, y) ρ and (y, x) ρ implies x = y for all x, y, z X.

Relations II Definition 2 Let X be any set, and let ρ be any binary relation over X. The relation ρ is said to be (1) reflexive if (x, x) ρ for all x X; (2) symmetric if (x, y) ρ implies (y, x) ρ for all x, y X; (3) transitive if (x, y) ρ and (y, z) ρ implies (x, z) ρ for all x, y, z X; (4) antisymmetric if (x, y) ρ and (y, x) ρ implies x = y for all x, y, z X. Any binary relation satisfying (1) through (3) is called equivalence relation. For any x X, we write [x] to denote the equivalence class generated by x, i.e., [x] = {y y X and (x, y) ρ}.

Relations III Any relation satisfying (1), (3) and (4) is called partial order. In this case, we also say that (X, ρ) is a partially ordered set.

Relations III Any relation satisfying (1), (3) and (4) is called partial order. In this case, we also say that (X, ρ) is a partially ordered set. Definition 3 Let ρ X Y and τ Y Z be binary relations. The composition of ρ and τ is the binary relation ζ X Z defined as ζ = ρτ = {(x, z) there is a y Y such that (x, y) ρ, (y, z) τ}.

Relations IV Now, let X be any set; there is a special binary relation ρ 0 called equality, and defined as ρ 0 = {(x, x) x X}. Moreover, let ρ X X be any binary relation. We inductively define ρ i+1 = ρ i ρ for each i N.

Relations IV Now, let X be any set; there is a special binary relation ρ 0 called equality, and defined as ρ 0 = {(x, x) x X}. Moreover, let ρ X X be any binary relation. We inductively define ρ i+1 = ρ i ρ for each i N. Definition 4 Let X be any set, and ρ be any binary relation over X. The reflexive-transitive closure of ρ is the binary relation ρ = i N ρi.

Relations IV Now, let X be any set; there is a special binary relation ρ 0 called equality, and defined as ρ 0 = {(x, x) x X}. Moreover, let ρ X X be any binary relation. We inductively define ρ i+1 = ρ i ρ for each i N. Definition 4 Let X be any set, and ρ be any binary relation over X. The reflexive-transitive closure of ρ is the binary relation ρ = i N ρi. Next, we introduce a formalism to deal with strings and sets of strings.

Alphabets By Σ we denote a finite non-empty set called alphabet. The elements of Σ are assumed to be indivisible symbols and referred to as letters or symbols. Examples: Σ = {0, 1} is an alphabet containing the letters 0 and 1, and Σ = {a, b, c} is an alphabet containing the letters a, b, and c. In compiling, we may also have alphabets containing for example begin and end. But the letters begin and end are also assumed to be indivisible.

Alphabets By Σ we denote a finite non-empty set called alphabet. The elements of Σ are assumed to be indivisible symbols and referred to as letters or symbols. Examples: Σ = {0, 1} is an alphabet containing the letters 0 and 1, and Σ = {a, b, c} is an alphabet containing the letters a, b, and c. In compiling, we may also have alphabets containing for example begin and end. But the letters begin and end are also assumed to be indivisible.

Alphabets By Σ we denote a finite non-empty set called alphabet. The elements of Σ are assumed to be indivisible symbols and referred to as letters or symbols. Examples: Σ = {0, 1} is an alphabet containing the letters 0 and 1, and Σ = {a, b, c} is an alphabet containing the letters a, b, and c. In compiling, we may also have alphabets containing for example begin and end. But the letters begin and end are also assumed to be indivisible.

Strings Definition 5 A string over an alphabet Σ is a finite length sequence of letters from Σ. A typical string is written as s = a 1 a 2 a k, where a i Σ for i = 1,..., k.

Strings Definition 5 A string over an alphabet Σ is a finite length sequence of letters from Σ. A typical string is written as s = a 1 a 2 a k, where a i Σ for i = 1,..., k. Note that we also allow k = 0 resulting in the empty string which we denote by λ. We call k the length of s and denote it by s, so λ = 0. By Σ we denote the set of all strings over Σ, and we set Σ + = Σ \ {λ}.

Concatenation Let s, w Σ ; we define a binary operation called concatenation (or word product). The concatenation of s and w is the string sw.

Concatenation Let s, w Σ ; we define a binary operation called concatenation (or word product). The concatenation of s and w is the string sw. Example: Let Σ = {0, 1}, s = 000111 and w = 0011; then sw = 0001110011.

Properties of Concatenation Proposition 1 Let Σ be any alphabet. (1) Concatenation is associative, i.e., for all x, y, z Σ, x(yz) = (xy)z. (2) The empty string λ is a two-sided identity for Σ, i.e., for all x Σ, xλ = λx = x. (3) Σ is free of nontrivial identities, i.e., for all x, y, z Σ, i) zx = zy implies x = y and, ii) xz = yz implies x = y. (4) For all x, y Σ, xy = x + y.

Extension to Sets of Strings Let X, Y be sets of strings. Then the product of X and Y is defined as XY = {xy x X and y Y}. Let X Σ ; define X 0 = {λ} and for all i 0 set X i+1 = X i X. The Kleene closure of X is defined as X = i N Xi, and the semigroup closure of X is X + = i N + Xi. Finally, we define the transpose of a string and of sets of strings.

Extension to Sets of Strings Let X, Y be sets of strings. Then the product of X and Y is defined as XY = {xy x X and y Y}. Let X Σ ; define X 0 = {λ} and for all i 0 set X i+1 = X i X. The Kleene closure of X is defined as X = i N Xi, and the semigroup closure of X is X + = i N + Xi. Finally, we define the transpose of a string and of sets of strings. Definition 6 Let Σ be any alphabet. The transpose operator is defined on strings in Σ and on sets X Σ of strings as follows: λ T = λ, and (xa) T = a(x T ) for all x Σ and all a Σ X T = {x T x X}.

Languages I Definition 7 Let Σ be any alphabet. Every subset L Σ is called language.

Languages I Definition 7 Let Σ be any alphabet. Every subset L Σ is called language. Note that the empty set as well as L = {λ} are also languages.

Languages I Definition 7 Let Σ be any alphabet. Every subset L Σ is called language. Note that the empty set as well as L = {λ} are also languages. Next, we ask how many languages there are. Let m be the cardinality of Σ. There is precisely one string of length 0, i.e., λ, there are m strings of length 1, i.e., a for all a Σ, there are m 2 many strings of length 2, and in general there are m n many strings of length n. Thus, the cardinality of Σ is countably infinite.

Languages II By Cantor s theorem we know that card(m) < card( (M)). So, we can conclude that there are uncountably many languages (as much as there are real numbers). Since the generation and recognition of languages should be done algorithmically, we immediately see that only countably many languages can be generated and recognized by an algorithm.

Palindromes I A palindrome is a string that reads the same from left to right and from right to left, e.g., AKASAKA

Palindromes I A palindrome is a string that reads the same from left to right and from right to left, e.g., AKASAKA ddddddd ddddddddddd dddddddddd

Palindromes I A palindrome is a string that reads the same from left to right and from right to left, e.g., AKASAKA ddddddd ddddddddddd dddddddddd Now we ask how can we describe the language of all palindromes over the alphabet {a, b} (just to keep it simple).

Palindromes II So let us try it. Of course λ, a, and b are palindromes. Every palindrome must begin and end with the same letter, and if we remove the first and last letter of a palindrome, we still get a palindrome. This observation suggests the following basis and induction for defining L pal :

Palindromes II So let us try it. Of course λ, a, and b are palindromes. Every palindrome must begin and end with the same letter, and if we remove the first and last letter of a palindrome, we still get a palindrome. This observation suggests the following basis and induction for defining L pal : Induction Basis: λ, a, and b are palindromes.

Palindromes II So let us try it. Of course λ, a, and b are palindromes. Every palindrome must begin and end with the same letter, and if we remove the first and last letter of a palindrome, we still get a palindrome. This observation suggests the following basis and induction for defining L pal : Induction Basis: λ, a, and b are palindromes. Induction Step: If w {a, b} is a palindrome, then awa and bwb are also palindromes. Furthermore, no string w {a, b} is a palindrome, unless it follows from this basis and induction step.

Palindromes II So let us try it. Of course λ, a, and b are palindromes. Every palindrome must begin and end with the same letter, and if we remove the first and last letter of a palindrome, we still get a palindrome. This observation suggests the following basis and induction for defining L pal : Induction Basis: λ, a, and b are palindromes. Induction Step: If w {a, b} is a palindrome, then awa and bwb are also palindromes. Furthermore, no string w {a, b} is a palindrome, unless it follows from this basis and induction step. But stop, we could have also used the transpose operator T to define the language of all palindromes, i.e., L pal = {w {a, b} w = w T }.

Palindromes III We used a different notation in the latter definition, since we still do not know whether or not L pal = L pal. For getting this equality, we need a proof.

Palindromes III We used a different notation in the latter definition, since we still do not know whether or not L pal = L pal. For getting this equality, we need a proof. Theorem 2 L pal = L pal.

Palindromes III We used a different notation in the latter definition, since we still do not know whether or not L pal = L pal. For getting this equality, we need a proof. Theorem 2 L pal = L pal. Proof. Equality of sets X, Y is often proved by showing X Y and Y X. So, let us first show that L pal L pal.

Palindromes IV We start with the strings defined by the basis, i.e., λ, a, and b. By the definition of the transpose operator, we have λ T = λ. Thus, λ L pal. Next, we deal with a. In order to apply the definition of the transpose operator, we use Property (2) of Proposition 1, i.e., a = λa. Then, we have a T = (λa) T = aλ T = aλ = a. The proof for b is analogous and thus omitted.

Palindromes IV We start with the strings defined by the basis, i.e., λ, a, and b. By the definition of the transpose operator, we have λ T = λ. Thus, λ L pal. Next, we deal with a. In order to apply the definition of the transpose operator, we use Property (2) of Proposition 1, i.e., a = λa. Then, we have a T = (λa) T = aλ T = aλ = a. The proof for b is analogous and thus omitted. Now, the induction hypothesis is that for all strings w with w n, we have w L pal implies w L pal. In accordance with our definition of L pal, the induction step is from n to n + 2. Let w L pal be any string with w = n + 2. Thus, w = ava or w = bvb, where v {a, b} such that v = n. Then v is a palindrome in the sense of the definition of L pal, and by the induction hypothesis, we know that v = v T.

Palindromes V The following claims provide a special property of the transpose operator: Claim 1. Let Σ be any alphabet, n N +, and w = w 1... w n Σ, where w i Σ for all i {1,..., n}. Then w T = w n... w 1.

Palindromes V The following claims provide a special property of the transpose operator: Claim 1. Let Σ be any alphabet, n N +, and w = w 1... w n Σ, where w i Σ for all i {1,..., n}. Then w T = w n... w 1. Claim 2. For all n N, if p = p 1 xp n+2 then p T = p n+2 x T p 1 for all p 1, p n+2 {a, b} and x {a, b}, where x = n.

Palindromes V The following claims provide a special property of the transpose operator: Claim 1. Let Σ be any alphabet, n N +, and w = w 1... w n Σ, where w i Σ for all i {1,..., n}. Then w T = w n... w 1. Claim 2. For all n N, if p = p 1 xp n+2 then p T = p n+2 x T p 1 for all p 1, p n+2 {a, b} and x {a, b}, where x = n. Note that Claim 1 is needed to show Claim 2. The proofs are left as exercise. By using Claim 2 just established we get w T = (ava) T = av T a }{{} = ava = w. by IH Again, the case w = bvb can be handled analogously and is thus omitted.

Palindromes VI Finally, we have to show L pal L pal. For the induction basis, we know that λ = λ T, i.e., λ L pal and by the induction basis of the definition of L pal, we also know that λ L pal. Thus, we have the induction hypothesis that for all strings w of length n: if w = w T then w L pal.

Palindromes VI Finally, we have to show L pal L pal. For the induction basis, we know that λ = λ T, i.e., λ L pal and by the induction basis of the definition of L pal, we also know that λ L pal. Thus, we have the induction hypothesis that for all strings w of length n: if w = w T then w L pal. The induction step is from n to n + 1. That is, we have to show if w = n + 1 and w = w T then w L pal.

Palindromes VI Finally, we have to show L pal L pal. For the induction basis, we know that λ = λ T, i.e., λ L pal and by the induction basis of the definition of L pal, we also know that λ L pal. Thus, we have the induction hypothesis that for all strings w of length n: if w = w T then w L pal. The induction step is from n to n + 1. That is, we have to show if w = n + 1 and w = w T then w L pal. Since the case n = 1 directly results in a and b and since a, b L pal, we assume n > 1 in the following.

Palindromes VII So, let w {a, b} be any string with w = n + 1 and w = w T, say w = a 1... a n+1, where a i Σ. Thus, by assumption we have a 1... a n+1 = a n+1... a 1.

Palindromes VII So, let w {a, b} be any string with w = n + 1 and w = w T, say w = a 1... a n+1, where a i Σ. Thus, by assumption we have a 1... a n+1 = a n+1... a 1. Now, applying Property (3) of Proposition 1 directly yields a 1 = a n+1. We have to distinguish the cases a 1 = a and a 1 = b. Since both cases can be handled analogously, we consider only the case a 1 = a here. Thus, we can conclude w = ava, where v {a, b} and v = n 1. Next, applying the property of the transpose operator established above, we obtain v = v T, i.e., v L pal. Finally, the induction part of the definition of L pal directly implies w L pal.

Thank you!