src/HOL/List.thy
changeset 36154 11c6106d7787
parent 35828 46cfc4b8112e
child 36176 3fe7e97ccca8
equal deleted inserted replaced
36147:b43b22f63665 36154:11c6106d7787
   511 next
   511 next
   512   case (Cons x xs ys zs) then show ?case by (cases ys, simp_all)
   512   case (Cons x xs ys zs) then show ?case by (cases ys, simp_all)
   513     (cases zs, simp_all)
   513     (cases zs, simp_all)
   514 qed
   514 qed
   515 
   515 
       
   516 lemma list_induct4 [consumes 3, case_names Nil Cons]:
       
   517   "length xs = length ys \<Longrightarrow> length ys = length zs \<Longrightarrow> length zs = length ws \<Longrightarrow>
       
   518    P [] [] [] [] \<Longrightarrow> (\<And>x xs y ys z zs w ws. length xs = length ys \<Longrightarrow>
       
   519    length ys = length zs \<Longrightarrow> length zs = length ws \<Longrightarrow> P xs ys zs ws \<Longrightarrow>
       
   520    P (x#xs) (y#ys) (z#zs) (w#ws)) \<Longrightarrow> P xs ys zs ws"
       
   521 proof (induct xs arbitrary: ys zs ws)
       
   522   case Nil then show ?case by simp
       
   523 next
       
   524   case (Cons x xs ys zs ws) then show ?case by ((cases ys, simp_all), (cases zs,simp_all)) (cases ws, simp_all)
       
   525 qed
       
   526 
   516 lemma list_induct2': 
   527 lemma list_induct2': 
   517   "\<lbrakk> P [] [];
   528   "\<lbrakk> P [] [];
   518   \<And>x xs. P (x#xs) [];
   529   \<And>x xs. P (x#xs) [];
   519   \<And>y ys. P [] (y#ys);
   530   \<And>y ys. P [] (y#ys);
   520    \<And>x xs y ys. P xs ys  \<Longrightarrow> P (x#xs) (y#ys) \<rbrakk>
   531    \<And>x xs y ys. P xs ys  \<Longrightarrow> P (x#xs) (y#ys) \<rbrakk>