MIT 18.404 — Lecture 1
Introduction, Finite Automata, Regular Expressions
The class website is https://math.mit.edu/ sipser/18404/, taught by Michael Sipser. This course follows the textbook Introduction to the Theory of Computation, 3rd edition (also written by Michael Sipser).
§ Finite Automata
One simplified model of computation is the finite automaton. Here's a prototypical example.

Definition. A finite automaton is a five-tuple of the following:
A finite set of states. In this example, we have .
A finite input alphabet . In this example, we have .
A transition function . In this example, the map is given by the labels of the edges of a directed graph.
A start state . In this example, we have .
A set of accept states. In this example, we have .
We say that “ accepts ” if starting at and following the arrows according to lands at an accept state.
Example. In the example above, we say that accepts but rejects .
Remark. Note that an accept state of a finite automaton need not be “stable”; it may have arrows to other states.
§ (Regular) Languages
Definition. Given a finite automaton , the language of is the set of all (finite) strings that accepts. Furthermore, we say that “ recognizes ” for some language if and only if .
Example. In the example above, the language of is the set of (finite) strings with as a substring.
Definition. A language is regular if is the language of some finite automaton.
Example. It turns out that…
The language of all strings with an even number of s is regular. (Obviously.)
The language of all strings with an equal number of s and s is not regular. (Not so obviously.)
Our goal is to be able to identify what the regular languages are.
§ Regular Operations and Regular Expressions
It helps to define the following:
Definition. For any two languages and , we can construct new languages via the regular operations:
Their union is .
Their concatenation is .
The star of a language is (that is, the regex
*).Note that always contains the empty string, which we denote .
Example. If and , then we have:
Meanwhile, we have .
Definition. We say that a regular expression is any expression formed using , , atoms , and regular operations.
Write to mean the set of all finite (possibly empty) binary strings.
Write to mean the set of all binary strings that end in .
Write to mean the set of all binary strings with as a substring.
Things like are also regular expressions.
As the name suggests, the following turns out to be true.
Theorem. (Regular Expressions are Regular) A language is regular if and only if some regular expression describes it.
For the rest of lecture, we'll work through a proof of one step of the “if” direction.
Theorem. (Union of Regular Languages) If and are regular languages, then so is .
Proof: The idea is to use the automata and that recognize and (respectively) and run them both simultaneously in a single automaton by taking their “cross product”. Here's an example of what that might look like.

Here, and are depicted as “one-dimensional” automata, drawn horizontally and vertically, respectively. Their cross product is the grid of states above and to the right of them. Evidently, the language of is .
Formally, writing , the proof is to consider the finite automaton given by:
The state set .
The input alphabet .
The transition function .
The start state .
The accept states .
And that's it.
Remark. Implicitly, we've assumed that the languages and use the same alphabet . We will almost always assume this in general, but even without this assumption, the argument is easily repairable by taking instead.
By replacing “” with “” in the proof, one can also prove the following:
Theorem. (Intersection of Regular Languages) If and are regular languages, then so is .