src/HOL/Library/Sublist.thy
changeset 73397 d47c8a89c6a5
parent 73381 3fdb94d87e0e
child 73411 1f1366966296
equal deleted inserted replaced
73396:8a1c6c7909c9 73397:d47c8a89c6a5
  1383     by (auto simp: prefix_def)
  1383     by (auto simp: prefix_def)
  1384   show ?thesis
  1384   show ?thesis
  1385     by (simp add: ys zs1 zs2)
  1385     by (simp add: ys zs1 zs2)
  1386 qed
  1386 qed
  1387 
  1387 
  1388 lemma sublist_list_all: "sublist xs ys \<Longrightarrow> list_all P ys \<Longrightarrow> list_all P xs"
       
  1389   by (auto simp: sublist_def)
       
  1390 
       
  1391 lemmas prefix_list_all = prefix_imp_sublist[THEN sublist_list_all]
       
  1392 lemmas suffix_list_all = suffix_imp_sublist[THEN sublist_list_all]
       
  1393 
       
  1394 subsubsection \<open>\<open>sublists\<close>\<close>
  1388 subsubsection \<open>\<open>sublists\<close>\<close>
  1395 
  1389 
  1396 primrec sublists :: "'a list \<Rightarrow> 'a list list" where
  1390 primrec sublists :: "'a list \<Rightarrow> 'a list list" where
  1397   "sublists [] = [[]]"
  1391   "sublists [] = [[]]"
  1398 | "sublists (x # xs) = sublists xs @ map ((#) x) (prefixes xs)"
  1392 | "sublists (x # xs) = sublists xs @ map ((#) x) (prefixes xs)"