ProgTutorial/Package/Ind_Prelims.thy
changeset 562 daf404920ab9
parent 513 f223f8223d4a
child 565 cecd7a941885
equal deleted inserted replaced
561:aec7073d4645 562:daf404920ab9
   167 lemma trcl_step_blast: 
   167 lemma trcl_step_blast: 
   168 shows "R x y \<Longrightarrow> trcl R y z \<Longrightarrow> trcl R x z"
   168 shows "R x y \<Longrightarrow> trcl R y z \<Longrightarrow> trcl R x z"
   169 apply(unfold trcl_def)
   169 apply(unfold trcl_def)
   170 apply(blast)
   170 apply(blast)
   171 done
   171 done
   172 
   172 term "even"
   173 text {*
   173 text {*
   174   Experience has shown that it is generally a bad idea to rely heavily on
   174   Experience has shown that it is generally a bad idea to rely heavily on
   175   @{text blast}, @{text auto} and the like in automated proofs. The reason is
   175   @{text blast}, @{text auto} and the like in automated proofs. The reason is
   176   that you do not have precise control over them (the user can, for example,
   176   that you do not have precise control over them (the user can, for example,
   177   declare new intro- or simplification rules that can throw automatic tactics
   177   declare new intro- or simplification rules that can throw automatic tactics
   192   Since the predicates @{term even} and @{term odd} are mutually inductive, each 
   192   Since the predicates @{term even} and @{term odd} are mutually inductive, each 
   193   corresponding definition must quantify over both predicates (we name them 
   193   corresponding definition must quantify over both predicates (we name them 
   194   below @{text "P"} and @{text "Q"}).
   194   below @{text "P"} and @{text "Q"}).
   195 *}
   195 *}
   196 
   196 
   197 definition "even \<equiv> 
   197 hide_const even
       
   198 hide_const odd
       
   199 
       
   200 definition "even \<equiv>
   198   \<lambda>n. \<forall>P Q. P 0 \<longrightarrow> (\<forall>m. Q m \<longrightarrow> P (Suc m)) 
   201   \<lambda>n. \<forall>P Q. P 0 \<longrightarrow> (\<forall>m. Q m \<longrightarrow> P (Suc m)) 
   199                  \<longrightarrow> (\<forall>m. P m \<longrightarrow> Q (Suc m)) \<longrightarrow> P n"
   202                  \<longrightarrow> (\<forall>m. P m \<longrightarrow> Q (Suc m)) \<longrightarrow> P n"
   200 
   203 
   201 definition "odd \<equiv>
   204 definition "odd \<equiv>
   202   \<lambda>n. \<forall>P Q. P 0 \<longrightarrow> (\<forall>m. Q m \<longrightarrow> P (Suc m)) 
   205   \<lambda>n. \<forall>P Q. P 0 \<longrightarrow> (\<forall>m. Q m \<longrightarrow> P (Suc m))