author | haftmann |
Wed, 22 Apr 2009 19:09:21 +0200 | |
changeset 30960 | fec1a04b7220 |
parent 30273 | ecd6f0ca62ea |
child 31014 | 79f0858d9d49 |
permissions | -rw-r--r-- |
28952
15a4b2cf8c34
made repository layout more coherent with logical distribution structure; stripped some $Id$s
haftmann
parents:
28906
diff
changeset
|
1 |
(* Title : HOL/RealPow.thy |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
2 |
Author : Jacques D. Fleuriot |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
3 |
Copyright : 1998 University of Cambridge |
20634 | 4 |
*) |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
5 |
|
20634 | 6 |
header {* Natural powers theory *} |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
7 |
|
15131 | 8 |
theory RealPow |
15140 | 9 |
imports RealDef |
28952
15a4b2cf8c34
made repository layout more coherent with logical distribution structure; stripped some $Id$s
haftmann
parents:
28906
diff
changeset
|
10 |
uses ("Tools/float_syntax.ML") |
15131 | 11 |
begin |
9435
c3a13a7d4424
lemmas [arith_split] = abs_split (*belongs to theory RealAbs*);
wenzelm
parents:
9013
diff
changeset
|
12 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
13 |
declare abs_mult_self [simp] |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
14 |
|
30960 | 15 |
instance real :: recpower .. |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
16 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
17 |
lemma two_realpow_ge_one [simp]: "(1::real) \<le> 2 ^ n" |
25875 | 18 |
by simp |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
19 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
20 |
lemma two_realpow_gt [simp]: "real (n::nat) < 2 ^ n" |
15251 | 21 |
apply (induct "n") |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
22 |
apply (auto simp add: real_of_nat_Suc) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14352
diff
changeset
|
23 |
apply (subst mult_2) |
22962 | 24 |
apply (rule add_less_le_mono) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
25 |
apply (auto simp add: two_realpow_ge_one) |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
26 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
27 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
28 |
lemma realpow_Suc_le_self: "[| 0 \<le> r; r \<le> (1::real) |] ==> r ^ Suc n \<le> r" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
29 |
by (insert power_decreasing [of 1 "Suc n" r], simp) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
30 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
31 |
lemma realpow_minus_mult [rule_format]: |
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29667
diff
changeset
|
32 |
"0 < n --> (x::real) ^ (n - 1) * x = x ^ n" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
33 |
apply (simp split add: nat_diff_split) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
34 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
35 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
36 |
lemma realpow_two_mult_inverse [simp]: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
37 |
"r \<noteq> 0 ==> r * inverse r ^Suc (Suc 0) = inverse (r::real)" |
23292 | 38 |
by (simp add: real_mult_assoc [symmetric]) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
39 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
40 |
lemma realpow_two_minus [simp]: "(-x)^Suc (Suc 0) = (x::real)^Suc (Suc 0)" |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
41 |
by simp |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
42 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
43 |
lemma realpow_two_diff: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
44 |
"(x::real)^Suc (Suc 0) - y^Suc (Suc 0) = (x - y) * (x + y)" |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
45 |
apply (unfold real_diff_def) |
29667 | 46 |
apply (simp add: algebra_simps) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
47 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
48 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
49 |
lemma realpow_two_disj: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
50 |
"((x::real)^Suc (Suc 0) = y^Suc (Suc 0)) = (x = y | x = -y)" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
51 |
apply (cut_tac x = x and y = y in realpow_two_diff) |
30273
ecd6f0ca62ea
declare power_Suc [simp]; remove redundant type-specific versions of power_Suc
huffman
parents:
30082
diff
changeset
|
52 |
apply auto |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
53 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
54 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
55 |
lemma realpow_real_of_nat: "real (m::nat) ^ n = real (m ^ n)" |
15251 | 56 |
apply (induct "n") |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
57 |
apply (auto simp add: real_of_nat_one real_of_nat_mult) |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
58 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
59 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
60 |
lemma realpow_real_of_nat_two_pos [simp] : "0 < real (Suc (Suc 0) ^ n)" |
15251 | 61 |
apply (induct "n") |
14334 | 62 |
apply (auto simp add: real_of_nat_mult zero_less_mult_iff) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
63 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
64 |
|
22962 | 65 |
(* used by AFP Integration theory *) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
66 |
lemma realpow_increasing: |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
67 |
"[|(0::real) \<le> x; 0 \<le> y; x ^ Suc n \<le> y ^ Suc n|] ==> x \<le> y" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
68 |
by (rule power_le_imp_le_base) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
69 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
70 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
71 |
subsection{*Literal Arithmetic Involving Powers, Type @{typ real}*} |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
72 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
73 |
lemma real_of_int_power: "real (x::int) ^ n = real (x ^ n)" |
15251 | 74 |
apply (induct "n") |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14352
diff
changeset
|
75 |
apply (simp_all add: nat_mult_distrib) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
76 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
77 |
declare real_of_int_power [symmetric, simp] |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
78 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
79 |
lemma power_real_number_of: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
80 |
"(number_of v :: real) ^ n = real ((number_of v :: int) ^ n)" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14352
diff
changeset
|
81 |
by (simp only: real_number_of [symmetric] real_of_int_power) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
82 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
83 |
declare power_real_number_of [of _ "number_of w", standard, simp] |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
84 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
85 |
|
22967 | 86 |
subsection {* Properties of Squares *} |
87 |
||
88 |
lemma sum_squares_ge_zero: |
|
89 |
fixes x y :: "'a::ordered_ring_strict" |
|
90 |
shows "0 \<le> x * x + y * y" |
|
91 |
by (intro add_nonneg_nonneg zero_le_square) |
|
92 |
||
93 |
lemma not_sum_squares_lt_zero: |
|
94 |
fixes x y :: "'a::ordered_ring_strict" |
|
95 |
shows "\<not> x * x + y * y < 0" |
|
96 |
by (simp add: linorder_not_less sum_squares_ge_zero) |
|
97 |
||
98 |
lemma sum_nonneg_eq_zero_iff: |
|
99 |
fixes x y :: "'a::pordered_ab_group_add" |
|
100 |
assumes x: "0 \<le> x" and y: "0 \<le> y" |
|
101 |
shows "(x + y = 0) = (x = 0 \<and> y = 0)" |
|
102 |
proof (auto) |
|
103 |
from y have "x + 0 \<le> x + y" by (rule add_left_mono) |
|
104 |
also assume "x + y = 0" |
|
105 |
finally have "x \<le> 0" by simp |
|
106 |
thus "x = 0" using x by (rule order_antisym) |
|
107 |
next |
|
108 |
from x have "0 + y \<le> x + y" by (rule add_right_mono) |
|
109 |
also assume "x + y = 0" |
|
110 |
finally have "y \<le> 0" by simp |
|
111 |
thus "y = 0" using y by (rule order_antisym) |
|
112 |
qed |
|
113 |
||
114 |
lemma sum_squares_eq_zero_iff: |
|
115 |
fixes x y :: "'a::ordered_ring_strict" |
|
116 |
shows "(x * x + y * y = 0) = (x = 0 \<and> y = 0)" |
|
23096 | 117 |
by (simp add: sum_nonneg_eq_zero_iff) |
22967 | 118 |
|
119 |
lemma sum_squares_le_zero_iff: |
|
120 |
fixes x y :: "'a::ordered_ring_strict" |
|
121 |
shows "(x * x + y * y \<le> 0) = (x = 0 \<and> y = 0)" |
|
122 |
by (simp add: order_le_less not_sum_squares_lt_zero sum_squares_eq_zero_iff) |
|
123 |
||
124 |
lemma sum_squares_gt_zero_iff: |
|
125 |
fixes x y :: "'a::ordered_ring_strict" |
|
126 |
shows "(0 < x * x + y * y) = (x \<noteq> 0 \<or> y \<noteq> 0)" |
|
127 |
by (simp add: order_less_le sum_squares_ge_zero sum_squares_eq_zero_iff) |
|
128 |
||
129 |
lemma sum_power2_ge_zero: |
|
130 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
131 |
shows "0 \<le> x\<twosuperior> + y\<twosuperior>" |
|
132 |
unfolding power2_eq_square by (rule sum_squares_ge_zero) |
|
133 |
||
134 |
lemma not_sum_power2_lt_zero: |
|
135 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
136 |
shows "\<not> x\<twosuperior> + y\<twosuperior> < 0" |
|
137 |
unfolding power2_eq_square by (rule not_sum_squares_lt_zero) |
|
138 |
||
139 |
lemma sum_power2_eq_zero_iff: |
|
140 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
141 |
shows "(x\<twosuperior> + y\<twosuperior> = 0) = (x = 0 \<and> y = 0)" |
|
142 |
unfolding power2_eq_square by (rule sum_squares_eq_zero_iff) |
|
143 |
||
144 |
lemma sum_power2_le_zero_iff: |
|
145 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
146 |
shows "(x\<twosuperior> + y\<twosuperior> \<le> 0) = (x = 0 \<and> y = 0)" |
|
147 |
unfolding power2_eq_square by (rule sum_squares_le_zero_iff) |
|
148 |
||
149 |
lemma sum_power2_gt_zero_iff: |
|
150 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
151 |
shows "(0 < x\<twosuperior> + y\<twosuperior>) = (x \<noteq> 0 \<or> y \<noteq> 0)" |
|
152 |
unfolding power2_eq_square by (rule sum_squares_gt_zero_iff) |
|
153 |
||
154 |
||
22970 | 155 |
subsection{* Squares of Reals *} |
156 |
||
157 |
lemma real_two_squares_add_zero_iff [simp]: |
|
158 |
"(x * x + y * y = 0) = ((x::real) = 0 \<and> y = 0)" |
|
159 |
by (rule sum_squares_eq_zero_iff) |
|
160 |
||
161 |
lemma real_sum_squares_cancel: "x * x + y * y = 0 ==> x = (0::real)" |
|
162 |
by simp |
|
163 |
||
164 |
lemma real_sum_squares_cancel2: "x * x + y * y = 0 ==> y = (0::real)" |
|
165 |
by simp |
|
166 |
||
167 |
lemma real_mult_self_sum_ge_zero: "(0::real) \<le> x*x + y*y" |
|
168 |
by (rule sum_squares_ge_zero) |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
169 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
170 |
lemma real_sum_squares_cancel_a: "x * x = -(y * y) ==> x = (0::real) & y=0" |
22970 | 171 |
by (simp add: real_add_eq_0_iff [symmetric]) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
172 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
173 |
lemma real_squared_diff_one_factored: "x*x - (1::real) = (x + 1)*(x - 1)" |
22970 | 174 |
by (simp add: left_distrib right_diff_distrib) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
175 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
176 |
lemma real_mult_is_one [simp]: "(x*x = (1::real)) = (x = 1 | x = - 1)" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
177 |
apply auto |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
178 |
apply (drule right_minus_eq [THEN iffD2]) |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
179 |
apply (auto simp add: real_squared_diff_one_factored) |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
180 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
181 |
|
22970 | 182 |
lemma real_sum_squares_not_zero: "x ~= 0 ==> x * x + y * y ~= (0::real)" |
183 |
by simp |
|
184 |
||
185 |
lemma real_sum_squares_not_zero2: "y ~= 0 ==> x * x + y * y ~= (0::real)" |
|
186 |
by simp |
|
187 |
||
188 |
lemma realpow_two_sum_zero_iff [simp]: |
|
189 |
"(x ^ 2 + y ^ 2 = (0::real)) = (x = 0 & y = 0)" |
|
190 |
by (rule sum_power2_eq_zero_iff) |
|
191 |
||
192 |
lemma realpow_two_le_add_order [simp]: "(0::real) \<le> u ^ 2 + v ^ 2" |
|
193 |
by (rule sum_power2_ge_zero) |
|
194 |
||
195 |
lemma realpow_two_le_add_order2 [simp]: "(0::real) \<le> u ^ 2 + v ^ 2 + w ^ 2" |
|
196 |
by (intro add_nonneg_nonneg zero_le_power2) |
|
197 |
||
198 |
lemma real_sum_square_gt_zero: "x ~= 0 ==> (0::real) < x * x + y * y" |
|
199 |
by (simp add: sum_squares_gt_zero_iff) |
|
200 |
||
201 |
lemma real_sum_square_gt_zero2: "y ~= 0 ==> (0::real) < x * x + y * y" |
|
202 |
by (simp add: sum_squares_gt_zero_iff) |
|
203 |
||
204 |
lemma real_minus_mult_self_le [simp]: "-(u * u) \<le> (x * (x::real))" |
|
205 |
by (rule_tac j = 0 in real_le_trans, auto) |
|
206 |
||
207 |
lemma realpow_square_minus_le [simp]: "-(u ^ 2) \<le> (x::real) ^ 2" |
|
208 |
by (auto simp add: power2_eq_square) |
|
209 |
||
210 |
(* The following theorem is by Benjamin Porter *) |
|
211 |
lemma real_sq_order: |
|
212 |
fixes x::real |
|
213 |
assumes xgt0: "0 \<le> x" and ygt0: "0 \<le> y" and sq: "x^2 \<le> y^2" |
|
214 |
shows "x \<le> y" |
|
215 |
proof - |
|
216 |
from sq have "x ^ Suc (Suc 0) \<le> y ^ Suc (Suc 0)" |
|
217 |
by (simp only: numeral_2_eq_2) |
|
218 |
thus "x \<le> y" using ygt0 |
|
219 |
by (rule power_le_imp_le_base) |
|
220 |
qed |
|
221 |
||
222 |
||
223 |
subsection {*Various Other Theorems*} |
|
224 |
||
14304 | 225 |
lemma real_le_add_half_cancel: "(x + y/2 \<le> (y::real)) = (x \<le> y /2)" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
226 |
by auto |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
227 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
228 |
lemma real_minus_half_eq [simp]: "(x::real) - x/2 = x/2" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
229 |
by auto |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
230 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
231 |
lemma real_mult_inverse_cancel: |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
232 |
"[|(0::real) < x; 0 < x1; x1 * y < x * u |] |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
233 |
==> inverse x * y < inverse x1 * u" |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
234 |
apply (rule_tac c=x in mult_less_imp_less_left) |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
235 |
apply (auto simp add: real_mult_assoc [symmetric]) |
14334 | 236 |
apply (simp (no_asm) add: mult_ac) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
237 |
apply (rule_tac c=x1 in mult_less_imp_less_right) |
14334 | 238 |
apply (auto simp add: mult_ac) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
239 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
240 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
241 |
lemma real_mult_inverse_cancel2: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
242 |
"[|(0::real) < x;0 < x1; x1 * y < x * u |] ==> y * inverse x < u * inverse x1" |
14334 | 243 |
apply (auto dest: real_mult_inverse_cancel simp add: mult_ac) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
244 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
245 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
246 |
lemma inverse_real_of_nat_gt_zero [simp]: "0 < inverse (real (Suc n))" |
20517
86343f2386a8
simplify some proofs, remove obsolete realpow_divide
huffman
parents:
19765
diff
changeset
|
247 |
by simp |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
248 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
249 |
lemma inverse_real_of_nat_ge_zero [simp]: "0 \<le> inverse (real (Suc n))" |
20517
86343f2386a8
simplify some proofs, remove obsolete realpow_divide
huffman
parents:
19765
diff
changeset
|
250 |
by simp |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
251 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
252 |
lemma realpow_num_eq_if: "(m::real) ^ n = (if n=0 then 1 else m * m ^ (n - 1))" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
253 |
by (case_tac "n", auto) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
254 |
|
28906 | 255 |
subsection{* Float syntax *} |
256 |
||
257 |
syntax "_Float" :: "float_const \<Rightarrow> 'a" ("_") |
|
258 |
||
28952
15a4b2cf8c34
made repository layout more coherent with logical distribution structure; stripped some $Id$s
haftmann
parents:
28906
diff
changeset
|
259 |
use "Tools/float_syntax.ML" |
28906 | 260 |
setup FloatSyntax.setup |
261 |
||
262 |
text{* Test: *} |
|
263 |
lemma "123.456 = -111.111 + 200 + 30 + 4 + 5/10 + 6/100 + (7/1000::real)" |
|
264 |
by simp |
|
265 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
266 |
end |