src/HOL/Real/HahnBanach/Subspace.thy
changeset 7978 1b99ee57d131
parent 7927 b50446a33c16
child 8169 77b3bc101de5
equal deleted inserted replaced
7977:67bfcd3a433c 7978:1b99ee57d131
    15 \emph{subspace} of $V$, iff $U$ is closed under addition and 
    15 \emph{subspace} of $V$, iff $U$ is closed under addition and 
    16 scalar multiplication. *};
    16 scalar multiplication. *};
    17 
    17 
    18 constdefs 
    18 constdefs 
    19   is_subspace ::  "['a::{minus, plus} set, 'a set] => bool"
    19   is_subspace ::  "['a::{minus, plus} set, 'a set] => bool"
    20   "is_subspace U V ==  U ~= {}  & U <= V 
    20   "is_subspace U V == U ~= {} & U <= V 
    21      &  (ALL x:U. ALL y:U. ALL a. x + y : U & a <*> x : U)";
    21      & (ALL x:U. ALL y:U. ALL a. x + y : U & a <*> x : U)";
    22 
    22 
    23 lemma subspaceI [intro]: 
    23 lemma subspaceI [intro]: 
    24   "[| <0>:U; U <= V; ALL x:U. ALL y:U. (x + y : U); 
    24   "[| <0> : U; U <= V; ALL x:U. ALL y:U. (x + y : U); 
    25   ALL x:U. ALL a. a <*> x : U |]
    25   ALL x:U. ALL a. a <*> x : U |]
    26   ==> is_subspace U V";
    26   ==> is_subspace U V";
    27 proof (unfold is_subspace_def, intro conjI); 
    27 proof (unfold is_subspace_def, intro conjI); 
    28   assume "<0>:U"; thus "U ~= {}"; by fast;
    28   assume "<0> : U"; thus "U ~= {}"; by fast;
    29 qed (simp+);
    29 qed (simp+);
    30 
    30 
    31 lemma subspace_not_empty [intro!!]: "is_subspace U V ==> U ~= {}";
    31 lemma subspace_not_empty [intro!!]: "is_subspace U V ==> U ~= {}";
    32   by (unfold is_subspace_def) simp; 
    32   by (unfold is_subspace_def) simp; 
    33 
    33 
    34 lemma subspace_subset [intro !!]: "is_subspace U V ==> U <= V";
    34 lemma subspace_subset [intro !!]: "is_subspace U V ==> U <= V";
    35   by (unfold is_subspace_def) simp;
    35   by (unfold is_subspace_def) simp;
    36 
    36 
    37 lemma subspace_subsetD [simp, intro!!]: 
    37 lemma subspace_subsetD [simp, intro!!]: 
    38   "[| is_subspace U V; x:U |]==> x:V";
    38   "[| is_subspace U V; x:U |] ==> x:V";
    39   by (unfold is_subspace_def) force;
    39   by (unfold is_subspace_def) force;
    40 
    40 
    41 lemma subspace_add_closed [simp, intro!!]: 
    41 lemma subspace_add_closed [simp, intro!!]: 
    42   "[| is_subspace U V; x: U; y: U |] ==> x + y : U";
    42   "[| is_subspace U V; x:U; y:U |] ==> x + y : U";
    43   by (unfold is_subspace_def) simp;
    43   by (unfold is_subspace_def) simp;
    44 
    44 
    45 lemma subspace_mult_closed [simp, intro!!]: 
    45 lemma subspace_mult_closed [simp, intro!!]: 
    46   "[| is_subspace U V; x: U |] ==> a <*> x: U";
    46   "[| is_subspace U V; x:U |] ==> a <*> x : U";
    47   by (unfold is_subspace_def) simp;
    47   by (unfold is_subspace_def) simp;
    48 
    48 
    49 lemma subspace_diff_closed [simp, intro!!]: 
    49 lemma subspace_diff_closed [simp, intro!!]: 
    50   "[| is_subspace U V; is_vectorspace V; x: U; y: U |] 
    50   "[| is_subspace U V; is_vectorspace V; x:U; y:U |] 
    51   ==> x - y: U";
    51   ==> x - y : U";
    52   by (simp! add: diff_eq1 negate_eq1);
    52   by (simp! add: diff_eq1 negate_eq1);
    53 
    53 
    54 text {* Similar as for linear spaces, the existence of the 
    54 text {* Similar as for linear spaces, the existence of the 
    55 zero element in every subspace follws from the non-emptyness 
    55 zero element in every subspace follows from the non-emptiness 
    56 of the subspace and vector space laws.*};
    56 of the carrier set and by vector space laws.*};
    57 
    57 
    58 lemma zero_in_subspace [intro !!]:
    58 lemma zero_in_subspace [intro !!]:
    59   "[| is_subspace U V; is_vectorspace V |] ==> <0>:U";
    59   "[| is_subspace U V; is_vectorspace V |] ==> <0> : U";
    60 proof -; 
    60 proof -; 
    61   assume "is_subspace U V" and v: "is_vectorspace V";
    61   assume "is_subspace U V" and v: "is_vectorspace V";
    62   have "U ~= {}"; ..;
    62   have "U ~= {}"; ..;
    63   hence "EX x. x:U"; by force;
    63   hence "EX x. x:U"; by force;
    64   thus ?thesis; 
    64   thus ?thesis; 
    70     finally; show ?thesis; .;
    70     finally; show ?thesis; .;
    71   qed;
    71   qed;
    72 qed;
    72 qed;
    73 
    73 
    74 lemma subspace_neg_closed [simp, intro!!]: 
    74 lemma subspace_neg_closed [simp, intro!!]: 
    75   "[| is_subspace U V; is_vectorspace V; x: U |] ==> - x: U";
    75   "[| is_subspace U V; is_vectorspace V; x:U |] ==> - x : U";
    76   by (simp add: negate_eq1);
    76   by (simp add: negate_eq1);
    77 
    77 
    78 text_raw {* \medskip *};
    78 text_raw {* \medskip *};
    79 text {* Further derived laws: Every subspace is a vector space. *};
    79 text {* Further derived laws: every subspace is a vector space. *};
    80 
    80 
    81 lemma subspace_vs [intro!!]:
    81 lemma subspace_vs [intro!!]:
    82   "[| is_subspace U V; is_vectorspace V |] ==> is_vectorspace U";
    82   "[| is_subspace U V; is_vectorspace V |] ==> is_vectorspace U";
    83 proof -;
    83 proof -;
    84   assume "is_subspace U V" "is_vectorspace V";
    84   assume "is_subspace U V" "is_vectorspace V";
    85   show ?thesis;
    85   show ?thesis;
    86   proof; 
    86   proof; 
    87     show "<0>:U"; ..;
    87     show "<0> : U"; ..;
    88     show "ALL x:U. ALL a. a <*> x : U"; by (simp!);
    88     show "ALL x:U. ALL a. a <*> x : U"; by (simp!);
    89     show "ALL x:U. ALL y:U. x + y : U"; by (simp!);
    89     show "ALL x:U. ALL y:U. x + y : U"; by (simp!);
    90     show "ALL x:U. - x = -1r <*> x"; by (simp! add: negate_eq1);
    90     show "ALL x:U. - x = -1r <*> x"; by (simp! add: negate_eq1);
    91     show "ALL x:U. ALL y:U. x - y =  x + - y"; 
    91     show "ALL x:U. ALL y:U. x - y =  x + - y"; 
    92       by (simp! add: diff_eq1);
    92       by (simp! add: diff_eq1);
   132 
   132 
   133 
   133 
   134 
   134 
   135 subsection {* Linear closure *};
   135 subsection {* Linear closure *};
   136 
   136 
   137 text {* The \emph{linear closure} of a vector $x$ is the set of all 
   137 text {* The \emph{linear closure} of a vector $x$ is the set of all
   138 multiples of $x$. *};
   138 scalar multiples of $x$. *};
   139 
   139 
   140 constdefs
   140 constdefs
   141   lin :: "'a => 'a set"
   141   lin :: "'a => 'a set"
   142   "lin x == {y. EX a. y = a <*> x}";
   142   "lin x == {a <*> x | a. True}"; 
   143 
   143 
   144 lemma linD: "x : lin v = (EX a::real. x = a <*> v)";
   144 lemma linD: "x : lin v = (EX a::real. x = a <*> v)";
   145   by (unfold lin_def) force;
   145   by (unfold lin_def) fast;
   146 
   146 
   147 lemma linI [intro!!]: "a <*> x0 : lin x0";
   147 lemma linI [intro!!]: "a <*> x0 : lin x0";
   148   by (unfold lin_def) force;
   148   by (unfold lin_def) fast;
   149 
   149 
   150 text {* Every vector is contained in its linear closure. *};
   150 text {* Every vector is contained in its linear closure. *};
   151 
   151 
   152 lemma x_lin_x: "[| is_vectorspace V; x:V |] ==> x:lin x";
   152 lemma x_lin_x: "[| is_vectorspace V; x:V |] ==> x : lin x";
   153 proof (unfold lin_def, intro CollectI exI);
   153 proof (unfold lin_def, intro CollectI exI conjI);
   154   assume "is_vectorspace V" "x:V";
   154   assume "is_vectorspace V" "x:V";
   155   show "x = 1r <*> x"; by (simp!);
   155   show "x = 1r <*> x"; by (simp!);
   156 qed;
   156 qed simp;
   157 
   157 
   158 text {* Any linear closure is a subspace. *};
   158 text {* Any linear closure is a subspace. *};
   159 
   159 
   160 lemma lin_subspace [intro!!]: 
   160 lemma lin_subspace [intro!!]: 
   161   "[| is_vectorspace V; x:V |] ==> is_subspace (lin x) V";
   161   "[| is_vectorspace V; x:V |] ==> is_subspace (lin x) V";
   162 proof;
   162 proof;
   163   assume "is_vectorspace V" "x:V";
   163   assume "is_vectorspace V" "x:V";
   164   show "<0> : lin x"; 
   164   show "<0> : lin x"; 
   165   proof (unfold lin_def, intro CollectI exI);
   165   proof (unfold lin_def, intro CollectI exI conjI);
   166     show "<0> = 0r <*> x"; by (simp!);
   166     show "<0> = 0r <*> x"; by (simp!);
   167   qed;
   167   qed simp;
   168 
   168 
   169   show "lin x <= V";
   169   show "lin x <= V";
   170   proof (unfold lin_def, intro subsetI, elim CollectE exE); 
   170   proof (unfold lin_def, intro subsetI, elim CollectE exE conjE); 
   171     fix xa a; assume "xa = a <*> x"; 
   171     fix xa a; assume "xa = a <*> x"; 
   172     show "xa:V"; by (simp!);
   172     show "xa:V"; by (simp!);
   173   qed;
   173   qed;
   174 
   174 
   175   show "ALL x1 : lin x. ALL x2 : lin x. x1 + x2 : lin x"; 
   175   show "ALL x1 : lin x. ALL x2 : lin x. x1 + x2 : lin x"; 
   176   proof (intro ballI);
   176   proof (intro ballI);
   177     fix x1 x2; assume "x1 : lin x" "x2 : lin x"; 
   177     fix x1 x2; assume "x1 : lin x" "x2 : lin x"; 
   178     thus "x1 + x2 : lin x";
   178     thus "x1 + x2 : lin x";
   179     proof (unfold lin_def, elim CollectE exE, intro CollectI exI);
   179     proof (unfold lin_def, elim CollectE exE conjE, 
       
   180       intro CollectI exI conjI);
   180       fix a1 a2; assume "x1 = a1 <*> x" "x2 = a2 <*> x";
   181       fix a1 a2; assume "x1 = a1 <*> x" "x2 = a2 <*> x";
   181       show "x1 + x2 = (a1 + a2) <*> x"; 
   182       show "x1 + x2 = (a1 + a2) <*> x"; 
   182         by (simp! add: vs_add_mult_distrib2);
   183         by (simp! add: vs_add_mult_distrib2);
   183     qed;
   184     qed simp;
   184   qed;
   185   qed;
   185 
   186 
   186   show "ALL xa:lin x. ALL a. a <*> xa : lin x"; 
   187   show "ALL xa:lin x. ALL a. a <*> xa : lin x"; 
   187   proof (intro ballI allI);
   188   proof (intro ballI allI);
   188     fix x1 a; assume "x1 : lin x"; 
   189     fix x1 a; assume "x1 : lin x"; 
   189     thus "a <*> x1 : lin x";
   190     thus "a <*> x1 : lin x";
   190     proof (unfold lin_def, elim CollectE exE, intro CollectI exI);
   191     proof (unfold lin_def, elim CollectE exE conjE,
       
   192       intro CollectI exI conjI);
   191       fix a1; assume "x1 = a1 <*> x";
   193       fix a1; assume "x1 = a1 <*> x";
   192       show "a <*> x1 = (a * a1) <*> x"; by (simp!);
   194       show "a <*> x1 = (a * a1) <*> x"; by (simp!);
   193     qed;
   195     qed simp;
   194   qed; 
   196   qed; 
   195 qed;
   197 qed;
   196 
   198 
   197 text {* Any linear closure is a vector space. *};
   199 text {* Any linear closure is a vector space. *};
   198 
   200 
   211 all sums of elements from $U$ and $V$. *};
   213 all sums of elements from $U$ and $V$. *};
   212 
   214 
   213 instance set :: (plus) plus; by intro_classes;
   215 instance set :: (plus) plus; by intro_classes;
   214 
   216 
   215 defs vs_sum_def:
   217 defs vs_sum_def:
   216   "U + V == {x. EX u:U. EX v:V. x = u + v}";(***  
   218   "U + V == {u + v | u v. u:U & v:V}"; (***
   217 
   219 
   218 constdefs 
   220 constdefs 
   219   vs_sum :: 
   221   vs_sum :: 
   220   "['a::{minus, plus} set, 'a set] => 'a set"         (infixl "+" 65)
   222   "['a::{minus, plus} set, 'a set] => 'a set"         (infixl "+" 65)
   221   "vs_sum U V == {x. EX u:U. EX v:V. x = u + v}";
   223   "vs_sum U V == {x. EX u:U. EX v:V. x = u + v}";
   222 ***)
   224 ***)
   223 
   225 
   224 lemma vs_sumD: 
   226 lemma vs_sumD: 
   225   "x: U + V = (EX u:U. EX v:V. x = u + v)";
   227   "x: U + V = (EX u:U. EX v:V. x = u + v)";
   226   by (unfold vs_sum_def) simp;
   228     by (unfold vs_sum_def) fast;
   227 
   229 
   228 lemmas vs_sumE = vs_sumD [RS iffD1, elimify];
   230 lemmas vs_sumE = vs_sumD [RS iffD1, elimify];
   229 
   231 
   230 lemma vs_sumI [intro!!]: 
   232 lemma vs_sumI [intro!!]: 
   231   "[| x:U; y:V; t= x + y |] ==> t : U + V";
   233   "[| x:U; y:V; t= x + y |] ==> t : U + V";
   232   by (unfold vs_sum_def, intro CollectI bexI); 
   234   by (unfold vs_sum_def) fast;
   233 
   235 
   234 text{* $U$ is a subspace of $U + V$. *};
   236 text{* $U$ is a subspace of $U + V$. *};
   235 
   237 
   236 lemma subspace_vs_sum1 [intro!!]: 
   238 lemma subspace_vs_sum1 [intro!!]: 
   237   "[| is_vectorspace U; is_vectorspace V |]
   239   "[| is_vectorspace U; is_vectorspace V |]
   285 	and "uy : U" "vy : V" "y = uy + vy";
   287 	and "uy : U" "vy : V" "y = uy + vy";
   286       show "x + y = (ux + uy) + (vx + vy)"; by (simp!);
   288       show "x + y = (ux + uy) + (vx + vy)"; by (simp!);
   287     qed (simp!)+;
   289     qed (simp!)+;
   288   qed;
   290   qed;
   289 
   291 
   290   show "ALL x: U + V. ALL a. a <*> x : U + V";
   292   show "ALL x : U + V. ALL a. a <*> x : U + V";
   291   proof (intro ballI allI);
   293   proof (intro ballI allI);
   292     fix x a; assume "x : U + V";
   294     fix x a; assume "x : U + V";
   293     thus "a <*> x : U + V";
   295     thus "a <*> x : U + V";
   294     proof (elim vs_sumE bexE, intro vs_sumI);
   296     proof (elim vs_sumE bexE, intro vs_sumI);
   295       fix a x u v; assume "u : U" "v : V" "x = u + v";
   297       fix a x u v; assume "u : U" "v : V" "x = u + v";
   346     show "v1 : E"; ..;
   348     show "v1 : E"; ..;
   347     show "v2 : E"; ..;
   349     show "v2 : E"; ..;
   348   qed;
   350   qed;
   349 qed;
   351 qed;
   350 
   352 
   351 text {* An application of the previous lemma will be used in the 
   353 text {* An application of the previous lemma will be used in the proof
   352 proof of the Hahn-Banach theorem: for an element $y + a \mult x_0$ 
   354 of the Hahn-Banach Theorem (see page \pageref{decomp-H0-use}): for any
   353 of the direct sum of a vectorspace $H$ and the linear closure of 
   355 element $y + a \mult x_0$ of the direct sum of a vectorspace $H$ and
   354 $x_0$ the components $y \in H$ and $a$ are unique. *}; 
   356 the linear closure of $x_0$ the components $y \in H$ and $a$ are
       
   357 uniquely determined. *};
   355 
   358 
   356 lemma decomp_H0: 
   359 lemma decomp_H0: 
   357   "[| is_vectorspace E; is_subspace H E; y1 : H; y2 : H; 
   360   "[| is_vectorspace E; is_subspace H E; y1 : H; y2 : H; 
   358   x0 ~: H; x0 : E; x0 ~= <0>; y1 + a1 <*> x0 = y2 + a2 <*> x0 |]
   361   x0 ~: H; x0 : E; x0 ~= <0>; y1 + a1 <*> x0 = y2 + a2 <*> x0 |]
   359   ==> y1 = y2 & a1 = a2";
   362   ==> y1 = y2 & a1 = a2";
   368     show "a2 <*> x0 : lin x0"; ..;
   371     show "a2 <*> x0 : lin x0"; ..;
   369     show "H Int (lin x0) = {<0>}"; 
   372     show "H Int (lin x0) = {<0>}"; 
   370     proof;
   373     proof;
   371       show "H Int lin x0 <= {<0>}"; 
   374       show "H Int lin x0 <= {<0>}"; 
   372       proof (intro subsetI, elim IntE, rule singleton_iff[RS iffD2]);
   375       proof (intro subsetI, elim IntE, rule singleton_iff[RS iffD2]);
   373         fix x; assume "x:H" "x:lin x0"; 
   376         fix x; assume "x:H" "x : lin x0"; 
   374         thus "x = <0>";
   377         thus "x = <0>";
   375         proof (unfold lin_def, elim CollectE exE);
   378         proof (unfold lin_def, elim CollectE exE conjE);
   376           fix a; assume "x = a <*> x0";
   379           fix a; assume "x = a <*> x0";
   377           show ?thesis;
   380           show ?thesis;
   378           proof (rule case_split);
   381           proof (rule case_split);
   379             assume "a = 0r"; show ?thesis; by (simp!);
   382             assume "a = 0r"; show ?thesis; by (simp!);
   380           next;
   383           next;
   386             thus ?thesis; by contradiction;
   389             thus ?thesis; by contradiction;
   387           qed;
   390           qed;
   388        qed;
   391        qed;
   389       qed;
   392       qed;
   390       show "{<0>} <= H Int lin x0";
   393       show "{<0>} <= H Int lin x0";
   391       proof (intro subsetI, elim singletonE, intro IntI, simp+);
   394       proof (intro subsetI, elim singletonE, intro IntI, 
   392         show "<0> : H"; ..;
   395         (simp only:)+);
       
   396         show "<0>:H"; ..;
   393         from lin_vs; show "<0> : lin x0"; ..;
   397         from lin_vs; show "<0> : lin x0"; ..;
   394       qed;
   398       qed;
   395     qed;
   399     qed;
   396     show "is_subspace (lin x0) E"; ..;
   400     show "is_subspace (lin x0) E"; ..;
   397   qed;
   401   qed;
   402   proof (rule vs_mult_right_cancel [RS iffD1]);
   406   proof (rule vs_mult_right_cancel [RS iffD1]);
   403     from c; show "a1 <*> x0 = a2 <*> x0"; by simp;
   407     from c; show "a1 <*> x0 = a2 <*> x0"; by simp;
   404   qed;
   408   qed;
   405 qed;
   409 qed;
   406 
   410 
   407 text {* Since for an element $y + a \mult x_0$ of the direct sum 
   411 text {* Since for any element $y + a \mult x_0$ of the direct sum 
   408 of a vectorspace $H$ and the linear closure of $x_0$ the components
   412 of a vectorspace $H$ and the linear closure of $x_0$ the components
   409 $y\in H$ and $a$ are unique, follows from $y\in H$ the fact that 
   413 $y\in H$ and $a$ are unique, it follows from $y\in H$ that 
   410 $a = 0$.*}; 
   414 $a = 0$.*}; 
   411 
   415 
   412 lemma decomp_H0_H: 
   416 lemma decomp_H0_H: 
   413   "[| is_vectorspace E; is_subspace H E; t:H; x0~:H; x0:E;
   417   "[| is_vectorspace E; is_subspace H E; t:H; x0 ~: H; x0:E;
   414   x0 ~= <0> |] 
   418   x0 ~= <0> |] 
   415   ==> (SOME (y, a). t = y + a <*> x0 & y : H) = (t, 0r)";
   419   ==> (SOME (y, a). t = y + a <*> x0 & y : H) = (t, 0r)";
   416 proof (rule, unfold split_paired_all);
   420 proof (rule, unfold split_paired_all);
   417   assume "is_vectorspace E" "is_subspace H E" "t:H" "x0~:H" "x0:E"
   421   assume "is_vectorspace E" "is_subspace H E" "t:H" "x0 ~: H" "x0:E"
   418     "x0 ~= <0>";
   422     "x0 ~= <0>";
   419   have h: "is_vectorspace H"; ..;
   423   have h: "is_vectorspace H"; ..;
   420   fix y a; presume t1: "t = y + a <*> x0" and "y : H";
   424   fix y a; presume t1: "t = y + a <*> x0" and "y:H";
   421   have "y = t & a = 0r"; 
   425   have "y = t & a = 0r"; 
   422     by (rule decomp_H0) (assumption | (simp!))+;
   426     by (rule decomp_H0) (assumption | (simp!))+;
   423   thus "(y, a) = (t, 0r)"; by (simp!);
   427   thus "(y, a) = (t, 0r)"; by (simp!);
   424 qed (simp!)+;
   428 qed (simp!)+;
   425 
   429 
   426 text {* The components $y\in H$ and $a$ in $y \plus a \mult x_0$ 
   430 text {* The components $y\in H$ and $a$ in $y \plus a \mult x_0$ 
   427 are unique, so the function $h_0$ defined by 
   431 are unique, so the function $h_0$ defined by 
   428 $h_0 (y \plus a \mult x_0) = h y + a \cdot \xi$ is definite. *};
   432 $h_0 (y \plus a \mult x_0) = h y + a \cdot \xi$ is definite. *};
   429 
   433 
   430 lemma h0_definite:
   434 lemma h0_definite:
   431   "[| h0 = (\<lambda>x. let (y, a) = SOME (y, a). (x = y + a <*> x0 & y:H)
   435   "[| h0 == (\<lambda>x. let (y, a) = SOME (y, a). (x = y + a <*> x0 & y:H)
   432                 in (h y) + a * xi);
   436                 in (h y) + a * xi);
   433   x = y + a <*> x0; is_vectorspace E; is_subspace H E;
   437   x = y + a <*> x0; is_vectorspace E; is_subspace H E;
   434   y:H; x0 ~: H; x0:E; x0 ~= <0> |]
   438   y:H; x0 ~: H; x0:E; x0 ~= <0> |]
   435   ==> h0 x = h y + a * xi";
   439   ==> h0 x = h y + a * xi";
   436 proof -;  
   440 proof -;  
   437   assume 
   441   assume 
   438     "h0 = (\<lambda>x. let (y, a) = SOME (y, a). (x = y + a <*> x0 & y:H)
   442     "h0 == (\<lambda>x. let (y, a) = SOME (y, a). (x = y + a <*> x0 & y:H)
   439                in (h y) + a * xi)"
   443                in (h y) + a * xi)"
   440     "x = y + a <*> x0" "is_vectorspace E" "is_subspace H E"
   444     "x = y + a <*> x0" "is_vectorspace E" "is_subspace H E"
   441     "y:H" "x0 ~: H" "x0:E" "x0 ~= <0>";
   445     "y:H" "x0 ~: H" "x0:E" "x0 ~= <0>";
   442   have "x : H + (lin x0)"; 
   446   have "x : H + (lin x0)"; 
   443     by (simp! add: vs_sum_def lin_def) force+;
   447     by (simp! add: vs_sum_def lin_def) force+;
   444   have "EX! xa. ((\<lambda>(y, a). x = y + a <*> x0 & y:H) xa)"; 
   448   have "EX! xa. ((\<lambda>(y, a). x = y + a <*> x0 & y:H) xa)"; 
   445   proof;
   449   proof;
   446     show "EX xa. ((%(y, a). x = y + a <*> x0 & y:H) xa)";
   450     show "EX xa. ((\<lambda>(y, a). x = y + a <*> x0 & y:H) xa)";
   447       by (force!);
   451       by (force!);
   448   next;
   452   next;
   449     fix xa ya;
   453     fix xa ya;
   450     assume "(%(y,a). x = y + a <*> x0 & y : H) xa"
   454     assume "(\<lambda>(y,a). x = y + a <*> x0 & y : H) xa"
   451            "(%(y,a). x = y + a <*> x0 & y : H) ya";
   455            "(\<lambda>(y,a). x = y + a <*> x0 & y : H) ya";
   452     show "xa = ya"; ;
   456     show "xa = ya"; ;
   453     proof -;
   457     proof -;
   454       show "fst xa = fst ya & snd xa = snd ya ==> xa = ya"; 
   458       show "fst xa = fst ya & snd xa = snd ya ==> xa = ya"; 
   455         by (rule Pair_fst_snd_eq [RS iffD2]);
   459         by (rule Pair_fst_snd_eq [RS iffD2]);
   456       have x: "x = (fst xa) + (snd xa) <*> x0 & (fst xa) : H"; 
   460       have x: "x = fst xa + snd xa <*> x0 & fst xa : H"; 
   457         by (force!);
   461         by (force!);
   458       have y: "x = (fst ya) + (snd ya) <*> x0 & (fst ya) : H"; 
   462       have y: "x = fst ya + snd ya <*> x0 & fst ya : H"; 
   459         by (force!);
   463         by (force!);
   460       from x y; show "fst xa = fst ya & snd xa = snd ya"; 
   464       from x y; show "fst xa = fst ya & snd xa = snd ya"; 
   461         by (elim conjE) (rule decomp_H0, (simp!)+);
   465         by (elim conjE) (rule decomp_H0, (simp!)+);
   462     qed;
   466     qed;
   463   qed;
   467   qed;
   464   hence eq: "(SOME (y, a). (x = y + a <*> x0 & y:H)) = (y, a)"; 
   468   hence eq: "(SOME (y, a). x = y + a <*> x0 & y:H) = (y, a)"; 
   465     by (rule select1_equality) (force!);
   469     by (rule select1_equality) (force!);
   466   thus "h0 x = h y + a * xi"; by (simp! add: Let_def);
   470   thus "h0 x = h y + a * xi"; by (simp! add: Let_def);
   467 qed;
   471 qed;
   468 
   472 
   469 end;
   473 end;