src/HOL/Semiring_Normalization.thy
author haftmann
Wed, 12 May 2010 15:27:15 +0200
changeset 36873 112e613e8d0b
parent 36872 6520ba1256a6
child 37946 be3c0df7bb90
permissions -rw-r--r--
tuned proofs and fact and class names
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36751
7f1da69cacb3 split of semiring normalization from Groebner theory; moved field_comp_conv to Numeral_Simproces
haftmann
parents: 36720
diff changeset
     1
(*  Title:      HOL/Semiring_Normalization.thy
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
     2
    Author:     Amine Chaieb, TU Muenchen
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
     3
*)
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
     4
36751
7f1da69cacb3 split of semiring normalization from Groebner theory; moved field_comp_conv to Numeral_Simproces
haftmann
parents: 36720
diff changeset
     5
header {* Semiring normalization *}
28402
09e4aa3ddc25 clarified dependencies between arith tools
haftmann
parents: 27666
diff changeset
     6
36751
7f1da69cacb3 split of semiring normalization from Groebner theory; moved field_comp_conv to Numeral_Simproces
haftmann
parents: 36720
diff changeset
     7
theory Semiring_Normalization
36699
816da1023508 moved nat_arith ot Nat_Numeral: clarified normalizer setup
haftmann
parents: 36698
diff changeset
     8
imports Numeral_Simprocs Nat_Transfer
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
     9
uses
36753
5cf4e9128f22 renamed Normalizer to the more specific Semiring_Normalizer
haftmann
parents: 36751
diff changeset
    10
  "Tools/semiring_normalizer.ML"
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
    11
begin
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
    12
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    13
text {* Prelude *}
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    14
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    15
class comm_semiring_1_cancel_crossproduct = comm_semiring_1_cancel +
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    16
  assumes crossproduct_eq: "w * y + x * z = w * z + x * y \<longleftrightarrow> w = x \<or> y = z"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    17
begin
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    18
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    19
lemma crossproduct_noteq:
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    20
  "a \<noteq> b \<and> c \<noteq> d \<longleftrightarrow> a * c + b * d \<noteq> a * d + b * c"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    21
  by (simp add: crossproduct_eq)
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    22
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    23
lemma add_scale_eq_noteq:
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    24
  "r \<noteq> 0 \<Longrightarrow> a = b \<and> c \<noteq> d \<Longrightarrow> a + r * c \<noteq> b + r * d"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    25
proof (rule notI)
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    26
  assume nz: "r\<noteq> 0" and cnd: "a = b \<and> c\<noteq>d"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    27
    and eq: "a + (r * c) = b + (r * d)"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    28
  have "(0 * d) + (r * c) = (0 * c) + (r * d)"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    29
    using add_imp_eq eq mult_zero_left by (simp add: cnd)
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    30
  then show False using crossproduct_eq [of 0 d] nz cnd by simp
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    31
qed
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    32
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    33
lemma add_0_iff:
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    34
  "b = b + a \<longleftrightarrow> a = 0"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    35
  using add_imp_eq [of b a 0] by auto
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    36
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    37
end
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    38
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    39
sublocale idom < comm_semiring_1_cancel_crossproduct
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    40
proof
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    41
  fix w x y z
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    42
  show "w * y + x * z = w * z + x * y \<longleftrightarrow> w = x \<or> y = z"
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    43
  proof
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    44
    assume "w * y + x * z = w * z + x * y"
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    45
    then have "w * y + x * z - w * z - x * y = 0" by (simp add: algebra_simps)
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    46
    then have "w * (y - z) - x * (y - z) = 0" by (simp add: algebra_simps)
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    47
    then have "(y - z) * (w - x) = 0" by (simp add: algebra_simps)
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    48
    then have "y - z = 0 \<or> w - x = 0" by (rule divisors_zero)
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    49
    then show "w = x \<or> y = z" by auto
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    50
  qed (auto simp add: add_ac)
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    51
qed
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    52
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    53
instance nat :: comm_semiring_1_cancel_crossproduct
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    54
proof
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    55
  fix w x y z :: nat
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    56
  have aux: "\<And>y z. y < z \<Longrightarrow> w * y + x * z = w * z + x * y \<Longrightarrow> w = x"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    57
  proof -
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    58
    fix y z :: nat
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    59
    assume "y < z" then have "\<exists>k. z = y + k \<and> k \<noteq> 0" by (intro exI [of _ "z - y"]) auto
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    60
    then obtain k where "z = y + k" and "k \<noteq> 0" by blast
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    61
    assume "w * y + x * z = w * z + x * y"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    62
    then have "(w * y + x * y) + x * k = (w * y + x * y) + w * k" by (simp add: `z = y + k` algebra_simps)
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    63
    then have "x * k = w * k" by simp
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    64
    then show "w = x" using `k \<noteq> 0` by simp
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    65
  qed
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    66
  show "w * y + x * z = w * z + x * y \<longleftrightarrow> w = x \<or> y = z"
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    67
    by (auto simp add: neq_iff dest!: aux)
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    68
qed
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
    69
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
    70
text {* Semiring normalization proper *}
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
    71
36753
5cf4e9128f22 renamed Normalizer to the more specific Semiring_Normalizer
haftmann
parents: 36751
diff changeset
    72
setup Semiring_Normalizer.setup
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
    73
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
    74
context comm_semiring_1
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
    75
begin
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
    76
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
    77
lemma normalizing_semiring_ops:
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    78
  shows "TERM (x + y)" and "TERM (x * y)" and "TERM (x ^ n)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    79
    and "TERM 0" and "TERM 1" .
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
    80
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
    81
lemma normalizing_semiring_rules:
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    82
  "(a * m) + (b * m) = (a + b) * m"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    83
  "(a * m) + m = (a + 1) * m"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    84
  "m + (a * m) = (a + 1) * m"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    85
  "m + m = (1 + 1) * m"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    86
  "0 + a = a"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    87
  "a + 0 = a"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    88
  "a * b = b * a"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    89
  "(a + b) * c = (a * c) + (b * c)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    90
  "0 * a = 0"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    91
  "a * 0 = 0"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    92
  "1 * a = a"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    93
  "a * 1 = a"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    94
  "(lx * ly) * (rx * ry) = (lx * rx) * (ly * ry)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    95
  "(lx * ly) * (rx * ry) = lx * (ly * (rx * ry))"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    96
  "(lx * ly) * (rx * ry) = rx * ((lx * ly) * ry)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    97
  "(lx * ly) * rx = (lx * rx) * ly"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    98
  "(lx * ly) * rx = lx * (ly * rx)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
    99
  "lx * (rx * ry) = (lx * rx) * ry"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   100
  "lx * (rx * ry) = rx * (lx * ry)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   101
  "(a + b) + (c + d) = (a + c) + (b + d)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   102
  "(a + b) + c = a + (b + c)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   103
  "a + (c + d) = c + (a + d)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   104
  "(a + b) + c = (a + c) + b"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   105
  "a + c = c + a"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   106
  "a + (c + d) = (a + c) + d"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   107
  "(x ^ p) * (x ^ q) = x ^ (p + q)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   108
  "x * (x ^ q) = x ^ (Suc q)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   109
  "(x ^ q) * x = x ^ (Suc q)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   110
  "x * x = x ^ 2"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   111
  "(x * y) ^ q = (x ^ q) * (y ^ q)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   112
  "(x ^ p) ^ q = x ^ (p * q)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   113
  "x ^ 0 = 1"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   114
  "x ^ 1 = x"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   115
  "x * (y + z) = (x * y) + (x * z)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   116
  "x ^ (Suc q) = x * (x ^ q)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   117
  "x ^ (2*n) = (x ^ n) * (x ^ n)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   118
  "x ^ (Suc (2*n)) = x * ((x ^ n) * (x ^ n))"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   119
  by (simp_all add: algebra_simps power_add power2_eq_square power_mult_distrib power_mult)
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   120
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   121
lemmas normalizing_comm_semiring_1_axioms =
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   122
  comm_semiring_1_axioms [normalizer
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   123
    semiring ops: normalizing_semiring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   124
    semiring rules: normalizing_semiring_rules]
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   125
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   126
declaration
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   127
  {* Semiring_Normalizer.semiring_funs @{thm normalizing_comm_semiring_1_axioms} *}
23573
d85a277f90fd common normalizer_funs, avoid cterm_of;
wenzelm
parents: 23477
diff changeset
   128
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   129
end
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   130
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   131
context comm_ring_1
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   132
begin
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   133
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   134
lemma normalizing_ring_ops: shows "TERM (x- y)" and "TERM (- x)" .
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   135
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   136
lemma normalizing_ring_rules:
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   137
  "- x = (- 1) * x"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   138
  "x - y = x + (- y)"
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   139
  by (simp_all add: diff_minus)
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   140
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   141
lemmas normalizing_comm_ring_1_axioms =
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   142
  comm_ring_1_axioms [normalizer
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   143
    semiring ops: normalizing_semiring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   144
    semiring rules: normalizing_semiring_rules
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   145
    ring ops: normalizing_ring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   146
    ring rules: normalizing_ring_rules]
30866
dd5117e2d73e now deals with devision in fields
chaieb
parents: 30729
diff changeset
   147
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   148
declaration
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   149
  {* Semiring_Normalizer.semiring_funs @{thm normalizing_comm_ring_1_axioms} *}
23327
1654013ec97c Added instantiation of algebra method to fields
chaieb
parents: 23312
diff changeset
   150
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   151
end
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   152
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   153
context comm_semiring_1_cancel_crossproduct
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   154
begin
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   155
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   156
declare
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   157
  normalizing_comm_semiring_1_axioms [normalizer del]
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   158
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   159
lemmas
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   160
  normalizing_comm_semiring_1_cancel_crossproduct_axioms =
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   161
  comm_semiring_1_cancel_crossproduct_axioms [normalizer
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   162
    semiring ops: normalizing_semiring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   163
    semiring rules: normalizing_semiring_rules
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   164
    idom rules: crossproduct_noteq add_scale_eq_noteq]
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   165
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   166
declaration
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   167
  {* Semiring_Normalizer.semiring_funs @{thm normalizing_comm_semiring_1_cancel_crossproduct_axioms} *}
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   168
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   169
end
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   170
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   171
context idom
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   172
begin
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   173
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   174
declare normalizing_comm_ring_1_axioms [normalizer del]
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   175
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   176
lemmas normalizing_idom_axioms = idom_axioms [normalizer
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   177
  semiring ops: normalizing_semiring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   178
  semiring rules: normalizing_semiring_rules
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   179
  ring ops: normalizing_ring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   180
  ring rules: normalizing_ring_rules
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   181
  idom rules: crossproduct_noteq add_scale_eq_noteq
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   182
  ideal rules: right_minus_eq add_0_iff]
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   183
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   184
declaration
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   185
  {* Semiring_Normalizer.semiring_funs @{thm normalizing_idom_axioms} *}
23252
67268bb40b21 Semiring normalization and Groebner Bases.
wenzelm
parents:
diff changeset
   186
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   187
end
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   188
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   189
context field
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   190
begin
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   191
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   192
lemma normalizing_field_ops:
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   193
  shows "TERM (x / y)" and "TERM (inverse x)" .
23327
1654013ec97c Added instantiation of algebra method to fields
chaieb
parents: 23312
diff changeset
   194
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   195
lemmas normalizing_field_rules = divide_inverse inverse_eq_divide
28402
09e4aa3ddc25 clarified dependencies between arith tools
haftmann
parents: 27666
diff changeset
   196
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   197
lemmas normalizing_field_axioms =
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   198
  field_axioms [normalizer
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   199
    semiring ops: normalizing_semiring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   200
    semiring rules: normalizing_semiring_rules
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   201
    ring ops: normalizing_ring_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   202
    ring rules: normalizing_ring_rules
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   203
    field ops: normalizing_field_ops
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   204
    field rules: normalizing_field_rules
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   205
    idom rules: crossproduct_noteq add_scale_eq_noteq
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   206
    ideal rules: right_minus_eq add_0_iff]
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   207
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   208
declaration
36756
c1ae8a0b4265 moved normalization proof tool infrastructure to canonical algebraic classes
haftmann
parents: 36753
diff changeset
   209
  {* Semiring_Normalizer.field_funs @{thm normalizing_field_axioms} *}
28402
09e4aa3ddc25 clarified dependencies between arith tools
haftmann
parents: 27666
diff changeset
   210
36871
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   211
end
3763c349c8c1 grouped local statements
haftmann
parents: 36845
diff changeset
   212
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   213
hide_fact (open) normalizing_comm_semiring_1_axioms
36873
112e613e8d0b tuned proofs and fact and class names
haftmann
parents: 36872
diff changeset
   214
  normalizing_comm_semiring_1_cancel_crossproduct_axioms normalizing_semiring_ops normalizing_semiring_rules
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   215
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   216
hide_fact (open) normalizing_comm_ring_1_axioms
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   217
  normalizing_idom_axioms normalizing_ring_ops normalizing_ring_rules
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   218
36872
6520ba1256a6 tuned fact collection names and some proofs
haftmann
parents: 36871
diff changeset
   219
hide_fact (open) normalizing_field_axioms normalizing_field_ops normalizing_field_rules
36845
d778c64fc35d Add rules directly to the corresponding class locales instead.
hoelzl
parents: 36756
diff changeset
   220
28402
09e4aa3ddc25 clarified dependencies between arith tools
haftmann
parents: 27666
diff changeset
   221
end