src/HOL/Hyperreal/HyperDef.thy
author paulson
Sat Dec 27 21:02:14 2003 +0100 (2003-12-27)
changeset 14331 8dbbb7cf3637
parent 14329 ff3210fe968f
child 14334 6137d24eef79
permissions -rw-r--r--
re-organized numeric lemmas
     1 (*  Title       : HOL/Real/Hyperreal/HyperDef.thy
     2     ID          : $Id$
     3     Author      : Jacques D. Fleuriot
     4     Copyright   : 1998  University of Cambridge
     5     Description : Construction of hyperreals using ultrafilters
     6 *)
     7 
     8 theory HyperDef = Filter + Real
     9 files ("fuf.ML"):  (*Warning: file fuf.ML refers to the name Hyperdef!*)
    10 
    11 
    12 constdefs
    13 
    14   FreeUltrafilterNat   :: "nat set set"    ("\\<U>")
    15     "FreeUltrafilterNat == (SOME U. U \<in> FreeUltrafilter (UNIV:: nat set))"
    16 
    17   hyprel :: "((nat=>real)*(nat=>real)) set"
    18     "hyprel == {p. \<exists>X Y. p = ((X::nat=>real),Y) &
    19                    {n::nat. X(n) = Y(n)}: FreeUltrafilterNat}"
    20 
    21 typedef hypreal = "UNIV//hyprel" 
    22     by (auto simp add: quotient_def) 
    23 
    24 instance hypreal :: ord ..
    25 instance hypreal :: zero ..
    26 instance hypreal :: one ..
    27 instance hypreal :: plus ..
    28 instance hypreal :: times ..
    29 instance hypreal :: minus ..
    30 instance hypreal :: inverse ..
    31 
    32 
    33 defs (overloaded)
    34 
    35   hypreal_zero_def:
    36   "0 == Abs_hypreal(hyprel``{%n::nat. (0::real)})"
    37 
    38   hypreal_one_def:
    39   "1 == Abs_hypreal(hyprel``{%n::nat. (1::real)})"
    40 
    41   hypreal_minus_def:
    42   "- P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). hyprel``{%n::nat. - (X n)})"
    43 
    44   hypreal_diff_def:
    45   "x - y == x + -(y::hypreal)"
    46 
    47   hypreal_inverse_def:
    48   "inverse P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P).
    49                     hyprel``{%n. if X n = 0 then 0 else inverse (X n)})"
    50 
    51   hypreal_divide_def:
    52   "P / Q::hypreal == P * inverse Q"
    53 
    54 constdefs
    55 
    56   hypreal_of_real  :: "real => hypreal"
    57   "hypreal_of_real r         == Abs_hypreal(hyprel``{%n::nat. r})"
    58 
    59   omega   :: hypreal   (*an infinite number = [<1,2,3,...>] *)
    60   "omega == Abs_hypreal(hyprel``{%n::nat. real (Suc n)})"
    61 
    62   epsilon :: hypreal   (*an infinitesimal number = [<1,1/2,1/3,...>] *)
    63   "epsilon == Abs_hypreal(hyprel``{%n::nat. inverse (real (Suc n))})"
    64 
    65 syntax (xsymbols)
    66   omega   :: hypreal   ("\<omega>")
    67   epsilon :: hypreal   ("\<epsilon>")
    68 
    69 
    70 defs
    71 
    72   hypreal_add_def:
    73   "P + Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q).
    74                 hyprel``{%n::nat. X n + Y n})"
    75 
    76   hypreal_mult_def:
    77   "P * Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q).
    78                 hyprel``{%n::nat. X n * Y n})"
    79 
    80   hypreal_less_def:
    81   "P < (Q::hypreal) == \<exists>X Y. X \<in> Rep_hypreal(P) &
    82                                Y \<in> Rep_hypreal(Q) &
    83                                {n::nat. X n < Y n} \<in> FreeUltrafilterNat"
    84   hypreal_le_def:
    85   "P <= (Q::hypreal) == ~(Q < P)"
    86 
    87   hrabs_def:  "abs (r::hypreal) == (if 0 \<le> r then r else -r)"
    88 
    89 
    90 subsection{*The Set of Naturals is not Finite*}
    91 
    92 (*** based on James' proof that the set of naturals is not finite ***)
    93 lemma finite_exhausts [rule_format]:
    94      "finite (A::nat set) --> (\<exists>n. \<forall>m. Suc (n + m) \<notin> A)"
    95 apply (rule impI)
    96 apply (erule_tac F = A in finite_induct)
    97 apply (blast, erule exE)
    98 apply (rule_tac x = "n + x" in exI)
    99 apply (rule allI, erule_tac x = "x + m" in allE)
   100 apply (auto simp add: add_ac)
   101 done
   102 
   103 lemma finite_not_covers [rule_format (no_asm)]:
   104      "finite (A :: nat set) --> (\<exists>n. n \<notin>A)"
   105 by (rule impI, drule finite_exhausts, blast)
   106 
   107 lemma not_finite_nat: "~ finite(UNIV:: nat set)"
   108 by (fast dest!: finite_exhausts)
   109 
   110 
   111 subsection{*Existence of Free Ultrafilter over the Naturals*}
   112 
   113 text{*Also, proof of various properties of @{term FreeUltrafilterNat}: 
   114 an arbitrary free ultrafilter*}
   115 
   116 lemma FreeUltrafilterNat_Ex: "\<exists>U. U: FreeUltrafilter (UNIV::nat set)"
   117 by (rule not_finite_nat [THEN FreeUltrafilter_Ex])
   118 
   119 lemma FreeUltrafilterNat_mem [simp]: 
   120      "FreeUltrafilterNat: FreeUltrafilter(UNIV:: nat set)"
   121 apply (unfold FreeUltrafilterNat_def)
   122 apply (rule FreeUltrafilterNat_Ex [THEN exE])
   123 apply (rule someI2, assumption+)
   124 done
   125 
   126 lemma FreeUltrafilterNat_finite: "finite x ==> x \<notin> FreeUltrafilterNat"
   127 apply (unfold FreeUltrafilterNat_def)
   128 apply (rule FreeUltrafilterNat_Ex [THEN exE])
   129 apply (rule someI2, assumption)
   130 apply (blast dest: mem_FreeUltrafiltersetD1)
   131 done
   132 
   133 lemma FreeUltrafilterNat_not_finite: "x: FreeUltrafilterNat ==> ~ finite x"
   134 by (blast dest: FreeUltrafilterNat_finite)
   135 
   136 lemma FreeUltrafilterNat_empty [simp]: "{} \<notin> FreeUltrafilterNat"
   137 apply (unfold FreeUltrafilterNat_def)
   138 apply (rule FreeUltrafilterNat_Ex [THEN exE])
   139 apply (rule someI2, assumption)
   140 apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter 
   141                    Filter_empty_not_mem)
   142 done
   143 
   144 lemma FreeUltrafilterNat_Int:
   145      "[| X: FreeUltrafilterNat;  Y: FreeUltrafilterNat |]   
   146       ==> X Int Y \<in> FreeUltrafilterNat"
   147 apply (cut_tac FreeUltrafilterNat_mem)
   148 apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD1)
   149 done
   150 
   151 lemma FreeUltrafilterNat_subset:
   152      "[| X: FreeUltrafilterNat;  X <= Y |]  
   153       ==> Y \<in> FreeUltrafilterNat"
   154 apply (cut_tac FreeUltrafilterNat_mem)
   155 apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD2)
   156 done
   157 
   158 lemma FreeUltrafilterNat_Compl:
   159      "X: FreeUltrafilterNat ==> -X \<notin> FreeUltrafilterNat"
   160 apply safe
   161 apply (drule FreeUltrafilterNat_Int, assumption, auto)
   162 done
   163 
   164 lemma FreeUltrafilterNat_Compl_mem:
   165      "X\<notin> FreeUltrafilterNat ==> -X \<in> FreeUltrafilterNat"
   166 apply (cut_tac FreeUltrafilterNat_mem [THEN FreeUltrafilter_iff [THEN iffD1]])
   167 apply (safe, drule_tac x = X in bspec)
   168 apply (auto simp add: UNIV_diff_Compl)
   169 done
   170 
   171 lemma FreeUltrafilterNat_Compl_iff1:
   172      "(X \<notin> FreeUltrafilterNat) = (-X: FreeUltrafilterNat)"
   173 by (blast dest: FreeUltrafilterNat_Compl FreeUltrafilterNat_Compl_mem)
   174 
   175 lemma FreeUltrafilterNat_Compl_iff2:
   176      "(X: FreeUltrafilterNat) = (-X \<notin> FreeUltrafilterNat)"
   177 by (auto simp add: FreeUltrafilterNat_Compl_iff1 [symmetric])
   178 
   179 lemma FreeUltrafilterNat_UNIV [simp]: "(UNIV::nat set) \<in> FreeUltrafilterNat"
   180 by (rule FreeUltrafilterNat_mem [THEN FreeUltrafilter_Ultrafilter, THEN Ultrafilter_Filter, THEN mem_FiltersetD4])
   181 
   182 lemma FreeUltrafilterNat_Nat_set [simp]: "UNIV \<in> FreeUltrafilterNat"
   183 by auto
   184 
   185 lemma FreeUltrafilterNat_Nat_set_refl [intro]:
   186      "{n. P(n) = P(n)} \<in> FreeUltrafilterNat"
   187 by simp
   188 
   189 lemma FreeUltrafilterNat_P: "{n::nat. P} \<in> FreeUltrafilterNat ==> P"
   190 by (rule ccontr, simp)
   191 
   192 lemma FreeUltrafilterNat_Ex_P: "{n. P(n)} \<in> FreeUltrafilterNat ==> \<exists>n. P(n)"
   193 by (rule ccontr, simp)
   194 
   195 lemma FreeUltrafilterNat_all: "\<forall>n. P(n) ==> {n. P(n)} \<in> FreeUltrafilterNat"
   196 by (auto intro: FreeUltrafilterNat_Nat_set)
   197 
   198 
   199 text{*Define and use Ultrafilter tactics*}
   200 use "fuf.ML"
   201 
   202 method_setup fuf = {*
   203     Method.ctxt_args (fn ctxt =>
   204         Method.METHOD (fn facts =>
   205             fuf_tac (Classical.get_local_claset ctxt,
   206                      Simplifier.get_local_simpset ctxt) 1)) *}
   207     "free ultrafilter tactic"
   208 
   209 method_setup ultra = {*
   210     Method.ctxt_args (fn ctxt =>
   211         Method.METHOD (fn facts =>
   212             ultra_tac (Classical.get_local_claset ctxt,
   213                        Simplifier.get_local_simpset ctxt) 1)) *}
   214     "ultrafilter tactic"
   215 
   216 
   217 text{*One further property of our free ultrafilter*}
   218 lemma FreeUltrafilterNat_Un:
   219      "X Un Y: FreeUltrafilterNat  
   220       ==> X: FreeUltrafilterNat | Y: FreeUltrafilterNat"
   221 apply auto
   222 apply ultra
   223 done
   224 
   225 
   226 subsection{*Properties of @{term hyprel}*}
   227 
   228 text{*Proving that @{term hyprel} is an equivalence relation*}
   229 
   230 lemma hyprel_iff: "((X,Y): hyprel) = ({n. X n = Y n}: FreeUltrafilterNat)"
   231 by (unfold hyprel_def, fast)
   232 
   233 lemma hyprel_refl: "(x,x): hyprel"
   234 apply (unfold hyprel_def)
   235 apply (auto simp add: FreeUltrafilterNat_Nat_set)
   236 done
   237 
   238 lemma hyprel_sym [rule_format (no_asm)]: "(x,y): hyprel --> (y,x):hyprel"
   239 by (simp add: hyprel_def eq_commute)
   240 
   241 lemma hyprel_trans: 
   242       "[|(x,y): hyprel; (y,z):hyprel|] ==> (x,z):hyprel"
   243 apply (unfold hyprel_def, auto, ultra)
   244 done
   245 
   246 lemma equiv_hyprel: "equiv UNIV hyprel"
   247 apply (simp add: equiv_def refl_def sym_def trans_def hyprel_refl)
   248 apply (blast intro: hyprel_sym hyprel_trans) 
   249 done
   250 
   251 (* (hyprel `` {x} = hyprel `` {y}) = ((x,y) \<in> hyprel) *)
   252 lemmas equiv_hyprel_iff =
   253     eq_equiv_class_iff [OF equiv_hyprel UNIV_I UNIV_I, simp] 
   254 
   255 lemma hyprel_in_hypreal [simp]: "hyprel``{x}:hypreal"
   256 by (unfold hypreal_def hyprel_def quotient_def, blast)
   257 
   258 lemma inj_on_Abs_hypreal: "inj_on Abs_hypreal hypreal"
   259 apply (rule inj_on_inverseI)
   260 apply (erule Abs_hypreal_inverse)
   261 done
   262 
   263 declare inj_on_Abs_hypreal [THEN inj_on_iff, simp] 
   264         Abs_hypreal_inverse [simp]
   265 
   266 declare equiv_hyprel [THEN eq_equiv_class_iff, simp]
   267 
   268 declare hyprel_iff [iff]
   269 
   270 lemmas eq_hyprelD = eq_equiv_class [OF _ equiv_hyprel]
   271 
   272 lemma inj_Rep_hypreal: "inj(Rep_hypreal)"
   273 apply (rule inj_on_inverseI)
   274 apply (rule Rep_hypreal_inverse)
   275 done
   276 
   277 lemma lemma_hyprel_refl [simp]: "x \<in> hyprel `` {x}"
   278 apply (unfold hyprel_def, safe)
   279 apply (auto intro!: FreeUltrafilterNat_Nat_set)
   280 done
   281 
   282 lemma hypreal_empty_not_mem [simp]: "{} \<notin> hypreal"
   283 apply (unfold hypreal_def)
   284 apply (auto elim!: quotientE equalityCE)
   285 done
   286 
   287 lemma Rep_hypreal_nonempty [simp]: "Rep_hypreal x \<noteq> {}"
   288 by (cut_tac x = x in Rep_hypreal, auto)
   289 
   290 
   291 subsection{*@{term hypreal_of_real}: 
   292             the Injection from @{typ real} to @{typ hypreal}*}
   293 
   294 lemma inj_hypreal_of_real: "inj(hypreal_of_real)"
   295 apply (rule inj_onI)
   296 apply (unfold hypreal_of_real_def)
   297 apply (drule inj_on_Abs_hypreal [THEN inj_onD])
   298 apply (rule hyprel_in_hypreal)+
   299 apply (drule eq_equiv_class)
   300 apply (rule equiv_hyprel)
   301 apply (simp_all add: split: split_if_asm) 
   302 done
   303 
   304 lemma eq_Abs_hypreal:
   305     "(!!x y. z = Abs_hypreal(hyprel``{x}) ==> P) ==> P"
   306 apply (rule_tac x1=z in Rep_hypreal [unfolded hypreal_def, THEN quotientE])
   307 apply (drule_tac f = Abs_hypreal in arg_cong)
   308 apply (force simp add: Rep_hypreal_inverse)
   309 done
   310 
   311 
   312 subsection{*Hyperreal Addition*}
   313 
   314 lemma hypreal_add_congruent2: 
   315     "congruent2 hyprel (%X Y. hyprel``{%n. X n + Y n})"
   316 apply (unfold congruent2_def, auto, ultra)
   317 done
   318 
   319 lemma hypreal_add: 
   320   "Abs_hypreal(hyprel``{%n. X n}) + Abs_hypreal(hyprel``{%n. Y n}) =  
   321    Abs_hypreal(hyprel``{%n. X n + Y n})"
   322 apply (unfold hypreal_add_def)
   323 apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_add_congruent2])
   324 done
   325 
   326 lemma hypreal_add_commute: "(z::hypreal) + w = w + z"
   327 apply (rule_tac z = z in eq_Abs_hypreal)
   328 apply (rule_tac z = w in eq_Abs_hypreal)
   329 apply (simp add: real_add_ac hypreal_add)
   330 done
   331 
   332 lemma hypreal_add_assoc: "((z1::hypreal) + z2) + z3 = z1 + (z2 + z3)"
   333 apply (rule_tac z = z1 in eq_Abs_hypreal)
   334 apply (rule_tac z = z2 in eq_Abs_hypreal)
   335 apply (rule_tac z = z3 in eq_Abs_hypreal)
   336 apply (simp add: hypreal_add real_add_assoc)
   337 done
   338 
   339 lemma hypreal_add_zero_left: "(0::hypreal) + z = z"
   340 apply (unfold hypreal_zero_def)
   341 apply (rule_tac z = z in eq_Abs_hypreal)
   342 apply (simp add: hypreal_add)
   343 done
   344 
   345 instance hypreal :: plus_ac0
   346   by (intro_classes,
   347       (assumption | 
   348        rule hypreal_add_commute hypreal_add_assoc hypreal_add_zero_left)+)
   349 
   350 lemma hypreal_add_zero_right [simp]: "z + (0::hypreal) = z"
   351 by (simp add: hypreal_add_zero_left hypreal_add_commute)
   352 
   353 
   354 subsection{*Additive inverse on @{typ hypreal}*}
   355 
   356 lemma hypreal_minus_congruent: 
   357   "congruent hyprel (%X. hyprel``{%n. - (X n)})"
   358 by (force simp add: congruent_def)
   359 
   360 lemma hypreal_minus: 
   361    "- (Abs_hypreal(hyprel``{%n. X n})) = Abs_hypreal(hyprel `` {%n. -(X n)})"
   362 apply (unfold hypreal_minus_def)
   363 apply (rule_tac f = Abs_hypreal in arg_cong)
   364 apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] 
   365                UN_equiv_class [OF equiv_hyprel hypreal_minus_congruent])
   366 done
   367 
   368 lemma hypreal_diff:
   369      "Abs_hypreal(hyprel``{%n. X n}) - Abs_hypreal(hyprel``{%n. Y n}) =  
   370       Abs_hypreal(hyprel``{%n. X n - Y n})"
   371 apply (simp add: hypreal_diff_def hypreal_minus hypreal_add)
   372 done
   373 
   374 lemma hypreal_add_minus [simp]: "z + -z = (0::hypreal)"
   375 apply (unfold hypreal_zero_def)
   376 apply (rule_tac z = z in eq_Abs_hypreal)
   377 apply (simp add: hypreal_minus hypreal_add)
   378 done
   379 
   380 lemma hypreal_add_minus_left: "-z + z = (0::hypreal)"
   381 by (simp add: hypreal_add_commute hypreal_add_minus)
   382 
   383 
   384 subsection{*Hyperreal Multiplication*}
   385 
   386 lemma hypreal_mult_congruent2: 
   387     "congruent2 hyprel (%X Y. hyprel``{%n. X n * Y n})"
   388 apply (unfold congruent2_def, auto, ultra)
   389 done
   390 
   391 lemma hypreal_mult: 
   392   "Abs_hypreal(hyprel``{%n. X n}) * Abs_hypreal(hyprel``{%n. Y n}) =  
   393    Abs_hypreal(hyprel``{%n. X n * Y n})"
   394 apply (unfold hypreal_mult_def)
   395 apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_mult_congruent2])
   396 done
   397 
   398 lemma hypreal_mult_commute: "(z::hypreal) * w = w * z"
   399 apply (rule_tac z = z in eq_Abs_hypreal)
   400 apply (rule_tac z = w in eq_Abs_hypreal)
   401 apply (simp add: hypreal_mult mult_ac)
   402 done
   403 
   404 lemma hypreal_mult_assoc: "((z1::hypreal) * z2) * z3 = z1 * (z2 * z3)"
   405 apply (rule_tac z = z1 in eq_Abs_hypreal)
   406 apply (rule_tac z = z2 in eq_Abs_hypreal)
   407 apply (rule_tac z = z3 in eq_Abs_hypreal)
   408 apply (simp add: hypreal_mult mult_assoc)
   409 done
   410 
   411 lemma hypreal_mult_1: "(1::hypreal) * z = z"
   412 apply (unfold hypreal_one_def)
   413 apply (rule_tac z = z in eq_Abs_hypreal)
   414 apply (simp add: hypreal_mult)
   415 done
   416 
   417 lemma hypreal_add_mult_distrib:
   418      "((z1::hypreal) + z2) * w = (z1 * w) + (z2 * w)"
   419 apply (rule_tac z = z1 in eq_Abs_hypreal)
   420 apply (rule_tac z = z2 in eq_Abs_hypreal)
   421 apply (rule_tac z = w in eq_Abs_hypreal)
   422 apply (simp add: hypreal_mult hypreal_add real_add_mult_distrib)
   423 done
   424 
   425 text{*one and zero are distinct*}
   426 lemma hypreal_zero_not_eq_one: "0 \<noteq> (1::hypreal)"
   427 apply (unfold hypreal_zero_def hypreal_one_def)
   428 apply (auto simp add: real_zero_not_eq_one)
   429 done
   430 
   431 
   432 subsection{*Multiplicative Inverse on @{typ hypreal} *}
   433 
   434 lemma hypreal_inverse_congruent: 
   435   "congruent hyprel (%X. hyprel``{%n. if X n = 0 then 0 else inverse(X n)})"
   436 apply (unfold congruent_def)
   437 apply (auto, ultra)
   438 done
   439 
   440 lemma hypreal_inverse: 
   441       "inverse (Abs_hypreal(hyprel``{%n. X n})) =  
   442        Abs_hypreal(hyprel `` {%n. if X n = 0 then 0 else inverse(X n)})"
   443 apply (unfold hypreal_inverse_def)
   444 apply (rule_tac f = Abs_hypreal in arg_cong)
   445 apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] 
   446            UN_equiv_class [OF equiv_hyprel hypreal_inverse_congruent])
   447 done
   448 
   449 lemma hypreal_mult_inverse: 
   450      "x \<noteq> 0 ==> x*inverse(x) = (1::hypreal)"
   451 apply (unfold hypreal_one_def hypreal_zero_def)
   452 apply (rule_tac z = x in eq_Abs_hypreal)
   453 apply (simp add: hypreal_inverse hypreal_mult)
   454 apply (drule FreeUltrafilterNat_Compl_mem)
   455 apply (blast intro!: real_mult_inv_right FreeUltrafilterNat_subset)
   456 done
   457 
   458 lemma hypreal_mult_inverse_left:
   459      "x \<noteq> 0 ==> inverse(x)*x = (1::hypreal)"
   460 by (simp add: hypreal_mult_inverse hypreal_mult_commute)
   461 
   462 instance hypreal :: field
   463 proof
   464   fix x y z :: hypreal
   465   show "(x + y) + z = x + (y + z)" by (rule hypreal_add_assoc)
   466   show "x + y = y + x" by (rule hypreal_add_commute)
   467   show "0 + x = x" by simp
   468   show "- x + x = 0" by (simp add: hypreal_add_minus_left)
   469   show "x - y = x + (-y)" by (simp add: hypreal_diff_def)
   470   show "(x * y) * z = x * (y * z)" by (rule hypreal_mult_assoc)
   471   show "x * y = y * x" by (rule hypreal_mult_commute)
   472   show "1 * x = x" by (simp add: hypreal_mult_1)
   473   show "(x + y) * z = x * z + y * z" by (simp add: hypreal_add_mult_distrib)
   474   show "0 \<noteq> (1::hypreal)" by (rule hypreal_zero_not_eq_one)
   475   show "x \<noteq> 0 ==> inverse x * x = 1" by (simp add: hypreal_mult_inverse_left)
   476   show "y \<noteq> 0 ==> x / y = x * inverse y" by (simp add: hypreal_divide_def)
   477 qed
   478 
   479 (*Pull negations out*)
   480 declare minus_mult_right [symmetric, simp] 
   481         minus_mult_left [symmetric, simp]
   482 
   483 
   484 lemma HYPREAL_INVERSE_ZERO: "inverse 0 = (0::hypreal)"
   485 by (simp add: hypreal_inverse hypreal_zero_def)
   486 
   487 lemma HYPREAL_DIVISION_BY_ZERO: "a / (0::hypreal) = 0"
   488 by (simp add: hypreal_divide_def HYPREAL_INVERSE_ZERO 
   489               hypreal_mult_commute [of a])
   490 
   491 instance hypreal :: division_by_zero
   492 proof
   493   fix x :: hypreal
   494   show "inverse 0 = (0::hypreal)" by (rule HYPREAL_INVERSE_ZERO)
   495   show "x/0 = 0" by (rule HYPREAL_DIVISION_BY_ZERO) 
   496 qed
   497 
   498 
   499 subsection{*Theorems for Ordering*}
   500 
   501 text{*TODO: define @{text "\<le>"} as the primitive concept and quickly 
   502 establish membership in class @{text linorder}. Then proofs could be
   503 simplified, since properties of @{text "<"} would be generic.*}
   504 
   505 text{*TODO: The following theorem should be used througout the proofs
   506   as it probably makes many of them more straightforward.*}
   507 lemma hypreal_less: 
   508       "(Abs_hypreal(hyprel``{%n. X n}) < Abs_hypreal(hyprel``{%n. Y n})) =  
   509        ({n. X n < Y n} \<in> FreeUltrafilterNat)"
   510 apply (unfold hypreal_less_def)
   511 apply (auto intro!: lemma_hyprel_refl, ultra)
   512 done
   513 
   514 lemma hypreal_less_not_refl: "~ (R::hypreal) < R"
   515 apply (rule_tac z = R in eq_Abs_hypreal)
   516 apply (auto simp add: hypreal_less_def, ultra)
   517 done
   518 
   519 lemmas hypreal_less_irrefl = hypreal_less_not_refl [THEN notE, standard]
   520 declare hypreal_less_irrefl [elim!]
   521 
   522 lemma hypreal_not_refl2: "!!(x::hypreal). x < y ==> x \<noteq> y"
   523 by (auto simp add: hypreal_less_not_refl)
   524 
   525 lemma hypreal_less_trans: "!!(R1::hypreal). [| R1 < R2; R2 < R3 |] ==> R1 < R3"
   526 apply (rule_tac z = R1 in eq_Abs_hypreal)
   527 apply (rule_tac z = R2 in eq_Abs_hypreal)
   528 apply (rule_tac z = R3 in eq_Abs_hypreal)
   529 apply (auto intro!: exI simp add: hypreal_less_def, ultra)
   530 done
   531 
   532 lemma hypreal_less_asym: "!! (R1::hypreal). [| R1 < R2; R2 < R1 |] ==> P"
   533 apply (drule hypreal_less_trans, assumption)
   534 apply (simp add: hypreal_less_not_refl)
   535 done
   536 
   537 
   538 subsection{*Trichotomy: the hyperreals are Linearly Ordered*}
   539 
   540 lemma lemma_hyprel_0_mem: "\<exists>x. x: hyprel `` {%n. 0}"
   541 apply (unfold hyprel_def)
   542 apply (rule_tac x = "%n. 0" in exI, safe)
   543 apply (auto intro!: FreeUltrafilterNat_Nat_set)
   544 done
   545 
   546 lemma hypreal_trichotomy: "0 <  x | x = 0 | x < (0::hypreal)"
   547 apply (unfold hypreal_zero_def)
   548 apply (rule_tac z = x in eq_Abs_hypreal)
   549 apply (auto simp add: hypreal_less_def)
   550 apply (cut_tac lemma_hyprel_0_mem, erule exE)
   551 apply (drule_tac x = xa in spec)
   552 apply (drule_tac x = x in spec)
   553 apply (cut_tac x = x in lemma_hyprel_refl, auto)
   554 apply (drule_tac x = x in spec)
   555 apply (drule_tac x = xa in spec, auto, ultra)
   556 done
   557 
   558 lemma hypreal_trichotomyE:
   559      "[| (0::hypreal) < x ==> P;  
   560          x = 0 ==> P;  
   561          x < 0 ==> P |] ==> P"
   562 apply (insert hypreal_trichotomy [of x], blast) 
   563 done
   564 
   565 lemma hypreal_less_minus_iff: "((x::hypreal) < y) = (0 < y + -x)"
   566 apply (rule_tac z = x in eq_Abs_hypreal)
   567 apply (rule_tac z = y in eq_Abs_hypreal)
   568 apply (auto simp add: hypreal_add hypreal_zero_def hypreal_minus hypreal_less)
   569 done
   570 
   571 lemma hypreal_less_minus_iff2: "((x::hypreal) < y) = (x + -y < 0)"
   572 apply (rule_tac z = x in eq_Abs_hypreal)
   573 apply (rule_tac z = y in eq_Abs_hypreal)
   574 apply (auto simp add: hypreal_add hypreal_zero_def hypreal_minus hypreal_less)
   575 done
   576 
   577 lemma hypreal_eq_minus_iff2: "((x::hypreal) = y) = (0 = y + - x)"
   578 apply auto
   579 apply (rule Ring_and_Field.add_right_cancel [of _ "-x", THEN iffD1], auto)
   580 done
   581 
   582 lemma hypreal_linear: "(x::hypreal) < y | x = y | y < x"
   583 apply (subst hypreal_eq_minus_iff2)
   584 apply (rule_tac x1 = x in hypreal_less_minus_iff [THEN ssubst])
   585 apply (rule_tac x1 = y in hypreal_less_minus_iff2 [THEN ssubst])
   586 apply (rule hypreal_trichotomyE, auto)
   587 done
   588 
   589 lemma hypreal_neq_iff: "((w::hypreal) \<noteq> z) = (w<z | z<w)"
   590 by (cut_tac hypreal_linear, blast)
   591 
   592 lemma hypreal_linear_less2: "!!(x::hypreal). [| x < y ==> P;  x = y ==> P;  
   593            y < x ==> P |] ==> P"
   594 apply (cut_tac x = x and y = y in hypreal_linear, auto)
   595 done
   596 
   597 
   598 subsection{*Properties of The @{text "\<le>"} Relation*}
   599 
   600 lemma hypreal_le: 
   601       "(Abs_hypreal(hyprel``{%n. X n}) <=  
   602             Abs_hypreal(hyprel``{%n. Y n})) =  
   603        ({n. X n <= Y n} \<in> FreeUltrafilterNat)"
   604 apply (unfold hypreal_le_def real_le_def)
   605 apply (auto simp add: hypreal_less)
   606 apply (ultra+)
   607 done
   608 
   609 lemma hypreal_le_imp_less_or_eq: "!!(x::hypreal). x <= y ==> x < y | x = y"
   610 apply (unfold hypreal_le_def)
   611 apply (cut_tac hypreal_linear)
   612 apply (fast elim: hypreal_less_irrefl hypreal_less_asym)
   613 done
   614 
   615 lemma hypreal_less_or_eq_imp_le: "z<w | z=w ==> z <=(w::hypreal)"
   616 apply (unfold hypreal_le_def)
   617 apply (cut_tac hypreal_linear)
   618 apply (fast elim: hypreal_less_irrefl hypreal_less_asym)
   619 done
   620 
   621 lemma hypreal_le_eq_less_or_eq: "(x <= (y::hypreal)) = (x < y | x=y)"
   622 by (blast intro!: hypreal_less_or_eq_imp_le dest: hypreal_le_imp_less_or_eq) 
   623 
   624 lemmas hypreal_le_less = hypreal_le_eq_less_or_eq
   625 
   626 lemma hypreal_le_refl: "w <= (w::hypreal)"
   627 by (simp add: hypreal_le_eq_less_or_eq)
   628 
   629 (* Axiom 'linorder_linear' of class 'linorder': *)
   630 lemma hypreal_le_linear: "(z::hypreal) <= w | w <= z"
   631 apply (simp add: hypreal_le_less)
   632 apply (cut_tac hypreal_linear, blast)
   633 done
   634 
   635 lemma hypreal_le_trans: "[| i <= j; j <= k |] ==> i <= (k::hypreal)"
   636 apply (drule hypreal_le_imp_less_or_eq) 
   637 apply (drule hypreal_le_imp_less_or_eq) 
   638 apply (rule hypreal_less_or_eq_imp_le) 
   639 apply (blast intro: hypreal_less_trans) 
   640 done
   641 
   642 lemma hypreal_le_anti_sym: "[| z <= w; w <= z |] ==> z = (w::hypreal)"
   643 apply (drule hypreal_le_imp_less_or_eq) 
   644 apply (drule hypreal_le_imp_less_or_eq) 
   645 apply (fast elim: hypreal_less_irrefl hypreal_less_asym)
   646 done
   647 
   648 (* Axiom 'order_less_le' of class 'order': *)
   649 lemma hypreal_less_le: "((w::hypreal) < z) = (w <= z & w \<noteq> z)"
   650 apply (simp add: hypreal_le_def hypreal_neq_iff)
   651 apply (blast intro: hypreal_less_asym)
   652 done
   653 
   654 instance hypreal :: order
   655   by (intro_classes,
   656       (assumption | 
   657        rule hypreal_le_refl hypreal_le_trans hypreal_le_anti_sym
   658             hypreal_less_le)+)
   659 
   660 instance hypreal :: linorder 
   661   by (intro_classes, rule hypreal_le_linear)
   662 
   663 
   664 lemma hypreal_add_less_mono1: "(A::hypreal) < B ==> A + C < B + C"
   665 apply (rule_tac z = A in eq_Abs_hypreal)
   666 apply (rule_tac z = B in eq_Abs_hypreal)
   667 apply (rule_tac z = C in eq_Abs_hypreal)
   668 apply (auto intro!: exI simp add: hypreal_less_def hypreal_add, ultra)
   669 done
   670 
   671 lemma hypreal_mult_order: "[| 0 < x; 0 < y |] ==> (0::hypreal) < x * y"
   672 apply (unfold hypreal_zero_def)
   673 apply (rule_tac z = x in eq_Abs_hypreal)
   674 apply (rule_tac z = y in eq_Abs_hypreal)
   675 apply (auto intro!: exI simp add: hypreal_less_def hypreal_mult, ultra)
   676 apply (auto intro: real_mult_order)
   677 done
   678 
   679 lemma hypreal_add_left_le_mono1: "(q1::hypreal) \<le> q2  ==> x + q1 \<le> x + q2"
   680 apply (drule order_le_imp_less_or_eq)
   681 apply (auto intro: order_less_imp_le hypreal_add_less_mono1 simp add: hypreal_add_commute)
   682 done
   683 
   684 lemma hypreal_mult_less_mono1: "[| (0::hypreal) < z; x < y |] ==> x*z < y*z"
   685 apply (rotate_tac 1)
   686 apply (drule hypreal_less_minus_iff [THEN iffD1])
   687 apply (rule hypreal_less_minus_iff [THEN iffD2])
   688 apply (drule hypreal_mult_order, assumption)
   689 apply (simp add: right_distrib hypreal_mult_commute)
   690 done
   691 
   692 lemma hypreal_mult_less_mono2: "[| (0::hypreal)<z; x<y |] ==> z*x<z*y"
   693 apply (simp (no_asm_simp) add: hypreal_mult_commute hypreal_mult_less_mono1)
   694 done
   695 
   696 subsection{*The Hyperreals Form an Ordered Field*}
   697 
   698 instance hypreal :: ordered_field
   699 proof
   700   fix x y z :: hypreal
   701   show "x \<le> y ==> z + x \<le> z + y" by (rule hypreal_add_left_le_mono1)
   702   show "x < y ==> 0 < z ==> z * x < z * y" by (simp add: hypreal_mult_less_mono2)
   703   show "\<bar>x\<bar> = (if x < 0 then -x else x)"
   704     by (auto dest: order_le_less_trans simp add: hrabs_def linorder_not_le)
   705 qed
   706 
   707 lemma hypreal_mult_1_right: "z * (1::hypreal) = z"
   708   by (rule Ring_and_Field.mult_1_right)
   709 
   710 lemma hypreal_mult_minus_1 [simp]: "(- (1::hypreal)) * z = -z"
   711 by (simp)
   712 
   713 lemma hypreal_mult_minus_1_right [simp]: "z * (- (1::hypreal)) = -z"
   714 by (subst hypreal_mult_commute, simp)
   715 
   716 (*Used ONCE: in NSA.ML*)
   717 lemma hypreal_minus_distrib1: "-(y + -(x::hypreal)) = x + -y"
   718 by (simp add: hypreal_add_commute)
   719 
   720 (*Used ONCE: in Lim.ML*)
   721 lemma hypreal_eq_minus_iff3: "(x = y + z) = (x + -z = (y::hypreal))"
   722 by (auto simp add: hypreal_add_assoc)
   723 
   724 lemma hypreal_eq_minus_iff: "((x::hypreal) = y) = (x + - y = 0)"
   725 apply auto
   726 apply (rule Ring_and_Field.add_right_cancel [of _ "-y", THEN iffD1], auto)
   727 done
   728 
   729 (*Used 3 TIMES: in Lim.ML*)
   730 lemma hypreal_not_eq_minus_iff: "(x \<noteq> a) = (x + -a \<noteq> (0::hypreal))"
   731 by (auto dest: hypreal_eq_minus_iff [THEN iffD2])
   732 
   733 lemma hypreal_mult_left_cancel: "(c::hypreal) \<noteq> 0 ==> (c*a=c*b) = (a=b)"
   734 apply auto
   735 done
   736     
   737 lemma hypreal_mult_right_cancel: "(c::hypreal) \<noteq> 0 ==> (a*c=b*c) = (a=b)"
   738 apply auto
   739 done
   740 
   741 lemma hypreal_inverse_not_zero: "x \<noteq> 0 ==> inverse (x::hypreal) \<noteq> 0"
   742   by (rule Ring_and_Field.nonzero_imp_inverse_nonzero)
   743 
   744 lemma hypreal_mult_not_0: "[| x \<noteq> 0; y \<noteq> 0 |] ==> x * y \<noteq> (0::hypreal)"
   745 by simp
   746 
   747 lemma hypreal_minus_inverse: "inverse(-x) = -inverse(x::hypreal)"
   748   by (rule Ring_and_Field.inverse_minus_eq)
   749 
   750 lemma hypreal_inverse_distrib: "inverse(x*y) = inverse(x)*inverse(y::hypreal)"
   751   by (rule Ring_and_Field.inverse_mult_distrib)
   752 
   753 
   754 subsection{* Division lemmas *}
   755 
   756 lemma hypreal_divide_one: "x/(1::hypreal) = x"
   757 by (simp add: hypreal_divide_def)
   758 
   759 
   760 (** As with multiplication, pull minus signs OUT of the / operator **)
   761 
   762 lemma hypreal_add_divide_distrib: "(x+y)/(z::hypreal) = x/z + y/z"
   763   by (rule Ring_and_Field.add_divide_distrib)
   764 
   765 lemma hypreal_inverse_add:
   766      "[|(x::hypreal) \<noteq> 0;  y \<noteq> 0 |]   
   767       ==> inverse(x) + inverse(y) = (x + y)*inverse(x*y)"
   768 by (simp add: Ring_and_Field.inverse_add mult_assoc)
   769 
   770 
   771 subsection{*@{term hypreal_of_real} Preserves Field and Order Properties*}
   772 
   773 lemma hypreal_of_real_add [simp]: 
   774      "hypreal_of_real (z1 + z2) = hypreal_of_real z1 + hypreal_of_real z2"
   775 apply (unfold hypreal_of_real_def)
   776 apply (simp add: hypreal_add left_distrib)
   777 done
   778 
   779 lemma hypreal_of_real_mult [simp]: 
   780      "hypreal_of_real (z1 * z2) = hypreal_of_real z1 * hypreal_of_real z2"
   781 apply (unfold hypreal_of_real_def)
   782 apply (simp add: hypreal_mult right_distrib)
   783 done
   784 
   785 lemma hypreal_of_real_less_iff [simp]: 
   786      "(hypreal_of_real z1 <  hypreal_of_real z2) = (z1 < z2)"
   787 apply (unfold hypreal_less_def hypreal_of_real_def, auto)
   788 apply (rule_tac [2] x = "%n. z1" in exI, safe)
   789 apply (rule_tac [3] x = "%n. z2" in exI, auto)
   790 apply (rule FreeUltrafilterNat_P, ultra)
   791 done
   792 
   793 lemma hypreal_of_real_le_iff [simp]: 
   794      "(hypreal_of_real z1 <= hypreal_of_real z2) = (z1 <= z2)"
   795 apply (unfold hypreal_le_def real_le_def, auto)
   796 done
   797 
   798 lemma hypreal_of_real_eq_iff [simp]:
   799      "(hypreal_of_real z1 = hypreal_of_real z2) = (z1 = z2)"
   800 by (force intro: order_antisym hypreal_of_real_le_iff [THEN iffD1])
   801 
   802 lemma hypreal_of_real_minus [simp]:
   803      "hypreal_of_real (-r) = - hypreal_of_real  r"
   804 apply (unfold hypreal_of_real_def)
   805 apply (auto simp add: hypreal_minus)
   806 done
   807 
   808 lemma hypreal_of_real_one [simp]: "hypreal_of_real 1 = (1::hypreal)"
   809 by (unfold hypreal_of_real_def hypreal_one_def, simp)
   810 
   811 lemma hypreal_of_real_zero [simp]: "hypreal_of_real 0 = 0"
   812 by (unfold hypreal_of_real_def hypreal_zero_def, simp)
   813 
   814 lemma hypreal_of_real_zero_iff: "(hypreal_of_real r = 0) = (r = 0)"
   815 by (auto intro: FreeUltrafilterNat_P simp add: hypreal_of_real_def hypreal_zero_def FreeUltrafilterNat_Nat_set)
   816 
   817 lemma hypreal_of_real_inverse [simp]:
   818      "hypreal_of_real (inverse r) = inverse (hypreal_of_real r)"
   819 apply (case_tac "r=0")
   820 apply (simp add: DIVISION_BY_ZERO INVERSE_ZERO HYPREAL_INVERSE_ZERO)
   821 apply (rule_tac c1 = "hypreal_of_real r" in hypreal_mult_left_cancel [THEN iffD1])
   822 apply (auto simp add: hypreal_of_real_zero_iff hypreal_of_real_mult [symmetric])
   823 done
   824 
   825 lemma hypreal_of_real_divide [simp]:
   826      "hypreal_of_real (z1 / z2) = hypreal_of_real z1 / hypreal_of_real z2"
   827 by (simp add: hypreal_divide_def real_divide_def)
   828 
   829 
   830 subsection{*Misc Others*}
   831 
   832 lemma hypreal_zero_num: "0 = Abs_hypreal (hyprel `` {%n. 0})"
   833 by (simp add: hypreal_zero_def [THEN meta_eq_to_obj_eq, symmetric])
   834 
   835 lemma hypreal_one_num: "1 = Abs_hypreal (hyprel `` {%n. 1})"
   836 by (simp add: hypreal_one_def [THEN meta_eq_to_obj_eq, symmetric])
   837 
   838 lemma hypreal_omega_gt_zero [simp]: "0 < omega"
   839 apply (unfold omega_def)
   840 apply (auto simp add: hypreal_less hypreal_zero_num)
   841 done
   842 
   843 
   844 lemma hypreal_hrabs:
   845      "abs (Abs_hypreal (hyprel `` {X})) = 
   846       Abs_hypreal(hyprel `` {%n. abs (X n)})"
   847 apply (auto simp add: hrabs_def hypreal_zero_def hypreal_le hypreal_minus)
   848 apply (ultra, arith)+
   849 done
   850 
   851 ML
   852 {*
   853 val hrabs_def = thm "hrabs_def";
   854 val hypreal_hrabs = thm "hypreal_hrabs";
   855 
   856 val hypreal_zero_def = thm "hypreal_zero_def";
   857 val hypreal_one_def = thm "hypreal_one_def";
   858 val hypreal_minus_def = thm "hypreal_minus_def";
   859 val hypreal_diff_def = thm "hypreal_diff_def";
   860 val hypreal_inverse_def = thm "hypreal_inverse_def";
   861 val hypreal_divide_def = thm "hypreal_divide_def";
   862 val hypreal_of_real_def = thm "hypreal_of_real_def";
   863 val omega_def = thm "omega_def";
   864 val epsilon_def = thm "epsilon_def";
   865 val hypreal_add_def = thm "hypreal_add_def";
   866 val hypreal_mult_def = thm "hypreal_mult_def";
   867 val hypreal_less_def = thm "hypreal_less_def";
   868 val hypreal_le_def = thm "hypreal_le_def";
   869 
   870 val finite_exhausts = thm "finite_exhausts";
   871 val finite_not_covers = thm "finite_not_covers";
   872 val not_finite_nat = thm "not_finite_nat";
   873 val FreeUltrafilterNat_Ex = thm "FreeUltrafilterNat_Ex";
   874 val FreeUltrafilterNat_mem = thm "FreeUltrafilterNat_mem";
   875 val FreeUltrafilterNat_finite = thm "FreeUltrafilterNat_finite";
   876 val FreeUltrafilterNat_not_finite = thm "FreeUltrafilterNat_not_finite";
   877 val FreeUltrafilterNat_empty = thm "FreeUltrafilterNat_empty";
   878 val FreeUltrafilterNat_Int = thm "FreeUltrafilterNat_Int";
   879 val FreeUltrafilterNat_subset = thm "FreeUltrafilterNat_subset";
   880 val FreeUltrafilterNat_Compl = thm "FreeUltrafilterNat_Compl";
   881 val FreeUltrafilterNat_Compl_mem = thm "FreeUltrafilterNat_Compl_mem";
   882 val FreeUltrafilterNat_Compl_iff1 = thm "FreeUltrafilterNat_Compl_iff1";
   883 val FreeUltrafilterNat_Compl_iff2 = thm "FreeUltrafilterNat_Compl_iff2";
   884 val FreeUltrafilterNat_UNIV = thm "FreeUltrafilterNat_UNIV";
   885 val FreeUltrafilterNat_Nat_set = thm "FreeUltrafilterNat_Nat_set";
   886 val FreeUltrafilterNat_Nat_set_refl = thm "FreeUltrafilterNat_Nat_set_refl";
   887 val FreeUltrafilterNat_P = thm "FreeUltrafilterNat_P";
   888 val FreeUltrafilterNat_Ex_P = thm "FreeUltrafilterNat_Ex_P";
   889 val FreeUltrafilterNat_all = thm "FreeUltrafilterNat_all";
   890 val FreeUltrafilterNat_Un = thm "FreeUltrafilterNat_Un";
   891 val hyprel_iff = thm "hyprel_iff";
   892 val hyprel_refl = thm "hyprel_refl";
   893 val hyprel_sym = thm "hyprel_sym";
   894 val hyprel_trans = thm "hyprel_trans";
   895 val equiv_hyprel = thm "equiv_hyprel";
   896 val hyprel_in_hypreal = thm "hyprel_in_hypreal";
   897 val Abs_hypreal_inverse = thm "Abs_hypreal_inverse";
   898 val inj_on_Abs_hypreal = thm "inj_on_Abs_hypreal";
   899 val inj_Rep_hypreal = thm "inj_Rep_hypreal";
   900 val lemma_hyprel_refl = thm "lemma_hyprel_refl";
   901 val hypreal_empty_not_mem = thm "hypreal_empty_not_mem";
   902 val Rep_hypreal_nonempty = thm "Rep_hypreal_nonempty";
   903 val inj_hypreal_of_real = thm "inj_hypreal_of_real";
   904 val eq_Abs_hypreal = thm "eq_Abs_hypreal";
   905 val hypreal_minus_congruent = thm "hypreal_minus_congruent";
   906 val hypreal_minus = thm "hypreal_minus";
   907 val hypreal_add_congruent2 = thm "hypreal_add_congruent2";
   908 val hypreal_add = thm "hypreal_add";
   909 val hypreal_diff = thm "hypreal_diff";
   910 val hypreal_add_commute = thm "hypreal_add_commute";
   911 val hypreal_add_assoc = thm "hypreal_add_assoc";
   912 val hypreal_add_zero_left = thm "hypreal_add_zero_left";
   913 val hypreal_add_zero_right = thm "hypreal_add_zero_right";
   914 val hypreal_add_minus = thm "hypreal_add_minus";
   915 val hypreal_add_minus_left = thm "hypreal_add_minus_left";
   916 val hypreal_minus_distrib1 = thm "hypreal_minus_distrib1";
   917 val hypreal_mult_congruent2 = thm "hypreal_mult_congruent2";
   918 val hypreal_mult = thm "hypreal_mult";
   919 val hypreal_mult_commute = thm "hypreal_mult_commute";
   920 val hypreal_mult_assoc = thm "hypreal_mult_assoc";
   921 val hypreal_mult_1 = thm "hypreal_mult_1";
   922 val hypreal_mult_1_right = thm "hypreal_mult_1_right";
   923 val hypreal_mult_minus_1 = thm "hypreal_mult_minus_1";
   924 val hypreal_mult_minus_1_right = thm "hypreal_mult_minus_1_right";
   925 val hypreal_zero_not_eq_one = thm "hypreal_zero_not_eq_one";
   926 val hypreal_inverse_congruent = thm "hypreal_inverse_congruent";
   927 val hypreal_inverse = thm "hypreal_inverse";
   928 val HYPREAL_INVERSE_ZERO = thm "HYPREAL_INVERSE_ZERO";
   929 val HYPREAL_DIVISION_BY_ZERO = thm "HYPREAL_DIVISION_BY_ZERO";
   930 val hypreal_mult_inverse = thm "hypreal_mult_inverse";
   931 val hypreal_mult_inverse_left = thm "hypreal_mult_inverse_left";
   932 val hypreal_mult_left_cancel = thm "hypreal_mult_left_cancel";
   933 val hypreal_mult_right_cancel = thm "hypreal_mult_right_cancel";
   934 val hypreal_inverse_not_zero = thm "hypreal_inverse_not_zero";
   935 val hypreal_mult_not_0 = thm "hypreal_mult_not_0";
   936 val hypreal_minus_inverse = thm "hypreal_minus_inverse";
   937 val hypreal_inverse_distrib = thm "hypreal_inverse_distrib";
   938 val hypreal_less_not_refl = thm "hypreal_less_not_refl";
   939 val hypreal_less_irrefl = thm"hypreal_less_irrefl";
   940 val hypreal_not_refl2 = thm "hypreal_not_refl2";
   941 val hypreal_less_trans = thm "hypreal_less_trans";
   942 val hypreal_less_asym = thm "hypreal_less_asym";
   943 val hypreal_less = thm "hypreal_less";
   944 val hypreal_trichotomy = thm "hypreal_trichotomy";
   945 val hypreal_less_minus_iff = thm "hypreal_less_minus_iff";
   946 val hypreal_less_minus_iff2 = thm "hypreal_less_minus_iff2";
   947 val hypreal_eq_minus_iff = thm "hypreal_eq_minus_iff";
   948 val hypreal_eq_minus_iff2 = thm "hypreal_eq_minus_iff2";
   949 val hypreal_eq_minus_iff3 = thm "hypreal_eq_minus_iff3";
   950 val hypreal_not_eq_minus_iff = thm "hypreal_not_eq_minus_iff";
   951 val hypreal_linear = thm "hypreal_linear";
   952 val hypreal_neq_iff = thm "hypreal_neq_iff";
   953 val hypreal_linear_less2 = thm "hypreal_linear_less2";
   954 val hypreal_le = thm "hypreal_le";
   955 val hypreal_le_imp_less_or_eq = thm "hypreal_le_imp_less_or_eq";
   956 val hypreal_le_eq_less_or_eq = thm "hypreal_le_eq_less_or_eq";
   957 val hypreal_le_refl = thm "hypreal_le_refl";
   958 val hypreal_le_linear = thm "hypreal_le_linear";
   959 val hypreal_le_trans = thm "hypreal_le_trans";
   960 val hypreal_le_anti_sym = thm "hypreal_le_anti_sym";
   961 val hypreal_less_le = thm "hypreal_less_le";
   962 val hypreal_of_real_add = thm "hypreal_of_real_add";
   963 val hypreal_of_real_mult = thm "hypreal_of_real_mult";
   964 val hypreal_of_real_less_iff = thm "hypreal_of_real_less_iff";
   965 val hypreal_of_real_le_iff = thm "hypreal_of_real_le_iff";
   966 val hypreal_of_real_eq_iff = thm "hypreal_of_real_eq_iff";
   967 val hypreal_of_real_minus = thm "hypreal_of_real_minus";
   968 val hypreal_of_real_one = thm "hypreal_of_real_one";
   969 val hypreal_of_real_zero = thm "hypreal_of_real_zero";
   970 val hypreal_of_real_zero_iff = thm "hypreal_of_real_zero_iff";
   971 val hypreal_of_real_inverse = thm "hypreal_of_real_inverse";
   972 val hypreal_of_real_divide = thm "hypreal_of_real_divide";
   973 val hypreal_divide_one = thm "hypreal_divide_one";
   974 val hypreal_add_divide_distrib = thm "hypreal_add_divide_distrib";
   975 val hypreal_inverse_add = thm "hypreal_inverse_add";
   976 val hypreal_zero_num = thm "hypreal_zero_num";
   977 val hypreal_one_num = thm "hypreal_one_num";
   978 val hypreal_omega_gt_zero = thm "hypreal_omega_gt_zero";
   979 *}
   980 
   981 end