src/HOL/Arith.ML
 author berghofe Fri Jul 24 13:03:20 1998 +0200 (1998-07-24) changeset 5183 89f162de39cf parent 5143 b94cd208f073 child 5270 70c599bff977 permissions -rw-r--r--
1 (*  Title:      HOL/Arith.ML
2     ID:         \$Id\$
3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
4     Copyright   1998  University of Cambridge
7 Some from the Hoare example from Norbert Galm
8 *)
10 (*** Basic rewrite rules for the arithmetic operators ***)
13 (** Difference **)
15 qed_goal "diff_0_eq_0" thy
16     "0 - n = 0"
17  (fn _ => [induct_tac "n" 1,  ALLGOALS Asm_simp_tac]);
19 (*Must simplify BEFORE the induction!!  (Else we get a critical pair)
20   Suc(m) - Suc(n)   rewrites to   pred(Suc(m) - n)  *)
21 qed_goal "diff_Suc_Suc" thy
22     "Suc(m) - Suc(n) = m - n"
23  (fn _ =>
24   [Simp_tac 1, induct_tac "n" 1, ALLGOALS Asm_simp_tac]);
28 (* Could be (and is, below) generalized in various ways;
29    However, none of the generalizations are currently in the simpset,
30    and I dread to think what happens if I put them in *)
31 Goal "0 < n ==> Suc(n-1) = n";
32 by (asm_simp_tac (simpset() addsplits [nat.split]) 1);
33 qed "Suc_pred";
36 Delsimps [diff_Suc];
39 (**** Inductive properties of the operators ****)
43 qed_goal "add_0_right" thy "m + 0 = m"
44  (fn _ => [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
46 qed_goal "add_Suc_right" thy "m + Suc(n) = Suc(m+n)"
47  (fn _ => [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
52 qed_goal "add_assoc" thy "(m + n) + k = m + ((n + k)::nat)"
53  (fn _ => [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
56 qed_goal "add_commute" thy "m + n = n + (m::nat)"
57  (fn _ =>  [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
60  (fn _ => [rtac (add_commute RS trans) 1, rtac (add_assoc RS trans) 1,
61            rtac (add_commute RS arg_cong) 1]);
66 Goal "!!k::nat. (k + m = k + n) = (m=n)";
67 by (induct_tac "k" 1);
68 by (Simp_tac 1);
69 by (Asm_simp_tac 1);
72 Goal "!!k::nat. (m + k = n + k) = (m=n)";
73 by (induct_tac "k" 1);
74 by (Simp_tac 1);
75 by (Asm_simp_tac 1);
78 Goal "!!k::nat. (k + m <= k + n) = (m<=n)";
79 by (induct_tac "k" 1);
80 by (Simp_tac 1);
81 by (Asm_simp_tac 1);
84 Goal "!!k::nat. (k + m < k + n) = (m<n)";
85 by (induct_tac "k" 1);
86 by (Simp_tac 1);
87 by (Asm_simp_tac 1);
93 (** Reasoning about m+0=0, etc. **)
95 Goal "(m+n = 0) = (m=0 & n=0)";
96 by (induct_tac "m" 1);
97 by (ALLGOALS Asm_simp_tac);
101 Goal "(0<m+n) = (0<m | 0<n)";
102 by (simp_tac (simpset() delsimps [neq0_conv] addsimps [neq0_conv RS sym]) 1);
106 (* FIXME: really needed?? *)
107 Goal "((m+n)-1 = 0) = (m=0 & n-1 = 0 | m-1 = 0 & n=0)";
108 by (exhaust_tac "m" 1);
109 by (ALLGOALS (fast_tac (claset() addss (simpset()))));
113 (* Could be generalized, eg to "!!n. k<n ==> m+(n-(Suc k)) = (m+n)-(Suc k)" *)
114 Goal "0<n ==> m + (n-1) = (m+n)-1";
115 by (exhaust_tac "m" 1);
116 by (ALLGOALS (asm_simp_tac (simpset() addsimps [diff_Suc]
121 Goal "!!m::nat. m + n = m ==> n = 0";
122 by (dtac (add_0_right RS ssubst) 1);
131 Goal "m<n --> (? k. n=Suc(m+k))";
132 by (induct_tac "n" 1);
133 by (ALLGOALS (simp_tac (simpset() addsimps [less_Suc_eq])));
134 by (blast_tac (claset() addSEs [less_SucE]
138 Goal "n <= ((m + n)::nat)";
139 by (induct_tac "m" 1);
140 by (ALLGOALS Simp_tac);
141 by (etac le_trans 1);
142 by (rtac (lessI RS less_imp_le) 1);
145 Goal "n <= ((n + m)::nat)";
153 (*"i <= j ==> i <= j+m"*)
156 (*"i <= j ==> i <= m+j"*)
159 (*"i < j ==> i < j+m"*)
162 (*"i < j ==> i < m+j"*)
165 Goal "i+j < (k::nat) ==> i<k";
166 by (etac rev_mp 1);
167 by (induct_tac "j" 1);
168 by (ALLGOALS Asm_simp_tac);
169 by (blast_tac (claset() addDs [Suc_lessD]) 1);
172 Goal "!!i::nat. ~ (i+j < i)";
173 by (rtac notI 1);
174 by (etac (add_lessD1 RS less_irrefl) 1);
177 Goal "!!i::nat. ~ (j+i < i)";
182 Goal "!!k::nat. m <= n ==> m <= n+k";
183 by (etac le_trans 1);
187 Goal "!!k::nat. m < n ==> m < n+k";
188 by (etac less_le_trans 1);
192 Goal "m+k<=n --> m<=(n::nat)";
193 by (induct_tac "k" 1);
194 by (ALLGOALS Asm_simp_tac);
195 by (blast_tac (claset() addDs [Suc_leD]) 1);
198 Goal "!!n::nat. m+k<=n ==> k<=n";
203 Goal "!!n::nat. m+k<=n ==> m<=n & k<=n";
205 bind_thm ("add_leE", result() RS conjE);
207 Goal "!!k l::nat. [| k<l; m+l = k+n |] ==> m<n";
209 by (asm_full_simp_tac
212 by (etac subst 1);
217 (*** Monotonicity of Addition ***)
219 (*strict, in 1st argument*)
220 Goal "!!i j k::nat. i < j ==> i + k < j + k";
221 by (induct_tac "k" 1);
222 by (ALLGOALS Asm_simp_tac);
225 (*strict, in both arguments*)
226 Goal "!!i j k::nat. [|i < j; k < l|] ==> i + k < j + l";
227 by (rtac (add_less_mono1 RS less_trans) 1);
228 by (REPEAT (assume_tac 1));
229 by (induct_tac "j" 1);
230 by (ALLGOALS Asm_simp_tac);
233 (*A [clumsy] way of lifting < monotonicity to <= monotonicity *)
234 val [lt_mono,le] = goal thy
235      "[| !!i j::nat. i<j ==> f(i) < f(j);       \
236 \        i <= j                                 \
237 \     |] ==> f(i) <= (f(j)::nat)";
238 by (cut_facts_tac [le] 1);
239 by (asm_full_simp_tac (simpset() addsimps [le_eq_less_or_eq]) 1);
240 by (blast_tac (claset() addSIs [lt_mono]) 1);
241 qed "less_mono_imp_le_mono";
243 (*non-strict, in 1st argument*)
244 Goal "!!i j k::nat. i<=j ==> i + k <= j + k";
245 by (res_inst_tac [("f", "%j. j+k")] less_mono_imp_le_mono 1);
247 by (assume_tac 1);
250 (*non-strict, in both arguments*)
251 Goal "!!k l::nat. [|i<=j;  k<=l |] ==> i + k <= j + l";
252 by (etac (add_le_mono1 RS le_trans) 1);
254 (*j moves to the end because it is free while k, l are bound*)
259 (*** Multiplication ***)
261 (*right annihilation in product*)
262 qed_goal "mult_0_right" thy "m * 0 = 0"
263  (fn _ => [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
265 (*right successor law for multiplication*)
266 qed_goal "mult_Suc_right" thy  "m * Suc(n) = m + (m * n)"
267  (fn _ => [induct_tac "m" 1,
272 Goal "1 * n = n";
273 by (Asm_simp_tac 1);
274 qed "mult_1";
276 Goal "n * 1 = n";
277 by (Asm_simp_tac 1);
278 qed "mult_1_right";
280 (*Commutative law for multiplication*)
281 qed_goal "mult_commute" thy "m * n = n * (m::nat)"
282  (fn _ => [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
285 qed_goal "add_mult_distrib" thy "(m + n)*k = (m*k) + ((n*k)::nat)"
286  (fn _ => [induct_tac "m" 1,
289 qed_goal "add_mult_distrib2" thy "k*(m + n) = (k*m) + ((k*n)::nat)"
290  (fn _ => [induct_tac "m" 1,
293 (*Associative law for multiplication*)
294 qed_goal "mult_assoc" thy "(m * n) * k = m * ((n * k)::nat)"
295   (fn _ => [induct_tac "m" 1,
298 qed_goal "mult_left_commute" thy "x*(y*z) = y*((x*z)::nat)"
299  (fn _ => [rtac trans 1, rtac mult_commute 1, rtac trans 1,
300            rtac mult_assoc 1, rtac (mult_commute RS arg_cong) 1]);
302 val mult_ac = [mult_assoc,mult_commute,mult_left_commute];
304 Goal "(m*n = 0) = (m=0 | n=0)";
305 by (induct_tac "m" 1);
306 by (induct_tac "n" 2);
307 by (ALLGOALS Asm_simp_tac);
308 qed "mult_is_0";
311 Goal "!!m::nat. m <= m*m";
312 by (induct_tac "m" 1);
314 by (etac (le_add2 RSN (2,le_trans)) 1);
315 qed "le_square";
318 (*** Difference ***)
321 qed_goal "diff_self_eq_0" thy "m - m = 0"
322  (fn _ => [induct_tac "m" 1, ALLGOALS Asm_simp_tac]);
325 (*Addition is the inverse of subtraction: if n<=m then n+(m-n) = m. *)
326 Goal "~ m<n --> n+(m-n) = (m::nat)";
327 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
328 by (ALLGOALS Asm_simp_tac);
331 Goal "n<=m ==> n+(m-n) = (m::nat)";
335 Goal "n<=m ==> (m-n)+n = (m::nat)";
342 (*** More results about difference ***)
344 val [prem] = goal thy "n < Suc(m) ==> Suc(m)-n = Suc(m-n)";
345 by (rtac (prem RS rev_mp) 1);
346 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
347 by (ALLGOALS Asm_simp_tac);
348 qed "Suc_diff_n";
350 Goal "m - n < Suc(m)";
351 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
352 by (etac less_SucE 3);
353 by (ALLGOALS (asm_simp_tac (simpset() addsimps [less_Suc_eq])));
354 qed "diff_less_Suc";
356 Goal "!!m::nat. m - n <= m";
357 by (res_inst_tac [("m","m"), ("n","n")] diff_induct 1);
358 by (ALLGOALS Asm_simp_tac);
359 qed "diff_le_self";
362 (* j<k ==> j-n < k *)
363 bind_thm ("less_imp_diff_less", diff_le_self RS le_less_trans);
365 Goal "!!i::nat. i-j-k = i - (j+k)";
366 by (res_inst_tac [("m","i"),("n","j")] diff_induct 1);
367 by (ALLGOALS Asm_simp_tac);
368 qed "diff_diff_left";
370 Goal "(Suc m - n) - Suc k = m - n - k";
371 by (simp_tac (simpset() addsimps [diff_diff_left]) 1);
372 qed "Suc_diff_diff";
375 Goal "0<n ==> n - Suc i < n";
376 by (exhaust_tac "n" 1);
377 by Safe_tac;
378 by (asm_simp_tac (simpset() addsimps [le_eq_less_Suc RS sym]) 1);
379 qed "diff_Suc_less";
382 Goal "!!n::nat. m - n <= Suc m - n";
383 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
384 by (ALLGOALS Asm_simp_tac);
385 qed "diff_le_Suc_diff";
387 (*This and the next few suggested by Florian Kammueller*)
388 Goal "!!i::nat. i-j-k = i-k-j";
390 qed "diff_commute";
392 Goal "!!i j k:: nat. k<=j --> j<=i --> i - (j - k) = i - j + k";
393 by (res_inst_tac [("m","i"),("n","j")] diff_induct 1);
394 by (ALLGOALS Asm_simp_tac);
395 by (asm_simp_tac
396     (simpset() addsimps [Suc_diff_n, le_imp_less_Suc, le_Suc_eq]) 1);
397 qed_spec_mp "diff_diff_right";
399 Goal "!!i j k:: nat. k<=j --> (i + j) - k = i + (j - k)";
400 by (res_inst_tac [("m","j"),("n","k")] diff_induct 1);
401 by (ALLGOALS Asm_simp_tac);
404 Goal "!!i j k:: nat. k<=j --> (j + i) - k = i + (j - k)";
408 Goal "!!n::nat. (n+m) - n = m";
409 by (induct_tac "n" 1);
410 by (ALLGOALS Asm_simp_tac);
414 Goal "!!n::nat.(m+n) - n = m";
419 Goal "!!i j k::nat. i<=j ==> (j-i=k) = (j=k+i)";
420 by Safe_tac;
421 by (ALLGOALS Asm_simp_tac);
424 val [prem] = goal thy "m < Suc(n) ==> m-n = 0";
425 by (rtac (prem RS rev_mp) 1);
426 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
427 by (asm_simp_tac (simpset() addsimps [less_Suc_eq]) 1);
428 by (ALLGOALS Asm_simp_tac);
429 qed "less_imp_diff_is_0";
431 val prems = goal thy "m-n = 0  -->  n-m = 0  -->  m=n";
432 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
433 by (REPEAT(Simp_tac 1 THEN TRY(atac 1)));
434 qed_spec_mp "diffs0_imp_equal";
436 val [prem] = goal thy "m<n ==> 0<n-m";
437 by (rtac (prem RS rev_mp) 1);
438 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
439 by (ALLGOALS Asm_simp_tac);
440 qed "less_imp_diff_positive";
442 Goal "!! (i::nat). i < j  ==> ? k. 0<k & i+k = j";
443 by (res_inst_tac [("x","j - i")] exI 1);
444 by (fast_tac (claset() addDs [less_trans, less_irrefl]
448 Goal "Suc(m)-n = (if m<n then 0 else Suc(m-n))";
449 by (simp_tac (simpset() addsimps [less_imp_diff_is_0, not_less_eq, Suc_diff_n]) 1);
450 qed "if_Suc_diff_n";
452 Goal "Suc(m)-n <= Suc(m-n)";
453 by (simp_tac (simpset() addsimps [if_Suc_diff_n]) 1);
454 qed "diff_Suc_le_Suc_diff";
456 Goal "P(k) --> (!n. P(Suc(n))--> P(n)) --> P(k-i)";
457 by (res_inst_tac [("m","k"),("n","i")] diff_induct 1);
458 by (ALLGOALS (Clarify_tac THEN' Simp_tac THEN' TRY o Blast_tac));
459 qed "zero_induct_lemma";
461 val prems = goal thy "[| P(k);  !!n. P(Suc(n)) ==> P(n) |] ==> P(0)";
462 by (rtac (diff_self_eq_0 RS subst) 1);
463 by (rtac (zero_induct_lemma RS mp RS mp) 1);
464 by (REPEAT (ares_tac ([impI,allI]@prems) 1));
465 qed "zero_induct";
467 Goal "!!k::nat. (k+m) - (k+n) = m - n";
468 by (induct_tac "k" 1);
469 by (ALLGOALS Asm_simp_tac);
470 qed "diff_cancel";
473 Goal "!!m::nat. (m+k) - (n+k) = m - n";
476 qed "diff_cancel2";
479 (*From Clemens Ballarin*)
480 Goal "!!n::nat. [| k<=n; n<=m |] ==> (m-k) - (n-k) = m-n";
481 by (subgoal_tac "k<=n --> n<=m --> (m-k) - (n-k) = m-n" 1);
482 by (Asm_full_simp_tac 1);
483 by (induct_tac "k" 1);
484 by (Simp_tac 1);
485 (* Induction step *)
486 by (subgoal_tac "Suc na <= m --> n <= m --> Suc na <= n --> \
487 \                Suc (m - Suc na) - Suc (n - Suc na) = m-n" 1);
488 by (Asm_full_simp_tac 1);
489 by (blast_tac (claset() addIs [le_trans]) 1);
490 by (auto_tac (claset() addIs [Suc_leD], simpset() delsimps [diff_Suc_Suc]));
491 by (asm_full_simp_tac (simpset() delsimps [Suc_less_eq]
492 		       addsimps [Suc_diff_n RS sym, le_eq_less_Suc]) 1);
493 qed "diff_right_cancel";
495 Goal "!!n::nat. n - (n+m) = 0";
496 by (induct_tac "n" 1);
497 by (ALLGOALS Asm_simp_tac);
501 (** Difference distributes over multiplication **)
503 Goal "!!m::nat. (m - n) * k = (m * k) - (n * k)";
504 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1);
505 by (ALLGOALS Asm_simp_tac);
506 qed "diff_mult_distrib" ;
508 Goal "!!m::nat. k * (m - n) = (k * m) - (k * n)";
509 val mult_commute_k = read_instantiate [("m","k")] mult_commute;
510 by (simp_tac (simpset() addsimps [diff_mult_distrib, mult_commute_k]) 1);
511 qed "diff_mult_distrib2" ;
512 (*NOT added as rewrites, since sometimes they are used from right-to-left*)
515 (*** Monotonicity of Multiplication ***)
517 Goal "!!i::nat. i<=j ==> i*k<=j*k";
518 by (induct_tac "k" 1);
520 qed "mult_le_mono1";
522 (*<=monotonicity, BOTH arguments*)
523 Goal "!!i::nat. [| i<=j; k<=l |] ==> i*k<=j*l";
524 by (etac (mult_le_mono1 RS le_trans) 1);
525 by (rtac le_trans 1);
526 by (stac mult_commute 2);
527 by (etac mult_le_mono1 2);
528 by (simp_tac (simpset() addsimps [mult_commute]) 1);
529 qed "mult_le_mono";
531 (*strict, in 1st argument; proof is by induction on k>0*)
532 Goal "!!i::nat. [| i<j; 0<k |] ==> k*i < k*j";
533 by (eres_inst_tac [("m1","0")] (less_eq_Suc_add RS exE) 1);
534 by (Asm_simp_tac 1);
535 by (induct_tac "x" 1);
537 qed "mult_less_mono2";
539 Goal "!!i::nat. [| i<j; 0<k |] ==> i*k < j*k";
540 by (dtac mult_less_mono2 1);
541 by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [mult_commute])));
542 qed "mult_less_mono1";
544 Goal "(0 < m*n) = (0<m & 0<n)";
545 by (induct_tac "m" 1);
546 by (induct_tac "n" 2);
547 by (ALLGOALS Asm_simp_tac);
548 qed "zero_less_mult_iff";
551 Goal "(m*n = 1) = (m=1 & n=1)";
552 by (induct_tac "m" 1);
553 by (Simp_tac 1);
554 by (induct_tac "n" 1);
555 by (Simp_tac 1);
556 by (fast_tac (claset() addss simpset()) 1);
557 qed "mult_eq_1_iff";
560 Goal "0<k ==> (m*k < n*k) = (m<n)";
561 by (safe_tac (claset() addSIs [mult_less_mono1]));
562 by (cut_facts_tac [less_linear] 1);
564 qed "mult_less_cancel2";
566 Goal "0<k ==> (k*m < k*n) = (m<n)";
567 by (dtac mult_less_cancel2 1);
568 by (asm_full_simp_tac (simpset() addsimps [mult_commute]) 1);
569 qed "mult_less_cancel1";
572 Goal "(Suc k * m < Suc k * n) = (m < n)";
573 by (rtac mult_less_cancel1 1);
574 by (Simp_tac 1);
575 qed "Suc_mult_less_cancel1";
577 Goalw [le_def] "(Suc k * m <= Suc k * n) = (m <= n)";
578 by (simp_tac (simpset_of HOL.thy) 1);
579 by (rtac Suc_mult_less_cancel1 1);
580 qed "Suc_mult_le_cancel1";
582 Goal "0<k ==> (m*k = n*k) = (m=n)";
583 by (cut_facts_tac [less_linear] 1);
584 by Safe_tac;
585 by (assume_tac 2);
586 by (ALLGOALS (dtac mult_less_mono1 THEN' assume_tac));
587 by (ALLGOALS Asm_full_simp_tac);
588 qed "mult_cancel2";
590 Goal "0<k ==> (k*m = k*n) = (m=n)";
591 by (dtac mult_cancel2 1);
592 by (asm_full_simp_tac (simpset() addsimps [mult_commute]) 1);
593 qed "mult_cancel1";
596 Goal "(Suc k * m = Suc k * n) = (m = n)";
597 by (rtac mult_cancel1 1);
598 by (Simp_tac 1);
599 qed "Suc_mult_cancel1";
602 (** Lemma for gcd **)
604 Goal "m = m*n ==> n=1 | m=0";
605 by (dtac sym 1);
606 by (rtac disjCI 1);
607 by (rtac nat_less_cases 1 THEN assume_tac 2);
610 qed "mult_eq_self_implies_10";
613 (*** Subtraction laws -- mostly from Clemens Ballarin ***)
615 Goal "!! a b c::nat. [| a < b; c <= a |] ==> a-c < b-c";
616 by (subgoal_tac "c+(a-c) < c+(b-c)" 1);
617 by (Full_simp_tac 1);
618 by (subgoal_tac "c <= b" 1);
619 by (blast_tac (claset() addIs [less_imp_le, le_trans]) 2);
620 by (Asm_simp_tac 1);
621 qed "diff_less_mono";
623 Goal "!! a b c::nat. a+b < c ==> a < c-b";
624 by (dtac diff_less_mono 1);
626 by (Asm_full_simp_tac 1);
629 Goal "n <= m ==> Suc m - n = Suc (m - n)";
630 by (asm_full_simp_tac (simpset() addsimps [Suc_diff_n, le_eq_less_Suc]) 1);
631 qed "Suc_diff_le";
633 Goal "Suc i <= n ==> Suc (n - Suc i) = n - i";
634 by (asm_full_simp_tac
635     (simpset() addsimps [Suc_diff_n RS sym, le_eq_less_Suc]) 1);
636 qed "Suc_diff_Suc";
638 Goal "!! i::nat. i <= n ==> n - (n - i) = i";
639 by (etac rev_mp 1);
640 by (res_inst_tac [("m","n"),("n","i")] diff_induct 1);
641 by (ALLGOALS (asm_simp_tac  (simpset() addsimps [Suc_diff_le])));
642 qed "diff_diff_cancel";
645 Goal "!!k::nat. k <= n ==> m <= n + m - k";
646 by (etac rev_mp 1);
647 by (res_inst_tac [("m", "k"), ("n", "n")] diff_induct 1);
648 by (Simp_tac 1);
650 by (Simp_tac 1);
653 Goal "!!i::nat. 0<k ==> j<i --> j+k-i < k";
654 by (res_inst_tac [("m","j"),("n","i")] diff_induct 1);
655 by (ALLGOALS Asm_simp_tac);
660 (** (Anti)Monotonicity of subtraction -- by Stefan Merz **)
662 (* Monotonicity of subtraction in first argument *)
663 Goal "!!n::nat. m<=n --> (m-l) <= (n-l)";
664 by (induct_tac "n" 1);
665 by (Simp_tac 1);
666 by (simp_tac (simpset() addsimps [le_Suc_eq]) 1);
667 by (blast_tac (claset() addIs [diff_le_Suc_diff, le_trans]) 1);
668 qed_spec_mp "diff_le_mono";
670 Goal "!!n::nat. m<=n ==> (l-n) <= (l-m)";
671 by (induct_tac "l" 1);
672 by (Simp_tac 1);
673 by (case_tac "n <= na" 1);
674 by (subgoal_tac "m <= na" 1);
675 by (asm_simp_tac (simpset() addsimps [Suc_diff_le]) 1);
676 by (fast_tac (claset() addEs [le_trans]) 1);
677 by (dtac not_leE 1);
678 by (asm_simp_tac (simpset() addsimps [if_Suc_diff_n]) 1);
679 qed_spec_mp "diff_le_mono2";