src/HOL/Library/Prefix_Order.thy
author wenzelm
Mon Dec 28 01:28:28 2015 +0100 (2015-12-28)
changeset 61945 1135b8de26c3
parent 61337 4645502c3c64
child 63117 acb6d72fc42e
permissions -rw-r--r--
more symbols;
     1 (*  Title:      HOL/Library/Prefix_Order.thy
     2     Author:     Tobias Nipkow and Markus Wenzel, TU Muenchen
     3 *)
     4 
     5 section \<open>Prefix order on lists as order class instance\<close>
     6 
     7 theory Prefix_Order
     8 imports Sublist
     9 begin
    10 
    11 instantiation list :: (type) order
    12 begin
    13 
    14 definition "(xs::'a list) \<le> ys \<equiv> prefixeq xs ys"
    15 definition "(xs::'a list) < ys \<equiv> xs \<le> ys \<and> \<not> (ys \<le> xs)"
    16 
    17 instance
    18   by standard (auto simp: less_eq_list_def less_list_def)
    19 
    20 end
    21 
    22 lemmas prefixI [intro?] = prefixeqI [folded less_eq_list_def]
    23 lemmas prefixE [elim?] = prefixeqE [folded less_eq_list_def]
    24 lemmas strict_prefixI' [intro?] = prefixI' [folded less_list_def]
    25 lemmas strict_prefixE' [elim?] = prefixE' [folded less_list_def]
    26 lemmas strict_prefixI [intro?] = prefixI [folded less_list_def]
    27 lemmas strict_prefixE [elim?] = prefixE [folded less_list_def]
    28 lemmas Nil_prefix [iff] = Nil_prefixeq [folded less_eq_list_def]
    29 lemmas prefix_Nil [simp] = prefixeq_Nil [folded less_eq_list_def]
    30 lemmas prefix_snoc [simp] = prefixeq_snoc [folded less_eq_list_def]
    31 lemmas Cons_prefix_Cons [simp] = Cons_prefixeq_Cons [folded less_eq_list_def]
    32 lemmas same_prefix_prefix [simp] = same_prefixeq_prefixeq [folded less_eq_list_def]
    33 lemmas same_prefix_nil [iff] = same_prefixeq_nil [folded less_eq_list_def]
    34 lemmas prefix_prefix [simp] = prefixeq_prefixeq [folded less_eq_list_def]
    35 lemmas prefix_Cons = prefixeq_Cons [folded less_eq_list_def]
    36 lemmas prefix_length_le = prefixeq_length_le [folded less_eq_list_def]
    37 lemmas strict_prefix_simps [simp, code] = prefix_simps [folded less_list_def]
    38 lemmas not_prefix_induct [consumes 1, case_names Nil Neq Eq] =
    39   not_prefixeq_induct [folded less_eq_list_def]
    40 
    41 end