author | haftmann |
Thu, 13 Oct 2011 23:27:46 +0200 | |
changeset 45140 | 339a8b3c4791 |
parent 44887 | 7ca82df6e951 |
child 46867 | 0883804b67bb |
permissions | -rw-r--r-- |
31795
be3e1cc5005c
standard naming conventions for session and theories;
wenzelm
parents:
29252
diff
changeset
|
1 |
(* Title: HOL/Hahn_Banach/Vector_Space.thy |
7917 | 2 |
Author: Gertrud Bauer, TU Munich |
3 |
*) |
|
4 |
||
9035 | 5 |
header {* Vector spaces *} |
7917 | 6 |
|
31795
be3e1cc5005c
standard naming conventions for session and theories;
wenzelm
parents:
29252
diff
changeset
|
7 |
theory Vector_Space |
44887 | 8 |
imports Complex_Main Bounds "~~/src/HOL/Library/Zorn" |
27612 | 9 |
begin |
7917 | 10 |
|
9035 | 11 |
subsection {* Signature *} |
7917 | 12 |
|
10687 | 13 |
text {* |
14 |
For the definition of real vector spaces a type @{typ 'a} of the |
|
15 |
sort @{text "{plus, minus, zero}"} is considered, on which a real |
|
16 |
scalar multiplication @{text \<cdot>} is declared. |
|
17 |
*} |
|
7917 | 18 |
|
19 |
consts |
|
10687 | 20 |
prod :: "real \<Rightarrow> 'a::{plus, minus, zero} \<Rightarrow> 'a" (infixr "'(*')" 70) |
7917 | 21 |
|
21210 | 22 |
notation (xsymbols) |
19736 | 23 |
prod (infixr "\<cdot>" 70) |
21210 | 24 |
notation (HTML output) |
19736 | 25 |
prod (infixr "\<cdot>" 70) |
7917 | 26 |
|
27 |
||
9035 | 28 |
subsection {* Vector space laws *} |
7917 | 29 |
|
10687 | 30 |
text {* |
31 |
A \emph{vector space} is a non-empty set @{text V} of elements from |
|
32 |
@{typ 'a} with the following vector space laws: The set @{text V} is |
|
33 |
closed under addition and scalar multiplication, addition is |
|
34 |
associative and commutative; @{text "- x"} is the inverse of @{text |
|
35 |
x} w.~r.~t.~addition and @{text 0} is the neutral element of |
|
36 |
addition. Addition and multiplication are distributive; scalar |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11704
diff
changeset
|
37 |
multiplication is associative and the real number @{text "1"} is |
10687 | 38 |
the neutral element of scalar multiplication. |
9035 | 39 |
*} |
7917 | 40 |
|
29234 | 41 |
locale var_V = fixes V |
42 |
||
43 |
locale vectorspace = var_V + |
|
13515 | 44 |
assumes non_empty [iff, intro?]: "V \<noteq> {}" |
45 |
and add_closed [iff]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + y \<in> V" |
|
46 |
and mult_closed [iff]: "x \<in> V \<Longrightarrow> a \<cdot> x \<in> V" |
|
47 |
and add_assoc: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> (x + y) + z = x + (y + z)" |
|
48 |
and add_commute: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + y = y + x" |
|
49 |
and diff_self [simp]: "x \<in> V \<Longrightarrow> x - x = 0" |
|
50 |
and add_zero_left [simp]: "x \<in> V \<Longrightarrow> 0 + x = x" |
|
51 |
and add_mult_distrib1: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y" |
|
52 |
and add_mult_distrib2: "x \<in> V \<Longrightarrow> (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x" |
|
53 |
and mult_assoc: "x \<in> V \<Longrightarrow> (a * b) \<cdot> x = a \<cdot> (b \<cdot> x)" |
|
54 |
and mult_1 [simp]: "x \<in> V \<Longrightarrow> 1 \<cdot> x = x" |
|
55 |
and negate_eq1: "x \<in> V \<Longrightarrow> - x = (- 1) \<cdot> x" |
|
56 |
and diff_eq1: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x - y = x + - y" |
|
44887 | 57 |
begin |
7917 | 58 |
|
44887 | 59 |
lemma negate_eq2: "x \<in> V \<Longrightarrow> (- 1) \<cdot> x = - x" |
13515 | 60 |
by (rule negate_eq1 [symmetric]) |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8703
diff
changeset
|
61 |
|
44887 | 62 |
lemma negate_eq2a: "x \<in> V \<Longrightarrow> -1 \<cdot> x = - x" |
13515 | 63 |
by (simp add: negate_eq1) |
7917 | 64 |
|
44887 | 65 |
lemma diff_eq2: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + - y = x - y" |
13515 | 66 |
by (rule diff_eq1 [symmetric]) |
7917 | 67 |
|
44887 | 68 |
lemma diff_closed [iff]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x - y \<in> V" |
9035 | 69 |
by (simp add: diff_eq1 negate_eq1) |
7917 | 70 |
|
44887 | 71 |
lemma neg_closed [iff]: "x \<in> V \<Longrightarrow> - x \<in> V" |
9035 | 72 |
by (simp add: negate_eq1) |
7917 | 73 |
|
44887 | 74 |
lemma add_left_commute: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> x + (y + z) = y + (x + z)" |
9035 | 75 |
proof - |
13515 | 76 |
assume xyz: "x \<in> V" "y \<in> V" "z \<in> V" |
27612 | 77 |
then have "x + (y + z) = (x + y) + z" |
13515 | 78 |
by (simp only: add_assoc) |
27612 | 79 |
also from xyz have "\<dots> = (y + x) + z" by (simp only: add_commute) |
80 |
also from xyz have "\<dots> = y + (x + z)" by (simp only: add_assoc) |
|
9035 | 81 |
finally show ?thesis . |
82 |
qed |
|
7917 | 83 |
|
44887 | 84 |
theorems add_ac = add_assoc add_commute add_left_commute |
7917 | 85 |
|
86 |
||
7978 | 87 |
text {* The existence of the zero element of a vector space |
13515 | 88 |
follows from the non-emptiness of carrier set. *} |
7917 | 89 |
|
44887 | 90 |
lemma zero [iff]: "0 \<in> V" |
10687 | 91 |
proof - |
13515 | 92 |
from non_empty obtain x where x: "x \<in> V" by blast |
93 |
then have "0 = x - x" by (rule diff_self [symmetric]) |
|
27612 | 94 |
also from x x have "\<dots> \<in> V" by (rule diff_closed) |
11472 | 95 |
finally show ?thesis . |
9035 | 96 |
qed |
7917 | 97 |
|
44887 | 98 |
lemma add_zero_right [simp]: "x \<in> V \<Longrightarrow> x + 0 = x" |
9035 | 99 |
proof - |
13515 | 100 |
assume x: "x \<in> V" |
101 |
from this and zero have "x + 0 = 0 + x" by (rule add_commute) |
|
27612 | 102 |
also from x have "\<dots> = x" by (rule add_zero_left) |
9035 | 103 |
finally show ?thesis . |
104 |
qed |
|
7917 | 105 |
|
44887 | 106 |
lemma mult_assoc2: "x \<in> V \<Longrightarrow> a \<cdot> b \<cdot> x = (a * b) \<cdot> x" |
13515 | 107 |
by (simp only: mult_assoc) |
7917 | 108 |
|
44887 | 109 |
lemma diff_mult_distrib1: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<cdot> (x - y) = a \<cdot> x - a \<cdot> y" |
13515 | 110 |
by (simp add: diff_eq1 negate_eq1 add_mult_distrib1 mult_assoc2) |
7917 | 111 |
|
44887 | 112 |
lemma diff_mult_distrib2: "x \<in> V \<Longrightarrow> (a - b) \<cdot> x = a \<cdot> x - (b \<cdot> x)" |
9035 | 113 |
proof - |
13515 | 114 |
assume x: "x \<in> V" |
10687 | 115 |
have " (a - b) \<cdot> x = (a + - b) \<cdot> x" |
37887 | 116 |
by (simp add: diff_minus) |
27612 | 117 |
also from x have "\<dots> = a \<cdot> x + (- b) \<cdot> x" |
13515 | 118 |
by (rule add_mult_distrib2) |
27612 | 119 |
also from x have "\<dots> = a \<cdot> x + - (b \<cdot> x)" |
13515 | 120 |
by (simp add: negate_eq1 mult_assoc2) |
27612 | 121 |
also from x have "\<dots> = a \<cdot> x - (b \<cdot> x)" |
13515 | 122 |
by (simp add: diff_eq1) |
9035 | 123 |
finally show ?thesis . |
124 |
qed |
|
7917 | 125 |
|
44887 | 126 |
lemmas distrib = |
13515 | 127 |
add_mult_distrib1 add_mult_distrib2 |
128 |
diff_mult_distrib1 diff_mult_distrib2 |
|
129 |
||
10687 | 130 |
|
131 |
text {* \medskip Further derived laws: *} |
|
7917 | 132 |
|
44887 | 133 |
lemma mult_zero_left [simp]: "x \<in> V \<Longrightarrow> 0 \<cdot> x = 0" |
9035 | 134 |
proof - |
13515 | 135 |
assume x: "x \<in> V" |
136 |
have "0 \<cdot> x = (1 - 1) \<cdot> x" by simp |
|
27612 | 137 |
also have "\<dots> = (1 + - 1) \<cdot> x" by simp |
138 |
also from x have "\<dots> = 1 \<cdot> x + (- 1) \<cdot> x" |
|
13515 | 139 |
by (rule add_mult_distrib2) |
27612 | 140 |
also from x have "\<dots> = x + (- 1) \<cdot> x" by simp |
141 |
also from x have "\<dots> = x + - x" by (simp add: negate_eq2a) |
|
142 |
also from x have "\<dots> = x - x" by (simp add: diff_eq2) |
|
143 |
also from x have "\<dots> = 0" by simp |
|
9035 | 144 |
finally show ?thesis . |
145 |
qed |
|
7917 | 146 |
|
44887 | 147 |
lemma mult_zero_right [simp]: "a \<cdot> 0 = (0::'a)" |
9035 | 148 |
proof - |
13515 | 149 |
have "a \<cdot> 0 = a \<cdot> (0 - (0::'a))" by simp |
27612 | 150 |
also have "\<dots> = a \<cdot> 0 - a \<cdot> 0" |
13515 | 151 |
by (rule diff_mult_distrib1) simp_all |
27612 | 152 |
also have "\<dots> = 0" by simp |
9035 | 153 |
finally show ?thesis . |
154 |
qed |
|
7917 | 155 |
|
44887 | 156 |
lemma minus_mult_cancel [simp]: "x \<in> V \<Longrightarrow> (- a) \<cdot> - x = a \<cdot> x" |
13515 | 157 |
by (simp add: negate_eq1 mult_assoc2) |
7917 | 158 |
|
44887 | 159 |
lemma add_minus_left_eq_diff: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> - x + y = y - x" |
10687 | 160 |
proof - |
13515 | 161 |
assume xy: "x \<in> V" "y \<in> V" |
27612 | 162 |
then have "- x + y = y + - x" by (simp add: add_commute) |
163 |
also from xy have "\<dots> = y - x" by (simp add: diff_eq1) |
|
9035 | 164 |
finally show ?thesis . |
165 |
qed |
|
7917 | 166 |
|
44887 | 167 |
lemma add_minus [simp]: "x \<in> V \<Longrightarrow> x + - x = 0" |
13515 | 168 |
by (simp add: diff_eq2) |
7917 | 169 |
|
44887 | 170 |
lemma add_minus_left [simp]: "x \<in> V \<Longrightarrow> - x + x = 0" |
13515 | 171 |
by (simp add: diff_eq2 add_commute) |
7917 | 172 |
|
44887 | 173 |
lemma minus_minus [simp]: "x \<in> V \<Longrightarrow> - (- x) = x" |
13515 | 174 |
by (simp add: negate_eq1 mult_assoc2) |
175 |
||
44887 | 176 |
lemma minus_zero [simp]: "- (0::'a) = 0" |
9035 | 177 |
by (simp add: negate_eq1) |
7917 | 178 |
|
44887 | 179 |
lemma minus_zero_iff [simp]: |
180 |
assumes x: "x \<in> V" |
|
181 |
shows "(- x = 0) = (x = 0)" |
|
13515 | 182 |
proof |
44887 | 183 |
from x have "x = - (- x)" by simp |
184 |
also assume "- x = 0" |
|
185 |
also have "- \<dots> = 0" by (rule minus_zero) |
|
186 |
finally show "x = 0" . |
|
187 |
next |
|
188 |
assume "x = 0" |
|
189 |
then show "- x = 0" by simp |
|
9035 | 190 |
qed |
7917 | 191 |
|
44887 | 192 |
lemma add_minus_cancel [simp]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x + (- x + y) = y" |
193 |
by (simp add: add_assoc [symmetric]) |
|
7917 | 194 |
|
44887 | 195 |
lemma minus_add_cancel [simp]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> - x + (x + y) = y" |
196 |
by (simp add: add_assoc [symmetric]) |
|
7917 | 197 |
|
44887 | 198 |
lemma minus_add_distrib [simp]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> - (x + y) = - x + - y" |
13515 | 199 |
by (simp add: negate_eq1 add_mult_distrib1) |
7917 | 200 |
|
44887 | 201 |
lemma diff_zero [simp]: "x \<in> V \<Longrightarrow> x - 0 = x" |
13515 | 202 |
by (simp add: diff_eq1) |
203 |
||
44887 | 204 |
lemma diff_zero_right [simp]: "x \<in> V \<Longrightarrow> 0 - x = - x" |
10687 | 205 |
by (simp add: diff_eq1) |
7917 | 206 |
|
44887 | 207 |
lemma add_left_cancel: |
208 |
assumes x: "x \<in> V" and y: "y \<in> V" and z: "z \<in> V" |
|
209 |
shows "(x + y = x + z) = (y = z)" |
|
9035 | 210 |
proof |
44887 | 211 |
from y have "y = 0 + y" by simp |
212 |
also from x y have "\<dots> = (- x + x) + y" by simp |
|
213 |
also from x y have "\<dots> = - x + (x + y)" by (simp add: add_assoc) |
|
214 |
also assume "x + y = x + z" |
|
215 |
also from x z have "- x + (x + z) = - x + x + z" by (simp add: add_assoc) |
|
216 |
also from x z have "\<dots> = z" by simp |
|
217 |
finally show "y = z" . |
|
218 |
next |
|
219 |
assume "y = z" |
|
220 |
then show "x + y = x + z" by (simp only:) |
|
13515 | 221 |
qed |
7917 | 222 |
|
44887 | 223 |
lemma add_right_cancel: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> (y + x = z + x) = (y = z)" |
13515 | 224 |
by (simp only: add_commute add_left_cancel) |
7917 | 225 |
|
44887 | 226 |
lemma add_assoc_cong: |
13515 | 227 |
"x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> x' \<in> V \<Longrightarrow> y' \<in> V \<Longrightarrow> z \<in> V |
228 |
\<Longrightarrow> x + y = x' + y' \<Longrightarrow> x + (y + z) = x' + (y' + z)" |
|
229 |
by (simp only: add_assoc [symmetric]) |
|
7917 | 230 |
|
44887 | 231 |
lemma mult_left_commute: "x \<in> V \<Longrightarrow> a \<cdot> b \<cdot> x = b \<cdot> a \<cdot> x" |
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
31795
diff
changeset
|
232 |
by (simp add: mult_commute mult_assoc2) |
7917 | 233 |
|
44887 | 234 |
lemma mult_zero_uniq: |
235 |
assumes x: "x \<in> V" "x \<noteq> 0" and ax: "a \<cdot> x = 0" |
|
236 |
shows "a = 0" |
|
9035 | 237 |
proof (rule classical) |
13515 | 238 |
assume a: "a \<noteq> 0" |
239 |
from x a have "x = (inverse a * a) \<cdot> x" by simp |
|
27612 | 240 |
also from `x \<in> V` have "\<dots> = inverse a \<cdot> (a \<cdot> x)" by (rule mult_assoc) |
241 |
also from ax have "\<dots> = inverse a \<cdot> 0" by simp |
|
242 |
also have "\<dots> = 0" by simp |
|
9374 | 243 |
finally have "x = 0" . |
23378 | 244 |
with `x \<noteq> 0` show "a = 0" by contradiction |
9035 | 245 |
qed |
7917 | 246 |
|
44887 | 247 |
lemma mult_left_cancel: |
248 |
assumes x: "x \<in> V" and y: "y \<in> V" and a: "a \<noteq> 0" |
|
249 |
shows "(a \<cdot> x = a \<cdot> y) = (x = y)" |
|
9035 | 250 |
proof |
13515 | 251 |
from x have "x = 1 \<cdot> x" by simp |
27612 | 252 |
also from a have "\<dots> = (inverse a * a) \<cdot> x" by simp |
253 |
also from x have "\<dots> = inverse a \<cdot> (a \<cdot> x)" |
|
13515 | 254 |
by (simp only: mult_assoc) |
255 |
also assume "a \<cdot> x = a \<cdot> y" |
|
27612 | 256 |
also from a y have "inverse a \<cdot> \<dots> = y" |
13515 | 257 |
by (simp add: mult_assoc2) |
258 |
finally show "x = y" . |
|
259 |
next |
|
260 |
assume "x = y" |
|
261 |
then show "a \<cdot> x = a \<cdot> y" by (simp only:) |
|
262 |
qed |
|
7917 | 263 |
|
44887 | 264 |
lemma mult_right_cancel: |
265 |
assumes x: "x \<in> V" and neq: "x \<noteq> 0" |
|
266 |
shows "(a \<cdot> x = b \<cdot> x) = (a = b)" |
|
9035 | 267 |
proof |
44887 | 268 |
from x have "(a - b) \<cdot> x = a \<cdot> x - b \<cdot> x" |
269 |
by (simp add: diff_mult_distrib2) |
|
270 |
also assume "a \<cdot> x = b \<cdot> x" |
|
271 |
with x have "a \<cdot> x - b \<cdot> x = 0" by simp |
|
272 |
finally have "(a - b) \<cdot> x = 0" . |
|
273 |
with x neq have "a - b = 0" by (rule mult_zero_uniq) |
|
274 |
then show "a = b" by simp |
|
275 |
next |
|
276 |
assume "a = b" |
|
277 |
then show "a \<cdot> x = b \<cdot> x" by (simp only:) |
|
13515 | 278 |
qed |
7917 | 279 |
|
44887 | 280 |
lemma eq_diff_eq: |
281 |
assumes x: "x \<in> V" and y: "y \<in> V" and z: "z \<in> V" |
|
282 |
shows "(x = z - y) = (x + y = z)" |
|
13515 | 283 |
proof |
44887 | 284 |
assume "x = z - y" |
285 |
then have "x + y = z - y + y" by simp |
|
286 |
also from y z have "\<dots> = z + - y + y" |
|
287 |
by (simp add: diff_eq1) |
|
288 |
also have "\<dots> = z + (- y + y)" |
|
289 |
by (rule add_assoc) (simp_all add: y z) |
|
290 |
also from y z have "\<dots> = z + 0" |
|
291 |
by (simp only: add_minus_left) |
|
292 |
also from z have "\<dots> = z" |
|
293 |
by (simp only: add_zero_right) |
|
294 |
finally show "x + y = z" . |
|
295 |
next |
|
296 |
assume "x + y = z" |
|
297 |
then have "z - y = (x + y) - y" by simp |
|
298 |
also from x y have "\<dots> = x + y + - y" |
|
299 |
by (simp add: diff_eq1) |
|
300 |
also have "\<dots> = x + (y + - y)" |
|
301 |
by (rule add_assoc) (simp_all add: x y) |
|
302 |
also from x y have "\<dots> = x" by simp |
|
303 |
finally show "x = z - y" .. |
|
9035 | 304 |
qed |
7917 | 305 |
|
44887 | 306 |
lemma add_minus_eq_minus: |
307 |
assumes x: "x \<in> V" and y: "y \<in> V" and xy: "x + y = 0" |
|
308 |
shows "x = - y" |
|
9035 | 309 |
proof - |
13515 | 310 |
from x y have "x = (- y + y) + x" by simp |
27612 | 311 |
also from x y have "\<dots> = - y + (x + y)" by (simp add: add_ac) |
44887 | 312 |
also note xy |
13515 | 313 |
also from y have "- y + 0 = - y" by simp |
9035 | 314 |
finally show "x = - y" . |
315 |
qed |
|
7917 | 316 |
|
44887 | 317 |
lemma add_minus_eq: |
318 |
assumes x: "x \<in> V" and y: "y \<in> V" and xy: "x - y = 0" |
|
319 |
shows "x = y" |
|
9035 | 320 |
proof - |
44887 | 321 |
from x y xy have eq: "x + - y = 0" by (simp add: diff_eq1) |
13515 | 322 |
with _ _ have "x = - (- y)" |
323 |
by (rule add_minus_eq_minus) (simp_all add: x y) |
|
324 |
with x y show "x = y" by simp |
|
9035 | 325 |
qed |
7917 | 326 |
|
44887 | 327 |
lemma add_diff_swap: |
328 |
assumes vs: "a \<in> V" "b \<in> V" "c \<in> V" "d \<in> V" |
|
329 |
and eq: "a + b = c + d" |
|
330 |
shows "a - c = d - b" |
|
10687 | 331 |
proof - |
44887 | 332 |
from assms have "- c + (a + b) = - c + (c + d)" |
13515 | 333 |
by (simp add: add_left_cancel) |
27612 | 334 |
also have "\<dots> = d" using `c \<in> V` `d \<in> V` by (rule minus_add_cancel) |
9035 | 335 |
finally have eq: "- c + (a + b) = d" . |
10687 | 336 |
from vs have "a - c = (- c + (a + b)) + - b" |
13515 | 337 |
by (simp add: add_ac diff_eq1) |
27612 | 338 |
also from vs eq have "\<dots> = d + - b" |
13515 | 339 |
by (simp add: add_right_cancel) |
27612 | 340 |
also from vs have "\<dots> = d - b" by (simp add: diff_eq2) |
9035 | 341 |
finally show "a - c = d - b" . |
342 |
qed |
|
7917 | 343 |
|
44887 | 344 |
lemma vs_add_cancel_21: |
345 |
assumes vs: "x \<in> V" "y \<in> V" "z \<in> V" "u \<in> V" |
|
346 |
shows "(x + (y + z) = y + u) = (x + z = u)" |
|
13515 | 347 |
proof |
44887 | 348 |
from vs have "x + z = - y + y + (x + z)" by simp |
349 |
also have "\<dots> = - y + (y + (x + z))" |
|
350 |
by (rule add_assoc) (simp_all add: vs) |
|
351 |
also from vs have "y + (x + z) = x + (y + z)" |
|
352 |
by (simp add: add_ac) |
|
353 |
also assume "x + (y + z) = y + u" |
|
354 |
also from vs have "- y + (y + u) = u" by simp |
|
355 |
finally show "x + z = u" . |
|
356 |
next |
|
357 |
assume "x + z = u" |
|
358 |
with vs show "x + (y + z) = y + u" |
|
359 |
by (simp only: add_left_commute [of x]) |
|
9035 | 360 |
qed |
7917 | 361 |
|
44887 | 362 |
lemma add_cancel_end: |
363 |
assumes vs: "x \<in> V" "y \<in> V" "z \<in> V" |
|
364 |
shows "(x + (y + z) = y) = (x = - z)" |
|
13515 | 365 |
proof |
44887 | 366 |
assume "x + (y + z) = y" |
367 |
with vs have "(x + z) + y = 0 + y" by (simp add: add_ac) |
|
368 |
with vs have "x + z = 0" by (simp only: add_right_cancel add_closed zero) |
|
369 |
with vs show "x = - z" by (simp add: add_minus_eq_minus) |
|
370 |
next |
|
371 |
assume eq: "x = - z" |
|
372 |
then have "x + (y + z) = - z + (y + z)" by simp |
|
373 |
also have "\<dots> = y + (- z + z)" by (rule add_left_commute) (simp_all add: vs) |
|
374 |
also from vs have "\<dots> = y" by simp |
|
375 |
finally show "x + (y + z) = y" . |
|
9035 | 376 |
qed |
7917 | 377 |
|
10687 | 378 |
end |
44887 | 379 |
|
380 |
end |
|
381 |