author | paulson |
Fri, 29 Oct 2004 15:16:02 +0200 | |
changeset 15270 | 8b3f707a78a7 |
parent 15140 | 322485b816ac |
child 15404 | a9a762f586b5 |
permissions | -rw-r--r-- |
10214 | 1 |
(* Title: HOL/NatArith.thy |
2 |
ID: $Id$ |
|
13297 | 3 |
Author: Tobias Nipkow and Markus Wenzel |
4 |
*) |
|
10214 | 5 |
|
13297 | 6 |
header {* More arithmetic on natural numbers *} |
10214 | 7 |
|
15131 | 8 |
theory NatArith |
15140 | 9 |
imports Nat |
15131 | 10 |
files "arith_data.ML" |
11 |
begin |
|
10214 | 12 |
|
13 |
setup arith_setup |
|
14 |
||
13297 | 15 |
|
11655 | 16 |
lemma pred_nat_trancl_eq_le: "((m, n) : pred_nat^*) = (m <= n)" |
14208 | 17 |
by (simp add: less_eq reflcl_trancl [symmetric] |
18 |
del: reflcl_trancl, arith) |
|
11454
7514e5e21cb8
Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents:
11324
diff
changeset
|
19 |
|
10214 | 20 |
lemma nat_diff_split: |
10599 | 21 |
"P(a - b::nat) = ((a<b --> P 0) & (ALL d. a = b + d --> P d))" |
13297 | 22 |
-- {* elimination of @{text -} on @{text nat} *} |
23 |
by (cases "a<b" rule: case_split) |
|
24 |
(auto simp add: diff_is_0_eq [THEN iffD2]) |
|
11324 | 25 |
|
26 |
lemma nat_diff_split_asm: |
|
27 |
"P(a - b::nat) = (~ (a < b & ~ P 0 | (EX d. a = b + d & ~ P d)))" |
|
13297 | 28 |
-- {* elimination of @{text -} on @{text nat} in assumptions *} |
11324 | 29 |
by (simp split: nat_diff_split) |
10214 | 30 |
|
11164 | 31 |
ML {* |
32 |
val nat_diff_split = thm "nat_diff_split"; |
|
11324 | 33 |
val nat_diff_split_asm = thm "nat_diff_split_asm"; |
13499 | 34 |
*} |
35 |
(* Careful: arith_tac produces counter examples! |
|
11181
d04f57b91166
renamed addaltern to addafter, addSaltern to addSafter
oheimb
parents:
11164
diff
changeset
|
36 |
fun add_arith cs = cs addafter ("arith_tac", arith_tac); |
14607 | 37 |
TODO: use arith_tac for force_tac in Provers/clasimp.ML *) |
10214 | 38 |
|
39 |
lemmas [arith_split] = nat_diff_split split_min split_max |
|
40 |
||
41 |
end |