Session 9: Induction II — Structural and Well-Founded Induction

Overview

Inductively defined sets given by inference rules, the induction principles they generate, and termination arguments for functions that are not structurally recursive.

Lecturer

Yara Sleem (CSE + Mathematics)

Session Information

Core Concepts

  • Inductively defined sets, given by inference rules: base constructors and step constructors
  • Defining List, Tree, and ℕ inductively
  • Structural recursion: defining functions by cases on constructors
  • Structural induction: deriving the induction principle from the constructors
  • Rule induction over an inductively defined relation
  • Well-founded induction and termination: measures, decreasing arguments, and why while is harder than for
  • Functions that terminate but not structurally (gcd, Ackermann)

Slides

Session 9 Slides: Download PDF

Readings

Exercises & Extra Steps

  • Practice (not collected): define length, append and reverse by structural recursion and prove length (append xs ys) = length xs + length ys
  • Practice (not collected): prove reverse (reverse xs) = xs
  • Practice (not collected): give a termination measure for Euclid’s algorithm and prove it decreases
  • Problem Set 3 released today — due on paper at the start of S11 (Mon 12 Oct)

Questions? Reach out on the course WhatsApp!