theory Demo10 imports Main begin -- {* Isar, case distinction *} declare length_tl[simp del] lemma "length(tl xs) = length xs - 1" proof (cases xs) case Nil thus ?thesis by simp next case (Cons y ys) thus ?thesis by simp qed -- {* structural induction *} lemma "2 * (\iii"} or @{text"\"} *} lemma assumes A: "(\n. (\m. m < n \ P m) \ P n)" shows "P (n::nat)" proof (rule A) show "\m. m < n \ P m" proof (induct n) case 0 thus ?case by simp next case (Suc n) show ?case proof cases assume eq: "m = n" from Suc and A have "P n" by blast with eq show "P m" by simp next assume "m \ n" with Suc have "m < n" by arith thus "P m" by(rule Suc) qed qed qed end