src/HOL/List.thy
changeset 14208 144f45277d5a
parent 14187 26dfcd0ac436
child 14247 cb32eb89bddd
     1.1 --- a/src/HOL/List.thy	Fri Sep 26 10:34:28 2003 +0200
     1.2 +++ b/src/HOL/List.thy	Fri Sep 26 10:34:57 2003 +0200
     1.3 @@ -282,16 +282,13 @@
     1.4  
     1.5  lemma Suc_length_conv:
     1.6  "(Suc n = length xs) = (\<exists>y ys. xs = y # ys \<and> length ys = n)"
     1.7 -apply (induct xs)
     1.8 - apply simp
     1.9 -apply simp
    1.10 +apply (induct xs, simp, simp)
    1.11  apply blast
    1.12  done
    1.13  
    1.14  lemma impossible_Cons [rule_format]: 
    1.15    "length xs <= length ys --> xs = x # ys = False"
    1.16 -apply (induct xs)
    1.17 -apply auto
    1.18 +apply (induct xs, auto)
    1.19  done
    1.20  
    1.21  
    1.22 @@ -319,12 +316,8 @@
    1.23   "!!ys. length xs = length ys \<or> length us = length vs
    1.24   ==> (xs@us = ys@vs) = (xs=ys \<and> us=vs)"
    1.25  apply (induct xs)
    1.26 - apply (case_tac ys)
    1.27 -apply simp
    1.28 - apply force
    1.29 -apply (case_tac ys)
    1.30 - apply force
    1.31 -apply simp
    1.32 + apply (case_tac ys, simp, force)
    1.33 +apply (case_tac ys, force, simp)
    1.34  done
    1.35  
    1.36  lemma same_append_eq [iff]: "(xs @ ys = xs @ zs) = (ys = zs)"
    1.37 @@ -486,12 +479,9 @@
    1.38  by (rules dest: map_injective injD intro: inj_onI)
    1.39  
    1.40  lemma inj_mapD: "inj (map f) ==> inj f"
    1.41 -apply (unfold inj_on_def)
    1.42 -apply clarify
    1.43 +apply (unfold inj_on_def, clarify)
    1.44  apply (erule_tac x = "[x]" in ballE)
    1.45 - apply (erule_tac x = "[y]" in ballE)
    1.46 -apply simp
    1.47 - apply blast
    1.48 + apply (erule_tac x = "[y]" in ballE, simp, blast)
    1.49  apply blast
    1.50  done
    1.51  
    1.52 @@ -514,11 +504,8 @@
    1.53  by (induct xs) auto
    1.54  
    1.55  lemma rev_is_rev_conv [iff]: "!!ys. (rev xs = rev ys) = (xs = ys)"
    1.56 -apply (induct xs)
    1.57 - apply force
    1.58 -apply (case_tac ys)
    1.59 - apply simp
    1.60 -apply force
    1.61 +apply (induct xs, force)
    1.62 +apply (case_tac ys, simp, force)
    1.63  done
    1.64  
    1.65  lemma rev_induct [case_names Nil snoc]:
    1.66 @@ -545,9 +532,7 @@
    1.67  by (induct xs) auto
    1.68  
    1.69  lemma hd_in_set: "l = x#xs \<Longrightarrow> x\<in>set l"
    1.70 -apply (case_tac l)
    1.71 -apply auto
    1.72 -done
    1.73 +by (case_tac l, auto)
    1.74  
    1.75  lemma set_subset_Cons: "set xs \<subseteq> set (x # xs)"
    1.76  by auto
    1.77 @@ -568,21 +553,16 @@
    1.78  by (induct xs) auto
    1.79  
    1.80  lemma set_upt [simp]: "set[i..j(] = {k. i \<le> k \<and> k < j}"
    1.81 -apply (induct j)
    1.82 - apply simp_all
    1.83 -apply(erule ssubst)
    1.84 -apply auto
    1.85 +apply (induct j, simp_all)
    1.86 +apply (erule ssubst, auto)
    1.87  done
    1.88  
    1.89  lemma in_set_conv_decomp: "(x : set xs) = (\<exists>ys zs. xs = ys @ x # zs)"
    1.90 -apply (induct xs)
    1.91 - apply simp
    1.92 -apply simp
    1.93 +apply (induct xs, simp, simp)
    1.94  apply (rule iffI)
    1.95   apply (blast intro: eq_Nil_appendI Cons_eq_appendI)
    1.96  apply (erule exE)+
    1.97 -apply (case_tac ys)
    1.98 -apply auto
    1.99 +apply (case_tac ys, auto)
   1.100  done
   1.101  
   1.102  lemma in_lists_conv_set: "(xs : lists A) = (\<forall>x \<in> set xs. x : A)"
   1.103 @@ -674,33 +654,23 @@
   1.104  
   1.105  lemma nth_append:
   1.106  "!!n. (xs @ ys)!n = (if n < length xs then xs!n else ys!(n - length xs))"
   1.107 -apply(induct "xs")
   1.108 - apply simp
   1.109 -apply (case_tac n)
   1.110 - apply auto
   1.111 +apply (induct "xs", simp)
   1.112 +apply (case_tac n, auto)
   1.113  done
   1.114  
   1.115  lemma nth_map [simp]: "!!n. n < length xs ==> (map f xs)!n = f(xs!n)"
   1.116 -apply(induct xs)
   1.117 - apply simp
   1.118 -apply (case_tac n)
   1.119 - apply auto
   1.120 +apply (induct xs, simp)
   1.121 +apply (case_tac n, auto)
   1.122  done
   1.123  
   1.124  lemma set_conv_nth: "set xs = {xs!i | i. i < length xs}"
   1.125 -apply (induct_tac xs)
   1.126 - apply simp
   1.127 -apply simp
   1.128 +apply (induct_tac xs, simp, simp)
   1.129  apply safe
   1.130 -apply (rule_tac x = 0 in exI)
   1.131 -apply simp
   1.132 - apply (rule_tac x = "Suc i" in exI)
   1.133 - apply simp
   1.134 -apply (case_tac i)
   1.135 - apply simp
   1.136 +apply (rule_tac x = 0 in exI, simp)
   1.137 + apply (rule_tac x = "Suc i" in exI, simp)
   1.138 +apply (case_tac i, simp)
   1.139  apply (rename_tac j)
   1.140 -apply (rule_tac x = j in exI)
   1.141 -apply simp
   1.142 +apply (rule_tac x = j in exI, simp)
   1.143  done
   1.144  
   1.145  lemma list_ball_nth: "[| n < length xs; !x : set xs. P x|] ==> P(xs!n)"
   1.146 @@ -738,8 +708,7 @@
   1.147  by (induct xs) (auto split: nat.split)
   1.148  
   1.149  lemma list_update_id[simp]: "!!i. i < length xs \<Longrightarrow> xs[i := xs!i] = xs"
   1.150 -apply(induct xs)
   1.151 - apply simp
   1.152 +apply (induct xs, simp)
   1.153  apply(simp split:nat.splits)
   1.154  done
   1.155  
   1.156 @@ -749,8 +718,7 @@
   1.157  
   1.158  lemma list_update_append1:
   1.159   "!!i. i < size xs \<Longrightarrow> (xs @ ys)[i:=x] = xs[i:=x] @ ys"
   1.160 -apply(induct xs)
   1.161 - apply simp
   1.162 +apply (induct xs, simp)
   1.163  apply(simp split:nat.split)
   1.164  done
   1.165  
   1.166 @@ -816,17 +784,14 @@
   1.167  by(induct xs, simp_all add:drop_Cons drop_Suc split:nat.split)
   1.168  
   1.169  lemma nth_via_drop: "!!n. drop n xs = y#ys \<Longrightarrow> xs!n = y"
   1.170 -apply(induct xs)
   1.171 - apply simp
   1.172 +apply (induct xs, simp)
   1.173  apply(simp add:drop_Cons nth_Cons split:nat.splits)
   1.174  done
   1.175  
   1.176  lemma take_Suc_conv_app_nth:
   1.177   "!!i. i < length xs \<Longrightarrow> take (Suc i) xs = take i xs @ [xs!i]"
   1.178 -apply(induct xs)
   1.179 - apply simp
   1.180 -apply(case_tac i)
   1.181 -apply auto
   1.182 +apply (induct xs, simp)
   1.183 +apply (case_tac i, auto)
   1.184  done
   1.185  
   1.186  lemma length_take [simp]: "!!xs. length (take n xs) = min (length xs) n"
   1.187 @@ -850,78 +815,56 @@
   1.188  by (induct n) (auto, case_tac xs, auto)
   1.189  
   1.190  lemma take_take [simp]: "!!xs n. take n (take m xs) = take (min n m) xs"
   1.191 -apply (induct m)
   1.192 - apply auto
   1.193 -apply (case_tac xs)
   1.194 - apply auto
   1.195 -apply (case_tac na)
   1.196 - apply auto
   1.197 +apply (induct m, auto)
   1.198 +apply (case_tac xs, auto)
   1.199 +apply (case_tac na, auto)
   1.200  done
   1.201  
   1.202  lemma drop_drop [simp]: "!!xs. drop n (drop m xs) = drop (n + m) xs"
   1.203 -apply (induct m)
   1.204 - apply auto
   1.205 -apply (case_tac xs)
   1.206 - apply auto
   1.207 +apply (induct m, auto)
   1.208 +apply (case_tac xs, auto)
   1.209  done
   1.210  
   1.211  lemma take_drop: "!!xs n. take n (drop m xs) = drop m (take (n + m) xs)"
   1.212 -apply (induct m)
   1.213 - apply auto
   1.214 -apply (case_tac xs)
   1.215 - apply auto
   1.216 +apply (induct m, auto)
   1.217 +apply (case_tac xs, auto)
   1.218  done
   1.219  
   1.220  lemma append_take_drop_id [simp]: "!!xs. take n xs @ drop n xs = xs"
   1.221 -apply (induct n)
   1.222 - apply auto
   1.223 -apply (case_tac xs)
   1.224 - apply auto
   1.225 +apply (induct n, auto)
   1.226 +apply (case_tac xs, auto)
   1.227  done
   1.228  
   1.229  lemma take_map: "!!xs. take n (map f xs) = map f (take n xs)"
   1.230 -apply (induct n)
   1.231 - apply auto
   1.232 -apply (case_tac xs)
   1.233 - apply auto
   1.234 +apply (induct n, auto)
   1.235 +apply (case_tac xs, auto)
   1.236  done
   1.237  
   1.238  lemma drop_map: "!!xs. drop n (map f xs) = map f (drop n xs)"
   1.239 -apply (induct n)
   1.240 - apply auto
   1.241 -apply (case_tac xs)
   1.242 - apply auto
   1.243 +apply (induct n, auto)
   1.244 +apply (case_tac xs, auto)
   1.245  done
   1.246  
   1.247  lemma rev_take: "!!i. rev (take i xs) = drop (length xs - i) (rev xs)"
   1.248 -apply (induct xs)
   1.249 - apply auto
   1.250 -apply (case_tac i)
   1.251 - apply auto
   1.252 +apply (induct xs, auto)
   1.253 +apply (case_tac i, auto)
   1.254  done
   1.255  
   1.256  lemma rev_drop: "!!i. rev (drop i xs) = take (length xs - i) (rev xs)"
   1.257 -apply (induct xs)
   1.258 - apply auto
   1.259 -apply (case_tac i)
   1.260 - apply auto
   1.261 +apply (induct xs, auto)
   1.262 +apply (case_tac i, auto)
   1.263  done
   1.264  
   1.265  lemma nth_take [simp]: "!!n i. i < n ==> (take n xs)!i = xs!i"
   1.266 -apply (induct xs)
   1.267 - apply auto
   1.268 -apply (case_tac n)
   1.269 - apply(blast )
   1.270 -apply (case_tac i)
   1.271 - apply auto
   1.272 +apply (induct xs, auto)
   1.273 +apply (case_tac n, blast)
   1.274 +apply (case_tac i, auto)
   1.275  done
   1.276  
   1.277  lemma nth_drop [simp]:
   1.278  "!!xs i. n + i <= length xs ==> (drop n xs)!i = xs!(n + i)"
   1.279 -apply (induct n)
   1.280 - apply auto
   1.281 -apply (case_tac xs)
   1.282 - apply auto
   1.283 +apply (induct n, auto)
   1.284 +apply (case_tac xs, auto)
   1.285  done
   1.286  
   1.287  lemma set_take_subset: "\<And>n. set(take n xs) \<subseteq> set xs"
   1.288 @@ -938,11 +881,8 @@
   1.289  
   1.290  lemma append_eq_conv_conj:
   1.291  "!!zs. (xs @ ys = zs) = (xs = take (length xs) zs \<and> ys = drop (length xs) zs)"
   1.292 -apply(induct xs)
   1.293 - apply simp
   1.294 -apply clarsimp
   1.295 -apply (case_tac zs)
   1.296 -apply auto
   1.297 +apply (induct xs, simp, clarsimp)
   1.298 +apply (case_tac zs, auto)
   1.299  done
   1.300  
   1.301  lemma take_add [rule_format]: 
   1.302 @@ -1004,28 +944,22 @@
   1.303  
   1.304  lemma length_zip [simp]:
   1.305  "!!xs. length (zip xs ys) = min (length xs) (length ys)"
   1.306 -apply(induct ys)
   1.307 - apply simp
   1.308 -apply (case_tac xs)
   1.309 - apply auto
   1.310 +apply (induct ys, simp)
   1.311 +apply (case_tac xs, auto)
   1.312  done
   1.313  
   1.314  lemma zip_append1:
   1.315  "!!xs. zip (xs @ ys) zs =
   1.316  zip xs (take (length xs) zs) @ zip ys (drop (length xs) zs)"
   1.317 -apply (induct zs)
   1.318 - apply simp
   1.319 -apply (case_tac xs)
   1.320 - apply simp_all
   1.321 +apply (induct zs, simp)
   1.322 +apply (case_tac xs, simp_all)
   1.323  done
   1.324  
   1.325  lemma zip_append2:
   1.326  "!!ys. zip xs (ys @ zs) =
   1.327  zip (take (length ys) xs) ys @ zip (drop (length ys) xs) zs"
   1.328 -apply (induct xs)
   1.329 - apply simp
   1.330 -apply (case_tac ys)
   1.331 - apply simp_all
   1.332 +apply (induct xs, simp)
   1.333 +apply (case_tac ys, simp_all)
   1.334  done
   1.335  
   1.336  lemma zip_append [simp]:
   1.337 @@ -1035,16 +969,13 @@
   1.338  
   1.339  lemma zip_rev:
   1.340  "!!xs. length xs = length ys ==> zip (rev xs) (rev ys) = rev (zip xs ys)"
   1.341 -apply(induct ys)
   1.342 - apply simp
   1.343 -apply (case_tac xs)
   1.344 - apply simp_all
   1.345 +apply (induct ys, simp)
   1.346 +apply (case_tac xs, simp_all)
   1.347  done
   1.348  
   1.349  lemma nth_zip [simp]:
   1.350  "!!i xs. [| i < length xs; i < length ys|] ==> (zip xs ys)!i = (xs!i, ys!i)"
   1.351 -apply (induct ys)
   1.352 - apply simp
   1.353 +apply (induct ys, simp)
   1.354  apply (case_tac xs)
   1.355   apply (simp_all add: nth.simps split: nat.split)
   1.356  done
   1.357 @@ -1059,10 +990,8 @@
   1.358  
   1.359  lemma zip_replicate [simp]:
   1.360  "!!j. zip (replicate i x) (replicate j y) = replicate (min i j) (x,y)"
   1.361 -apply (induct i)
   1.362 - apply auto
   1.363 -apply (case_tac j)
   1.364 - apply auto
   1.365 +apply (induct i, auto)
   1.366 +apply (case_tac j, auto)
   1.367  done
   1.368  
   1.369  
   1.370 @@ -1105,8 +1034,7 @@
   1.371  apply (rule iffI)
   1.372   apply (rule_tac x = "take (length xs) zs" in exI)
   1.373   apply (rule_tac x = "drop (length xs) zs" in exI)
   1.374 - apply (force split: nat_diff_split simp add: min_def)
   1.375 -apply clarify
   1.376 + apply (force split: nat_diff_split simp add: min_def, clarify)
   1.377  apply (simp add: ball_Un)
   1.378  done
   1.379  
   1.380 @@ -1118,18 +1046,15 @@
   1.381  apply (rule iffI)
   1.382   apply (rule_tac x = "take (length ys) xs" in exI)
   1.383   apply (rule_tac x = "drop (length ys) xs" in exI)
   1.384 - apply (force split: nat_diff_split simp add: min_def)
   1.385 -apply clarify
   1.386 + apply (force split: nat_diff_split simp add: min_def, clarify)
   1.387  apply (simp add: ball_Un)
   1.388  done
   1.389  
   1.390  lemma list_all2_append:
   1.391    "\<And>b. length a = length b \<Longrightarrow>
   1.392    list_all2 P (a@c) (b@d) = (list_all2 P a b \<and> list_all2 P c d)"
   1.393 -  apply (induct a)
   1.394 -   apply simp
   1.395 -  apply (case_tac b)
   1.396 -  apply auto
   1.397 +  apply (induct a, simp)
   1.398 +  apply (case_tac b, auto)
   1.399    done
   1.400  
   1.401  lemma list_all2_appendI [intro?, trans]:
   1.402 @@ -1185,20 +1110,15 @@
   1.403  
   1.404  lemma list_all2_dropI [intro?]:
   1.405    "\<And>n bs. list_all2 P as bs \<Longrightarrow> list_all2 P (drop n as) (drop n bs)"
   1.406 -  apply (induct as)
   1.407 -   apply simp
   1.408 +  apply (induct as, simp)
   1.409    apply (clarsimp simp add: list_all2_Cons1)
   1.410 -  apply (case_tac n)
   1.411 -   apply simp
   1.412 -  apply simp
   1.413 +  apply (case_tac n, simp, simp)
   1.414    done
   1.415  
   1.416  lemma list_all2_mono [intro?]:
   1.417    "\<And>y. list_all2 P x y \<Longrightarrow> (\<And>x y. P x y \<Longrightarrow> Q x y) \<Longrightarrow> list_all2 Q x y"
   1.418 -  apply (induct x)
   1.419 -   apply simp
   1.420 -  apply (case_tac y)
   1.421 -  apply auto
   1.422 +  apply (induct x, simp)
   1.423 +  apply (case_tac y, auto)
   1.424    done
   1.425  
   1.426  
   1.427 @@ -1231,7 +1151,7 @@
   1.428    Nil:  "(a, [],a) : fold_rel R"
   1.429    Cons: "[|(a,x,b) : R; (b,xs,c) : fold_rel R|] ==> (a,x#xs,c) : fold_rel R"
   1.430  inductive_cases fold_rel_elim_case [elim!]:
   1.431 -   "(a, []  , b) : fold_rel R"
   1.432 +   "(a, [] , b) : fold_rel R"
   1.433     "(a, x#xs, b) : fold_rel R"
   1.434  
   1.435  lemma fold_rel_Nil [intro!]: "a = b ==> (a, [], b) : fold_rel R" 
   1.436 @@ -1255,8 +1175,7 @@
   1.437  lemma upt_conv_Cons: "i < j ==> [i..j(] = i # [Suc i..j(]"
   1.438  apply(rule trans)
   1.439  apply(subst upt_rec)
   1.440 - prefer 2 apply(rule refl)
   1.441 -apply simp
   1.442 + prefer 2 apply (rule refl, simp)
   1.443  done
   1.444  
   1.445  lemma upt_add_eq_append: "i<=j ==> [i..j+k(] = [i..j(]@[j..j+k(]"
   1.446 @@ -1272,8 +1191,7 @@
   1.447  done
   1.448  
   1.449  lemma take_upt [simp]: "!!i. i+m <= n ==> take m [i..n(] = [i..i+m(]"
   1.450 -apply (induct m)
   1.451 - apply simp
   1.452 +apply (induct m, simp)
   1.453  apply (subst upt_rec)
   1.454  apply (rule sym)
   1.455  apply (subst upt_rec)
   1.456 @@ -1293,13 +1211,10 @@
   1.457    "!!xs ys. k <= length xs ==> k <= length ys ==>
   1.458       (!!i. i < k --> xs!i = ys!i) ==> take k xs = take k ys"
   1.459  apply (atomize, induct k)
   1.460 -apply (simp_all add: less_Suc_eq_0_disj all_conj_distrib)
   1.461 -apply clarify
   1.462 +apply (simp_all add: less_Suc_eq_0_disj all_conj_distrib, clarify)
   1.463  txt {* Both lists must be non-empty *}
   1.464 -apply (case_tac xs)
   1.465 - apply simp
   1.466 -apply (case_tac ys)
   1.467 - apply clarify
   1.468 +apply (case_tac xs, simp)
   1.469 +apply (case_tac ys, clarify)
   1.470   apply (simp (no_asm_use))
   1.471  apply clarify
   1.472  txt {* prenexing's needed, not miniscoping *}
   1.473 @@ -1318,9 +1233,7 @@
   1.474    "\<lbrakk> (\<And>x y. \<lbrakk>P x y; Q y x\<rbrakk> \<Longrightarrow> x = y); list_all2 P xs ys; list_all2 Q ys xs \<rbrakk> 
   1.475    \<Longrightarrow> xs = ys"
   1.476    apply (simp add: list_all2_conv_all_nth) 
   1.477 -  apply (rule nth_equalityI)
   1.478 -   apply blast
   1.479 -  apply simp
   1.480 +  apply (rule nth_equalityI, blast, simp)
   1.481    done
   1.482  
   1.483  lemma take_equalityI: "(\<forall>i. take i xs = take i ys) ==> xs = ys"
   1.484 @@ -1350,27 +1263,19 @@
   1.485  it is useful. *}
   1.486  lemma distinct_conv_nth:
   1.487  "distinct xs = (\<forall>i j. i < size xs \<and> j < size xs \<and> i \<noteq> j --> xs!i \<noteq> xs!j)"
   1.488 -apply (induct_tac xs)
   1.489 - apply simp
   1.490 -apply simp
   1.491 -apply (rule iffI)
   1.492 - apply clarsimp
   1.493 +apply (induct_tac xs, simp, simp)
   1.494 +apply (rule iffI, clarsimp)
   1.495   apply (case_tac i)
   1.496 -apply (case_tac j)
   1.497 - apply simp
   1.498 +apply (case_tac j, simp)
   1.499  apply (simp add: set_conv_nth)
   1.500   apply (case_tac j)
   1.501 -apply (clarsimp simp add: set_conv_nth)
   1.502 - apply simp
   1.503 +apply (clarsimp simp add: set_conv_nth, simp)
   1.504  apply (rule conjI)
   1.505   apply (clarsimp simp add: set_conv_nth)
   1.506   apply (erule_tac x = 0 in allE)
   1.507 - apply (erule_tac x = "Suc i" in allE)
   1.508 - apply simp
   1.509 -apply clarsimp
   1.510 + apply (erule_tac x = "Suc i" in allE, simp, clarsimp)
   1.511  apply (erule_tac x = "Suc i" in allE)
   1.512 -apply (erule_tac x = "Suc j" in allE)
   1.513 -apply simp
   1.514 +apply (erule_tac x = "Suc j" in allE, simp)
   1.515  done
   1.516  
   1.517  
   1.518 @@ -1387,8 +1292,7 @@
   1.519  by (induct n) auto
   1.520  
   1.521  lemma rev_replicate [simp]: "rev (replicate n x) = replicate n x"
   1.522 -apply(induct n)
   1.523 - apply simp
   1.524 +apply (induct n, simp)
   1.525  apply (simp add: replicate_app_Cons_same)
   1.526  done
   1.527  
   1.528 @@ -1405,8 +1309,7 @@
   1.529  by (atomize (full), induct n) auto
   1.530  
   1.531  lemma nth_replicate[simp]: "!!i. i < n ==> (replicate n x)!i = x"
   1.532 -apply(induct n)
   1.533 - apply simp
   1.534 +apply (induct n, simp)
   1.535  apply (simp add: nth_Cons split: nat.split)
   1.536  done
   1.537  
   1.538 @@ -1451,14 +1354,11 @@
   1.539  subsection {* Lexicographic orderings on lists *}
   1.540  
   1.541  lemma wf_lexn: "wf r ==> wf (lexn r n)"
   1.542 -apply (induct_tac n)
   1.543 - apply simp
   1.544 -apply simp
   1.545 +apply (induct_tac n, simp, simp)
   1.546  apply(rule wf_subset)
   1.547   prefer 2 apply (rule Int_lower1)
   1.548  apply(rule wf_prod_fun_image)
   1.549 - prefer 2 apply (rule inj_onI)
   1.550 -apply auto
   1.551 + prefer 2 apply (rule inj_onI, auto)
   1.552  done
   1.553  
   1.554  lemma lexn_length:
   1.555 @@ -1468,8 +1368,7 @@
   1.556  lemma wf_lex [intro!]: "wf r ==> wf (lex r)"
   1.557  apply (unfold lex_def)
   1.558  apply (rule wf_UN)
   1.559 -apply (blast intro: wf_lexn)
   1.560 -apply clarify
   1.561 +apply (blast intro: wf_lexn, clarify)
   1.562  apply (rename_tac m n)
   1.563  apply (subgoal_tac "m \<noteq> n")
   1.564   prefer 2 apply blast
   1.565 @@ -1480,17 +1379,10 @@
   1.566  "lexn r n =
   1.567  {(xs,ys). length xs = n \<and> length ys = n \<and>
   1.568  (\<exists>xys x y xs' ys'. xs= xys @ x#xs' \<and> ys= xys @ y # ys' \<and> (x, y):r)}"
   1.569 -apply (induct_tac n)
   1.570 - apply simp
   1.571 - apply blast
   1.572 -apply (simp add: image_Collect lex_prod_def)
   1.573 -apply safe
   1.574 -apply blast
   1.575 - apply (rule_tac x = "ab # xys" in exI)
   1.576 - apply simp
   1.577 -apply (case_tac xys)
   1.578 - apply simp_all
   1.579 -apply blast
   1.580 +apply (induct_tac n, simp, blast)
   1.581 +apply (simp add: image_Collect lex_prod_def, safe, blast)
   1.582 + apply (rule_tac x = "ab # xys" in exI, simp)
   1.583 +apply (case_tac xys, simp_all, blast)
   1.584  done
   1.585  
   1.586  lemma lex_conv:
   1.587 @@ -1518,11 +1410,8 @@
   1.588  ((x, y) : r \<and> length xs = length ys | x = y \<and> (xs, ys) : lex r)"
   1.589  apply (simp add: lex_conv)
   1.590  apply (rule iffI)
   1.591 - prefer 2 apply (blast intro: Cons_eq_appendI)
   1.592 -apply clarify
   1.593 -apply (case_tac xys)
   1.594 - apply simp
   1.595 -apply simp
   1.596 + prefer 2 apply (blast intro: Cons_eq_appendI, clarify)
   1.597 +apply (case_tac xys, simp, simp)
   1.598  apply blast
   1.599  done
   1.600  
   1.601 @@ -1543,8 +1432,7 @@
   1.602  lemma sublist_append:
   1.603  "sublist (l @ l') A = sublist l A @ sublist l' {j. j + length l : A}"
   1.604  apply (unfold sublist_def)
   1.605 -apply (induct l' rule: rev_induct)
   1.606 - apply simp
   1.607 +apply (induct l' rule: rev_induct, simp)
   1.608  apply (simp add: upt_add_eq_append[of 0] zip_append sublist_shift_lemma)
   1.609  apply (simp add: add_commute)
   1.610  done
   1.611 @@ -1560,8 +1448,7 @@
   1.612  by (simp add: sublist_Cons)
   1.613  
   1.614  lemma sublist_upt_eq_take [simp]: "sublist l {..n(} = take n l"
   1.615 -apply (induct l rule: rev_induct)
   1.616 - apply simp
   1.617 +apply (induct l rule: rev_induct, simp)
   1.618  apply (simp split: nat_diff_split add: sublist_append)
   1.619  done
   1.620