src/HOL/Real/RealDef.thy
author paulson
Fri Nov 28 12:09:37 2003 +0100 (2003-11-28)
changeset 14269 502a7c95de73
parent 13487 1291c6375c29
child 14270 342451d763f9
permissions -rw-r--r--
conversion of some Real theories to Isar scripts
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@14269
    10
instance preal :: order
paulson@14269
    11
proof qed
paulson@14269
    12
 (assumption |
paulson@14269
    13
  rule preal_le_refl preal_le_trans preal_le_anti_sym preal_less_le)+
paulson@10752
    14
paulson@5588
    15
constdefs
paulson@5588
    16
  realrel   ::  "((preal * preal) * (preal * preal)) set"
paulson@14269
    17
  "realrel == {p. \<exists>x1 y1 x2 y2. p = ((x1,y1),(x2,y2)) & x1+y2 = x2+y1}"
paulson@14269
    18
paulson@14269
    19
typedef (REAL)  real = "UNIV//realrel"
paulson@14269
    20
  by (auto simp add: quotient_def)
paulson@5588
    21
paulson@14269
    22
instance real :: ord ..
paulson@14269
    23
instance real :: zero ..
paulson@14269
    24
instance real :: one ..
paulson@14269
    25
instance real :: plus ..
paulson@14269
    26
instance real :: times ..
paulson@14269
    27
instance real :: minus ..
paulson@14269
    28
instance real :: inverse ..
paulson@14269
    29
paulson@14269
    30
consts
paulson@14269
    31
   (*Overloaded constants denoting the Nat and Real subsets of enclosing
paulson@14269
    32
     types such as hypreal and complex*)
paulson@14269
    33
   Nats  :: "'a set"
paulson@14269
    34
   Reals :: "'a set"
paulson@14269
    35
paulson@14269
    36
   (*overloaded constant for injecting other types into "real"*)
paulson@14269
    37
   real :: "'a => real"
paulson@5588
    38
paulson@5588
    39
paulson@14269
    40
defs (overloaded)
paulson@5588
    41
paulson@14269
    42
  real_zero_def:
paulson@12018
    43
  "0 == Abs_REAL(realrel``{(preal_of_prat(prat_of_pnat 1),
paulson@12018
    44
			    preal_of_prat(prat_of_pnat 1))})"
paulson@12018
    45
paulson@14269
    46
  real_one_def:
paulson@12018
    47
  "1 == Abs_REAL(realrel``
paulson@12018
    48
               {(preal_of_prat(prat_of_pnat 1) + preal_of_prat(prat_of_pnat 1),
paulson@12018
    49
		 preal_of_prat(prat_of_pnat 1))})"
paulson@5588
    50
paulson@14269
    51
  real_minus_def:
paulson@10919
    52
  "- R ==  Abs_REAL(UN (x,y):Rep_REAL(R). realrel``{(y,x)})"
bauerg@10606
    53
paulson@14269
    54
  real_diff_def:
bauerg@10606
    55
  "R - (S::real) == R + - S"
paulson@5588
    56
paulson@14269
    57
  real_inverse_def:
wenzelm@11713
    58
  "inverse (R::real) == (SOME S. (R = 0 & S = 0) | S * R = 1)"
paulson@5588
    59
paulson@14269
    60
  real_divide_def:
bauerg@10606
    61
  "R / (S::real) == R * inverse S"
paulson@14269
    62
paulson@5588
    63
constdefs
paulson@5588
    64
paulson@12018
    65
  (** these don't use the overloaded "real" function: users don't see them **)
paulson@14269
    66
paulson@14269
    67
  real_of_preal :: "preal => real"
paulson@7077
    68
  "real_of_preal m     ==
paulson@12018
    69
           Abs_REAL(realrel``{(m + preal_of_prat(prat_of_pnat 1),
paulson@12018
    70
                               preal_of_prat(prat_of_pnat 1))})"
paulson@5588
    71
paulson@14269
    72
  real_of_posnat :: "nat => real"
paulson@7077
    73
  "real_of_posnat n == real_of_preal(preal_of_prat(prat_of_pnat(pnat_of_nat n)))"
paulson@7077
    74
paulson@5588
    75
paulson@14269
    76
defs (overloaded)
paulson@5588
    77
paulson@14269
    78
  real_of_nat_def:   "real n == real_of_posnat n + (- 1)"
paulson@10919
    79
paulson@14269
    80
  real_add_def:
paulson@10919
    81
  "P+Q == Abs_REAL(UN p1:Rep_REAL(P). UN p2:Rep_REAL(Q).
nipkow@10834
    82
                   (%(x1,y1). (%(x2,y2). realrel``{(x1+x2, y1+y2)}) p2) p1)"
paulson@14269
    83
paulson@14269
    84
  real_mult_def:
paulson@10919
    85
  "P*Q == Abs_REAL(UN p1:Rep_REAL(P). UN p2:Rep_REAL(Q).
nipkow@10834
    86
                   (%(x1,y1). (%(x2,y2). realrel``{(x1*x2+y1*y2,x1*y2+x2*y1)})
paulson@10752
    87
		   p2) p1)"
paulson@5588
    88
paulson@14269
    89
  real_less_def:
paulson@14269
    90
  "P<Q == \<exists>x1 y1 x2 y2. x1 + y2 < x2 + y1 &
paulson@14269
    91
                            (x1,y1):Rep_REAL(P) & (x2,y2):Rep_REAL(Q)"
paulson@14269
    92
  real_le_def:
paulson@14269
    93
  "P \<le> (Q::real) == ~(Q < P)"
paulson@5588
    94
wenzelm@12114
    95
syntax (xsymbols)
paulson@14269
    96
  Reals     :: "'a set"                   ("\<real>")
paulson@14269
    97
  Nats      :: "'a set"                   ("\<nat>")
paulson@14269
    98
paulson@14269
    99
paulson@14269
   100
(*** Proving that realrel is an equivalence relation ***)
paulson@14269
   101
paulson@14269
   102
lemma preal_trans_lemma: "[| (x1::preal) + y2 = x2 + y1; x2 + y3 = x3 + y2 |]
paulson@14269
   103
      ==> x1 + y3 = x3 + y1"
paulson@14269
   104
apply (rule_tac C = y2 in preal_add_right_cancel)
paulson@14269
   105
apply (rotate_tac 1, drule sym)
paulson@14269
   106
apply (simp add: preal_add_ac)
paulson@14269
   107
apply (rule preal_add_left_commute [THEN subst])
paulson@14269
   108
apply (rule_tac x1 = x1 in preal_add_assoc [THEN subst])
paulson@14269
   109
apply (simp add: preal_add_ac)
paulson@14269
   110
done
paulson@14269
   111
paulson@14269
   112
(** Natural deduction for realrel **)
paulson@14269
   113
paulson@14269
   114
lemma realrel_iff [simp]: "(((x1,y1),(x2,y2)): realrel) = (x1 + y2 = x2 + y1)"
paulson@14269
   115
by (unfold realrel_def, blast)
paulson@14269
   116
paulson@14269
   117
lemma realrel_refl: "(x,x): realrel"
paulson@14269
   118
apply (case_tac "x")
paulson@14269
   119
apply (simp add: realrel_def)
paulson@14269
   120
done
paulson@14269
   121
paulson@14269
   122
lemma equiv_realrel: "equiv UNIV realrel"
paulson@14269
   123
apply (unfold equiv_def refl_def sym_def trans_def realrel_def)
paulson@14269
   124
apply (fast elim!: sym preal_trans_lemma)
paulson@14269
   125
done
paulson@14269
   126
paulson@14269
   127
(* (realrel `` {x} = realrel `` {y}) = ((x,y) : realrel) *)
paulson@14269
   128
lemmas equiv_realrel_iff = 
paulson@14269
   129
       eq_equiv_class_iff [OF equiv_realrel UNIV_I UNIV_I]
paulson@14269
   130
paulson@14269
   131
declare equiv_realrel_iff [simp]
paulson@14269
   132
paulson@14269
   133
lemma realrel_in_real [simp]: "realrel``{(x,y)}: REAL"
paulson@14269
   134
by (unfold REAL_def realrel_def quotient_def, blast)
paulson@14269
   135
paulson@14269
   136
lemma inj_on_Abs_REAL: "inj_on Abs_REAL REAL"
paulson@14269
   137
apply (rule inj_on_inverseI)
paulson@14269
   138
apply (erule Abs_REAL_inverse)
paulson@14269
   139
done
paulson@14269
   140
paulson@14269
   141
declare inj_on_Abs_REAL [THEN inj_on_iff, simp]
paulson@14269
   142
declare Abs_REAL_inverse [simp]
paulson@14269
   143
paulson@14269
   144
paulson@14269
   145
lemmas eq_realrelD = equiv_realrel [THEN [2] eq_equiv_class]
paulson@14269
   146
paulson@14269
   147
lemma inj_Rep_REAL: "inj Rep_REAL"
paulson@14269
   148
apply (rule inj_on_inverseI)
paulson@14269
   149
apply (rule Rep_REAL_inverse)
paulson@14269
   150
done
paulson@14269
   151
paulson@14269
   152
(** real_of_preal: the injection from preal to real **)
paulson@14269
   153
lemma inj_real_of_preal: "inj(real_of_preal)"
paulson@14269
   154
apply (rule inj_onI)
paulson@14269
   155
apply (unfold real_of_preal_def)
paulson@14269
   156
apply (drule inj_on_Abs_REAL [THEN inj_onD])
paulson@14269
   157
apply (rule realrel_in_real)+
paulson@14269
   158
apply (drule eq_equiv_class)
paulson@14269
   159
apply (rule equiv_realrel, blast)
paulson@14269
   160
apply (simp add: realrel_def)
paulson@14269
   161
done
paulson@14269
   162
paulson@14269
   163
lemma eq_Abs_REAL: 
paulson@14269
   164
    "(!!x y. z = Abs_REAL(realrel``{(x,y)}) ==> P) ==> P"
paulson@14269
   165
apply (rule_tac x1 = z in Rep_REAL [unfolded REAL_def, THEN quotientE])
paulson@14269
   166
apply (drule_tac f = Abs_REAL in arg_cong)
paulson@14269
   167
apply (case_tac "x")
paulson@14269
   168
apply (simp add: Rep_REAL_inverse)
paulson@14269
   169
done
paulson@14269
   170
paulson@14269
   171
(**** real_minus: additive inverse on real ****)
paulson@14269
   172
paulson@14269
   173
lemma real_minus_congruent:
paulson@14269
   174
  "congruent realrel (%p. (%(x,y). realrel``{(y,x)}) p)"
paulson@14269
   175
apply (unfold congruent_def, clarify)
paulson@14269
   176
apply (simp add: preal_add_commute)
paulson@14269
   177
done
paulson@14269
   178
paulson@14269
   179
lemma real_minus:
paulson@14269
   180
      "- (Abs_REAL(realrel``{(x,y)})) = Abs_REAL(realrel `` {(y,x)})"
paulson@14269
   181
apply (unfold real_minus_def)
paulson@14269
   182
apply (rule_tac f = Abs_REAL in arg_cong)
paulson@14269
   183
apply (simp add: realrel_in_real [THEN Abs_REAL_inverse] 
paulson@14269
   184
            UN_equiv_class [OF equiv_realrel real_minus_congruent])
paulson@14269
   185
done
paulson@14269
   186
paulson@14269
   187
lemma real_minus_minus: "- (- z) = (z::real)"
paulson@14269
   188
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   189
apply (simp add: real_minus)
paulson@14269
   190
done
paulson@14269
   191
paulson@14269
   192
declare real_minus_minus [simp]
paulson@14269
   193
paulson@14269
   194
lemma inj_real_minus: "inj(%r::real. -r)"
paulson@14269
   195
apply (rule inj_onI)
paulson@14269
   196
apply (drule_tac f = uminus in arg_cong)
paulson@14269
   197
apply (simp add: real_minus_minus)
paulson@14269
   198
done
paulson@14269
   199
paulson@14269
   200
lemma real_minus_zero: "- 0 = (0::real)"
paulson@14269
   201
apply (unfold real_zero_def)
paulson@14269
   202
apply (simp add: real_minus)
paulson@14269
   203
done
paulson@14269
   204
paulson@14269
   205
declare real_minus_zero [simp]
paulson@14269
   206
paulson@14269
   207
lemma real_minus_zero_iff: "(-x = 0) = (x = (0::real))"
paulson@14269
   208
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14269
   209
apply (auto simp add: real_zero_def real_minus preal_add_ac)
paulson@14269
   210
done
paulson@14269
   211
paulson@14269
   212
declare real_minus_zero_iff [simp]
paulson@14269
   213
paulson@14269
   214
(*** Congruence property for addition ***)
paulson@14269
   215
paulson@14269
   216
lemma real_add_congruent2_lemma:
paulson@14269
   217
     "[|a + ba = aa + b; ab + bc = ac + bb|]
paulson@14269
   218
      ==> a + ab + (ba + bc) = aa + ac + (b + (bb::preal))"
paulson@14269
   219
apply (simp add: preal_add_assoc) 
paulson@14269
   220
apply (rule preal_add_left_commute [of ab, THEN ssubst])
paulson@14269
   221
apply (simp add: preal_add_assoc [symmetric])
paulson@14269
   222
apply (simp add: preal_add_ac)
paulson@14269
   223
done
paulson@14269
   224
paulson@14269
   225
lemma real_add:
paulson@14269
   226
  "Abs_REAL(realrel``{(x1,y1)}) + Abs_REAL(realrel``{(x2,y2)}) =
paulson@14269
   227
   Abs_REAL(realrel``{(x1+x2, y1+y2)})"
paulson@14269
   228
apply (simp add: real_add_def UN_UN_split_split_eq)
paulson@14269
   229
apply (subst equiv_realrel [THEN UN_equiv_class2])
paulson@14269
   230
apply (auto simp add: congruent2_def)
paulson@14269
   231
apply (blast intro: real_add_congruent2_lemma) 
paulson@14269
   232
done
paulson@14269
   233
paulson@14269
   234
lemma real_add_commute: "(z::real) + w = w + z"
paulson@14269
   235
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   236
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14269
   237
apply (simp add: preal_add_ac real_add)
paulson@14269
   238
done
paulson@14269
   239
paulson@14269
   240
lemma real_add_assoc: "((z1::real) + z2) + z3 = z1 + (z2 + z3)"
paulson@14269
   241
apply (rule_tac z = z1 in eq_Abs_REAL)
paulson@14269
   242
apply (rule_tac z = z2 in eq_Abs_REAL)
paulson@14269
   243
apply (rule_tac z = z3 in eq_Abs_REAL)
paulson@14269
   244
apply (simp add: real_add preal_add_assoc)
paulson@14269
   245
done
paulson@14269
   246
paulson@14269
   247
(*For AC rewriting*)
paulson@14269
   248
lemma real_add_left_commute: "(x::real)+(y+z)=y+(x+z)"
paulson@14269
   249
  apply (rule mk_left_commute [of "op +"])
paulson@14269
   250
  apply (rule real_add_assoc)
paulson@14269
   251
  apply (rule real_add_commute)
paulson@14269
   252
  done
paulson@14269
   253
paulson@14269
   254
paulson@14269
   255
(* real addition is an AC operator *)
paulson@14269
   256
lemmas real_add_ac = real_add_assoc real_add_commute real_add_left_commute
paulson@14269
   257
paulson@14269
   258
lemma real_add_zero_left: "(0::real) + z = z"
paulson@14269
   259
apply (unfold real_of_preal_def real_zero_def)
paulson@14269
   260
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   261
apply (simp add: real_add preal_add_ac)
paulson@14269
   262
done
paulson@14269
   263
declare real_add_zero_left [simp]
paulson@14269
   264
paulson@14269
   265
lemma real_add_zero_right: "z + (0::real) = z"
paulson@14269
   266
by (simp add: real_add_commute)
paulson@14269
   267
declare real_add_zero_right [simp]
paulson@14269
   268
paulson@14269
   269
instance real :: plus_ac0
paulson@14269
   270
  by (intro_classes,
paulson@14269
   271
      (assumption | 
paulson@14269
   272
       rule real_add_commute real_add_assoc real_add_zero_left)+)
paulson@14269
   273
paulson@14269
   274
paulson@14269
   275
lemma real_add_minus: "z + (-z) = (0::real)"
paulson@14269
   276
apply (unfold real_zero_def)
paulson@14269
   277
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   278
apply (simp add: real_minus real_add preal_add_commute)
paulson@14269
   279
done
paulson@14269
   280
declare real_add_minus [simp]
paulson@14269
   281
paulson@14269
   282
lemma real_add_minus_left: "(-z) + z = (0::real)"
paulson@14269
   283
by (simp add: real_add_commute)
paulson@14269
   284
declare real_add_minus_left [simp]
paulson@14269
   285
paulson@14269
   286
paulson@14269
   287
lemma real_add_minus_cancel: "z + ((- z) + w) = (w::real)"
paulson@14269
   288
by (simp add: real_add_assoc [symmetric])
paulson@14269
   289
paulson@14269
   290
lemma real_minus_add_cancel: "(-z) + (z + w) = (w::real)"
paulson@14269
   291
by (simp add: real_add_assoc [symmetric])
paulson@14269
   292
paulson@14269
   293
declare real_add_minus_cancel [simp] real_minus_add_cancel [simp]
paulson@14269
   294
paulson@14269
   295
lemma real_minus_ex: "\<exists>y. (x::real) + y = 0"
paulson@14269
   296
by (blast intro: real_add_minus)
paulson@14269
   297
paulson@14269
   298
lemma real_minus_ex1: "EX! y. (x::real) + y = 0"
paulson@14269
   299
apply (auto intro: real_add_minus)
paulson@14269
   300
apply (drule_tac f = "%x. ya+x" in arg_cong)
paulson@14269
   301
apply (simp add: real_add_assoc [symmetric])
paulson@14269
   302
apply (simp add: real_add_commute)
paulson@14269
   303
done
paulson@14269
   304
paulson@14269
   305
lemma real_minus_left_ex1: "EX! y. y + (x::real) = 0"
paulson@14269
   306
apply (auto intro: real_add_minus_left)
paulson@14269
   307
apply (drule_tac f = "%x. x+ya" in arg_cong)
paulson@14269
   308
apply (simp add: real_add_assoc)
paulson@14269
   309
apply (simp add: real_add_commute)
paulson@14269
   310
done
paulson@14269
   311
paulson@14269
   312
lemma real_add_minus_eq_minus: "x + y = (0::real) ==> x = -y"
paulson@14269
   313
apply (cut_tac z = y in real_add_minus_left)
paulson@14269
   314
apply (rule_tac x1 = y in real_minus_left_ex1 [THEN ex1E], blast)
paulson@14269
   315
done
paulson@14269
   316
paulson@14269
   317
lemma real_as_add_inverse_ex: "\<exists>(y::real). x = -y"
paulson@14269
   318
apply (cut_tac x = x in real_minus_ex)
paulson@14269
   319
apply (erule exE, drule real_add_minus_eq_minus, fast)
paulson@14269
   320
done
paulson@14269
   321
paulson@14269
   322
lemma real_minus_add_distrib: "-(x + y) = (-x) + (- y :: real)"
paulson@14269
   323
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14269
   324
apply (rule_tac z = y in eq_Abs_REAL)
paulson@14269
   325
apply (auto simp add: real_minus real_add)
paulson@14269
   326
done
paulson@14269
   327
paulson@14269
   328
declare real_minus_add_distrib [simp]
paulson@14269
   329
paulson@14269
   330
lemma real_add_left_cancel: "((x::real) + y = x + z) = (y = z)"
paulson@14269
   331
apply safe
paulson@14269
   332
apply (drule_tac f = "%t. (-x) + t" in arg_cong)
paulson@14269
   333
apply (simp add: real_add_assoc [symmetric])
paulson@14269
   334
done
paulson@14269
   335
paulson@14269
   336
lemma real_add_right_cancel: "(y + (x::real)= z + x) = (y = z)"
paulson@14269
   337
by (simp add: real_add_commute real_add_left_cancel)
paulson@14269
   338
paulson@14269
   339
lemma real_diff_0: "(0::real) - x = -x"
paulson@14269
   340
by (simp add: real_diff_def)
paulson@14269
   341
paulson@14269
   342
lemma real_diff_0_right: "x - (0::real) = x"
paulson@14269
   343
by (simp add: real_diff_def)
paulson@14269
   344
paulson@14269
   345
lemma real_diff_self: "x - x = (0::real)"
paulson@14269
   346
by (simp add: real_diff_def)
paulson@14269
   347
paulson@14269
   348
declare real_diff_0 [simp] real_diff_0_right [simp] real_diff_self [simp]
paulson@14269
   349
paulson@14269
   350
paulson@14269
   351
(*** Congruence property for multiplication ***)
paulson@14269
   352
paulson@14269
   353
lemma real_mult_congruent2_lemma: "!!(x1::preal). [| x1 + y2 = x2 + y1 |] ==>
paulson@14269
   354
          x * x1 + y * y1 + (x * y2 + x2 * y) =
paulson@14269
   355
          x * x2 + y * y2 + (x * y1 + x1 * y)"
paulson@14269
   356
apply (simp add: preal_add_left_commute preal_add_assoc [symmetric] preal_add_mult_distrib2 [symmetric])
paulson@14269
   357
apply (rule preal_mult_commute [THEN subst])
paulson@14269
   358
apply (rule_tac y1 = x2 in preal_mult_commute [THEN subst])
paulson@14269
   359
apply (simp add: preal_add_assoc preal_add_mult_distrib2 [symmetric])
paulson@14269
   360
apply (simp add: preal_add_commute)
paulson@14269
   361
done
paulson@14269
   362
paulson@14269
   363
lemma real_mult_congruent2:
paulson@14269
   364
    "congruent2 realrel (%p1 p2.
paulson@14269
   365
          (%(x1,y1). (%(x2,y2). realrel``{(x1*x2 + y1*y2, x1*y2+x2*y1)}) p2) p1)"
paulson@14269
   366
apply (rule equiv_realrel [THEN congruent2_commuteI], clarify)
paulson@14269
   367
apply (unfold split_def)
paulson@14269
   368
apply (simp add: preal_mult_commute preal_add_commute)
paulson@14269
   369
apply (auto simp add: real_mult_congruent2_lemma)
paulson@14269
   370
done
paulson@14269
   371
paulson@14269
   372
lemma real_mult:
paulson@14269
   373
   "Abs_REAL((realrel``{(x1,y1)})) * Abs_REAL((realrel``{(x2,y2)})) =
paulson@14269
   374
    Abs_REAL(realrel `` {(x1*x2+y1*y2,x1*y2+x2*y1)})"
paulson@14269
   375
apply (unfold real_mult_def)
paulson@14269
   376
apply (simp add: equiv_realrel [THEN UN_equiv_class2] real_mult_congruent2)
paulson@14269
   377
done
paulson@14269
   378
paulson@14269
   379
lemma real_mult_commute: "(z::real) * w = w * z"
paulson@14269
   380
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   381
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14269
   382
apply (simp add: real_mult preal_add_ac preal_mult_ac)
paulson@14269
   383
done
paulson@14269
   384
paulson@14269
   385
lemma real_mult_assoc: "((z1::real) * z2) * z3 = z1 * (z2 * z3)"
paulson@14269
   386
apply (rule_tac z = z1 in eq_Abs_REAL)
paulson@14269
   387
apply (rule_tac z = z2 in eq_Abs_REAL)
paulson@14269
   388
apply (rule_tac z = z3 in eq_Abs_REAL)
paulson@14269
   389
apply (simp add: preal_add_mult_distrib2 real_mult preal_add_ac preal_mult_ac)
paulson@14269
   390
done
paulson@14269
   391
paulson@14269
   392
paulson@14269
   393
(*For AC rewriting*)
paulson@14269
   394
lemma real_mult_left_commute: "(x::real)*(y*z)=y*(x*z)"
paulson@14269
   395
  apply (rule mk_left_commute [of "op *"])
paulson@14269
   396
  apply (rule real_mult_assoc)
paulson@14269
   397
  apply (rule real_mult_commute)
paulson@14269
   398
  done
paulson@14269
   399
paulson@14269
   400
(* real multiplication is an AC operator *)
paulson@14269
   401
lemmas real_mult_ac = real_mult_assoc real_mult_commute real_mult_left_commute
paulson@14269
   402
paulson@14269
   403
lemma real_mult_1: "(1::real) * z = z"
paulson@14269
   404
apply (unfold real_one_def pnat_one_def)
paulson@14269
   405
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   406
apply (simp add: real_mult preal_add_mult_distrib2 preal_mult_1_right preal_mult_ac preal_add_ac)
paulson@14269
   407
done
paulson@14269
   408
paulson@14269
   409
declare real_mult_1 [simp]
paulson@14269
   410
paulson@14269
   411
lemma real_mult_1_right: "z * (1::real) = z"
paulson@14269
   412
by (simp add: real_mult_commute)
paulson@14269
   413
paulson@14269
   414
declare real_mult_1_right [simp]
paulson@14269
   415
paulson@14269
   416
lemma real_mult_0: "0 * z = (0::real)"
paulson@14269
   417
apply (unfold real_zero_def pnat_one_def)
paulson@14269
   418
apply (rule_tac z = z in eq_Abs_REAL)
paulson@14269
   419
apply (simp add: real_mult preal_add_mult_distrib2 preal_mult_1_right preal_mult_ac preal_add_ac)
paulson@14269
   420
done
paulson@14269
   421
paulson@14269
   422
lemma real_mult_0_right: "z * 0 = (0::real)"
paulson@14269
   423
by (simp add: real_mult_commute real_mult_0)
paulson@14269
   424
paulson@14269
   425
declare real_mult_0_right [simp] real_mult_0 [simp]
paulson@14269
   426
paulson@14269
   427
lemma real_mult_minus_eq1: "(-x) * (y::real) = -(x * y)"
paulson@14269
   428
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14269
   429
apply (rule_tac z = y in eq_Abs_REAL)
paulson@14269
   430
apply (auto simp add: real_minus real_mult preal_mult_ac preal_add_ac)
paulson@14269
   431
done
paulson@14269
   432
declare real_mult_minus_eq1 [simp]
paulson@14269
   433
paulson@14269
   434
lemmas real_minus_mult_eq1 = real_mult_minus_eq1 [symmetric, standard]
paulson@14269
   435
paulson@14269
   436
lemma real_mult_minus_eq2: "x * (- y :: real) = -(x * y)"
paulson@14269
   437
by (simp add: real_mult_commute [of x])
paulson@14269
   438
declare real_mult_minus_eq2 [simp]
paulson@14269
   439
paulson@14269
   440
lemmas real_minus_mult_eq2 = real_mult_minus_eq2 [symmetric, standard]
paulson@14269
   441
paulson@14269
   442
lemma real_mult_minus_1: "(- (1::real)) * z = -z"
paulson@14269
   443
by simp
paulson@14269
   444
declare real_mult_minus_1 [simp]
paulson@14269
   445
paulson@14269
   446
lemma real_mult_minus_1_right: "z * (- (1::real)) = -z"
paulson@14269
   447
by (subst real_mult_commute, simp)
paulson@14269
   448
declare real_mult_minus_1_right [simp]
paulson@14269
   449
paulson@14269
   450
lemma real_minus_mult_cancel: "(-x) * (-y) = x * (y::real)"
paulson@14269
   451
by simp
paulson@14269
   452
paulson@14269
   453
declare real_minus_mult_cancel [simp]
paulson@14269
   454
paulson@14269
   455
lemma real_minus_mult_commute: "(-x) * y = x * (- y :: real)"
paulson@14269
   456
by simp
paulson@14269
   457
paulson@14269
   458
(** Lemmas **)
paulson@14269
   459
paulson@14269
   460
lemma real_add_assoc_cong: "(z::real) + v = z' + v' ==> z + (v + w) = z' + (v' + w)"
paulson@14269
   461
by (simp add: real_add_assoc [symmetric])
paulson@14269
   462
paulson@14269
   463
lemma real_add_mult_distrib: "((z1::real) + z2) * w = (z1 * w) + (z2 * w)"
paulson@14269
   464
apply (rule_tac z = z1 in eq_Abs_REAL)
paulson@14269
   465
apply (rule_tac z = z2 in eq_Abs_REAL)
paulson@14269
   466
apply (rule_tac z = w in eq_Abs_REAL)
paulson@14269
   467
apply (simp add: preal_add_mult_distrib2 real_add real_mult preal_add_ac preal_mult_ac)
paulson@14269
   468
done
paulson@14269
   469
paulson@14269
   470
lemma real_add_mult_distrib2: "(w::real) * (z1 + z2) = (w * z1) + (w * z2)"
paulson@14269
   471
by (simp add: real_mult_commute [of w] real_add_mult_distrib)
paulson@14269
   472
paulson@14269
   473
lemma real_diff_mult_distrib: "((z1::real) - z2) * w = (z1 * w) - (z2 * w)"
paulson@14269
   474
apply (unfold real_diff_def)
paulson@14269
   475
apply (simp add: real_add_mult_distrib)
paulson@14269
   476
done
paulson@14269
   477
paulson@14269
   478
lemma real_diff_mult_distrib2: "(w::real) * (z1 - z2) = (w * z1) - (w * z2)"
paulson@14269
   479
by (simp add: real_mult_commute [of w] real_diff_mult_distrib)
paulson@14269
   480
paulson@14269
   481
(*** one and zero are distinct ***)
paulson@14269
   482
lemma real_zero_not_eq_one: "0 ~= (1::real)"
paulson@14269
   483
apply (unfold real_zero_def real_one_def)
paulson@14269
   484
apply (auto simp add: preal_self_less_add_left [THEN preal_not_refl2])
paulson@14269
   485
done
paulson@14269
   486
paulson@14269
   487
(*** existence of inverse ***)
paulson@14269
   488
(** lemma -- alternative definition of 0 **)
paulson@14269
   489
lemma real_zero_iff: "0 = Abs_REAL (realrel `` {(x, x)})"
paulson@14269
   490
apply (unfold real_zero_def)
paulson@14269
   491
apply (auto simp add: preal_add_commute)
paulson@14269
   492
done
paulson@14269
   493
paulson@14269
   494
paulson@14269
   495
(*MOVE UP*)
paulson@14269
   496
instance preal :: order
paulson@14269
   497
  by (intro_classes,
paulson@14269
   498
      (assumption | 
paulson@14269
   499
       rule preal_le_refl preal_le_trans preal_le_anti_sym preal_less_le)+)
paulson@14269
   500
paulson@14269
   501
lemma preal_le_linear: "x <= y | y <= (x::preal)"
paulson@14269
   502
apply (insert preal_linear [of x y]) 
paulson@14269
   503
apply (auto simp add: order_less_le) 
paulson@14269
   504
done
paulson@14269
   505
paulson@14269
   506
instance preal :: linorder
paulson@14269
   507
  by (intro_classes, rule preal_le_linear)
paulson@14269
   508
paulson@14269
   509
paulson@14269
   510
lemma real_mult_inv_right_ex:
paulson@14269
   511
          "!!(x::real). x ~= 0 ==> \<exists>y. x*y = (1::real)"
paulson@14269
   512
apply (unfold real_zero_def real_one_def)
paulson@14269
   513
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14269
   514
apply (cut_tac x = xa and y = y in linorder_less_linear)
paulson@14269
   515
apply (auto dest!: preal_less_add_left_Ex simp add: real_zero_iff [symmetric])
paulson@14269
   516
apply (rule_tac x = "Abs_REAL (realrel `` { (preal_of_prat (prat_of_pnat 1), pinv (D) + preal_of_prat (prat_of_pnat 1))}) " in exI)
paulson@14269
   517
apply (rule_tac [2] x = "Abs_REAL (realrel `` { (pinv (D) + preal_of_prat (prat_of_pnat 1), preal_of_prat (prat_of_pnat 1))}) " in exI)
paulson@14269
   518
apply (auto simp add: real_mult pnat_one_def preal_mult_1_right preal_add_mult_distrib2 preal_add_mult_distrib preal_mult_1 preal_mult_inv_right preal_add_ac preal_mult_ac)
paulson@14269
   519
done
paulson@14269
   520
paulson@14269
   521
lemma real_mult_inv_left_ex: "x ~= 0 ==> \<exists>y. y*x = (1::real)"
paulson@14269
   522
apply (drule real_mult_inv_right_ex)
paulson@14269
   523
apply (auto simp add: real_mult_commute)
paulson@14269
   524
done
paulson@14269
   525
paulson@14269
   526
lemma real_mult_inv_left: "x ~= 0 ==> inverse(x)*x = (1::real)"
paulson@14269
   527
apply (unfold real_inverse_def)
paulson@14269
   528
apply (frule real_mult_inv_left_ex, safe)
paulson@14269
   529
apply (rule someI2, auto)
paulson@14269
   530
done
paulson@14269
   531
declare real_mult_inv_left [simp]
paulson@14269
   532
paulson@14269
   533
lemma real_mult_inv_right: "x ~= 0 ==> x*inverse(x) = (1::real)"
paulson@14269
   534
apply (subst real_mult_commute)
paulson@14269
   535
apply (auto simp add: real_mult_inv_left)
paulson@14269
   536
done
paulson@14269
   537
declare real_mult_inv_right [simp]
paulson@14269
   538
paulson@14269
   539
paulson@14269
   540
(*---------------------------------------------------------
paulson@14269
   541
     Theorems for ordering
paulson@14269
   542
 --------------------------------------------------------*)
paulson@14269
   543
(* prove introduction and elimination rules for real_less *)
paulson@14269
   544
paulson@14269
   545
(* real_less is a strong order i.e. nonreflexive and transitive *)
paulson@14269
   546
paulson@14269
   547
(*** lemmas ***)
paulson@14269
   548
lemma preal_lemma_eq_rev_sum: "!!(x::preal). [| x = y; x1 = y1 |] ==> x + y1 = x1 + y"
paulson@14269
   549
by (simp add: preal_add_commute)
paulson@14269
   550
paulson@14269
   551
lemma preal_add_left_commute_cancel: "!!(b::preal). x + (b + y) = x1 + (b + y1) ==> x + y = x1 + y1"
paulson@14269
   552
by (simp add: preal_add_ac)
paulson@14269
   553
paulson@14269
   554
lemma preal_lemma_for_not_refl: "!!(x::preal). [| x + y2a = x2a + y;
paulson@14269
   555
                       x + y2b = x2b + y |]
paulson@14269
   556
                    ==> x2a + y2b = x2b + y2a"
paulson@14269
   557
apply (drule preal_lemma_eq_rev_sum, assumption)
paulson@14269
   558
apply (erule_tac V = "x + y2b = x2b + y" in thin_rl)
paulson@14269
   559
apply (simp add: preal_add_ac)
paulson@14269
   560
apply (drule preal_add_left_commute_cancel)
paulson@14269
   561
apply (simp add: preal_add_ac)
paulson@14269
   562
done
paulson@14269
   563
paulson@14269
   564
lemma real_less_not_refl: "~ (R::real) < R"
paulson@14269
   565
apply (rule_tac z = R in eq_Abs_REAL)
paulson@14269
   566
apply (auto simp add: real_less_def)
paulson@14269
   567
apply (drule preal_lemma_for_not_refl, assumption, auto)
paulson@14269
   568
done
paulson@14269
   569
paulson@14269
   570
(*** y < y ==> P ***)
paulson@14269
   571
lemmas real_less_irrefl = real_less_not_refl [THEN notE, standard]
paulson@14269
   572
declare real_less_irrefl [elim!]
paulson@14269
   573
paulson@14269
   574
lemma real_not_refl2: "!!(x::real). x < y ==> x ~= y"
paulson@14269
   575
by (auto simp add: real_less_not_refl)
paulson@14269
   576
paulson@14269
   577
(* lemma re-arranging and eliminating terms *)
paulson@14269
   578
lemma preal_lemma_trans: "!! (a::preal). [| a + b = c + d;
paulson@14269
   579
             x2b + d + (c + y2e) < a + y2b + (x2e + b) |]
paulson@14269
   580
          ==> x2b + y2e < x2e + y2b"
paulson@14269
   581
apply (simp add: preal_add_ac)
paulson@14269
   582
apply (rule_tac C = "c+d" in preal_add_left_less_cancel)
paulson@14269
   583
apply (simp add: preal_add_assoc [symmetric])
paulson@14269
   584
done
paulson@14269
   585
paulson@14269
   586
(** A MESS!  heavy re-writing involved*)
paulson@14269
   587
lemma real_less_trans: "!!(R1::real). [| R1 < R2; R2 < R3 |] ==> R1 < R3"
paulson@14269
   588
apply (rule_tac z = R1 in eq_Abs_REAL)
paulson@14269
   589
apply (rule_tac z = R2 in eq_Abs_REAL)
paulson@14269
   590
apply (rule_tac z = R3 in eq_Abs_REAL)
paulson@14269
   591
apply (auto simp add: real_less_def)
paulson@14269
   592
apply (rule exI)+
paulson@14269
   593
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   594
 prefer 2 apply blast 
paulson@14269
   595
 prefer 2 apply blast 
paulson@14269
   596
apply (drule preal_lemma_for_not_refl, assumption)
paulson@14269
   597
apply (blast dest: preal_add_less_mono intro: preal_lemma_trans)
paulson@14269
   598
done
paulson@14269
   599
paulson@14269
   600
lemma real_less_not_sym: "!! (R1::real). R1 < R2 ==> ~ (R2 < R1)"
paulson@14269
   601
apply (rule notI)
paulson@14269
   602
apply (drule real_less_trans, assumption)
paulson@14269
   603
apply (simp add: real_less_not_refl)
paulson@14269
   604
done
paulson@14269
   605
paulson@14269
   606
(* [| x < y;  ~P ==> y < x |] ==> P *)
paulson@14269
   607
lemmas real_less_asym = real_less_not_sym [THEN contrapos_np, standard]
paulson@14269
   608
paulson@14269
   609
lemma real_of_preal_add:
paulson@14269
   610
     "real_of_preal ((z1::preal) + z2) =
paulson@14269
   611
      real_of_preal z1 + real_of_preal z2"
paulson@14269
   612
apply (unfold real_of_preal_def)
paulson@14269
   613
apply (simp add: real_add preal_add_mult_distrib preal_mult_1 add: preal_add_ac)
paulson@14269
   614
done
paulson@14269
   615
paulson@14269
   616
lemma real_of_preal_mult:
paulson@14269
   617
     "real_of_preal ((z1::preal) * z2) =
paulson@14269
   618
      real_of_preal z1* real_of_preal z2"
paulson@14269
   619
apply (unfold real_of_preal_def)
paulson@14269
   620
apply (simp (no_asm_use) add: real_mult preal_add_mult_distrib2 preal_mult_1 preal_mult_1_right pnat_one_def preal_add_ac preal_mult_ac)
paulson@14269
   621
done
paulson@14269
   622
paulson@14269
   623
lemma real_of_preal_ExI:
paulson@14269
   624
      "!!(x::preal). y < x ==>
paulson@14269
   625
       \<exists>m. Abs_REAL (realrel `` {(x,y)}) = real_of_preal m"
paulson@14269
   626
apply (unfold real_of_preal_def)
paulson@14269
   627
apply (auto dest!: preal_less_add_left_Ex simp add: preal_add_ac)
paulson@14269
   628
done
paulson@14269
   629
paulson@14269
   630
lemma real_of_preal_ExD:
paulson@14269
   631
      "!!(x::preal). \<exists>m. Abs_REAL (realrel `` {(x,y)}) =
paulson@14269
   632
                     real_of_preal m ==> y < x"
paulson@14269
   633
apply (unfold real_of_preal_def)
paulson@14269
   634
apply (auto simp add: preal_add_commute preal_add_assoc)
paulson@14269
   635
apply (simp add: preal_add_assoc [symmetric] preal_self_less_add_left)
paulson@14269
   636
done
paulson@14269
   637
paulson@14269
   638
lemma real_of_preal_iff: "(\<exists>m. Abs_REAL (realrel `` {(x,y)}) = real_of_preal m) = (y < x)"
paulson@14269
   639
by (blast intro!: real_of_preal_ExI real_of_preal_ExD)
paulson@14269
   640
paulson@14269
   641
(*** Gleason prop 9-4.4 p 127 ***)
paulson@14269
   642
lemma real_of_preal_trichotomy:
paulson@14269
   643
      "\<exists>m. (x::real) = real_of_preal m | x = 0 | x = -(real_of_preal m)"
paulson@14269
   644
apply (unfold real_of_preal_def real_zero_def)
paulson@14269
   645
apply (rule_tac z = x in eq_Abs_REAL)
paulson@14269
   646
apply (auto simp add: real_minus preal_add_ac)
paulson@14269
   647
apply (cut_tac x = x and y = y in linorder_less_linear)
paulson@14269
   648
apply (auto dest!: preal_less_add_left_Ex simp add: preal_add_assoc [symmetric])
paulson@14269
   649
apply (auto simp add: preal_add_commute)
paulson@14269
   650
done
paulson@14269
   651
paulson@14269
   652
lemma real_of_preal_trichotomyE: "!!P. [| !!m. x = real_of_preal m ==> P;
paulson@14269
   653
              x = 0 ==> P;
paulson@14269
   654
              !!m. x = -(real_of_preal m) ==> P |] ==> P"
paulson@14269
   655
apply (cut_tac x = x in real_of_preal_trichotomy, auto)
paulson@14269
   656
done
paulson@14269
   657
paulson@14269
   658
lemma real_of_preal_lessD:
paulson@14269
   659
      "real_of_preal m1 < real_of_preal m2 ==> m1 < m2"
paulson@14269
   660
apply (unfold real_of_preal_def)
paulson@14269
   661
apply (auto simp add: real_less_def preal_add_ac)
paulson@14269
   662
apply (auto simp add: preal_add_assoc [symmetric])
paulson@14269
   663
apply (auto simp add: preal_add_ac)
paulson@14269
   664
done
paulson@14269
   665
paulson@14269
   666
lemma real_of_preal_lessI: "m1 < m2 ==> real_of_preal m1 < real_of_preal m2"
paulson@14269
   667
apply (drule preal_less_add_left_Ex)
paulson@14269
   668
apply (auto simp add: real_of_preal_add real_of_preal_def real_less_def)
paulson@14269
   669
apply (rule exI)+
paulson@14269
   670
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   671
 apply (rule_tac [2] refl)+
paulson@14269
   672
apply (simp add: preal_self_less_add_left del: preal_add_less_iff2)
paulson@14269
   673
done
paulson@14269
   674
paulson@14269
   675
lemma real_of_preal_less_iff1: "(real_of_preal m1 < real_of_preal m2) = (m1 < m2)"
paulson@14269
   676
by (blast intro: real_of_preal_lessI real_of_preal_lessD)
paulson@14269
   677
paulson@14269
   678
declare real_of_preal_less_iff1 [simp]
paulson@14269
   679
paulson@14269
   680
lemma real_of_preal_minus_less_self: "- real_of_preal m < real_of_preal m"
paulson@14269
   681
apply (auto simp add: real_of_preal_def real_less_def real_minus)
paulson@14269
   682
apply (rule exI)+
paulson@14269
   683
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   684
 apply (rule_tac [2] refl)+
paulson@14269
   685
apply (simp (no_asm_use) add: preal_add_ac)
paulson@14269
   686
apply (simp (no_asm_use) add: preal_self_less_add_right preal_add_assoc [symmetric])
paulson@14269
   687
done
paulson@14269
   688
paulson@14269
   689
lemma real_of_preal_minus_less_zero: "- real_of_preal m < 0"
paulson@14269
   690
apply (unfold real_zero_def)
paulson@14269
   691
apply (auto simp add: real_of_preal_def real_less_def real_minus)
paulson@14269
   692
apply (rule exI)+
paulson@14269
   693
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   694
 apply (rule_tac [2] refl)+
paulson@14269
   695
apply (simp (no_asm_use) add: preal_self_less_add_right preal_add_ac)
paulson@14269
   696
done
paulson@14269
   697
paulson@14269
   698
lemma real_of_preal_not_minus_gt_zero: "~ 0 < - real_of_preal m"
paulson@14269
   699
apply (cut_tac real_of_preal_minus_less_zero)
paulson@14269
   700
apply (fast dest: real_less_trans elim: real_less_irrefl)
paulson@14269
   701
done
paulson@14269
   702
paulson@14269
   703
lemma real_of_preal_zero_less: "0 < real_of_preal m"
paulson@14269
   704
apply (unfold real_zero_def)
paulson@14269
   705
apply (auto simp add: real_of_preal_def real_less_def real_minus)
paulson@14269
   706
apply (rule exI)+
paulson@14269
   707
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   708
 apply (rule_tac [2] refl)+
paulson@14269
   709
apply (simp (no_asm_use) add: preal_self_less_add_right preal_add_ac)
paulson@14269
   710
done
paulson@14269
   711
paulson@14269
   712
lemma real_of_preal_not_less_zero: "~ real_of_preal m < 0"
paulson@14269
   713
apply (cut_tac real_of_preal_zero_less)
paulson@14269
   714
apply (blast dest: real_less_trans elim: real_less_irrefl)
paulson@14269
   715
done
paulson@14269
   716
paulson@14269
   717
lemma real_minus_minus_zero_less: "0 < - (- real_of_preal m)"
paulson@14269
   718
by (simp add: real_of_preal_zero_less)
paulson@14269
   719
paulson@14269
   720
(* another lemma *)
paulson@14269
   721
lemma real_of_preal_sum_zero_less:
paulson@14269
   722
      "0 < real_of_preal m + real_of_preal m1"
paulson@14269
   723
apply (unfold real_zero_def)
paulson@14269
   724
apply (auto simp add: real_of_preal_def real_less_def real_add)
paulson@14269
   725
apply (rule exI)+
paulson@14269
   726
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   727
 apply (rule_tac [2] refl)+
paulson@14269
   728
apply (simp (no_asm_use) add: preal_add_ac)
paulson@14269
   729
apply (simp (no_asm_use) add: preal_self_less_add_right preal_add_assoc [symmetric])
paulson@14269
   730
done
paulson@14269
   731
paulson@14269
   732
lemma real_of_preal_minus_less_all: "- real_of_preal m < real_of_preal m1"
paulson@14269
   733
apply (auto simp add: real_of_preal_def real_less_def real_minus)
paulson@14269
   734
apply (rule exI)+
paulson@14269
   735
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   736
 apply (rule_tac [2] refl)+
paulson@14269
   737
apply (simp (no_asm_use) add: preal_add_ac)
paulson@14269
   738
apply (simp (no_asm_use) add: preal_self_less_add_right preal_add_assoc [symmetric])
paulson@14269
   739
done
paulson@14269
   740
paulson@14269
   741
lemma real_of_preal_not_minus_gt_all: "~ real_of_preal m < - real_of_preal m1"
paulson@14269
   742
apply (cut_tac real_of_preal_minus_less_all)
paulson@14269
   743
apply (blast dest: real_less_trans elim: real_less_irrefl)
paulson@14269
   744
done
paulson@14269
   745
paulson@14269
   746
lemma real_of_preal_minus_less_rev1: "- real_of_preal m1 < - real_of_preal m2
paulson@14269
   747
      ==> real_of_preal m2 < real_of_preal m1"
paulson@14269
   748
apply (auto simp add: real_of_preal_def real_less_def real_minus)
paulson@14269
   749
apply (rule exI)+
paulson@14269
   750
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   751
 apply (rule_tac [2] refl)+
paulson@14269
   752
apply (auto simp add: preal_add_ac)
paulson@14269
   753
apply (simp add: preal_add_assoc [symmetric])
paulson@14269
   754
apply (auto simp add: preal_add_ac)
paulson@14269
   755
done
paulson@14269
   756
paulson@14269
   757
lemma real_of_preal_minus_less_rev2: "real_of_preal m1 < real_of_preal m2
paulson@14269
   758
      ==> - real_of_preal m2 < - real_of_preal m1"
paulson@14269
   759
apply (auto simp add: real_of_preal_def real_less_def real_minus)
paulson@14269
   760
apply (rule exI)+
paulson@14269
   761
apply (rule conjI, rule_tac [2] conjI)
paulson@14269
   762
 apply (rule_tac [2] refl)+
paulson@14269
   763
apply (auto simp add: preal_add_ac)
paulson@14269
   764
apply (simp add: preal_add_assoc [symmetric])
paulson@14269
   765
apply (auto simp add: preal_add_ac)
paulson@14269
   766
done
paulson@14269
   767
paulson@14269
   768
lemma real_of_preal_minus_less_rev_iff: "(- real_of_preal m1 < - real_of_preal m2) =
paulson@14269
   769
      (real_of_preal m2 < real_of_preal m1)"
paulson@14269
   770
apply (blast intro!: real_of_preal_minus_less_rev1 real_of_preal_minus_less_rev2)
paulson@14269
   771
done
paulson@14269
   772
paulson@14269
   773
declare real_of_preal_minus_less_rev_iff [simp]
paulson@14269
   774
paulson@14269
   775
(*** linearity ***)
paulson@14269
   776
lemma real_linear: "(x::real) < y | x = y | y < x"
paulson@14269
   777
apply (rule_tac x = x in real_of_preal_trichotomyE)
paulson@14269
   778
apply (rule_tac [!] x = y in real_of_preal_trichotomyE)
paulson@14269
   779
apply (auto dest!: preal_le_anti_sym simp add: preal_less_le_iff real_of_preal_minus_less_zero real_of_preal_zero_less real_of_preal_minus_less_all)
paulson@14269
   780
done
paulson@14269
   781
paulson@14269
   782
lemma real_neq_iff: "!!w::real. (w ~= z) = (w<z | z<w)"
paulson@14269
   783
by (cut_tac real_linear, blast)
paulson@14269
   784
paulson@14269
   785
paulson@14269
   786
lemma real_linear_less2: "!!(R1::real). [| R1 < R2 ==> P;  R1 = R2 ==> P;
paulson@14269
   787
                       R2 < R1 ==> P |] ==> P"
paulson@14269
   788
apply (cut_tac x = R1 and y = R2 in real_linear, auto)
paulson@14269
   789
done
paulson@14269
   790
paulson@14269
   791
(*** Properties of <= ***)
paulson@14269
   792
paulson@14269
   793
lemma real_leI: "~(w < z) ==> z \<le> (w::real)"
paulson@14269
   794
paulson@14269
   795
apply (unfold real_le_def, assumption)
paulson@14269
   796
done
paulson@14269
   797
paulson@14269
   798
lemma real_leD: "z\<le>w ==> ~(w<(z::real))"
paulson@14269
   799
by (unfold real_le_def, assumption)
paulson@14269
   800
paulson@14269
   801
lemmas real_leE = real_leD [elim_format]
paulson@14269
   802
paulson@14269
   803
lemma real_less_le_iff: "(~(w < z)) = (z \<le> (w::real))"
paulson@14269
   804
by (blast intro!: real_leI real_leD)
paulson@14269
   805
paulson@14269
   806
lemma not_real_leE: "~ z \<le> w ==> w<(z::real)"
paulson@14269
   807
by (unfold real_le_def, blast)
paulson@14269
   808
paulson@14269
   809
lemma real_le_imp_less_or_eq: "!!(x::real). x \<le> y ==> x < y | x = y"
paulson@14269
   810
apply (unfold real_le_def)
paulson@14269
   811
apply (cut_tac real_linear)
paulson@14269
   812
apply (blast elim: real_less_irrefl real_less_asym)
paulson@14269
   813
done
paulson@14269
   814
paulson@14269
   815
lemma real_less_or_eq_imp_le: "z<w | z=w ==> z \<le>(w::real)"
paulson@14269
   816
apply (unfold real_le_def)
paulson@14269
   817
apply (cut_tac real_linear)
paulson@14269
   818
apply (fast elim: real_less_irrefl real_less_asym)
paulson@14269
   819
done
paulson@14269
   820
paulson@14269
   821
lemma real_le_less: "(x \<le> (y::real)) = (x < y | x=y)"
paulson@14269
   822
by (blast intro!: real_less_or_eq_imp_le dest!: real_le_imp_less_or_eq)
paulson@14269
   823
paulson@14269
   824
lemma real_le_refl: "w \<le> (w::real)"
paulson@14269
   825
by (simp add: real_le_less)
paulson@14269
   826
paulson@14269
   827
lemma real_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::real)"
paulson@14269
   828
apply (drule real_le_imp_less_or_eq) 
paulson@14269
   829
apply (drule real_le_imp_less_or_eq) 
paulson@14269
   830
apply (rule real_less_or_eq_imp_le) 
paulson@14269
   831
apply (blast intro: real_less_trans) 
paulson@14269
   832
done
paulson@14269
   833
paulson@14269
   834
lemma real_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::real)"
paulson@14269
   835
apply (drule real_le_imp_less_or_eq) 
paulson@14269
   836
apply (drule real_le_imp_less_or_eq) 
paulson@14269
   837
apply (fast elim: real_less_irrefl real_less_asym)
paulson@14269
   838
done
paulson@14269
   839
paulson@14269
   840
(* Axiom 'order_less_le' of class 'order': *)
paulson@14269
   841
lemma real_less_le: "((w::real) < z) = (w \<le> z & w ~= z)"
paulson@14269
   842
apply (simp add: real_le_def real_neq_iff)
paulson@14269
   843
apply (blast elim!: real_less_asym)
paulson@14269
   844
done
paulson@14269
   845
paulson@14269
   846
instance real :: order
paulson@14269
   847
  by (intro_classes,
paulson@14269
   848
      (assumption | 
paulson@14269
   849
       rule real_le_refl real_le_trans real_le_anti_sym real_less_le)+)
paulson@14269
   850
paulson@14269
   851
(* Axiom 'linorder_linear' of class 'linorder': *)
paulson@14269
   852
lemma real_le_linear: "(z::real) \<le> w | w \<le> z"
paulson@14269
   853
apply (simp add: real_le_less)
paulson@14269
   854
apply (cut_tac real_linear, blast)
paulson@14269
   855
done
paulson@14269
   856
paulson@14269
   857
instance real :: linorder
paulson@14269
   858
  by (intro_classes, rule real_le_linear)
paulson@14269
   859
paulson@14269
   860
paulson@14269
   861
lemma real_minus_zero_less_iff: "(0 < -R) = (R < (0::real))"
paulson@14269
   862
apply (rule_tac x = R in real_of_preal_trichotomyE)
paulson@14269
   863
apply (auto simp add: real_of_preal_not_minus_gt_zero real_of_preal_not_less_zero real_of_preal_zero_less real_of_preal_minus_less_zero)
paulson@14269
   864
done
paulson@14269
   865
declare real_minus_zero_less_iff [simp]
paulson@14269
   866
paulson@14269
   867
lemma real_minus_zero_less_iff2: "(-R < 0) = ((0::real) < R)"
paulson@14269
   868
apply (rule_tac x = R in real_of_preal_trichotomyE)
paulson@14269
   869
apply (auto simp add: real_of_preal_not_minus_gt_zero real_of_preal_not_less_zero real_of_preal_zero_less real_of_preal_minus_less_zero)
paulson@14269
   870
done
paulson@14269
   871
declare real_minus_zero_less_iff2 [simp]
paulson@14269
   872
paulson@14269
   873
(*Alternative definition for real_less*)
paulson@14269
   874
lemma real_less_add_positive_left_Ex: "R < S ==> \<exists>T::real. 0 < T & R + T = S"
paulson@14269
   875
apply (rule_tac x = R in real_of_preal_trichotomyE)
paulson@14269
   876
apply (rule_tac [!] x = S in real_of_preal_trichotomyE)
paulson@14269
   877
apply (auto dest!: preal_less_add_left_Ex simp add: real_of_preal_not_minus_gt_all real_of_preal_add real_of_preal_not_less_zero real_less_not_refl real_of_preal_not_minus_gt_zero)
paulson@14269
   878
apply (rule_tac x = "real_of_preal D" in exI)
paulson@14269
   879
apply (rule_tac [2] x = "real_of_preal m+real_of_preal ma" in exI)
paulson@14269
   880
apply (rule_tac [3] x = "real_of_preal D" in exI)
paulson@14269
   881
apply (auto simp add: real_of_preal_zero_less real_of_preal_sum_zero_less real_add_assoc)
paulson@14269
   882
done
paulson@14269
   883
paulson@14269
   884
(** change naff name(s)! **)
paulson@14269
   885
lemma real_less_sum_gt_zero: "(W < S) ==> (0 < S + (-W::real))"
paulson@14269
   886
apply (drule real_less_add_positive_left_Ex)
paulson@14269
   887
apply (auto simp add: real_add_minus real_add_zero_right real_add_ac)
paulson@14269
   888
done
paulson@14269
   889
paulson@14269
   890
lemma real_lemma_change_eq_subj: "!!S::real. T = S + W ==> S = T + (-W)"
paulson@14269
   891
by (simp add: real_add_ac)
paulson@14269
   892
paulson@14269
   893
(* FIXME: long! *)
paulson@14269
   894
lemma real_sum_gt_zero_less: "(0 < S + (-W::real)) ==> (W < S)"
paulson@14269
   895
apply (rule ccontr)
paulson@14269
   896
apply (drule real_leI [THEN real_le_imp_less_or_eq])
paulson@14269
   897
apply (auto simp add: real_less_not_refl)
paulson@14269
   898
apply (drule real_less_add_positive_left_Ex, clarify, simp)
paulson@14269
   899
apply (drule real_lemma_change_eq_subj, auto)
paulson@14269
   900
apply (drule real_less_sum_gt_zero)
paulson@14269
   901
apply (auto elim: real_less_asym simp add: real_add_left_commute [of W] real_add_ac)
paulson@14269
   902
done
paulson@14269
   903
paulson@14269
   904
lemma real_less_sum_gt_0_iff: "(0 < S + (-W::real)) = (W < S)"
paulson@14269
   905
by (blast intro: real_less_sum_gt_zero real_sum_gt_zero_less)
paulson@14269
   906
paulson@14269
   907
paulson@14269
   908
lemma real_less_eq_diff: "(x<y) = (x-y < (0::real))"
paulson@14269
   909
apply (unfold real_diff_def)
paulson@14269
   910
apply (subst real_minus_zero_less_iff [symmetric])
paulson@14269
   911
apply (simp add: real_add_commute real_less_sum_gt_0_iff)
paulson@14269
   912
done
paulson@14269
   913
paulson@14269
   914
paulson@14269
   915
(*** Subtraction laws ***)
paulson@14269
   916
paulson@14269
   917
lemma real_add_diff_eq: "x + (y - z) = (x + y) - (z::real)"
paulson@14269
   918
by (simp add: real_diff_def real_add_ac)
paulson@14269
   919
paulson@14269
   920
lemma real_diff_add_eq: "(x - y) + z = (x + z) - (y::real)"
paulson@14269
   921
by (simp add: real_diff_def real_add_ac)
paulson@14269
   922
paulson@14269
   923
lemma real_diff_diff_eq: "(x - y) - z = x - (y + (z::real))"
paulson@14269
   924
by (simp add: real_diff_def real_add_ac)
paulson@14269
   925
paulson@14269
   926
lemma real_diff_diff_eq2: "x - (y - z) = (x + z) - (y::real)"
paulson@14269
   927
by (simp add: real_diff_def real_add_ac)
paulson@14269
   928
paulson@14269
   929
lemma real_diff_less_eq: "(x-y < z) = (x < z + (y::real))"
paulson@14269
   930
apply (subst real_less_eq_diff)
paulson@14269
   931
apply (rule_tac y1 = z in real_less_eq_diff [THEN ssubst])
paulson@14269
   932
apply (simp add: real_diff_def real_add_ac)
paulson@14269
   933
done
paulson@14269
   934
paulson@14269
   935
lemma real_less_diff_eq: "(x < z-y) = (x + (y::real) < z)"
paulson@14269
   936
apply (subst real_less_eq_diff)
paulson@14269
   937
apply (rule_tac y1 = "z-y" in real_less_eq_diff [THEN ssubst])
paulson@14269
   938
apply (simp add: real_diff_def real_add_ac)
paulson@14269
   939
done
paulson@14269
   940
paulson@14269
   941
lemma real_diff_le_eq: "(x-y \<le> z) = (x \<le> z + (y::real))"
paulson@14269
   942
apply (unfold real_le_def)
paulson@14269
   943
apply (simp add: real_less_diff_eq)
paulson@14269
   944
done
paulson@14269
   945
paulson@14269
   946
lemma real_le_diff_eq: "(x \<le> z-y) = (x + (y::real) \<le> z)"
paulson@14269
   947
apply (unfold real_le_def)
paulson@14269
   948
apply (simp add: real_diff_less_eq)
paulson@14269
   949
done
paulson@14269
   950
paulson@14269
   951
lemma real_diff_eq_eq: "(x-y = z) = (x = z + (y::real))"
paulson@14269
   952
apply (unfold real_diff_def)
paulson@14269
   953
apply (auto simp add: real_add_assoc)
paulson@14269
   954
done
paulson@14269
   955
paulson@14269
   956
lemma real_eq_diff_eq: "(x = z-y) = (x + (y::real) = z)"
paulson@14269
   957
apply (unfold real_diff_def)
paulson@14269
   958
apply (auto simp add: real_add_assoc)
paulson@14269
   959
done
paulson@14269
   960
paulson@14269
   961
(*This list of rewrites simplifies (in)equalities by bringing subtractions
paulson@14269
   962
  to the top and then moving negative terms to the other side.
paulson@14269
   963
  Use with real_add_ac*)
paulson@14269
   964
lemmas real_compare_rls =
paulson@14269
   965
   real_diff_def [symmetric]
paulson@14269
   966
   real_add_diff_eq real_diff_add_eq real_diff_diff_eq real_diff_diff_eq2
paulson@14269
   967
   real_diff_less_eq real_less_diff_eq real_diff_le_eq real_le_diff_eq
paulson@14269
   968
   real_diff_eq_eq real_eq_diff_eq
paulson@14269
   969
paulson@14269
   970
paulson@14269
   971
(** For the cancellation simproc.
paulson@14269
   972
    The idea is to cancel like terms on opposite sides by subtraction **)
paulson@14269
   973
paulson@14269
   974
lemma real_less_eqI: "(x::real) - y = x' - y' ==> (x<y) = (x'<y')"
paulson@14269
   975
apply (subst real_less_eq_diff)
paulson@14269
   976
apply (rule_tac y1 = y in real_less_eq_diff [THEN ssubst], simp)
paulson@14269
   977
done
paulson@14269
   978
paulson@14269
   979
lemma real_le_eqI: "(x::real) - y = x' - y' ==> (y\<le>x) = (y'\<le>x')"
paulson@14269
   980
apply (drule real_less_eqI)
paulson@14269
   981
apply (simp add: real_le_def)
paulson@14269
   982
done
paulson@14269
   983
paulson@14269
   984
lemma real_eq_eqI: "(x::real) - y = x' - y' ==> (x=y) = (x'=y')"
paulson@14269
   985
apply safe
paulson@14269
   986
apply (simp_all add: real_eq_diff_eq real_diff_eq_eq)
paulson@14269
   987
done
paulson@14269
   988
paulson@14269
   989
paulson@14269
   990
ML
paulson@14269
   991
{*
paulson@14269
   992
val real_le_def = thm "real_le_def";
paulson@14269
   993
val real_diff_def = thm "real_diff_def";
paulson@14269
   994
val real_divide_def = thm "real_divide_def";
paulson@14269
   995
val real_of_nat_def = thm "real_of_nat_def";
paulson@14269
   996
paulson@14269
   997
val preal_trans_lemma = thm"preal_trans_lemma";
paulson@14269
   998
val realrel_iff = thm"realrel_iff";
paulson@14269
   999
val realrel_refl = thm"realrel_refl";
paulson@14269
  1000
val equiv_realrel = thm"equiv_realrel";
paulson@14269
  1001
val equiv_realrel_iff = thm"equiv_realrel_iff";
paulson@14269
  1002
val realrel_in_real = thm"realrel_in_real";
paulson@14269
  1003
val inj_on_Abs_REAL = thm"inj_on_Abs_REAL";
paulson@14269
  1004
val eq_realrelD = thm"eq_realrelD";
paulson@14269
  1005
val inj_Rep_REAL = thm"inj_Rep_REAL";
paulson@14269
  1006
val inj_real_of_preal = thm"inj_real_of_preal";
paulson@14269
  1007
val eq_Abs_REAL = thm"eq_Abs_REAL";
paulson@14269
  1008
val real_minus_congruent = thm"real_minus_congruent";
paulson@14269
  1009
val real_minus = thm"real_minus";
paulson@14269
  1010
val real_minus_minus = thm"real_minus_minus";
paulson@14269
  1011
val inj_real_minus = thm"inj_real_minus";
paulson@14269
  1012
val real_minus_zero = thm"real_minus_zero";
paulson@14269
  1013
val real_minus_zero_iff = thm"real_minus_zero_iff";
paulson@14269
  1014
val real_add_congruent2_lemma = thm"real_add_congruent2_lemma";
paulson@14269
  1015
val real_add = thm"real_add";
paulson@14269
  1016
val real_add_commute = thm"real_add_commute";
paulson@14269
  1017
val real_add_assoc = thm"real_add_assoc";
paulson@14269
  1018
val real_add_left_commute = thm"real_add_left_commute";
paulson@14269
  1019
val real_add_zero_left = thm"real_add_zero_left";
paulson@14269
  1020
val real_add_zero_right = thm"real_add_zero_right";
paulson@14269
  1021
val real_add_minus = thm"real_add_minus";
paulson@14269
  1022
val real_add_minus_left = thm"real_add_minus_left";
paulson@14269
  1023
val real_add_minus_cancel = thm"real_add_minus_cancel";
paulson@14269
  1024
val real_minus_add_cancel = thm"real_minus_add_cancel";
paulson@14269
  1025
val real_minus_ex = thm"real_minus_ex";
paulson@14269
  1026
val real_minus_ex1 = thm"real_minus_ex1";
paulson@14269
  1027
val real_minus_left_ex1 = thm"real_minus_left_ex1";
paulson@14269
  1028
val real_add_minus_eq_minus = thm"real_add_minus_eq_minus";
paulson@14269
  1029
val real_as_add_inverse_ex = thm"real_as_add_inverse_ex";
paulson@14269
  1030
val real_minus_add_distrib = thm"real_minus_add_distrib";
paulson@14269
  1031
val real_add_left_cancel = thm"real_add_left_cancel";
paulson@14269
  1032
val real_add_right_cancel = thm"real_add_right_cancel";
paulson@14269
  1033
val real_diff_0 = thm"real_diff_0";
paulson@14269
  1034
val real_diff_0_right = thm"real_diff_0_right";
paulson@14269
  1035
val real_diff_self = thm"real_diff_self";
paulson@14269
  1036
val real_mult_congruent2_lemma = thm"real_mult_congruent2_lemma";
paulson@14269
  1037
val real_mult_congruent2 = thm"real_mult_congruent2";
paulson@14269
  1038
val real_mult = thm"real_mult";
paulson@14269
  1039
val real_mult_commute = thm"real_mult_commute";
paulson@14269
  1040
val real_mult_assoc = thm"real_mult_assoc";
paulson@14269
  1041
val real_mult_left_commute = thm"real_mult_left_commute";
paulson@14269
  1042
val real_mult_1 = thm"real_mult_1";
paulson@14269
  1043
val real_mult_1_right = thm"real_mult_1_right";
paulson@14269
  1044
val real_mult_0 = thm"real_mult_0";
paulson@14269
  1045
val real_mult_0_right = thm"real_mult_0_right";
paulson@14269
  1046
val real_mult_minus_eq1 = thm"real_mult_minus_eq1";
paulson@14269
  1047
val real_minus_mult_eq1 = thm"real_minus_mult_eq1";
paulson@14269
  1048
val real_mult_minus_eq2 = thm"real_mult_minus_eq2";
paulson@14269
  1049
val real_minus_mult_eq2 = thm"real_minus_mult_eq2";
paulson@14269
  1050
val real_mult_minus_1 = thm"real_mult_minus_1";
paulson@14269
  1051
val real_mult_minus_1_right = thm"real_mult_minus_1_right";
paulson@14269
  1052
val real_minus_mult_cancel = thm"real_minus_mult_cancel";
paulson@14269
  1053
val real_minus_mult_commute = thm"real_minus_mult_commute";
paulson@14269
  1054
val real_add_assoc_cong = thm"real_add_assoc_cong";
paulson@14269
  1055
val real_add_mult_distrib = thm"real_add_mult_distrib";
paulson@14269
  1056
val real_add_mult_distrib2 = thm"real_add_mult_distrib2";
paulson@14269
  1057
val real_diff_mult_distrib = thm"real_diff_mult_distrib";
paulson@14269
  1058
val real_diff_mult_distrib2 = thm"real_diff_mult_distrib2";
paulson@14269
  1059
val real_zero_not_eq_one = thm"real_zero_not_eq_one";
paulson@14269
  1060
val real_zero_iff = thm"real_zero_iff";
paulson@14269
  1061
val preal_le_linear = thm"preal_le_linear";
paulson@14269
  1062
val real_mult_inv_right_ex = thm"real_mult_inv_right_ex";
paulson@14269
  1063
val real_mult_inv_left_ex = thm"real_mult_inv_left_ex";
paulson@14269
  1064
val real_mult_inv_left = thm"real_mult_inv_left";
paulson@14269
  1065
val real_mult_inv_right = thm"real_mult_inv_right";
paulson@14269
  1066
val preal_lemma_eq_rev_sum = thm"preal_lemma_eq_rev_sum";
paulson@14269
  1067
val preal_add_left_commute_cancel = thm"preal_add_left_commute_cancel";
paulson@14269
  1068
val preal_lemma_for_not_refl = thm"preal_lemma_for_not_refl";
paulson@14269
  1069
val real_less_not_refl = thm"real_less_not_refl";
paulson@14269
  1070
val real_less_irrefl = thm"real_less_irrefl";
paulson@14269
  1071
val real_not_refl2 = thm"real_not_refl2";
paulson@14269
  1072
val preal_lemma_trans = thm"preal_lemma_trans";
paulson@14269
  1073
val real_less_trans = thm"real_less_trans";
paulson@14269
  1074
val real_less_not_sym = thm"real_less_not_sym";
paulson@14269
  1075
val real_less_asym = thm"real_less_asym";
paulson@14269
  1076
val real_of_preal_add = thm"real_of_preal_add";
paulson@14269
  1077
val real_of_preal_mult = thm"real_of_preal_mult";
paulson@14269
  1078
val real_of_preal_ExI = thm"real_of_preal_ExI";
paulson@14269
  1079
val real_of_preal_ExD = thm"real_of_preal_ExD";
paulson@14269
  1080
val real_of_preal_iff = thm"real_of_preal_iff";
paulson@14269
  1081
val real_of_preal_trichotomy = thm"real_of_preal_trichotomy";
paulson@14269
  1082
val real_of_preal_trichotomyE = thm"real_of_preal_trichotomyE";
paulson@14269
  1083
val real_of_preal_lessD = thm"real_of_preal_lessD";
paulson@14269
  1084
val real_of_preal_lessI = thm"real_of_preal_lessI";
paulson@14269
  1085
val real_of_preal_less_iff1 = thm"real_of_preal_less_iff1";
paulson@14269
  1086
val real_of_preal_minus_less_self = thm"real_of_preal_minus_less_self";
paulson@14269
  1087
val real_of_preal_minus_less_zero = thm"real_of_preal_minus_less_zero";
paulson@14269
  1088
val real_of_preal_not_minus_gt_zero = thm"real_of_preal_not_minus_gt_zero";
paulson@14269
  1089
val real_of_preal_zero_less = thm"real_of_preal_zero_less";
paulson@14269
  1090
val real_of_preal_not_less_zero = thm"real_of_preal_not_less_zero";
paulson@14269
  1091
val real_minus_minus_zero_less = thm"real_minus_minus_zero_less";
paulson@14269
  1092
val real_of_preal_sum_zero_less = thm"real_of_preal_sum_zero_less";
paulson@14269
  1093
val real_of_preal_minus_less_all = thm"real_of_preal_minus_less_all";
paulson@14269
  1094
val real_of_preal_not_minus_gt_all = thm"real_of_preal_not_minus_gt_all";
paulson@14269
  1095
val real_of_preal_minus_less_rev1 = thm"real_of_preal_minus_less_rev1";
paulson@14269
  1096
val real_of_preal_minus_less_rev2 = thm"real_of_preal_minus_less_rev2";
paulson@14269
  1097
val real_of_preal_minus_less_rev_iff = thm"real_of_preal_minus_less_rev_iff";
paulson@14269
  1098
val real_linear = thm"real_linear";
paulson@14269
  1099
val real_neq_iff = thm"real_neq_iff";
paulson@14269
  1100
val real_linear_less2 = thm"real_linear_less2";
paulson@14269
  1101
val real_leI = thm"real_leI";
paulson@14269
  1102
val real_leD = thm"real_leD";
paulson@14269
  1103
val real_leE = thm"real_leE";
paulson@14269
  1104
val real_less_le_iff = thm"real_less_le_iff";
paulson@14269
  1105
val not_real_leE = thm"not_real_leE";
paulson@14269
  1106
val real_le_imp_less_or_eq = thm"real_le_imp_less_or_eq";
paulson@14269
  1107
val real_less_or_eq_imp_le = thm"real_less_or_eq_imp_le";
paulson@14269
  1108
val real_le_less = thm"real_le_less";
paulson@14269
  1109
val real_le_refl = thm"real_le_refl";
paulson@14269
  1110
val real_le_linear = thm"real_le_linear";
paulson@14269
  1111
val real_le_trans = thm"real_le_trans";
paulson@14269
  1112
val real_le_anti_sym = thm"real_le_anti_sym";
paulson@14269
  1113
val real_less_le = thm"real_less_le";
paulson@14269
  1114
val real_minus_zero_less_iff = thm"real_minus_zero_less_iff";
paulson@14269
  1115
val real_minus_zero_less_iff2 = thm"real_minus_zero_less_iff2";
paulson@14269
  1116
val real_less_add_positive_left_Ex = thm"real_less_add_positive_left_Ex";
paulson@14269
  1117
val real_less_sum_gt_zero = thm"real_less_sum_gt_zero";
paulson@14269
  1118
val real_lemma_change_eq_subj = thm"real_lemma_change_eq_subj";
paulson@14269
  1119
val real_sum_gt_zero_less = thm"real_sum_gt_zero_less";
paulson@14269
  1120
val real_less_sum_gt_0_iff = thm"real_less_sum_gt_0_iff";
paulson@14269
  1121
val real_less_eq_diff = thm"real_less_eq_diff";
paulson@14269
  1122
val real_add_diff_eq = thm"real_add_diff_eq";
paulson@14269
  1123
val real_diff_add_eq = thm"real_diff_add_eq";
paulson@14269
  1124
val real_diff_diff_eq = thm"real_diff_diff_eq";
paulson@14269
  1125
val real_diff_diff_eq2 = thm"real_diff_diff_eq2";
paulson@14269
  1126
val real_diff_less_eq = thm"real_diff_less_eq";
paulson@14269
  1127
val real_less_diff_eq = thm"real_less_diff_eq";
paulson@14269
  1128
val real_diff_le_eq = thm"real_diff_le_eq";
paulson@14269
  1129
val real_le_diff_eq = thm"real_le_diff_eq";
paulson@14269
  1130
val real_diff_eq_eq = thm"real_diff_eq_eq";
paulson@14269
  1131
val real_eq_diff_eq = thm"real_eq_diff_eq";
paulson@14269
  1132
val real_less_eqI = thm"real_less_eqI";
paulson@14269
  1133
val real_le_eqI = thm"real_le_eqI";
paulson@14269
  1134
val real_eq_eqI = thm"real_eq_eqI";
paulson@14269
  1135
paulson@14269
  1136
val real_add_ac = thms"real_add_ac";
paulson@14269
  1137
val real_mult_ac = thms"real_mult_ac";
paulson@14269
  1138
val real_compare_rls = thms"real_compare_rls";
paulson@14269
  1139
*}
paulson@14269
  1140
paulson@10752
  1141
paulson@5588
  1142
end