doc-src/TutorialI/Misc/cond_rewr.thy
changeset 8771 026f37a86ea7
parent 8745 13b32661dde4
child 9458 c613cd06d5cf
equal deleted inserted replaced
8770:bfab4d4b7516 8771:026f37a86ea7
    21 lemma "xs \\<noteq> [] \\<Longrightarrow> hd(rev xs) # tl(rev xs) = rev xs";
    21 lemma "xs \\<noteq> [] \\<Longrightarrow> hd(rev xs) # tl(rev xs) = rev xs";
    22 (*<*)
    22 (*<*)
    23 apply(simp).
    23 apply(simp).
    24 (*>*)
    24 (*>*)
    25 text{*\noindent
    25 text{*\noindent
    26 is proved by simplification:
    26 is proved by plain simplification:
    27 the conditional equation \isa{hd_Cons_tl} above
    27 the conditional equation \isa{hd_Cons_tl} above
    28 can simplify \isa{hd(rev~xs)~\#~tl(rev~xs)} to \isa{rev xs}
    28 can simplify \isa{hd(rev~xs)~\#~tl(rev~xs)} to \isa{rev xs}
    29 because the corresponding precondition \isa{rev xs \isasymnoteq\ []}
    29 because the corresponding precondition \isa{rev xs \isasymnoteq\ []}
    30 simplifies to \isa{xs \isasymnoteq\ []}, which is exactly the local
    30 simplifies to \isa{xs \isasymnoteq\ []}, which is exactly the local
    31 assumption of the subgoal.
    31 assumption of the subgoal.