theory Test imports Main begin consts lookupEq :: "'a list \ 'b list \ 'a \ 'b option" primrec "lookupEq [] l2 a = None" "lookupEq (x # t1) l2 a = (if (a = x) then Some(hd l2) else lookupEq t1 (tl l2) a)" lemma lookupEq_exists: "\ys. \ length xs = length ys; a \ set xs \ \ (\y. lookupEq xs ys a = Some y)" proof (induct xs) case Nil thus ?case by auto next case (Cons z zs) hence "\ys. \length zs = length ys; a \ set zs\ \ (\y. lookupEq zs ys a = Some y)" by auto