Prefix of WFF of PropLog is not WFF

Theorem
Let $$\mathbf A$$ be a WFF of propositional calculus.

Let $$\mathbf S$$ be an initial part of $$\mathbf A$$.

Then $$\mathbf S$$ is not a WFF of propositional calculus.

Proof
Let $$l \left({\mathbf Q}\right)$$ denote the length of a string $$\mathbf Q$$.

By definition, $$\mathbf S$$ is an initial part of $$\mathbf A$$ if $$\mathbf A = \mathbf{ST}$$ for some non-null string $$\mathbf T$$.

Thus we note that $$l \left({\mathbf S}\right) < l \left({\mathbf A}\right)$$.

Let $$\mathbf A$$ be a WFF such that $$l \left({\mathbf A}\right) = 1$$.

Then for an initial part $$\mathbf S$$, $$l \left({\mathbf S}\right) < 1 = 0$$.

That is, $$\mathbf S$$ must be the null string, which is not a WFF.

So the result holds for WFFs of length $$1$$.

Now, we assume an induction hypothesis: that the result holds for all WFFs of length $$k$$ or less.

Let $$\mathbf A$$ be a WFF such that $$l \left({\mathbf A}\right) = k+1$$.

Suppose $$\mathbf D$$ is an initial part of $$\mathbf A$$ which happens to be a WFF.

That is, $$\mathbf A = \mathbf{DT}$$ where $$\mathbf T$$ is non-null.

There are two cases:


 * $$\mathbf A = \neg \mathbf B$$, where $$\mathbf B$$ is a WFF of length $$k$$.

$$\mathbf D$$ is a WFF starting with $$\neg$$, so $$\mathbf D = \neg \mathbf E$$ where $$\mathbf E$$ is also a WFF.

We remove the initial $$\neg$$ from $$\mathbf A = \mathbf{DT}$$ to get $$\mathbf B = \mathbf{ET}$$.

But then $$\mathbf B$$ is a WFF of length $$k$$ which has $$\mathbf E$$ as an initial part which is itself a WFF.

This contradicts the induction hypothesis.

Therefore no initial part of $$\mathbf A = \neg \mathbf B$$ can be a WFF.


 * $$\mathbf A = \left({\mathbf B \circ \mathbf C}\right)$$ where $$\circ$$ is one of the binary connectives.

In this case, $$\mathbf D$$ is a WFF starting with $$($$, so $$\mathbf D = \left({\mathbf E * \mathbf F}\right)$$ for some binary connective $$*$$ and some WFFs $$\mathbf E$$ and $$\mathbf F$$.

Thus $$\mathbf B \circ \mathbf C) = \mathbf E * \mathbf F) \mathbf T$$.

Both $$\mathbf B$$ and $$\mathbf E$$ are WFFs of length less than $$k+1$$.

By the inductive hypothesis, then, neither $$\mathbf B$$ nor $$\mathbf E$$ can be an initial part of the other.

But since both $$\mathbf B$$ and $$\mathbf E$$ start at the same place in $$\mathbf A$$, they must be the same: $$\mathbf B = \mathbf E$$.

Therefore $$\mathbf B \circ \mathbf C) = \mathbf B * \mathbf F) \mathbf T$$.

So $$\circ = *$$ and $$\mathbf C) = \mathbf F) \mathbf T$$.

But then the WFF $$\mathbf F$$ is an initial part of the WFF $$\mathbf C$$ of length less than $$k+1$$.

This contradicts our inductive hypothesis.

Therefore no initial part of $$\mathbf A = \left({\mathbf B \circ \mathbf C}\right)$$ can be a WFF.

So no initial part of any WFF of length $$k+1$$ can be a WFF.

The result follows by strong induction.