Knaph

Proving Things About Every Formula6 of 243 min read

Climbing the Formula Tree

Every formula is built from letters by a few rules, one step at a time. There are endlessly many formulas, so we cannot check them one by one. Yet logicians say things about every formula at once. How?

The same climb, on a tree

Recall the building rules from What Counts as a Formula. A letter is a formula. If φ and ψ (read: phi and psi, any formulas) are formulas, then so are ¬φ, (φ ∧ ψ), (φ ∨ ψ), (φ → ψ) and (φ ↔ ψ). Nothing else is a formula.

So we can climb as in the last lesson, but along the tree. The first step: show the claim for every letter. Then one climbing step for each rule: if the claim holds for the parts, it holds for the whole. This is structural induction. Every formula is built by the rules from letters, so the claim holds for every formula.

The tree of the formula ¬P ∧ (Q ∨ R) with a tick on every node. A note beside the three letters reads first step, and a note beside the other nodes reads climbing steps.

Be careful to cover every rule. A proof that forgets the rule for ¬ says nothing about ¬P.

Example 1: the brackets

Claim: in every formula written with its full brackets, the number of opening brackets equals the number of closing ones.

First step: a letter has no brackets, so 0 and 0. Now the steps. ¬φ has the same brackets as φ, so the counts stay equal. For (φ ∧ ψ), say φ has a opening and a closing brackets, and ψ has b and b. The new formula has a + b + 1 opening and a + b + 1 closing ones, still equal. The rules for ∨, → and ↔ are the same. So the claim holds for every formula.

A check: ((P ∧ Q) → ¬R) has two opening and two closing brackets.

Example 2: one value in every row

Claim: in every row of a truth table, every formula gets exactly one value, T or F. This is why truth tables always work.

First step: in a row, each letter is given T or F, exactly one. Step for ¬φ: φ has one value, and the table of ¬ turns it into one other value. Step for (φ ∧ ψ): φ has one value and ψ has one. The table of ∧ gives one answer for each pair, so the whole has one value. The same for ∨, → and ↔.

The tree of ¬P ∧ (Q ∨ R) in the row P true, Q false, R true. Each node shows its value: P is T, the ¬ above it is F, Q is F, R is T, the ∨ is T and the ∧ at the top is F.

This is the idea of the proof. The full proof is longer only because it lists every rule in the same way.

Careful

Every building rule needs its own step. Skip one and the proof has a hole.

Try it at home

  1. Write the formula ¬(P → Q) with full brackets, and count its opening and closing brackets.
  2. Draw its tree. Take the row P true, Q false, and write the value of every node.
  3. Explain why the proof about brackets needs a separate step for each rule.

Words to know

  • structural induction - a proof that a claim holds for every formula: first the letters, then each building rule
  • formula tree - a picture of how a formula was built, with its main connective at the top

Big idea

To prove something about every formula, show it for the letters, and show that each building rule keeps it true.

Test your understanding

Sign in to test your understanding of this lesson and track your progress.