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