| author | nipkow | 
| Tue, 06 Jun 2006 19:24:05 +0200 | |
| changeset 19795 | 746274ca400b | 
| parent 19783 | 82f365a14960 | 
| child 19931 | fb32b43e7f80 | 
| permissions | -rw-r--r-- | 
| 14706 | 1  | 
(* Title: HOL/Algebra/Module.thy  | 
| 13936 | 2  | 
ID: $Id$  | 
3  | 
Author: Clemens Ballarin, started 15 April 2003  | 
|
4  | 
Copyright: Clemens Ballarin  | 
|
5  | 
*)  | 
|
6  | 
||
| 14577 | 7  | 
header {* Modules over an Abelian Group *}
 | 
| 13936 | 8  | 
|
| 16417 | 9  | 
theory Module imports CRing begin  | 
| 13936 | 10  | 
|
11  | 
record ('a, 'b) module = "'b ring" +
 | 
|
12  | 
smult :: "['a, 'b] => 'b" (infixl "\<odot>\<index>" 70)  | 
|
13  | 
||
14  | 
locale module = cring R + abelian_group M +  | 
|
15  | 
assumes smult_closed [simp, intro]:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
16  | 
"[| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"  | 
| 13936 | 17  | 
and smult_l_distr:  | 
18  | 
"[| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
19  | 
(a \<oplus> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> b \<odot>\<^bsub>M\<^esub> x"  | 
| 13936 | 20  | 
and smult_r_distr:  | 
21  | 
"[| a \<in> carrier R; x \<in> carrier M; y \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
22  | 
a \<odot>\<^bsub>M\<^esub> (x \<oplus>\<^bsub>M\<^esub> y) = a \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> a \<odot>\<^bsub>M\<^esub> y"  | 
| 13936 | 23  | 
and smult_assoc1:  | 
24  | 
"[| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
25  | 
(a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 26  | 
and smult_one [simp]:  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
27  | 
"x \<in> carrier M ==> \<one> \<odot>\<^bsub>M\<^esub> x = x"  | 
| 13936 | 28  | 
|
29  | 
locale algebra = module R M + cring M +  | 
|
30  | 
assumes smult_assoc2:  | 
|
31  | 
"[| a \<in> carrier R; x \<in> carrier M; y \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
32  | 
(a \<odot>\<^bsub>M\<^esub> x) \<otimes>\<^bsub>M\<^esub> y = a \<odot>\<^bsub>M\<^esub> (x \<otimes>\<^bsub>M\<^esub> y)"  | 
| 13936 | 33  | 
|
34  | 
lemma moduleI:  | 
|
| 19783 | 35  | 
fixes R (structure) and M (structure)  | 
| 13936 | 36  | 
assumes cring: "cring R"  | 
37  | 
and abelian_group: "abelian_group M"  | 
|
38  | 
and smult_closed:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
39  | 
"!!a x. [| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"  | 
| 13936 | 40  | 
and smult_l_distr:  | 
41  | 
"!!a b x. [| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
42  | 
(a \<oplus> b) \<odot>\<^bsub>M\<^esub> x = (a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 43  | 
and smult_r_distr:  | 
44  | 
"!!a x y. [| a \<in> carrier R; x \<in> carrier M; y \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
45  | 
a \<odot>\<^bsub>M\<^esub> (x \<oplus>\<^bsub>M\<^esub> y) = (a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> y)"  | 
| 13936 | 46  | 
and smult_assoc1:  | 
47  | 
"!!a b x. [| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
48  | 
(a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 49  | 
and smult_one:  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
50  | 
"!!x. x \<in> carrier M ==> \<one> \<odot>\<^bsub>M\<^esub> x = x"  | 
| 13936 | 51  | 
shows "module R M"  | 
52  | 
by (auto intro: module.intro cring.axioms abelian_group.axioms  | 
|
53  | 
module_axioms.intro prems)  | 
|
54  | 
||
55  | 
lemma algebraI:  | 
|
| 19783 | 56  | 
fixes R (structure) and M (structure)  | 
| 13936 | 57  | 
assumes R_cring: "cring R"  | 
58  | 
and M_cring: "cring M"  | 
|
59  | 
and smult_closed:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
60  | 
"!!a x. [| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"  | 
| 13936 | 61  | 
and smult_l_distr:  | 
62  | 
"!!a b x. [| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
63  | 
(a \<oplus> b) \<odot>\<^bsub>M\<^esub> x = (a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 64  | 
and smult_r_distr:  | 
65  | 
"!!a x y. [| a \<in> carrier R; x \<in> carrier M; y \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
66  | 
a \<odot>\<^bsub>M\<^esub> (x \<oplus>\<^bsub>M\<^esub> y) = (a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> y)"  | 
| 13936 | 67  | 
and smult_assoc1:  | 
68  | 
"!!a b x. [| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
69  | 
(a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 70  | 
and smult_one:  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
71  | 
"!!x. x \<in> carrier M ==> (one R) \<odot>\<^bsub>M\<^esub> x = x"  | 
| 13936 | 72  | 
and smult_assoc2:  | 
73  | 
"!!a x y. [| a \<in> carrier R; x \<in> carrier M; y \<in> carrier M |] ==>  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
74  | 
(a \<odot>\<^bsub>M\<^esub> x) \<otimes>\<^bsub>M\<^esub> y = a \<odot>\<^bsub>M\<^esub> (x \<otimes>\<^bsub>M\<^esub> y)"  | 
| 13936 | 75  | 
shows "algebra R M"  | 
76  | 
by (auto intro!: algebra.intro algebra_axioms.intro cring.axioms  | 
|
77  | 
module_axioms.intro prems)  | 
|
78  | 
||
79  | 
lemma (in algebra) R_cring:  | 
|
80  | 
"cring R"  | 
|
| 14651 | 81  | 
by (rule cring.intro)  | 
| 13936 | 82  | 
|
83  | 
lemma (in algebra) M_cring:  | 
|
84  | 
"cring M"  | 
|
| 14651 | 85  | 
by (rule cring.intro)  | 
| 13936 | 86  | 
|
87  | 
lemma (in algebra) module:  | 
|
88  | 
"module R M"  | 
|
89  | 
by (auto intro: moduleI R_cring is_abelian_group  | 
|
90  | 
smult_l_distr smult_r_distr smult_assoc1)  | 
|
91  | 
||
| 14651 | 92  | 
|
| 13936 | 93  | 
subsection {* Basic Properties of Algebras *}
 | 
94  | 
||
95  | 
lemma (in algebra) smult_l_null [simp]:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
96  | 
"x \<in> carrier M ==> \<zero> \<odot>\<^bsub>M\<^esub> x = \<zero>\<^bsub>M\<^esub>"  | 
| 13936 | 97  | 
proof -  | 
98  | 
assume M: "x \<in> carrier M"  | 
|
99  | 
note facts = M smult_closed  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
100  | 
from facts have "\<zero> \<odot>\<^bsub>M\<^esub> x = (\<zero> \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> \<zero> \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub> (\<zero> \<odot>\<^bsub>M\<^esub> x)" by algebra  | 
| 
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
101  | 
also from M have "... = (\<zero> \<oplus> \<zero>) \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub> (\<zero> \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 102  | 
by (simp add: smult_l_distr del: R.l_zero R.r_zero)  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
103  | 
also from facts have "... = \<zero>\<^bsub>M\<^esub>" by algebra  | 
| 13936 | 104  | 
finally show ?thesis .  | 
105  | 
qed  | 
|
106  | 
||
107  | 
lemma (in algebra) smult_r_null [simp]:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
108  | 
"a \<in> carrier R ==> a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub> = \<zero>\<^bsub>M\<^esub>";  | 
| 13936 | 109  | 
proof -  | 
110  | 
assume R: "a \<in> carrier R"  | 
|
111  | 
note facts = R smult_closed  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
112  | 
from facts have "a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub> = (a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub> \<oplus>\<^bsub>M\<^esub> a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub>) \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub>)"  | 
| 13936 | 113  | 
by algebra  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
114  | 
also from R have "... = a \<odot>\<^bsub>M\<^esub> (\<zero>\<^bsub>M\<^esub> \<oplus>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub>) \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub>)"  | 
| 13936 | 115  | 
by (simp add: smult_r_distr del: M.l_zero M.r_zero)  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
116  | 
also from facts have "... = \<zero>\<^bsub>M\<^esub>" by algebra  | 
| 13936 | 117  | 
finally show ?thesis .  | 
118  | 
qed  | 
|
119  | 
||
120  | 
lemma (in algebra) smult_l_minus:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
121  | 
"[| a \<in> carrier R; x \<in> carrier M |] ==> (\<ominus>a) \<odot>\<^bsub>M\<^esub> x = \<ominus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 122  | 
proof -  | 
123  | 
assume RM: "a \<in> carrier R" "x \<in> carrier M"  | 
|
124  | 
note facts = RM smult_closed  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
125  | 
from facts have "(\<ominus>a) \<odot>\<^bsub>M\<^esub> x = (\<ominus>a \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)"  | 
| 
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
126  | 
by algebra  | 
| 
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
127  | 
also from RM have "... = (\<ominus>a \<oplus> a) \<odot>\<^bsub>M\<^esub> x \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 128  | 
by (simp add: smult_l_distr)  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
129  | 
also from facts smult_l_null have "... = \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)" by algebra  | 
| 13936 | 130  | 
finally show ?thesis .  | 
131  | 
qed  | 
|
132  | 
||
133  | 
lemma (in algebra) smult_r_minus:  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
134  | 
"[| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> (\<ominus>\<^bsub>M\<^esub>x) = \<ominus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 135  | 
proof -  | 
136  | 
assume RM: "a \<in> carrier R" "x \<in> carrier M"  | 
|
137  | 
note facts = RM smult_closed  | 
|
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
138  | 
from facts have "a \<odot>\<^bsub>M\<^esub> (\<ominus>\<^bsub>M\<^esub>x) = (a \<odot>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub>x \<oplus>\<^bsub>M\<^esub> a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 139  | 
by algebra  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
140  | 
also from RM have "... = a \<odot>\<^bsub>M\<^esub> (\<ominus>\<^bsub>M\<^esub>x \<oplus>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)"  | 
| 13936 | 141  | 
by (simp add: smult_r_distr)  | 
| 
15095
 
63f5f4c265dd
Theories now take advantage of recent syntax improvements with (structure).
 
ballarin 
parents: 
14706 
diff
changeset
 | 
142  | 
also from facts smult_r_null have "... = \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)" by algebra  | 
| 13936 | 143  | 
finally show ?thesis .  | 
144  | 
qed  | 
|
145  | 
||
146  | 
end  |