equal
deleted
inserted
replaced
144 (**** Additional theorems about "less than" ****) |
144 (**** Additional theorems about "less than" ****) |
145 |
145 |
146 (*Deleted less_natE; instead use less_eq_Suc_add RS exE*) |
146 (*Deleted less_natE; instead use less_eq_Suc_add RS exE*) |
147 Goal "m<n --> (? k. n=Suc(m+k))"; |
147 Goal "m<n --> (? k. n=Suc(m+k))"; |
148 by (induct_tac "n" 1); |
148 by (induct_tac "n" 1); |
149 by (ALLGOALS (simp_tac (simpset() addsimps [le_eq_less_or_eq]))); |
149 by (ALLGOALS (simp_tac (simpset() addsimps [order_le_less]))); |
150 by (blast_tac (claset() addSEs [less_SucE] |
150 by (blast_tac (claset() addSEs [less_SucE] |
151 addSIs [add_0_right RS sym, add_Suc_right RS sym]) 1); |
151 addSIs [add_0_right RS sym, add_Suc_right RS sym]) 1); |
152 qed_spec_mp "less_eq_Suc_add"; |
152 qed_spec_mp "less_eq_Suc_add"; |
153 |
153 |
154 Goal "n <= ((m + n)::nat)"; |
154 Goal "n <= ((m + n)::nat)"; |
243 val [lt_mono,le] = Goal |
243 val [lt_mono,le] = Goal |
244 "[| !!i j::nat. i<j ==> f(i) < f(j); \ |
244 "[| !!i j::nat. i<j ==> f(i) < f(j); \ |
245 \ i <= j \ |
245 \ i <= j \ |
246 \ |] ==> f(i) <= (f(j)::nat)"; |
246 \ |] ==> f(i) <= (f(j)::nat)"; |
247 by (cut_facts_tac [le] 1); |
247 by (cut_facts_tac [le] 1); |
248 by (asm_full_simp_tac (simpset() addsimps [le_eq_less_or_eq]) 1); |
248 by (asm_full_simp_tac (simpset() addsimps [order_le_less]) 1); |
249 by (blast_tac (claset() addSIs [lt_mono]) 1); |
249 by (blast_tac (claset() addSIs [lt_mono]) 1); |
250 qed "less_mono_imp_le_mono"; |
250 qed "less_mono_imp_le_mono"; |
251 |
251 |
252 (*non-strict, in 1st argument*) |
252 (*non-strict, in 1st argument*) |
253 Goal "i<=j ==> i + k <= j + (k::nat)"; |
253 Goal "i<=j ==> i + k <= j + (k::nat)"; |
394 Goal "i<n ==> n - Suc i < n - i"; |
394 Goal "i<n ==> n - Suc i < n - i"; |
395 by (exhaust_tac "n" 1); |
395 by (exhaust_tac "n" 1); |
396 by (auto_tac (claset(), |
396 by (auto_tac (claset(), |
397 simpset() addsimps [Suc_diff_le]@le_simps)); |
397 simpset() addsimps [Suc_diff_le]@le_simps)); |
398 qed "diff_Suc_less_diff"; |
398 qed "diff_Suc_less_diff"; |
399 |
|
400 Goal "m - n <= Suc m - n"; |
|
401 by (res_inst_tac [("m","m"),("n","n")] diff_induct 1); |
|
402 by (ALLGOALS Asm_simp_tac); |
|
403 qed "diff_le_Suc_diff"; |
|
404 |
399 |
405 (*This and the next few suggested by Florian Kammueller*) |
400 (*This and the next few suggested by Florian Kammueller*) |
406 Goal "!!i::nat. i-j-k = i-k-j"; |
401 Goal "!!i::nat. i-j-k = i-k-j"; |
407 by (simp_tac (simpset() addsimps [diff_diff_left, add_commute]) 1); |
402 by (simp_tac (simpset() addsimps [diff_diff_left, add_commute]) 1); |
408 qed "diff_commute"; |
403 qed "diff_commute"; |
700 AddIffs [diff_le_Suc_diff]; |
695 AddIffs [diff_le_Suc_diff]; |
701 |
696 |
702 Goal "n - Suc i <= n - i"; |
697 Goal "n - Suc i <= n - i"; |
703 by (case_tac "i<n" 1); |
698 by (case_tac "i<n" 1); |
704 by (dtac diff_Suc_less_diff 1); |
699 by (dtac diff_Suc_less_diff 1); |
705 by (auto_tac (claset(), simpset() addsimps [leI])); |
700 by (auto_tac (claset(), simpset() addsimps [less_imp_le, leI])); |
706 qed "diff_Suc_le_diff"; |
701 qed "diff_Suc_le_diff"; |
707 AddIffs [diff_Suc_le_diff]; |
702 AddIffs [diff_Suc_le_diff]; |
708 |
703 |
709 Goal "0 < n ==> (m <= n-1) = (m<n)"; |
704 Goal "0 < n ==> (m <= n-1) = (m<n)"; |
710 by (exhaust_tac "n" 1); |
705 by (exhaust_tac "n" 1); |