Skip to content
Part IA Michaelmas, Lent Term

Derivations and Derivation Trees

Derivations

Definition

A derivation (or proof) that vXRv \in X_R is a finite tree where:

  1. The root is labelled vv
  2. Each node is the conclusion of a rule whose premises are its children
  3. Each leaf is an axiom

Intuition

A derivation shows how vv can be built by applying rules starting from axioms.

Derivation Trees

Structure

        v
       /|\
      / | \
    u1  u2  u3
    /|   |   \
   ...  ...  ...
  • Root at top (conclusion)
  • Leaves at bottom (axioms)
  • Internal nodes: applications of rules

Depth and Height

  • The height of a derivation is the length of the longest path from root to leaf
  • The depth of a node is its distance from the root

Example: Natural Numbers

Derivation of S(S(0))S(S(0)):

    S(S(0))
       |
     S(0)
       |
      0

Reading

  1. 0N0 \in \mathbb{N} (axiom)
  2. S(0)NS(0) \in \mathbb{N} (by successor rule from 0)
  3. S(S(0))NS(S(0)) \in \mathbb{N} (by successor rule from S(0)S(0))

Example: Binary Trees

Derivation of Node(Leaf,Node(Leaf,Leaf))\text{Node}(\text{Leaf}, \text{Node}(\text{Leaf}, \text{Leaf})):

        Node(Leaf, Node(Leaf, Leaf))
              /              \
          Leaf          Node(Leaf, Leaf)
                          /        \
                       Leaf        Leaf

The Set of Derivable Elements

Definition

XRXX_R \subseteq X is the set of elements that have a derivation using rules RR.

Key Theorem

XR={SX:S closed under R}X_R = \bigcap \{S \subseteq X : S \text{ closed under } R\}

The set of derivable elements equals the smallest closed set.

Types of Rules

Axioms (0-premise rules)

a\frac{}{a}

Elements derived in one step.

Unary Rules (1-premise)

uv\frac{u}{v}

If uu derivable, so is vv.

Binary Rules (2-premises)

u1u2v\frac{u_1 \quad u_2}{v}

If both u1u_1 and u2u_2 derivable, so is vv.

n-ary Rules

u1u2unv\frac{u_1 \quad u_2 \quad \cdots \quad u_n}{v}

Reasoning About Derivations

By Induction on Derivation Height

To prove vXR.P(v)\forall v \in X_R. P(v):

  1. Base: Prove P(a)P(a) for every axiom aa
  2. Step: For each rule u1,,unv\frac{u_1, \ldots, u_n}{v}, assume P(u1),,P(un)P(u_1), \ldots, P(u_n) and prove P(v)P(v)

This is a powerful proof technique that mirrors the structure of derivations.

Example: Balanced Strings

Rules for {w{a,b}:wa=wb}\{w \in \{a, b\}^* : |w|_a = |w|_b\}:

εwawbwbwauvuv\frac{}{\varepsilon} \qquad \frac{w}{awb} \qquad \frac{w}{bwa} \qquad \frac{u \quad v}{uv}

Claim: All derivable strings have equal numbers of aa‘s and bb‘s.

Proof by induction on derivations:

  • Base: ε\varepsilon has 00 aa‘s and 00 bb‘s.
  • If ww balances, so do awbawb and bwabwa.
  • If uu and vv balance, so does uvuv (sums add).

Summary

  • A derivation is a finite tree with axioms at leaves and rule applications at internal nodes
  • XRX_R = set of elements with a derivation
  • Induction on derivation height: base case for axioms, step case for each rule