Advanced Regular Properties

Lesson 12 proves languages regular without building anything. It covers the subsequence order and how it differs from the substring order, upward and downward closed languages, and well-quasi-orderings with their equivalent characterization as having no descending chain and no antichain. It then proves Dickson's lemma on tuples by extraction and explains why finitely many coordinates is essential, sketches Higman's theorem by the minimal-bad-sequence argument and the role of the finite alphabet, and gives the finite-basis property and the consequence that every subsequence-closed language is regular. It ends on the cost: the argument is non-constructive and yields no machine.

Subject: Theory of Computation · 114 slides · symbolic lesson

Open the interactive version of this deck · Homework for this lesson

What this lesson covers

The lesson, slide by slide

1. Advanced Regular Properties

Title

Theory of Computation · Lesson 12

Some languages are regular for reasons that have nothing to do with building a machine. Higman, Dickson, and the surprising power of a well-behaved ordering.

2. What you will be able to do

Objectives

Lessons 10 and 11 showed how to prove languages irregular. This lesson shows a way to prove languages regular without exhibiting anything. By the end you can:

  1. Define the subsequence order on strings and check it on examples.
  2. State what a well-quasi-ordering is, and give the three equivalent characterizations.
  1. State and use Dickson's lemma on tuples of natural numbers.
  2. State Higman's theorem and prove the finite-basis consequence from it.
  1. Show that every subsequence-closed language is regular, non-constructively.
  2. Explain why such a proof gives no machine, and why that is a genuine limitation.

3. What survived from Applications of the Pumping Lemma?

Warm-up

Discussion prompt

Before we open Advanced Regular Properties: without looking back, what was the main idea of Applications of the Pumping Lemma, and what could you do by the end of it that you could not do before?

Hint: One sentence for the idea, one for the skill. If the second one is blank, that is the part to revisit.

Answer:

Lesson 11 is a worked catalogue of non-regularity proofs. It gives the canonical matched-counts proof and the trap of choosing your own split, then counting languages and the line between bounded and unbounded quantities, and shape languages such as palindromes and repeated blocks, handled with the marker trick. It works arithmetic languages that need gap and factorization arguments, for the perfect squares and for the primes, and shows closure arguments as the shorter alternative. It ends with a language that pumps yet is not regular, together with the distinguishable-prefix fallback, and a diagnostic table for repairing failed attempts.

4. The Subsequence Order

Section

Section 1

5. Subsequences, not substrings

Concept

Two different notions of 'part of a string' are easy to confuse, and this lesson depends entirely on the less familiar one.

subsequence — A string obtained from another by deleting any number of symbols, from any positions, keeping the rest in order.

RelationFrom abcde you can getContiguous?
substringbcd, cde, abcyes
subsequencebcd, ace, ad, abcdeno

Every substring is a subsequence, but not conversely. The subsequence relation is much looser, and that looseness is exactly what makes the theorems below work.

6. Fill in: From abcde you can get for Subsequences, not substrings

Comparison

Comparison matrix

From Subsequences, not substrings: refill the From abcde you can get column from what you know. The rest of the table is as it appeared.

RelationFrom abcde you can getContiguous?
substringbcd, cde, abcyes
subsequencebcd, ace, ad, abcdeno

7. The order it defines

Concept

Write that one string embeds in another when the first is a subsequence of the second. This is a relation on the set of all strings.

\[ u \preceq v \quad \overset{\text{def}}{\iff} \quad u \text{ is a subsequence of } v \]

It is reflexive, since every string is a subsequence of itself, and transitive, since deleting from a deletion is a deletion. So it is a quasi-order in the sense of Lesson 1.

It is also antisymmetric on strings, since two strings that embed in each other must have equal length and hence be equal. So it is in fact a partial order — but the theorems only need the quasi-order structure.

\[ u \preceq v \text{ and } v \preceq u \;\Rightarrow\; u = v \]

8. Break it if you can: The order it defines

Counterexample

Discussion prompt

Write that one string embeds in another when the first is a subsequence of the second. This is a relation on the set of all strings.

That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.

Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.

9. What has to happen first: Check the order on concrete strings

Ranking

Put in order

Put the moves of Check the order on concrete strings into the order they have to happen.

  1. Check an obvious case
  2. Check a non-contiguous case
  3. Check a case that fails
  4. Note the empty string
  5. Verify the count of subsequences on a short string

Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Delete the first and last symbols of abcde to leave bcd.

10. Check the order on concrete strings

Worked example

Get the relation into your fingers before using it, since the looseness is easy to underestimate.

Check an obvious case

Why: Delete the first and last symbols of abcde to leave bcd. Every symbol kept stayed in its original order, so the relation holds.

\[ bcd \preceq abcde \]

Check a non-contiguous case

Why: Keep the first, third and fifth symbols. They remain in order, so this also embeds — even though the result is not a substring.

\[ ace \preceq abcde \]

Check a case that fails

Why: The string ba cannot embed, because b appears after a in the target and the relation must preserve order.

\[ ba \not\preceq abcde \]

Note the empty string

Why: Deleting everything leaves the empty string, so it embeds in every string at all. It is the least element of the order.

\[ \varepsilon \preceq v \quad \text{for every } v \]

Verify the count of subsequences on a short string

Why: The string abc has one subsequence per subset of its positions, and the three positions give eight subsets. Listing them gives the empty string, a, b, c, ab, ac, bc and abc — eight, matching the count, and every one is genuinely order-preserving.

\[ 2^{3} = 8 \text{ subsequences of } abc \ \checkmark \]

11. Check the order on concrete strings — line by line

Picture it

Animation

Shows: Each line of the worked example "Check the order on concrete strings", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Delete the first and last symbols of abcde to leave bcd. Every symbol kept stayed in its original order, so the relation holds.

12. Closed languages

Concept

Two kinds of language interact especially well with an order, and both come up constantly.

  1. A language is downward closed when every subsequence of a member is a member.
  2. A language is upward closed when every string containing a member as a subsequence is a member.

\[ \text{down: } v \in L, u \preceq v \Rightarrow u \in L \qquad \text{up: } u \in L, u \preceq v \Rightarrow v \in L \]

The two notions are complementary: a language is downward closed exactly when its complement is upward closed. So a theorem about one gives a theorem about the other for free.

13. By analogy: Closed languages

Analogy

Discussion prompt

Explain Closed languages by analogy to something with no Theory of Computation in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.

Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.

Answer:

Two kinds of language interact especially well with an order, and both come up constantly.

14. Plan first: Recognize closed languages

Step zero

Discussion prompt

Recognize closed languages — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Take the strings containing at least one a

Answer:

  1. Take the strings containing at least one a
  2. Take the strings containing at most three a's
  3. Take the strings containing the block ab as a subsequence
  4. Take a language that is neither
  5. Verify the complementation relationship on one pair

15. Recognize closed languages

Worked example

Classify a few languages, since spotting closure is what makes the theorems applicable.

Take the strings containing at least one a

Why: Adding symbols to such a string keeps the a present, so it is upward closed. Deleting could remove the only a, so it is not downward closed.

Take the strings containing at most three a's

Why: Deleting symbols cannot increase the count, so every subsequence still qualifies. This is downward closed, and not upward closed.

Take the strings containing the block ab as a subsequence

Why: Adding symbols preserves the embedding, so it is upward closed. This is exactly the strings with an a somewhere before a b.

\[ L = \{\, w : ab \preceq w \,\} \]

Take a language that is neither

Why: The strings of even length are neither: deleting one symbol leaves odd length, and adding one does too.

Verify the complementation relationship on one pair

Why: The strings with at most three a's and the strings with at least four a's are complements. The first is downward closed and the second is upward closed, exactly as the general statement predicts.

\[ L \text{ down-closed} \iff \overline{L} \text{ up-closed} \ \checkmark \]

16. Recognize closed languages — line by line

Picture it

Animation

Shows: Each line of the worked example "Recognize closed languages", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: The strings with at most three a's and the strings with at least four a's are complements. The first is downward closed and the second is upward closed, exactly as the general statement predicts.

17. Why closure should feel like a strong condition

Intuition

Downward and upward closed languages are highly constrained, and it pays to feel why before the theorems arrive.

An upward closed language is determined entirely by its minimal members: once you know those, everything above them is in, and nothing else is. So the whole language is described by a possibly small set of witnesses.

The theorems below say that set is always finite — which immediately makes the language a finite union of simple pieces, and hence regular. The entire lesson is that one implication, made precise.

\[ \text{finitely many minimal elements} \;\Rightarrow\; \text{regular} \]

18. Teach it back: Why closure should feel like a strong condition

Explain it

Discussion prompt

Explain Why closure should feel like a strong condition to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.

Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.

Answer:

Downward and upward closed languages are highly constrained, and it pays to feel why before the theorems arrive.

19. Rebuild the recipe: How to use an order to prove regularity

Ranking

Put in order

These are the steps of How to use an order to prove regularity, scrambled. Put them back in order before the next slide shows you.

  1. Show the language is closed upward or downward under the subsequence order.
  2. Invoke the theorem that this order is well behaved.
  3. Conclude the set of minimal members is finite.
  4. Write the language as a finite union of upward cones, one per minimal member.
  5. Observe each cone is regular, and finite unions of regular languages are regular.

Why: This is the order the recipe itself gives. Recalling the sequence without the slide in front of you is the difference between recognising the method and being able to run it — most of what goes wrong in practice is a step done out of turn.

20. How to use an order to prove regularity

Pattern

The strategy, before the machinery. It is worth having the shape in mind while the definitions arrive.

  1. Show the language is closed upward or downward under the subsequence order.
  2. Invoke the theorem that this order is well behaved.
  3. Conclude the set of minimal members is finite.
  4. Write the language as a finite union of upward cones, one per minimal member.
  5. Observe each cone is regular, and finite unions of regular languages are regular.

Step three is where all the mathematics lives. Steps four and five are routine once it is available.

21. Rule out three: Check yourself: the subsequence order

Elimination

Eliminate the wrong options

Which of these strings is NOT a subsequence of the string banana?

3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.

  • A. nab
  • B. ban
  • C. aaa
  • D. bnn

Survives elimination: A

Why: Reading banana left to right, an n never appears before an a that is followed by a b — the only b is the very first symbol. So the pattern n, then a, then b cannot be embedded in order.

22. Check yourself: the subsequence order

Check

Remember that subsequences need not be contiguous.

Check your understanding

Which of these strings is NOT a subsequence of the string banana?

  • A. nab (correct)
  • B. ban
  • C. aaa
  • D. bnn

Answer: A

Why: Reading banana left to right, an n never appears before an a that is followed by a b — the only b is the very first symbol. So the pattern n, then a, then b cannot be embedded in order.

Why B tempts people
Take the first three symbols directly. They already spell b, a, n in order.
Why C tempts people
The three a's sit at positions two, four and six, in order, so this embeds.
Why D tempts people
Take the b at position one, then the n at position three, then the n at position five.

23. Well-Quasi-Orderings

Section

Section 2

24. The definition

Concept

The property that makes everything work has a name, and the definition is deceptively short.

well-quasi-ordering — A reflexive, transitive relation in which every infinite sequence of elements contains some earlier element that is below some later one.

\[ \forall x_1, x_2, x_3, \dots \;\; \exists i < j \; : \; x_i \preceq x_j \]

Read that carefully. It does not say the sequence is increasing, or that it has an increasing subsequence starting at the front. It says that somewhere in any infinite list, a later element sits above an earlier one.

25. Quasi-order, partial order, well-order

Concept

Four related notions get used interchangeably in casual speech, and this lesson needs them kept apart.

NotionRequiresExample
quasi-orderreflexive and transitiveany preorder
partial orderalso antisymmetricsubsequence order
total orderalso every pair comparablethe natural numbers
well-ordertotal, and every subset has a least elementthe natural numbers

A well-quasi-ordering sits alongside these rather than inside them: it demands nothing about comparability of individual pairs, only about infinite sequences. The subsequence order is a partial order that is not total, yet is a well-quasi-ordering.

26. Which is which, by Example

Discrimination

Sort into buckets

Sort these by Example, from memory, without looking back at Quasi-order, partial order, well-order. Telling them apart on the spot is the skill; the table is only where the answer happens to be written down.

any preorder
quasi-order
subsequence order
partial order
the natural numbers
total order; well-order
g1
Example is "any preorder" for quasi-order — that is what the table on "Quasi-order, partial order, well-order" records, and it is the single property separating this group from the rest.
g2
Example is "subsequence order" for partial order — that is what the table on "Quasi-order, partial order, well-order" records, and it is the single property separating this group from the rest.
g3
Example is "the natural numbers" for total order, well-order — that is what the table on "Quasi-order, partial order, well-order" records, and it is the single property separating this group from the rest.

27. Guess the shape of the answer: Check the three conditions on a small order

Estimation

Predict first

Practise the definitions on a finite example, where everything can be checked exhaustively.

Commit before you compute: what does Check the three conditions on a small order come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.

Correct: Verify why a finite order is automatically a well-quasi-ordering

Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Any infinite sequence drawn from a finite set must repeat some element, and a repeat gives an earlier element embedding in a later one by reflexivity.

28. Check the three conditions on a small order

Worked example

Practise the definitions on a finite example, where everything can be checked exhaustively.

Take the strings of length at most two over one symbol

Why: Three strings: the empty string, a single a, and two a's. Order them by the subsequence relation.

\[ \varepsilon \preceq a \preceq aa \]

Check reflexivity and transitivity

Why: Each string is a subsequence of itself, and the chain composes, so the relation is a quasi-order.

Check antisymmetry

Why: No two distinct strings embed in each other, since embedding cannot increase length. So it is a partial order too.

Check for antichains and descending chains

Why: The order is a chain, so there are no incomparable pairs at all, and it is finite so there is no infinite descent.

Verify why a finite order is automatically a well-quasi-ordering

Why: Any infinite sequence drawn from a finite set must repeat some element, and a repeat gives an earlier element embedding in a later one by reflexivity. So every finite quasi-order is a well-quasi-ordering, and the content of the theorems lies entirely in the infinite case.

\[ \text{finite set} \;\Rightarrow\; \text{some } x_i = x_j, \; i<j \;\Rightarrow\; x_i \preceq x_j \ \checkmark \]

29. Check the three conditions on a small order — line by line

Picture it

Animation

Shows: Each line of the worked example "Check the three conditions on a small order", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Each string is a subsequence of itself, and the chain composes, so the relation is a quasi-order.

30. Two things it rules out

Concept

The definition is easier to use in its negative form, which forbids two kinds of bad infinite structure.

  1. No infinite strictly descending chain. Otherwise that chain would be an infinite sequence with no later element above an earlier one.
  2. No infinite antichain. An antichain is a set of pairwise incomparable elements, and again no pair would be related the right way.

Remarkably, forbidding both is not merely necessary but sufficient. That equivalence is the standard working characterization.

\[ \text{wqo} \iff \text{well-founded} \;\text{and}\; \text{no infinite antichain} \]

31. Why antichains are the interesting half

Intuition

Well-foundedness is usually easy — most natural orders on finite objects have no infinite descending chain, because size decreases and sizes are natural numbers.

The subsequence order is like that: a proper subsequence is strictly shorter, so a descending chain must terminate. Well-foundedness comes free.

\[ u \prec v \;\Rightarrow\; |u| < |v| \]

The real content is the absence of infinite antichains — no infinite family of strings, none of which embeds in any other. That is what Higman's theorem asserts, and it is genuinely surprising.

32. What has to be given first: Find an infinite antichain in an order that…

Missing information

Discussion prompt

See the property fail, so that its success later means something.

What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.

Hint: Anything you would have to invent to get started is a thing the problem must supply.

Answer:

Say one string is below another when it appears as a contiguous block inside it.

33. Find an infinite antichain in an order that is not well behaved

Worked example

See the property fail, so that its success later means something.

Take the substring order instead of the subsequence order

Why: Say one string is below another when it appears as a contiguous block inside it.

Build a candidate antichain

Why: Consider the strings consisting of an a, then some number of b's, then an a — one for each count.

\[ w_n = a\,b^{n}\,a, \qquad n = 1, 2, 3, \dots \]

Check they are pairwise incomparable

Why: A shorter one cannot sit contiguously inside a longer one, because the longer one's interior is all b's, and any block containing both a's must be the whole string.

Conclude the substring order is not well behaved

Why: An infinite antichain exists, so the substring order is not a well-quasi-ordering. Every theorem in this lesson is therefore specific to the subsequence order.

Verify the same family is not an antichain under subsequences

Why: Under the subsequence order the shorter strings do embed in the longer ones: take the two a's and as many b's as needed. So the family that broke the substring order is harmless here — which is the first hint that the looser order is better behaved.

\[ a\,b^{2}\,a \preceq a\,b^{5}\,a \quad \text{but} \quad a\,b^{2}\,a \text{ is not a substring of } a\,b^{5}\,a \ \checkmark \]

34. Find an infinite antichain in an order that is not… — line by line

Picture it

Animation

Shows: Each line of the worked example "Find an infinite antichain in an order that is not well behaved", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: A shorter one cannot sit contiguously inside a longer one, because the longer one's interior is all b's, and any block containing both a's must be the whole string.

35. The finite-basis consequence

Concept

The reason well-quasi-orderings matter is a single corollary, and it is worth deriving rather than quoting.

Take any upward closed set. Its minimal elements — those with nothing strictly below them inside the set — form an antichain, since two minimal elements cannot be comparable.

If the order is a well-quasi-ordering, that antichain must be finite. And well-foundedness guarantees every member of the set sits above at least one minimal element.

\[ U \text{ up-closed} \;\Rightarrow\; U = \{\, v : \exists i \le k, \; b_i \preceq v \,\} \]

So the whole set is described by finitely many witnesses. That is the finite-basis property, and it is what turns an abstract order into a regularity theorem.

36. Plan first: Prove the finite-basis property

Step zero

Discussion prompt

Prove the finite-basis property — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Take an upward closed set and its minimal elements

Answer:

  1. Take an upward closed set and its minimal elements
  2. Show the minimal elements form an antichain
  3. Apply the no-infinite-antichain half
  4. Apply the well-foundedness half
  5. Verify both directions of the resulting description

37. Prove the finite-basis property

Worked example

The derivation in full, since it is short and it shows exactly where each half of the definition is used.

Take an upward closed set and its minimal elements

Why: Let the set be given, and collect those members with nothing strictly smaller inside it.

Show the minimal elements form an antichain

Why: If one minimal element were strictly below another, the second would not be minimal. So no two are comparable, which is what antichain means.

Apply the no-infinite-antichain half

Why: A well-quasi-ordering admits no infinite antichain, so the set of minimal elements is finite.

\[ \{b_1, \dots, b_k\} \text{ finite} \]

Apply the well-foundedness half

Why: Every member of the set has some minimal element below it — otherwise an infinite strictly descending chain inside the set could be built, which well-foundedness forbids.

Verify both directions of the resulting description

Why: Every member sits above some witness, by the previous step; and every string above a witness is a member, since the set is upward closed. So the set is exactly the union of the finitely many upward cones, and the description is exact rather than approximate.

\[ U = \bigcup_{i=1}^{k} \{\, v : b_i \preceq v \,\} \ \checkmark \]

38. Prove the finite-basis property — line by line

Picture it

Animation

Shows: Each line of the worked example "Prove the finite-basis property", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Every member sits above some witness, by the previous step; and every string above a witness is a member, since the set is upward closed. So the set is exactly the union of the finitely many upward cones, and the description is exact rather than approximate.

39. Answer it before you see the options: Check yourself: well-quasi-orderings

Prediction

Predict first

Which pair of conditions is equivalent to being a well-quasi-ordering?

Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.

Correct: No infinite strictly descending chain, and no infinite antichain

Why: An infinite descending chain and an infinite antichain are exactly the two ways an infinite sequence can avoid having a later element above an earlier one. Forbidding both is therefore equivalent to the definition.

40. Check yourself: well-quasi-orderings

Check

Recall which two structures the definition forbids.

Check your understanding

Which pair of conditions is equivalent to being a well-quasi-ordering?

  • A. No infinite strictly descending chain, and no infinite antichain (correct)
  • B. Every pair of elements is comparable, and the order is finite
  • C. Every subset has a least element
  • D. The order is antisymmetric and transitive

Answer: A

Why: An infinite descending chain and an infinite antichain are exactly the two ways an infinite sequence can avoid having a later element above an earlier one. Forbidding both is therefore equivalent to the definition.

Why B tempts people
Comparability of every pair is a total order, which is far stronger and not required. The subsequence order is not total, since ab and ba are incomparable.
Why C tempts people
Having a least element in every subset is well-ordering, which additionally demands totality. Well-quasi-orderings allow incomparable elements, just not infinitely many pairwise incomparable ones.
Why D tempts people
Antisymmetry and transitivity give a partial order, which says nothing about infinite behaviour. The substring order is a partial order and is not a well-quasi-ordering.

41. Dickson's Lemma

Section

Section 3

42. Tuples of natural numbers

Concept

The simplest well-quasi-ordering, and the one every other proof in this lesson leans on.

Order tuples of natural numbers componentwise: one tuple is below another when every one of its entries is at most the corresponding entry.

\[ (a_1,\dots,a_k) \preceq (b_1,\dots,b_k) \quad\iff\quad a_i \le b_i \text{ for all } i \]

Dickson's lemma — For every fixed k, the componentwise order on k-tuples of natural numbers is a well-quasi-ordering.

For one component this is just the fact that the natural numbers have no infinite descending sequence. The content is that it survives taking finite products.

43. State the rule before it runs: Prove Dickson's lemma

Hypothesis

Predict first

Prove Dickson's lemma is about to be worked. State your hypothesis first: which rule or definition decides this one, and what is the first move it forces? Then watch whether the example agrees with you.

Correct: Take an infinite sequence of tuples

Why: Suppose the lemma fails: there is an infinite sequence with no earlier tuple below any later one.

A hypothesis you wrote down is falsifiable; a vague sense of how it will go is not. If the example opens somewhere else, that gap is the thing worth chasing.

44. Prove Dickson's lemma

Worked example

The proof is a repeated extraction of monotone subsequences, and it is worth doing once because Higman's proof imitates it.

Take an infinite sequence of tuples

Why: Suppose the lemma fails: there is an infinite sequence with no earlier tuple below any later one.

Extract on the first coordinate

Why: The first coordinates form an infinite sequence of natural numbers. Every such sequence has an infinite non-decreasing subsequence, since it cannot decrease forever.

\[ \text{pass to a subsequence with } a^{(1)}_{i} \le a^{(1)}_{j} \text{ for } i < j \]

Repeat on each remaining coordinate

Why: Within that subsequence, extract again on the second coordinate, then the third, and so on. There are k coordinates, so the process stops after k extractions.

Read off the contradiction

Why: In the final subsequence every coordinate is non-decreasing, so any earlier tuple is componentwise below any later one — contradicting the assumption.

Verify that finiteness of k was essential

Why: The argument performs one extraction per coordinate, so it terminates only because k is finite. With infinitely many coordinates the lemma genuinely fails, and an infinite antichain can be built from tuples that are each smallest in a different coordinate.

\[ k \text{ finite} \;\Rightarrow\; \text{finitely many extractions} \ \checkmark \]

45. Prove Dickson's lemma — line by line

Picture it

Animation

Shows: Each line of the worked example "Prove Dickson's lemma", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: The argument performs one extraction per coordinate, so it terminates only because k is finite. With infinitely many coordinates the lemma genuinely fails, and an infinite antichain can be built from tuples that are each smallest in a different coordinate.

46. Products of well-quasi-orderings

Concept

Dickson's lemma is the special case of a general principle worth stating on its own, because it is what makes the machinery composable.

If two orders are each well-quasi-orderings, so is their product ordered componentwise. The proof is the two-step extraction from the previous slide, done once per factor.

\[ (A, \preceq_A) \text{ wqo}, \; (B, \preceq_B) \text{ wqo} \;\Rightarrow\; (A \times B) \text{ wqo} \]

Iterating gives any finite product. Dickson's lemma is then just the statement for finitely many copies of the natural numbers, which is a well-quasi-ordering because it has no infinite descending sequence and is totally ordered.

The same closure does not extend to infinite products, which is why the coordinate count must be fixed — the extraction would never terminate.

47. Where does each piece belong: Advanced Regular Properties

Sorting

Sort into buckets

These are the pieces of Advanced Regular Properties, out of order. Put each one back under the part of the lesson it belongs to.

The Subsequence Order
Subsequences, not substrings; The order it defines; Check the order on concrete strings
Well-Quasi-Orderings
The definition; Quasi-order, partial order, well-order; Check the three conditions on a small order
Dickson's Lemma
Tuples of natural numbers; Prove Dickson's lemma; Products of well-quasi-orderings
s1
The Subsequence Order is where Advanced Regular Properties puts Subsequences, not substrings, The order it defines, Check the order on concrete strings. Knowing which part of the lesson a problem belongs to is most of knowing which method to reach for.
s2
Well-Quasi-Orderings is where Advanced Regular Properties puts The definition, Quasi-order, partial order, well-order, Check the three conditions on a small order. Knowing which part of the lesson a problem belongs to is most of knowing which method to reach for.
s3
Dickson's Lemma is where Advanced Regular Properties puts Tuples of natural numbers, Prove Dickson's lemma, Products of well-quasi-orderings. Knowing which part of the lesson a problem belongs to is most of knowing which method to reach for.

48. Show a set of tuples has a finite basis by hand

Worked example

One more basis computation, this time where the answer is less obvious.

Take an upward closed set with a mixed condition

Why: Consider the pairs where either the first entry is at least three, or the second entry is at least two.

\[ U = \{\, (a,b) : a \ge 3 \text{ or } b \ge 2 \,\} \]

Check upward closure

Why: Increasing either entry preserves whichever disjunct already held, so the set is upward closed.

Find the minimal elements of each disjunct

Why: For the first, the minimum is three in the first entry and nothing required in the second. For the second, it is two in the second entry with nothing required in the first.

\[ (3,0) \quad \text{and} \quad (0,2) \]

Check they are incomparable and that nothing else is minimal

Why: Neither is componentwise below the other. Any other member sits above one of them, since it satisfies one of the two disjuncts.

Verify the union description covers the set exactly

Why: The pair with entries four and zero sits above the first witness and satisfies the first disjunct. The pair with entries zero and five sits above the second. The pair with entries two and one sits above neither and satisfies neither disjunct, so it is correctly excluded.

\[ (4,0), (0,5) \in U \qquad (2,1) \notin U \ \checkmark \]

49. Show a set of tuples has a finite basis by hand — line by line

Picture it

Animation

Shows: Each line of the worked example "Show a set of tuples has a finite basis by hand", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Increasing either entry preserves whichever disjunct already held, so the set is upward closed.

50. What Dickson's lemma says in practice

Intuition

Stated concretely, the lemma is a statement about monomials, or about resource vectors, and it is used constantly outside this course.

SettingTuples representThe lemma says
polynomial algebramonomial exponentsevery monomial ideal is finitely generated
Petri netstoken countscoverability sets are finite
program analysiscounter valuescertain fixpoint computations terminate

Each application is the finite-basis property applied to an upward closed set of tuples. Recognizing that shape is most of the skill.

51. What each one costs: What Dickson's lemma says in practice

Trade off

Comparison matrix

From What Dickson's lemma says in practice: every row here is a choice with a cost. Fill the The lemma says column, then say which row you would actually pick and what you give up for it.

SettingTuples representThe lemma says
polynomial algebramonomial exponentsevery monomial ideal is finitely generated
Petri netstoken countscoverability sets are finite
program analysiscounter valuescertain fixpoint computations terminate

52. What has to happen first: Apply Dickson's lemma to a set of tuples

Ranking

Put in order

Put the moves of Apply Dickson's lemma to a set of tuples into the order they have to happen.

  1. Take an upward closed set of pairs
  2. Find the minimal elements
  3. Check the count is finite
  4. Write the set as a finite union of cones
  5. Verify the description on a member and a non-member

Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Consider the pairs of natural numbers whose sum is at least four.

53. Apply Dickson's lemma to a set of tuples

Worked example

Use the finite-basis property on a concrete upward closed set.

Take an upward closed set of pairs

Why: Consider the pairs of natural numbers whose sum is at least four. Increasing either entry keeps the sum at least four, so the set is upward closed.

\[ U = \{\, (a,b) : a + b \ge 4 \,\} \]

Find the minimal elements

Why: A pair is minimal when decreasing either entry leaves the set. Those are the pairs summing to exactly four.

\[ (0,4), \; (1,3), \; (2,2), \; (3,1), \; (4,0) \]

Check the count is finite

Why: Five minimal pairs, as Dickson's lemma guarantees. They are pairwise incomparable, since each has a strictly larger first entry and a strictly smaller second than the next.

Write the set as a finite union of cones

Why: Every member sits above one of the five, and everything above one of the five is a member.

\[ U = \bigcup_{i=0}^{4} \{\, (a,b) : a \ge i, \; b \ge 4-i \,\} \]

Verify the description on a member and a non-member

Why: The pair with entries three and three sums to six and sits above the minimal pair with entries two and two, so it is in the union. The pair with entries one and two sums to three and sits above none of the five, so it is outside — matching the original condition exactly.

\[ (3,3) \in U, \qquad (1,2) \notin U \ \checkmark \]

54. Apply Dickson's lemma to a set of tuples — line by line

Picture it

Animation

Shows: Each line of the worked example "Apply Dickson's lemma to a set of tuples", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Five minimal pairs, as Dickson's lemma guarantees. They are pairwise incomparable, since each has a strictly larger first entry and a strictly smaller second than the next.

55. Check yourself: Dickson's lemma

Check

Think about what the proof does once per coordinate.

Check your understanding

Why does Dickson's lemma require the number of coordinates to be fixed and finite?

  • A. The proof extracts a monotone subsequence once per coordinate, so it must terminate (correct)
  • B. Infinite tuples are not well defined
  • C. Natural numbers only have finitely many divisors
  • D. The componentwise order is only transitive for finitely many coordinates

Answer: A

Why: Each extraction fixes one coordinate to be non-decreasing while preserving infiniteness. With finitely many coordinates the process ends and every coordinate is non-decreasing at once; with infinitely many it never finishes, and the lemma is actually false.

Why B tempts people
Infinite tuples are perfectly well defined — sequences of natural numbers. The lemma simply fails for them.
Why C tempts people
Divisors play no part in the statement or the proof, which concerns only the componentwise ordering.
Why D tempts people
Transitivity holds for any number of coordinates, since it is checked coordinate by coordinate. The failure is about infinite antichains, not transitivity.

56. Higman's Theorem

Section

Section 4

57. The statement

Concept

The central result of the lesson, and one of the more surprising theorems in elementary formal language theory.

Higman's theorem — For any finite alphabet, the subsequence order on the set of all strings over that alphabet is a well-quasi-ordering.

\[ \Sigma \text{ finite} \;\Longrightarrow\; (\Sigma^{*}, \preceq) \text{ is a wqo} \]

Concretely: given any infinite list of strings over a fixed finite alphabet, some earlier string in the list embeds as a subsequence in some later one. You cannot avoid it, however cleverly you choose.

58. Term to definition: Advanced Regular Properties

Matching

Match the pairs

Match each term to the definition this lesson gave it — not the one you would guess from the word.

  • t1. subsequence
  • t2. well-quasi-ordering
  • t3. Dickson's lemma
  • t4. Higman's theorem
  • d1. A string obtained from another by deleting any number of symbols, from any positions, keeping the rest in order.
  • d2. A reflexive, transitive relation in which every infinite sequence of elements contains some earlier element that is below some later one.
  • d3. For every fixed k, the componentwise order on k-tuples of natural numbers is a well-quasi-ordering.
  • d4. For any finite alphabet, the subsequence order on the set of all strings over that alphabet is a well-quasi-ordering.

Why: These are the working definitions of subsequence, well-quasi-ordering, Dickson's lemma, Higman's theorem as Advanced Regular Properties uses them. Pairing them correctly is the test of whether you could state each one with the slide switched off.

59. Why the theorem is surprising

Intuition

It is worth trying to violate it for a minute, because failing to is what makes the statement land.

The obvious attempt is the family used earlier against the substring order: an a, then a growing block of b's, then an a. Under subsequences the shorter ones embed in the longer ones immediately, so that fails.

Every other natural attempt fails the same way. Making strings longer gives later strings more room to contain earlier ones, and making them structurally different runs out of room because the alphabet is finite.

\[ \text{finite alphabet} \;+\; \text{unbounded length} \;=\; \text{unavoidable embedding} \]

60. Guess the shape of the answer: Try and fail to build an infinite antichain

Estimation

Predict first

Three attempts, each defeated, which is the fastest route to believing the theorem.

Commit before you compute: what does Try and fail to build an infinite antichain come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.

Correct: Verify the finite-alphabet hypothesis is doing the work

Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Over an infinite alphabet the theorem fails immediately: the one-symbol strings, one per letter, are pairwise incomparable and form an infinite antichain.

61. Try and fail to build an infinite antichain

Worked example

Three attempts, each defeated, which is the fastest route to believing the theorem.

Attempt one: increasing blocks

Why: Take an a, then n b's, then an a. Any earlier member embeds in a later one by keeping both a's and enough b's. Not an antichain.

\[ a\,b^{2}\,a \preceq a\,b^{5}\,a \]

Attempt two: alternate the pattern

Why: Take strings alternating a and b, of increasing length. A shorter alternating string embeds in a longer one by taking a prefix. Not an antichain.

Attempt three: make each string avoid the previous

Why: Choose each new string to omit some symbol pattern the previous one had. With a finite alphabet there are only finitely many patterns of each length, so this cannot be sustained indefinitely.

Recognize the obstruction

Why: Every attempt founders on the same point: strings must grow, and a growing string over a finite alphabet has ever more room to contain the short strings already listed.

Verify the finite-alphabet hypothesis is doing the work

Why: Over an infinite alphabet the theorem fails immediately: the one-symbol strings, one per letter, are pairwise incomparable and form an infinite antichain. So finiteness is not a technical convenience but the essential hypothesis.

\[ |\Sigma| = \infty \;\Rightarrow\; \{a_1, a_2, a_3, \dots\} \text{ is an infinite antichain} \ \checkmark \]

62. Try and fail to build an infinite antichain — line by line

Picture it

Animation

Shows: Each line of the worked example "Try and fail to build an infinite antichain", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Over an infinite alphabet the theorem fails immediately: the one-symbol strings, one per letter, are pairwise incomparable and form an infinite antichain. So finiteness is not a technical convenience but the essential hypothesis.

63. The one-symbol case, done directly

Concept

Before the general proof, the single-symbol alphabet is worth checking, because it makes the statement concrete.

Over one symbol, a string is determined by its length, and one string embeds in another exactly when it is no longer. So the subsequence order is just the order on the natural numbers.

\[ a^{m} \preceq a^{n} \iff m \le n \]

The natural numbers have no infinite descending sequence and no two are incomparable, so the order is a well-quasi-ordering. Higman's theorem for one symbol is therefore immediate.

The difficulty appears only from two symbols upward, where incomparable strings exist — ab and ba, for instance — and the question of infinite antichains becomes real.

64. Plan first: Find the basis of a downward closed language

Step zero

Discussion prompt

Find the basis of a downward closed language — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Take a downward closed language

Answer:

  1. Take a downward closed language
  2. Describe it by what it forbids
  3. Read off the basis of the complement
  4. Build the machine from the basis
  5. Verify the machine against the description

65. Find the basis of a downward closed language

Worked example

Downward closed languages are described by their forbidden patterns rather than their required ones, and the basis lives in the complement.

Take a downward closed language

Why: The strings over the alphabet of a and b containing at most two a's. Deleting symbols cannot raise the count, so it is downward closed.

Describe it by what it forbids

Why: A string is excluded exactly when it contains three a's, which as a subsequence is the string of three a's.

\[ w \in L \iff aaa \not\preceq w \]

Read off the basis of the complement

Why: The complement is upward closed and its unique minimal member is the three-a string. So the forbidden set has exactly one element.

Build the machine from the basis

Why: The cone above the three-a string has a four-state machine counting a's up to three. Complementing swaps its accepting set, giving a machine for the original language.

\[ |Q| = 4 \]

Verify the machine against the description

Why: Strings with zero, one or two a's are accepted and strings with three or more are rejected, matching the at-most-two condition exactly. Here the basis was findable by inspection, which is why an explicit machine could be produced — the general theorem offers no such luck.

\[ aab \in L, \qquad aaab \notin L \ \checkmark \]

66. Find the basis of a downward closed language — line by line

Picture it

Animation

Shows: Each line of the worked example "Find the basis of a downward closed language", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Strings with zero, one or two a's are accepted and strings with three or more are rejected, matching the at-most-two condition exactly. Here the basis was findable by inspection, which is why an explicit machine could be produced — the general theorem offers no such luck.

67. Forbidden patterns are the usual way these languages arrive

Intuition

Downward closed languages are almost always specified negatively, and the specification is exactly a set of forbidden subsequences.

LanguageForbidden subsequence
at most two a'sthree a's
no b after an athe string ab
no a and b in either orderab and ba
symbols appear in alphabetical orderevery descending pair

Higman's theorem says the forbidden set can always be taken finite — even when the natural description lists infinitely many patterns, as in the last row, where all the descending pairs reduce to finitely many minimal ones.

68. A sketch of the proof

Concept

The standard proof is by a minimal-counterexample argument, and the shape is worth knowing even without the details.

  1. Suppose an infinite sequence with no embedding pair exists — call it bad.
  2. Among all bad sequences, choose one that is minimal: its first string is as short as possible, then its second, and so on.
  3. Every string in it is nonempty, since the empty string embeds everywhere.
  4. Strip the first symbol off each, and use finiteness of the alphabet to find an infinite subfamily stripped of the same symbol.
  5. That subfamily contradicts minimality, because it is bad and its strings are shorter.

The technique is called the minimal bad sequence argument, and it recurs throughout the theory of well-quasi-orderings, including in the proof of the graph minor theorem.

69. Where the finiteness of the alphabet enters the proof

Intuition

One step of the sketch uses the hypothesis, and identifying it explains why the theorem is sharp.

Stripping the first symbol from each string in an infinite family produces infinitely many stripped strings, each tagged with the symbol removed. With finitely many possible tags, some tag is used infinitely often — a pigeonhole step.

\[ \text{infinitely many strings} \;+\; \text{finitely many first symbols} \;\Rightarrow\; \text{an infinite same-symbol subfamily} \]

With an infinite alphabet every string could be stripped of a different symbol and no infinite subfamily would appear. That is exactly the case where the theorem fails.

70. How sure are you: Check yourself: Higman's theorem

Commit first

Predict first

Higman's theorem fails for infinite alphabets. What is the simplest counterexample?

Commit to an answer, then rate it — certain, fairly sure, or guessing — and write the rating down before you turn the page.

Correct: The one-symbol strings, one for each letter of the alphabet

Why: Two distinct single-symbol strings are incomparable, since neither can be obtained from the other by deletion. With infinitely many letters that gives an infinite antichain immediately, so the order is not a well-quasi-ordering.

The rating matters as much as the answer: confident-and-wrong is the combination that survives revision, because nothing about it feels like it needs revisiting.

71. Check yourself: Higman's theorem

Check

Recall which hypothesis the counterexample violates.

Check your understanding

Higman's theorem fails for infinite alphabets. What is the simplest counterexample?

  • A. The one-symbol strings, one for each letter of the alphabet (correct)
  • B. The strings of increasing length over two symbols
  • C. The palindromes over an infinite alphabet
  • D. The empty string, repeated infinitely often

Answer: A

Why: Two distinct single-symbol strings are incomparable, since neither can be obtained from the other by deletion. With infinitely many letters that gives an infinite antichain immediately, so the order is not a well-quasi-ordering.

Why B tempts people
Over two symbols the theorem holds, so no family there can be an infinite antichain — longer strings always contain shorter ones from the family.
Why C tempts people
Palindromes are not the obstruction; the single letters already are, and they are much simpler.
Why D tempts people
A sequence repeating one element has the element embedding in itself, satisfying the definition rather than violating it.

72. The Regularity Consequence

Section

Section 5

73. Every upward closed language is regular

Concept

Now the payoff. Combine Higman's theorem with the finite-basis property and the closure results of Lesson 7.

Let the language be upward closed under the subsequence order. By Higman's theorem the order is a well-quasi-ordering, so the set of minimal members is finite.

\[ L = \bigcup_{i=1}^{k} \{\, v : b_i \preceq v \,\} \]

Each cone — the strings containing a fixed string as a subsequence — is regular, with an easy machine. And a finite union of regular languages is regular by Lesson 7.

So the language is regular, and the proof never looked at what the language actually contains.

74. What has to be given first: Build the machine for a single cone

Missing information

Discussion prompt

The one construction the argument needs: a machine for the strings containing a fixed string as a subsequence.

What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.

Hint: Anything you would have to invent to get started is a thing the problem must supply.

Answer:

How much of the pattern has been matched so far. That is a number between zero and the pattern's length, so there are finitely many answers.

75. Build the machine for a single cone

Worked example

The one construction the argument needs: a machine for the strings containing a fixed string as a subsequence.

\[ C_b = \{\, v : b \preceq v \,\}, \qquad b = b_1b_2\cdots b_m \]

Choose what to remember

Why: How much of the pattern has been matched so far. That is a number between zero and the pattern's length, so there are finitely many answers.

\[ \text{states} = \{0, 1, \dots, m\} \]

Wire the arrows

Why: From state i, reading the next needed symbol advances to state i plus one. Reading anything else stays in state i, since a non-matching symbol is simply skipped.

Choose the accepting state

Why: The final state, meaning the whole pattern has been matched, and it absorbs: once matched, adding symbols cannot unmatch.

\[ F = \{m\}, \qquad \delta(m, a) = m \]

Note the greedy behaviour is correct

Why: Matching the earliest possible occurrence of each symbol never loses: if some embedding exists, the greedy one succeeds too. So the deterministic machine is right without needing nondeterminism.

Verify on a member and a non-member

Why: For the pattern ab, the string ba is rejected because no a precedes a b, while the string bab is accepted — the machine skips the first b, matches a, then matches the final b. Both verdicts match the subsequence relation.

\[ ab \preceq bab, \qquad ab \not\preceq ba \ \checkmark \]

76. Build the machine for a single cone — line by line

Picture it

Animation

Shows: Each line of the worked example "Build the machine for a single cone", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: For the pattern ab, the string ba is rejected because no a precedes a b, while the string bab is accepted — the machine skips the first b, matches a, then matches the final b. Both verdicts match the subsequence relation.

77. And every downward closed language too

Concept

The complementary statement follows immediately, with no extra work.

A language is downward closed exactly when its complement is upward closed. The complement is regular by the previous result, and the regular languages are closed under complement by Lesson 7.

\[ L \text{ down-closed} \;\Rightarrow\; \overline{L} \text{ up-closed} \;\Rightarrow\; \overline{L} \text{ regular} \;\Rightarrow\; L \text{ regular} \]

So both kinds of closed language are regular, for the same underlying reason. Notice how much of Lesson 7 is being used: complement, finite union, and the fact that these are theorems rather than definitions.

78. Guess the shape of the answer: Apply the theorem to a language with no…

Estimation

Predict first

Use the result on a language where building a machine directly would be genuinely awkward.

Commit before you compute: what does Apply the theorem to a language with no obvious machine come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.

Correct: Verify the surprise is real by testing an infinite defining set

Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Take the defining set to be every string of the form a, then some b's, then a.

79. Apply the theorem to a language with no obvious machine

Worked example

Use the result on a language where building a machine directly would be genuinely awkward.

State the language

Why: Fix any set of strings, however complicated, and take all strings containing at least one member of that set as a subsequence.

Check upward closure

Why: Adding symbols to a string preserves every subsequence it already had, so a string above a member is still a member. The language is upward closed.

Invoke the theorem

Why: By Higman's theorem and the finite-basis property, only finitely many minimal members matter — even though the defining set may have been infinite.

Conclude regularity

Why: The language is a finite union of cones, each regular, so it is regular.

Verify the surprise is real by testing an infinite defining set

Why: Take the defining set to be every string of the form a, then some b's, then a. It is infinite, yet all its members contain the minimal member a-b-a as a subsequence, so the whole language is the single cone above that string — one machine, four states. The finite basis collapsed an infinite specification.

\[ \{a\,b^{n}\,a : n \ge 1\} \;\rightsquigarrow\; \text{basis } \{aba\} \ \checkmark \]

80. Apply the theorem to a language with no obvious… — line by line

Picture it

Animation

Shows: Each line of the worked example "Apply the theorem to a language with no obvious machine", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Adding symbols to a string preserves every subsequence it already had, so a string above a member is still a member. The language is upward closed.

81. Something is wrong here: expecting the proof to hand you a machine

Anomaly

Predict first

A student writes this, and it looks reasonable:

A language is shown regular by Higman's theorem. Where is its machine?

It is wrong. Say what breaks — and say it before you turn the page.

Correct: The argument produced a finite basis and a union of cones, and each cone has an explicit machine.

A language is shown regular by Higman's theorem. Where is its machine?

Why: The argument produced a finite basis and a union of cones, and each cone has an explicit machine. So take the union of those machines.

82. Trap: expecting the proof to hand you a machine

Trap

The trap

A language is shown regular by Higman's theorem. Where is its machine?

Assume the proof is constructive

Why: The argument produced a finite basis and a union of cones, and each cone has an explicit machine. So take the union of those machines.

\[ L = \bigcup_{i=1}^{k} C_{b_i} \;\Rightarrow\; \text{build } k \text{ machines} \]

Try to carry it out

Why: To build the machines you must know the basis. Ask the proof for the basis strings, and it has none to give.

The fix

A language is shown regular by Higman's theorem. Where is its machine?

Notice what the theorem actually asserts

Why: It says the basis is finite. It does not say which strings are in it, how many there are, or how to find them. The finite-basis argument is a pure existence proof.

\[ \exists k, \exists b_1,\dots,b_k \quad \text{— with no way to compute them} \]

Accept the conclusion without the construction

Why: The language is regular: some machine exists. But the proof supplies no algorithm to produce it, and in general no algorithm exists.

\[ L \text{ regular} \quad \text{but no machine is exhibited} \ \checkmark \]

Recognize this as a genuinely different kind of proof

Why: Every earlier regularity proof in this course was constructive: it built something. This one is not, and that distinction matters for the decidability questions of Lesson 24.

83. Decode the notation: Trap: expecting the proof to hand you a machine

Notation

Annotate

From Trap: expecting the proof to hand you a machine — read this one piece at a time. What is each part doing?

On: \( L = \bigcup_{i=1}^{k} C_{b_i} \;\Rightarrow\; \text{build } k \text{ machines} \)

  • The argument produced a finite basis and a union of cones, and each cone has an explicit machine. So take the union of those machines.
  • To build the machines you must know the basis. Ask the proof for the basis strings, and it has none to give.
  • It says the basis is finite. It does not say which strings are in it, how many there are, or how to find them. The finite-basis argument is a pure existence proof.

84. Non-constructive proofs and what they cost

Intuition

This is probably the first non-constructive argument in the course, and it is worth pausing on what has been given up.

Proof styleGives youExample
constructivean object you can runthe subset construction
non-constructiveonly the knowledge that one existsthe finite-basis argument

Knowing a machine exists is enough for many purposes — it settles the classification question, and it licenses every closure theorem. But it does not let you decide membership, because you cannot run a machine you cannot write down.

85. Fill in: Gives you for Non-constructive proofs and what they cost

Comparison

Comparison matrix

From Non-constructive proofs and what they cost: refill the Gives you column from what you know. The rest of the table is as it appeared.

Proof styleGives youExample
constructivean object you can runthe subset construction
non-constructiveonly the knowledge that one existsthe finite-basis argument

86. Check yourself: the regularity consequence

Check

Think about what the finite-basis property does and does not provide.

Check your understanding

Higman's theorem shows a certain upward closed language is regular. What can you do with that fact?

  • A. Conclude some machine exists, but not necessarily write one down (correct)
  • B. Construct the minimal machine for the language
  • C. Decide membership for any given string
  • D. Conclude the language is finite

Answer: A

Why: The argument establishes that the set of minimal members is finite, which forces the language to be a finite union of cones and hence regular. It gives no way to identify those minimal members, so no machine is produced.

Why B tempts people
Constructing any machine, minimal or not, requires knowing the basis. The theorem asserts the basis is finite without revealing it.
Why C tempts people
Deciding membership needs a machine to run. Knowing one exists is not the same as having it.
Why D tempts people
Upward closed languages are typically infinite — the cone above any string contains unboundedly many strings.

87. Perspective

Section

Section 6

88. Deciding membership once the basis is known

Concept

If somebody hands you the basis, everything becomes constructive again, and the resulting algorithm is simple.

  1. For an upward closed language: accept when the input contains some basis string as a subsequence.
  2. For a downward closed language: accept when the input contains no forbidden string as a subsequence.
  3. Checking one embedding is a greedy left-to-right scan, linear in the input length.
  4. With k basis strings, run k scans, or run one machine that is their product.

So the difficulty is never in using the basis. It is entirely in obtaining one, which the theorem declines to help with.

\[ \text{basis known} \;\Rightarrow\; O(k \cdot |w|) \text{ membership test} \]

89. Teach it back: Deciding membership once the basis is known

Explain it

Discussion prompt

Explain Deciding membership once the basis is known to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.

Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.

Answer:

If somebody hands you the basis, everything becomes constructive again, and the resulting algorithm is simple.

90. Plan first: Run the greedy embedding test

Step zero

Discussion prompt

Run the greedy embedding test — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Set up two pointers

Answer:

  1. Set up two pointers
  2. See why greedy is correct
  3. Verify on a positive and a negative case

91. Run the greedy embedding test

Worked example

The linear scan that decides whether one string is a subsequence of another.

Set up two pointers

Why: One walks the pattern and one walks the input. Start both at the beginning.

Scan

Why: Advance the input pointer one symbol at a time. Whenever the current input symbol equals the current pattern symbol, advance the pattern pointer too.

Decide

Why: The pattern embeds exactly when its pointer reaches the end before the input is exhausted.

\[ ab \preceq bab \;: \; b \text{ skipped}, \; a \text{ matched}, \; b \text{ matched} \]

See why greedy is correct

Why: Matching each pattern symbol at its earliest opportunity leaves the most room for the rest. So if any embedding exists, the greedy one succeeds — no backtracking is needed.

Verify on a positive and a negative case

Why: For the pattern ab and input bab the scan matches both symbols and reports yes. For the same pattern and input ba the scan matches the a at position two and then finds no b afterwards, reporting no — matching the subsequence relation in both cases.

\[ ab \preceq bab, \qquad ab \not\preceq ba \ \checkmark \]

92. Run the greedy embedding test — line by line

Picture it

Animation

Shows: Each line of the worked example "Run the greedy embedding test", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: For the pattern ab and input bab the scan matches both symbols and reports yes. For the same pattern and input ba the scan matches the a at position two and then finds no b afterwards, reporting no — matching the subsequence relation in both cases.

93. Answer it before you see the options: Check yourself: using a basis

Prediction

Predict first

A downward closed language has forbidden set consisting of the single string aa. Which strings does it contain?

Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.

Correct: Exactly the strings with at most one a

Why: A string is excluded exactly when it contains the forbidden pattern as a subsequence, and containing two a's anywhere — adjacent or not — embeds the pattern. So the language holds the strings with zero or one a, and any number of other symbols.

94. Check yourself: using a basis

Check

Think about which direction the closure runs.

Check your understanding

A downward closed language has forbidden set consisting of the single string aa. Which strings does it contain?

  • A. Exactly the strings with at most one a (correct)
  • B. Exactly the strings containing aa as a subsequence
  • C. Exactly the strings with no two adjacent a's
  • D. Exactly the strings of length at most one

Answer: A

Why: A string is excluded exactly when it contains the forbidden pattern as a subsequence, and containing two a's anywhere — adjacent or not — embeds the pattern. So the language holds the strings with zero or one a, and any number of other symbols.

Why B tempts people
That is the complement. The forbidden set describes what must be absent, not what must be present.
Why C tempts people
Adjacency is a substring condition, not a subsequence one. The string aba contains aa as a subsequence despite having no adjacent pair, so it is excluded.
Why D tempts people
Length is unconstrained. The string bbbb has no a at all and is included, however long it is.

95. Rebuild the recipe: Recognizing when this machinery applies

Ranking

Put in order

These are the steps of Recognizing when this machinery applies, scrambled. Put them back in order before the next slide shows you.

  1. The language is defined by 'contains one of these as a subsequence' or 'avoids all of these'.
  2. The defining family may be infinite, but closure under the order is obvious.
  3. You need only the classification, not an actual machine.
  4. Direct construction stalls because the defining family cannot be enumerated.
  5. The objects are tuples of counts rather than strings — then use Dickson rather than Higman.

Why: This is the order the recipe itself gives. Recalling the sequence without the slide in front of you is the difference between recognising the method and being able to run it — most of what goes wrong in practice is a step done out of turn.

96. Recognizing when this machinery applies

Pattern

The theorems are powerful but narrow. These are the signals that they are the right tool.

  1. The language is defined by 'contains one of these as a subsequence' or 'avoids all of these'.
  2. The defining family may be infinite, but closure under the order is obvious.
  3. You need only the classification, not an actual machine.
  4. Direct construction stalls because the defining family cannot be enumerated.
  5. The objects are tuples of counts rather than strings — then use Dickson rather than Higman.

If you need to run something, this is the wrong tool no matter how elegant. Go back and find the basis by hand, or find a different characterization of the language.

97. Where does it stop working: Recognizing when this machinery applies

Edge cases

Discussion prompt

Recognizing when this machinery applies works on the cases you have just seen. Push it to the edge: what is the most degenerate input it still handles — empty, zero, one item, everything equal — and what is the first case where it stops being true? Name the case, not just "it breaks".

Hint: Try the smallest legal input, then the largest, then the one where two things collide. Methods are specified at their edges; the middle takes care of itself.

Answer:

The theorems are powerful but narrow. These are the signals that they are the right tool.

98. Where else these ideas appear

Concept

Well-quasi-orderings are not a curiosity of formal language theory. The same finite-basis argument runs in several other subjects.

OrderObjectsFinite-basis statement
componentwise on tuplesvectors of countsDickson's lemma
subsequence on stringswordsHigman's theorem
minor on graphsfinite graphsthe graph minor theorem
divisibility on monomialsmonomialsmonomial ideals are finitely generated

The third row is the deepest: every family of graphs closed under taking minors is characterized by finitely many forbidden minors. Planarity is the famous instance, with exactly two.

99. What each one costs: Where else these ideas appear

Trade off

Comparison matrix

From Where else these ideas appear: every row here is a choice with a cost. Fill the Objects column, then say which row you would actually pick and what you give up for it.

OrderObjectsFinite-basis statement
componentwise on tuplesvectors of countsDickson's lemma
subsequence on stringswordsHigman's theorem
minor on graphsfinite graphsthe graph minor theorem
divisibility on monomialsmonomialsmonomial ideals are finitely generated

100. The same shape of theorem, three times

Intuition

Each of those results says: a class closed under a natural weakening operation is determined by a finite set of obstructions.

And each comes with the same limitation. The obstruction set is guaranteed finite and is usually unknown, so the theorem classifies without deciding.

For graph minors the situation is stark: membership is decidable in principle once the obstructions are known, and for most interesting classes they are not known. Exactly the trade-off this lesson's trap illustrates.

\[ \text{finite obstruction set} \;\not\Rightarrow\; \text{known obstruction set} \]

101. By analogy: The same shape of theorem, three times

Analogy

Discussion prompt

Explain The same shape of theorem, three times by analogy to something with no Theory of Computation in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.

Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.

Answer:

Each of those results says: a class closed under a natural weakening operation is determined by a finite set of obstructions.

102. What has to happen first: Use Dickson's lemma on a language question

Ranking

Put in order

Put the moves of Use Dickson's lemma on a language question into the order they have to happen.

  1. Take a language defined by counts
  2. Apply Dickson's lemma to the triples
  3. Translate each basis triple into a language condition
  4. Verify the counting condition really is capped

Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Fix an alphabet of three symbols and consider the strings whose symbol counts, as a triple, lie in some upward closed set of triples.

103. Use Dickson's lemma on a language question

Worked example

A final application, tying the tuple version back to strings.

Take a language defined by counts

Why: Fix an alphabet of three symbols and consider the strings whose symbol counts, as a triple, lie in some upward closed set of triples.

Apply Dickson's lemma to the triples

Why: The componentwise order on triples is a well-quasi-ordering, so the upward closed set of triples has a finite basis.

\[ T = \bigcup_{i=1}^{k} \{\, (a,b,c) : (a,b,c) \succeq t_i \,\} \]

Translate each basis triple into a language condition

Why: A triple condition says: at least so many of each symbol. That is a conjunction of three capped-count conditions, each recognized by a small machine.

Assemble

Why: Each basis triple gives a regular language by intersection of three capped counters, and the whole language is the finite union of those. So it is regular.

Verify the counting condition really is capped

Why: Each condition asks for at least a fixed number of one symbol, so the counter may stop at that number — a bounded quantity, unlike the unbounded differences of Lesson 11. That is precisely why these languages are regular while the matched-counts language is not.

\[ \text{at least } n \text{ copies} \;\Rightarrow\; n+1 \text{ states} \ \checkmark \]

104. Use Dickson's lemma on a language question — line by line

Picture it

Animation

Shows: Each line of the worked example "Use Dickson's lemma on a language question", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Each condition asks for at least a fixed number of one symbol, so the counter may stop at that number — a bounded quantity, unlike the unbounded differences of Lesson 11. That is precisely why these languages are regular while the matched-counts language is not.

105. Not every regular language is closed

Concept

The theorem gives a sufficient condition, not a necessary one, and it is worth seeing how far short of the full class it falls.

LanguageClosed under subsequences?Regular?
at most three a'sdownwardyes, by this lesson
contains ab as a subsequenceupwardyes, by this lesson
even lengthneitheryes, but not by this lesson
ends in 01neitheryes, but not by this lesson

So the closed languages are a small and special corner of the regular class. When the tool applies it is powerful; when it does not, nothing has been learned and an ordinary construction is needed.

106. Which is which, by Closed under subsequences?

Discrimination

Sort into buckets

Sort these by Closed under subsequences?, from memory, without looking back at Not every regular language is closed. Telling them apart on the spot is the skill; the table is only where the answer happens to be written down.

downward
at most three a's
upward
contains ab as a subsequence
neither
even length; ends in 01
g1
Closed under subsequences? is "downward" for at most three a's — that is what the table on "Not every regular language is closed" records, and it is the single property separating this group from the rest.
g2
Closed under subsequences? is "upward" for contains ab as a subsequence — that is what the table on "Not every regular language is closed" records, and it is the single property separating this group from the rest.
g3
Closed under subsequences? is "neither" for even length, ends in 01 — that is what the table on "Not every regular language is closed" records, and it is the single property separating this group from the rest.

107. Why closure is such a strong hypothesis

Intuition

The last two rows of that table fail closure for the same reason, and it explains the tool's narrowness.

Both conditions care about the positions of symbols — the last two symbols, or the length parity. Deleting a symbol changes every later position, so positional conditions almost never survive the subsequence order.

Conditions that do survive are about presence and counts: which symbols appear, and how many. Those are the languages this lesson reaches, and they are exactly the ones where order-theoretic arguments are natural.

\[ \text{positional} \;\Rightarrow\; \text{not closed} \qquad \text{presence or count} \;\Rightarrow\; \text{often closed} \]

108. Break it if you can: Why closure is such a strong hypothesis

Counterexample

Discussion prompt

The last two rows of that table fail closure for the same reason, and it explains the tool's narrowness.

That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.

Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.

109. Rule out three: Check yourself: the scope of the theorem

Elimination

Eliminate the wrong options

Why can Higman's theorem not be used to prove that the strings ending in 01 form a regular language?

3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.

  • A. That language is neither upward nor downward closed under subsequences
  • B. Higman's theorem applies only to infinite alphabets
  • C. The language is finite, so the theorem says nothing
  • D. The subsequence order is not well-founded on that language

Survives elimination: A

Why: Deleting the final 1 from a member leaves a string not ending in 01, so it is not downward closed; and appending a 0 to a member also leaves the language, so it is not upward closed. With neither closure available the theorem simply does not apply.

110. Check yourself: the scope of the theorem

Check

Recall what closure requires.

Check your understanding

Why can Higman's theorem not be used to prove that the strings ending in 01 form a regular language?

  • A. That language is neither upward nor downward closed under subsequences (correct)
  • B. Higman's theorem applies only to infinite alphabets
  • C. The language is finite, so the theorem says nothing
  • D. The subsequence order is not well-founded on that language

Answer: A

Why: Deleting the final 1 from a member leaves a string not ending in 01, so it is not downward closed; and appending a 0 to a member also leaves the language, so it is not upward closed. With neither closure available the theorem simply does not apply.

Why B tempts people
The theorem requires a finite alphabet and fails for infinite ones. This language is over a two-symbol alphabet, which is exactly the setting where it holds.
Why C tempts people
The language is infinite — every string ending in 01 qualifies, and there are unboundedly many.
Why D tempts people
The subsequence order is well-founded everywhere, since a proper subsequence is strictly shorter. Well-foundedness is never the obstacle.

111. How this sits beside Lessons 10 and 11

Concept

Three lessons, three relationships between a language and the regular class, and it is worth seeing them together.

LessonQuestionMethod
4 to 9is it regular?build a machine or an expression
10 and 11is it not regular?pumping, closure, distinguishable prefixes
12is it regular, without building?closure under a well-quasi-ordering

The third row is the odd one out because it answers the positive question with no witness. That is unusual in this course, and it will not happen again until the counting arguments of Lesson 25.

112. Fill in: Method for How this sits beside Lessons 10 and 11

Comparison

Comparison matrix

From How this sits beside Lessons 10 and 11: refill the Method column from what you know. The rest of the table is as it appeared.

LessonQuestionMethod
4 to 9is it regular?build a machine or an expression
10 and 11is it not regular?pumping, closure, distinguishable prefixes
12is it regular, without building?closure under a well-quasi-ordering

113. Connect it up: Advanced Regular Properties

Connect it up

Draw it

One page, no notation unless you need it: draw how these connect — The Subsequence Order · Well-Quasi-Orderings · Dickson's Lemma · Higman's Theorem · The Regularity Consequence · Perspective. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.

114. What you can do now

Recap

You can prove a language regular by an argument that never mentions states, and you know exactly what such a proof does and does not deliver.

SituationMove
language defined by forbidden subsequencesdownward closed — regular by Higman
language defined by required subsequencesupward closed — regular by Higman
condition on tuples of countsDickson's lemma, then finite union of counters
you need an actual machinethis lesson will not help — find the basis by hand
condition on contiguous blocksthe substring order is not a wqo — go back to Lesson 4

Lesson 13 leaves finite automata behind and introduces grammars, which generate languages rather than recognize them — and reach well beyond the regular class.

Sources

  1. Higman, 'Ordering by divisibility in abstract algebras', Proceedings of the London Mathematical Society s3-2(1) — LMS, 1952.
  2. Dickson, 'Finiteness of the odd perfect and primitive abundant numbers with n distinct prime factors', American Journal of Mathematics 35(4) — Johns Hopkins, 1913.
  3. Nash-Williams, 'On well-quasi-ordering finite trees', Proceedings of the Cambridge Philosophical Society 59(4) (the minimal bad sequence argument) — Cambridge, 1963.
  4. Robertson & Seymour, 'Graph Minors XX: Wagner's conjecture', Journal of Combinatorial Theory B 92(2) — Elsevier, 2004.
  5. Every ordering check, basis computation and cone machine in this deck was verified by hand against explicit strings and tuples. — Verified 2026-08-03.

Want this taught 1-on-1? Alexander tutors Theory of Computation — $55/session, free consultation.

Book on Wyzant · Text (657) 465-8108