src/HOL/List.thy
changeset 47397 d654c73e4b12
parent 47131 af818dcdc709
child 47398 07bcf80391d0
     1.1 --- a/src/HOL/List.thy	Fri Apr 06 14:40:00 2012 +0200
     1.2 +++ b/src/HOL/List.thy	Fri Apr 06 18:17:16 2012 +0200
     1.3 @@ -85,18 +85,20 @@
     1.4  syntax (HTML output)
     1.5    "_filter" :: "[pttrn, 'a list, bool] => 'a list"("(1[_\<leftarrow>_ ./ _])")
     1.6  
     1.7 -primrec -- {* canonical argument order *}
     1.8 -  fold :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a list \<Rightarrow> 'b \<Rightarrow> 'b" where
     1.9 -    "fold f [] = id"
    1.10 -  | "fold f (x # xs) = fold f xs \<circ> f x"
    1.11 -
    1.12 -definition 
    1.13 -  foldr :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a list \<Rightarrow> 'b \<Rightarrow> 'b" where
    1.14 -  [code_abbrev]: "foldr f xs = fold f (rev xs)"
    1.15 -
    1.16 -definition
    1.17 -  foldl :: "('b \<Rightarrow> 'a \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a list \<Rightarrow> 'b" where
    1.18 -  "foldl f s xs = fold (\<lambda>x s. f s x)  xs s"
    1.19 +primrec fold :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a list \<Rightarrow> 'b \<Rightarrow> 'b"
    1.20 +where
    1.21 +  fold_Nil:  "fold f [] = id"
    1.22 +| fold_Cons: "fold f (x # xs) = fold f xs \<circ> f x" -- {* natural argument order *}
    1.23 +
    1.24 +primrec foldr :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a list \<Rightarrow> 'b \<Rightarrow> 'b"
    1.25 +where
    1.26 +  foldr_Nil:  "foldr f [] = id"
    1.27 +| foldr_Cons: "foldr f (x # xs) = f x \<circ> foldr f xs" -- {* natural argument order *}
    1.28 +
    1.29 +primrec foldl :: "('b \<Rightarrow> 'a \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a list \<Rightarrow> 'b"
    1.30 +where
    1.31 +  foldl_Nil:  "foldl f a [] = a"
    1.32 +| foldl_Cons: "foldl f a (x # xs) = foldl f (f a x) xs"
    1.33  
    1.34  primrec
    1.35    concat:: "'a list list \<Rightarrow> 'a list" where
    1.36 @@ -250,8 +252,8 @@
    1.37  @{lemma[source] "filter (\<lambda>n::nat. n<2) [0,2,1] = [0,1]" by simp}\\
    1.38  @{lemma "concat [[a,b],[c,d,e],[],[f]] = [a,b,c,d,e,f]" by simp}\\
    1.39  @{lemma "fold f [a,b,c] x = f c (f b (f a x))" by simp}\\
    1.40 -@{lemma "foldr f [a,b,c] x = f a (f b (f c x))" by (simp add: foldr_def)}\\
    1.41 -@{lemma "foldl f x [a,b,c] = f (f (f x a) b) c" by (simp add: foldl_def)}\\
    1.42 +@{lemma "foldr f [a,b,c] x = f a (f b (f c x))" by simp}\\
    1.43 +@{lemma "foldl f x [a,b,c] = f (f (f x a) b) c" by simp}\\
    1.44  @{lemma "zip [a,b,c] [x,y,z] = [(a,x),(b,y),(c,z)]" by simp}\\
    1.45  @{lemma "zip [a,b] [x,y,z] = [(a,x),(b,y)]" by simp}\\
    1.46  @{lemma "splice [a,b,c] [x,y,z] = [a,x,b,y,c,z]" by simp}\\
    1.47 @@ -277,7 +279,7 @@
    1.48  @{lemma "rotate 3 [a,b,c,d] = [d,a,b,c]" by (simp add:rotate_def eval_nat_numeral)}\\
    1.49  @{lemma "replicate 4 a = [a,a,a,a]" by (simp add:eval_nat_numeral)}\\
    1.50  @{lemma "[2..<5] = [2,3,4]" by (simp add:eval_nat_numeral)}\\
    1.51 -@{lemma "listsum [1,2,3::nat] = 6" by (simp add: listsum_def foldr_def)}
    1.52 +@{lemma "listsum [1,2,3::nat] = 6" by (simp add: listsum_def)}
    1.53  \end{tabular}}
    1.54  \caption{Characteristic examples}
    1.55  \label{fig:Characteristic}
    1.56 @@ -2387,7 +2389,7 @@
    1.57  by(auto simp add: set_zip list_all2_eq list_all2_conv_all_nth cong: conj_cong)
    1.58  
    1.59  
    1.60 -subsubsection {* @{const fold} with canonical argument order *}
    1.61 +subsubsection {* @{const fold} with natural argument order *}
    1.62  
    1.63  lemma fold_remove1_split:
    1.64    assumes f: "\<And>x y. x \<in> set xs \<Longrightarrow> y \<in> set xs \<Longrightarrow> f x \<circ> f y = f y \<circ> f x"
    1.65 @@ -2477,7 +2479,7 @@
    1.66    qed
    1.67  qed
    1.68  
    1.69 -lemma union_set_fold:
    1.70 +lemma union_set_fold [code]:
    1.71    "set xs \<union> A = fold Set.insert xs A"
    1.72  proof -
    1.73    interpret comp_fun_idem Set.insert
    1.74 @@ -2485,7 +2487,11 @@
    1.75    show ?thesis by (simp add: union_fold_insert fold_set_fold)
    1.76  qed
    1.77  
    1.78 -lemma minus_set_fold:
    1.79 +lemma union_coset_filter [code]:
    1.80 +  "List.coset xs \<union> A = List.coset (List.filter (\<lambda>x. x \<notin> A) xs)"
    1.81 +  by auto
    1.82 +
    1.83 +lemma minus_set_fold [code]:
    1.84    "A - set xs = fold Set.remove xs A"
    1.85  proof -
    1.86    interpret comp_fun_idem Set.remove
    1.87 @@ -2494,6 +2500,18 @@
    1.88      by (simp add: minus_fold_remove [of _ A] fold_set_fold)
    1.89  qed
    1.90  
    1.91 +lemma minus_coset_filter [code]:
    1.92 +  "A - List.coset xs = set (List.filter (\<lambda>x. x \<in> A) xs)"
    1.93 +  by auto
    1.94 +
    1.95 +lemma inter_set_filter [code]:
    1.96 +  "A \<inter> set xs = set (List.filter (\<lambda>x. x \<in> A) xs)"
    1.97 +  by auto
    1.98 +
    1.99 +lemma inter_coset_fold [code]:
   1.100 +  "A \<inter> List.coset xs = fold Set.remove xs A"
   1.101 +  by (simp add: Diff_eq [symmetric] minus_set_fold)
   1.102 +
   1.103  lemma (in lattice) Inf_fin_set_fold:
   1.104    "Inf_fin (set (x # xs)) = fold inf xs x"
   1.105  proof -
   1.106 @@ -2503,6 +2521,8 @@
   1.107      by (simp add: Inf_fin_def fold1_set_fold del: set.simps)
   1.108  qed
   1.109  
   1.110 +declare Inf_fin_set_fold [code]
   1.111 +
   1.112  lemma (in lattice) Sup_fin_set_fold:
   1.113    "Sup_fin (set (x # xs)) = fold sup xs x"
   1.114  proof -
   1.115 @@ -2512,6 +2532,8 @@
   1.116      by (simp add: Sup_fin_def fold1_set_fold del: set.simps)
   1.117  qed
   1.118  
   1.119 +declare Sup_fin_set_fold [code]
   1.120 +
   1.121  lemma (in linorder) Min_fin_set_fold:
   1.122    "Min (set (x # xs)) = fold min xs x"
   1.123  proof -
   1.124 @@ -2521,6 +2543,8 @@
   1.125      by (simp add: Min_def fold1_set_fold del: set.simps)
   1.126  qed
   1.127  
   1.128 +declare Min_fin_set_fold [code]
   1.129 +
   1.130  lemma (in linorder) Max_fin_set_fold:
   1.131    "Max (set (x # xs)) = fold max xs x"
   1.132  proof -
   1.133 @@ -2530,6 +2554,8 @@
   1.134      by (simp add: Max_def fold1_set_fold del: set.simps)
   1.135  qed
   1.136  
   1.137 +declare Max_fin_set_fold [code]
   1.138 +
   1.139  lemma (in complete_lattice) Inf_set_fold:
   1.140    "Inf (set xs) = fold inf xs top"
   1.141  proof -
   1.142 @@ -2538,6 +2564,8 @@
   1.143    show ?thesis by (simp add: Inf_fold_inf fold_set_fold inf_commute)
   1.144  qed
   1.145  
   1.146 +declare Inf_set_fold [where 'a = "'a set", code]
   1.147 +
   1.148  lemma (in complete_lattice) Sup_set_fold:
   1.149    "Sup (set xs) = fold sup xs bot"
   1.150  proof -
   1.151 @@ -2546,73 +2574,74 @@
   1.152    show ?thesis by (simp add: Sup_fold_sup fold_set_fold sup_commute)
   1.153  qed
   1.154  
   1.155 +declare Sup_set_fold [where 'a = "'a set", code]
   1.156 +
   1.157  lemma (in complete_lattice) INF_set_fold:
   1.158    "INFI (set xs) f = fold (inf \<circ> f) xs top"
   1.159    unfolding INF_def set_map [symmetric] Inf_set_fold fold_map ..
   1.160  
   1.161 +declare INF_set_fold [code]
   1.162 +
   1.163  lemma (in complete_lattice) SUP_set_fold:
   1.164    "SUPR (set xs) f = fold (sup \<circ> f) xs bot"
   1.165    unfolding SUP_def set_map [symmetric] Sup_set_fold fold_map ..
   1.166  
   1.167 +declare SUP_set_fold [code]
   1.168  
   1.169  subsubsection {* Fold variants: @{const foldr} and @{const foldl} *}
   1.170  
   1.171  text {* Correspondence *}
   1.172  
   1.173 -lemma foldr_foldl: -- {* The ``Third Duality Theorem'' in Bird \& Wadler: *}
   1.174 +lemma foldr_conv_fold [code_abbrev]:
   1.175 +  "foldr f xs = fold f (rev xs)"
   1.176 +  by (induct xs) simp_all
   1.177 +
   1.178 +lemma foldl_conv_fold:
   1.179 +  "foldl f s xs = fold (\<lambda>x s. f s x) xs s"
   1.180 +  by (induct xs arbitrary: s) simp_all
   1.181 +
   1.182 +lemma foldr_conv_foldl: -- {* The ``Third Duality Theorem'' in Bird \& Wadler: *}
   1.183    "foldr f xs a = foldl (\<lambda>x y. f y x) a (rev xs)"
   1.184 -  by (simp add: foldr_def foldl_def)
   1.185 -
   1.186 -lemma foldl_foldr:
   1.187 +  by (simp add: foldr_conv_fold foldl_conv_fold)
   1.188 +
   1.189 +lemma foldl_conv_foldr:
   1.190    "foldl f a xs = foldr (\<lambda>x y. f y x) (rev xs) a"
   1.191 -  by (simp add: foldr_def foldl_def)
   1.192 +  by (simp add: foldr_conv_fold foldl_conv_fold)
   1.193  
   1.194  lemma foldr_fold:
   1.195    assumes "\<And>x y. x \<in> set xs \<Longrightarrow> y \<in> set xs \<Longrightarrow> f y \<circ> f x = f x \<circ> f y"
   1.196    shows "foldr f xs = fold f xs"
   1.197 -  using assms unfolding foldr_def by (rule fold_rev)
   1.198 -
   1.199 -lemma
   1.200 -  foldr_Nil [code, simp]: "foldr f [] = id"
   1.201 -  and foldr_Cons [code, simp]: "foldr f (x # xs) = f x \<circ> foldr f xs"
   1.202 -  by (simp_all add: foldr_def)
   1.203 -
   1.204 -lemma
   1.205 -  foldl_Nil [simp]: "foldl f a [] = a"
   1.206 -  and foldl_Cons [simp]: "foldl f a (x # xs) = foldl f (f a x) xs"
   1.207 -  by (simp_all add: foldl_def)
   1.208 +  using assms unfolding foldr_conv_fold by (rule fold_rev)
   1.209  
   1.210  lemma foldr_cong [fundef_cong]:
   1.211    "a = b \<Longrightarrow> l = k \<Longrightarrow> (\<And>a x. x \<in> set l \<Longrightarrow> f x a = g x a) \<Longrightarrow> foldr f l a = foldr g k b"
   1.212 -  by (auto simp add: foldr_def intro!: fold_cong)
   1.213 +  by (auto simp add: foldr_conv_fold intro!: fold_cong)
   1.214  
   1.215  lemma foldl_cong [fundef_cong]:
   1.216    "a = b \<Longrightarrow> l = k \<Longrightarrow> (\<And>a x. x \<in> set l \<Longrightarrow> f a x = g a x) \<Longrightarrow> foldl f a l = foldl g b k"
   1.217 -  by (auto simp add: foldl_def intro!: fold_cong)
   1.218 +  by (auto simp add: foldl_conv_fold intro!: fold_cong)
   1.219  
   1.220  lemma foldr_append [simp]:
   1.221    "foldr f (xs @ ys) a = foldr f xs (foldr f ys a)"
   1.222 -  by (simp add: foldr_def)
   1.223 +  by (simp add: foldr_conv_fold)
   1.224  
   1.225  lemma foldl_append [simp]:
   1.226    "foldl f a (xs @ ys) = foldl f (foldl f a xs) ys"
   1.227 -  by (simp add: foldl_def)
   1.228 +  by (simp add: foldl_conv_fold)
   1.229  
   1.230  lemma foldr_map [code_unfold]:
   1.231    "foldr g (map f xs) a = foldr (g o f) xs a"
   1.232 -  by (simp add: foldr_def fold_map rev_map)
   1.233 +  by (simp add: foldr_conv_fold fold_map rev_map)
   1.234  
   1.235  lemma foldl_map [code_unfold]:
   1.236    "foldl g a (map f xs) = foldl (\<lambda>a x. g a (f x)) a xs"
   1.237 -  by (simp add: foldl_def fold_map comp_def)
   1.238 -
   1.239 -text {* Executing operations in terms of @{const foldr} -- tail-recursive! *}
   1.240 +  by (simp add: foldl_conv_fold fold_map comp_def)
   1.241  
   1.242  lemma concat_conv_foldr [code]:
   1.243    "concat xss = foldr append xss []"
   1.244 -  by (simp add: fold_append_concat_rev foldr_def)
   1.245 -
   1.246 -lemma minus_set_foldr [code]:
   1.247 +  by (simp add: fold_append_concat_rev foldr_conv_fold)
   1.248 +
   1.249 +lemma minus_set_foldr:
   1.250    "A - set xs = foldr Set.remove xs A"
   1.251  proof -
   1.252    have "\<And>x y :: 'a. Set.remove y \<circ> Set.remove x = Set.remove x \<circ> Set.remove y"
   1.253 @@ -2620,11 +2649,7 @@
   1.254    then show ?thesis by (simp add: minus_set_fold foldr_fold)
   1.255  qed
   1.256  
   1.257 -lemma subtract_coset_filter [code]:
   1.258 -  "A - List.coset xs = set (List.filter (\<lambda>x. x \<in> A) xs)"
   1.259 -  by auto
   1.260 -
   1.261 -lemma union_set_foldr [code]:
   1.262 +lemma union_set_foldr:
   1.263    "set xs \<union> A = foldr Set.insert xs A"
   1.264  proof -
   1.265    have "\<And>x y :: 'a. insert y \<circ> insert x = insert x \<circ> insert y"
   1.266 @@ -2632,31 +2657,23 @@
   1.267    then show ?thesis by (simp add: union_set_fold foldr_fold)
   1.268  qed
   1.269  
   1.270 -lemma union_coset_foldr [code]:
   1.271 -  "List.coset xs \<union> A = List.coset (List.filter (\<lambda>x. x \<notin> A) xs)"
   1.272 -  by auto
   1.273 -
   1.274 -lemma inter_set_filer [code]:
   1.275 -  "A \<inter> set xs = set (List.filter (\<lambda>x. x \<in> A) xs)"
   1.276 -  by auto
   1.277 -
   1.278 -lemma inter_coset_foldr [code]:
   1.279 +lemma inter_coset_foldr:
   1.280    "A \<inter> List.coset xs = foldr Set.remove xs A"
   1.281    by (simp add: Diff_eq [symmetric] minus_set_foldr)
   1.282  
   1.283 -lemma (in lattice) Inf_fin_set_foldr [code]:
   1.284 +lemma (in lattice) Inf_fin_set_foldr:
   1.285    "Inf_fin (set (x # xs)) = foldr inf xs x"
   1.286    by (simp add: Inf_fin_set_fold ac_simps foldr_fold fun_eq_iff del: set.simps)
   1.287  
   1.288 -lemma (in lattice) Sup_fin_set_foldr [code]:
   1.289 +lemma (in lattice) Sup_fin_set_foldr:
   1.290    "Sup_fin (set (x # xs)) = foldr sup xs x"
   1.291    by (simp add: Sup_fin_set_fold ac_simps foldr_fold fun_eq_iff del: set.simps)
   1.292  
   1.293 -lemma (in linorder) Min_fin_set_foldr [code]:
   1.294 +lemma (in linorder) Min_fin_set_foldr:
   1.295    "Min (set (x # xs)) = foldr min xs x"
   1.296    by (simp add: Min_fin_set_fold ac_simps foldr_fold fun_eq_iff del: set.simps)
   1.297  
   1.298 -lemma (in linorder) Max_fin_set_foldr [code]:
   1.299 +lemma (in linorder) Max_fin_set_foldr:
   1.300    "Max (set (x # xs)) = foldr max xs x"
   1.301    by (simp add: Max_fin_set_fold ac_simps foldr_fold fun_eq_iff del: set.simps)
   1.302  
   1.303 @@ -2668,13 +2685,11 @@
   1.304    "Sup (set xs) = foldr sup xs bot"
   1.305    by (simp add: Sup_set_fold ac_simps foldr_fold fun_eq_iff)
   1.306  
   1.307 -declare Inf_set_foldr [where 'a = "'a set", code] Sup_set_foldr [where 'a = "'a set", code]
   1.308 -
   1.309 -lemma (in complete_lattice) INF_set_foldr [code]:
   1.310 +lemma (in complete_lattice) INF_set_foldr:
   1.311    "INFI (set xs) f = foldr (inf \<circ> f) xs top"
   1.312    by (simp only: INF_def Inf_set_foldr foldr_map set_map [symmetric])
   1.313  
   1.314 -lemma (in complete_lattice) SUP_set_foldr [code]:
   1.315 +lemma (in complete_lattice) SUP_set_foldr:
   1.316    "SUPR (set xs) f = foldr (sup \<circ> f) xs bot"
   1.317    by (simp only: SUP_def Sup_set_foldr foldr_map set_map [symmetric])
   1.318  
   1.319 @@ -3108,7 +3123,7 @@
   1.320  
   1.321  lemma (in comm_monoid_add) listsum_rev [simp]:
   1.322    "listsum (rev xs) = listsum xs"
   1.323 -  by (simp add: listsum_def foldr_def fold_rev fun_eq_iff add_ac)
   1.324 +  by (simp add: listsum_def foldr_fold fold_rev fun_eq_iff add_ac)
   1.325  
   1.326  lemma (in monoid_add) fold_plus_listsum_rev:
   1.327    "fold plus xs = plus (listsum (rev xs))"
   1.328 @@ -3116,40 +3131,12 @@
   1.329    fix x
   1.330    have "fold plus xs x = fold plus xs (x + 0)" by simp
   1.331    also have "\<dots> = fold plus (x # xs) 0" by simp
   1.332 -  also have "\<dots> = foldr plus (rev xs @ [x]) 0" by (simp add: foldr_def)
   1.333 +  also have "\<dots> = foldr plus (rev xs @ [x]) 0" by (simp add: foldr_conv_fold)
   1.334    also have "\<dots> = listsum (rev xs @ [x])" by (simp add: listsum_def)
   1.335    also have "\<dots> = listsum (rev xs) + listsum [x]" by simp
   1.336    finally show "fold plus xs x = listsum (rev xs) + x" by simp
   1.337  qed
   1.338  
   1.339 -lemma (in semigroup_add) foldl_assoc:
   1.340 -  "foldl plus (x + y) zs = x + foldl plus y zs"
   1.341 -  by (simp add: foldl_def fold_commute_apply [symmetric] fun_eq_iff add_assoc)
   1.342 -
   1.343 -lemma (in ab_semigroup_add) foldr_conv_foldl:
   1.344 -  "foldr plus xs a = foldl plus a xs"
   1.345 -  by (simp add: foldl_def foldr_fold fun_eq_iff add_ac)
   1.346 -
   1.347 -text {*
   1.348 -  Note: @{text "n \<le> foldl (op +) n ns"} looks simpler, but is more
   1.349 -  difficult to use because it requires an additional transitivity step.
   1.350 -*}
   1.351 -
   1.352 -lemma start_le_sum:
   1.353 -  fixes m n :: nat
   1.354 -  shows "m \<le> n \<Longrightarrow> m \<le> foldl plus n ns"
   1.355 -  by (simp add: foldl_def add_commute fold_plus_listsum_rev)
   1.356 -
   1.357 -lemma elem_le_sum:
   1.358 -  fixes m n :: nat 
   1.359 -  shows "n \<in> set ns \<Longrightarrow> n \<le> foldl plus 0 ns"
   1.360 -  by (force intro: start_le_sum simp add: in_set_conv_decomp)
   1.361 -
   1.362 -lemma sum_eq_0_conv [iff]:
   1.363 -  fixes m :: nat
   1.364 -  shows "foldl plus m ns = 0 \<longleftrightarrow> m = 0 \<and> (\<forall>n \<in> set ns. n = 0)"
   1.365 -  by (induct ns arbitrary: m) auto
   1.366 -
   1.367  text{* Some syntactic sugar for summing a function over a list: *}
   1.368  
   1.369  syntax
   1.370 @@ -3186,17 +3173,18 @@
   1.371  
   1.372  lemma listsum_eq_0_nat_iff_nat [simp]:
   1.373    "listsum ns = (0::nat) \<longleftrightarrow> (\<forall>n \<in> set ns. n = 0)"
   1.374 -  by (simp add: listsum_def foldr_conv_foldl)
   1.375 +  by (induct ns) simp_all
   1.376 +
   1.377 +lemma member_le_listsum_nat:
   1.378 +  "(n :: nat) \<in> set ns \<Longrightarrow> n \<le> listsum ns"
   1.379 +  by (induct ns) auto
   1.380  
   1.381  lemma elem_le_listsum_nat:
   1.382    "k < size ns \<Longrightarrow> ns ! k \<le> listsum (ns::nat list)"
   1.383 -apply(induct ns arbitrary: k)
   1.384 - apply simp
   1.385 -apply(fastforce simp add:nth_Cons split: nat.split)
   1.386 -done
   1.387 +  by (rule member_le_listsum_nat) simp
   1.388  
   1.389  lemma listsum_update_nat:
   1.390 -  "k<size ns \<Longrightarrow> listsum (ns[k := (n::nat)]) = listsum ns + n - ns ! k"
   1.391 +  "k < size ns \<Longrightarrow> listsum (ns[k := (n::nat)]) = listsum ns + n - ns ! k"
   1.392  apply(induct ns arbitrary:k)
   1.393   apply (auto split:nat.split)
   1.394  apply(drule elem_le_listsum_nat)
   1.395 @@ -4053,7 +4041,7 @@
   1.396      show "(insort_key f y \<circ> insort_key f x) zs = (insort_key f x \<circ> insort_key f y) zs"
   1.397        by (induct zs) (auto intro: * simp add: **)
   1.398    qed
   1.399 -  then show ?thesis by (simp add: sort_key_def foldr_def)
   1.400 +  then show ?thesis by (simp add: sort_key_def foldr_conv_fold)
   1.401  qed
   1.402  
   1.403  lemma (in linorder) sort_conv_fold:
   1.404 @@ -4601,7 +4589,7 @@
   1.405  lemma listsp_inf_eq [simp]: "listsp (inf A B) = inf (listsp A) (listsp B)"
   1.406  proof (rule mono_inf [where f=listsp, THEN order_antisym])
   1.407    show "mono listsp" by (simp add: mono_def listsp_mono)
   1.408 -  show "inf (listsp A) (listsp B) \<le> listsp (inf A B)" by (blast intro!: listsp_infI predicate1I)
   1.409 +  show "inf (listsp A) (listsp B) \<le> listsp (inf A B)" by (blast intro!: listsp_infI)
   1.410  qed
   1.411  
   1.412  lemmas listsp_conj_eq [simp] = listsp_inf_eq [simplified inf_fun_def inf_bool_def]
   1.413 @@ -5756,3 +5744,4 @@
   1.414    by (simp add: wf_iff_acyclic_if_finite)
   1.415  
   1.416  end
   1.417 +