src/HOL/Decision_Procs/Commutative_Ring.thy
author wenzelm
Thu, 06 Mar 2014 22:15:01 +0100
changeset 55965 0c2c61a87a7d
parent 55793 52c8f934ea6f
child 58249 180f1b3508ed
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28952
15a4b2cf8c34 made repository layout more coherent with logical distribution structure; stripped some $Id$s
haftmann
parents: 27487
diff changeset
     1
(*  Author:     Bernhard Haeupler
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     2
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     3
Proving equalities in commutative rings done "right" in Isabelle/HOL.
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     4
*)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     5
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     6
header {* Proving equalities in commutative rings *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     7
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
     8
theory Commutative_Ring
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
     9
imports Parity
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    10
begin
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    11
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    12
text {* Syntax of multivariate polynomials (pol) and polynomial expressions. *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    13
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    14
datatype 'a pol =
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    15
    Pc 'a
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    16
  | Pinj nat "'a pol"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    17
  | PX "'a pol" nat "'a pol"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    18
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    19
datatype 'a polex =
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
    20
    Pol "'a pol"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    21
  | Add "'a polex" "'a polex"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    22
  | Sub "'a polex" "'a polex"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    23
  | Mul "'a polex" "'a polex"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    24
  | Pow "'a polex" nat
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    25
  | Neg "'a polex"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    26
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    27
text {* Interpretation functions for the shadow syntax. *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    28
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    29
primrec Ipol :: "'a::{comm_ring_1} list \<Rightarrow> 'a pol \<Rightarrow> 'a"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    30
where
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    31
    "Ipol l (Pc c) = c"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    32
  | "Ipol l (Pinj i P) = Ipol (drop i l) P"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    33
  | "Ipol l (PX P x Q) = Ipol l P * (hd l)^x + Ipol (drop 1 l) Q"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    34
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    35
primrec Ipolex :: "'a::{comm_ring_1} list \<Rightarrow> 'a polex \<Rightarrow> 'a"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    36
where
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    37
    "Ipolex l (Pol P) = Ipol l P"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    38
  | "Ipolex l (Add P Q) = Ipolex l P + Ipolex l Q"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    39
  | "Ipolex l (Sub P Q) = Ipolex l P - Ipolex l Q"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    40
  | "Ipolex l (Mul P Q) = Ipolex l P * Ipolex l Q"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    41
  | "Ipolex l (Pow p n) = Ipolex l p ^ n"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    42
  | "Ipolex l (Neg P) = - Ipolex l P"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    43
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    44
text {* Create polynomial normalized polynomials given normalized inputs. *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    45
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    46
definition mkPinj :: "nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    47
where
19736
wenzelm
parents: 18708
diff changeset
    48
  "mkPinj x P = (case P of
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    49
    Pc c \<Rightarrow> Pc c |
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    50
    Pinj y P \<Rightarrow> Pinj (x + y) P |
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    51
    PX p1 y p2 \<Rightarrow> Pinj x P)"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    52
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    53
definition mkPX :: "'a::comm_ring pol \<Rightarrow> nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    54
where
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    55
  "mkPX P i Q =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    56
    (case P of
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    57
      Pc c \<Rightarrow> if c = 0 then mkPinj 1 Q else PX P i Q
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    58
    | Pinj j R \<Rightarrow> PX P i Q
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    59
    | PX P2 i2 Q2 \<Rightarrow> if Q2 = Pc 0 then PX P2 (i + i2) Q else PX P i Q)"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    60
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    61
text {* Defining the basic ring operations on normalized polynomials *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    62
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    63
function add :: "'a::comm_ring pol \<Rightarrow> 'a pol \<Rightarrow> 'a pol"  (infixl "\<oplus>" 65)
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    64
where
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    65
  "Pc a \<oplus> Pc b = Pc (a + b)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    66
| "Pc c \<oplus> Pinj i P = Pinj i (P \<oplus> Pc c)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    67
| "Pinj i P \<oplus> Pc c = Pinj i (P \<oplus> Pc c)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    68
| "Pc c \<oplus> PX P i Q = PX P i (Q \<oplus> Pc c)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    69
| "PX P i Q \<oplus> Pc c = PX P i (Q \<oplus> Pc c)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    70
| "Pinj x P \<oplus> Pinj y Q =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    71
    (if x = y then mkPinj x (P \<oplus> Q)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    72
     else (if x > y then mkPinj y (Pinj (x - y) P \<oplus> Q)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    73
       else mkPinj x (Pinj (y - x) Q \<oplus> P)))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    74
| "Pinj x P \<oplus> PX Q y R =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    75
    (if x = 0 then P \<oplus> PX Q y R
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    76
     else (if x = 1 then PX Q y (R \<oplus> P)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    77
       else PX Q y (R \<oplus> Pinj (x - 1) P)))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    78
| "PX P x R \<oplus> Pinj y Q =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    79
    (if y = 0 then PX P x R \<oplus> Q
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    80
     else (if y = 1 then PX P x (R \<oplus> Q)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    81
       else PX P x (R \<oplus> Pinj (y - 1) Q)))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    82
| "PX P1 x P2 \<oplus> PX Q1 y Q2 =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    83
    (if x = y then mkPX (P1 \<oplus> Q1) x (P2 \<oplus> Q2)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    84
     else (if x > y then mkPX (PX P1 (x - y) (Pc 0) \<oplus> Q1) y (P2 \<oplus> Q2)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    85
       else mkPX (PX Q1 (y-x) (Pc 0) \<oplus> P1) x (P2 \<oplus> Q2)))"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    86
by pat_completeness auto
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    87
termination by (relation "measure (\<lambda>(x, y). size x + size y)") auto
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
    88
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    89
function mul :: "'a::{comm_ring} pol \<Rightarrow> 'a pol \<Rightarrow> 'a pol"  (infixl "\<otimes>" 70)
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
    90
where
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    91
  "Pc a \<otimes> Pc b = Pc (a * b)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    92
| "Pc c \<otimes> Pinj i P =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    93
    (if c = 0 then Pc 0 else mkPinj i (P \<otimes> Pc c))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    94
| "Pinj i P \<otimes> Pc c =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    95
    (if c = 0 then Pc 0 else mkPinj i (P \<otimes> Pc c))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    96
| "Pc c \<otimes> PX P i Q =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    97
    (if c = 0 then Pc 0 else mkPX (P \<otimes> Pc c) i (Q \<otimes> Pc c))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    98
| "PX P i Q \<otimes> Pc c =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
    99
    (if c = 0 then Pc 0 else mkPX (P \<otimes> Pc c) i (Q \<otimes> Pc c))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   100
| "Pinj x P \<otimes> Pinj y Q =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   101
    (if x = y then mkPinj x (P \<otimes> Q) else
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   102
       (if x > y then mkPinj y (Pinj (x-y) P \<otimes> Q)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   103
         else mkPinj x (Pinj (y - x) Q \<otimes> P)))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   104
| "Pinj x P \<otimes> PX Q y R =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   105
    (if x = 0 then P \<otimes> PX Q y R else
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   106
       (if x = 1 then mkPX (Pinj x P \<otimes> Q) y (R \<otimes> P)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   107
         else mkPX (Pinj x P \<otimes> Q) y (R \<otimes> Pinj (x - 1) P)))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   108
| "PX P x R \<otimes> Pinj y Q =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   109
    (if y = 0 then PX P x R \<otimes> Q else
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   110
       (if y = 1 then mkPX (Pinj y Q \<otimes> P) x (R \<otimes> Q)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   111
         else mkPX (Pinj y Q \<otimes> P) x (R \<otimes> Pinj (y - 1) Q)))"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   112
| "PX P1 x P2 \<otimes> PX Q1 y Q2 =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   113
    mkPX (P1 \<otimes> Q1) (x + y) (P2 \<otimes> Q2) \<oplus>
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   114
      (mkPX (P1 \<otimes> mkPinj 1 Q2) x (Pc 0) \<oplus>
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   115
        (mkPX (Q1 \<otimes> mkPinj 1 P2) y (Pc 0)))"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   116
by pat_completeness auto
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   117
termination by (relation "measure (\<lambda>(x, y). size x + size y)")
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   118
  (auto simp add: mkPinj_def split: pol.split)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   119
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   120
text {* Negation*}
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   121
primrec neg :: "'a::{comm_ring} pol \<Rightarrow> 'a pol"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   122
where
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   123
  "neg (Pc c) = Pc (-c)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   124
| "neg (Pinj i P) = Pinj i (neg P)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   125
| "neg (PX P x Q) = PX (neg P) x (neg Q)"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   126
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   127
text {* Substraction *}
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   128
definition sub :: "'a::{comm_ring} pol \<Rightarrow> 'a pol \<Rightarrow> 'a pol"  (infixl "\<ominus>" 65)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   129
  where "sub P Q = P \<oplus> neg Q"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   130
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   131
text {* Square for Fast Exponentation *}
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   132
primrec sqr :: "'a::{comm_ring_1} pol \<Rightarrow> 'a pol"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   133
where
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   134
  "sqr (Pc c) = Pc (c * c)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   135
| "sqr (Pinj i P) = mkPinj i (sqr P)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   136
| "sqr (PX A x B) =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   137
    mkPX (sqr A) (x + x) (sqr B) \<oplus> mkPX (Pc (1 + 1) \<otimes> A \<otimes> mkPinj 1 B) x (Pc 0)"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   138
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   139
text {* Fast Exponentation *}
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   140
fun pow :: "nat \<Rightarrow> 'a::{comm_ring_1} pol \<Rightarrow> 'a pol"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   141
where
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   142
  "pow 0 P = Pc 1"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   143
| "pow n P =
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   144
    (if even n then pow (n div 2) (sqr P)
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   145
     else P \<otimes> pow (n div 2) (sqr P))"
55793
52c8f934ea6f tuned whitespace;
wenzelm
parents: 55754
diff changeset
   146
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   147
lemma pow_if:
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   148
  "pow n P =
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   149
   (if n = 0 then Pc 1 else if even n then pow (n div 2) (sqr P)
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   150
    else P \<otimes> pow (n div 2) (sqr P))"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   151
  by (cases n) simp_all
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   152
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   153
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   154
text {* Normalization of polynomial expressions *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   155
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   156
primrec norm :: "'a::{comm_ring_1} polex \<Rightarrow> 'a pol"
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   157
where
55754
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   158
  "norm (Pol P) = P"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   159
| "norm (Add P Q) = norm P \<oplus> norm Q"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   160
| "norm (Sub P Q) = norm P \<ominus> norm Q"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   161
| "norm (Mul P Q) = norm P \<otimes> norm Q"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   162
| "norm (Pow P n) = pow n (norm P)"
d14072d53c1e tuned specifications and proofs;
wenzelm
parents: 53077
diff changeset
   163
| "norm (Neg P) = neg (norm P)"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   164
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   165
text {* mkPinj preserve semantics *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   166
lemma mkPinj_ci: "Ipol l (mkPinj a B) = Ipol l (Pinj a B)"
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   167
  by (induct B) (auto simp add: mkPinj_def algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   168
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   169
text {* mkPX preserves semantics *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   170
lemma mkPX_ci: "Ipol l (mkPX A b C) = Ipol l (PX A b C)"
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   171
  by (cases A) (auto simp add: mkPX_def mkPinj_ci power_add algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   172
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   173
text {* Correctness theorems for the implemented operations *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   174
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   175
text {* Negation *}
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   176
lemma neg_ci: "Ipol l (neg P) = -(Ipol l P)"
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   177
  by (induct P arbitrary: l) auto
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   178
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   179
text {* Addition *}
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   180
lemma add_ci: "Ipol l (P \<oplus> Q) = Ipol l P + Ipol l Q"
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   181
proof (induct P Q arbitrary: l rule: add.induct)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   182
  case (6 x P y Q)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   183
  show ?case
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   184
  proof (rule linorder_cases)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   185
    assume "x < y"
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   186
    with 6 show ?case by (simp add: mkPinj_ci algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   187
  next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   188
    assume "x = y"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   189
    with 6 show ?case by (simp add: mkPinj_ci)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   190
  next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   191
    assume "x > y"
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   192
    with 6 show ?case by (simp add: mkPinj_ci algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   193
  qed
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   194
next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   195
  case (7 x P Q y R)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   196
  have "x = 0 \<or> x = 1 \<or> x > 1" by arith
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   197
  moreover
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   198
  { assume "x = 0" with 7 have ?case by simp }
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   199
  moreover
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   200
  { assume "x = 1" with 7 have ?case by (simp add: algebra_simps) }
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   201
  moreover
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   202
  { assume "x > 1" from 7 have ?case by (cases x) simp_all }
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   203
  ultimately show ?case by blast
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   204
next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   205
  case (8 P x R y Q)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   206
  have "y = 0 \<or> y = 1 \<or> y > 1" by arith
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   207
  moreover
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   208
  { assume "y = 0" with 8 have ?case by simp }
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   209
  moreover
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   210
  { assume "y = 1" with 8 have ?case by simp }
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   211
  moreover
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   212
  { assume "y > 1" with 8 have ?case by simp }
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   213
  ultimately show ?case by blast
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   214
next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   215
  case (9 P1 x P2 Q1 y Q2)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   216
  show ?case
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   217
  proof (rule linorder_cases)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   218
    assume a: "x < y" hence "EX d. d + x = y" by arith
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   219
    with 9 a show ?case by (auto simp add: mkPX_ci power_add algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   220
  next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   221
    assume a: "y < x" hence "EX d. d + y = x" by arith
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   222
    with 9 a show ?case by (auto simp add: power_add mkPX_ci algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   223
  next
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   224
    assume "x = y"
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   225
    with 9 show ?case by (simp add: mkPX_ci algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   226
  qed
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   227
qed (auto simp add: algebra_simps)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   228
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   229
text {* Multiplication *}
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   230
lemma mul_ci: "Ipol l (P \<otimes> Q) = Ipol l P * Ipol l Q"
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   231
  by (induct P Q arbitrary: l rule: mul.induct)
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   232
    (simp_all add: mkPX_ci mkPinj_ci algebra_simps add_ci power_add)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   233
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   234
text {* Substraction *}
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   235
lemma sub_ci: "Ipol l (P \<ominus> Q) = Ipol l P - Ipol l Q"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   236
  by (simp add: add_ci neg_ci sub_def)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   237
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   238
text {* Square *}
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   239
lemma sqr_ci: "Ipol ls (sqr P) = Ipol ls P * Ipol ls P"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   240
  by (induct P arbitrary: ls)
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 28952
diff changeset
   241
    (simp_all add: add_ci mkPinj_ci mkPX_ci mul_ci algebra_simps power_add)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   242
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   243
text {* Power *}
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   244
lemma even_pow:"even n \<Longrightarrow> pow n P = pow (n div 2) (sqr P)"
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   245
  by (induct n) simp_all
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   246
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   247
lemma pow_ci: "Ipol ls (pow n P) = Ipol ls P ^ n"
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   248
proof (induct n arbitrary: P rule: nat_less_induct)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   249
  case (1 k)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   250
  show ?case
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   251
  proof (cases k)
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   252
    case 0
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   253
    then show ?thesis by simp
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   254
  next
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   255
    case (Suc l)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   256
    show ?thesis
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   257
    proof cases
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   258
      assume "even l"
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   259
      then have "Suc l div 2 = l div 2"
40077
c8a9eaaa2f59 nat_number -> eval_nat_numeral
nipkow
parents: 33356
diff changeset
   260
        by (simp add: eval_nat_numeral even_nat_plus_one_div_two)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   261
      moreover
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   262
      from Suc have "l < k" by simp
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   263
      with 1 have "\<And>P. Ipol ls (pow l P) = Ipol ls P ^ l" by simp
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   264
      moreover
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   265
      note Suc `even l` even_nat_plus_one_div_two
52658
1e7896c7f781 tuned specifications and proofs;
wenzelm
parents: 48891
diff changeset
   266
      ultimately show ?thesis by (auto simp add: mul_ci even_pow)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   267
    next
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   268
      assume "odd l"
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   269
      {
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   270
        fix p
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   271
        have "Ipol ls (sqr P) ^ (Suc l div 2) = Ipol ls P ^ Suc l"
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   272
        proof (cases l)
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   273
          case 0
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   274
          with `odd l` show ?thesis by simp
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   275
        next
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   276
          case (Suc w)
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   277
          with `odd l` have "even w" by simp
20678
f6d602833557 tuned proofs;
wenzelm
parents: 20622
diff changeset
   278
          have two_times: "2 * (w div 2) = w"
f6d602833557 tuned proofs;
wenzelm
parents: 20622
diff changeset
   279
            by (simp only: numerals even_nat_div_two_times_two [OF `even w`])
22742
06165e40e7bd switched from recdef to function package; constants add, mul, pow now curried; infix syntax for algebraic operations.
haftmann
parents: 22665
diff changeset
   280
          have "Ipol ls P * Ipol ls P = Ipol ls P ^ Suc (Suc 0)"
52658
1e7896c7f781 tuned specifications and proofs;
wenzelm
parents: 48891
diff changeset
   281
            by simp
53077
a1b3784f8129 more symbols;
wenzelm
parents: 52658
diff changeset
   282
          then have "Ipol ls P * Ipol ls P = (Ipol ls P)\<^sup>2"
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 31021
diff changeset
   283
            by (simp add: numerals)
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   284
          with Suc show ?thesis
30273
ecd6f0ca62ea declare power_Suc [simp]; remove redundant type-specific versions of power_Suc
huffman
parents: 29667
diff changeset
   285
            by (auto simp add: power_mult [symmetric, of _ 2 _] two_times mul_ci sqr_ci
ecd6f0ca62ea declare power_Suc [simp]; remove redundant type-specific versions of power_Suc
huffman
parents: 29667
diff changeset
   286
                     simp del: power_Suc)
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   287
        qed
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   288
      } with 1 Suc `odd l` show ?thesis by simp
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   289
    qed
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   290
  qed
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   291
qed
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   292
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   293
text {* Normalization preserves semantics  *}
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   294
lemma norm_ci: "Ipolex l Pe = Ipol l (norm Pe)"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   295
  by (induct Pe) (simp_all add: add_ci sub_ci mul_ci neg_ci pow_ci)
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   296
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   297
text {* Reflection lemma: Key to the (incomplete) decision procedure *}
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   298
lemma norm_eq:
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   299
  assumes "norm P1 = norm P2"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   300
  shows "Ipolex l P1 = Ipolex l P2"
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   301
proof -
41807
ab5d2d81f9fb tuned proofs -- eliminated prems;
wenzelm
parents: 40077
diff changeset
   302
  from assms have "Ipol l (norm P1) = Ipol l (norm P2)" by simp
20622
e1a573146be5 tuned proofs;
wenzelm
parents: 19736
diff changeset
   303
  then show ?thesis by (simp only: norm_ci)
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   304
qed
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   305
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   306
48891
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 47432
diff changeset
   307
ML_file "commutative_ring_tac.ML"
47432
e1576d13e933 more standard method setup;
wenzelm
parents: 41807
diff changeset
   308
e1576d13e933 more standard method setup;
wenzelm
parents: 41807
diff changeset
   309
method_setup comm_ring = {*
e1576d13e933 more standard method setup;
wenzelm
parents: 41807
diff changeset
   310
  Scan.succeed (SIMPLE_METHOD' o Commutative_Ring_Tac.tac)
e1576d13e933 more standard method setup;
wenzelm
parents: 41807
diff changeset
   311
*} "reflective decision procedure for equalities over commutative rings"
17516
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   312
45164074dad4 added Commutative_Ring (from Main HOL);
wenzelm
parents:
diff changeset
   313
end