Mechanizing structural induction