theory Demo4 = Main: subsection{*Inductive definition of the even numbers*} consts Ev :: "nat set" inductive Ev intros ZeroI: "0 \ Ev" Add2I: "n \ Ev \ Suc(Suc n) \ Ev" text{* Using the introduction rules: *} lemma "Suc(Suc(Suc(Suc 0))) \ Ev" apply(rule Add2I) apply(rule Add2I) apply(rule ZeroI) done text{*A simple inductive proof: *} lemma "n \ Ev \ n+n \ Ev" apply(erule Ev.induct) apply(simp) apply(rule ZeroI) apply(simp) apply(rule Add2I) apply(rule Add2I) apply(assumption) done end