src/HOL/Hyperreal/hypreal_arith.ML
author urbanc
Tue, 13 Dec 2005 18:11:21 +0100
changeset 18396 b3e7da94b51f
parent 17876 b9c92f384109
child 18708 4b3dadb4fe33
permissions -rw-r--r--
added a fresh_left lemma that contains all instantiation for the various atom-types.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14309
f508492af9b4 moving HyperArith0.ML to other theories
paulson
parents: 14305
diff changeset
     1
(*  Title:      HOL/Hyperreal/hypreal_arith.ML
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     2
    ID:         $Id$
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     3
    Author:     Tobias Nipkow, TU Muenchen
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     4
    Copyright   1999 TU Muenchen
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     5
14352
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
     6
Simprocs for common factor cancellation & Rational coefficient handling
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
     7
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
     8
Instantiation of the generic linear arithmetic package for type hypreal.
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
     9
*)
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    10
14352
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    11
(****Instantiation of the generic linear arithmetic package****)
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    12
14309
f508492af9b4 moving HyperArith0.ML to other theories
paulson
parents: 14305
diff changeset
    13
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    14
local
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    15
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 15923
diff changeset
    16
val real_inj_thms = [thm "star_of_le" RS iffD2, 
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 15923
diff changeset
    17
                     thm "star_of_less" RS iffD2,
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 15923
diff changeset
    18
                     thm "star_of_eq" RS iffD2];
14369
c50188fe6366 tidying up arithmetic for the hyperreals
paulson
parents: 14352
diff changeset
    19
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    20
in
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    21
17431
70311ad8bf11 fix names in hypreal_arith.ML
huffman
parents: 17318
diff changeset
    22
val hyprealT = Type("StarDef.star", [HOLogic.realT]);
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14370
diff changeset
    23
14352
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    24
val fast_hypreal_arith_simproc =
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    25
    Simplifier.simproc (Theory.sign_of (the_context ()))
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    26
      "fast_hypreal_arith" 
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    27
      ["(m::hypreal) < n", "(m::hypreal) <= n", "(m::hypreal) = n"]
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    28
    Fast_Arith.lin_arith_prover;
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    29
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    30
val hypreal_arith_setup =
15923
01d5d0c1c078 fixed lin.arith
nipkow
parents: 15186
diff changeset
    31
 [Fast_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset} =>
14369
c50188fe6366 tidying up arithmetic for the hyperreals
paulson
parents: 14352
diff changeset
    32
   {add_mono_thms = add_mono_thms,
15184
d2c19aea17bc made mult_mono_thms generic.
nipkow
parents: 14387
diff changeset
    33
    mult_mono_thms = mult_mono_thms,
14369
c50188fe6366 tidying up arithmetic for the hyperreals
paulson
parents: 14352
diff changeset
    34
    inj_thms = inj_thms @ real_inj_thms, 
14352
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    35
    lessD = lessD,  (*Can't change LA_Data_Ref.lessD: the hypreals are dense!*)
15923
01d5d0c1c078 fixed lin.arith
nipkow
parents: 15186
diff changeset
    36
    neqE = neqE,
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14370
diff changeset
    37
    simpset = simpset}),
17431
70311ad8bf11 fix names in hypreal_arith.ML
huffman
parents: 17318
diff changeset
    38
  arith_inj_const ("StarDef.star_of", HOLogic.realT --> hyprealT),
17876
b9c92f384109 change_claset/simpset;
wenzelm
parents: 17431
diff changeset
    39
  fn thy => (change_simpset_of thy (fn ss => ss addsimprocs [fast_hypreal_arith_simproc]); thy)];
10751
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    40
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    41
end;
a81ea5d3dd41 separation of HOL-Hyperreal from HOL-Real
paulson
parents:
diff changeset
    42
14352
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    43
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    44