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