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