| author | wenzelm |
| Sat, 02 May 1998 13:27:06 +0200 | |
| changeset 4886 | 31f23b8d6851 |
| parent 4423 | a129b817b58a |
| child 5069 | 3ea049f7979d |
| permissions | -rw-r--r-- |
| 2281 | 1 |
(* Title: HOL/Integ/Ring.ML |
2 |
ID: $Id$ |
|
3 |
Author: Tobias Nipkow |
|
4 |
Copyright 1996 TU Muenchen |
|
5 |
||
6 |
Derives a few equational consequences about rings |
|
7 |
and defines cring_simpl, a simplification tactic for commutative rings. |
|
8 |
*) |
|
9 |
||
10 |
goal Ring.thy "!!x::'a::cring. x*(y*z)=y*(x*z)"; |
|
| 3018 | 11 |
by (rtac trans 1); |
12 |
by (rtac times_commute 1); |
|
13 |
by (rtac trans 1); |
|
14 |
by (rtac times_assoc 1); |
|
|
4230
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
15 |
by (simp_tac (HOL_basic_ss addsimps [times_commute]) 1); |
| 2281 | 16 |
qed "times_commuteL"; |
17 |
||
18 |
val times_cong = read_instantiate [("f1","op *")] (arg_cong RS cong);
|
|
19 |
||
20 |
goal Ring.thy "!!x::'a::ring. zero*x = zero"; |
|
| 3018 | 21 |
by (rtac trans 1); |
22 |
by (rtac right_inv 2); |
|
23 |
by (rtac trans 1); |
|
24 |
by (rtac plus_cong 2); |
|
25 |
by (rtac refl 3); |
|
26 |
by (rtac trans 2); |
|
27 |
by (rtac times_cong 3); |
|
28 |
by (rtac zeroL 3); |
|
29 |
by (rtac refl 3); |
|
30 |
by (rtac (distribR RS sym) 2); |
|
31 |
by (rtac trans 1); |
|
| 4423 | 32 |
by (rtac (plus_assoc RS sym) 2); |
| 3018 | 33 |
by (rtac trans 1); |
34 |
by (rtac plus_cong 2); |
|
35 |
by (rtac refl 2); |
|
36 |
by (rtac (right_inv RS sym) 2); |
|
37 |
by (rtac (zeroR RS sym) 1); |
|
| 2281 | 38 |
qed "mult_zeroL"; |
39 |
||
40 |
goal Ring.thy "!!x::'a::ring. x*zero = zero"; |
|
| 3018 | 41 |
by (rtac trans 1); |
42 |
by (rtac right_inv 2); |
|
43 |
by (rtac trans 1); |
|
44 |
by (rtac plus_cong 2); |
|
45 |
by (rtac refl 3); |
|
46 |
by (rtac trans 2); |
|
47 |
by (rtac times_cong 3); |
|
48 |
by (rtac zeroL 4); |
|
49 |
by (rtac refl 3); |
|
50 |
by (rtac (distribL RS sym) 2); |
|
51 |
by (rtac trans 1); |
|
| 4423 | 52 |
by (rtac (plus_assoc RS sym) 2); |
| 3018 | 53 |
by (rtac trans 1); |
54 |
by (rtac plus_cong 2); |
|
55 |
by (rtac refl 2); |
|
56 |
by (rtac (right_inv RS sym) 2); |
|
57 |
by (rtac (zeroR RS sym) 1); |
|
| 2281 | 58 |
qed "mult_zeroR"; |
59 |
||
60 |
goal Ring.thy "!!x::'a::ring. (zero-x)*y = zero-(x*y)"; |
|
| 3018 | 61 |
by (rtac trans 1); |
62 |
by (rtac zeroL 2); |
|
63 |
by (rtac trans 1); |
|
64 |
by (rtac plus_cong 2); |
|
65 |
by (rtac refl 3); |
|
66 |
by (rtac mult_zeroL 2); |
|
67 |
by (rtac trans 1); |
|
68 |
by (rtac plus_cong 2); |
|
69 |
by (rtac refl 3); |
|
70 |
by (rtac times_cong 2); |
|
71 |
by (rtac left_inv 2); |
|
72 |
by (rtac refl 2); |
|
73 |
by (rtac trans 1); |
|
74 |
by (rtac plus_cong 2); |
|
75 |
by (rtac refl 3); |
|
76 |
by (rtac (distribR RS sym) 2); |
|
77 |
by (rtac trans 1); |
|
| 4423 | 78 |
by (rtac (plus_assoc RS sym) 2); |
| 3018 | 79 |
by (rtac trans 1); |
80 |
by (rtac plus_cong 2); |
|
81 |
by (rtac refl 2); |
|
82 |
by (rtac (right_inv RS sym) 2); |
|
83 |
by (rtac (zeroR RS sym) 1); |
|
| 2281 | 84 |
qed "mult_invL"; |
85 |
||
86 |
goal Ring.thy "!!x::'a::ring. x*(zero-y) = zero-(x*y)"; |
|
| 3018 | 87 |
by (rtac trans 1); |
88 |
by (rtac zeroL 2); |
|
89 |
by (rtac trans 1); |
|
90 |
by (rtac plus_cong 2); |
|
91 |
by (rtac refl 3); |
|
92 |
by (rtac mult_zeroR 2); |
|
93 |
by (rtac trans 1); |
|
94 |
by (rtac plus_cong 2); |
|
95 |
by (rtac refl 3); |
|
96 |
by (rtac times_cong 2); |
|
97 |
by (rtac refl 2); |
|
98 |
by (rtac left_inv 2); |
|
99 |
by (rtac trans 1); |
|
100 |
by (rtac plus_cong 2); |
|
101 |
by (rtac refl 3); |
|
102 |
by (rtac (distribL RS sym) 2); |
|
103 |
by (rtac trans 1); |
|
| 4423 | 104 |
by (rtac (plus_assoc RS sym) 2); |
| 3018 | 105 |
by (rtac trans 1); |
106 |
by (rtac plus_cong 2); |
|
107 |
by (rtac refl 2); |
|
108 |
by (rtac (right_inv RS sym) 2); |
|
109 |
by (rtac (zeroR RS sym) 1); |
|
| 2281 | 110 |
qed "mult_invR"; |
111 |
||
|
4230
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
112 |
goal Ring.thy "x*(y-z) = (x*y - x*z::'a::ring)"; |
| 4423 | 113 |
by (mk_group1_tac 1); |
114 |
by (simp_tac (HOL_basic_ss addsimps [distribL,mult_invR]) 1); |
|
| 2281 | 115 |
qed "minus_distribL"; |
116 |
||
|
4230
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
117 |
goal Ring.thy "(x-y)*z = (x*z - y*z::'a::ring)"; |
| 4423 | 118 |
by (mk_group1_tac 1); |
119 |
by (simp_tac (HOL_basic_ss addsimps [distribR,mult_invL]) 1); |
|
| 2281 | 120 |
qed "minus_distribR"; |
121 |
||
|
4230
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
122 |
val cring_simps = [times_assoc,times_commute,times_commuteL, |
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
123 |
distribL,distribR,minus_distribL,minus_distribR] |
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
124 |
@ agroup2_simps; |
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
125 |
|
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
126 |
val cring_tac = |
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
127 |
let val ss = HOL_basic_ss addsimps cring_simps |
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
128 |
in simp_tac ss end; |
|
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
129 |
|
| 2281 | 130 |
|
131 |
(*** The order [minus_plusL3,minus_plusL2] is important because minus_plusL3 |
|
|
4230
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
132 |
MUST be tried first |
| 2281 | 133 |
val cring_simp = |
| 4089 | 134 |
let val phase1 = simpset() addsimps |
| 2281 | 135 |
[plus_minusL,minus_plusR,minus_minusR,plus_minusR] |
136 |
val phase2 = HOL_ss addsimps [minus_plusL3,minus_plusL2, |
|
137 |
zeroL,zeroR,mult_zeroL,mult_zeroR] |
|
138 |
in simp_tac phase1 THEN' simp_tac phase2 end; |
|
|
4230
eb5586526bc9
Redesigned the decision procedures for (Abelian) groups and commutative rings.
nipkow
parents:
4089
diff
changeset
|
139 |
***) |