src/HOL/Hyperreal/HyperDef.thy
author kleing
Wed Apr 14 14:13:05 2004 +0200 (2004-04-14)
changeset 14565 c6dc17aab88a
parent 14477 cc61fd03e589
child 14658 b1293d0f8d5f
permissions -rw-r--r--
use more symbols in HTML output
paulson@10751
     1
(*  Title       : HOL/Real/Hyperreal/HyperDef.thy
paulson@10751
     2
    ID          : $Id$
paulson@10751
     3
    Author      : Jacques D. Fleuriot
paulson@10751
     4
    Copyright   : 1998  University of Cambridge
paulson@14468
     5
    Conversion to Isar and new proofs by Lawrence C Paulson, 2004
wenzelm@13487
     6
*)
paulson@10751
     7
paulson@14468
     8
header{*Construction of Hyperreals Using Ultrafilters*}
paulson@14468
     9
paulson@14299
    10
theory HyperDef = Filter + Real
paulson@14299
    11
files ("fuf.ML"):  (*Warning: file fuf.ML refers to the name Hyperdef!*)
paulson@10751
    12
paulson@10751
    13
paulson@10751
    14
constdefs
paulson@14299
    15
schirmer@14361
    16
  FreeUltrafilterNat   :: "nat set set"    ("\<U>")
paulson@14299
    17
    "FreeUltrafilterNat == (SOME U. U \<in> FreeUltrafilter (UNIV:: nat set))"
paulson@14299
    18
paulson@14299
    19
  hyprel :: "((nat=>real)*(nat=>real)) set"
paulson@14299
    20
    "hyprel == {p. \<exists>X Y. p = ((X::nat=>real),Y) &
paulson@10751
    21
                   {n::nat. X(n) = Y(n)}: FreeUltrafilterNat}"
paulson@10751
    22
paulson@14299
    23
typedef hypreal = "UNIV//hyprel" 
paulson@14299
    24
    by (auto simp add: quotient_def) 
paulson@10751
    25
paulson@14299
    26
instance hypreal :: ord ..
paulson@14299
    27
instance hypreal :: zero ..
paulson@14299
    28
instance hypreal :: one ..
paulson@14299
    29
instance hypreal :: plus ..
paulson@14299
    30
instance hypreal :: times ..
paulson@14299
    31
instance hypreal :: minus ..
paulson@14299
    32
instance hypreal :: inverse ..
paulson@10751
    33
paulson@10751
    34
paulson@14299
    35
defs (overloaded)
paulson@14299
    36
paulson@14299
    37
  hypreal_zero_def:
paulson@12018
    38
  "0 == Abs_hypreal(hyprel``{%n::nat. (0::real)})"
paulson@10751
    39
paulson@14299
    40
  hypreal_one_def:
paulson@12018
    41
  "1 == Abs_hypreal(hyprel``{%n::nat. (1::real)})"
paulson@10751
    42
paulson@14299
    43
  hypreal_minus_def:
paulson@14299
    44
  "- P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). hyprel``{%n::nat. - (X n)})"
paulson@10751
    45
paulson@14299
    46
  hypreal_diff_def:
paulson@10751
    47
  "x - y == x + -(y::hypreal)"
paulson@10751
    48
paulson@14299
    49
  hypreal_inverse_def:
paulson@14299
    50
  "inverse P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P).
paulson@12018
    51
                    hyprel``{%n. if X n = 0 then 0 else inverse (X n)})"
paulson@10751
    52
paulson@14299
    53
  hypreal_divide_def:
paulson@10751
    54
  "P / Q::hypreal == P * inverse Q"
wenzelm@13487
    55
paulson@10751
    56
constdefs
paulson@10751
    57
paulson@14299
    58
  hypreal_of_real  :: "real => hypreal"
nipkow@10834
    59
  "hypreal_of_real r         == Abs_hypreal(hyprel``{%n::nat. r})"
paulson@10751
    60
paulson@10919
    61
  omega   :: hypreal   (*an infinite number = [<1,2,3,...>] *)
paulson@10919
    62
  "omega == Abs_hypreal(hyprel``{%n::nat. real (Suc n)})"
wenzelm@13487
    63
paulson@10919
    64
  epsilon :: hypreal   (*an infinitesimal number = [<1,1/2,1/3,...>] *)
paulson@10919
    65
  "epsilon == Abs_hypreal(hyprel``{%n::nat. inverse (real (Suc n))})"
paulson@10919
    66
paulson@10919
    67
syntax (xsymbols)
paulson@14299
    68
  omega   :: hypreal   ("\<omega>")
paulson@14299
    69
  epsilon :: hypreal   ("\<epsilon>")
paulson@10919
    70
kleing@14565
    71
syntax (HTML output)
kleing@14565
    72
  omega   :: hypreal   ("\<omega>")
kleing@14565
    73
  epsilon :: hypreal   ("\<epsilon>")
kleing@14565
    74
paulson@10751
    75
paulson@14370
    76
defs (overloaded)
wenzelm@13487
    77
paulson@14299
    78
  hypreal_add_def:
paulson@14299
    79
  "P + Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q).
nipkow@10834
    80
                hyprel``{%n::nat. X n + Y n})"
paulson@10751
    81
paulson@14299
    82
  hypreal_mult_def:
paulson@14299
    83
  "P * Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q).
nipkow@10834
    84
                hyprel``{%n::nat. X n * Y n})"
paulson@10751
    85
paulson@14370
    86
  hypreal_le_def:
paulson@14370
    87
  "P \<le> (Q::hypreal) == \<exists>X Y. X \<in> Rep_hypreal(P) &
paulson@14299
    88
                               Y \<in> Rep_hypreal(Q) &
paulson@14370
    89
                               {n::nat. X n \<le> Y n} \<in> FreeUltrafilterNat"
paulson@14370
    90
paulson@14370
    91
  hypreal_less_def: "(x < (y::hypreal)) == (x \<le> y & x \<noteq> y)"
paulson@10751
    92
paulson@14329
    93
  hrabs_def:  "abs (r::hypreal) == (if 0 \<le> r then r else -r)"
paulson@14329
    94
paulson@14329
    95
paulson@14329
    96
subsection{*The Set of Naturals is not Finite*}
paulson@14299
    97
paulson@14299
    98
(*** based on James' proof that the set of naturals is not finite ***)
paulson@14329
    99
lemma finite_exhausts [rule_format]:
paulson@14329
   100
     "finite (A::nat set) --> (\<exists>n. \<forall>m. Suc (n + m) \<notin> A)"
paulson@14299
   101
apply (rule impI)
paulson@14301
   102
apply (erule_tac F = A in finite_induct)
paulson@14301
   103
apply (blast, erule exE)
paulson@14299
   104
apply (rule_tac x = "n + x" in exI)
paulson@14301
   105
apply (rule allI, erule_tac x = "x + m" in allE)
paulson@14299
   106
apply (auto simp add: add_ac)
paulson@14299
   107
done
paulson@14299
   108
paulson@14329
   109
lemma finite_not_covers [rule_format (no_asm)]:
paulson@14329
   110
     "finite (A :: nat set) --> (\<exists>n. n \<notin>A)"
paulson@14301
   111
by (rule impI, drule finite_exhausts, blast)
paulson@14299
   112
paulson@14299
   113
lemma not_finite_nat: "~ finite(UNIV:: nat set)"
paulson@14301
   114
by (fast dest!: finite_exhausts)
paulson@14299
   115
paulson@14329
   116
paulson@14329
   117
subsection{*Existence of Free Ultrafilter over the Naturals*}
paulson@14329
   118
paulson@14329
   119
text{*Also, proof of various properties of @{term FreeUltrafilterNat}: 
paulson@14329
   120
an arbitrary free ultrafilter*}
paulson@14299
   121
paulson@14299
   122
lemma FreeUltrafilterNat_Ex: "\<exists>U. U: FreeUltrafilter (UNIV::nat set)"
paulson@14301
   123
by (rule not_finite_nat [THEN FreeUltrafilter_Ex])
paulson@14299
   124
paulson@14301
   125
lemma FreeUltrafilterNat_mem [simp]: 
paulson@14299
   126
     "FreeUltrafilterNat: FreeUltrafilter(UNIV:: nat set)"
paulson@14299
   127
apply (unfold FreeUltrafilterNat_def)
paulson@14299
   128
apply (rule FreeUltrafilterNat_Ex [THEN exE])
paulson@14301
   129
apply (rule someI2, assumption+)
paulson@14299
   130
done
paulson@14299
   131
paulson@14299
   132
lemma FreeUltrafilterNat_finite: "finite x ==> x \<notin> FreeUltrafilterNat"
paulson@14299
   133
apply (unfold FreeUltrafilterNat_def)
paulson@14299
   134
apply (rule FreeUltrafilterNat_Ex [THEN exE])
paulson@14301
   135
apply (rule someI2, assumption)
paulson@14299
   136
apply (blast dest: mem_FreeUltrafiltersetD1)
paulson@14299
   137
done
paulson@14299
   138
paulson@14299
   139
lemma FreeUltrafilterNat_not_finite: "x: FreeUltrafilterNat ==> ~ finite x"
paulson@14301
   140
by (blast dest: FreeUltrafilterNat_finite)
paulson@14299
   141
paulson@14301
   142
lemma FreeUltrafilterNat_empty [simp]: "{} \<notin> FreeUltrafilterNat"
paulson@14299
   143
apply (unfold FreeUltrafilterNat_def)
paulson@14299
   144
apply (rule FreeUltrafilterNat_Ex [THEN exE])
paulson@14301
   145
apply (rule someI2, assumption)
paulson@14301
   146
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter 
paulson@14301
   147
                   Filter_empty_not_mem)
paulson@14299
   148
done
paulson@14299
   149
paulson@14329
   150
lemma FreeUltrafilterNat_Int:
paulson@14329
   151
     "[| X: FreeUltrafilterNat;  Y: FreeUltrafilterNat |]   
paulson@14299
   152
      ==> X Int Y \<in> FreeUltrafilterNat"
paulson@14299
   153
apply (cut_tac FreeUltrafilterNat_mem)
paulson@14299
   154
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD1)
paulson@14299
   155
done
paulson@14299
   156
paulson@14329
   157
lemma FreeUltrafilterNat_subset:
paulson@14365
   158
     "[| X: FreeUltrafilterNat;  X \<subseteq> Y |]  
paulson@14299
   159
      ==> Y \<in> FreeUltrafilterNat"
paulson@14299
   160
apply (cut_tac FreeUltrafilterNat_mem)
paulson@14299
   161
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD2)
paulson@14299
   162
done
paulson@14299
   163
paulson@14329
   164
lemma FreeUltrafilterNat_Compl:
paulson@14329
   165
     "X: FreeUltrafilterNat ==> -X \<notin> FreeUltrafilterNat"
paulson@14301
   166
apply safe
paulson@14301
   167
apply (drule FreeUltrafilterNat_Int, assumption, auto)
paulson@14299
   168
done
paulson@14299
   169
paulson@14329
   170
lemma FreeUltrafilterNat_Compl_mem:
paulson@14329
   171
     "X\<notin> FreeUltrafilterNat ==> -X \<in> FreeUltrafilterNat"
paulson@14299
   172
apply (cut_tac FreeUltrafilterNat_mem [THEN FreeUltrafilter_iff [THEN iffD1]])
paulson@14301
   173
apply (safe, drule_tac x = X in bspec)
paulson@14299
   174
apply (auto simp add: UNIV_diff_Compl)
paulson@14299
   175
done
paulson@14299
   176
paulson@14329
   177
lemma FreeUltrafilterNat_Compl_iff1:
paulson@14329
   178
     "(X \<notin> FreeUltrafilterNat) = (-X: FreeUltrafilterNat)"
paulson@14301
   179
by (blast dest: FreeUltrafilterNat_Compl FreeUltrafilterNat_Compl_mem)
paulson@14299
   180
paulson@14329
   181
lemma FreeUltrafilterNat_Compl_iff2:
paulson@14329
   182
     "(X: FreeUltrafilterNat) = (-X \<notin> FreeUltrafilterNat)"
paulson@14301
   183
by (auto simp add: FreeUltrafilterNat_Compl_iff1 [symmetric])
paulson@14299
   184
paulson@14378
   185
lemma cofinite_mem_FreeUltrafilterNat: "finite (-X) ==> X \<in> FreeUltrafilterNat"
paulson@14378
   186
apply (drule FreeUltrafilterNat_finite)  
paulson@14378
   187
apply (simp add: FreeUltrafilterNat_Compl_iff2 [symmetric])
paulson@14378
   188
done
paulson@14378
   189
paulson@14301
   190
lemma FreeUltrafilterNat_UNIV [simp]: "(UNIV::nat set) \<in> FreeUltrafilterNat"
paulson@14301
   191
by (rule FreeUltrafilterNat_mem [THEN FreeUltrafilter_Ultrafilter, THEN Ultrafilter_Filter, THEN mem_FiltersetD4])
paulson@14299
   192
paulson@14301
   193
lemma FreeUltrafilterNat_Nat_set [simp]: "UNIV \<in> FreeUltrafilterNat"
paulson@14301
   194
by auto
paulson@14299
   195
paulson@14329
   196
lemma FreeUltrafilterNat_Nat_set_refl [intro]:
paulson@14329
   197
     "{n. P(n) = P(n)} \<in> FreeUltrafilterNat"
paulson@14301
   198
by simp
paulson@14299
   199
paulson@14299
   200
lemma FreeUltrafilterNat_P: "{n::nat. P} \<in> FreeUltrafilterNat ==> P"
paulson@14301
   201
by (rule ccontr, simp)
paulson@14299
   202
paulson@14299
   203
lemma FreeUltrafilterNat_Ex_P: "{n. P(n)} \<in> FreeUltrafilterNat ==> \<exists>n. P(n)"
paulson@14301
   204
by (rule ccontr, simp)
paulson@14299
   205
paulson@14299
   206
lemma FreeUltrafilterNat_all: "\<forall>n. P(n) ==> {n. P(n)} \<in> FreeUltrafilterNat"
paulson@14301
   207
by (auto intro: FreeUltrafilterNat_Nat_set)
paulson@14299
   208
paulson@14329
   209
paulson@14329
   210
text{*Define and use Ultrafilter tactics*}
paulson@14299
   211
use "fuf.ML"
paulson@14299
   212
paulson@14299
   213
method_setup fuf = {*
paulson@14299
   214
    Method.ctxt_args (fn ctxt =>
paulson@14299
   215
        Method.METHOD (fn facts =>
paulson@14299
   216
            fuf_tac (Classical.get_local_claset ctxt,
paulson@14299
   217
                     Simplifier.get_local_simpset ctxt) 1)) *}
paulson@14299
   218
    "free ultrafilter tactic"
paulson@14299
   219
paulson@14299
   220
method_setup ultra = {*
paulson@14299
   221
    Method.ctxt_args (fn ctxt =>
paulson@14299
   222
        Method.METHOD (fn facts =>
paulson@14299
   223
            ultra_tac (Classical.get_local_claset ctxt,
paulson@14299
   224
                       Simplifier.get_local_simpset ctxt) 1)) *}
paulson@14299
   225
    "ultrafilter tactic"
paulson@14299
   226
paulson@14299
   227
paulson@14329
   228
text{*One further property of our free ultrafilter*}
paulson@14329
   229
lemma FreeUltrafilterNat_Un:
paulson@14329
   230
     "X Un Y: FreeUltrafilterNat  
paulson@14299
   231
      ==> X: FreeUltrafilterNat | Y: FreeUltrafilterNat"
paulson@14299
   232
apply auto
paulson@14301
   233
apply ultra
paulson@14299
   234
done
paulson@14299
   235
paulson@14299
   236
paulson@14329
   237
subsection{*Properties of @{term hyprel}*}
paulson@14329
   238
paulson@14329
   239
text{*Proving that @{term hyprel} is an equivalence relation*}
paulson@14299
   240
paulson@14365
   241
lemma hyprel_iff: "((X,Y) \<in> hyprel) = ({n. X n = Y n}: FreeUltrafilterNat)"
paulson@14468
   242
by (simp add: hyprel_def)
paulson@14299
   243
paulson@14365
   244
lemma hyprel_refl: "(x,x) \<in> hyprel"
paulson@14468
   245
by (simp add: hyprel_def)
paulson@14299
   246
paulson@14365
   247
lemma hyprel_sym [rule_format (no_asm)]: "(x,y) \<in> hyprel --> (y,x) \<in> hyprel"
paulson@14301
   248
by (simp add: hyprel_def eq_commute)
paulson@14299
   249
paulson@14299
   250
lemma hyprel_trans: 
paulson@14365
   251
      "[|(x,y) \<in> hyprel; (y,z) \<in> hyprel|] ==> (x,z) \<in> hyprel"
paulson@14468
   252
by (simp add: hyprel_def, ultra)
paulson@14299
   253
paulson@14299
   254
lemma equiv_hyprel: "equiv UNIV hyprel"
paulson@14299
   255
apply (simp add: equiv_def refl_def sym_def trans_def hyprel_refl)
paulson@14299
   256
apply (blast intro: hyprel_sym hyprel_trans) 
paulson@14299
   257
done
paulson@14299
   258
paulson@14299
   259
(* (hyprel `` {x} = hyprel `` {y}) = ((x,y) \<in> hyprel) *)
paulson@14299
   260
lemmas equiv_hyprel_iff =
paulson@14299
   261
    eq_equiv_class_iff [OF equiv_hyprel UNIV_I UNIV_I, simp] 
paulson@14299
   262
paulson@14301
   263
lemma hyprel_in_hypreal [simp]: "hyprel``{x}:hypreal"
paulson@14468
   264
by (simp add: hypreal_def hyprel_def quotient_def, blast)
paulson@14299
   265
paulson@14299
   266
lemma inj_on_Abs_hypreal: "inj_on Abs_hypreal hypreal"
paulson@14299
   267
apply (rule inj_on_inverseI)
paulson@14299
   268
apply (erule Abs_hypreal_inverse)
paulson@14299
   269
done
paulson@14299
   270
paulson@14299
   271
declare inj_on_Abs_hypreal [THEN inj_on_iff, simp] 
paulson@14301
   272
        Abs_hypreal_inverse [simp]
paulson@14299
   273
paulson@14299
   274
declare equiv_hyprel [THEN eq_equiv_class_iff, simp]
paulson@14299
   275
paulson@14299
   276
declare hyprel_iff [iff]
paulson@14299
   277
paulson@14299
   278
lemmas eq_hyprelD = eq_equiv_class [OF _ equiv_hyprel]
paulson@14299
   279
paulson@14299
   280
lemma inj_Rep_hypreal: "inj(Rep_hypreal)"
paulson@14299
   281
apply (rule inj_on_inverseI)
paulson@14299
   282
apply (rule Rep_hypreal_inverse)
paulson@14299
   283
done
paulson@14299
   284
paulson@14301
   285
lemma lemma_hyprel_refl [simp]: "x \<in> hyprel `` {x}"
paulson@14468
   286
by (simp add: hyprel_def)
paulson@14299
   287
paulson@14301
   288
lemma hypreal_empty_not_mem [simp]: "{} \<notin> hypreal"
paulson@14468
   289
apply (simp add: hypreal_def)
paulson@14299
   290
apply (auto elim!: quotientE equalityCE)
paulson@14299
   291
done
paulson@14299
   292
paulson@14301
   293
lemma Rep_hypreal_nonempty [simp]: "Rep_hypreal x \<noteq> {}"
paulson@14301
   294
by (cut_tac x = x in Rep_hypreal, auto)
paulson@14299
   295
paulson@14299
   296
paulson@14329
   297
subsection{*@{term hypreal_of_real}: 
paulson@14329
   298
            the Injection from @{typ real} to @{typ hypreal}*}
paulson@14299
   299
paulson@14299
   300
lemma inj_hypreal_of_real: "inj(hypreal_of_real)"
paulson@14299
   301
apply (rule inj_onI)
paulson@14468
   302
apply (simp add: hypreal_of_real_def split: split_if_asm)
paulson@14299
   303
done
paulson@14299
   304
paulson@14299
   305
lemma eq_Abs_hypreal:
paulson@14468
   306
    "(!!x. z = Abs_hypreal(hyprel``{x}) ==> P) ==> P"
paulson@14299
   307
apply (rule_tac x1=z in Rep_hypreal [unfolded hypreal_def, THEN quotientE])
paulson@14301
   308
apply (drule_tac f = Abs_hypreal in arg_cong)
paulson@14299
   309
apply (force simp add: Rep_hypreal_inverse)
paulson@14299
   310
done
paulson@14299
   311
paulson@14468
   312
theorem hypreal_cases [case_names Abs_hypreal, cases type: hypreal]:
paulson@14468
   313
    "(!!x. z = Abs_hypreal(hyprel``{x}) ==> P) ==> P"
paulson@14468
   314
by (rule eq_Abs_hypreal [of z], blast)
paulson@14468
   315
paulson@14329
   316
paulson@14329
   317
subsection{*Hyperreal Addition*}
paulson@14329
   318
paulson@14329
   319
lemma hypreal_add_congruent2: 
paulson@14329
   320
    "congruent2 hyprel (%X Y. hyprel``{%n. X n + Y n})"
paulson@14468
   321
apply (simp add: congruent2_def, auto, ultra)
paulson@14329
   322
done
paulson@14329
   323
paulson@14329
   324
lemma hypreal_add: 
paulson@14329
   325
  "Abs_hypreal(hyprel``{%n. X n}) + Abs_hypreal(hyprel``{%n. Y n}) =  
paulson@14329
   326
   Abs_hypreal(hyprel``{%n. X n + Y n})"
paulson@14468
   327
apply (simp add: hypreal_add_def)
paulson@14329
   328
apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_add_congruent2])
paulson@14329
   329
done
paulson@14329
   330
paulson@14329
   331
lemma hypreal_add_commute: "(z::hypreal) + w = w + z"
paulson@14468
   332
apply (cases z, cases w)
paulson@14334
   333
apply (simp add: add_ac hypreal_add)
paulson@14329
   334
done
paulson@14329
   335
paulson@14329
   336
lemma hypreal_add_assoc: "((z1::hypreal) + z2) + z3 = z1 + (z2 + z3)"
paulson@14468
   337
apply (cases z1, cases z2, cases z3)
paulson@14329
   338
apply (simp add: hypreal_add real_add_assoc)
paulson@14329
   339
done
paulson@14329
   340
paulson@14331
   341
lemma hypreal_add_zero_left: "(0::hypreal) + z = z"
paulson@14468
   342
by (cases z, simp add: hypreal_zero_def hypreal_add)
paulson@14329
   343
paulson@14329
   344
instance hypreal :: plus_ac0
paulson@14329
   345
  by (intro_classes,
paulson@14329
   346
      (assumption | 
paulson@14329
   347
       rule hypreal_add_commute hypreal_add_assoc hypreal_add_zero_left)+)
paulson@14329
   348
paulson@14329
   349
lemma hypreal_add_zero_right [simp]: "z + (0::hypreal) = z"
paulson@14329
   350
by (simp add: hypreal_add_zero_left hypreal_add_commute)
paulson@14329
   351
paulson@14329
   352
paulson@14329
   353
subsection{*Additive inverse on @{typ hypreal}*}
paulson@14299
   354
paulson@14299
   355
lemma hypreal_minus_congruent: 
paulson@14299
   356
  "congruent hyprel (%X. hyprel``{%n. - (X n)})"
paulson@14299
   357
by (force simp add: congruent_def)
paulson@14299
   358
paulson@14299
   359
lemma hypreal_minus: 
paulson@14299
   360
   "- (Abs_hypreal(hyprel``{%n. X n})) = Abs_hypreal(hyprel `` {%n. -(X n)})"
paulson@14468
   361
apply (simp add: hypreal_minus_def)
paulson@14301
   362
apply (rule_tac f = Abs_hypreal in arg_cong)
paulson@14301
   363
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] 
paulson@14299
   364
               UN_equiv_class [OF equiv_hyprel hypreal_minus_congruent])
paulson@14299
   365
done
paulson@14299
   366
paulson@14329
   367
lemma hypreal_diff:
paulson@14329
   368
     "Abs_hypreal(hyprel``{%n. X n}) - Abs_hypreal(hyprel``{%n. Y n}) =  
paulson@14299
   369
      Abs_hypreal(hyprel``{%n. X n - Y n})"
paulson@14301
   370
apply (simp add: hypreal_diff_def hypreal_minus hypreal_add)
paulson@14299
   371
done
paulson@14299
   372
paulson@14301
   373
lemma hypreal_add_minus [simp]: "z + -z = (0::hypreal)"
paulson@14468
   374
apply (simp add: hypreal_zero_def)
paulson@14301
   375
apply (rule_tac z = z in eq_Abs_hypreal)
paulson@14299
   376
apply (simp add: hypreal_minus hypreal_add)
paulson@14299
   377
done
paulson@14299
   378
paulson@14331
   379
lemma hypreal_add_minus_left: "-z + z = (0::hypreal)"
paulson@14301
   380
by (simp add: hypreal_add_commute hypreal_add_minus)
paulson@14299
   381
paulson@14329
   382
paulson@14329
   383
subsection{*Hyperreal Multiplication*}
paulson@14299
   384
paulson@14299
   385
lemma hypreal_mult_congruent2: 
paulson@14299
   386
    "congruent2 hyprel (%X Y. hyprel``{%n. X n * Y n})"
paulson@14468
   387
apply (simp add: congruent2_def, auto, ultra)
paulson@14299
   388
done
paulson@14299
   389
paulson@14299
   390
lemma hypreal_mult: 
paulson@14299
   391
  "Abs_hypreal(hyprel``{%n. X n}) * Abs_hypreal(hyprel``{%n. Y n}) =  
paulson@14299
   392
   Abs_hypreal(hyprel``{%n. X n * Y n})"
paulson@14468
   393
apply (simp add: hypreal_mult_def)
paulson@14299
   394
apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_mult_congruent2])
paulson@14299
   395
done
paulson@14299
   396
paulson@14299
   397
lemma hypreal_mult_commute: "(z::hypreal) * w = w * z"
paulson@14468
   398
apply (cases z, cases w)
paulson@14331
   399
apply (simp add: hypreal_mult mult_ac)
paulson@14299
   400
done
paulson@14299
   401
paulson@14299
   402
lemma hypreal_mult_assoc: "((z1::hypreal) * z2) * z3 = z1 * (z2 * z3)"
paulson@14468
   403
apply (cases z1, cases z2, cases z3)
paulson@14331
   404
apply (simp add: hypreal_mult mult_assoc)
paulson@14299
   405
done
paulson@14299
   406
paulson@14331
   407
lemma hypreal_mult_1: "(1::hypreal) * z = z"
paulson@14468
   408
apply (simp add: hypreal_one_def)
paulson@14301
   409
apply (rule_tac z = z in eq_Abs_hypreal)
paulson@14299
   410
apply (simp add: hypreal_mult)
paulson@14299
   411
done
paulson@14301
   412
paulson@14329
   413
lemma hypreal_add_mult_distrib:
paulson@14329
   414
     "((z1::hypreal) + z2) * w = (z1 * w) + (z2 * w)"
paulson@14468
   415
apply (cases z1, cases z2, cases w)
paulson@14334
   416
apply (simp add: hypreal_mult hypreal_add left_distrib)
paulson@14299
   417
done
paulson@14299
   418
paulson@14331
   419
text{*one and zero are distinct*}
paulson@14299
   420
lemma hypreal_zero_not_eq_one: "0 \<noteq> (1::hypreal)"
paulson@14468
   421
by (simp add: hypreal_zero_def hypreal_one_def)
paulson@14299
   422
paulson@14299
   423
paulson@14329
   424
subsection{*Multiplicative Inverse on @{typ hypreal} *}
paulson@14299
   425
paulson@14299
   426
lemma hypreal_inverse_congruent: 
paulson@14299
   427
  "congruent hyprel (%X. hyprel``{%n. if X n = 0 then 0 else inverse(X n)})"
paulson@14468
   428
apply (simp add: congruent_def)
paulson@14301
   429
apply (auto, ultra)
paulson@14299
   430
done
paulson@14299
   431
paulson@14299
   432
lemma hypreal_inverse: 
paulson@14299
   433
      "inverse (Abs_hypreal(hyprel``{%n. X n})) =  
paulson@14299
   434
       Abs_hypreal(hyprel `` {%n. if X n = 0 then 0 else inverse(X n)})"
paulson@14468
   435
apply (simp add: hypreal_inverse_def)
paulson@14301
   436
apply (rule_tac f = Abs_hypreal in arg_cong)
paulson@14301
   437
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] 
paulson@14299
   438
           UN_equiv_class [OF equiv_hyprel hypreal_inverse_congruent])
paulson@14299
   439
done
paulson@14299
   440
paulson@14331
   441
lemma hypreal_mult_inverse: 
paulson@14299
   442
     "x \<noteq> 0 ==> x*inverse(x) = (1::hypreal)"
paulson@14468
   443
apply (simp add: hypreal_one_def hypreal_zero_def)
paulson@14468
   444
apply (cases x)
paulson@14299
   445
apply (simp add: hypreal_inverse hypreal_mult)
paulson@14299
   446
apply (drule FreeUltrafilterNat_Compl_mem)
paulson@14334
   447
apply (blast intro!: right_inverse FreeUltrafilterNat_subset)
paulson@14299
   448
done
paulson@14299
   449
paulson@14331
   450
lemma hypreal_mult_inverse_left:
paulson@14329
   451
     "x \<noteq> 0 ==> inverse(x)*x = (1::hypreal)"
paulson@14301
   452
by (simp add: hypreal_mult_inverse hypreal_mult_commute)
paulson@14299
   453
paulson@14331
   454
instance hypreal :: field
paulson@14331
   455
proof
paulson@14331
   456
  fix x y z :: hypreal
paulson@14331
   457
  show "(x + y) + z = x + (y + z)" by (rule hypreal_add_assoc)
paulson@14331
   458
  show "x + y = y + x" by (rule hypreal_add_commute)
paulson@14331
   459
  show "0 + x = x" by simp
paulson@14331
   460
  show "- x + x = 0" by (simp add: hypreal_add_minus_left)
paulson@14331
   461
  show "x - y = x + (-y)" by (simp add: hypreal_diff_def)
paulson@14331
   462
  show "(x * y) * z = x * (y * z)" by (rule hypreal_mult_assoc)
paulson@14331
   463
  show "x * y = y * x" by (rule hypreal_mult_commute)
paulson@14331
   464
  show "1 * x = x" by (simp add: hypreal_mult_1)
paulson@14331
   465
  show "(x + y) * z = x * z + y * z" by (simp add: hypreal_add_mult_distrib)
paulson@14331
   466
  show "0 \<noteq> (1::hypreal)" by (rule hypreal_zero_not_eq_one)
paulson@14331
   467
  show "x \<noteq> 0 ==> inverse x * x = 1" by (simp add: hypreal_mult_inverse_left)
paulson@14430
   468
  show "x / y = x * inverse y" by (simp add: hypreal_divide_def)
paulson@14331
   469
qed
paulson@14331
   470
paulson@14331
   471
paulson@14331
   472
instance hypreal :: division_by_zero
paulson@14331
   473
proof
paulson@14430
   474
  show "inverse 0 = (0::hypreal)" 
paulson@14421
   475
    by (simp add: hypreal_inverse hypreal_zero_def)
paulson@14331
   476
qed
paulson@14331
   477
paulson@14329
   478
paulson@14329
   479
subsection{*Properties of The @{text "\<le>"} Relation*}
paulson@14299
   480
paulson@14299
   481
lemma hypreal_le: 
paulson@14365
   482
      "(Abs_hypreal(hyprel``{%n. X n}) \<le> Abs_hypreal(hyprel``{%n. Y n})) =  
paulson@14365
   483
       ({n. X n \<le> Y n} \<in> FreeUltrafilterNat)"
paulson@14468
   484
apply (simp add: hypreal_le_def)
paulson@14387
   485
apply (auto intro!: lemma_hyprel_refl, ultra)
paulson@14299
   486
done
paulson@14299
   487
paulson@14365
   488
lemma hypreal_le_refl: "w \<le> (w::hypreal)"
paulson@14468
   489
apply (cases w)
paulson@14370
   490
apply (simp add: hypreal_le) 
paulson@14299
   491
done
paulson@14299
   492
paulson@14365
   493
lemma hypreal_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::hypreal)"
paulson@14468
   494
apply (cases i, cases j, cases k)
paulson@14387
   495
apply (simp add: hypreal_le, ultra)
paulson@14299
   496
done
paulson@14299
   497
paulson@14365
   498
lemma hypreal_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::hypreal)"
paulson@14468
   499
apply (cases z, cases w)
paulson@14387
   500
apply (simp add: hypreal_le, ultra)
paulson@14299
   501
done
paulson@14299
   502
paulson@14299
   503
(* Axiom 'order_less_le' of class 'order': *)
paulson@14365
   504
lemma hypreal_less_le: "((w::hypreal) < z) = (w \<le> z & w \<noteq> z)"
paulson@14387
   505
by (simp add: hypreal_less_def)
paulson@14299
   506
paulson@14329
   507
instance hypreal :: order
paulson@14370
   508
proof qed
paulson@14370
   509
 (assumption |
paulson@14370
   510
  rule hypreal_le_refl hypreal_le_trans hypreal_le_anti_sym hypreal_less_le)+
paulson@14370
   511
paulson@14370
   512
paulson@14370
   513
(* Axiom 'linorder_linear' of class 'linorder': *)
paulson@14370
   514
lemma hypreal_le_linear: "(z::hypreal) \<le> w | w \<le> z"
paulson@14468
   515
apply (cases z, cases w)
paulson@14387
   516
apply (auto simp add: hypreal_le, ultra)
paulson@14370
   517
done
paulson@14329
   518
paulson@14329
   519
instance hypreal :: linorder 
paulson@14329
   520
  by (intro_classes, rule hypreal_le_linear)
paulson@14329
   521
paulson@14370
   522
lemma hypreal_not_refl2: "!!(x::hypreal). x < y ==> x \<noteq> y"
paulson@14370
   523
by (auto simp add: order_less_irrefl)
paulson@14329
   524
paulson@14370
   525
lemma hypreal_add_left_mono: "x \<le> y ==> z + x \<le> z + (y::hypreal)"
paulson@14468
   526
apply (cases x, cases y, cases z)
paulson@14370
   527
apply (auto simp add: hypreal_le hypreal_add) 
paulson@14329
   528
done
paulson@14329
   529
paulson@14329
   530
lemma hypreal_mult_less_mono2: "[| (0::hypreal)<z; x<y |] ==> z*x<z*y"
paulson@14468
   531
apply (cases x, cases y, cases z)
paulson@14370
   532
apply (auto simp add: hypreal_zero_def hypreal_le hypreal_mult 
paulson@14387
   533
                      linorder_not_le [symmetric], ultra) 
paulson@14329
   534
done
paulson@14329
   535
paulson@14370
   536
paulson@14329
   537
subsection{*The Hyperreals Form an Ordered Field*}
paulson@14329
   538
paulson@14329
   539
instance hypreal :: ordered_field
paulson@14329
   540
proof
paulson@14329
   541
  fix x y z :: hypreal
paulson@14348
   542
  show "x \<le> y ==> z + x \<le> z + y" 
paulson@14370
   543
    by (rule hypreal_add_left_mono)
paulson@14348
   544
  show "x < y ==> 0 < z ==> z * x < z * y" 
paulson@14348
   545
    by (simp add: hypreal_mult_less_mono2)
paulson@14329
   546
  show "\<bar>x\<bar> = (if x < 0 then -x else x)"
paulson@14329
   547
    by (auto dest: order_le_less_trans simp add: hrabs_def linorder_not_le)
paulson@14329
   548
qed
paulson@14329
   549
paulson@14331
   550
lemma hypreal_eq_minus_iff: "((x::hypreal) = y) = (x + - y = 0)"
paulson@14331
   551
apply auto
paulson@14331
   552
apply (rule Ring_and_Field.add_right_cancel [of _ "-y", THEN iffD1], auto)
paulson@14331
   553
done
paulson@14331
   554
paulson@14329
   555
lemma hypreal_mult_left_cancel: "(c::hypreal) \<noteq> 0 ==> (c*a=c*b) = (a=b)"
paulson@14387
   556
by auto
paulson@14329
   557
    
paulson@14329
   558
lemma hypreal_mult_right_cancel: "(c::hypreal) \<noteq> 0 ==> (a*c=b*c) = (a=b)"
paulson@14387
   559
by auto
paulson@14329
   560
paulson@14329
   561
paulson@14371
   562
subsection{*The Embedding @{term hypreal_of_real} Preserves Field and 
paulson@14371
   563
      Order Properties*}
paulson@14329
   564
paulson@14301
   565
lemma hypreal_of_real_add [simp]: 
paulson@14369
   566
     "hypreal_of_real (w + z) = hypreal_of_real w + hypreal_of_real z"
paulson@14468
   567
apply (simp add: hypreal_of_real_def)
paulson@14331
   568
apply (simp add: hypreal_add left_distrib)
paulson@14299
   569
done
paulson@14299
   570
paulson@14301
   571
lemma hypreal_of_real_mult [simp]: 
paulson@14369
   572
     "hypreal_of_real (w * z) = hypreal_of_real w * hypreal_of_real z"
paulson@14468
   573
apply (simp add: hypreal_of_real_def)
paulson@14331
   574
apply (simp add: hypreal_mult right_distrib)
paulson@14299
   575
done
paulson@14299
   576
paulson@14301
   577
lemma hypreal_of_real_one [simp]: "hypreal_of_real 1 = (1::hypreal)"
paulson@14468
   578
by (simp add: hypreal_of_real_def hypreal_one_def)
paulson@14299
   579
paulson@14301
   580
lemma hypreal_of_real_zero [simp]: "hypreal_of_real 0 = 0"
paulson@14468
   581
by (simp add: hypreal_of_real_def hypreal_zero_def)
paulson@14299
   582
paulson@14370
   583
lemma hypreal_of_real_le_iff [simp]: 
paulson@14370
   584
     "(hypreal_of_real w \<le> hypreal_of_real z) = (w \<le> z)"
paulson@14468
   585
apply (simp add: hypreal_le_def hypreal_of_real_def, auto)
paulson@14369
   586
apply (rule_tac [2] x = "%n. w" in exI, safe)
paulson@14369
   587
apply (rule_tac [3] x = "%n. z" in exI, auto)
paulson@14369
   588
apply (rule FreeUltrafilterNat_P, ultra)
paulson@14369
   589
done
paulson@14369
   590
paulson@14370
   591
lemma hypreal_of_real_less_iff [simp]: 
paulson@14370
   592
     "(hypreal_of_real w < hypreal_of_real z) = (w < z)"
paulson@14370
   593
by (simp add: linorder_not_le [symmetric]) 
paulson@14369
   594
paulson@14369
   595
lemma hypreal_of_real_eq_iff [simp]:
paulson@14369
   596
     "(hypreal_of_real w = hypreal_of_real z) = (w = z)"
paulson@14369
   597
by (force intro: order_antisym hypreal_of_real_le_iff [THEN iffD1])
paulson@14369
   598
paulson@14369
   599
text{*As above, for 0*}
paulson@14369
   600
paulson@14369
   601
declare hypreal_of_real_less_iff [of 0, simplified, simp]
paulson@14369
   602
declare hypreal_of_real_le_iff   [of 0, simplified, simp]
paulson@14369
   603
declare hypreal_of_real_eq_iff   [of 0, simplified, simp]
paulson@14369
   604
paulson@14369
   605
declare hypreal_of_real_less_iff [of _ 0, simplified, simp]
paulson@14369
   606
declare hypreal_of_real_le_iff   [of _ 0, simplified, simp]
paulson@14369
   607
declare hypreal_of_real_eq_iff   [of _ 0, simplified, simp]
paulson@14369
   608
paulson@14369
   609
text{*As above, for 1*}
paulson@14369
   610
paulson@14369
   611
declare hypreal_of_real_less_iff [of 1, simplified, simp]
paulson@14369
   612
declare hypreal_of_real_le_iff   [of 1, simplified, simp]
paulson@14369
   613
declare hypreal_of_real_eq_iff   [of 1, simplified, simp]
paulson@14369
   614
paulson@14369
   615
declare hypreal_of_real_less_iff [of _ 1, simplified, simp]
paulson@14369
   616
declare hypreal_of_real_le_iff   [of _ 1, simplified, simp]
paulson@14369
   617
declare hypreal_of_real_eq_iff   [of _ 1, simplified, simp]
paulson@14369
   618
paulson@14369
   619
lemma hypreal_of_real_minus [simp]:
paulson@14369
   620
     "hypreal_of_real (-r) = - hypreal_of_real  r"
paulson@14370
   621
by (auto simp add: hypreal_of_real_def hypreal_minus)
paulson@14299
   622
paulson@14329
   623
lemma hypreal_of_real_inverse [simp]:
paulson@14329
   624
     "hypreal_of_real (inverse r) = inverse (hypreal_of_real r)"
paulson@14370
   625
apply (case_tac "r=0", simp)
paulson@14299
   626
apply (rule_tac c1 = "hypreal_of_real r" in hypreal_mult_left_cancel [THEN iffD1])
paulson@14369
   627
apply (auto simp add: hypreal_of_real_mult [symmetric])
paulson@14299
   628
done
paulson@14299
   629
paulson@14329
   630
lemma hypreal_of_real_divide [simp]:
paulson@14369
   631
     "hypreal_of_real (w / z) = hypreal_of_real w / hypreal_of_real z"
paulson@14301
   632
by (simp add: hypreal_divide_def real_divide_def)
paulson@14299
   633
paulson@14299
   634
paulson@14329
   635
subsection{*Misc Others*}
paulson@14299
   636
paulson@14370
   637
lemma hypreal_less: 
paulson@14370
   638
      "(Abs_hypreal(hyprel``{%n. X n}) < Abs_hypreal(hyprel``{%n. Y n})) =  
paulson@14370
   639
       ({n. X n < Y n} \<in> FreeUltrafilterNat)"
paulson@14387
   640
apply (auto simp add: hypreal_le linorder_not_le [symmetric], ultra+)
paulson@14370
   641
done
paulson@14370
   642
paulson@14299
   643
lemma hypreal_zero_num: "0 = Abs_hypreal (hyprel `` {%n. 0})"
paulson@14301
   644
by (simp add: hypreal_zero_def [THEN meta_eq_to_obj_eq, symmetric])
paulson@14299
   645
paulson@14299
   646
lemma hypreal_one_num: "1 = Abs_hypreal (hyprel `` {%n. 1})"
paulson@14301
   647
by (simp add: hypreal_one_def [THEN meta_eq_to_obj_eq, symmetric])
paulson@14299
   648
paulson@14301
   649
lemma hypreal_omega_gt_zero [simp]: "0 < omega"
paulson@14468
   650
apply (simp add: omega_def)
paulson@14299
   651
apply (auto simp add: hypreal_less hypreal_zero_num)
paulson@14299
   652
done
paulson@14299
   653
paulson@14329
   654
lemma hypreal_hrabs:
paulson@14329
   655
     "abs (Abs_hypreal (hyprel `` {X})) = 
paulson@14329
   656
      Abs_hypreal(hyprel `` {%n. abs (X n)})"
paulson@14329
   657
apply (auto simp add: hrabs_def hypreal_zero_def hypreal_le hypreal_minus)
paulson@14329
   658
apply (ultra, arith)+
paulson@14329
   659
done
paulson@14329
   660
paulson@14370
   661
paulson@14370
   662
paulson@14370
   663
lemma hypreal_add_zero_less_le_mono: "[|r < x; (0::hypreal) \<le> y|] ==> r < x+y"
paulson@14370
   664
by (auto dest: add_less_le_mono)
paulson@14370
   665
paulson@14370
   666
text{*The precondition could be weakened to @{term "0\<le>x"}*}
paulson@14370
   667
lemma hypreal_mult_less_mono:
paulson@14370
   668
     "[| u<v;  x<y;  (0::hypreal) < v;  0 < x |] ==> u*x < v* y"
paulson@14370
   669
 by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
paulson@14370
   670
paulson@14370
   671
paulson@14370
   672
subsection{*Existence of Infinite Hyperreal Number*}
paulson@14370
   673
paulson@14370
   674
lemma Rep_hypreal_omega: "Rep_hypreal(omega) \<in> hypreal"
paulson@14468
   675
by (simp add: omega_def)
paulson@14370
   676
paulson@14370
   677
text{*Existence of infinite number not corresponding to any real number.
paulson@14370
   678
Use assumption that member @{term FreeUltrafilterNat} is not finite.*}
paulson@14370
   679
paulson@14370
   680
paulson@14370
   681
text{*A few lemmas first*}
paulson@14370
   682
paulson@14370
   683
lemma lemma_omega_empty_singleton_disj: "{n::nat. x = real n} = {} |  
paulson@14370
   684
      (\<exists>y. {n::nat. x = real n} = {y})"
paulson@14387
   685
by force
paulson@14370
   686
paulson@14370
   687
lemma lemma_finite_omega_set: "finite {n::nat. x = real n}"
paulson@14370
   688
by (cut_tac x = x in lemma_omega_empty_singleton_disj, auto)
paulson@14370
   689
paulson@14370
   690
lemma not_ex_hypreal_of_real_eq_omega: 
paulson@14370
   691
      "~ (\<exists>x. hypreal_of_real x = omega)"
paulson@14468
   692
apply (simp add: omega_def hypreal_of_real_def)
paulson@14370
   693
apply (auto simp add: real_of_nat_Suc diff_eq_eq [symmetric] 
paulson@14370
   694
            lemma_finite_omega_set [THEN FreeUltrafilterNat_finite])
paulson@14370
   695
done
paulson@14370
   696
paulson@14370
   697
lemma hypreal_of_real_not_eq_omega: "hypreal_of_real x \<noteq> omega"
paulson@14370
   698
by (cut_tac not_ex_hypreal_of_real_eq_omega, auto)
paulson@14370
   699
paulson@14370
   700
text{*Existence of infinitesimal number also not corresponding to any
paulson@14370
   701
 real number*}
paulson@14370
   702
paulson@14370
   703
lemma lemma_epsilon_empty_singleton_disj:
paulson@14370
   704
     "{n::nat. x = inverse(real(Suc n))} = {} |  
paulson@14370
   705
      (\<exists>y. {n::nat. x = inverse(real(Suc n))} = {y})"
paulson@14387
   706
by auto
paulson@14370
   707
paulson@14370
   708
lemma lemma_finite_epsilon_set: "finite {n. x = inverse(real(Suc n))}"
paulson@14370
   709
by (cut_tac x = x in lemma_epsilon_empty_singleton_disj, auto)
paulson@14370
   710
paulson@14370
   711
lemma not_ex_hypreal_of_real_eq_epsilon: 
paulson@14370
   712
      "~ (\<exists>x. hypreal_of_real x = epsilon)"
paulson@14468
   713
apply (simp add: epsilon_def hypreal_of_real_def)
paulson@14370
   714
apply (auto simp add: lemma_finite_epsilon_set [THEN FreeUltrafilterNat_finite])
paulson@14370
   715
done
paulson@14370
   716
paulson@14370
   717
lemma hypreal_of_real_not_eq_epsilon: "hypreal_of_real x \<noteq> epsilon"
paulson@14370
   718
by (cut_tac not_ex_hypreal_of_real_eq_epsilon, auto)
paulson@14370
   719
paulson@14370
   720
lemma hypreal_epsilon_not_zero: "epsilon \<noteq> 0"
paulson@14468
   721
by (simp add: epsilon_def hypreal_zero_def)
paulson@14370
   722
paulson@14370
   723
lemma hypreal_epsilon_inverse_omega: "epsilon = inverse(omega)"
paulson@14370
   724
by (simp add: hypreal_inverse omega_def epsilon_def)
paulson@14370
   725
paulson@14370
   726
paulson@14299
   727
ML
paulson@14299
   728
{*
paulson@14329
   729
val hrabs_def = thm "hrabs_def";
paulson@14329
   730
val hypreal_hrabs = thm "hypreal_hrabs";
paulson@14329
   731
paulson@14299
   732
val hypreal_zero_def = thm "hypreal_zero_def";
paulson@14299
   733
val hypreal_one_def = thm "hypreal_one_def";
paulson@14299
   734
val hypreal_minus_def = thm "hypreal_minus_def";
paulson@14299
   735
val hypreal_diff_def = thm "hypreal_diff_def";
paulson@14299
   736
val hypreal_inverse_def = thm "hypreal_inverse_def";
paulson@14299
   737
val hypreal_divide_def = thm "hypreal_divide_def";
paulson@14299
   738
val hypreal_of_real_def = thm "hypreal_of_real_def";
paulson@14299
   739
val omega_def = thm "omega_def";
paulson@14299
   740
val epsilon_def = thm "epsilon_def";
paulson@14299
   741
val hypreal_add_def = thm "hypreal_add_def";
paulson@14299
   742
val hypreal_mult_def = thm "hypreal_mult_def";
paulson@14299
   743
val hypreal_less_def = thm "hypreal_less_def";
paulson@14299
   744
val hypreal_le_def = thm "hypreal_le_def";
paulson@14299
   745
paulson@14299
   746
val finite_exhausts = thm "finite_exhausts";
paulson@14299
   747
val finite_not_covers = thm "finite_not_covers";
paulson@14299
   748
val not_finite_nat = thm "not_finite_nat";
paulson@14299
   749
val FreeUltrafilterNat_Ex = thm "FreeUltrafilterNat_Ex";
paulson@14299
   750
val FreeUltrafilterNat_mem = thm "FreeUltrafilterNat_mem";
paulson@14299
   751
val FreeUltrafilterNat_finite = thm "FreeUltrafilterNat_finite";
paulson@14299
   752
val FreeUltrafilterNat_not_finite = thm "FreeUltrafilterNat_not_finite";
paulson@14299
   753
val FreeUltrafilterNat_empty = thm "FreeUltrafilterNat_empty";
paulson@14299
   754
val FreeUltrafilterNat_Int = thm "FreeUltrafilterNat_Int";
paulson@14299
   755
val FreeUltrafilterNat_subset = thm "FreeUltrafilterNat_subset";
paulson@14299
   756
val FreeUltrafilterNat_Compl = thm "FreeUltrafilterNat_Compl";
paulson@14299
   757
val FreeUltrafilterNat_Compl_mem = thm "FreeUltrafilterNat_Compl_mem";
paulson@14299
   758
val FreeUltrafilterNat_Compl_iff1 = thm "FreeUltrafilterNat_Compl_iff1";
paulson@14299
   759
val FreeUltrafilterNat_Compl_iff2 = thm "FreeUltrafilterNat_Compl_iff2";
paulson@14299
   760
val FreeUltrafilterNat_UNIV = thm "FreeUltrafilterNat_UNIV";
paulson@14299
   761
val FreeUltrafilterNat_Nat_set = thm "FreeUltrafilterNat_Nat_set";
paulson@14299
   762
val FreeUltrafilterNat_Nat_set_refl = thm "FreeUltrafilterNat_Nat_set_refl";
paulson@14299
   763
val FreeUltrafilterNat_P = thm "FreeUltrafilterNat_P";
paulson@14299
   764
val FreeUltrafilterNat_Ex_P = thm "FreeUltrafilterNat_Ex_P";
paulson@14299
   765
val FreeUltrafilterNat_all = thm "FreeUltrafilterNat_all";
paulson@14299
   766
val FreeUltrafilterNat_Un = thm "FreeUltrafilterNat_Un";
paulson@14299
   767
val hyprel_iff = thm "hyprel_iff";
paulson@14299
   768
val hyprel_refl = thm "hyprel_refl";
paulson@14299
   769
val hyprel_sym = thm "hyprel_sym";
paulson@14299
   770
val hyprel_trans = thm "hyprel_trans";
paulson@14299
   771
val equiv_hyprel = thm "equiv_hyprel";
paulson@14299
   772
val hyprel_in_hypreal = thm "hyprel_in_hypreal";
paulson@14299
   773
val Abs_hypreal_inverse = thm "Abs_hypreal_inverse";
paulson@14299
   774
val inj_on_Abs_hypreal = thm "inj_on_Abs_hypreal";
paulson@14299
   775
val inj_Rep_hypreal = thm "inj_Rep_hypreal";
paulson@14299
   776
val lemma_hyprel_refl = thm "lemma_hyprel_refl";
paulson@14299
   777
val hypreal_empty_not_mem = thm "hypreal_empty_not_mem";
paulson@14299
   778
val Rep_hypreal_nonempty = thm "Rep_hypreal_nonempty";
paulson@14299
   779
val inj_hypreal_of_real = thm "inj_hypreal_of_real";
paulson@14299
   780
val eq_Abs_hypreal = thm "eq_Abs_hypreal";
paulson@14299
   781
val hypreal_minus_congruent = thm "hypreal_minus_congruent";
paulson@14299
   782
val hypreal_minus = thm "hypreal_minus";
paulson@14299
   783
val hypreal_add_congruent2 = thm "hypreal_add_congruent2";
paulson@14299
   784
val hypreal_add = thm "hypreal_add";
paulson@14299
   785
val hypreal_diff = thm "hypreal_diff";
paulson@14299
   786
val hypreal_add_commute = thm "hypreal_add_commute";
paulson@14299
   787
val hypreal_add_assoc = thm "hypreal_add_assoc";
paulson@14299
   788
val hypreal_add_zero_left = thm "hypreal_add_zero_left";
paulson@14299
   789
val hypreal_add_zero_right = thm "hypreal_add_zero_right";
paulson@14299
   790
val hypreal_add_minus = thm "hypreal_add_minus";
paulson@14299
   791
val hypreal_add_minus_left = thm "hypreal_add_minus_left";
paulson@14299
   792
val hypreal_mult_congruent2 = thm "hypreal_mult_congruent2";
paulson@14299
   793
val hypreal_mult = thm "hypreal_mult";
paulson@14299
   794
val hypreal_mult_commute = thm "hypreal_mult_commute";
paulson@14299
   795
val hypreal_mult_assoc = thm "hypreal_mult_assoc";
paulson@14299
   796
val hypreal_mult_1 = thm "hypreal_mult_1";
paulson@14299
   797
val hypreal_zero_not_eq_one = thm "hypreal_zero_not_eq_one";
paulson@14299
   798
val hypreal_inverse_congruent = thm "hypreal_inverse_congruent";
paulson@14299
   799
val hypreal_inverse = thm "hypreal_inverse";
paulson@14299
   800
val hypreal_mult_inverse = thm "hypreal_mult_inverse";
paulson@14299
   801
val hypreal_mult_inverse_left = thm "hypreal_mult_inverse_left";
paulson@14299
   802
val hypreal_mult_left_cancel = thm "hypreal_mult_left_cancel";
paulson@14299
   803
val hypreal_mult_right_cancel = thm "hypreal_mult_right_cancel";
paulson@14299
   804
val hypreal_not_refl2 = thm "hypreal_not_refl2";
paulson@14299
   805
val hypreal_less = thm "hypreal_less";
paulson@14299
   806
val hypreal_eq_minus_iff = thm "hypreal_eq_minus_iff";
paulson@14299
   807
val hypreal_le = thm "hypreal_le";
paulson@14299
   808
val hypreal_le_refl = thm "hypreal_le_refl";
paulson@14299
   809
val hypreal_le_linear = thm "hypreal_le_linear";
paulson@14299
   810
val hypreal_le_trans = thm "hypreal_le_trans";
paulson@14299
   811
val hypreal_le_anti_sym = thm "hypreal_le_anti_sym";
paulson@14299
   812
val hypreal_less_le = thm "hypreal_less_le";
paulson@14299
   813
val hypreal_of_real_add = thm "hypreal_of_real_add";
paulson@14299
   814
val hypreal_of_real_mult = thm "hypreal_of_real_mult";
paulson@14299
   815
val hypreal_of_real_less_iff = thm "hypreal_of_real_less_iff";
paulson@14299
   816
val hypreal_of_real_le_iff = thm "hypreal_of_real_le_iff";
paulson@14299
   817
val hypreal_of_real_eq_iff = thm "hypreal_of_real_eq_iff";
paulson@14299
   818
val hypreal_of_real_minus = thm "hypreal_of_real_minus";
paulson@14299
   819
val hypreal_of_real_one = thm "hypreal_of_real_one";
paulson@14299
   820
val hypreal_of_real_zero = thm "hypreal_of_real_zero";
paulson@14299
   821
val hypreal_of_real_inverse = thm "hypreal_of_real_inverse";
paulson@14299
   822
val hypreal_of_real_divide = thm "hypreal_of_real_divide";
paulson@14299
   823
val hypreal_zero_num = thm "hypreal_zero_num";
paulson@14299
   824
val hypreal_one_num = thm "hypreal_one_num";
paulson@14299
   825
val hypreal_omega_gt_zero = thm "hypreal_omega_gt_zero";
paulson@14370
   826
paulson@14370
   827
val hypreal_add_zero_less_le_mono = thm"hypreal_add_zero_less_le_mono";
paulson@14370
   828
val Rep_hypreal_omega = thm"Rep_hypreal_omega";
paulson@14370
   829
val lemma_omega_empty_singleton_disj = thm"lemma_omega_empty_singleton_disj";
paulson@14370
   830
val lemma_finite_omega_set = thm"lemma_finite_omega_set";
paulson@14370
   831
val not_ex_hypreal_of_real_eq_omega = thm"not_ex_hypreal_of_real_eq_omega";
paulson@14370
   832
val hypreal_of_real_not_eq_omega = thm"hypreal_of_real_not_eq_omega";
paulson@14370
   833
val not_ex_hypreal_of_real_eq_epsilon = thm"not_ex_hypreal_of_real_eq_epsilon";
paulson@14370
   834
val hypreal_of_real_not_eq_epsilon = thm"hypreal_of_real_not_eq_epsilon";
paulson@14370
   835
val hypreal_epsilon_not_zero = thm"hypreal_epsilon_not_zero";
paulson@14370
   836
val hypreal_epsilon_inverse_omega = thm"hypreal_epsilon_inverse_omega";
paulson@14299
   837
*}
paulson@14299
   838
paulson@10751
   839
end