2.1.6: Subformulas
It is often useful to talk about the formulas that “make up” a given formula. We call these its subformulas . Any formula counts as a subformula of itself; a subformula of \(A\) other than \(A\) itself is a proper subformula .
If \(A\) is a formula, the immediate subformulas of \(A\) are defined inductively as follows:
- Atomic formulas have no immediate subformulas.
- \(\indcase{A}{\lnot B}\) The only immediate subformula of \(\indfrm\) is \(B\) .
- \(\indcase{A}{(B \ast C)}\) The immediate subformulas of \(\indfrm\) are \(B\) and \(C\) ( \(\ast\) is any one of the two-place connectives).
- \(\indcase{A}{\lforall{x}{B}}\) The only immediate subformula of \(\indfrm\) is \(B\) .
- \(\indcase{A}{\lexists{x}{B}}\) The only immediate subformula of \(\indfrm\) is \(B\) .
If \(A\) is a formula, the proper subformulas of \(A\) are recursively as follows:
- Atomic formulas have no proper subformulas.
- \(\indcase{A}{\lnot B}\) The proper subformulas of \(\indfrm\) are \(B\) together with all proper subformulas of \(B\) .
- \(\indcase{A}{(B \ast C)}\) The proper subformulas of \(\indfrm\) are \(B\) , \(C\) , together with all proper subformulas of \(B\) and those of \(C\) .
- \(\indcase{A}{\lforall{x}{B}}\) The proper subformulas of \(\indfrm\) are \(B\) together with all proper subformulas of \(B\) .
- \(\indcase{A}{\lexists{x}{B}}\) The proper subformulas of \(\indfrm\) are \(B\) together with all proper subformulas of \(B\) .
The subformulas of \(A\) are \(A\) itself together with all its proper subformulas.
Note the subtle difference in how we have defined immediate subformulas and proper subformulas. In the first case, we have directly defined the immediate subformulas of a formula \(A\) for each possible form of \(A\) . It is an explicit definition by cases, and the cases mirror the inductive definition of the set of formulas. In the second case, we have also mirrored the way the set of all formulas is defined, but in each case we have also included the proper subformulas of the smaller formulas \(B\) , \(C\) in addition to these formulas themselves. This makes the definition recursive . In general, a definition of a function on an inductively defined set (in our case, formulas) is recursive if the cases in the definition of the function make use of the function itself. To be well defined, we must make sure, however, that we only ever use the values of the function for arguments that come “before” the one we are defining—in our case, when defining “proper subformula” for \((B \ast C)\) we only use the proper subformulas of the “earlier” formulas \(B\) and \(C\) .