2

This site is full of Pumping Lemma questions, and I do admit I've not read them all. I've tried some proofs myself and they seem to work, but I can't find anywhere what is the (general) exact structure of a proof where you show a language is not regular or context-free?

Wikipedia and most proofs start with "Suppose $L$ is a regular language", which would mean it is a proof by contradiction, because it isn't.

But the lemma has the quantifiers $\exists, \forall, \exists, \forall$ in order. And in the proof you assume a given constant given by the first $\exists$, and then you come up with some word (the first $\forall$), format it in some given substring division (the second $\exists$) and again come up with some $k$ (second $\forall$) for which you show it is not in $L$.

This seems to me like a counterexample proof ("this is not context-free/regular because I can come up with a counterexample which fails the pumping lemma"), and not a proof by contradiction?

Gilles 'SO- stop being evil'
  • 44,159
  • 8
  • 120
  • 184
PHPirate
  • 123
  • 6

3 Answers3

4

this is not context-free/regular because I can come up with a counterexample which fails the pumping lemma

You are missing that in order to construct this counterexample you have to assume that $L$ is regular. Then you apply the Pumping lemma, which yields the Pumping length $p$. Only then do you construct your (counter)example string (using $p$!) and show that it contradicts the Pumping lemma. Hence, the assumption must be false.

So while you can say that you derive the contradiction using a counterexample, the outer-most proof is by contradiction.
With the assumption, you wouldn't have $p$!

Note that proofs can be nested, so you don't need to see only one proof technique. For instance, induction proofs often use a proof by contradiction inside the inductive step.

Raphael
  • 73,212
  • 30
  • 182
  • 400
1

The formulation of the Pumping Lemma, with explicit quantifiers, is as follows:

$$\forall L\in REG, \exists p>0, \forall w\in L,|w|>p\Rightarrow \exists x,y,z\in \Sigma^*, w=xyz\wedge c_1\wedge c_2\wedge c_3$$ where $c_1,c_2,c_3$ are the conditions of the lemma.

Thus, a proof that a language is not regular is indeed by contradiction. In order to see the general structure of a proof, it is convenient to this of ourselves as trying to contradict the lemma, while an adversary is trying to prove the lemma holds.

Thus, the general structure is as follows. The lemma claims something for every regular language, so we choose a certain language we want to "attack".

Now, the adversary gets to choose $p$, so we write "for every $p>0$". Next, the lemma says something for every $w\in L$ such that $|w|>0$, so we get to pick $w$, but in order to make it useful, we need to pick $w\in L$ such that $|w|>p$ (otherwise the adversary wins vacuously).

Now, we have $\exists x,y,z$, so the adversary chooses them. We thus write "there exist $x,y,z$ such that $w=xyz$". Next, we want to show that at least one of the conditions $c_1,c_2,c_3$ does not hold. Technically, if $c_1$ or $c_2$ don't hold, then the adversary chose "stupidly", and we're done. Thus, we assume that $c_1$ and $c_2$ do hold, and we show that $c_3$ (the pumping argument) fails, and thus we win.

So overall we get the following proof structure:

Assume by way of contradiction that $L\in REG$, then let $p>0$ be its pumping constant. Consider the word $w=...$(something clever). Let $x,y,z\in \Sigma^*$ such that $w=xyz$, and $|xy|\le p$, and $|y|>0$, we show that there exists $i\ge 0$ such that $xy^iz\notin L$, in contradiction to the pumping lemma.

Thus, $L\notin REG$.

Shaull
  • 17,814
  • 1
  • 41
  • 67
1

In general, proving things is a creative enterprise. As such, there is no "standard template": you're free to do whatever you want, as long as it's logically valid.

In particular, as long as you understand why a proof works, you shouldn't worry too much about whether it's a proof by contradiction, or a proof by counterexample, or something else. That's a bit like a poet wondering whether a particular phrasing they've used is a zeugma or a syllepsis. As long as it's effective imagery, who cares except the critics?

David Richerby
  • 82,470
  • 26
  • 145
  • 239