src/HOL/Real/RealDef.thy
author paulson
Tue Jan 27 15:39:51 2004 +0100 (2004-01-27)
changeset 14365 3d4df8c166ae
parent 14348 744c868ee0b7
child 14369 c50188fe6366
permissions -rw-r--r--
replacing HOL/Real/PRat, PNat by the rational number development
of Markus Wenzel
paulson@5588
     1
(*  Title       : Real/RealDef.thy
paulson@7219
     2
    ID          : $Id$
paulson@5588
     3
    Author      : Jacques D. Fleuriot
paulson@5588
     4
    Copyright   : 1998  University of Cambridge
paulson@5588
     5
    Description : The reals
paulson@14269
     6
*)
paulson@14269
     7
paulson@14269
     8
theory RealDef = PReal:
paulson@5588
     9
paulson@5588
    10
constdefs
paulson@5588
    11
  realrel   ::  "((preal * preal) * (preal * preal)) set"
paulson@14269
    12
  "realrel == {p. \<exists>x1 y1 x2 y2. p = ((x1,y1),(x2,y2)) & x1+y2 = x2+y1}"
paulson@14269
    13
paulson@14269
    14
typedef (REAL)  real = "UNIV//realrel"
paulson@14269
    15
  by (auto simp add: quotient_def)
paulson@5588
    16
paulson@14269
    17
instance real :: ord ..
paulson@14269
    18
instance real :: zero ..
paulson@14269
    19
instance real :: one ..
paulson@14269
    20
instance real :: plus ..
paulson@14269
    21
instance real :: times ..
paulson@14269
    22
instance real :: minus ..
paulson@14269
    23
instance real :: inverse ..
paulson@14269
    24
paulson@14269
    25
consts
paulson@14269
    26
   (*Overloaded constants denoting the Nat and Real subsets of enclosing
paulson@14269
    27
     types such as hypreal and complex*)
paulson@14269
    28
   Nats  :: "'a set"
paulson@14269
    29
   Reals :: "'a set"
paulson@14269
    30
paulson@14269
    31
   (*overloaded constant for injecting other types into "real"*)
paulson@14269
    32
   real :: "'a => real"
paulson@5588
    33
paulson@5588
    34
paulson@14269
    35
defs (overloaded)
paulson@5588
    36
paulson@14269
    37
  real_zero_def:
paulson@14365
    38
  "0 == Abs_REAL(realrel``{(preal_of_rat 1, preal_of_rat 1)})"
paulson@12018
    39
paulson@14269
    40
  real_one_def:
paulson@12018
    41
  "1 == Abs_REAL(realrel``
paulson@14365
    42
               {(preal_of_rat 1 + preal_of_rat 1,
paulson@14365
    43
		 preal_of_rat 1)})"
paulson@5588
    44
paulson@14269
    45
  real_minus_def:
paulson@10919
    46
  "- R ==  Abs_REAL(UN (x,y):Rep_REAL(R). realrel``{(y,x)})"
bauerg@10606
    47
paulson@14269
    48
  real_diff_def:
bauerg@10606
    49
  "R - (S::real) == R + - S"
paulson@5588
    50
paulson@14269
    51
  real_inverse_def:
wenzelm@11713
    52
  "inverse (R::real) == (SOME S. (R = 0 & S = 0) | S * R = 1)"
paulson@5588
    53
paulson@14269
    54
  real_divide_def:
bauerg@10606
    55
  "R / (S::real) == R * inverse S"
paulson@14269
    56
paulson@5588
    57
constdefs
paulson@5588
    58
paulson@12018
    59
  (** these don't use the overloaded "real" function: users don't see them **)
paulson@14269
    60
paulson@14269
    61
  real_of_preal :: "preal => real"
paulson@7077
    62
  "real_of_preal m     ==
paulson@14365
    63
           Abs_REAL(realrel``{(m + preal_of_rat 1, preal_of_rat 1)})"
paulson@5588
    64
paulson@14269
    65
defs (overloaded)
paulson@5588
    66
paulson@14269
    67
  real_add_def:
paulson@14329
    68
  "P+Q == Abs_REAL(\<Union>p1\<in>Rep_REAL(P). \<Union>p2\<in>Rep_REAL(Q).
nipkow@10834
    69
                   (%(x1,y1). (%(x2,y2). realrel``{(x1+x2, y1+y2)}) p2) p1)"
paulson@14269
    70
paulson@14269
    71
  real_mult_def:
paulson@14329
    72
  "P*Q == Abs_REAL(\<Union>p1\<in>Rep_REAL(P). \<Union>p2\<in>Rep_REAL(Q).
nipkow@10834
    73
                   (%(x1,y1). (%(x2,y2). realrel``{(x1*x2+y1*y2,x1*y2+x2*y1)})
paulson@10752
    74
		   p2) p1)"
paulson@5588
    75
paulson@14365
    76
  real_less_def: "(x < (y::real)) == (x \<le> y & x \<noteq> y)"
paulson@14365
    77
paulson@14365
    78
paulson@14269
    79
  real_le_def:
paulson@14365
    80
  "P \<le> (Q::real) == \<exists>x1 y1 x2 y2. x1 + y2 \<le> x2 + y1 &
paulson@14365
    81
                            (x1,y1) \<in> Rep_REAL(P) & (x2,y2) \<in> Rep_REAL(Q)"
paulson@5588
    82
paulson@14334
    83
  real_abs_def:  "abs (r::real) == (if 0 \<le> r then r else -r)"
paulson@14334
    84
paulson@14334
    85
wenzelm@12114
    86
syntax (xsymbols)
paulson@14269
    87
  Reals     :: "'a set"                   ("\<real>")
paulson@14269
    88
  Nats      :: "'a set"                   ("\<nat>")
paulson@14269
    89
paulson@14269
    90
paulson@14365
    91
defs (overloaded)
paulson@14365
    92
  real_of_int_def:
paulson@14365
    93
   "real z == Abs_REAL(\<Union>(i,j) \<in> Rep_Integ z. realrel ``
paulson@14365
    94
		       {(preal_of_rat(rat(int(Suc i))),
paulson@14365
    95
			 preal_of_rat(rat(int(Suc j))))})"
paulson@14365
    96
paulson@14365
    97
  real_of_nat_def:   "real n == real (int n)"
paulson@14365
    98
paulson@14365
    99
paulson@14329
   100
subsection{*Proving that realrel is an equivalence relation*}
paulson@14269
   101
paulson@14270
   102
lemma preal_trans_lemma:
paulson@14365
   103
  assumes "x + y1 = x1 + y"
paulson@14365
   104
      and "x + y2 = x2 + y"
paulson@14365
   105
  shows "x1 + y2 = x2 + (y1::preal)"
paulson@14365
   106
proof -
paulson@14365
   107
  have "(x1 + y2) + x = (x + y2) + x1" by (simp add: preal_add_ac) 
paulson@14365
   108
  also have "... = (x2 + y) + x1"  by (simp add: prems)
paulson@14365
   109
  also have "... = x2 + (x1 + y)"  by (simp add: preal_add_ac)
paulson@14365
   110
  also have "... = x2 + (x + y1)"  by (simp add: prems)
paulson@14365
   111
  also have "... = (x2 + y1) + x"  by (simp add: preal_add_ac)
paulson@14365
   112
  finally have "(x1 + y2) + x = (x2 + y1) + x" .
paulson@14365
   113
  thus ?thesis by (simp add: preal_add_right_cancel_iff) 
paulson@14365
   114
qed
paulson@14365
   115
paulson@14269
   116
paulson@14269
   117
lemma realrel_iff [simp]: "(((x1,y1),(x2,y2)): realrel) = (x1 + y2 = x2 + y1)"
paulson@14269
   118
by (unfold realrel_def, blast)
paulson@14269
   119
paulson@14269
   120
lemma realrel_refl: "(x,x): realrel"
paulson@14269
   121
apply (case_tac "x")
paulson@14269
   122
apply (simp add: realrel_def)
paulson@14269
   123
done
paulson@14269
   124
paulson@14269
   125
lemma equiv_realrel: "equiv UNIV realrel"
paulson@14365
   126
apply (auto simp add: equiv_def refl_def sym_def trans_def realrel_def)
paulson@14365
   127
apply (blast dest: preal_trans_lemma) 
paulson@14269
   128
done
paulson@14269
   129
paulson@14269
   130
(* (realrel `` {x} = realrel `` {y}) = ((x,y) : realrel) *)
paulson@14269
   131
lemmas equiv_realrel_iff = 
paulson@14269
   132
       eq_equiv_class_iff [OF equiv_realrel UNIV_I UNIV_I]
paulson@14269
   133
paulson@14269
   134
declare equiv_realrel_iff [simp]
paulson@14269
   135
paulson@14269
   136
lemma realrel_in_real [simp]: "realrel``{(x,y)}: REAL"
paulson@14269
   137
by (unfold REAL_def realrel_def quotient_def, blast)
paulson@14269
   138
paulson@14365
   139
paulson@14269
   140
lemma inj_on_Abs_REAL: "inj_on Abs_REAL REAL"
paulson@14269
   141
apply (rule inj_on_inverseI)
paulson@14269
   142
apply (erule Abs_REAL_inverse)
paulson@14269
   143
done
paulson@14269
   144
paulson@14269
   145
declare inj_on_Abs_REAL [THEN inj_on_iff, simp]
paulson@14269
   146
declare Abs_REAL_inverse [simp]
paulson@14269
   147
paulson@14269
   148
paulson@14269
   149
lemmas eq_realrelD = equiv_realrel [THEN [2] eq_equiv_class]
paulson@14269
   150
paulson@14269
   151
lemma inj_Rep_REAL: "inj Rep_REAL"
paulson@14269
   152
apply (rule inj_on_inverseI)
paulson@14269
   153
apply (rule Rep_REAL_inverse)
paulson@14269
   154
done
paulson@14269
   155
paulson@14269
   156
(** real_of_preal: the injection from preal to real **)
paulson@14269
   157
lemma inj_real_of_preal: "inj(real_of_preal)"
paulson@14269
   158
apply (rule inj_onI)
paulson@14269
   159
apply (unfold real_of_preal_def)
paulson@14269
   160
apply (drule inj_on_Abs_REAL [THEN inj_onD])
paulson@14269
   161
apply (rule realrel_in_real)+
paulson@14269
   162
apply (drule eq_equiv_class)
paulson@14269
   163
apply (rule equiv_realrel, blast)
paulson@14365
   164
apply (simp add: realrel_def preal_add_right_cancel_iff)
paulson@14269
   165
done
paulson@14269
   166
paulson@14269
   167
lemma eq_Abs_REAL: 
paulson@14269
   168
    "(!!x y. z = Abs_REAL(realrel``{(x,y)}) ==> P) ==> P"
paulson@14269
   169
apply (rule_tac x1 = z in Rep_REAL [unfolded REAL_def, THEN quotientE])
paulson@14269
   170
apply (drule_tac f = Abs_REAL in arg_cong)
paulson@14269
   171
apply (case_tac "x")
paulson@14269
   172
apply (simp add: Rep_REAL_inverse)
paulson@14269
   173
done
paulson@14269
   174
paulson@14365
   175
lemma real_eq_iff:
paulson@14365
   176
     "[|(x1,y1) \<in> Rep_REAL w; (x2,y2) \<in> Rep_REAL z|] 
paulson@14365
   177
      ==> (z = w) = (x1+y2 = x2+y1)"
paulson@14365
   178
apply (insert quotient_eq_iff
paulson@14365
   179
                [OF equiv_realrel, 
paulson@14365
   180
                 of "Rep_REAL w" "Rep_REAL z" "(x1,y1)" "(x2,y2)"])
paulson@14365
   181
apply (simp add: Rep_REAL [unfolded REAL_def] Rep_REAL_inject eq_commute) 
paulson@14365
   182
done 
paulson@14365
   183
paulson@14365
   184
lemma mem_REAL_imp_eq:
paulson@14365
   185
     "[|R \<in> REAL; (x1,y1) \<in> R; (x2,y2) \<in> R|] ==> x1+y2 = x2+y1" 
paulson@14365
   186
apply (auto simp add: REAL_def realrel_def quotient_def)
paulson@14365
   187
apply (blast dest: preal_trans_lemma) 
paulson@14365
   188
done
paulson@14365
   189
paulson@14365
   190
lemma Rep_REAL_cancel_right:
paulson@14365
   191
     "((x + z, y + z) \<in> Rep_REAL R) = ((x, y) \<in> Rep_REAL R)"
paulson@14365
   192
apply (rule_tac z = R in eq_Abs_REAL, simp) 
paulson@14365
   193
apply (rename_tac u v) 
paulson@14365
   194
apply (subgoal_tac "(u + (y + z) = x + z + v) = ((u + y) + z = (x + v) + z)")
paulson@14365
   195
 prefer 2 apply (simp add: preal_add_ac) 
paulson@14365
   196
apply (simp add: preal_add_right_cancel_iff) 
paulson@14365
   197
done
paulson@14365
   198
paulson@14269
   199
paulson@14329
   200
subsection{*Congruence property for addition*}
paulson@14269
   201
paulson@14269
   202
lemma real_add_congruent2_lemma:
paulson@14269
   203
     "[|a + ba = aa + b; ab + bc = ac + bb|]
paulson@14269
   204
      ==> a + ab + (ba + bc) = aa + ac + (b + (bb::preal))"
paulson@14269
   205
apply (simp add: preal_add_assoc) 
paulson@14269
   206
apply (rule preal_add_left_commute [of ab, THEN ssubst])
paulson@14269
   207
apply (simp add: preal_add_assoc [symmetric])
paulson@14269
   208
apply (simp add: preal_add_ac)
paulson@14269
   209
done
paulson@14269
   210
paulson@14269
   211
lemma real_add:
paulson@14269
   212
  "Abs_REAL(realrel``{(x1,y1)}) + Abs_REAL(realrel``{(x2,y2)}) =
paulson@14269
   213
   Abs_REAL(realrel``{(x1+x2, y1+y2)})"
paulson@14269
   214
apply (simp add: real_add_def UN_UN_split_split_eq)
paulson@14269
   215
apply (subst equiv_realrel [THEN UN_equiv_class2])
paulson@14269
   216
apply (auto simp add: congruent2_def)
paulson@14269
   217
apply (blast intro: real_add_congruent2_lemma) 
paulson@14269
   218
done
paulson@14269
   219
paulson@14269
   220
lemma real_add_commute: "(z::real) + w = w + z"
paulson@14269
   221
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   222
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14269
   223
apply (simp add: preal_add_ac real_add)
paulson@14269
   224
done
paulson@14269
   225
paulson@14269
   226
lemma real_add_assoc: "((z1::real) + z2) + z3 = z1 + (z2 + z3)"
paulson@14269
   227
apply (rule_tac z = z1 in eq_Abs_REAL)
paulson@14269
   228
apply (rule_tac z = z2 in eq_Abs_REAL)
paulson@14269
   229
apply (rule_tac z = z3 in eq_Abs_REAL)
paulson@14269
   230
apply (simp add: real_add preal_add_assoc)
paulson@14269
   231
done
paulson@14269
   232
paulson@14269
   233
lemma real_add_zero_left: "(0::real) + z = z"
paulson@14269
   234
apply (unfold real_of_preal_def real_zero_def)
paulson@14269
   235
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   236
apply (simp add: real_add preal_add_ac)
paulson@14269
   237
done
paulson@14269
   238
paulson@14269
   239
lemma real_add_zero_right: "z + (0::real) = z"
paulson@14334
   240
by (simp add: real_add_zero_left real_add_commute)
paulson@14269
   241
paulson@14269
   242
instance real :: plus_ac0
paulson@14269
   243
  by (intro_classes,
paulson@14269
   244
      (assumption | 
paulson@14269
   245
       rule real_add_commute real_add_assoc real_add_zero_left)+)
paulson@14269
   246
paulson@14269
   247
paulson@14334
   248
subsection{*Additive Inverse on real*}
paulson@14334
   249
paulson@14334
   250
lemma real_minus_congruent:
paulson@14334
   251
  "congruent realrel (%p. (%(x,y). realrel``{(y,x)}) p)"
paulson@14334
   252
apply (unfold congruent_def, clarify)
paulson@14334
   253
apply (simp add: preal_add_commute)
paulson@14334
   254
done
paulson@14334
   255
paulson@14334
   256
lemma real_minus:
paulson@14334
   257
      "- (Abs_REAL(realrel``{(x,y)})) = Abs_REAL(realrel `` {(y,x)})"
paulson@14334
   258
apply (unfold real_minus_def)
paulson@14334
   259
apply (rule_tac f = Abs_REAL in arg_cong)
paulson@14334
   260
apply (simp add: realrel_in_real [THEN Abs_REAL_inverse] 
paulson@14334
   261
            UN_equiv_class [OF equiv_realrel real_minus_congruent])
paulson@14334
   262
done
paulson@14334
   263
paulson@14334
   264
lemma real_add_minus_left: "(-z) + z = (0::real)"
paulson@14269
   265
apply (unfold real_zero_def)
paulson@14269
   266
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   267
apply (simp add: real_minus real_add preal_add_commute)
paulson@14269
   268
done
paulson@14269
   269
paulson@14269
   270
paulson@14329
   271
subsection{*Congruence property for multiplication*}
paulson@14269
   272
paulson@14329
   273
lemma real_mult_congruent2_lemma:
paulson@14329
   274
     "!!(x1::preal). [| x1 + y2 = x2 + y1 |] ==>
paulson@14269
   275
          x * x1 + y * y1 + (x * y2 + x2 * y) =
paulson@14269
   276
          x * x2 + y * y2 + (x * y1 + x1 * y)"
paulson@14269
   277
apply (simp add: preal_add_left_commute preal_add_assoc [symmetric] preal_add_mult_distrib2 [symmetric])
paulson@14269
   278
apply (rule preal_mult_commute [THEN subst])
paulson@14269
   279
apply (rule_tac y1 = x2 in preal_mult_commute [THEN subst])
paulson@14269
   280
apply (simp add: preal_add_assoc preal_add_mult_distrib2 [symmetric])
paulson@14269
   281
apply (simp add: preal_add_commute)
paulson@14269
   282
done
paulson@14269
   283
paulson@14269
   284
lemma real_mult_congruent2:
paulson@14269
   285
    "congruent2 realrel (%p1 p2.
paulson@14269
   286
          (%(x1,y1). (%(x2,y2). realrel``{(x1*x2 + y1*y2, x1*y2+x2*y1)}) p2) p1)"
paulson@14269
   287
apply (rule equiv_realrel [THEN congruent2_commuteI], clarify)
paulson@14269
   288
apply (unfold split_def)
paulson@14269
   289
apply (simp add: preal_mult_commute preal_add_commute)
paulson@14269
   290
apply (auto simp add: real_mult_congruent2_lemma)
paulson@14269
   291
done
paulson@14269
   292
paulson@14269
   293
lemma real_mult:
paulson@14269
   294
   "Abs_REAL((realrel``{(x1,y1)})) * Abs_REAL((realrel``{(x2,y2)})) =
paulson@14269
   295
    Abs_REAL(realrel `` {(x1*x2+y1*y2,x1*y2+x2*y1)})"
paulson@14269
   296
apply (unfold real_mult_def)
paulson@14269
   297
apply (simp add: equiv_realrel [THEN UN_equiv_class2] real_mult_congruent2)
paulson@14269
   298
done
paulson@14269
   299
paulson@14269
   300
lemma real_mult_commute: "(z::real) * w = w * z"
paulson@14269
   301
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   302
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14269
   303
apply (simp add: real_mult preal_add_ac preal_mult_ac)
paulson@14269
   304
done
paulson@14269
   305
paulson@14269
   306
lemma real_mult_assoc: "((z1::real) * z2) * z3 = z1 * (z2 * z3)"
paulson@14269
   307
apply (rule_tac z = z1 in eq_Abs_REAL)
paulson@14269
   308
apply (rule_tac z = z2 in eq_Abs_REAL)
paulson@14269
   309
apply (rule_tac z = z3 in eq_Abs_REAL)
paulson@14269
   310
apply (simp add: preal_add_mult_distrib2 real_mult preal_add_ac preal_mult_ac)
paulson@14269
   311
done
paulson@14269
   312
paulson@14269
   313
lemma real_mult_1: "(1::real) * z = z"
paulson@14365
   314
apply (unfold real_one_def)
paulson@14269
   315
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14334
   316
apply (simp add: real_mult preal_add_mult_distrib2 preal_mult_1_right
paulson@14334
   317
                 preal_mult_ac preal_add_ac)
paulson@14269
   318
done
paulson@14269
   319
paulson@14269
   320
lemma real_add_mult_distrib: "((z1::real) + z2) * w = (z1 * w) + (z2 * w)"
paulson@14269
   321
apply (rule_tac z = z1 in eq_Abs_REAL)
paulson@14269
   322
apply (rule_tac z = z2 in eq_Abs_REAL)
paulson@14269
   323
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14269
   324
apply (simp add: preal_add_mult_distrib2 real_add real_mult preal_add_ac preal_mult_ac)
paulson@14269
   325
done
paulson@14269
   326
paulson@14329
   327
text{*one and zero are distinct*}
paulson@14365
   328
lemma real_zero_not_eq_one: "0 \<noteq> (1::real)"
paulson@14365
   329
apply (subgoal_tac "preal_of_rat 1 < preal_of_rat 1 + preal_of_rat 1")
paulson@14365
   330
 prefer 2 apply (simp add: preal_self_less_add_left) 
paulson@14269
   331
apply (unfold real_zero_def real_one_def)
paulson@14365
   332
apply (auto simp add: preal_add_right_cancel_iff)
paulson@14269
   333
done
paulson@14269
   334
paulson@14329
   335
subsection{*existence of inverse*}
paulson@14365
   336
paulson@14365
   337
lemma real_zero_iff: "Abs_REAL (realrel `` {(x, x)}) = 0"
paulson@14269
   338
apply (unfold real_zero_def)
paulson@14269
   339
apply (auto simp add: preal_add_commute)
paulson@14269
   340
done
paulson@14269
   341
paulson@14365
   342
text{*Instead of using an existential quantifier and constructing the inverse
paulson@14365
   343
within the proof, we could define the inverse explicitly.*}
paulson@14365
   344
paulson@14365
   345
lemma real_mult_inverse_left_ex: "x \<noteq> 0 ==> \<exists>y. y*x = (1::real)"
paulson@14269
   346
apply (unfold real_zero_def real_one_def)
paulson@14269
   347
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14269
   348
apply (cut_tac x = xa and y = y in linorder_less_linear)
paulson@14365
   349
apply (auto dest!: less_add_left_Ex simp add: real_zero_iff)
paulson@14334
   350
apply (rule_tac
paulson@14365
   351
        x = "Abs_REAL (realrel `` { (preal_of_rat 1, 
paulson@14365
   352
                            inverse (D) + preal_of_rat 1)}) " 
paulson@14334
   353
       in exI)
paulson@14334
   354
apply (rule_tac [2]
paulson@14365
   355
        x = "Abs_REAL (realrel `` { (inverse (D) + preal_of_rat 1,
paulson@14365
   356
                   preal_of_rat 1)})" 
paulson@14334
   357
       in exI)
paulson@14365
   358
apply (auto simp add: real_mult preal_mult_1_right
paulson@14329
   359
              preal_add_mult_distrib2 preal_add_mult_distrib preal_mult_1
paulson@14365
   360
              preal_mult_inverse_right preal_add_ac preal_mult_ac)
paulson@14269
   361
done
paulson@14269
   362
paulson@14365
   363
lemma real_mult_inverse_left: "x \<noteq> 0 ==> inverse(x)*x = (1::real)"
paulson@14269
   364
apply (unfold real_inverse_def)
paulson@14365
   365
apply (frule real_mult_inverse_left_ex, safe)
paulson@14269
   366
apply (rule someI2, auto)
paulson@14269
   367
done
paulson@14334
   368
paulson@14341
   369
paulson@14341
   370
subsection{*The Real Numbers form a Field*}
paulson@14341
   371
paulson@14334
   372
instance real :: field
paulson@14334
   373
proof
paulson@14334
   374
  fix x y z :: real
paulson@14334
   375
  show "(x + y) + z = x + (y + z)" by (rule real_add_assoc)
paulson@14334
   376
  show "x + y = y + x" by (rule real_add_commute)
paulson@14334
   377
  show "0 + x = x" by simp
paulson@14334
   378
  show "- x + x = 0" by (rule real_add_minus_left)
paulson@14334
   379
  show "x - y = x + (-y)" by (simp add: real_diff_def)
paulson@14334
   380
  show "(x * y) * z = x * (y * z)" by (rule real_mult_assoc)
paulson@14334
   381
  show "x * y = y * x" by (rule real_mult_commute)
paulson@14334
   382
  show "1 * x = x" by (rule real_mult_1)
paulson@14334
   383
  show "(x + y) * z = x * z + y * z" by (simp add: real_add_mult_distrib)
paulson@14334
   384
  show "0 \<noteq> (1::real)" by (rule real_zero_not_eq_one)
paulson@14365
   385
  show "x \<noteq> 0 ==> inverse x * x = 1" by (rule real_mult_inverse_left)
paulson@14334
   386
  show "y \<noteq> 0 ==> x / y = x * inverse y" by (simp add: real_divide_def)
paulson@14341
   387
  assume eq: "z+x = z+y" 
paulson@14341
   388
    hence "(-z + z) + x = (-z + z) + y" by (simp only: eq real_add_assoc)
paulson@14341
   389
    thus "x = y" by (simp add: real_add_minus_left)
paulson@14334
   390
qed
paulson@14334
   391
paulson@14334
   392
paulson@14341
   393
text{*Inverse of zero!  Useful to simplify certain equations*}
paulson@14269
   394
paulson@14334
   395
lemma INVERSE_ZERO: "inverse 0 = (0::real)"
paulson@14334
   396
apply (unfold real_inverse_def)
paulson@14334
   397
apply (rule someI2)
paulson@14334
   398
apply (auto simp add: zero_neq_one)
paulson@14269
   399
done
paulson@14334
   400
paulson@14334
   401
lemma DIVISION_BY_ZERO: "a / (0::real) = 0"
paulson@14334
   402
  by (simp add: real_divide_def INVERSE_ZERO)
paulson@14334
   403
paulson@14334
   404
instance real :: division_by_zero
paulson@14334
   405
proof
paulson@14334
   406
  fix x :: real
paulson@14334
   407
  show "inverse 0 = (0::real)" by (rule INVERSE_ZERO)
paulson@14334
   408
  show "x/0 = 0" by (rule DIVISION_BY_ZERO) 
paulson@14334
   409
qed
paulson@14334
   410
paulson@14334
   411
paulson@14334
   412
(*Pull negations out*)
paulson@14334
   413
declare minus_mult_right [symmetric, simp] 
paulson@14334
   414
        minus_mult_left [symmetric, simp]
paulson@14334
   415
paulson@14334
   416
lemma real_mult_1_right: "z * (1::real) = z"
paulson@14334
   417
  by (rule Ring_and_Field.mult_1_right)
paulson@14269
   418
paulson@14269
   419
paulson@14365
   420
subsection{*The @{text "\<le>"} Ordering*}
paulson@14269
   421
paulson@14365
   422
lemma real_le_refl: "w \<le> (w::real)"
paulson@14365
   423
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14365
   424
apply (force simp add: real_le_def)
paulson@14269
   425
done
paulson@14269
   426
paulson@14365
   427
lemma real_le_trans_lemma:
paulson@14365
   428
  assumes le1: "x1 + y2 \<le> x2 + y1"
paulson@14365
   429
      and le2: "u1 + v2 \<le> u2 + v1"
paulson@14365
   430
      and eq: "x2 + v1 = u1 + y2"
paulson@14365
   431
  shows "x1 + v2 + u1 + y2 \<le> u2 + u1 + y2 + (y1::preal)"
paulson@14365
   432
proof -
paulson@14365
   433
  have "x1 + v2 + u1 + y2 = (x1 + y2) + (u1 + v2)" by (simp add: preal_add_ac)
paulson@14365
   434
  also have "... \<le> (x2 + y1) + (u1 + v2)"
paulson@14365
   435
         by (simp add: prems preal_add_le_cancel_right)
paulson@14365
   436
  also have "... \<le> (x2 + y1) + (u2 + v1)"
paulson@14365
   437
         by (simp add: prems preal_add_le_cancel_left)
paulson@14365
   438
  also have "... = (x2 + v1) + (u2 + y1)" by (simp add: preal_add_ac)
paulson@14365
   439
  also have "... = (u1 + y2) + (u2 + y1)" by (simp add: prems)
paulson@14365
   440
  also have "... = u2 + u1 + y2 + y1" by (simp add: preal_add_ac)
paulson@14365
   441
  finally show ?thesis .
paulson@14365
   442
qed						 
paulson@14269
   443
paulson@14365
   444
lemma real_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::real)"
paulson@14365
   445
apply (simp add: real_le_def, clarify)
paulson@14365
   446
apply (rename_tac x1 u1 y1 v1 x2 u2 y2 v2) 
paulson@14365
   447
apply (drule mem_REAL_imp_eq [OF Rep_REAL], assumption)  
paulson@14365
   448
apply (rule_tac x=x1 in exI) 
paulson@14365
   449
apply (rule_tac x=y1 in exI) 
paulson@14365
   450
apply (rule_tac x="u2 + (x2 + v1)" in exI) 
paulson@14365
   451
apply (rule_tac x="v2 + (u1 + y2)" in exI) 
paulson@14365
   452
apply (simp add: Rep_REAL_cancel_right preal_add_le_cancel_right 
paulson@14365
   453
                 preal_add_assoc [symmetric] real_le_trans_lemma)
paulson@14269
   454
done
paulson@14269
   455
paulson@14365
   456
lemma real_le_anti_sym_lemma: 
paulson@14365
   457
  assumes le1: "x1 + y2 \<le> x2 + y1"
paulson@14365
   458
      and le2: "u1 + v2 \<le> u2 + v1"
paulson@14365
   459
      and eq1: "x1 + v2 = u2 + y1"
paulson@14365
   460
      and eq2: "x2 + v1 = u1 + y2"
paulson@14365
   461
  shows "x2 + y1 = x1 + (y2::preal)"
paulson@14365
   462
proof (rule order_antisym)
paulson@14365
   463
  show "x1 + y2 \<le> x2 + y1" .
paulson@14365
   464
  have "(x2 + y1) + (u1+u2) = x2 + u1 + (u2 + y1)" by (simp add: preal_add_ac)
paulson@14365
   465
  also have "... = x2 + u1 + (x1 + v2)" by (simp add: prems)
paulson@14365
   466
  also have "... = (x2 + x1) + (u1 + v2)" by (simp add: preal_add_ac)
paulson@14365
   467
  also have "... \<le> (x2 + x1) + (u2 + v1)" 
paulson@14365
   468
                                  by (simp add: preal_add_le_cancel_left)
paulson@14365
   469
  also have "... = (x1 + u2) + (x2 + v1)" by (simp add: preal_add_ac)
paulson@14365
   470
  also have "... = (x1 + u2) + (u1 + y2)" by (simp add: prems)
paulson@14365
   471
  also have "... = (x1 + y2) + (u1 + u2)" by (simp add: preal_add_ac)
paulson@14365
   472
  finally show "x2 + y1 \<le> x1 + y2" by (simp add: preal_add_le_cancel_right)
paulson@14365
   473
qed  
paulson@14334
   474
paulson@14334
   475
lemma real_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::real)"
paulson@14365
   476
apply (simp add: real_le_def, clarify) 
paulson@14365
   477
apply (rule real_eq_iff [THEN iffD2], assumption+)
paulson@14365
   478
apply (drule mem_REAL_imp_eq [OF Rep_REAL], assumption)+
paulson@14365
   479
apply (blast intro: real_le_anti_sym_lemma) 
paulson@14334
   480
done
paulson@14334
   481
paulson@14334
   482
(* Axiom 'order_less_le' of class 'order': *)
paulson@14334
   483
lemma real_less_le: "((w::real) < z) = (w \<le> z & w \<noteq> z)"
paulson@14365
   484
by (simp add: real_less_def)
paulson@14365
   485
paulson@14365
   486
instance real :: order
paulson@14365
   487
proof qed
paulson@14365
   488
 (assumption |
paulson@14365
   489
  rule real_le_refl real_le_trans real_le_anti_sym real_less_le)+
paulson@14365
   490
paulson@14365
   491
text{*Simplifies a strange formula that occurs quantified.*}
paulson@14365
   492
lemma preal_strange_le_eq: "(x1 + x2 \<le> x2 + y1) = (x1 \<le> (y1::preal))"
paulson@14365
   493
by (simp add: preal_add_commute [of x1] preal_add_le_cancel_left) 
paulson@14365
   494
paulson@14365
   495
text{*This is the nicest way to prove linearity*}
paulson@14365
   496
lemma real_le_linear_0: "(z::real) \<le> 0 | 0 \<le> z"
paulson@14365
   497
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14365
   498
apply (auto simp add: real_le_def real_zero_def preal_add_ac 
paulson@14365
   499
                      preal_cancels preal_strange_le_eq)
paulson@14365
   500
apply (cut_tac x=x and y=y in linorder_linear, auto) 
paulson@14365
   501
done
paulson@14365
   502
paulson@14365
   503
lemma real_minus_zero_le_iff: "(0 \<le> -R) = (R \<le> (0::real))"
paulson@14365
   504
apply (rule_tac z = R in eq_Abs_REAL)
paulson@14365
   505
apply (force simp add: real_le_def real_zero_def real_minus preal_add_ac 
paulson@14365
   506
                       preal_cancels preal_strange_le_eq)
paulson@14334
   507
done
paulson@14334
   508
paulson@14365
   509
lemma real_le_imp_diff_le_0: "x \<le> y ==> x-y \<le> (0::real)"
paulson@14365
   510
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14365
   511
apply (rule_tac z = y in eq_Abs_REAL)
paulson@14365
   512
apply (auto simp add: real_le_def real_zero_def real_diff_def real_minus 
paulson@14365
   513
    real_add preal_add_ac preal_cancels preal_strange_le_eq)
paulson@14365
   514
apply (rule exI)+
paulson@14365
   515
apply (rule conjI, assumption)
paulson@14365
   516
apply (subgoal_tac " x + (x2 + y1 + ya) = (x + y1) + (x2 + ya)")
paulson@14365
   517
 prefer 2 apply (simp (no_asm) only: preal_add_ac) 
paulson@14365
   518
apply (subgoal_tac "x1 + y2 + (xa + y) = (x1 + y) + (xa + y2)")
paulson@14365
   519
 prefer 2 apply (simp (no_asm) only: preal_add_ac) 
paulson@14365
   520
apply simp 
paulson@14365
   521
done
paulson@14365
   522
paulson@14365
   523
lemma real_diff_le_0_imp_le: "x-y \<le> (0::real) ==> x \<le> y"
paulson@14365
   524
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14365
   525
apply (rule_tac z = y in eq_Abs_REAL)
paulson@14365
   526
apply (auto simp add: real_le_def real_zero_def real_diff_def real_minus 
paulson@14365
   527
    real_add preal_add_ac preal_cancels preal_strange_le_eq)
paulson@14365
   528
apply (rule exI)+
paulson@14365
   529
apply (rule conjI, rule_tac [2] conjI)
paulson@14365
   530
 apply (rule_tac [2] refl)+
paulson@14365
   531
apply (subgoal_tac "(x + ya) + (x1 + y1) \<le> (xa + y) + (x1 + y1)") 
paulson@14365
   532
apply (simp add: preal_cancels)
paulson@14365
   533
apply (subgoal_tac "x1 + (x + (y1 + ya)) \<le> y1 + (x1 + (xa + y))")
paulson@14365
   534
 apply (simp add: preal_add_ac) 
paulson@14365
   535
apply (simp add: preal_cancels)
paulson@14365
   536
done
paulson@14365
   537
paulson@14365
   538
lemma real_le_eq_diff: "(x \<le> y) = (x-y \<le> (0::real))"
paulson@14365
   539
by (blast intro!: real_diff_le_0_imp_le real_le_imp_diff_le_0)
paulson@14365
   540
paulson@14334
   541
paulson@14334
   542
(* Axiom 'linorder_linear' of class 'linorder': *)
paulson@14334
   543
lemma real_le_linear: "(z::real) \<le> w | w \<le> z"
paulson@14365
   544
apply (insert real_le_linear_0 [of "z-w"])
paulson@14365
   545
apply (auto simp add: real_le_eq_diff [of w] real_le_eq_diff [of z] 
paulson@14365
   546
                      real_minus_zero_le_iff [symmetric])
paulson@14334
   547
done
paulson@14334
   548
paulson@14334
   549
instance real :: linorder
paulson@14334
   550
  by (intro_classes, rule real_le_linear)
paulson@14334
   551
paulson@14334
   552
paulson@14365
   553
lemma real_add_left_mono: "x \<le> y ==> z + x \<le> z + (y::real)"
paulson@14365
   554
apply (auto simp add: real_le_eq_diff [of x] real_le_eq_diff [of "z+x"])
paulson@14365
   555
apply (subgoal_tac "z + x - (z + y) = (z + -z) + (x - y)")
paulson@14365
   556
 prefer 2 apply (simp add: diff_minus add_ac, simp) 
paulson@14365
   557
done
paulson@14334
   558
paulson@14365
   559
paulson@14365
   560
lemma real_minus_zero_le_iff2: "(-R \<le> 0) = (0 \<le> (R::real))"
paulson@14365
   561
apply (rule_tac z = R in eq_Abs_REAL)
paulson@14365
   562
apply (force simp add: real_le_def real_zero_def real_minus preal_add_ac 
paulson@14365
   563
                       preal_cancels preal_strange_le_eq)
paulson@14334
   564
done
paulson@14334
   565
paulson@14365
   566
lemma real_minus_zero_less_iff: "(0 < -R) = (R < (0::real))"
paulson@14365
   567
by (simp add: linorder_not_le [symmetric] real_minus_zero_le_iff2) 
paulson@14365
   568
paulson@14365
   569
lemma real_minus_zero_less_iff2: "(-R < 0) = ((0::real) < R)"
paulson@14365
   570
by (simp add: linorder_not_le [symmetric] real_minus_zero_le_iff) 
paulson@14334
   571
paulson@14365
   572
lemma real_sum_gt_zero_less: "(0 < S + (-W::real)) ==> (W < S)"
paulson@14365
   573
by (simp add: linorder_not_le [symmetric] real_le_eq_diff [of S] diff_minus)
paulson@14365
   574
paulson@14365
   575
text{*Used a few times in Lim and Transcendental*}
paulson@14365
   576
lemma real_less_sum_gt_zero: "(W < S) ==> (0 < S + (-W::real))"
paulson@14365
   577
by (simp add: linorder_not_le [symmetric] real_le_eq_diff [of S] diff_minus)
paulson@14334
   578
paulson@14365
   579
text{*Handles other strange cases that arise in these proofs.*}
paulson@14365
   580
lemma forall_imp_less: "\<forall>u v. u \<le> v \<longrightarrow> x + v \<noteq> u + (y::preal) ==> y < x";
paulson@14365
   581
apply (drule_tac x=x in spec) 
paulson@14365
   582
apply (drule_tac x=y in spec) 
paulson@14365
   583
apply (simp add: preal_add_commute linorder_not_le) 
paulson@14365
   584
done
paulson@14334
   585
paulson@14365
   586
text{*The arithmetic decision procedure is not set up for type preal.*}
paulson@14365
   587
lemma preal_eq_le_imp_le:
paulson@14365
   588
  assumes eq: "a+b = c+d" and le: "c \<le> a"
paulson@14365
   589
  shows "b \<le> (d::preal)"
paulson@14365
   590
proof -
paulson@14365
   591
  have "c+d \<le> a+d" by (simp add: prems preal_cancels)
paulson@14365
   592
  hence "a+b \<le> a+d" by (simp add: prems)
paulson@14365
   593
  thus "b \<le> d" by (simp add: preal_cancels)
paulson@14365
   594
qed
paulson@14334
   595
paulson@14334
   596
lemma real_mult_order: "[| 0 < x; 0 < y |] ==> (0::real) < x * y"
paulson@14365
   597
apply (simp add: linorder_not_le [symmetric])
paulson@14365
   598
  --{*Reduce to the (simpler) @{text "\<le>"} relation *}
paulson@14365
   599
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14365
   600
apply (rule_tac z = y in eq_Abs_REAL)
paulson@14365
   601
apply (auto simp add: real_zero_def real_le_def real_mult preal_add_ac 
paulson@14365
   602
                      preal_cancels preal_strange_le_eq)
paulson@14365
   603
apply (drule preal_eq_le_imp_le, assumption)
paulson@14365
   604
apply (auto  dest!: forall_imp_less less_add_left_Ex 
paulson@14365
   605
     simp add: preal_add_ac preal_mult_ac 
paulson@14365
   606
         preal_add_mult_distrib preal_add_mult_distrib2)
paulson@14365
   607
apply (insert preal_self_less_add_right)
paulson@14365
   608
apply (simp add: linorder_not_le [symmetric])
paulson@14334
   609
done
paulson@14334
   610
paulson@14334
   611
lemma real_mult_less_mono2: "[| (0::real) < z; x < y |] ==> z * x < z * y"
paulson@14334
   612
apply (rule real_sum_gt_zero_less)
paulson@14334
   613
apply (drule real_less_sum_gt_zero [of x y])
paulson@14334
   614
apply (drule real_mult_order, assumption)
paulson@14334
   615
apply (simp add: right_distrib)
paulson@14334
   616
done
paulson@14334
   617
paulson@14365
   618
text{*lemma for proving @{term "0<(1::real)"}*}
paulson@14365
   619
lemma real_zero_le_one: "0 \<le> (1::real)"
paulson@14365
   620
apply (auto simp add: real_zero_def real_one_def real_le_def preal_add_ac 
paulson@14365
   621
                      preal_cancels)
paulson@14365
   622
apply (rule_tac x="preal_of_rat 1 + preal_of_rat 1" in exI) 
paulson@14365
   623
apply (rule_tac x="preal_of_rat 1" in exI) 
paulson@14365
   624
apply (auto simp add: preal_add_ac preal_self_less_add_left order_less_imp_le)
paulson@14334
   625
done
paulson@14334
   626
paulson@14334
   627
subsection{*The Reals Form an Ordered Field*}
paulson@14334
   628
paulson@14334
   629
instance real :: ordered_field
paulson@14334
   630
proof
paulson@14334
   631
  fix x y z :: real
paulson@14365
   632
  show "0 < (1::real)"
paulson@14365
   633
    by (simp add: real_less_def real_zero_le_one real_zero_not_eq_one)  
paulson@14334
   634
  show "x \<le> y ==> z + x \<le> z + y" by (rule real_add_left_mono)
paulson@14334
   635
  show "x < y ==> 0 < z ==> z * x < z * y" by (simp add: real_mult_less_mono2)
paulson@14334
   636
  show "\<bar>x\<bar> = (if x < 0 then -x else x)"
paulson@14334
   637
    by (auto dest: order_le_less_trans simp add: real_abs_def linorder_not_le)
paulson@14334
   638
qed
paulson@14334
   639
paulson@14365
   640
paulson@14365
   641
paulson@14365
   642
text{*The function @{term real_of_preal} requires many proofs, but it seems
paulson@14365
   643
to be essential for proving completeness of the reals from that of the
paulson@14365
   644
positive reals.*}
paulson@14365
   645
paulson@14365
   646
lemma real_of_preal_add:
paulson@14365
   647
     "real_of_preal ((x::preal) + y) = real_of_preal x + real_of_preal y"
paulson@14365
   648
by (simp add: real_of_preal_def real_add preal_add_mult_distrib preal_mult_1 
paulson@14365
   649
              preal_add_ac)
paulson@14365
   650
paulson@14365
   651
lemma real_of_preal_mult:
paulson@14365
   652
     "real_of_preal ((x::preal) * y) = real_of_preal x* real_of_preal y"
paulson@14365
   653
by (simp add: real_of_preal_def real_mult preal_add_mult_distrib2
paulson@14365
   654
              preal_mult_1 preal_mult_1_right preal_add_ac preal_mult_ac)
paulson@14365
   655
paulson@14365
   656
paulson@14365
   657
text{*Gleason prop 9-4.4 p 127*}
paulson@14365
   658
lemma real_of_preal_trichotomy:
paulson@14365
   659
      "\<exists>m. (x::real) = real_of_preal m | x = 0 | x = -(real_of_preal m)"
paulson@14365
   660
apply (unfold real_of_preal_def real_zero_def)
paulson@14365
   661
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14365
   662
apply (auto simp add: real_minus preal_add_ac)
paulson@14365
   663
apply (cut_tac x = x and y = y in linorder_less_linear)
paulson@14365
   664
apply (auto dest!: less_add_left_Ex simp add: preal_add_assoc [symmetric])
paulson@14365
   665
apply (auto simp add: preal_add_commute)
paulson@14365
   666
done
paulson@14365
   667
paulson@14365
   668
lemma real_of_preal_leD:
paulson@14365
   669
      "real_of_preal m1 \<le> real_of_preal m2 ==> m1 \<le> m2"
paulson@14365
   670
apply (unfold real_of_preal_def)
paulson@14365
   671
apply (auto simp add: real_le_def preal_add_ac)
paulson@14365
   672
apply (auto simp add: preal_add_assoc [symmetric] preal_add_right_cancel_iff)
paulson@14365
   673
apply (auto simp add: preal_add_ac preal_add_le_cancel_left)
paulson@14365
   674
done
paulson@14365
   675
paulson@14365
   676
lemma real_of_preal_lessI: "m1 < m2 ==> real_of_preal m1 < real_of_preal m2"
paulson@14365
   677
by (auto simp add: real_of_preal_leD linorder_not_le [symmetric])
paulson@14365
   678
paulson@14365
   679
lemma real_of_preal_lessD:
paulson@14365
   680
      "real_of_preal m1 < real_of_preal m2 ==> m1 < m2"
paulson@14365
   681
apply (auto simp add: real_less_def)
paulson@14365
   682
apply (drule real_of_preal_leD) 
paulson@14365
   683
apply (auto simp add: order_le_less) 
paulson@14365
   684
done
paulson@14365
   685
paulson@14365
   686
lemma real_of_preal_less_iff [simp]:
paulson@14365
   687
     "(real_of_preal m1 < real_of_preal m2) = (m1 < m2)"
paulson@14365
   688
by (blast intro: real_of_preal_lessI real_of_preal_lessD)
paulson@14365
   689
paulson@14365
   690
lemma real_of_preal_le_iff:
paulson@14365
   691
     "(real_of_preal m1 \<le> real_of_preal m2) = (m1 \<le> m2)"
paulson@14365
   692
by (simp add: linorder_not_less [symmetric]) 
paulson@14365
   693
paulson@14365
   694
lemma real_of_preal_zero_less: "0 < real_of_preal m"
paulson@14365
   695
apply (auto simp add: real_zero_def real_of_preal_def real_less_def real_le_def
paulson@14365
   696
            preal_add_ac preal_cancels)
paulson@14365
   697
apply (simp_all add: preal_add_assoc [symmetric] preal_cancels)
paulson@14365
   698
apply (blast intro: preal_self_less_add_left order_less_imp_le)
paulson@14365
   699
apply (insert preal_not_eq_self [of "preal_of_rat 1" m]) 
paulson@14365
   700
apply (simp add: preal_add_ac) 
paulson@14365
   701
done
paulson@14365
   702
paulson@14365
   703
lemma real_of_preal_minus_less_zero: "- real_of_preal m < 0"
paulson@14365
   704
by (simp add: real_of_preal_zero_less)
paulson@14365
   705
paulson@14365
   706
lemma real_of_preal_not_minus_gt_zero: "~ 0 < - real_of_preal m"
paulson@14365
   707
apply (cut_tac real_of_preal_minus_less_zero)
paulson@14365
   708
apply (fast dest: order_less_trans)
paulson@14365
   709
done
paulson@14365
   710
paulson@14365
   711
paulson@14365
   712
subsection{*Theorems About the Ordering*}
paulson@14365
   713
paulson@14365
   714
text{*obsolete but used a lot*}
paulson@14365
   715
paulson@14365
   716
lemma real_not_refl2: "x < y ==> x \<noteq> (y::real)"
paulson@14365
   717
by blast 
paulson@14365
   718
paulson@14365
   719
lemma real_le_imp_less_or_eq: "!!(x::real). x \<le> y ==> x < y | x = y"
paulson@14365
   720
by (simp add: order_le_less)
paulson@14365
   721
paulson@14365
   722
lemma real_gt_zero_preal_Ex: "(0 < x) = (\<exists>y. x = real_of_preal y)"
paulson@14365
   723
apply (auto simp add: real_of_preal_zero_less)
paulson@14365
   724
apply (cut_tac x = x in real_of_preal_trichotomy)
paulson@14365
   725
apply (blast elim!: real_of_preal_not_minus_gt_zero [THEN notE])
paulson@14365
   726
done
paulson@14365
   727
paulson@14365
   728
lemma real_gt_preal_preal_Ex:
paulson@14365
   729
     "real_of_preal z < x ==> \<exists>y. x = real_of_preal y"
paulson@14365
   730
by (blast dest!: real_of_preal_zero_less [THEN order_less_trans]
paulson@14365
   731
             intro: real_gt_zero_preal_Ex [THEN iffD1])
paulson@14365
   732
paulson@14365
   733
lemma real_ge_preal_preal_Ex:
paulson@14365
   734
     "real_of_preal z \<le> x ==> \<exists>y. x = real_of_preal y"
paulson@14365
   735
by (blast dest: order_le_imp_less_or_eq real_gt_preal_preal_Ex)
paulson@14365
   736
paulson@14365
   737
lemma real_less_all_preal: "y \<le> 0 ==> \<forall>x. y < real_of_preal x"
paulson@14365
   738
by (auto elim: order_le_imp_less_or_eq [THEN disjE] 
paulson@14365
   739
            intro: real_of_preal_zero_less [THEN [2] order_less_trans] 
paulson@14365
   740
            simp add: real_of_preal_zero_less)
paulson@14365
   741
paulson@14365
   742
lemma real_less_all_real2: "~ 0 < y ==> \<forall>x. y < real_of_preal x"
paulson@14365
   743
by (blast intro!: real_less_all_preal linorder_not_less [THEN iffD1])
paulson@14365
   744
paulson@14334
   745
lemma real_add_less_le_mono: "[| w'<w; z'\<le>z |] ==> w' + z' < w + (z::real)"
paulson@14365
   746
  by (rule Ring_and_Field.add_less_le_mono)
paulson@14334
   747
paulson@14334
   748
lemma real_add_le_less_mono:
paulson@14334
   749
     "!!z z'::real. [| w'\<le>w; z'<z |] ==> w' + z' < w + z"
paulson@14365
   750
  by (rule Ring_and_Field.add_le_less_mono)
paulson@14334
   751
paulson@14334
   752
lemma real_zero_less_one: "0 < (1::real)"
paulson@14334
   753
  by (rule Ring_and_Field.zero_less_one)
paulson@14334
   754
paulson@14334
   755
lemma real_le_square [simp]: "(0::real) \<le> x*x"
paulson@14334
   756
 by (rule Ring_and_Field.zero_le_square)
paulson@14334
   757
paulson@14334
   758
paulson@14334
   759
subsection{*More Lemmas*}
paulson@14334
   760
paulson@14334
   761
lemma real_mult_left_cancel: "(c::real) \<noteq> 0 ==> (c*a=c*b) = (a=b)"
paulson@14334
   762
by auto
paulson@14334
   763
paulson@14334
   764
lemma real_mult_right_cancel: "(c::real) \<noteq> 0 ==> (a*c=b*c) = (a=b)"
paulson@14334
   765
by auto
paulson@14334
   766
paulson@14334
   767
text{*The precondition could be weakened to @{term "0\<le>x"}*}
paulson@14334
   768
lemma real_mult_less_mono:
paulson@14334
   769
     "[| u<v;  x<y;  (0::real) < v;  0 < x |] ==> u*x < v* y"
paulson@14334
   770
 by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
paulson@14334
   771
paulson@14334
   772
lemma real_mult_less_iff1 [simp]: "(0::real) < z ==> (x*z < y*z) = (x < y)"
paulson@14334
   773
  by (force elim: order_less_asym
paulson@14334
   774
            simp add: Ring_and_Field.mult_less_cancel_right)
paulson@14334
   775
paulson@14334
   776
lemma real_mult_le_cancel_iff1 [simp]: "(0::real) < z ==> (x*z \<le> y*z) = (x\<le>y)"
paulson@14365
   777
apply (simp add: mult_le_cancel_right)
paulson@14365
   778
apply (blast intro: elim: order_less_asym) 
paulson@14365
   779
done
paulson@14334
   780
paulson@14334
   781
lemma real_mult_le_cancel_iff2 [simp]: "(0::real) < z ==> (z*x \<le> z*y) = (x\<le>y)"
paulson@14334
   782
  by (force elim: order_less_asym
paulson@14334
   783
            simp add: Ring_and_Field.mult_le_cancel_left)
paulson@14334
   784
paulson@14334
   785
text{*Only two uses?*}
paulson@14334
   786
lemma real_mult_less_mono':
paulson@14334
   787
     "[| x < y;  r1 < r2;  (0::real) \<le> r1;  0 \<le> x|] ==> r1 * x < r2 * y"
paulson@14334
   788
 by (rule Ring_and_Field.mult_strict_mono')
paulson@14334
   789
paulson@14334
   790
text{*FIXME: delete or at least combine the next two lemmas*}
paulson@14334
   791
lemma real_sum_squares_cancel: "x * x + y * y = 0 ==> x = (0::real)"
paulson@14334
   792
apply (drule Ring_and_Field.equals_zero_I [THEN sym])
paulson@14334
   793
apply (cut_tac x = y in real_le_square) 
paulson@14334
   794
apply (auto, drule real_le_anti_sym, auto)
paulson@14334
   795
done
paulson@14334
   796
paulson@14334
   797
lemma real_sum_squares_cancel2: "x * x + y * y = 0 ==> y = (0::real)"
paulson@14334
   798
apply (rule_tac y = x in real_sum_squares_cancel)
paulson@14334
   799
apply (simp add: real_add_commute)
paulson@14334
   800
done
paulson@14334
   801
paulson@14334
   802
lemma real_add_order: "[| 0 < x; 0 < y |] ==> (0::real) < x + y"
paulson@14365
   803
by (drule add_strict_mono [of concl: 0 0], assumption, simp)
paulson@14334
   804
paulson@14334
   805
lemma real_le_add_order: "[| 0 \<le> x; 0 \<le> y |] ==> (0::real) \<le> x + y"
paulson@14334
   806
apply (drule order_le_imp_less_or_eq)+
paulson@14334
   807
apply (auto intro: real_add_order order_less_imp_le)
paulson@14334
   808
done
paulson@14334
   809
paulson@14365
   810
lemma real_inverse_unique: "x*y = (1::real) ==> y = inverse x"
paulson@14365
   811
apply (case_tac "x \<noteq> 0")
paulson@14365
   812
apply (rule_tac c1 = x in real_mult_left_cancel [THEN iffD1], auto)
paulson@14365
   813
done
paulson@14334
   814
paulson@14365
   815
lemma real_inverse_gt_one: "[| (0::real) < x; x < 1 |] ==> 1 < inverse x"
paulson@14365
   816
by (auto dest: less_imp_inverse_less)
paulson@14334
   817
paulson@14365
   818
lemma real_mult_self_sum_ge_zero: "(0::real) \<le> x*x + y*y"
paulson@14365
   819
proof -
paulson@14365
   820
  have "0 + 0 \<le> x*x + y*y" by (blast intro: add_mono zero_le_square)
paulson@14365
   821
  thus ?thesis by simp
paulson@14365
   822
qed
paulson@14365
   823
paulson@14334
   824
paulson@14365
   825
subsection{*Embedding the Integers into the Reals*}
paulson@14365
   826
paulson@14365
   827
lemma real_of_int_congruent: 
paulson@14365
   828
  "congruent intrel (%p. (%(i,j). realrel ``  
paulson@14365
   829
   {(preal_of_rat (rat (int(Suc i))), preal_of_rat (rat (int(Suc j))))}) p)"
paulson@14365
   830
apply (simp add: congruent_def add_ac del: int_Suc, clarify)
paulson@14365
   831
(*OPTION raised if only is changed to add?????????*)  
paulson@14365
   832
apply (simp only: add_Suc_right zero_less_rat_of_int_iff zadd_int
paulson@14365
   833
          preal_of_rat_add [symmetric] rat_of_int_add_distrib [symmetric], simp) 
paulson@14334
   834
done
paulson@14334
   835
paulson@14365
   836
lemma real_of_int: 
paulson@14365
   837
   "real (Abs_Integ (intrel `` {(i, j)})) =  
paulson@14365
   838
      Abs_REAL(realrel ``  
paulson@14365
   839
        {(preal_of_rat (rat (int(Suc i))),  
paulson@14365
   840
          preal_of_rat (rat (int(Suc j))))})"
paulson@14365
   841
apply (unfold real_of_int_def)
paulson@14365
   842
apply (rule_tac f = Abs_REAL in arg_cong)
paulson@14365
   843
apply (simp del: int_Suc
paulson@14365
   844
            add: realrel_in_real [THEN Abs_REAL_inverse] 
paulson@14365
   845
             UN_equiv_class [OF equiv_intrel real_of_int_congruent])
paulson@14365
   846
done
paulson@14365
   847
paulson@14365
   848
lemma inj_real_of_int: "inj(real :: int => real)"
paulson@14365
   849
apply (rule inj_onI)
paulson@14365
   850
apply (rule_tac z = x in eq_Abs_Integ)
paulson@14365
   851
apply (rule_tac z = y in eq_Abs_Integ, clarify) 
paulson@14365
   852
apply (simp del: int_Suc 
paulson@14365
   853
            add: real_of_int zadd_int preal_of_rat_eq_iff
paulson@14365
   854
               preal_of_rat_add [symmetric] rat_of_int_add_distrib [symmetric])
paulson@14365
   855
done
paulson@14365
   856
paulson@14365
   857
lemma real_of_int_int_zero: "real (int 0) = 0"  
paulson@14365
   858
by (simp add: int_def real_zero_def real_of_int preal_add_commute)
paulson@14365
   859
paulson@14365
   860
lemma real_of_int_zero [simp]: "real (0::int) = 0"  
paulson@14365
   861
by (insert real_of_int_int_zero, simp)
paulson@14365
   862
paulson@14365
   863
lemma real_of_one [simp]: "real (1::int) = (1::real)"
paulson@14365
   864
apply (subst int_1 [symmetric])
paulson@14365
   865
apply (simp add: int_def real_one_def)
paulson@14365
   866
apply (simp add: real_of_int preal_of_rat_add [symmetric])  
paulson@14334
   867
done
paulson@14334
   868
paulson@14365
   869
lemma real_of_int_add: "real (x::int) + real y = real (x + y)"
paulson@14365
   870
apply (rule_tac z = x in eq_Abs_Integ)
paulson@14365
   871
apply (rule_tac z = y in eq_Abs_Integ, clarify) 
paulson@14365
   872
apply (simp del: int_Suc
paulson@14365
   873
            add: pos_add_strict real_of_int real_add zadd
paulson@14365
   874
                 preal_of_rat_add [symmetric], simp) 
paulson@14365
   875
done
paulson@14365
   876
declare real_of_int_add [symmetric, simp]
paulson@14365
   877
paulson@14365
   878
lemma real_of_int_minus: "-real (x::int) = real (-x)"
paulson@14365
   879
apply (rule_tac z = x in eq_Abs_Integ)
paulson@14365
   880
apply (auto simp add: real_of_int real_minus zminus)
paulson@14365
   881
done
paulson@14365
   882
declare real_of_int_minus [symmetric, simp]
paulson@14365
   883
paulson@14365
   884
lemma real_of_int_diff: "real (x::int) - real y = real (x - y)"
paulson@14365
   885
by (simp only: zdiff_def real_diff_def real_of_int_add real_of_int_minus)
paulson@14365
   886
declare real_of_int_diff [symmetric, simp]
paulson@14334
   887
paulson@14365
   888
lemma real_of_int_mult: "real (x::int) * real y = real (x * y)"
paulson@14365
   889
apply (rule_tac z = x in eq_Abs_Integ)
paulson@14365
   890
apply (rule_tac z = y in eq_Abs_Integ)
paulson@14365
   891
apply (rename_tac a b c d) 
paulson@14365
   892
apply (simp del: int_Suc
paulson@14365
   893
            add: pos_add_strict mult_pos real_of_int real_mult zmult
paulson@14365
   894
                 preal_of_rat_add [symmetric] preal_of_rat_mult [symmetric])
paulson@14365
   895
apply (rule_tac f=preal_of_rat in arg_cong) 
paulson@14365
   896
apply (simp only: int_Suc right_distrib add_ac mult_ac zadd_int zmult_int
paulson@14365
   897
        rat_of_int_add_distrib [symmetric] rat_of_int_mult_distrib [symmetric]
paulson@14365
   898
        rat_inject)
paulson@14365
   899
done
paulson@14365
   900
declare real_of_int_mult [symmetric, simp]
paulson@14365
   901
paulson@14365
   902
lemma real_of_int_Suc: "real (int (Suc n)) = real (int n) + (1::real)"
paulson@14365
   903
by (simp only: real_of_one [symmetric] zadd_int add_ac int_Suc real_of_int_add)
paulson@14365
   904
paulson@14365
   905
lemma real_of_int_zero_cancel [simp]: "(real x = 0) = (x = (0::int))"
paulson@14365
   906
by (auto intro: inj_real_of_int [THEN injD])
paulson@14365
   907
paulson@14365
   908
lemma zero_le_real_of_int: "0 \<le> real y ==> 0 \<le> (y::int)"
paulson@14365
   909
apply (rule_tac z = y in eq_Abs_Integ)
paulson@14365
   910
apply (simp add: real_le_def, clarify)  
paulson@14365
   911
apply (rename_tac a b c d) 
paulson@14365
   912
apply (simp del: int_Suc zdiff_def [symmetric]
paulson@14365
   913
            add: real_zero_def real_of_int zle_def zless_def zdiff_def zadd
paulson@14365
   914
                 zminus neg_def preal_add_ac preal_cancels)
paulson@14365
   915
apply (drule sym, drule preal_eq_le_imp_le, assumption) 
paulson@14365
   916
apply (simp del: int_Suc add: preal_of_rat_le_iff)
paulson@14334
   917
done
paulson@14334
   918
paulson@14365
   919
lemma real_of_int_le_cancel:
paulson@14365
   920
  assumes le: "real (x::int) \<le> real y"
paulson@14365
   921
  shows "x \<le> y"
paulson@14365
   922
proof -
paulson@14365
   923
  have "real x - real x \<le> real y - real x" using le
paulson@14365
   924
    by (simp only: diff_minus add_le_cancel_right) 
paulson@14365
   925
  hence "0 \<le> real y - real x" by simp
paulson@14365
   926
  hence "0 \<le> y - x" by (simp only: real_of_int_diff zero_le_real_of_int) 
paulson@14365
   927
  hence "0 + x \<le> (y - x) + x" by (simp only: add_le_cancel_right) 
paulson@14365
   928
  thus  "x \<le> y" by simp 
paulson@14365
   929
qed
paulson@14365
   930
paulson@14365
   931
lemma real_of_int_inject [iff]: "(real (x::int) = real y) = (x = y)"
paulson@14365
   932
by (blast dest!: inj_real_of_int [THEN injD])
paulson@14365
   933
paulson@14365
   934
lemma real_of_int_less_cancel: "real (x::int) < real y ==> x < y"
paulson@14365
   935
by (auto simp add: order_less_le real_of_int_le_cancel)
paulson@14365
   936
paulson@14365
   937
lemma real_of_int_less_mono: "x < y ==> (real (x::int) < real y)"
paulson@14365
   938
apply (simp add: linorder_not_le [symmetric])
paulson@14365
   939
apply (auto dest!: real_of_int_less_cancel simp add: order_le_less)
paulson@14365
   940
done
paulson@14365
   941
paulson@14365
   942
lemma real_of_int_less_iff [iff]: "(real (x::int) < real y) = (x < y)"
paulson@14365
   943
by (blast dest: real_of_int_less_cancel intro: real_of_int_less_mono)
paulson@14365
   944
paulson@14365
   945
lemma real_of_int_le_iff [simp]: "(real (x::int) \<le> real y) = (x \<le> y)"
paulson@14365
   946
by (simp add: linorder_not_less [symmetric])
paulson@14365
   947
paulson@14365
   948
paulson@14365
   949
subsection{*Embedding the Naturals into the Reals*}
paulson@14365
   950
paulson@14334
   951
lemma real_of_nat_zero [simp]: "real (0::nat) = 0"
paulson@14365
   952
by (simp add: real_of_nat_def)
paulson@14334
   953
paulson@14334
   954
lemma real_of_nat_one [simp]: "real (Suc 0) = (1::real)"
paulson@14365
   955
by (simp add: real_of_nat_def)
paulson@14334
   956
paulson@14365
   957
lemma real_of_nat_add [simp]: "real (m + n) = real (m::nat) + real n"
paulson@14365
   958
by (simp add: real_of_nat_def add_ac)
paulson@14334
   959
paulson@14334
   960
(*Not for addsimps: often the LHS is used to represent a positive natural*)
paulson@14334
   961
lemma real_of_nat_Suc: "real (Suc n) = real n + (1::real)"
paulson@14365
   962
by (simp add: real_of_nat_def add_ac)
paulson@14334
   963
paulson@14334
   964
lemma real_of_nat_less_iff [iff]: 
paulson@14334
   965
     "(real (n::nat) < real m) = (n < m)"
paulson@14365
   966
by (simp add: real_of_nat_def)
paulson@14334
   967
paulson@14334
   968
lemma real_of_nat_le_iff [iff]: "(real (n::nat) \<le> real m) = (n \<le> m)"
paulson@14334
   969
by (simp add: linorder_not_less [symmetric])
paulson@14334
   970
paulson@14334
   971
lemma inj_real_of_nat: "inj (real :: nat => real)"
paulson@14334
   972
apply (rule inj_onI)
paulson@14365
   973
apply (simp add: real_of_nat_def)
paulson@14334
   974
done
paulson@14334
   975
paulson@14334
   976
lemma real_of_nat_ge_zero [iff]: "0 \<le> real (n::nat)"
paulson@14365
   977
apply (insert real_of_int_le_iff [of 0 "int n"]) 
paulson@14365
   978
apply (simp add: real_of_nat_def) 
paulson@14334
   979
done
paulson@14334
   980
paulson@14365
   981
lemma real_of_nat_Suc_gt_zero: "0 < real (Suc n)"
paulson@14365
   982
by (insert real_of_nat_less_iff [of 0 "Suc n"], simp) 
paulson@14365
   983
paulson@14334
   984
lemma real_of_nat_mult [simp]: "real (m * n) = real (m::nat) * real n"
paulson@14365
   985
by (simp add: real_of_nat_def zmult_int [symmetric]) 
paulson@14334
   986
paulson@14334
   987
lemma real_of_nat_inject [iff]: "(real (n::nat) = real m) = (n = m)"
paulson@14334
   988
by (auto dest: inj_real_of_nat [THEN injD])
paulson@14334
   989
paulson@14334
   990
lemma real_of_nat_zero_iff: "(real (n::nat) = 0) = (n = 0)"
paulson@14334
   991
  proof 
paulson@14334
   992
    assume "real n = 0"
paulson@14334
   993
    have "real n = real (0::nat)" by simp
paulson@14334
   994
    then show "n = 0" by (simp only: real_of_nat_inject)
paulson@14334
   995
  next
paulson@14334
   996
    show "n = 0 \<Longrightarrow> real n = 0" by simp
paulson@14334
   997
  qed
paulson@14334
   998
paulson@14365
   999
lemma real_of_nat_diff: "n \<le> m ==> real (m - n) = real (m::nat) - real n"
paulson@14365
  1000
by (simp add: real_of_nat_def zdiff_int [symmetric])
paulson@14365
  1001
paulson@14334
  1002
lemma real_of_nat_neg_int [simp]: "neg z ==> real (nat z) = 0"
paulson@14365
  1003
by (simp add: neg_nat)
paulson@14334
  1004
paulson@14365
  1005
lemma real_of_nat_gt_zero_cancel_iff [simp]: "(0 < real (n::nat)) = (0 < n)"
paulson@14365
  1006
by (rule real_of_nat_less_iff [THEN subst], auto)
paulson@14365
  1007
paulson@14365
  1008
lemma real_of_nat_le_zero_cancel_iff [simp]: "(real (n::nat) \<le> 0) = (n = 0)"
paulson@14365
  1009
apply (rule real_of_nat_zero [THEN subst])
paulson@14365
  1010
apply (simp only: real_of_nat_le_iff, simp) 
paulson@14334
  1011
done
paulson@14334
  1012
paulson@14334
  1013
paulson@14365
  1014
lemma not_real_of_nat_less_zero [simp]: "~ real (n::nat) < 0"
paulson@14365
  1015
by (simp add: linorder_not_less real_of_nat_ge_zero)
paulson@14334
  1016
paulson@14365
  1017
lemma real_of_nat_ge_zero_cancel_iff [simp]: "(0 \<le> real (n::nat)) = (0 \<le> n)"
paulson@14365
  1018
by (simp add: linorder_not_less)
paulson@14334
  1019
paulson@14365
  1020
text{*Now obsolete, but used in Hyperreal/IntFloor???*}
paulson@14365
  1021
lemma real_of_int_real_of_nat: "real (int n) = real n"
paulson@14365
  1022
by (simp add: real_of_nat_def)
paulson@14334
  1023
paulson@14365
  1024
lemma real_of_nat_real_of_int: "~neg z ==> real (nat z) = real z"
paulson@14365
  1025
by (simp add: not_neg_eq_ge_0 real_of_nat_def)
paulson@14334
  1026
paulson@14334
  1027
ML
paulson@14334
  1028
{*
paulson@14334
  1029
val real_abs_def = thm "real_abs_def";
paulson@14334
  1030
paulson@14341
  1031
val real_le_def = thm "real_le_def";
paulson@14341
  1032
val real_diff_def = thm "real_diff_def";
paulson@14341
  1033
val real_divide_def = thm "real_divide_def";
paulson@14341
  1034
paulson@14341
  1035
val preal_trans_lemma = thm"preal_trans_lemma";
paulson@14341
  1036
val realrel_iff = thm"realrel_iff";
paulson@14341
  1037
val realrel_refl = thm"realrel_refl";
paulson@14341
  1038
val equiv_realrel = thm"equiv_realrel";
paulson@14341
  1039
val equiv_realrel_iff = thm"equiv_realrel_iff";
paulson@14341
  1040
val realrel_in_real = thm"realrel_in_real";
paulson@14341
  1041
val inj_on_Abs_REAL = thm"inj_on_Abs_REAL";
paulson@14341
  1042
val eq_realrelD = thm"eq_realrelD";
paulson@14341
  1043
val inj_Rep_REAL = thm"inj_Rep_REAL";
paulson@14341
  1044
val inj_real_of_preal = thm"inj_real_of_preal";
paulson@14341
  1045
val eq_Abs_REAL = thm"eq_Abs_REAL";
paulson@14341
  1046
val real_minus_congruent = thm"real_minus_congruent";
paulson@14341
  1047
val real_minus = thm"real_minus";
paulson@14341
  1048
val real_add = thm"real_add";
paulson@14341
  1049
val real_add_commute = thm"real_add_commute";
paulson@14341
  1050
val real_add_assoc = thm"real_add_assoc";
paulson@14341
  1051
val real_add_zero_left = thm"real_add_zero_left";
paulson@14341
  1052
val real_add_zero_right = thm"real_add_zero_right";
paulson@14341
  1053
paulson@14334
  1054
val real_mult = thm"real_mult";
paulson@14334
  1055
val real_mult_commute = thm"real_mult_commute";
paulson@14334
  1056
val real_mult_assoc = thm"real_mult_assoc";
paulson@14334
  1057
val real_mult_1 = thm"real_mult_1";
paulson@14334
  1058
val real_mult_1_right = thm"real_mult_1_right";
paulson@14334
  1059
val preal_le_linear = thm"preal_le_linear";
paulson@14365
  1060
val real_mult_inverse_left = thm"real_mult_inverse_left";
paulson@14334
  1061
val real_not_refl2 = thm"real_not_refl2";
paulson@14334
  1062
val real_of_preal_add = thm"real_of_preal_add";
paulson@14334
  1063
val real_of_preal_mult = thm"real_of_preal_mult";
paulson@14334
  1064
val real_of_preal_trichotomy = thm"real_of_preal_trichotomy";
paulson@14334
  1065
val real_of_preal_minus_less_zero = thm"real_of_preal_minus_less_zero";
paulson@14334
  1066
val real_of_preal_not_minus_gt_zero = thm"real_of_preal_not_minus_gt_zero";
paulson@14334
  1067
val real_of_preal_zero_less = thm"real_of_preal_zero_less";
paulson@14334
  1068
val real_le_imp_less_or_eq = thm"real_le_imp_less_or_eq";
paulson@14334
  1069
val real_le_refl = thm"real_le_refl";
paulson@14334
  1070
val real_le_linear = thm"real_le_linear";
paulson@14334
  1071
val real_le_trans = thm"real_le_trans";
paulson@14334
  1072
val real_le_anti_sym = thm"real_le_anti_sym";
paulson@14334
  1073
val real_less_le = thm"real_less_le";
paulson@14334
  1074
val real_less_sum_gt_zero = thm"real_less_sum_gt_zero";
paulson@14334
  1075
val real_gt_zero_preal_Ex = thm "real_gt_zero_preal_Ex";
paulson@14334
  1076
val real_gt_preal_preal_Ex = thm "real_gt_preal_preal_Ex";
paulson@14334
  1077
val real_ge_preal_preal_Ex = thm "real_ge_preal_preal_Ex";
paulson@14334
  1078
val real_less_all_preal = thm "real_less_all_preal";
paulson@14334
  1079
val real_less_all_real2 = thm "real_less_all_real2";
paulson@14334
  1080
val real_of_preal_le_iff = thm "real_of_preal_le_iff";
paulson@14334
  1081
val real_mult_order = thm "real_mult_order";
paulson@14334
  1082
val real_zero_less_one = thm "real_zero_less_one";
paulson@14334
  1083
val real_add_less_le_mono = thm "real_add_less_le_mono";
paulson@14334
  1084
val real_add_le_less_mono = thm "real_add_le_less_mono";
paulson@14334
  1085
val real_add_order = thm "real_add_order";
paulson@14334
  1086
val real_le_add_order = thm "real_le_add_order";
paulson@14334
  1087
val real_le_square = thm "real_le_square";
paulson@14334
  1088
val real_mult_less_mono2 = thm "real_mult_less_mono2";
paulson@14334
  1089
paulson@14334
  1090
val real_mult_less_iff1 = thm "real_mult_less_iff1";
paulson@14334
  1091
val real_mult_le_cancel_iff1 = thm "real_mult_le_cancel_iff1";
paulson@14334
  1092
val real_mult_le_cancel_iff2 = thm "real_mult_le_cancel_iff2";
paulson@14334
  1093
val real_mult_less_mono = thm "real_mult_less_mono";
paulson@14334
  1094
val real_mult_less_mono' = thm "real_mult_less_mono'";
paulson@14334
  1095
val real_sum_squares_cancel = thm "real_sum_squares_cancel";
paulson@14334
  1096
val real_sum_squares_cancel2 = thm "real_sum_squares_cancel2";
paulson@14334
  1097
paulson@14334
  1098
val real_mult_left_cancel = thm"real_mult_left_cancel";
paulson@14334
  1099
val real_mult_right_cancel = thm"real_mult_right_cancel";
paulson@14365
  1100
val real_inverse_unique = thm "real_inverse_unique";
paulson@14365
  1101
val real_inverse_gt_one = thm "real_inverse_gt_one";
paulson@14365
  1102
paulson@14365
  1103
val real_of_int = thm"real_of_int";
paulson@14365
  1104
val inj_real_of_int = thm"inj_real_of_int";
paulson@14365
  1105
val real_of_int_zero = thm"real_of_int_zero";
paulson@14365
  1106
val real_of_one = thm"real_of_one";
paulson@14365
  1107
val real_of_int_add = thm"real_of_int_add";
paulson@14365
  1108
val real_of_int_minus = thm"real_of_int_minus";
paulson@14365
  1109
val real_of_int_diff = thm"real_of_int_diff";
paulson@14365
  1110
val real_of_int_mult = thm"real_of_int_mult";
paulson@14365
  1111
val real_of_int_Suc = thm"real_of_int_Suc";
paulson@14365
  1112
val real_of_int_real_of_nat = thm"real_of_int_real_of_nat";
paulson@14365
  1113
val real_of_nat_real_of_int = thm"real_of_nat_real_of_int";
paulson@14365
  1114
val real_of_int_less_cancel = thm"real_of_int_less_cancel";
paulson@14365
  1115
val real_of_int_inject = thm"real_of_int_inject";
paulson@14365
  1116
val real_of_int_less_mono = thm"real_of_int_less_mono";
paulson@14365
  1117
val real_of_int_less_iff = thm"real_of_int_less_iff";
paulson@14365
  1118
val real_of_int_le_iff = thm"real_of_int_le_iff";
paulson@14334
  1119
val real_of_nat_zero = thm "real_of_nat_zero";
paulson@14334
  1120
val real_of_nat_one = thm "real_of_nat_one";
paulson@14334
  1121
val real_of_nat_add = thm "real_of_nat_add";
paulson@14334
  1122
val real_of_nat_Suc = thm "real_of_nat_Suc";
paulson@14334
  1123
val real_of_nat_less_iff = thm "real_of_nat_less_iff";
paulson@14334
  1124
val real_of_nat_le_iff = thm "real_of_nat_le_iff";
paulson@14334
  1125
val inj_real_of_nat = thm "inj_real_of_nat";
paulson@14334
  1126
val real_of_nat_ge_zero = thm "real_of_nat_ge_zero";
paulson@14365
  1127
val real_of_nat_Suc_gt_zero = thm "real_of_nat_Suc_gt_zero";
paulson@14334
  1128
val real_of_nat_mult = thm "real_of_nat_mult";
paulson@14334
  1129
val real_of_nat_inject = thm "real_of_nat_inject";
paulson@14334
  1130
val real_of_nat_diff = thm "real_of_nat_diff";
paulson@14334
  1131
val real_of_nat_zero_iff = thm "real_of_nat_zero_iff";
paulson@14334
  1132
val real_of_nat_neg_int = thm "real_of_nat_neg_int";
paulson@14334
  1133
val real_of_nat_gt_zero_cancel_iff = thm "real_of_nat_gt_zero_cancel_iff";
paulson@14334
  1134
val real_of_nat_le_zero_cancel_iff = thm "real_of_nat_le_zero_cancel_iff";
paulson@14334
  1135
val not_real_of_nat_less_zero = thm "not_real_of_nat_less_zero";
paulson@14334
  1136
val real_of_nat_ge_zero_cancel_iff = thm "real_of_nat_ge_zero_cancel_iff";
paulson@14334
  1137
*}
paulson@10752
  1138
paulson@5588
  1139
end