Attic/MyInduction.thy
author Christian Urban <christian.urban@kcl.ac.uk>
Sat, 10 Sep 2022 15:04:35 +0100
changeset 598 2c9a3aba8ebc
parent 95 a33d3040bf7e
permissions -rw-r--r--
simplified the n-times case in decode_aux

theory MyInduction
imports Main
begin

fun itrev :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list" where
"itrev [] ys = ys" |
"itrev (x#xs) ys = itrev xs (x#ys)"

lemma "itrev xs [] = rev xs"
apply(induction xs)
apply(auto)
oops

lemma "itrev xs ys = rev xs @ ys"
apply(induction xs arbitrary: ys)
apply auto
done