src/HOL/Library/While_Combinator.thy
changeset 14300 bf8b8c9425c3
parent 12791 ccc0f45ad2c4
child 14589 feae7b5fd425
equal deleted inserted replaced
14299:0b5c0b0a3eba 14300:bf8b8c9425c3
    65   apply (erule_tac x = "\<lambda>i. f (Suc i)" in allE)
    65   apply (erule_tac x = "\<lambda>i. f (Suc i)" in allE)
    66   apply blast
    66   apply blast
    67   done
    67   done
    68 
    68 
    69 hide const while_aux
    69 hide const while_aux
       
    70 
       
    71 lemma def_while_unfold: assumes fdef: "f == while test do"
       
    72       shows "f x = (if test x then f(do x) else x)"
       
    73 proof -
       
    74   have "f x = while test do x" using fdef by simp
       
    75   also have "\<dots> = (if test x then while test do (do x) else x)"
       
    76     by(rule while_unfold)
       
    77   also have "\<dots> = (if test x then f(do x) else x)" by(simp add:fdef[symmetric])
       
    78   finally show ?thesis .
       
    79 qed
       
    80 
    70 
    81 
    71 text {*
    82 text {*
    72  The proof rule for @{term while}, where @{term P} is the invariant.
    83  The proof rule for @{term while}, where @{term P} is the invariant.
    73 *}
    84 *}
    74 
    85