author | haftmann |
Sat, 19 May 2007 11:33:30 +0200 | |
changeset 23024 | 70435ffe077d |
parent 22973 | 64d300e16370 |
child 23113 | d5cdaa3b7517 |
permissions | -rw-r--r-- |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
1 |
(* Title : RealVector.thy |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
2 |
ID: $Id$ |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
3 |
Author : Brian Huffman |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
4 |
*) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
5 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
6 |
header {* Vector Spaces and Algebras over the Reals *} |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
7 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
8 |
theory RealVector |
20684 | 9 |
imports RealPow |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
10 |
begin |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
11 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
12 |
subsection {* Locale for additive functions *} |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
13 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
14 |
locale additive = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
15 |
fixes f :: "'a::ab_group_add \<Rightarrow> 'b::ab_group_add" |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
16 |
assumes add: "f (x + y) = f x + f y" |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
17 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
18 |
lemma (in additive) zero: "f 0 = 0" |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
19 |
proof - |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
20 |
have "f 0 = f (0 + 0)" by simp |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
21 |
also have "\<dots> = f 0 + f 0" by (rule add) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
22 |
finally show "f 0 = 0" by simp |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
23 |
qed |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
24 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
25 |
lemma (in additive) minus: "f (- x) = - f x" |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
26 |
proof - |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
27 |
have "f (- x) + f x = f (- x + x)" by (rule add [symmetric]) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
28 |
also have "\<dots> = - f x + f x" by (simp add: zero) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
29 |
finally show "f (- x) = - f x" by (rule add_right_imp_eq) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
30 |
qed |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
31 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
32 |
lemma (in additive) diff: "f (x - y) = f x - f y" |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
33 |
by (simp add: diff_def add minus) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
34 |
|
22942 | 35 |
lemma (in additive) setsum: "f (setsum g A) = (\<Sum>x\<in>A. f (g x))" |
36 |
apply (cases "finite A") |
|
37 |
apply (induct set: finite) |
|
38 |
apply (simp add: zero) |
|
39 |
apply (simp add: add) |
|
40 |
apply (simp add: zero) |
|
41 |
done |
|
42 |
||
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
43 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
44 |
subsection {* Real vector spaces *} |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
45 |
|
22636 | 46 |
class scaleR = type + |
47 |
fixes scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a" |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
48 |
|
22636 | 49 |
notation |
50 |
scaleR (infixr "*#" 75) |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
51 |
|
20763 | 52 |
abbreviation |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
53 |
divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a::scaleR" (infixl "'/#" 70) where |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
54 |
"x /# r == scaleR (inverse r) x" |
20763 | 55 |
|
21210 | 56 |
notation (xsymbols) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
57 |
scaleR (infixr "*\<^sub>R" 75) and |
20763 | 58 |
divideR (infixl "'/\<^sub>R" 70) |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
59 |
|
22636 | 60 |
instance real :: scaleR |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
61 |
real_scaleR_def [simp]: "scaleR a x \<equiv> a * x" .. |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
62 |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
63 |
axclass real_vector < scaleR, ab_group_add |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
64 |
scaleR_right_distrib: "scaleR a (x + y) = scaleR a x + scaleR a y" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
65 |
scaleR_left_distrib: "scaleR (a + b) x = scaleR a x + scaleR b x" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
66 |
scaleR_scaleR [simp]: "scaleR a (scaleR b x) = scaleR (a * b) x" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
67 |
scaleR_one [simp]: "scaleR 1 x = x" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
68 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
69 |
axclass real_algebra < real_vector, ring |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
70 |
mult_scaleR_left [simp]: "scaleR a x * y = scaleR a (x * y)" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
71 |
mult_scaleR_right [simp]: "x * scaleR a y = scaleR a (x * y)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
72 |
|
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
73 |
axclass real_algebra_1 < real_algebra, ring_1 |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
74 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
75 |
axclass real_div_algebra < real_algebra_1, division_ring |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
76 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
77 |
axclass real_field < real_div_algebra, field |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
78 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
79 |
instance real :: real_field |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
80 |
apply (intro_classes, unfold real_scaleR_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
81 |
apply (rule right_distrib) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
82 |
apply (rule left_distrib) |
20763 | 83 |
apply (rule mult_assoc [symmetric]) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
84 |
apply (rule mult_1_left) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
85 |
apply (rule mult_assoc) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
86 |
apply (rule mult_left_commute) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
87 |
done |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
88 |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
89 |
lemma scaleR_left_commute: |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
90 |
fixes x :: "'a::real_vector" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
91 |
shows "scaleR a (scaleR b x) = scaleR b (scaleR a x)" |
20763 | 92 |
by (simp add: mult_commute) |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
93 |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
94 |
lemma additive_scaleR_right: "additive (\<lambda>x. scaleR a x::'a::real_vector)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
95 |
by (rule additive.intro, rule scaleR_right_distrib) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
96 |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
97 |
lemma additive_scaleR_left: "additive (\<lambda>a. scaleR a x::'a::real_vector)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
98 |
by (rule additive.intro, rule scaleR_left_distrib) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
99 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
100 |
lemmas scaleR_zero_left [simp] = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
101 |
additive.zero [OF additive_scaleR_left, standard] |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
102 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
103 |
lemmas scaleR_zero_right [simp] = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
104 |
additive.zero [OF additive_scaleR_right, standard] |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
105 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
106 |
lemmas scaleR_minus_left [simp] = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
107 |
additive.minus [OF additive_scaleR_left, standard] |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
108 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
109 |
lemmas scaleR_minus_right [simp] = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
110 |
additive.minus [OF additive_scaleR_right, standard] |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
111 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
112 |
lemmas scaleR_left_diff_distrib = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
113 |
additive.diff [OF additive_scaleR_left, standard] |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
114 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
115 |
lemmas scaleR_right_diff_distrib = |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
116 |
additive.diff [OF additive_scaleR_right, standard] |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
117 |
|
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
118 |
lemma scaleR_eq_0_iff [simp]: |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
119 |
fixes x :: "'a::real_vector" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
120 |
shows "(scaleR a x = 0) = (a = 0 \<or> x = 0)" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
121 |
proof cases |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
122 |
assume "a = 0" thus ?thesis by simp |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
123 |
next |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
124 |
assume anz [simp]: "a \<noteq> 0" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
125 |
{ assume "scaleR a x = 0" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
126 |
hence "scaleR (inverse a) (scaleR a x) = 0" by simp |
20763 | 127 |
hence "x = 0" by simp } |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
128 |
thus ?thesis by force |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
129 |
qed |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
130 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
131 |
lemma scaleR_left_imp_eq: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
132 |
fixes x y :: "'a::real_vector" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
133 |
shows "\<lbrakk>a \<noteq> 0; scaleR a x = scaleR a y\<rbrakk> \<Longrightarrow> x = y" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
134 |
proof - |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
135 |
assume nonzero: "a \<noteq> 0" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
136 |
assume "scaleR a x = scaleR a y" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
137 |
hence "scaleR a (x - y) = 0" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
138 |
by (simp add: scaleR_right_diff_distrib) |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
139 |
hence "x - y = 0" by (simp add: nonzero) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
140 |
thus "x = y" by simp |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
141 |
qed |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
142 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
143 |
lemma scaleR_right_imp_eq: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
144 |
fixes x y :: "'a::real_vector" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
145 |
shows "\<lbrakk>x \<noteq> 0; scaleR a x = scaleR b x\<rbrakk> \<Longrightarrow> a = b" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
146 |
proof - |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
147 |
assume nonzero: "x \<noteq> 0" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
148 |
assume "scaleR a x = scaleR b x" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
149 |
hence "scaleR (a - b) x = 0" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
150 |
by (simp add: scaleR_left_diff_distrib) |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
151 |
hence "a - b = 0" by (simp add: nonzero) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
152 |
thus "a = b" by simp |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
153 |
qed |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
154 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
155 |
lemma scaleR_cancel_left: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
156 |
fixes x y :: "'a::real_vector" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
157 |
shows "(scaleR a x = scaleR a y) = (x = y \<or> a = 0)" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
158 |
by (auto intro: scaleR_left_imp_eq) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
159 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
160 |
lemma scaleR_cancel_right: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
161 |
fixes x y :: "'a::real_vector" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
162 |
shows "(scaleR a x = scaleR b x) = (a = b \<or> x = 0)" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
163 |
by (auto intro: scaleR_right_imp_eq) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
164 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
165 |
lemma nonzero_inverse_scaleR_distrib: |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
166 |
fixes x :: "'a::real_div_algebra" shows |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
167 |
"\<lbrakk>a \<noteq> 0; x \<noteq> 0\<rbrakk> \<Longrightarrow> inverse (scaleR a x) = scaleR (inverse a) (inverse x)" |
20763 | 168 |
by (rule inverse_unique, simp) |
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
169 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
170 |
lemma inverse_scaleR_distrib: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
171 |
fixes x :: "'a::{real_div_algebra,division_by_zero}" |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
172 |
shows "inverse (scaleR a x) = scaleR (inverse a) (inverse x)" |
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
173 |
apply (case_tac "a = 0", simp) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
174 |
apply (case_tac "x = 0", simp) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
175 |
apply (erule (1) nonzero_inverse_scaleR_distrib) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
176 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
177 |
|
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
178 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
179 |
subsection {* Embedding of the Reals into any @{text real_algebra_1}: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
180 |
@{term of_real} *} |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
181 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
182 |
definition |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
183 |
of_real :: "real \<Rightarrow> 'a::real_algebra_1" where |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
184 |
"of_real r = scaleR r 1" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
185 |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
186 |
lemma scaleR_conv_of_real: "scaleR r x = of_real r * x" |
20763 | 187 |
by (simp add: of_real_def) |
188 |
||
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
189 |
lemma of_real_0 [simp]: "of_real 0 = 0" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
190 |
by (simp add: of_real_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
191 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
192 |
lemma of_real_1 [simp]: "of_real 1 = 1" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
193 |
by (simp add: of_real_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
194 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
195 |
lemma of_real_add [simp]: "of_real (x + y) = of_real x + of_real y" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
196 |
by (simp add: of_real_def scaleR_left_distrib) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
197 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
198 |
lemma of_real_minus [simp]: "of_real (- x) = - of_real x" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
199 |
by (simp add: of_real_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
200 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
201 |
lemma of_real_diff [simp]: "of_real (x - y) = of_real x - of_real y" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
202 |
by (simp add: of_real_def scaleR_left_diff_distrib) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
203 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
204 |
lemma of_real_mult [simp]: "of_real (x * y) = of_real x * of_real y" |
20763 | 205 |
by (simp add: of_real_def mult_commute) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
206 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
207 |
lemma nonzero_of_real_inverse: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
208 |
"x \<noteq> 0 \<Longrightarrow> of_real (inverse x) = |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
209 |
inverse (of_real x :: 'a::real_div_algebra)" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
210 |
by (simp add: of_real_def nonzero_inverse_scaleR_distrib) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
211 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
212 |
lemma of_real_inverse [simp]: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
213 |
"of_real (inverse x) = |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
214 |
inverse (of_real x :: 'a::{real_div_algebra,division_by_zero})" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
215 |
by (simp add: of_real_def inverse_scaleR_distrib) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
216 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
217 |
lemma nonzero_of_real_divide: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
218 |
"y \<noteq> 0 \<Longrightarrow> of_real (x / y) = |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
219 |
(of_real x / of_real y :: 'a::real_field)" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
220 |
by (simp add: divide_inverse nonzero_of_real_inverse) |
20722 | 221 |
|
222 |
lemma of_real_divide [simp]: |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
223 |
"of_real (x / y) = |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
224 |
(of_real x / of_real y :: 'a::{real_field,division_by_zero})" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
225 |
by (simp add: divide_inverse) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
226 |
|
20722 | 227 |
lemma of_real_power [simp]: |
228 |
"of_real (x ^ n) = (of_real x :: 'a::{real_algebra_1,recpower}) ^ n" |
|
20772 | 229 |
by (induct n) (simp_all add: power_Suc) |
20722 | 230 |
|
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
231 |
lemma of_real_eq_iff [simp]: "(of_real x = of_real y) = (x = y)" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
232 |
by (simp add: of_real_def scaleR_cancel_right) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
233 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
234 |
lemmas of_real_eq_0_iff [simp] = of_real_eq_iff [of _ 0, simplified] |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
235 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
236 |
lemma of_real_eq_id [simp]: "of_real = (id :: real \<Rightarrow> real)" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
237 |
proof |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
238 |
fix r |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
239 |
show "of_real r = id r" |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
240 |
by (simp add: of_real_def) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
241 |
qed |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
242 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
243 |
text{*Collapse nested embeddings*} |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
244 |
lemma of_real_of_nat_eq [simp]: "of_real (of_nat n) = of_nat n" |
20772 | 245 |
by (induct n) auto |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
246 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
247 |
lemma of_real_of_int_eq [simp]: "of_real (of_int z) = of_int z" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
248 |
by (cases z rule: int_diff_cases, simp) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
249 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
250 |
lemma of_real_number_of_eq: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
251 |
"of_real (number_of w) = (number_of w :: 'a::{number_ring,real_algebra_1})" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
252 |
by (simp add: number_of_eq) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
253 |
|
22912 | 254 |
text{*Every real algebra has characteristic zero*} |
255 |
instance real_algebra_1 < ring_char_0 |
|
256 |
proof |
|
257 |
fix w z :: int |
|
258 |
assume "of_int w = (of_int z::'a)" |
|
259 |
hence "of_real (of_int w) = (of_real (of_int z)::'a)" |
|
260 |
by (simp only: of_real_of_int_eq) |
|
261 |
thus "w = z" |
|
262 |
by (simp only: of_real_eq_iff of_int_eq_iff) |
|
263 |
qed |
|
264 |
||
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
265 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
266 |
subsection {* The Set of Real Numbers *} |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
267 |
|
20772 | 268 |
definition |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21210
diff
changeset
|
269 |
Reals :: "'a::real_algebra_1 set" where |
20772 | 270 |
"Reals \<equiv> range of_real" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
271 |
|
21210 | 272 |
notation (xsymbols) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
273 |
Reals ("\<real>") |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
274 |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
275 |
lemma Reals_of_real [simp]: "of_real r \<in> Reals" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
276 |
by (simp add: Reals_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
277 |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
278 |
lemma Reals_of_int [simp]: "of_int z \<in> Reals" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
279 |
by (subst of_real_of_int_eq [symmetric], rule Reals_of_real) |
20718 | 280 |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
281 |
lemma Reals_of_nat [simp]: "of_nat n \<in> Reals" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
282 |
by (subst of_real_of_nat_eq [symmetric], rule Reals_of_real) |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
283 |
|
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
284 |
lemma Reals_number_of [simp]: |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
285 |
"(number_of w::'a::{number_ring,real_algebra_1}) \<in> Reals" |
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
286 |
by (subst of_real_number_of_eq [symmetric], rule Reals_of_real) |
20718 | 287 |
|
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
288 |
lemma Reals_0 [simp]: "0 \<in> Reals" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
289 |
apply (unfold Reals_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
290 |
apply (rule range_eqI) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
291 |
apply (rule of_real_0 [symmetric]) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
292 |
done |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
293 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
294 |
lemma Reals_1 [simp]: "1 \<in> Reals" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
295 |
apply (unfold Reals_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
296 |
apply (rule range_eqI) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
297 |
apply (rule of_real_1 [symmetric]) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
298 |
done |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
299 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
300 |
lemma Reals_add [simp]: "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a + b \<in> Reals" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
301 |
apply (auto simp add: Reals_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
302 |
apply (rule range_eqI) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
303 |
apply (rule of_real_add [symmetric]) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
304 |
done |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
305 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
306 |
lemma Reals_minus [simp]: "a \<in> Reals \<Longrightarrow> - a \<in> Reals" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
307 |
apply (auto simp add: Reals_def) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
308 |
apply (rule range_eqI) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
309 |
apply (rule of_real_minus [symmetric]) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
310 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
311 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
312 |
lemma Reals_diff [simp]: "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a - b \<in> Reals" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
313 |
apply (auto simp add: Reals_def) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
314 |
apply (rule range_eqI) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
315 |
apply (rule of_real_diff [symmetric]) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
316 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
317 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
318 |
lemma Reals_mult [simp]: "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a * b \<in> Reals" |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
319 |
apply (auto simp add: Reals_def) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
320 |
apply (rule range_eqI) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
321 |
apply (rule of_real_mult [symmetric]) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
322 |
done |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
323 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
324 |
lemma nonzero_Reals_inverse: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
325 |
fixes a :: "'a::real_div_algebra" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
326 |
shows "\<lbrakk>a \<in> Reals; a \<noteq> 0\<rbrakk> \<Longrightarrow> inverse a \<in> Reals" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
327 |
apply (auto simp add: Reals_def) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
328 |
apply (rule range_eqI) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
329 |
apply (erule nonzero_of_real_inverse [symmetric]) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
330 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
331 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
332 |
lemma Reals_inverse [simp]: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
333 |
fixes a :: "'a::{real_div_algebra,division_by_zero}" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
334 |
shows "a \<in> Reals \<Longrightarrow> inverse a \<in> Reals" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
335 |
apply (auto simp add: Reals_def) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
336 |
apply (rule range_eqI) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
337 |
apply (rule of_real_inverse [symmetric]) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
338 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
339 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
340 |
lemma nonzero_Reals_divide: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
341 |
fixes a b :: "'a::real_field" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
342 |
shows "\<lbrakk>a \<in> Reals; b \<in> Reals; b \<noteq> 0\<rbrakk> \<Longrightarrow> a / b \<in> Reals" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
343 |
apply (auto simp add: Reals_def) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
344 |
apply (rule range_eqI) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
345 |
apply (erule nonzero_of_real_divide [symmetric]) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
346 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
347 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
348 |
lemma Reals_divide [simp]: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
349 |
fixes a b :: "'a::{real_field,division_by_zero}" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
350 |
shows "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a / b \<in> Reals" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
351 |
apply (auto simp add: Reals_def) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
352 |
apply (rule range_eqI) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
353 |
apply (rule of_real_divide [symmetric]) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
354 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
355 |
|
20722 | 356 |
lemma Reals_power [simp]: |
357 |
fixes a :: "'a::{real_algebra_1,recpower}" |
|
358 |
shows "a \<in> Reals \<Longrightarrow> a ^ n \<in> Reals" |
|
359 |
apply (auto simp add: Reals_def) |
|
360 |
apply (rule range_eqI) |
|
361 |
apply (rule of_real_power [symmetric]) |
|
362 |
done |
|
363 |
||
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
364 |
lemma Reals_cases [cases set: Reals]: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
365 |
assumes "q \<in> \<real>" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
366 |
obtains (of_real) r where "q = of_real r" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
367 |
unfolding Reals_def |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
368 |
proof - |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
369 |
from `q \<in> \<real>` have "q \<in> range of_real" unfolding Reals_def . |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
370 |
then obtain r where "q = of_real r" .. |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
371 |
then show thesis .. |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
372 |
qed |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
373 |
|
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
374 |
lemma Reals_induct [case_names of_real, induct set: Reals]: |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
375 |
"q \<in> \<real> \<Longrightarrow> (\<And>r. P (of_real r)) \<Longrightarrow> P q" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
376 |
by (rule Reals_cases) auto |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
377 |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
378 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
379 |
subsection {* Real normed vector spaces *} |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
380 |
|
22636 | 381 |
class norm = type + |
382 |
fixes norm :: "'a \<Rightarrow> real" |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
383 |
|
22636 | 384 |
instance real :: norm |
385 |
real_norm_def [simp]: "norm r \<equiv> \<bar>r\<bar>" .. |
|
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
386 |
|
22852 | 387 |
axclass real_normed_vector < real_vector, norm |
20533 | 388 |
norm_ge_zero [simp]: "0 \<le> norm x" |
389 |
norm_eq_zero [simp]: "(norm x = 0) = (x = 0)" |
|
390 |
norm_triangle_ineq: "norm (x + y) \<le> norm x + norm y" |
|
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
391 |
norm_scaleR: "norm (scaleR a x) = \<bar>a\<bar> * norm x" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
392 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
393 |
axclass real_normed_algebra < real_algebra, real_normed_vector |
20533 | 394 |
norm_mult_ineq: "norm (x * y) \<le> norm x * norm y" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
395 |
|
22852 | 396 |
axclass real_normed_algebra_1 < real_algebra_1, real_normed_algebra |
397 |
norm_one [simp]: "norm 1 = 1" |
|
398 |
||
399 |
axclass real_normed_div_algebra < real_div_algebra, real_normed_vector |
|
20533 | 400 |
norm_mult: "norm (x * y) = norm x * norm y" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
401 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
402 |
axclass real_normed_field < real_field, real_normed_div_algebra |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
403 |
|
22852 | 404 |
instance real_normed_div_algebra < real_normed_algebra_1 |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
405 |
proof |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
406 |
fix x y :: 'a |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
407 |
show "norm (x * y) \<le> norm x * norm y" |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
408 |
by (simp add: norm_mult) |
22852 | 409 |
next |
410 |
have "norm (1 * 1::'a) = norm (1::'a) * norm (1::'a)" |
|
411 |
by (rule norm_mult) |
|
412 |
thus "norm (1::'a) = 1" by simp |
|
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
413 |
qed |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
414 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
415 |
instance real :: real_normed_field |
22852 | 416 |
apply (intro_classes, unfold real_norm_def real_scaleR_def) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
417 |
apply (rule abs_ge_zero) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
418 |
apply (rule abs_eq_0) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
419 |
apply (rule abs_triangle_ineq) |
22852 | 420 |
apply (rule abs_mult) |
20554
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
421 |
apply (rule abs_mult) |
c433e78d4203
define new constant of_real for class real_algebra_1;
huffman
parents:
20551
diff
changeset
|
422 |
done |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
423 |
|
22852 | 424 |
lemma norm_zero [simp]: "norm (0::'a::real_normed_vector) = 0" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
425 |
by simp |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
426 |
|
22852 | 427 |
lemma zero_less_norm_iff [simp]: |
428 |
fixes x :: "'a::real_normed_vector" |
|
429 |
shows "(0 < norm x) = (x \<noteq> 0)" |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
430 |
by (simp add: order_less_le) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
431 |
|
22852 | 432 |
lemma norm_not_less_zero [simp]: |
433 |
fixes x :: "'a::real_normed_vector" |
|
434 |
shows "\<not> norm x < 0" |
|
20828 | 435 |
by (simp add: linorder_not_less) |
436 |
||
22852 | 437 |
lemma norm_le_zero_iff [simp]: |
438 |
fixes x :: "'a::real_normed_vector" |
|
439 |
shows "(norm x \<le> 0) = (x = 0)" |
|
20828 | 440 |
by (simp add: order_le_less) |
441 |
||
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
442 |
lemma norm_minus_cancel [simp]: |
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
443 |
fixes x :: "'a::real_normed_vector" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
444 |
shows "norm (- x) = norm x" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
445 |
proof - |
21809
4b93e949ac33
remove uses of scaleR infix syntax; add lemma Reals_number_of
huffman
parents:
21404
diff
changeset
|
446 |
have "norm (- x) = norm (scaleR (- 1) x)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
447 |
by (simp only: scaleR_minus_left scaleR_one) |
20533 | 448 |
also have "\<dots> = \<bar>- 1\<bar> * norm x" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
449 |
by (rule norm_scaleR) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
450 |
finally show ?thesis by simp |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
451 |
qed |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
452 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
453 |
lemma norm_minus_commute: |
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
454 |
fixes a b :: "'a::real_normed_vector" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
455 |
shows "norm (a - b) = norm (b - a)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
456 |
proof - |
22898 | 457 |
have "norm (- (b - a)) = norm (b - a)" |
458 |
by (rule norm_minus_cancel) |
|
459 |
thus ?thesis by simp |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
460 |
qed |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
461 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
462 |
lemma norm_triangle_ineq2: |
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
463 |
fixes a b :: "'a::real_normed_vector" |
20533 | 464 |
shows "norm a - norm b \<le> norm (a - b)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
465 |
proof - |
20533 | 466 |
have "norm (a - b + b) \<le> norm (a - b) + norm b" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
467 |
by (rule norm_triangle_ineq) |
22898 | 468 |
thus ?thesis by simp |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
469 |
qed |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
470 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
471 |
lemma norm_triangle_ineq3: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
472 |
fixes a b :: "'a::real_normed_vector" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
473 |
shows "\<bar>norm a - norm b\<bar> \<le> norm (a - b)" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
474 |
apply (subst abs_le_iff) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
475 |
apply auto |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
476 |
apply (rule norm_triangle_ineq2) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
477 |
apply (subst norm_minus_commute) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
478 |
apply (rule norm_triangle_ineq2) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
479 |
done |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
480 |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
481 |
lemma norm_triangle_ineq4: |
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
482 |
fixes a b :: "'a::real_normed_vector" |
20533 | 483 |
shows "norm (a - b) \<le> norm a + norm b" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
484 |
proof - |
22898 | 485 |
have "norm (a + - b) \<le> norm a + norm (- b)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
486 |
by (rule norm_triangle_ineq) |
22898 | 487 |
thus ?thesis |
488 |
by (simp only: diff_minus norm_minus_cancel) |
|
489 |
qed |
|
490 |
||
491 |
lemma norm_diff_ineq: |
|
492 |
fixes a b :: "'a::real_normed_vector" |
|
493 |
shows "norm a - norm b \<le> norm (a + b)" |
|
494 |
proof - |
|
495 |
have "norm a - norm (- b) \<le> norm (a - - b)" |
|
496 |
by (rule norm_triangle_ineq2) |
|
497 |
thus ?thesis by simp |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
498 |
qed |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
499 |
|
20551 | 500 |
lemma norm_diff_triangle_ineq: |
501 |
fixes a b c d :: "'a::real_normed_vector" |
|
502 |
shows "norm ((a + b) - (c + d)) \<le> norm (a - c) + norm (b - d)" |
|
503 |
proof - |
|
504 |
have "norm ((a + b) - (c + d)) = norm ((a - c) + (b - d))" |
|
505 |
by (simp add: diff_minus add_ac) |
|
506 |
also have "\<dots> \<le> norm (a - c) + norm (b - d)" |
|
507 |
by (rule norm_triangle_ineq) |
|
508 |
finally show ?thesis . |
|
509 |
qed |
|
510 |
||
22857 | 511 |
lemma abs_norm_cancel [simp]: |
512 |
fixes a :: "'a::real_normed_vector" |
|
513 |
shows "\<bar>norm a\<bar> = norm a" |
|
514 |
by (rule abs_of_nonneg [OF norm_ge_zero]) |
|
515 |
||
22880 | 516 |
lemma norm_add_less: |
517 |
fixes x y :: "'a::real_normed_vector" |
|
518 |
shows "\<lbrakk>norm x < r; norm y < s\<rbrakk> \<Longrightarrow> norm (x + y) < r + s" |
|
519 |
by (rule order_le_less_trans [OF norm_triangle_ineq add_strict_mono]) |
|
520 |
||
521 |
lemma norm_mult_less: |
|
522 |
fixes x y :: "'a::real_normed_algebra" |
|
523 |
shows "\<lbrakk>norm x < r; norm y < s\<rbrakk> \<Longrightarrow> norm (x * y) < r * s" |
|
524 |
apply (rule order_le_less_trans [OF norm_mult_ineq]) |
|
525 |
apply (simp add: mult_strict_mono') |
|
526 |
done |
|
527 |
||
22857 | 528 |
lemma norm_of_real [simp]: |
529 |
"norm (of_real r :: 'a::real_normed_algebra_1) = \<bar>r\<bar>" |
|
22852 | 530 |
unfolding of_real_def by (simp add: norm_scaleR) |
20560 | 531 |
|
22876
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
532 |
lemma norm_number_of [simp]: |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
533 |
"norm (number_of w::'a::{number_ring,real_normed_algebra_1}) |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
534 |
= \<bar>number_of w\<bar>" |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
535 |
by (subst of_real_number_of_eq [symmetric], rule norm_of_real) |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
536 |
|
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
537 |
lemma norm_of_int [simp]: |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
538 |
"norm (of_int z::'a::real_normed_algebra_1) = \<bar>of_int z\<bar>" |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
539 |
by (subst of_real_of_int_eq [symmetric], rule norm_of_real) |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
540 |
|
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
541 |
lemma norm_of_nat [simp]: |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
542 |
"norm (of_nat n::'a::real_normed_algebra_1) = of_nat n" |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
543 |
apply (subst of_real_of_nat_eq [symmetric]) |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
544 |
apply (subst norm_of_real, simp) |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
545 |
done |
2b4c831ceca7
add lemmas norm_number_of, norm_of_int, norm_of_nat
huffman
parents:
22857
diff
changeset
|
546 |
|
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
547 |
lemma nonzero_norm_inverse: |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
548 |
fixes a :: "'a::real_normed_div_algebra" |
20533 | 549 |
shows "a \<noteq> 0 \<Longrightarrow> norm (inverse a) = inverse (norm a)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
550 |
apply (rule inverse_unique [symmetric]) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
551 |
apply (simp add: norm_mult [symmetric]) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
552 |
done |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
553 |
|
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
554 |
lemma norm_inverse: |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
555 |
fixes a :: "'a::{real_normed_div_algebra,division_by_zero}" |
20533 | 556 |
shows "norm (inverse a) = inverse (norm a)" |
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
557 |
apply (case_tac "a = 0", simp) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
558 |
apply (erule nonzero_norm_inverse) |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
559 |
done |
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
560 |
|
20584
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
561 |
lemma nonzero_norm_divide: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
562 |
fixes a b :: "'a::real_normed_field" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
563 |
shows "b \<noteq> 0 \<Longrightarrow> norm (a / b) = norm a / norm b" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
564 |
by (simp add: divide_inverse norm_mult nonzero_norm_inverse) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
565 |
|
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
566 |
lemma norm_divide: |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
567 |
fixes a b :: "'a::{real_normed_field,division_by_zero}" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
568 |
shows "norm (a / b) = norm a / norm b" |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
569 |
by (simp add: divide_inverse norm_mult norm_inverse) |
60b1d52a455d
added classes real_div_algebra and real_field; added lemmas
huffman
parents:
20560
diff
changeset
|
570 |
|
22852 | 571 |
lemma norm_power_ineq: |
572 |
fixes x :: "'a::{real_normed_algebra_1,recpower}" |
|
573 |
shows "norm (x ^ n) \<le> norm x ^ n" |
|
574 |
proof (induct n) |
|
575 |
case 0 show "norm (x ^ 0) \<le> norm x ^ 0" by simp |
|
576 |
next |
|
577 |
case (Suc n) |
|
578 |
have "norm (x * x ^ n) \<le> norm x * norm (x ^ n)" |
|
579 |
by (rule norm_mult_ineq) |
|
580 |
also from Suc have "\<dots> \<le> norm x * norm x ^ n" |
|
581 |
using norm_ge_zero by (rule mult_left_mono) |
|
582 |
finally show "norm (x ^ Suc n) \<le> norm x ^ Suc n" |
|
583 |
by (simp add: power_Suc) |
|
584 |
qed |
|
585 |
||
20684 | 586 |
lemma norm_power: |
587 |
fixes x :: "'a::{real_normed_div_algebra,recpower}" |
|
588 |
shows "norm (x ^ n) = norm x ^ n" |
|
20772 | 589 |
by (induct n) (simp_all add: power_Suc norm_mult) |
20684 | 590 |
|
22442
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
591 |
|
22972
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
592 |
subsection {* Sign function *} |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
593 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
594 |
definition |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
595 |
sgn :: "'a::real_normed_vector \<Rightarrow> 'a" where |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
596 |
"sgn x = scaleR (inverse (norm x)) x" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
597 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
598 |
lemma norm_sgn: "norm (sgn x) = (if x = 0 then 0 else 1)" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
599 |
unfolding sgn_def by (simp add: norm_scaleR) |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
600 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
601 |
lemma sgn_zero [simp]: "sgn 0 = 0" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
602 |
unfolding sgn_def by simp |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
603 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
604 |
lemma sgn_zero_iff: "(sgn x = 0) = (x = 0)" |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
605 |
unfolding sgn_def by simp |
22972
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
606 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
607 |
lemma sgn_minus: "sgn (- x) = - sgn x" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
608 |
unfolding sgn_def by simp |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
609 |
|
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
610 |
lemma sgn_scaleR: "sgn (scaleR r x) = scaleR (sgn r) (sgn x)" |
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
611 |
unfolding sgn_def by (simp add: norm_scaleR mult_ac) |
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
612 |
|
22972
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
613 |
lemma sgn_one [simp]: "sgn (1::'a::real_normed_algebra_1) = 1" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
614 |
unfolding sgn_def by simp |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
615 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
616 |
lemma sgn_of_real: |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
617 |
"sgn (of_real r::'a::real_normed_algebra_1) = of_real (sgn r)" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
618 |
unfolding of_real_def by (simp only: sgn_scaleR sgn_one) |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
619 |
|
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
620 |
lemma sgn_mult: |
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
621 |
fixes x y :: "'a::real_normed_div_algebra" |
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
622 |
shows "sgn (x * y) = sgn x * sgn y" |
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
623 |
unfolding sgn_def by (simp add: norm_mult mult_commute) |
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
624 |
|
22972
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
625 |
lemma real_sgn_eq: "sgn (x::real) = x / \<bar>x\<bar>" |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
626 |
unfolding sgn_def by (simp add: divide_inverse) |
22972
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
627 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
628 |
lemma real_sgn_pos: "0 < (x::real) \<Longrightarrow> sgn x = 1" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
629 |
unfolding real_sgn_eq by simp |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
630 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
631 |
lemma real_sgn_neg: "(x::real) < 0 \<Longrightarrow> sgn x = -1" |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
632 |
unfolding real_sgn_eq by simp |
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
633 |
|
3e96b98d37c6
generalized sgn function to work on any real normed vector space
huffman
parents:
22942
diff
changeset
|
634 |
|
22442
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
635 |
subsection {* Bounded Linear and Bilinear Operators *} |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
636 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
637 |
locale bounded_linear = additive + |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
638 |
constrains f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
639 |
assumes scaleR: "f (scaleR r x) = scaleR r (f x)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
640 |
assumes bounded: "\<exists>K. \<forall>x. norm (f x) \<le> norm x * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
641 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
642 |
lemma (in bounded_linear) pos_bounded: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
643 |
"\<exists>K>0. \<forall>x. norm (f x) \<le> norm x * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
644 |
proof - |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
645 |
obtain K where K: "\<And>x. norm (f x) \<le> norm x * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
646 |
using bounded by fast |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
647 |
show ?thesis |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
648 |
proof (intro exI impI conjI allI) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
649 |
show "0 < max 1 K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
650 |
by (rule order_less_le_trans [OF zero_less_one le_maxI1]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
651 |
next |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
652 |
fix x |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
653 |
have "norm (f x) \<le> norm x * K" using K . |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
654 |
also have "\<dots> \<le> norm x * max 1 K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
655 |
by (rule mult_left_mono [OF le_maxI2 norm_ge_zero]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
656 |
finally show "norm (f x) \<le> norm x * max 1 K" . |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
657 |
qed |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
658 |
qed |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
659 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
660 |
lemma (in bounded_linear) nonneg_bounded: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
661 |
"\<exists>K\<ge>0. \<forall>x. norm (f x) \<le> norm x * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
662 |
proof - |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
663 |
from pos_bounded |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
664 |
show ?thesis by (auto intro: order_less_imp_le) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
665 |
qed |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
666 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
667 |
locale bounded_bilinear = |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
668 |
fixes prod :: "['a::real_normed_vector, 'b::real_normed_vector] |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
669 |
\<Rightarrow> 'c::real_normed_vector" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
670 |
(infixl "**" 70) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
671 |
assumes add_left: "prod (a + a') b = prod a b + prod a' b" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
672 |
assumes add_right: "prod a (b + b') = prod a b + prod a b'" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
673 |
assumes scaleR_left: "prod (scaleR r a) b = scaleR r (prod a b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
674 |
assumes scaleR_right: "prod a (scaleR r b) = scaleR r (prod a b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
675 |
assumes bounded: "\<exists>K. \<forall>a b. norm (prod a b) \<le> norm a * norm b * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
676 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
677 |
lemma (in bounded_bilinear) pos_bounded: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
678 |
"\<exists>K>0. \<forall>a b. norm (a ** b) \<le> norm a * norm b * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
679 |
apply (cut_tac bounded, erule exE) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
680 |
apply (rule_tac x="max 1 K" in exI, safe) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
681 |
apply (rule order_less_le_trans [OF zero_less_one le_maxI1]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
682 |
apply (drule spec, drule spec, erule order_trans) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
683 |
apply (rule mult_left_mono [OF le_maxI2]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
684 |
apply (intro mult_nonneg_nonneg norm_ge_zero) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
685 |
done |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
686 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
687 |
lemma (in bounded_bilinear) nonneg_bounded: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
688 |
"\<exists>K\<ge>0. \<forall>a b. norm (a ** b) \<le> norm a * norm b * K" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
689 |
proof - |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
690 |
from pos_bounded |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
691 |
show ?thesis by (auto intro: order_less_imp_le) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
692 |
qed |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
693 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
694 |
lemma (in bounded_bilinear) additive_right: "additive (\<lambda>b. prod a b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
695 |
by (rule additive.intro, rule add_right) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
696 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
697 |
lemma (in bounded_bilinear) additive_left: "additive (\<lambda>a. prod a b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
698 |
by (rule additive.intro, rule add_left) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
699 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
700 |
lemma (in bounded_bilinear) zero_left: "prod 0 b = 0" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
701 |
by (rule additive.zero [OF additive_left]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
702 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
703 |
lemma (in bounded_bilinear) zero_right: "prod a 0 = 0" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
704 |
by (rule additive.zero [OF additive_right]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
705 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
706 |
lemma (in bounded_bilinear) minus_left: "prod (- a) b = - prod a b" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
707 |
by (rule additive.minus [OF additive_left]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
708 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
709 |
lemma (in bounded_bilinear) minus_right: "prod a (- b) = - prod a b" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
710 |
by (rule additive.minus [OF additive_right]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
711 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
712 |
lemma (in bounded_bilinear) diff_left: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
713 |
"prod (a - a') b = prod a b - prod a' b" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
714 |
by (rule additive.diff [OF additive_left]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
715 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
716 |
lemma (in bounded_bilinear) diff_right: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
717 |
"prod a (b - b') = prod a b - prod a b'" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
718 |
by (rule additive.diff [OF additive_right]) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
719 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
720 |
lemma (in bounded_bilinear) bounded_linear_left: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
721 |
"bounded_linear (\<lambda>a. a ** b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
722 |
apply (unfold_locales) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
723 |
apply (rule add_left) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
724 |
apply (rule scaleR_left) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
725 |
apply (cut_tac bounded, safe) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
726 |
apply (rule_tac x="norm b * K" in exI) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
727 |
apply (simp add: mult_ac) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
728 |
done |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
729 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
730 |
lemma (in bounded_bilinear) bounded_linear_right: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
731 |
"bounded_linear (\<lambda>b. a ** b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
732 |
apply (unfold_locales) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
733 |
apply (rule add_right) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
734 |
apply (rule scaleR_right) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
735 |
apply (cut_tac bounded, safe) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
736 |
apply (rule_tac x="norm a * K" in exI) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
737 |
apply (simp add: mult_ac) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
738 |
done |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
739 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
740 |
lemma (in bounded_bilinear) prod_diff_prod: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
741 |
"(x ** y - a ** b) = (x - a) ** (y - b) + (x - a) ** b + a ** (y - b)" |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
742 |
by (simp add: diff_left diff_right) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
743 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
744 |
interpretation bounded_bilinear_mult: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
745 |
bounded_bilinear ["op * :: 'a \<Rightarrow> 'a \<Rightarrow> 'a::real_normed_algebra"] |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
746 |
apply (rule bounded_bilinear.intro) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
747 |
apply (rule left_distrib) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
748 |
apply (rule right_distrib) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
749 |
apply (rule mult_scaleR_left) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
750 |
apply (rule mult_scaleR_right) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
751 |
apply (rule_tac x="1" in exI) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
752 |
apply (simp add: norm_mult_ineq) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
753 |
done |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
754 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
755 |
interpretation bounded_linear_mult_left: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
756 |
bounded_linear ["(\<lambda>x::'a::real_normed_algebra. x * y)"] |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
757 |
by (rule bounded_bilinear_mult.bounded_linear_left) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
758 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
759 |
interpretation bounded_linear_mult_right: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
760 |
bounded_linear ["(\<lambda>y::'a::real_normed_algebra. x * y)"] |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
761 |
by (rule bounded_bilinear_mult.bounded_linear_right) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
762 |
|
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
763 |
interpretation bounded_bilinear_scaleR: |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
764 |
bounded_bilinear ["scaleR"] |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
765 |
apply (rule bounded_bilinear.intro) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
766 |
apply (rule scaleR_left_distrib) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
767 |
apply (rule scaleR_right_distrib) |
22973
64d300e16370
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman
parents:
22972
diff
changeset
|
768 |
apply simp |
22442
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
769 |
apply (rule scaleR_left_commute) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
770 |
apply (rule_tac x="1" in exI) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
771 |
apply (simp add: norm_scaleR) |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
772 |
done |
15d9ed9b5051
move bounded (bi)linear operator locales from Lim.thy to RealVector.thy
huffman
parents:
21809
diff
changeset
|
773 |
|
22625 | 774 |
interpretation bounded_linear_of_real: |
775 |
bounded_linear ["\<lambda>r. of_real r"] |
|
776 |
apply (unfold of_real_def) |
|
777 |
apply (rule bounded_bilinear_scaleR.bounded_linear_left) |
|
778 |
done |
|
779 |
||
20504
6342e872e71d
formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff
changeset
|
780 |
end |