src/HOL/Real/RealOrd.thy
author paulson
Mon, 22 Dec 2003 14:12:54 +0100
changeset 14310 1dd7439477dd
parent 14308 c0489217deb2
child 14317 85125b18d38a
permissions -rw-r--r--
simplifying
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8838
diff changeset
     1
(*  Title:	 Real/RealOrd.thy
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8838
diff changeset
     2
    ID: 	 $Id$
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8838
diff changeset
     3
    Author:      Jacques D. Fleuriot and Lawrence C. Paulson
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     4
    Copyright:   1998  University of Cambridge
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     5
*)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     6
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
     7
header{*The Reals Form an Ordered Field, etc.*}
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
     8
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
     9
theory RealOrd = RealDef:
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
    10
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
    11
defs (overloaded)
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
    12
  real_abs_def:  "abs (r::real) == (if 0 \<le> r then r else -r)"
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
    13
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
    14
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
    15
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    16
subsection{*Properties of Less-Than Or Equals*}
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    17
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    18
lemma real_leI: "~(w < z) ==> z \<le> (w::real)"
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
    19
by (unfold real_le_def, assumption)
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    20
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    21
lemma real_leD: "z\<le>w ==> ~(w<(z::real))"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    22
by (unfold real_le_def, assumption)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    23
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    24
lemma not_real_leE: "~ z \<le> w ==> w<(z::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    25
by (unfold real_le_def, blast)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    26
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    27
lemma real_le_imp_less_or_eq: "!!(x::real). x \<le> y ==> x < y | x = y"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    28
apply (unfold real_le_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    29
apply (cut_tac real_linear)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    30
apply (blast elim: real_less_irrefl real_less_asym)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    31
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    32
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    33
lemma real_less_or_eq_imp_le: "z<w | z=w ==> z \<le>(w::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    34
apply (unfold real_le_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    35
apply (cut_tac real_linear)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    36
apply (fast elim: real_less_irrefl real_less_asym)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    37
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    38
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    39
lemma real_le_less: "(x \<le> (y::real)) = (x < y | x=y)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    40
by (blast intro!: real_less_or_eq_imp_le dest!: real_le_imp_less_or_eq)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    41
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    42
lemma real_le_refl: "w \<le> (w::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    43
by (simp add: real_le_less)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    44
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    45
lemma real_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    46
apply (drule real_le_imp_less_or_eq) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    47
apply (drule real_le_imp_less_or_eq) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    48
apply (rule real_less_or_eq_imp_le) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    49
apply (blast intro: real_less_trans) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    50
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    51
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    52
lemma real_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    53
apply (drule real_le_imp_less_or_eq) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    54
apply (drule real_le_imp_less_or_eq) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    55
apply (fast elim: real_less_irrefl real_less_asym)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    56
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    57
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    58
(* Axiom 'order_less_le' of class 'order': *)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    59
lemma real_less_le: "((w::real) < z) = (w \<le> z & w ~= z)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    60
apply (simp add: real_le_def real_neq_iff)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    61
apply (blast elim!: real_less_asym)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    62
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    63
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    64
instance real :: order
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    65
  by (intro_classes,
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    66
      (assumption | 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    67
       rule real_le_refl real_le_trans real_le_anti_sym real_less_le)+)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    68
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    69
(* Axiom 'linorder_linear' of class 'linorder': *)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    70
lemma real_le_linear: "(z::real) \<le> w | w \<le> z"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    71
apply (simp add: real_le_less)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    72
apply (cut_tac real_linear, blast)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    73
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    74
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    75
instance real :: linorder
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    76
  by (intro_classes, rule real_le_linear)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    77
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    78
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    79
subsection{*Theorems About the Ordering*}
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    80
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    81
lemma real_gt_zero_preal_Ex: "(0 < x) = (\<exists>y. x = real_of_preal y)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    82
apply (auto simp add: real_of_preal_zero_less)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    83
apply (cut_tac x = x in real_of_preal_trichotomy)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    84
apply (blast elim!: real_less_irrefl real_of_preal_not_minus_gt_zero [THEN notE])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    85
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    86
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    87
lemma real_gt_preal_preal_Ex: "real_of_preal z < x ==> \<exists>y. x = real_of_preal y"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    88
by (blast dest!: real_of_preal_zero_less [THEN real_less_trans]
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    89
             intro: real_gt_zero_preal_Ex [THEN iffD1])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    90
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    91
lemma real_ge_preal_preal_Ex: "real_of_preal z \<le> x ==> \<exists>y. x = real_of_preal y"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    92
by (blast dest: order_le_imp_less_or_eq real_gt_preal_preal_Ex)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    93
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    94
lemma real_less_all_preal: "y \<le> 0 ==> \<forall>x. y < real_of_preal x"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    95
by (auto elim: order_le_imp_less_or_eq [THEN disjE] 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    96
            intro: real_of_preal_zero_less [THEN [2] real_less_trans] 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    97
            simp add: real_of_preal_zero_less)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    98
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
    99
lemma real_less_all_real2: "~ 0 < y ==> \<forall>x. y < real_of_preal x"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   100
by (blast intro!: real_less_all_preal real_leI)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   101
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   102
lemma real_of_preal_le_iff: "(real_of_preal m1 \<le> real_of_preal m2) = (m1 \<le> m2)"
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   103
apply (auto intro!: preal_leI simp add: linorder_not_less [symmetric])
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   104
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   105
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   106
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   107
subsection{*Monotonicity of Addition*}
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   108
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   109
lemma real_add_left_cancel: "((x::real) + y = x + z) = (y = z)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   110
apply safe
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   111
apply (drule_tac f = "%t. (-x) + t" in arg_cong)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   112
apply (simp add: real_add_assoc [symmetric])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   113
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   114
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   115
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   116
lemma real_mult_order: "[| 0 < x; 0 < y |] ==> (0::real) < x * y"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   117
apply (auto simp add: real_gt_zero_preal_Ex)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   118
apply (rule_tac x = "y*ya" in exI)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   119
apply (simp (no_asm_use) add: real_of_preal_mult)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   120
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   121
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   122
lemma real_minus_add_distrib [simp]: "-(x + y) = (-x) + (- y :: real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   123
apply (rule_tac z = x in eq_Abs_REAL)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   124
apply (rule_tac z = y in eq_Abs_REAL)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   125
apply (auto simp add: real_minus real_add)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   126
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   127
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   128
(*Alternative definition for real_less*)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   129
lemma real_less_add_positive_left_Ex: "R < S ==> \<exists>T::real. 0 < T & R + T = S"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   130
apply (rule_tac x = R in real_of_preal_trichotomyE)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   131
apply (rule_tac [!] x = S in real_of_preal_trichotomyE)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   132
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)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   133
apply (rule_tac x = "real_of_preal D" in exI)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   134
apply (rule_tac [2] x = "real_of_preal m+real_of_preal ma" in exI)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   135
apply (rule_tac [3] x = "real_of_preal D" in exI)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   136
apply (auto simp add: real_of_preal_zero_less real_of_preal_sum_zero_less real_add_assoc)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   137
apply (simp add: real_add_assoc [symmetric])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   138
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   139
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   140
lemma real_less_sum_gt_zero: "(W < S) ==> (0 < S + (-W::real))"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   141
apply (drule real_less_add_positive_left_Ex)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   142
apply (auto simp add: real_add_minus real_add_zero_right real_add_ac)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   143
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   144
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   145
lemma real_lemma_change_eq_subj: "!!S::real. T = S + W ==> S = T + (-W)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   146
by (simp add: real_add_ac)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   147
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   148
(* FIXME: long! *)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   149
lemma real_sum_gt_zero_less: "(0 < S + (-W::real)) ==> (W < S)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   150
apply (rule ccontr)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   151
apply (drule real_leI [THEN real_le_imp_less_or_eq])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   152
apply (auto simp add: real_less_not_refl)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   153
apply (drule real_less_add_positive_left_Ex, clarify, simp)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   154
apply (drule real_lemma_change_eq_subj, auto)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   155
apply (drule real_less_sum_gt_zero)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   156
apply (auto elim: real_less_asym simp add: real_add_left_commute [of W] real_add_ac)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   157
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   158
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   159
lemma real_mult_less_mono2: "[| (0::real) < z; x < y |] ==> z * x < z * y"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   160
apply (rule real_sum_gt_zero_less)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   161
apply (drule real_less_sum_gt_zero [of x y])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   162
apply (drule real_mult_order, assumption)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   163
apply (simp add: real_add_mult_distrib2)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   164
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   165
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   166
lemma real_less_sum_gt_0_iff: "(0 < S + (-W::real)) = (W < S)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   167
by (blast intro: real_less_sum_gt_zero real_sum_gt_zero_less)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   168
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   169
lemma real_less_eq_diff: "(x<y) = (x-y < (0::real))"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   170
apply (unfold real_diff_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   171
apply (subst real_minus_zero_less_iff [symmetric])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   172
apply (simp add: real_add_commute real_less_sum_gt_0_iff)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   173
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   174
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   175
lemma real_less_eqI: "(x::real) - y = x' - y' ==> (x<y) = (x'<y')"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   176
apply (subst real_less_eq_diff)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   177
apply (rule_tac y1 = y in real_less_eq_diff [THEN ssubst], simp)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   178
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   179
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   180
lemma real_le_eqI: "(x::real) - y = x' - y' ==> (y\<le>x) = (y'\<le>x')"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   181
apply (drule real_less_eqI)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   182
apply (simp add: real_le_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   183
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   184
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   185
lemma real_add_left_mono: "x \<le> y ==> z + x \<le> z + (y::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   186
apply (rule real_le_eqI [THEN iffD1]) 
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   187
 prefer 2 apply assumption
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   188
apply (simp add: real_diff_def real_add_ac)
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   189
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   190
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   191
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   192
subsection{*The Reals Form an Ordered Field*}
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   193
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   194
instance real :: inverse ..
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   195
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   196
instance real :: ordered_field
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   197
proof
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   198
  fix x y z :: real
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   199
  show "(x + y) + z = x + (y + z)" by (rule real_add_assoc)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   200
  show "x + y = y + x" by (rule real_add_commute)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   201
  show "0 + x = x" by simp
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   202
  show "- x + x = 0" by simp
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   203
  show "x - y = x + (-y)" by (simp add: real_diff_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   204
  show "(x * y) * z = x * (y * z)" by (rule real_mult_assoc)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   205
  show "x * y = y * x" by (rule real_mult_commute)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   206
  show "1 * x = x" by simp
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   207
  show "(x + y) * z = x * z + y * z" by (simp add: real_add_mult_distrib)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   208
  show "0 \<noteq> (1::real)" by (rule real_zero_not_eq_one)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   209
  show "x \<le> y ==> z + x \<le> z + y" by (rule real_add_left_mono)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   210
  show "x < y ==> 0 < z ==> z * x < z * y" by (simp add: real_mult_less_mono2)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   211
  show "\<bar>x\<bar> = (if x < 0 then -x else x)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   212
    by (auto dest: order_le_less_trans simp add: real_abs_def linorder_not_le)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   213
  show "x \<noteq> 0 ==> inverse x * x = 1" by simp
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   214
  show "y \<noteq> 0 ==> x / y = x * inverse y" by (simp add: real_divide_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   215
qed
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   216
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   217
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   218
lemma real_zero_less_one: "0 < (1::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   219
  by (rule Ring_and_Field.zero_less_one)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   220
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   221
lemma real_add_less_mono: "[| R1 < S1; R2 < S2 |] ==> R1+R2 < S1+(S2::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   222
 by (rule Ring_and_Field.add_strict_mono)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   223
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   224
lemma real_add_le_mono: "[|i\<le>j;  k\<le>l |] ==> i + k \<le> j + (l::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   225
 by (rule Ring_and_Field.add_mono)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   226
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   227
lemma real_le_minus_iff: "(-s \<le> -r) = ((r::real) \<le> s)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   228
 by (rule Ring_and_Field.neg_le_iff_le)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   229
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   230
lemma real_le_square [simp]: "(0::real) \<le> x*x"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   231
 by (rule Ring_and_Field.zero_le_square)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   232
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   233
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   234
subsection{*Division Lemmas*}
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   235
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   236
(** Inverse of zero!  Useful to simplify certain equations **)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   237
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   238
lemma INVERSE_ZERO: "inverse 0 = (0::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   239
apply (unfold real_inverse_def)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   240
apply (rule someI2)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   241
apply (auto simp add: real_zero_not_eq_one)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   242
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   243
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   244
lemma DIVISION_BY_ZERO [simp]: "a / (0::real) = 0"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   245
  by (simp add: real_divide_def INVERSE_ZERO)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   246
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   247
instance real :: division_by_zero
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   248
proof
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   249
  fix x :: real
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   250
  show "inverse 0 = (0::real)" by (rule INVERSE_ZERO)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   251
  show "x/0 = 0" by (rule DIVISION_BY_ZERO) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   252
qed
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   253
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   254
lemma real_mult_left_cancel: "(c::real) ~= 0 ==> (c*a=c*b) = (a=b)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   255
by auto
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   256
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   257
lemma real_mult_right_cancel: "(c::real) ~= 0 ==> (a*c=b*c) = (a=b)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   258
by auto
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   259
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   260
lemma real_mult_left_cancel_ccontr: "c*a ~= c*b ==> a ~= b"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   261
by auto
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   262
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   263
lemma real_mult_right_cancel_ccontr: "a*c ~= b*c ==> a ~= b"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   264
by auto
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   265
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   266
lemma real_inverse_not_zero: "x ~= 0 ==> inverse(x::real) ~= 0"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   267
  by (rule Ring_and_Field.nonzero_imp_inverse_nonzero)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   268
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   269
lemma real_mult_not_zero: "[| x ~= 0; y ~= 0 |] ==> x * y ~= (0::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   270
by simp
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   271
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   272
lemma real_inverse_inverse: "inverse(inverse (x::real)) = x"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   273
  by (rule Ring_and_Field.inverse_inverse_eq)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   274
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   275
lemma real_inverse_1: "inverse((1::real)) = (1::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   276
  by (rule Ring_and_Field.inverse_1)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   277
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   278
lemma real_minus_inverse: "inverse(-x) = -inverse(x::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   279
  by (rule Ring_and_Field.inverse_minus_eq)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   280
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   281
lemma real_inverse_distrib: "inverse(x*y) = inverse(x)*inverse(y::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   282
  by (rule Ring_and_Field.inverse_mult_distrib)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   283
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   284
lemma real_add_divide_distrib: "(x+y)/(z::real) = x/z + y/z"
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   285
  by (rule Ring_and_Field.add_divide_distrib)
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   286
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   287
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   288
subsection{*More Lemmas*}
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   289
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   290
lemma real_add_right_cancel: "(y + (x::real)= z + x) = (y = z)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   291
  by (rule Ring_and_Field.add_right_cancel)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   292
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   293
lemma real_add_less_mono1: "v < (w::real) ==> v + z < w + z"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   294
  by (rule Ring_and_Field.add_strict_right_mono)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   295
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   296
lemma real_add_le_mono1: "v \<le> (w::real) ==> v + z \<le> w + z"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   297
  by (rule Ring_and_Field.add_right_mono)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   298
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   299
lemma real_add_less_le_mono: "[| w'<w; z'\<le>z |] ==> w' + z' < w + (z::real)"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   300
apply (erule add_strict_right_mono [THEN order_less_le_trans])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   301
apply (erule add_left_mono) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   302
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   303
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   304
lemma real_add_le_less_mono: "!!z z'::real. [| w'\<le>w; z'<z |] ==> w' + z' < w + z"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   305
apply (erule add_right_mono [THEN order_le_less_trans])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   306
apply (erule add_strict_left_mono) 
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   307
done
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   308
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   309
lemma real_less_add_right_cancel: "!!(A::real). A + C < B + C ==> A < B"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   310
  by (rule Ring_and_Field.add_less_imp_less_right)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   311
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   312
lemma real_less_add_left_cancel: "!!(A::real). C + A < C + B ==> A < B"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   313
  by (rule Ring_and_Field.add_less_imp_less_left)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   314
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   315
lemma real_le_add_right_cancel: "!!(A::real). A + C \<le> B + C ==> A \<le> B"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   316
  by (rule Ring_and_Field.add_le_imp_le_right)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   317
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   318
lemma real_le_add_left_cancel: "!!(A::real). C + A \<le> C + B ==> A \<le> B"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   319
  by (rule (*Ring_and_Field.*)add_le_imp_le_left)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   320
14310
1dd7439477dd simplifying
paulson
parents: 14308
diff changeset
   321
lemma real_add_right_cancel_less: "(v+z < w+z) = (v < (w::real))"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   322
  by (rule Ring_and_Field.add_less_cancel_right)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   323
14310
1dd7439477dd simplifying
paulson
parents: 14308
diff changeset
   324
lemma real_add_left_cancel_less: "(z+v < z+w) = (v < (w::real))"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   325
  by (rule Ring_and_Field.add_less_cancel_left)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   326
14310
1dd7439477dd simplifying
paulson
parents: 14308
diff changeset
   327
lemma real_add_right_cancel_le: "(v+z \<le> w+z) = (v \<le> (w::real))"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   328
  by (rule Ring_and_Field.add_le_cancel_right)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   329
14310
1dd7439477dd simplifying
paulson
parents: 14308
diff changeset
   330
lemma real_add_left_cancel_le: "(z+v \<le> z+w) = (v \<le> (w::real))"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   331
  by (rule Ring_and_Field.add_le_cancel_left)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   332
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   333
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   334
subsection{*Inverse and Division*}
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   335
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   336
lemma real_inverse_gt_0: "0 < x ==> 0 < inverse (x::real)"
14277
ad66687ece6e more field division lemmas transferred from Real to Ring_and_Field
paulson
parents: 14271
diff changeset
   337
  by (rule Ring_and_Field.positive_imp_inverse_positive)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   338
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   339
lemma real_inverse_less_0: "x < 0 ==> inverse (x::real) < 0"
14277
ad66687ece6e more field division lemmas transferred from Real to Ring_and_Field
paulson
parents: 14271
diff changeset
   340
  by (rule Ring_and_Field.negative_imp_inverse_negative)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   341
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   342
lemma real_mult_less_mono1: "[| (0::real) < z; x < y |] ==> x*z < y*z"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   343
 by (rule Ring_and_Field.mult_strict_right_mono)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   344
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   345
text{*The precondition could be weakened to @{term "0\<le>x"}*}
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   346
lemma real_mult_less_mono:
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   347
     "[| u<v;  x<y;  (0::real) < v;  0 < x |] ==> u*x < v* y"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   348
 by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   349
14266
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   350
lemma real_mult_less_iff1 [simp]: "(0::real) < z ==> (x*z < y*z) = (x < y)"
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   351
  by (force elim: order_less_asym
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   352
            simp add: Ring_and_Field.mult_less_cancel_right)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   353
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   354
lemma real_mult_le_cancel_iff1 [simp]: "(0::real) < z ==> (x*z \<le> y*z) = (x\<le>y)"
14266
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   355
by (auto simp add: real_le_def)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   356
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   357
lemma real_mult_le_cancel_iff2 [simp]: "(0::real) < z ==> (z*x \<le> z*y) = (x\<le>y)"
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   358
  by (force elim: order_less_asym
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   359
            simp add: Ring_and_Field.mult_le_cancel_left)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   360
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   361
text{*Only two uses?*}
14266
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   362
lemma real_mult_less_mono':
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   363
     "[| x < y;  r1 < r2;  (0::real) \<le> r1;  0 \<le> x|] ==> r1 * x < r2 * y"
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   364
 by (rule Ring_and_Field.mult_strict_mono')
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   365
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   366
lemma real_inverse_less_swap:
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   367
     "[| 0 < r; r < x |] ==> inverse x < inverse (r::real)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   368
  by (rule Ring_and_Field.less_imp_inverse_less)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   369
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   370
(*FIXME: remove the [iff], since the general theorem is already [simp]*)
14266
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   371
lemma real_mult_is_0 [iff]: "(x*y = 0) = (x = 0 | y = (0::real))"
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   372
by (rule Ring_and_Field.mult_eq_0_iff)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   373
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   374
lemma real_inverse_add: "[| x \<noteq> 0; y \<noteq> 0 |]  
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   375
      ==> inverse x + inverse y = (x + y) * inverse (x * (y::real))"
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   376
by (simp add: Ring_and_Field.inverse_add mult_assoc)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   377
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   378
text{*FIXME: delete or at least combine the next two lemmas*}
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   379
lemma real_sum_squares_cancel: "x * x + y * y = 0 ==> x = (0::real)"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   380
apply (drule Ring_and_Field.equals_zero_I [THEN sym])
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   381
apply (cut_tac x = y in real_le_square) 
14266
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   382
apply (auto, drule real_le_anti_sym, auto)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   383
done
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   384
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   385
lemma real_sum_squares_cancel2: "x * x + y * y = 0 ==> y = (0::real)"
14266
08b34c902618 conversion of integers to use Ring_and_Field;
paulson
parents: 14265
diff changeset
   386
apply (rule_tac y = x in real_sum_squares_cancel)
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   387
apply (simp add: real_add_commute)
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   388
done
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   389
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   390
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   391
subsection{*Convenient Biconditionals for Products of Signs*}
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   392
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   393
lemma real_0_less_mult_iff: "((0::real) < x*y) = (0<x & 0<y | x<0 & y<0)"
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   394
  by (rule Ring_and_Field.zero_less_mult_iff) 
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   395
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   396
lemma real_0_le_mult_iff: "((0::real)\<le>x*y) = (0\<le>x & 0\<le>y | x\<le>0 & y\<le>0)"
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   397
  by (rule Ring_and_Field.zero_le_mult_iff) 
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   398
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   399
lemma real_mult_less_0_iff: "(x*y < (0::real)) = (0<x & y<0 | x<0 & 0<y)"
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   400
  by (rule Ring_and_Field.mult_less_0_iff) 
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   401
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   402
lemma real_mult_le_0_iff: "(x*y \<le> (0::real)) = (0\<le>x & y\<le>0 | x\<le>0 & 0\<le>y)"
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   403
  by (rule Ring_and_Field.mult_le_0_iff) 
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   404
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   405
subsection{*Hardly Used Theorems to be Deleted*}
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   406
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   407
lemma real_add_less_mono2: "!!(A::real). A < B ==> C + A < C + B"
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   408
by simp
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   409
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   410
lemma real_add_order: "[| 0 < x; 0 < y |] ==> (0::real) < x + y"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   411
apply (erule order_less_trans)
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   412
apply (drule real_add_less_mono2, simp)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   413
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   414
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   415
lemma real_le_add_order: "[| 0 \<le> x; 0 \<le> y |] ==> (0::real) \<le> x + y"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   416
apply (drule order_le_imp_less_or_eq)+
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   417
apply (auto intro: real_add_order order_less_imp_le)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   418
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   419
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   420
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   421
subsection{*An Embedding of the Naturals in the Reals*}
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   422
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   423
lemma real_of_posnat_one: "real_of_posnat 0 = (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   424
by (simp add: real_of_posnat_def pnat_one_iff [symmetric]
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   425
              real_of_preal_def symmetric real_one_def)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   426
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   427
lemma real_of_posnat_two: "real_of_posnat (Suc 0) = (1::real) + (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   428
by (simp add: real_of_posnat_def real_of_preal_def real_one_def pnat_two_eq
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   429
                 real_add
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   430
            prat_of_pnat_add [symmetric] preal_of_prat_add [symmetric]
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   431
            pnat_add_ac)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   432
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   433
lemma real_of_posnat_add: 
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   434
     "real_of_posnat n1 + real_of_posnat n2 = real_of_posnat (n1 + n2) + (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   435
apply (unfold real_of_posnat_def)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   436
apply (simp (no_asm_use) add: real_of_posnat_one [symmetric] real_of_posnat_def real_of_preal_add [symmetric] preal_of_prat_add [symmetric] prat_of_pnat_add [symmetric] pnat_of_nat_add)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   437
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   438
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   439
lemma real_of_posnat_add_one: "real_of_posnat (n + 1) = real_of_posnat n + (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   440
apply (rule_tac x1 = " (1::real) " in real_add_right_cancel [THEN iffD1])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   441
apply (rule real_of_posnat_add [THEN subst])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   442
apply (simp (no_asm_use) add: real_of_posnat_two real_add_assoc)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   443
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   444
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   445
lemma real_of_posnat_Suc: "real_of_posnat (Suc n) = real_of_posnat n + (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   446
by (subst real_of_posnat_add_one [symmetric], simp)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   447
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   448
lemma inj_real_of_posnat: "inj(real_of_posnat)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   449
apply (rule inj_onI)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   450
apply (unfold real_of_posnat_def)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   451
apply (drule inj_real_of_preal [THEN injD])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   452
apply (drule inj_preal_of_prat [THEN injD])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   453
apply (drule inj_prat_of_pnat [THEN injD])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   454
apply (erule inj_pnat_of_nat [THEN injD])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   455
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   456
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   457
lemma real_of_nat_zero [simp]: "real (0::nat) = 0"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   458
by (simp add: real_of_nat_def real_of_posnat_one)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   459
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   460
lemma real_of_nat_one [simp]: "real (Suc 0) = (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   461
by (simp add: real_of_nat_def real_of_posnat_two real_add_assoc)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   462
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   463
lemma real_of_nat_add [simp]: 
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   464
     "real (m + n) = real (m::nat) + real n"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   465
apply (simp add: real_of_nat_def add_ac)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   466
apply (simp add: real_of_posnat_add add_assoc [symmetric])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   467
apply (simp add: add_commute) 
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   468
apply (simp add: add_assoc [symmetric])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   469
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   470
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   471
(*Not for addsimps: often the LHS is used to represent a positive natural*)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   472
lemma real_of_nat_Suc: "real (Suc n) = real n + (1::real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   473
by (simp add: real_of_nat_def real_of_posnat_Suc real_add_ac)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   474
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   475
lemma real_of_nat_less_iff [iff]: 
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   476
     "(real (n::nat) < real m) = (n < m)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   477
by (auto simp add: real_of_nat_def real_of_posnat_def)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   478
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   479
lemma real_of_nat_le_iff [iff]: "(real (n::nat) \<le> real m) = (n \<le> m)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   480
by (simp add: linorder_not_less [symmetric])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   481
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   482
lemma inj_real_of_nat: "inj (real :: nat => real)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   483
apply (rule inj_onI)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   484
apply (auto intro!: inj_real_of_posnat [THEN injD]
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   485
            simp add: real_of_nat_def real_add_right_cancel)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   486
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   487
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   488
lemma real_of_nat_ge_zero [iff]: "0 \<le> real (n::nat)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   489
apply (induct_tac "n")
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   490
apply (auto simp add: real_of_nat_Suc)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   491
apply (drule real_add_le_less_mono)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   492
apply (rule real_zero_less_one)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   493
apply (simp add: order_less_imp_le)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   494
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   495
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   496
lemma real_of_nat_mult [simp]: "real (m * n) = real (m::nat) * real n"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   497
apply (induct_tac "m")
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   498
apply (auto simp add: real_of_nat_Suc real_add_mult_distrib real_add_commute)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   499
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   500
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   501
lemma real_of_nat_inject [iff]: "(real (n::nat) = real m) = (n = m)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   502
by (auto dest: inj_real_of_nat [THEN injD])
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   503
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   504
lemma real_of_nat_diff [rule_format]:
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   505
     "n \<le> m --> real (m - n) = real (m::nat) - real n"
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   506
apply (induct_tac "m", simp)
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   507
apply (simp add: real_diff_def Suc_diff_le le_Suc_eq real_of_nat_Suc add_ac)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   508
apply (simp add: add_left_commute [of _ "- 1"]) 
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   509
done
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   510
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   511
lemma real_of_nat_zero_iff: "(real (n::nat) = 0) = (n = 0)"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   512
  proof 
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   513
    assume "real n = 0"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   514
    have "real n = real (0::nat)" by simp
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   515
    then show "n = 0" by (simp only: real_of_nat_inject)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   516
  next
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   517
    show "n = 0 \<Longrightarrow> real n = 0" by simp
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   518
  qed
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   519
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   520
lemma real_of_nat_neg_int [simp]: "neg z ==> real (nat z) = 0"
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   521
by (simp add: neg_nat real_of_nat_zero)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   522
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   523
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   524
subsection{*Results About @{term real_of_posnat}: to be Deleted*}
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   525
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   526
lemma real_of_posnat_gt_zero: "0 < real_of_posnat n"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   527
apply (unfold real_of_posnat_def)
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   528
apply (rule real_gt_zero_preal_Ex [THEN iffD2], blast)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   529
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   530
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   531
declare real_of_posnat_gt_zero [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   532
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   533
lemmas real_inv_real_of_posnat_gt_zero =  real_of_posnat_gt_zero [THEN real_inverse_gt_0, standard]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   534
declare real_inv_real_of_posnat_gt_zero [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   535
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   536
lemmas real_of_posnat_ge_zero = real_of_posnat_gt_zero [THEN order_less_imp_le, standard]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   537
declare real_of_posnat_ge_zero [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   538
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   539
lemma real_of_posnat_not_eq_zero: "real_of_posnat n ~= 0"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   540
by (rule real_of_posnat_gt_zero [THEN real_not_refl2, THEN not_sym])
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   541
declare real_of_posnat_not_eq_zero [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   542
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   543
declare real_of_posnat_not_eq_zero [THEN real_mult_inv_left, simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   544
declare real_of_posnat_not_eq_zero [THEN real_mult_inv_right, simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   545
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   546
lemma real_of_posnat_ge_one: "1 <= real_of_posnat n"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   547
apply (simp (no_asm) add: real_of_posnat_one [symmetric])
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   548
apply (induct_tac "n", simp) 
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   549
apply (simp add: real_of_posnat_Suc real_of_posnat_one order_less_imp_le)
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   550
apply (rule add_le_cancel_right [THEN iffD1, of _ "- 1"]) 
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   551
apply (simp add: add_assoc) 
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   552
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   553
declare real_of_posnat_ge_one [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   554
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   555
lemma real_of_posnat_real_inv_not_zero: "inverse(real_of_posnat n) ~= 0"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   556
apply (rule real_inverse_not_zero) 
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   557
apply (rule real_of_posnat_gt_zero [THEN real_not_refl2, THEN not_sym])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   558
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   559
declare real_of_posnat_real_inv_not_zero [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   560
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   561
lemma real_of_posnat_real_inv_inj: "inverse(real_of_posnat x) = inverse(real_of_posnat y) ==> x = y"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   562
apply (rule inj_real_of_posnat [THEN injD])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   563
apply (rule real_of_posnat_real_inv_not_zero
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   564
              [THEN real_mult_left_cancel, THEN iffD1, of x])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   565
apply (simp add: real_mult_inv_left
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   566
             real_of_posnat_gt_zero [THEN real_not_refl2, THEN not_sym])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   567
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   568
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   569
lemma real_mult_less_self: "0 < r ==> r*(1 + -inverse(real_of_posnat n)) < r"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   570
apply (simp (no_asm) add: real_add_mult_distrib2)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   571
apply (rule_tac C = "-r" in real_less_add_left_cancel)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   572
apply (auto intro: real_mult_order simp add: real_add_assoc [symmetric] real_minus_zero_less_iff2)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   573
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   574
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   575
lemma real_of_posnat_inv_Ex_iff: "(EX n. inverse(real_of_posnat n) < r) = (EX n. 1 < r * real_of_posnat n)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   576
apply safe
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   577
apply (drule_tac n1 = n in real_of_posnat_gt_zero [THEN real_mult_less_mono1])
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   578
apply (drule_tac [2] n2=n in real_of_posnat_gt_zero [THEN real_inverse_gt_0, THEN real_mult_less_mono1])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   579
apply (auto simp add: real_of_posnat_gt_zero [THEN real_not_refl2, THEN not_sym] real_mult_assoc)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   580
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   581
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   582
lemma real_of_posnat_inv_iff: "(inverse(real_of_posnat n) < r) = (1 < r * real_of_posnat n)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   583
apply safe
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   584
apply (drule_tac n1 = n in real_of_posnat_gt_zero [THEN real_mult_less_mono1])
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   585
apply (drule_tac [2] n2=n in real_of_posnat_gt_zero [THEN real_inverse_gt_0, THEN real_mult_less_mono1]) 
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   586
apply (auto simp add: real_mult_assoc)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   587
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   588
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   589
lemma real_mult_le_le_mono1: "[| (0::real) <=z; x<=y |] ==> z*x<=z*y"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   590
  by (rule Ring_and_Field.mult_left_mono)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   591
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   592
lemma real_mult_le_le_mono2: "[| (0::real)<=z; x<=y |] ==> x*z<=y*z"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   593
  by (rule Ring_and_Field.mult_right_mono)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   594
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   595
lemma real_of_posnat_inv_le_iff: "(inverse(real_of_posnat n) <= r) = (1 <= r * real_of_posnat n)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   596
apply safe
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   597
apply (drule_tac n2=n in real_of_posnat_gt_zero [THEN order_less_imp_le, THEN real_mult_le_le_mono1])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   598
apply (drule_tac [2] n3=n in real_of_posnat_gt_zero [THEN real_inverse_gt_0, THEN order_less_imp_le, THEN real_mult_le_le_mono1])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   599
apply (auto simp add: real_mult_ac)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   600
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   601
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   602
lemma real_of_posnat_less_iff: 
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   603
      "(real_of_posnat n < real_of_posnat m) = (n < m)"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   604
apply (unfold real_of_posnat_def, auto)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   605
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   606
declare real_of_posnat_less_iff [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   607
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   608
lemma real_of_posnat_le_iff: "(real_of_posnat n <= real_of_posnat m) = (n <= m)"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   609
by (auto dest: inj_real_of_posnat [THEN injD] simp add: real_le_less le_eq_less_or_eq)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   610
declare real_of_posnat_le_iff [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   611
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   612
lemma real_mult_less_cancel3: "[| (0::real)<z; x*z<y*z |] ==> x<y"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   613
by auto
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   614
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   615
lemma real_mult_less_cancel4: "[| (0::real)<z; z*x<z*y |] ==> x<y"
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   616
  by (force elim: order_less_asym
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   617
            simp add: Ring_and_Field.mult_less_cancel_left)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   618
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   619
lemma real_of_posnat_less_inv_iff: "0 < u  ==> (u < inverse (real_of_posnat n)) = (real_of_posnat n < inverse(u))"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   620
apply safe
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   621
apply (rule_tac n2=n in real_of_posnat_gt_zero [THEN real_inverse_gt_0, THEN real_mult_less_cancel3])
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   622
apply (rule_tac [2] x1 = u in real_inverse_gt_0 [THEN real_mult_less_cancel3])
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   623
apply (auto simp add: real_not_refl2 [THEN not_sym])
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   624
apply (rule_tac z = u in real_mult_less_cancel4)
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   625
apply (rule_tac [3] n1 = n in real_of_posnat_gt_zero [THEN real_mult_less_cancel4])
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   626
apply (auto simp add: real_not_refl2 [THEN not_sym] real_mult_assoc [symmetric])
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   627
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   628
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   629
lemma real_of_posnat_inv_eq_iff: "0 < u ==> (u = inverse(real_of_posnat n)) = (real_of_posnat n = inverse u)"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   630
by auto
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   631
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   632
lemma real_add_one_minus_inv_ge_zero: "0 <= 1 + -inverse(real_of_posnat n)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   633
apply (rule_tac C = "inverse (real_of_posnat n) " in real_le_add_right_cancel)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   634
apply (simp (no_asm) add: real_add_assoc real_of_posnat_inv_le_iff)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   635
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   636
14288
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   637
(*Used just below and in HahnBanach/Aux.thy*)
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   638
lemma real_mult_le_less_mono1: "[| (0::real) \<le> z; x < y |] ==> x*z \<le> y*z"
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   639
apply (rule real_less_or_eq_imp_le)
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   640
apply (drule order_le_imp_less_or_eq)
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   641
apply (auto intro: real_mult_less_mono1)
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   642
done
d149e3cbdb39 Moving some theorems from Real/RealArith0.ML
paulson
parents: 14284
diff changeset
   643
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   644
lemma real_mult_add_one_minus_ge_zero: "0 < r ==> 0 <= r*(1 + -inverse(real_of_posnat n))"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   645
by (drule real_add_one_minus_inv_ge_zero [THEN real_mult_le_less_mono1], auto)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   646
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   647
lemma real_inverse_unique: "x*y = (1::real) ==> y = inverse x"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   648
apply (case_tac "x ~= 0")
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   649
apply (rule_tac c1 = x in real_mult_left_cancel [THEN iffD1], auto)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   650
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   651
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   652
lemma real_inverse_gt_one: "[| (0::real) < x; x < 1 |] ==> 1 < inverse x"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   653
by (auto dest: real_inverse_less_swap)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   654
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   655
lemma real_of_nat_gt_zero_cancel_iff: "(0 < real (n::nat)) = (0 < n)"
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   656
by (rule real_of_nat_less_iff [THEN subst], auto)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   657
declare real_of_nat_gt_zero_cancel_iff [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   658
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   659
lemma real_of_nat_le_zero_cancel_iff: "(real (n::nat) <= 0) = (n = 0)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   660
apply (rule real_of_nat_zero [THEN subst])
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   661
apply (subst real_of_nat_le_iff, auto)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   662
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   663
declare real_of_nat_le_zero_cancel_iff [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   664
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   665
lemma not_real_of_nat_less_zero: "~ real (n::nat) < 0"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   666
apply (simp (no_asm) add: real_le_def [symmetric] real_of_nat_ge_zero)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   667
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   668
declare not_real_of_nat_less_zero [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   669
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   670
lemma real_of_nat_ge_zero_cancel_iff: 
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   671
      "(0 <= real (n::nat)) = (0 <= n)"
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   672
apply (unfold real_le_def le_def)
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   673
apply (simp (no_asm))
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   674
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   675
declare real_of_nat_ge_zero_cancel_iff [simp]
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   676
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   677
lemma real_of_nat_num_if: "real n = (if n=0 then 0 else 1 + real ((n::nat) - 1))"
14293
22542982bffd moving some division theorems to Ring_and_Field
paulson
parents: 14290
diff changeset
   678
apply (case_tac "n", simp) 
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   679
apply (simp add: real_of_nat_Suc add_commute)
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   680
done
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   681
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   682
lemma real_mult_self_sum_ge_zero: "(0::real) \<le> x*x + y*y"
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   683
proof -
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   684
  have "0 + 0 \<le> x*x + y*y" by (blast intro: add_mono zero_le_square)
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   685
  thus ?thesis by simp
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   686
qed
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   687
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   688
declare real_mult_self_sum_ge_zero [simp]
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   689
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   690
ML
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   691
{*
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   692
val real_abs_def = thm "real_abs_def";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   693
14270
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   694
val real_less_eq_diff = thm "real_less_eq_diff";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   695
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   696
val real_add_right_cancel = thm"real_add_right_cancel";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   697
val real_mult_congruent2_lemma = thm"real_mult_congruent2_lemma";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   698
val real_mult_congruent2 = thm"real_mult_congruent2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   699
val real_mult = thm"real_mult";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   700
val real_mult_commute = thm"real_mult_commute";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   701
val real_mult_assoc = thm"real_mult_assoc";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   702
val real_mult_left_commute = thm"real_mult_left_commute";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   703
val real_mult_1 = thm"real_mult_1";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   704
val real_mult_1_right = thm"real_mult_1_right";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   705
val real_mult_0 = thm"real_mult_0";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   706
val real_mult_0_right = thm"real_mult_0_right";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   707
val real_mult_minus_eq1 = thm"real_mult_minus_eq1";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   708
val real_minus_mult_eq1 = thm"real_minus_mult_eq1";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   709
val real_mult_minus_eq2 = thm"real_mult_minus_eq2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   710
val real_minus_mult_eq2 = thm"real_minus_mult_eq2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   711
val real_mult_minus_1 = thm"real_mult_minus_1";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   712
val real_mult_minus_1_right = thm"real_mult_minus_1_right";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   713
val real_minus_mult_cancel = thm"real_minus_mult_cancel";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   714
val real_minus_mult_commute = thm"real_minus_mult_commute";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   715
val real_add_assoc_cong = thm"real_add_assoc_cong";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   716
val real_add_mult_distrib = thm"real_add_mult_distrib";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   717
val real_add_mult_distrib2 = thm"real_add_mult_distrib2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   718
val real_diff_mult_distrib = thm"real_diff_mult_distrib";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   719
val real_diff_mult_distrib2 = thm"real_diff_mult_distrib2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   720
val real_zero_not_eq_one = thm"real_zero_not_eq_one";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   721
val real_zero_iff = thm"real_zero_iff";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   722
val preal_le_linear = thm"preal_le_linear";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   723
val real_mult_inv_right_ex = thm"real_mult_inv_right_ex";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   724
val real_mult_inv_left_ex = thm"real_mult_inv_left_ex";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   725
val real_mult_inv_left = thm"real_mult_inv_left";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   726
val real_mult_inv_right = thm"real_mult_inv_right";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   727
val preal_lemma_eq_rev_sum = thm"preal_lemma_eq_rev_sum";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   728
val preal_add_left_commute_cancel = thm"preal_add_left_commute_cancel";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   729
val preal_lemma_for_not_refl = thm"preal_lemma_for_not_refl";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   730
val real_less_not_refl = thm"real_less_not_refl";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   731
val real_less_irrefl = thm"real_less_irrefl";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   732
val real_not_refl2 = thm"real_not_refl2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   733
val preal_lemma_trans = thm"preal_lemma_trans";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   734
val real_less_trans = thm"real_less_trans";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   735
val real_less_not_sym = thm"real_less_not_sym";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   736
val real_less_asym = thm"real_less_asym";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   737
val real_of_preal_add = thm"real_of_preal_add";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   738
val real_of_preal_mult = thm"real_of_preal_mult";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   739
val real_of_preal_ExI = thm"real_of_preal_ExI";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   740
val real_of_preal_ExD = thm"real_of_preal_ExD";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   741
val real_of_preal_iff = thm"real_of_preal_iff";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   742
val real_of_preal_trichotomy = thm"real_of_preal_trichotomy";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   743
val real_of_preal_trichotomyE = thm"real_of_preal_trichotomyE";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   744
val real_of_preal_lessD = thm"real_of_preal_lessD";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   745
val real_of_preal_lessI = thm"real_of_preal_lessI";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   746
val real_of_preal_less_iff1 = thm"real_of_preal_less_iff1";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   747
val real_of_preal_minus_less_self = thm"real_of_preal_minus_less_self";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   748
val real_of_preal_minus_less_zero = thm"real_of_preal_minus_less_zero";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   749
val real_of_preal_not_minus_gt_zero = thm"real_of_preal_not_minus_gt_zero";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   750
val real_of_preal_zero_less = thm"real_of_preal_zero_less";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   751
val real_of_preal_not_less_zero = thm"real_of_preal_not_less_zero";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   752
val real_minus_minus_zero_less = thm"real_minus_minus_zero_less";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   753
val real_of_preal_sum_zero_less = thm"real_of_preal_sum_zero_less";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   754
val real_of_preal_minus_less_all = thm"real_of_preal_minus_less_all";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   755
val real_of_preal_not_minus_gt_all = thm"real_of_preal_not_minus_gt_all";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   756
val real_of_preal_minus_less_rev1 = thm"real_of_preal_minus_less_rev1";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   757
val real_of_preal_minus_less_rev2 = thm"real_of_preal_minus_less_rev2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   758
val real_of_preal_minus_less_rev_iff = thm"real_of_preal_minus_less_rev_iff";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   759
val real_linear = thm"real_linear";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   760
val real_neq_iff = thm"real_neq_iff";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   761
val real_linear_less2 = thm"real_linear_less2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   762
val real_leI = thm"real_leI";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   763
val real_leD = thm"real_leD";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   764
val not_real_leE = thm"not_real_leE";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   765
val real_le_imp_less_or_eq = thm"real_le_imp_less_or_eq";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   766
val real_less_or_eq_imp_le = thm"real_less_or_eq_imp_le";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   767
val real_le_less = thm"real_le_less";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   768
val real_le_refl = thm"real_le_refl";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   769
val real_le_linear = thm"real_le_linear";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   770
val real_le_trans = thm"real_le_trans";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   771
val real_le_anti_sym = thm"real_le_anti_sym";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   772
val real_less_le = thm"real_less_le";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   773
val real_minus_zero_less_iff = thm"real_minus_zero_less_iff";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   774
val real_minus_zero_less_iff2 = thm"real_minus_zero_less_iff2";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   775
val real_less_add_positive_left_Ex = thm"real_less_add_positive_left_Ex";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   776
val real_less_sum_gt_zero = thm"real_less_sum_gt_zero";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   777
val real_sum_gt_zero_less = thm"real_sum_gt_zero_less";
342451d763f9 More re-organising of numerical theorems
paulson
parents: 14269
diff changeset
   778
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   779
val real_gt_zero_preal_Ex = thm "real_gt_zero_preal_Ex";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   780
val real_gt_preal_preal_Ex = thm "real_gt_preal_preal_Ex";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   781
val real_ge_preal_preal_Ex = thm "real_ge_preal_preal_Ex";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   782
val real_less_all_preal = thm "real_less_all_preal";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   783
val real_less_all_real2 = thm "real_less_all_real2";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   784
val real_of_preal_le_iff = thm "real_of_preal_le_iff";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   785
val real_mult_order = thm "real_mult_order";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   786
val real_zero_less_one = thm "real_zero_less_one";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   787
val real_add_right_cancel_less = thm "real_add_right_cancel_less";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   788
val real_add_left_cancel_less = thm "real_add_left_cancel_less";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   789
val real_add_right_cancel_le = thm "real_add_right_cancel_le";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   790
val real_add_left_cancel_le = thm "real_add_left_cancel_le";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   791
val real_add_less_mono1 = thm "real_add_less_mono1";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   792
val real_add_le_mono1 = thm "real_add_le_mono1";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   793
val real_add_less_le_mono = thm "real_add_less_le_mono";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   794
val real_add_le_less_mono = thm "real_add_le_less_mono";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   795
val real_add_less_mono2 = thm "real_add_less_mono2";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   796
val real_less_add_right_cancel = thm "real_less_add_right_cancel";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   797
val real_less_add_left_cancel = thm "real_less_add_left_cancel";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   798
val real_le_add_right_cancel = thm "real_le_add_right_cancel";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   799
val real_le_add_left_cancel = thm "real_le_add_left_cancel";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   800
val real_add_order = thm "real_add_order";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   801
val real_le_add_order = thm "real_le_add_order";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   802
val real_add_less_mono = thm "real_add_less_mono";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   803
val real_add_le_mono = thm "real_add_le_mono";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   804
val real_le_minus_iff = thm "real_le_minus_iff";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   805
val real_le_square = thm "real_le_square";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   806
val real_mult_less_mono1 = thm "real_mult_less_mono1";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   807
val real_mult_less_mono2 = thm "real_mult_less_mono2";
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   808
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   809
val real_inverse_gt_0 = thm "real_inverse_gt_0";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   810
val real_inverse_less_0 = thm "real_inverse_less_0";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   811
val real_mult_less_iff1 = thm "real_mult_less_iff1";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   812
val real_mult_le_cancel_iff1 = thm "real_mult_le_cancel_iff1";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   813
val real_mult_le_cancel_iff2 = thm "real_mult_le_cancel_iff2";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   814
val real_mult_less_mono = thm "real_mult_less_mono";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   815
val real_mult_less_mono' = thm "real_mult_less_mono'";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   816
val real_inverse_less_swap = thm "real_inverse_less_swap";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   817
val real_mult_is_0 = thm "real_mult_is_0";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   818
val real_inverse_add = thm "real_inverse_add";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   819
val real_sum_squares_cancel = thm "real_sum_squares_cancel";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   820
val real_sum_squares_cancel2 = thm "real_sum_squares_cancel2";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   821
val real_0_less_mult_iff = thm "real_0_less_mult_iff";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   822
val real_0_le_mult_iff = thm "real_0_le_mult_iff";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   823
val real_mult_less_0_iff = thm "real_mult_less_0_iff";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   824
val real_mult_le_0_iff = thm "real_mult_le_0_iff";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   825
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   826
val INVERSE_ZERO = thm"INVERSE_ZERO";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   827
val DIVISION_BY_ZERO = thm"DIVISION_BY_ZERO";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   828
val real_mult_left_cancel = thm"real_mult_left_cancel";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   829
val real_mult_right_cancel = thm"real_mult_right_cancel";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   830
val real_mult_left_cancel_ccontr = thm"real_mult_left_cancel_ccontr";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   831
val real_mult_right_cancel_ccontr = thm"real_mult_right_cancel_ccontr";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   832
val real_inverse_not_zero = thm"real_inverse_not_zero";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   833
val real_mult_not_zero = thm"real_mult_not_zero";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   834
val real_inverse_inverse = thm"real_inverse_inverse";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   835
val real_inverse_1 = thm"real_inverse_1";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   836
val real_minus_inverse = thm"real_minus_inverse";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   837
val real_inverse_distrib = thm"real_inverse_distrib";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   838
val real_add_divide_distrib = thm"real_add_divide_distrib";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   839
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   840
val real_of_posnat_one = thm "real_of_posnat_one";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   841
val real_of_posnat_two = thm "real_of_posnat_two";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   842
val real_of_posnat_add = thm "real_of_posnat_add";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   843
val real_of_posnat_add_one = thm "real_of_posnat_add_one";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   844
val real_of_posnat_Suc = thm "real_of_posnat_Suc";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   845
val inj_real_of_posnat = thm "inj_real_of_posnat";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   846
val real_of_nat_zero = thm "real_of_nat_zero";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   847
val real_of_nat_one = thm "real_of_nat_one";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   848
val real_of_nat_add = thm "real_of_nat_add";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   849
val real_of_nat_Suc = thm "real_of_nat_Suc";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   850
val real_of_nat_less_iff = thm "real_of_nat_less_iff";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   851
val real_of_nat_le_iff = thm "real_of_nat_le_iff";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   852
val inj_real_of_nat = thm "inj_real_of_nat";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   853
val real_of_nat_ge_zero = thm "real_of_nat_ge_zero";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   854
val real_of_nat_mult = thm "real_of_nat_mult";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   855
val real_of_nat_inject = thm "real_of_nat_inject";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   856
val real_of_nat_diff = thm "real_of_nat_diff";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   857
val real_of_nat_zero_iff = thm "real_of_nat_zero_iff";
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   858
val real_of_nat_neg_int = thm "real_of_nat_neg_int";
14268
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   859
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   860
val real_of_posnat_gt_zero = thm "real_of_posnat_gt_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   861
val real_inv_real_of_posnat_gt_zero = thm "real_inv_real_of_posnat_gt_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   862
val real_of_posnat_ge_zero = thm "real_of_posnat_ge_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   863
val real_of_posnat_not_eq_zero = thm "real_of_posnat_not_eq_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   864
val real_of_posnat_ge_one = thm "real_of_posnat_ge_one";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   865
val real_of_posnat_real_inv_not_zero = thm "real_of_posnat_real_inv_not_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   866
val real_of_posnat_real_inv_inj = thm "real_of_posnat_real_inv_inj";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   867
val real_mult_less_self = thm "real_mult_less_self";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   868
val real_of_posnat_inv_Ex_iff = thm "real_of_posnat_inv_Ex_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   869
val real_of_posnat_inv_iff = thm "real_of_posnat_inv_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   870
val real_mult_le_le_mono1 = thm "real_mult_le_le_mono1";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   871
val real_mult_le_le_mono2 = thm "real_mult_le_le_mono2";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   872
val real_of_posnat_inv_le_iff = thm "real_of_posnat_inv_le_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   873
val real_of_posnat_less_iff = thm "real_of_posnat_less_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   874
val real_of_posnat_le_iff = thm "real_of_posnat_le_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   875
val real_of_posnat_less_inv_iff = thm "real_of_posnat_less_inv_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   876
val real_of_posnat_inv_eq_iff = thm "real_of_posnat_inv_eq_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   877
val real_add_one_minus_inv_ge_zero = thm "real_add_one_minus_inv_ge_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   878
val real_mult_add_one_minus_ge_zero = thm "real_mult_add_one_minus_ge_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   879
val real_inverse_unique = thm "real_inverse_unique";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   880
val real_inverse_gt_one = thm "real_inverse_gt_one";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   881
val real_of_nat_gt_zero_cancel_iff = thm "real_of_nat_gt_zero_cancel_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   882
val real_of_nat_le_zero_cancel_iff = thm "real_of_nat_le_zero_cancel_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   883
val not_real_of_nat_less_zero = thm "not_real_of_nat_less_zero";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   884
val real_of_nat_ge_zero_cancel_iff = thm "real_of_nat_ge_zero_cancel_iff";
5cf13e80be0e Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents: 14266
diff changeset
   885
val real_of_nat_num_if = thm "real_of_nat_num_if";
14269
502a7c95de73 conversion of some Real theories to Isar scripts
paulson
parents: 14268
diff changeset
   886
14290
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   887
val real_minus_add_distrib = thm"real_minus_add_distrib";
84fda1b39947 removal of abel_cancel from Real
paulson
parents: 14288
diff changeset
   888
val real_add_left_cancel = thm"real_add_left_cancel";
14304
cc0b4bbfbc43 minor tweaks
paulson
parents: 14293
diff changeset
   889
val real_mult_self_sum_ge_zero = thm "real_mult_self_sum_ge_zero";
14265
95b42e69436c HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents: 9043
diff changeset
   890
*}
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   891
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   892
end