src/HOL/Hyperreal/hypreal_arith.ML
author huffman
Fri, 09 Sep 2005 19:34:22 +0200
changeset 17318 bc1c75855f3d
parent 15923 01d5d0c1c078
child 17431 70311ad8bf11
permissions -rw-r--r--
starfun, starset, and other functions on NS types are now polymorphic; many similar theorems have been generalized and merged; (star_n X) replaces (Abs_star(starrel `` {X})); many proofs have been simplified with the transfer tactic.
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
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14370
diff changeset
    22
val hyprealT = Type("Rational.hypreal", []);
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}),
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14370
diff changeset
    38
  arith_inj_const ("HyperDef.hypreal_of_real", HOLogic.realT --> hyprealT),
14352
a8b1a44d8264 Modified real arithmetic simplification
paulson
parents: 14334
diff changeset
    39
  Simplifier.change_simpset_of (op addsimprocs) [fast_hypreal_arith_simproc]];
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