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