90 by (unfold list_le_def, cases x) auto |
90 by (unfold list_le_def, cases x) auto |
91 |
91 |
92 lemma Cons_le_Cons [simp]: "a # x \<le> b # y \<longleftrightarrow> a < b \<or> a = b \<and> x \<le> y" |
92 lemma Cons_le_Cons [simp]: "a # x \<le> b # y \<longleftrightarrow> a < b \<or> a = b \<and> x \<le> y" |
93 by (unfold list_le_def) auto |
93 by (unfold list_le_def) auto |
94 |
94 |
95 lemma less_code [code func]: |
95 lemma less_code [code]: |
96 "xs < ([]\<Colon>'a\<Colon>{eq, order} list) \<longleftrightarrow> False" |
96 "xs < ([]\<Colon>'a\<Colon>{eq, order} list) \<longleftrightarrow> False" |
97 "[] < (x\<Colon>'a\<Colon>{eq, order}) # xs \<longleftrightarrow> True" |
97 "[] < (x\<Colon>'a\<Colon>{eq, order}) # xs \<longleftrightarrow> True" |
98 "(x\<Colon>'a\<Colon>{eq, order}) # xs < y # ys \<longleftrightarrow> x < y \<or> x = y \<and> xs < ys" |
98 "(x\<Colon>'a\<Colon>{eq, order}) # xs < y # ys \<longleftrightarrow> x < y \<or> x = y \<and> xs < ys" |
99 by simp_all |
99 by simp_all |
100 |
100 |
101 lemma less_eq_code [code func]: |
101 lemma less_eq_code [code]: |
102 "x # xs \<le> ([]\<Colon>'a\<Colon>{eq, order} list) \<longleftrightarrow> False" |
102 "x # xs \<le> ([]\<Colon>'a\<Colon>{eq, order} list) \<longleftrightarrow> False" |
103 "[] \<le> (xs\<Colon>'a\<Colon>{eq, order} list) \<longleftrightarrow> True" |
103 "[] \<le> (xs\<Colon>'a\<Colon>{eq, order} list) \<longleftrightarrow> True" |
104 "(x\<Colon>'a\<Colon>{eq, order}) # xs \<le> y # ys \<longleftrightarrow> x < y \<or> x = y \<and> xs \<le> ys" |
104 "(x\<Colon>'a\<Colon>{eq, order}) # xs \<le> y # ys \<longleftrightarrow> x < y \<or> x = y \<and> xs \<le> ys" |
105 by simp_all |
105 by simp_all |
106 |
106 |