src/HOL/Algebra/Module.thy
author wenzelm
Tue, 23 May 2017 10:59:01 +0200
changeset 65908 aefdb9e664c9
parent 61565 352c73a689da
child 68551 b680e74eb6f2
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14706
71590b7733b7 tuned document;
wenzelm
parents: 14651
diff changeset
     1
(*  Title:      HOL/Algebra/Module.thy
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
     2
    Author:     Clemens Ballarin, started 15 April 2003
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
     3
    Copyright:  Clemens Ballarin
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
     4
*)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
     5
35849
b5522b51cb1e standard headers;
wenzelm
parents: 29237
diff changeset
     6
theory Module
b5522b51cb1e standard headers;
wenzelm
parents: 29237
diff changeset
     7
imports Ring
b5522b51cb1e standard headers;
wenzelm
parents: 29237
diff changeset
     8
begin
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
     9
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 58860
diff changeset
    10
section \<open>Modules over an Abelian Group\<close>
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 20168
diff changeset
    11
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 58860
diff changeset
    12
subsection \<open>Definitions\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    13
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    14
record ('a, 'b) module = "'b ring" +
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    15
  smult :: "['a, 'b] => 'b" (infixl "\<odot>\<index>" 70)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    16
61565
352c73a689da Qualifiers in locale expressions default to mandatory regardless of the command.
ballarin
parents: 61382
diff changeset
    17
locale module = R?: cring + M?: abelian_group M for M (structure) +
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    18
  assumes smult_closed [simp, intro]:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
    19
      "[| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    20
    and smult_l_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    21
      "[| 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
    22
      (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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    23
    and smult_r_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    24
      "[| 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
    25
      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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    26
    and smult_assoc1:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    27
      "[| 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
    28
      (a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    29
    and smult_one [simp]:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
    30
      "x \<in> carrier M ==> \<one> \<odot>\<^bsub>M\<^esub> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    31
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28823
diff changeset
    32
locale algebra = module + cring M +
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    33
  assumes smult_assoc2:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    34
      "[| 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
    35
      (a \<odot>\<^bsub>M\<^esub> x) \<otimes>\<^bsub>M\<^esub> y = a \<odot>\<^bsub>M\<^esub> (x \<otimes>\<^bsub>M\<^esub> y)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    36
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    37
lemma moduleI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 16417
diff changeset
    38
  fixes R (structure) and M (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    39
  assumes cring: "cring R"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    40
    and abelian_group: "abelian_group M"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    41
    and smult_closed:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
    42
      "!!a x. [| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    43
    and smult_l_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    44
      "!!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
    45
      (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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    46
    and smult_r_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    47
      "!!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
    48
      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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    49
    and smult_assoc1:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    50
      "!!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
    51
      (a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    52
    and smult_one:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
    53
      "!!x. x \<in> carrier M ==> \<one> \<odot>\<^bsub>M\<^esub> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    54
  shows "module R M"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    55
  by (auto intro: module.intro cring.axioms abelian_group.axioms
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 20318
diff changeset
    56
    module_axioms.intro assms)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    57
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    58
lemma algebraI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 16417
diff changeset
    59
  fixes R (structure) and M (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    60
  assumes R_cring: "cring R"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    61
    and M_cring: "cring M"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    62
    and smult_closed:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
    63
      "!!a x. [| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    64
    and smult_l_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    65
      "!!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
    66
      (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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    67
    and smult_r_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    68
      "!!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
    69
      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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    70
    and smult_assoc1:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    71
      "!!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
    72
      (a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    73
    and smult_one:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
    74
      "!!x. x \<in> carrier M ==> (one R) \<odot>\<^bsub>M\<^esub> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    75
    and smult_assoc2:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    76
      "!!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
    77
      (a \<odot>\<^bsub>M\<^esub> x) \<otimes>\<^bsub>M\<^esub> y = a \<odot>\<^bsub>M\<^esub> (x \<otimes>\<^bsub>M\<^esub> y)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    78
  shows "algebra R M"
19984
29bb4659f80a Method intro_locales replaced by intro_locales and unfold_locales.
ballarin
parents: 19931
diff changeset
    79
apply intro_locales
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 20318
diff changeset
    80
apply (rule cring.axioms ring.axioms abelian_group.axioms comm_monoid.axioms assms)+
19931
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    81
apply (rule module_axioms.intro)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    82
 apply (simp add: smult_closed)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    83
 apply (simp add: smult_l_distr)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    84
 apply (simp add: smult_r_distr)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    85
 apply (simp add: smult_assoc1)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    86
 apply (simp add: smult_one)
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 20318
diff changeset
    87
apply (rule cring.axioms ring.axioms abelian_group.axioms comm_monoid.axioms assms)+
19931
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    88
apply (rule algebra_axioms.intro)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    89
 apply (simp add: smult_assoc2)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 19783
diff changeset
    90
done
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    91
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    92
lemma (in algebra) R_cring:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    93
  "cring R"
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27714
diff changeset
    94
  ..
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    95
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    96
lemma (in algebra) M_cring:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    97
  "cring M"
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27714
diff changeset
    98
  ..
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
    99
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   100
lemma (in algebra) module:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   101
  "module R M"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   102
  by (auto intro: moduleI R_cring is_abelian_group
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   103
    smult_l_distr smult_r_distr smult_assoc1)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   104
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14577
diff changeset
   105
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 58860
diff changeset
   106
subsection \<open>Basic Properties of Algebras\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   107
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   108
lemma (in algebra) smult_l_null [simp]:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   109
  "x \<in> carrier M ==> \<zero> \<odot>\<^bsub>M\<^esub> x = \<zero>\<^bsub>M\<^esub>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   110
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   111
  assume M: "x \<in> carrier M"
20168
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   112
  note facts = M smult_closed [OF R.zero_closed]
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   113
  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
   114
  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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   115
    by (simp add: smult_l_distr del: R.l_zero R.r_zero)
20168
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   116
  also from facts have "... = \<zero>\<^bsub>M\<^esub>" apply algebra apply algebra done
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   117
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   118
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   119
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   120
lemma (in algebra) smult_r_null [simp]:
58860
fee7cfa69c50 eliminated spurious semicolons;
wenzelm
parents: 35849
diff changeset
   121
  "a \<in> carrier R ==> a \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub> = \<zero>\<^bsub>M\<^esub>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   122
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   123
  assume R: "a \<in> carrier R"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   124
  note facts = R smult_closed
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   125
  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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   126
    by algebra
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   127
  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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   128
    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
   129
  also from facts have "... = \<zero>\<^bsub>M\<^esub>" by algebra
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   130
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   131
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   132
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   133
lemma (in algebra) smult_l_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 |] ==> (\<ominus>a) \<odot>\<^bsub>M\<^esub> x = \<ominus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> x)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   135
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   136
  assume RM: "a \<in> carrier R" "x \<in> carrier M"
20168
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   137
  from RM have a_smult: "a \<odot>\<^bsub>M\<^esub> x \<in> carrier M" by simp
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   138
  from RM have ma_smult: "\<ominus>a \<odot>\<^bsub>M\<^esub> x \<in> carrier M" by simp
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   139
  note facts = RM a_smult ma_smult
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   140
  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
   141
    by algebra
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   142
  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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   143
    by (simp add: smult_l_distr)
20168
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   144
  also from facts smult_l_null have "... = \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)"
ed7bced29e1b Reimplemented algebra method; now controlled by attribute.
ballarin
parents: 19984
diff changeset
   145
    apply algebra apply algebra done
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   146
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   147
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   148
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   149
lemma (in algebra) smult_r_minus:
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   150
  "[| 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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   151
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   152
  assume RM: "a \<in> carrier R" "x \<in> carrier M"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   153
  note facts = RM smult_closed
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   154
  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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   155
    by algebra
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   156
  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
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   157
    by (simp add: smult_r_distr)
15095
63f5f4c265dd Theories now take advantage of recent syntax improvements with (structure).
ballarin
parents: 14706
diff changeset
   158
  also from facts smult_r_null have "... = \<ominus>\<^bsub>M\<^esub>(a \<odot>\<^bsub>M\<^esub> x)" by algebra
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   159
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   160
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   161
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents:
diff changeset
   162
end