author | huffman |
Mon, 14 May 2007 17:45:42 +0200 | |
changeset 22967 | 0651b224528a |
parent 22962 | 4bb05ba38939 |
child 22970 | b5910e3dec4c |
permissions | -rw-r--r-- |
9435
c3a13a7d4424
lemmas [arith_split] = abs_split (*belongs to theory RealAbs*);
wenzelm
parents:
9013
diff
changeset
|
1 |
(* Title : HOL/Real/RealPow.thy |
7219 | 2 |
ID : $Id$ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
3 |
Author : Jacques D. Fleuriot |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
4 |
Copyright : 1998 University of Cambridge |
20634 | 5 |
*) |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
6 |
|
20634 | 7 |
header {* Natural powers theory *} |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
8 |
|
15131 | 9 |
theory RealPow |
15140 | 10 |
imports RealDef |
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 |
|
10309 | 15 |
instance real :: power .. |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
16 |
|
8856 | 17 |
primrec (realpow) |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11701
diff
changeset
|
18 |
realpow_0: "r ^ 0 = 1" |
9435
c3a13a7d4424
lemmas [arith_split] = abs_split (*belongs to theory RealAbs*);
wenzelm
parents:
9013
diff
changeset
|
19 |
realpow_Suc: "r ^ (Suc n) = (r::real) * (r ^ n)" |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
20 |
|
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
21 |
|
15003 | 22 |
instance real :: recpower |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
23 |
proof |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
24 |
fix z :: real |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
25 |
fix n :: nat |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
26 |
show "z^0 = 1" by simp |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
27 |
show "z^(Suc n) = z * (z^n)" by simp |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
28 |
qed |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
29 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
30 |
|
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
31 |
lemma realpow_zero_zero: "r ^ n = (0::real) ==> r = 0" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
32 |
by simp |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
33 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
34 |
lemma realpow_two: "(r::real)^ (Suc (Suc 0)) = r * r" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
35 |
by simp |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
36 |
|
19765 | 37 |
text{*Legacy: weaker version of the theorem @{text power_strict_mono}*} |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
38 |
lemma realpow_less: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
39 |
"[|(0::real) < x; x < y; 0 < n|] ==> x ^ n < y ^ n" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
40 |
apply (rule power_strict_mono, auto) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
41 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
42 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
43 |
lemma realpow_two_le [simp]: "(0::real) \<le> r^ Suc (Suc 0)" |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
44 |
by (simp add: real_le_square) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
45 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
46 |
lemma abs_realpow_two [simp]: "abs((x::real)^Suc (Suc 0)) = x^Suc (Suc 0)" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
47 |
by (simp add: abs_mult) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
48 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
49 |
lemma realpow_two_abs [simp]: "abs(x::real)^Suc (Suc 0) = x^Suc (Suc 0)" |
15229 | 50 |
by (simp add: power_abs [symmetric] del: realpow_Suc) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
51 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
52 |
lemma two_realpow_ge_one [simp]: "(1::real) \<le> 2 ^ n" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
53 |
by (insert power_increasing [of 0 n "2::real"], simp) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
54 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
55 |
lemma two_realpow_gt [simp]: "real (n::nat) < 2 ^ 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_Suc) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14352
diff
changeset
|
58 |
apply (subst mult_2) |
22962 | 59 |
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
|
60 |
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
|
61 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
62 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
63 |
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
|
64 |
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
|
65 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
66 |
lemma realpow_minus_mult [rule_format]: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
67 |
"0 < n --> (x::real) ^ (n - 1) * x = x ^ n" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
68 |
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
|
69 |
done |
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 |
lemma realpow_two_mult_inverse [simp]: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
72 |
"r \<noteq> 0 ==> r * inverse r ^Suc (Suc 0) = inverse (r::real)" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
73 |
by (simp add: realpow_two real_mult_assoc [symmetric]) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
74 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
75 |
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
|
76 |
by simp |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
77 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
78 |
lemma realpow_two_diff: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
79 |
"(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
|
80 |
apply (unfold real_diff_def) |
14334 | 81 |
apply (simp add: right_distrib left_distrib mult_ac) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
82 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
83 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
84 |
lemma realpow_two_disj: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
85 |
"((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
|
86 |
apply (cut_tac x = x and y = y in realpow_two_diff) |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
87 |
apply (auto simp del: realpow_Suc) |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
88 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
89 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
90 |
lemma realpow_real_of_nat: "real (m::nat) ^ n = real (m ^ n)" |
15251 | 91 |
apply (induct "n") |
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
92 |
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
|
93 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
94 |
|
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
95 |
lemma realpow_real_of_nat_two_pos [simp] : "0 < real (Suc (Suc 0) ^ n)" |
15251 | 96 |
apply (induct "n") |
14334 | 97 |
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
|
98 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
99 |
|
22962 | 100 |
(* 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
|
101 |
lemma realpow_increasing: |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
102 |
"[|(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
|
103 |
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
|
104 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
105 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
106 |
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
|
107 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
108 |
lemma real_of_int_power: "real (x::int) ^ n = real (x ^ n)" |
15251 | 109 |
apply (induct "n") |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14352
diff
changeset
|
110 |
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
|
111 |
done |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
112 |
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
|
113 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
114 |
lemma power_real_number_of: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
115 |
"(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
|
116 |
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
|
117 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
118 |
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
|
119 |
|
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
12018
diff
changeset
|
120 |
|
22967 | 121 |
subsection {* Properties of Squares *} |
122 |
||
123 |
lemma sum_squares_ge_zero: |
|
124 |
fixes x y :: "'a::ordered_ring_strict" |
|
125 |
shows "0 \<le> x * x + y * y" |
|
126 |
by (intro add_nonneg_nonneg zero_le_square) |
|
127 |
||
128 |
lemma not_sum_squares_lt_zero: |
|
129 |
fixes x y :: "'a::ordered_ring_strict" |
|
130 |
shows "\<not> x * x + y * y < 0" |
|
131 |
by (simp add: linorder_not_less sum_squares_ge_zero) |
|
132 |
||
133 |
lemma sum_nonneg_eq_zero_iff: |
|
134 |
fixes x y :: "'a::pordered_ab_group_add" |
|
135 |
assumes x: "0 \<le> x" and y: "0 \<le> y" |
|
136 |
shows "(x + y = 0) = (x = 0 \<and> y = 0)" |
|
137 |
proof (auto) |
|
138 |
from y have "x + 0 \<le> x + y" by (rule add_left_mono) |
|
139 |
also assume "x + y = 0" |
|
140 |
finally have "x \<le> 0" by simp |
|
141 |
thus "x = 0" using x by (rule order_antisym) |
|
142 |
next |
|
143 |
from x have "0 + y \<le> x + y" by (rule add_right_mono) |
|
144 |
also assume "x + y = 0" |
|
145 |
finally have "y \<le> 0" by simp |
|
146 |
thus "y = 0" using y by (rule order_antisym) |
|
147 |
qed |
|
148 |
||
149 |
lemma sum_squares_eq_zero_iff: |
|
150 |
fixes x y :: "'a::ordered_ring_strict" |
|
151 |
shows "(x * x + y * y = 0) = (x = 0 \<and> y = 0)" |
|
152 |
by (simp add: sum_nonneg_eq_zero_iff zero_le_square) |
|
153 |
||
154 |
lemma sum_squares_le_zero_iff: |
|
155 |
fixes x y :: "'a::ordered_ring_strict" |
|
156 |
shows "(x * x + y * y \<le> 0) = (x = 0 \<and> y = 0)" |
|
157 |
by (simp add: order_le_less not_sum_squares_lt_zero sum_squares_eq_zero_iff) |
|
158 |
||
159 |
lemma sum_squares_gt_zero_iff: |
|
160 |
fixes x y :: "'a::ordered_ring_strict" |
|
161 |
shows "(0 < x * x + y * y) = (x \<noteq> 0 \<or> y \<noteq> 0)" |
|
162 |
by (simp add: order_less_le sum_squares_ge_zero sum_squares_eq_zero_iff) |
|
163 |
||
164 |
lemma sum_power2_ge_zero: |
|
165 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
166 |
shows "0 \<le> x\<twosuperior> + y\<twosuperior>" |
|
167 |
unfolding power2_eq_square by (rule sum_squares_ge_zero) |
|
168 |
||
169 |
lemma not_sum_power2_lt_zero: |
|
170 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
171 |
shows "\<not> x\<twosuperior> + y\<twosuperior> < 0" |
|
172 |
unfolding power2_eq_square by (rule not_sum_squares_lt_zero) |
|
173 |
||
174 |
lemma sum_power2_eq_zero_iff: |
|
175 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
176 |
shows "(x\<twosuperior> + y\<twosuperior> = 0) = (x = 0 \<and> y = 0)" |
|
177 |
unfolding power2_eq_square by (rule sum_squares_eq_zero_iff) |
|
178 |
||
179 |
lemma sum_power2_le_zero_iff: |
|
180 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
181 |
shows "(x\<twosuperior> + y\<twosuperior> \<le> 0) = (x = 0 \<and> y = 0)" |
|
182 |
unfolding power2_eq_square by (rule sum_squares_le_zero_iff) |
|
183 |
||
184 |
lemma sum_power2_gt_zero_iff: |
|
185 |
fixes x y :: "'a::{ordered_idom,recpower}" |
|
186 |
shows "(0 < x\<twosuperior> + y\<twosuperior>) = (x \<noteq> 0 \<or> y \<noteq> 0)" |
|
187 |
unfolding power2_eq_square by (rule sum_squares_gt_zero_iff) |
|
188 |
||
189 |
||
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
190 |
subsection{*Various Other Theorems*} |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
191 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
192 |
lemma real_sum_squares_cancel_a: "x * x = -(y * y) ==> x = (0::real) & y=0" |
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15003
diff
changeset
|
193 |
apply (auto dest: real_sum_squares_cancel simp add: real_add_eq_0_iff [symmetric]) |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15003
diff
changeset
|
194 |
apply (auto dest: real_sum_squares_cancel simp add: add_commute) |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15003
diff
changeset
|
195 |
done |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
196 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
197 |
lemma real_squared_diff_one_factored: "x*x - (1::real) = (x + 1)*(x - 1)" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
198 |
by (auto simp add: left_distrib right_distrib real_diff_def) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
199 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
200 |
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
|
201 |
apply auto |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
202 |
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
|
203 |
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
|
204 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
205 |
|
14304 | 206 |
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
|
207 |
by auto |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
208 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
209 |
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
|
210 |
by auto |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
211 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
212 |
lemma real_mult_inverse_cancel: |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
213 |
"[|(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
|
214 |
==> inverse x * y < inverse x1 * u" |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
215 |
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
|
216 |
apply (auto simp add: real_mult_assoc [symmetric]) |
14334 | 217 |
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
|
218 |
apply (rule_tac c=x1 in mult_less_imp_less_right) |
14334 | 219 |
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
|
220 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
221 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
222 |
lemma real_mult_inverse_cancel2: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
223 |
"[|(0::real) < x;0 < x1; x1 * y < x * u |] ==> y * inverse x < u * inverse x1" |
14334 | 224 |
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
|
225 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
226 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
227 |
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
|
228 |
by simp |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
229 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
230 |
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
|
231 |
by simp |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
232 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
233 |
lemma real_sum_squares_not_zero: "x ~= 0 ==> x * x + y * y ~= (0::real)" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
234 |
by (blast dest!: real_sum_squares_cancel) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
235 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
236 |
lemma real_sum_squares_not_zero2: "y ~= 0 ==> x * x + y * y ~= (0::real)" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
237 |
by (blast dest!: real_sum_squares_cancel2) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
238 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
239 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
240 |
subsection {*Various Other Theorems*} |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
241 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
242 |
lemma realpow_two_sum_zero_iff [simp]: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
243 |
"(x ^ 2 + y ^ 2 = (0::real)) = (x = 0 & y = 0)" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
244 |
apply (auto intro: real_sum_squares_cancel real_sum_squares_cancel2 |
14352 | 245 |
simp add: power2_eq_square) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
246 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
247 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
248 |
lemma realpow_two_le_add_order [simp]: "(0::real) \<le> u ^ 2 + v ^ 2" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
249 |
apply (rule real_le_add_order) |
14352 | 250 |
apply (auto simp add: power2_eq_square) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
251 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
252 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
253 |
lemma realpow_two_le_add_order2 [simp]: "(0::real) \<le> u ^ 2 + v ^ 2 + w ^ 2" |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
254 |
apply (rule real_le_add_order)+ |
14352 | 255 |
apply (auto simp add: power2_eq_square) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
256 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
257 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
258 |
lemma real_sum_square_gt_zero: "x ~= 0 ==> (0::real) < x * x + y * y" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
259 |
apply (cut_tac x = x and y = y in real_mult_self_sum_ge_zero) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
260 |
apply (drule real_le_imp_less_or_eq) |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
261 |
apply (drule_tac y = y in real_sum_squares_not_zero, auto) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
262 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
263 |
|
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
264 |
lemma real_sum_square_gt_zero2: "y ~= 0 ==> (0::real) < x * x + y * y" |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
265 |
apply (rule real_add_commute [THEN subst]) |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
266 |
apply (erule real_sum_square_gt_zero) |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
267 |
done |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
268 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
269 |
lemma real_minus_mult_self_le [simp]: "-(u * u) \<le> (x * (x::real))" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
270 |
by (rule_tac j = 0 in real_le_trans, auto) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
271 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14334
diff
changeset
|
272 |
lemma realpow_square_minus_le [simp]: "-(u ^ 2) \<le> (x::real) ^ 2" |
14352 | 273 |
by (auto simp add: power2_eq_square) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
274 |
|
19279 | 275 |
(* The following theorem is by Benjamin Porter *) |
276 |
lemma real_sq_order: |
|
277 |
fixes x::real |
|
278 |
assumes xgt0: "0 \<le> x" and ygt0: "0 \<le> y" and sq: "x^2 \<le> y^2" |
|
279 |
shows "x \<le> y" |
|
20517
86343f2386a8
simplify some proofs, remove obsolete realpow_divide
huffman
parents:
19765
diff
changeset
|
280 |
proof - |
86343f2386a8
simplify some proofs, remove obsolete realpow_divide
huffman
parents:
19765
diff
changeset
|
281 |
from sq have "x ^ Suc (Suc 0) \<le> y ^ Suc (Suc 0)" |
86343f2386a8
simplify some proofs, remove obsolete realpow_divide
huffman
parents:
19765
diff
changeset
|
282 |
by (simp only: numeral_2_eq_2) |
22624
7a6c8ed516ab
removed unnecessary premise from power_le_imp_le_base
huffman
parents:
20634
diff
changeset
|
283 |
thus "x \<le> y" using ygt0 |
20517
86343f2386a8
simplify some proofs, remove obsolete realpow_divide
huffman
parents:
19765
diff
changeset
|
284 |
by (rule power_le_imp_le_base) |
19279 | 285 |
qed |
286 |
||
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
287 |
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
|
288 |
by (case_tac "n", auto) |
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14265
diff
changeset
|
289 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
diff
changeset
|
290 |
end |