author | wenzelm |
Fri, 08 Mar 2002 16:24:06 +0100 | |
changeset 13049 | ce180e5b7fa0 |
parent 12114 | a8e860c86252 |
child 13515 | a6a7025fd7e8 |
permissions | -rw-r--r-- |
7917 | 1 |
(* Title: HOL/Real/HahnBanach/VectorSpace.thy |
2 |
ID: $Id$ |
|
3 |
Author: Gertrud Bauer, TU Munich |
|
4 |
*) |
|
5 |
||
9035 | 6 |
header {* Vector spaces *} |
7917 | 7 |
|
9035 | 8 |
theory VectorSpace = Bounds + Aux: |
7917 | 9 |
|
9035 | 10 |
subsection {* Signature *} |
7917 | 11 |
|
10687 | 12 |
text {* |
13 |
For the definition of real vector spaces a type @{typ 'a} of the |
|
14 |
sort @{text "{plus, minus, zero}"} is considered, on which a real |
|
15 |
scalar multiplication @{text \<cdot>} is declared. |
|
16 |
*} |
|
7917 | 17 |
|
18 |
consts |
|
10687 | 19 |
prod :: "real \<Rightarrow> 'a::{plus, minus, zero} \<Rightarrow> 'a" (infixr "'(*')" 70) |
7917 | 20 |
|
12114
a8e860c86252
eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents:
12018
diff
changeset
|
21 |
syntax (xsymbols) |
10687 | 22 |
prod :: "real \<Rightarrow> 'a \<Rightarrow> 'a" (infixr "\<cdot>" 70) |
7917 | 23 |
|
24 |
||
9035 | 25 |
subsection {* Vector space laws *} |
7917 | 26 |
|
10687 | 27 |
text {* |
28 |
A \emph{vector space} is a non-empty set @{text V} of elements from |
|
29 |
@{typ 'a} with the following vector space laws: The set @{text V} is |
|
30 |
closed under addition and scalar multiplication, addition is |
|
31 |
associative and commutative; @{text "- x"} is the inverse of @{text |
|
32 |
x} w.~r.~t.~addition and @{text 0} is the neutral element of |
|
33 |
addition. Addition and multiplication are distributive; scalar |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
34 |
multiplication is associative and the real number @{text "1"} is |
10687 | 35 |
the neutral element of scalar multiplication. |
9035 | 36 |
*} |
7917 | 37 |
|
38 |
constdefs |
|
10687 | 39 |
is_vectorspace :: "('a::{plus, minus, zero}) set \<Rightarrow> bool" |
40 |
"is_vectorspace V \<equiv> V \<noteq> {} |
|
9503 | 41 |
\<and> (\<forall>x \<in> V. \<forall>y \<in> V. \<forall>z \<in> V. \<forall>a b. |
10687 | 42 |
x + y \<in> V |
43 |
\<and> a \<cdot> x \<in> V |
|
44 |
\<and> (x + y) + z = x + (y + z) |
|
45 |
\<and> x + y = y + x |
|
46 |
\<and> x - x = 0 |
|
47 |
\<and> 0 + x = x |
|
48 |
\<and> a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y |
|
49 |
\<and> (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x |
|
50 |
\<and> (a * b) \<cdot> x = a \<cdot> b \<cdot> x |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
51 |
\<and> 1 \<cdot> x = x |
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
52 |
\<and> - x = (- 1) \<cdot> x |
10687 | 53 |
\<and> x - y = x + - y)" |
7917 | 54 |
|
10687 | 55 |
|
56 |
text {* \medskip The corresponding introduction rule is:*} |
|
7917 | 57 |
|
58 |
lemma vsI [intro]: |
|
10687 | 59 |
"0 \<in> V \<Longrightarrow> |
60 |
\<forall>x \<in> V. \<forall>y \<in> V. x + y \<in> V \<Longrightarrow> |
|
61 |
\<forall>x \<in> V. \<forall>a. a \<cdot> x \<in> V \<Longrightarrow> |
|
62 |
\<forall>x \<in> V. \<forall>y \<in> V. \<forall>z \<in> V. (x + y) + z = x + (y + z) \<Longrightarrow> |
|
63 |
\<forall>x \<in> V. \<forall>y \<in> V. x + y = y + x \<Longrightarrow> |
|
64 |
\<forall>x \<in> V. x - x = 0 \<Longrightarrow> |
|
65 |
\<forall>x \<in> V. 0 + x = x \<Longrightarrow> |
|
66 |
\<forall>x \<in> V. \<forall>y \<in> V. \<forall>a. a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y \<Longrightarrow> |
|
67 |
\<forall>x \<in> V. \<forall>a b. (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x \<Longrightarrow> |
|
68 |
\<forall>x \<in> V. \<forall>a b. (a * b) \<cdot> x = a \<cdot> b \<cdot> x \<Longrightarrow> |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
69 |
\<forall>x \<in> V. 1 \<cdot> x = x \<Longrightarrow> |
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
70 |
\<forall>x \<in> V. - x = (- 1) \<cdot> x \<Longrightarrow> |
10687 | 71 |
\<forall>x \<in> V. \<forall>y \<in> V. x - y = x + - y \<Longrightarrow> is_vectorspace V" |
72 |
by (unfold is_vectorspace_def) auto |
|
7917 | 73 |
|
10687 | 74 |
text {* \medskip The corresponding destruction rules are: *} |
7917 | 75 |
|
10687 | 76 |
lemma negate_eq1: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
77 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x = (- 1) \<cdot> x" |
10687 | 78 |
by (unfold is_vectorspace_def) simp |
79 |
||
80 |
lemma diff_eq1: |
|
81 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x - y = x + - y" |
|
9035 | 82 |
by (unfold is_vectorspace_def) simp |
7917 | 83 |
|
10687 | 84 |
lemma negate_eq2: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
85 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- 1) \<cdot> x = - x" |
10687 | 86 |
by (unfold is_vectorspace_def) simp |
7917 | 87 |
|
10687 | 88 |
lemma negate_eq2a: |
11704
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
wenzelm
parents:
11701
diff
changeset
|
89 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> -1 \<cdot> x = - x" |
9035 | 90 |
by (unfold is_vectorspace_def) simp |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8703
diff
changeset
|
91 |
|
10687 | 92 |
lemma diff_eq2: |
93 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + - y = x - y" |
|
94 |
by (unfold is_vectorspace_def) simp |
|
95 |
||
96 |
lemma vs_not_empty [intro?]: "is_vectorspace V \<Longrightarrow> (V \<noteq> {})" |
|
9035 | 97 |
by (unfold is_vectorspace_def) simp |
7917 | 98 |
|
10687 | 99 |
lemma vs_add_closed [simp, intro?]: |
100 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + y \<in> V" |
|
101 |
by (unfold is_vectorspace_def) simp |
|
7917 | 102 |
|
10687 | 103 |
lemma vs_mult_closed [simp, intro?]: |
104 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> a \<cdot> x \<in> V" |
|
9035 | 105 |
by (unfold is_vectorspace_def) simp |
7917 | 106 |
|
10687 | 107 |
lemma vs_diff_closed [simp, intro?]: |
108 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x - y \<in> V" |
|
9035 | 109 |
by (simp add: diff_eq1 negate_eq1) |
7917 | 110 |
|
10687 | 111 |
lemma vs_neg_closed [simp, intro?]: |
112 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x \<in> V" |
|
9035 | 113 |
by (simp add: negate_eq1) |
7917 | 114 |
|
10687 | 115 |
lemma vs_add_assoc [simp]: |
116 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V |
|
117 |
\<Longrightarrow> (x + y) + z = x + (y + z)" |
|
118 |
by (unfold is_vectorspace_def) blast |
|
7917 | 119 |
|
10687 | 120 |
lemma vs_add_commute [simp]: |
121 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> y + x = x + y" |
|
122 |
by (unfold is_vectorspace_def) blast |
|
7917 | 123 |
|
124 |
lemma vs_add_left_commute [simp]: |
|
10687 | 125 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V |
126 |
\<Longrightarrow> x + (y + z) = y + (x + z)" |
|
9035 | 127 |
proof - |
10687 | 128 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" "z \<in> V" |
129 |
hence "x + (y + z) = (x + y) + z" |
|
9035 | 130 |
by (simp only: vs_add_assoc) |
131 |
also have "... = (y + x) + z" by (simp! only: vs_add_commute) |
|
132 |
also have "... = y + (x + z)" by (simp! only: vs_add_assoc) |
|
133 |
finally show ?thesis . |
|
134 |
qed |
|
7917 | 135 |
|
9035 | 136 |
theorems vs_add_ac = vs_add_assoc vs_add_commute vs_add_left_commute |
7917 | 137 |
|
10687 | 138 |
lemma vs_diff_self [simp]: |
139 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x - x = 0" |
|
9035 | 140 |
by (unfold is_vectorspace_def) simp |
7917 | 141 |
|
7978 | 142 |
text {* The existence of the zero element of a vector space |
9035 | 143 |
follows from the non-emptiness of carrier set. *} |
7917 | 144 |
|
10687 | 145 |
lemma zero_in_vs [simp, intro]: "is_vectorspace V \<Longrightarrow> 0 \<in> V" |
146 |
proof - |
|
9035 | 147 |
assume "is_vectorspace V" |
9503 | 148 |
have "V \<noteq> {}" .. |
11472 | 149 |
then obtain x where "x \<in> V" by blast |
150 |
have "0 = x - x" by (simp!) |
|
151 |
also have "... \<in> V" by (simp! only: vs_diff_closed) |
|
152 |
finally show ?thesis . |
|
9035 | 153 |
qed |
7917 | 154 |
|
10687 | 155 |
lemma vs_add_zero_left [simp]: |
156 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> 0 + x = x" |
|
9035 | 157 |
by (unfold is_vectorspace_def) simp |
7917 | 158 |
|
10687 | 159 |
lemma vs_add_zero_right [simp]: |
160 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x + 0 = x" |
|
9035 | 161 |
proof - |
10687 | 162 |
assume "is_vectorspace V" "x \<in> V" |
9374 | 163 |
hence "x + 0 = 0 + x" by simp |
9035 | 164 |
also have "... = x" by (simp!) |
165 |
finally show ?thesis . |
|
166 |
qed |
|
7917 | 167 |
|
10687 | 168 |
lemma vs_add_mult_distrib1: |
169 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V |
|
170 |
\<Longrightarrow> a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y" |
|
9035 | 171 |
by (unfold is_vectorspace_def) simp |
7917 | 172 |
|
10687 | 173 |
lemma vs_add_mult_distrib2: |
174 |
"is_vectorspace V \<Longrightarrow> x \<in> V |
|
175 |
\<Longrightarrow> (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x" |
|
9035 | 176 |
by (unfold is_vectorspace_def) simp |
7917 | 177 |
|
10687 | 178 |
lemma vs_mult_assoc: |
179 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (a * b) \<cdot> x = a \<cdot> (b \<cdot> x)" |
|
9035 | 180 |
by (unfold is_vectorspace_def) simp |
7917 | 181 |
|
10687 | 182 |
lemma vs_mult_assoc2 [simp]: |
183 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> a \<cdot> b \<cdot> x = (a * b) \<cdot> x" |
|
9035 | 184 |
by (simp only: vs_mult_assoc) |
7917 | 185 |
|
10687 | 186 |
lemma vs_mult_1 [simp]: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
187 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> 1 \<cdot> x = x" |
9035 | 188 |
by (unfold is_vectorspace_def) simp |
7917 | 189 |
|
10687 | 190 |
lemma vs_diff_mult_distrib1: |
191 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V |
|
192 |
\<Longrightarrow> a \<cdot> (x - y) = a \<cdot> x - a \<cdot> y" |
|
9035 | 193 |
by (simp add: diff_eq1 negate_eq1 vs_add_mult_distrib1) |
7917 | 194 |
|
10687 | 195 |
lemma vs_diff_mult_distrib2: |
196 |
"is_vectorspace V \<Longrightarrow> x \<in> V |
|
197 |
\<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - (b \<cdot> x)" |
|
9035 | 198 |
proof - |
10687 | 199 |
assume "is_vectorspace V" "x \<in> V" |
200 |
have " (a - b) \<cdot> x = (a + - b) \<cdot> x" |
|
9035 | 201 |
by (unfold real_diff_def, simp) |
10687 | 202 |
also have "... = a \<cdot> x + (- b) \<cdot> x" |
9035 | 203 |
by (rule vs_add_mult_distrib2) |
10687 | 204 |
also have "... = a \<cdot> x + - (b \<cdot> x)" |
9035 | 205 |
by (simp! add: negate_eq1) |
10687 | 206 |
also have "... = a \<cdot> x - (b \<cdot> x)" |
9035 | 207 |
by (simp! add: diff_eq1) |
208 |
finally show ?thesis . |
|
209 |
qed |
|
7917 | 210 |
|
10687 | 211 |
|
212 |
text {* \medskip Further derived laws: *} |
|
7917 | 213 |
|
10687 | 214 |
lemma vs_mult_zero_left [simp]: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
215 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> 0 \<cdot> x = 0" |
9035 | 216 |
proof - |
10687 | 217 |
assume "is_vectorspace V" "x \<in> V" |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
218 |
have "0 \<cdot> x = (1 - 1) \<cdot> x" by simp |
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
219 |
also have "... = (1 + - 1) \<cdot> x" by simp |
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
220 |
also have "... = 1 \<cdot> x + (- 1) \<cdot> x" |
9035 | 221 |
by (rule vs_add_mult_distrib2) |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
222 |
also have "... = x + (- 1) \<cdot> x" by (simp!) |
9035 | 223 |
also have "... = x + - x" by (simp! add: negate_eq2a) |
224 |
also have "... = x - x" by (simp! add: diff_eq2) |
|
9374 | 225 |
also have "... = 0" by (simp!) |
9035 | 226 |
finally show ?thesis . |
227 |
qed |
|
7917 | 228 |
|
10687 | 229 |
lemma vs_mult_zero_right [simp]: |
230 |
"is_vectorspace (V:: 'a::{plus, minus, zero} set) |
|
231 |
\<Longrightarrow> a \<cdot> 0 = (0::'a)" |
|
9035 | 232 |
proof - |
233 |
assume "is_vectorspace V" |
|
9503 | 234 |
have "a \<cdot> 0 = a \<cdot> (0 - (0::'a))" by (simp!) |
235 |
also have "... = a \<cdot> 0 - a \<cdot> 0" |
|
9035 | 236 |
by (rule vs_diff_mult_distrib1) (simp!)+ |
9374 | 237 |
also have "... = 0" by (simp!) |
9035 | 238 |
finally show ?thesis . |
239 |
qed |
|
7917 | 240 |
|
10687 | 241 |
lemma vs_minus_mult_cancel [simp]: |
242 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- a) \<cdot> - x = a \<cdot> x" |
|
9035 | 243 |
by (simp add: negate_eq1) |
7917 | 244 |
|
10687 | 245 |
lemma vs_add_minus_left_eq_diff: |
246 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> - x + y = y - x" |
|
247 |
proof - |
|
248 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" |
|
249 |
hence "- x + y = y + - x" |
|
9379 | 250 |
by (simp add: vs_add_commute) |
9035 | 251 |
also have "... = y - x" by (simp! add: diff_eq1) |
252 |
finally show ?thesis . |
|
253 |
qed |
|
7917 | 254 |
|
10687 | 255 |
lemma vs_add_minus [simp]: |
256 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x + - x = 0" |
|
9035 | 257 |
by (simp! add: diff_eq2) |
7917 | 258 |
|
10687 | 259 |
lemma vs_add_minus_left [simp]: |
260 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x + x = 0" |
|
9035 | 261 |
by (simp! add: diff_eq2) |
7917 | 262 |
|
10687 | 263 |
lemma vs_minus_minus [simp]: |
264 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - (- x) = x" |
|
9035 | 265 |
by (simp add: negate_eq1) |
7917 | 266 |
|
10687 | 267 |
lemma vs_minus_zero [simp]: |
268 |
"is_vectorspace (V::'a::{plus, minus, zero} set) \<Longrightarrow> - (0::'a) = 0" |
|
9035 | 269 |
by (simp add: negate_eq1) |
7917 | 270 |
|
271 |
lemma vs_minus_zero_iff [simp]: |
|
10687 | 272 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- x = 0) = (x = 0)" |
9035 | 273 |
(concl is "?L = ?R") |
274 |
proof - |
|
10687 | 275 |
assume "is_vectorspace V" "x \<in> V" |
9035 | 276 |
show "?L = ?R" |
277 |
proof |
|
9379 | 278 |
have "x = - (- x)" by (simp! add: vs_minus_minus) |
9035 | 279 |
also assume ?L |
9374 | 280 |
also have "- ... = 0" by (rule vs_minus_zero) |
9035 | 281 |
finally show ?R . |
282 |
qed (simp!) |
|
283 |
qed |
|
7917 | 284 |
|
10687 | 285 |
lemma vs_add_minus_cancel [simp]: |
286 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + (- x + y) = y" |
|
287 |
by (simp add: vs_add_assoc [symmetric] del: vs_add_commute) |
|
7917 | 288 |
|
10687 | 289 |
lemma vs_minus_add_cancel [simp]: |
290 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> - x + (x + y) = y" |
|
291 |
by (simp add: vs_add_assoc [symmetric] del: vs_add_commute) |
|
7917 | 292 |
|
10687 | 293 |
lemma vs_minus_add_distrib [simp]: |
294 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V |
|
295 |
\<Longrightarrow> - (x + y) = - x + - y" |
|
9035 | 296 |
by (simp add: negate_eq1 vs_add_mult_distrib1) |
7917 | 297 |
|
10687 | 298 |
lemma vs_diff_zero [simp]: |
299 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x - 0 = x" |
|
300 |
by (simp add: diff_eq1) |
|
7917 | 301 |
|
10687 | 302 |
lemma vs_diff_zero_right [simp]: |
303 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> 0 - x = - x" |
|
9035 | 304 |
by (simp add:diff_eq1) |
7917 | 305 |
|
306 |
lemma vs_add_left_cancel: |
|
10687 | 307 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V |
308 |
\<Longrightarrow> (x + y = x + z) = (y = z)" |
|
9035 | 309 |
(concl is "?L = ?R") |
310 |
proof |
|
10687 | 311 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" "z \<in> V" |
9374 | 312 |
have "y = 0 + y" by (simp!) |
9035 | 313 |
also have "... = - x + x + y" by (simp!) |
10687 | 314 |
also have "... = - x + (x + y)" |
9035 | 315 |
by (simp! only: vs_add_assoc vs_neg_closed) |
9379 | 316 |
also assume "x + y = x + z" |
10687 | 317 |
also have "- x + (x + z) = - x + x + z" |
9623 | 318 |
by (simp! only: vs_add_assoc [symmetric] vs_neg_closed) |
9035 | 319 |
also have "... = z" by (simp!) |
320 |
finally show ?R . |
|
10687 | 321 |
qed blast |
7917 | 322 |
|
10687 | 323 |
lemma vs_add_right_cancel: |
324 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V |
|
325 |
\<Longrightarrow> (y + x = z + x) = (y = z)" |
|
9035 | 326 |
by (simp only: vs_add_commute vs_add_left_cancel) |
7917 | 327 |
|
10687 | 328 |
lemma vs_add_assoc_cong: |
329 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x' \<in> V \<Longrightarrow> y' \<in> V \<Longrightarrow> z \<in> V |
|
330 |
\<Longrightarrow> x + y = x' + y' \<Longrightarrow> x + (y + z) = x' + (y' + z)" |
|
331 |
by (simp only: vs_add_assoc [symmetric]) |
|
7917 | 332 |
|
10687 | 333 |
lemma vs_mult_left_commute: |
334 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V |
|
335 |
\<Longrightarrow> x \<cdot> y \<cdot> z = y \<cdot> x \<cdot> z" |
|
9035 | 336 |
by (simp add: real_mult_commute) |
7917 | 337 |
|
9374 | 338 |
lemma vs_mult_zero_uniq: |
10687 | 339 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> a \<cdot> x = 0 \<Longrightarrow> a = 0" |
9035 | 340 |
proof (rule classical) |
10687 | 341 |
assume "is_vectorspace V" "x \<in> V" "a \<cdot> x = 0" "x \<noteq> 0" |
10683 | 342 |
assume "a \<noteq> 0" |
10606 | 343 |
have "x = (inverse a * a) \<cdot> x" by (simp!) |
344 |
also have "... = inverse a \<cdot> (a \<cdot> x)" by (rule vs_mult_assoc) |
|
345 |
also have "... = inverse a \<cdot> 0" by (simp!) |
|
9374 | 346 |
also have "... = 0" by (simp!) |
347 |
finally have "x = 0" . |
|
10687 | 348 |
thus "a = 0" by contradiction |
9035 | 349 |
qed |
7917 | 350 |
|
10687 | 351 |
lemma vs_mult_left_cancel: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
352 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<noteq> 0 \<Longrightarrow> |
9503 | 353 |
(a \<cdot> x = a \<cdot> y) = (x = y)" |
9035 | 354 |
(concl is "?L = ?R") |
355 |
proof |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
356 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" "a \<noteq> 0" |
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
357 |
have "x = 1 \<cdot> x" by (simp!) |
10606 | 358 |
also have "... = (inverse a * a) \<cdot> x" by (simp!) |
10687 | 359 |
also have "... = inverse a \<cdot> (a \<cdot> x)" |
9035 | 360 |
by (simp! only: vs_mult_assoc) |
361 |
also assume ?L |
|
10606 | 362 |
also have "inverse a \<cdot> ... = y" by (simp!) |
9035 | 363 |
finally show ?R . |
364 |
qed simp |
|
7917 | 365 |
|
366 |
lemma vs_mult_right_cancel: (*** forward ***) |
|
10687 | 367 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x \<noteq> 0 |
368 |
\<Longrightarrow> (a \<cdot> x = b \<cdot> x) = (a = b)" (concl is "?L = ?R") |
|
9035 | 369 |
proof |
10687 | 370 |
assume v: "is_vectorspace V" "x \<in> V" "x \<noteq> 0" |
371 |
have "(a - b) \<cdot> x = a \<cdot> x - b \<cdot> x" |
|
9035 | 372 |
by (simp! add: vs_diff_mult_distrib2) |
9503 | 373 |
also assume ?L hence "a \<cdot> x - b \<cdot> x = 0" by (simp!) |
10683 | 374 |
finally have "(a - b) \<cdot> x = 0" . |
10687 | 375 |
from v this have "a - b = 0" by (rule vs_mult_zero_uniq) |
10683 | 376 |
thus "a = b" by simp |
10687 | 377 |
qed simp |
7917 | 378 |
|
10687 | 379 |
lemma vs_eq_diff_eq: |
380 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> |
|
7917 | 381 |
(x = z - y) = (x + y = z)" |
10687 | 382 |
(concl is "?L = ?R" ) |
9035 | 383 |
proof - |
10687 | 384 |
assume vs: "is_vectorspace V" "x \<in> V" "y \<in> V" "z \<in> V" |
385 |
show "?L = ?R" |
|
9035 | 386 |
proof |
387 |
assume ?L |
|
388 |
hence "x + y = z - y + y" by simp |
|
389 |
also have "... = z + - y + y" by (simp! add: diff_eq1) |
|
10687 | 390 |
also have "... = z + (- y + y)" |
9035 | 391 |
by (rule vs_add_assoc) (simp!)+ |
10687 | 392 |
also from vs have "... = z + 0" |
9035 | 393 |
by (simp only: vs_add_minus_left) |
394 |
also from vs have "... = z" by (simp only: vs_add_zero_right) |
|
395 |
finally show ?R . |
|
396 |
next |
|
397 |
assume ?R |
|
398 |
hence "z - y = (x + y) - y" by simp |
|
10687 | 399 |
also from vs have "... = x + y + - y" |
9035 | 400 |
by (simp add: diff_eq1) |
10687 | 401 |
also have "... = x + (y + - y)" |
9035 | 402 |
by (rule vs_add_assoc) (simp!)+ |
403 |
also have "... = x" by (simp!) |
|
404 |
finally show ?L by (rule sym) |
|
405 |
qed |
|
406 |
qed |
|
7917 | 407 |
|
10687 | 408 |
lemma vs_add_minus_eq_minus: |
409 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + y = 0 \<Longrightarrow> x = - y" |
|
9035 | 410 |
proof - |
10687 | 411 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" |
9035 | 412 |
have "x = (- y + y) + x" by (simp!) |
413 |
also have "... = - y + (x + y)" by (simp!) |
|
9374 | 414 |
also assume "x + y = 0" |
415 |
also have "- y + 0 = - y" by (simp!) |
|
9035 | 416 |
finally show "x = - y" . |
417 |
qed |
|
7917 | 418 |
|
10687 | 419 |
lemma vs_add_minus_eq: |
420 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x - y = 0 \<Longrightarrow> x = y" |
|
9035 | 421 |
proof - |
10687 | 422 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" "x - y = 0" |
9374 | 423 |
assume "x - y = 0" |
424 |
hence e: "x + - y = 0" by (simp! add: diff_eq1) |
|
10687 | 425 |
with _ _ _ have "x = - (- y)" |
9035 | 426 |
by (rule vs_add_minus_eq_minus) (simp!)+ |
427 |
thus "x = y" by (simp!) |
|
428 |
qed |
|
7917 | 429 |
|
430 |
lemma vs_add_diff_swap: |
|
10687 | 431 |
"is_vectorspace V \<Longrightarrow> a \<in> V \<Longrightarrow> b \<in> V \<Longrightarrow> c \<in> V \<Longrightarrow> d \<in> V \<Longrightarrow> a + b = c + d |
432 |
\<Longrightarrow> a - c = d - b" |
|
433 |
proof - |
|
434 |
assume vs: "is_vectorspace V" "a \<in> V" "b \<in> V" "c \<in> V" "d \<in> V" |
|
9035 | 435 |
and eq: "a + b = c + d" |
10687 | 436 |
have "- c + (a + b) = - c + (c + d)" |
9035 | 437 |
by (simp! add: vs_add_left_cancel) |
438 |
also have "... = d" by (rule vs_minus_add_cancel) |
|
439 |
finally have eq: "- c + (a + b) = d" . |
|
10687 | 440 |
from vs have "a - c = (- c + (a + b)) + - b" |
9035 | 441 |
by (simp add: vs_add_ac diff_eq1) |
10687 | 442 |
also from eq have "... = d + - b" |
9035 | 443 |
by (simp! add: vs_add_right_cancel) |
9374 | 444 |
also have "... = d - b" by (simp! add: diff_eq2) |
9035 | 445 |
finally show "a - c = d - b" . |
446 |
qed |
|
7917 | 447 |
|
10687 | 448 |
lemma vs_add_cancel_21: |
449 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> u \<in> V |
|
450 |
\<Longrightarrow> (x + (y + z) = y + u) = ((x + z) = u)" |
|
451 |
(concl is "?L = ?R") |
|
452 |
proof - |
|
453 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" "z \<in> V" "u \<in> V" |
|
9035 | 454 |
show "?L = ?R" |
455 |
proof |
|
456 |
have "x + z = - y + y + (x + z)" by (simp!) |
|
457 |
also have "... = - y + (y + (x + z))" |
|
458 |
by (rule vs_add_assoc) (simp!)+ |
|
459 |
also have "y + (x + z) = x + (y + z)" by (simp!) |
|
460 |
also assume ?L |
|
461 |
also have "- y + (y + u) = u" by (simp!) |
|
462 |
finally show ?R . |
|
463 |
qed (simp! only: vs_add_left_commute [of V x]) |
|
464 |
qed |
|
7917 | 465 |
|
10687 | 466 |
lemma vs_add_cancel_end: |
467 |
"is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V |
|
468 |
\<Longrightarrow> (x + (y + z) = y) = (x = - z)" |
|
9035 | 469 |
(concl is "?L = ?R" ) |
470 |
proof - |
|
10687 | 471 |
assume "is_vectorspace V" "x \<in> V" "y \<in> V" "z \<in> V" |
9035 | 472 |
show "?L = ?R" |
473 |
proof |
|
474 |
assume l: ?L |
|
10687 | 475 |
have "x + z = 0" |
9623 | 476 |
proof (rule vs_add_left_cancel [THEN iffD1]) |
9035 | 477 |
have "y + (x + z) = x + (y + z)" by (simp!) |
478 |
also note l |
|
9374 | 479 |
also have "y = y + 0" by (simp!) |
480 |
finally show "y + (x + z) = y + 0" . |
|
9035 | 481 |
qed (simp!)+ |
482 |
thus "x = - z" by (simp! add: vs_add_minus_eq_minus) |
|
483 |
next |
|
484 |
assume r: ?R |
|
10687 | 485 |
hence "x + (y + z) = - z + (y + z)" by simp |
486 |
also have "... = y + (- z + z)" |
|
9035 | 487 |
by (simp! only: vs_add_left_commute) |
488 |
also have "... = y" by (simp!) |
|
489 |
finally show ?L . |
|
490 |
qed |
|
491 |
qed |
|
7917 | 492 |
|
10687 | 493 |
end |