HahnBanach update by Gertrud Bauer;
authorwenzelm
Fri Oct 22 20:14:31 1999 +0200 (1999-10-22)
changeset 79175e5b9813cce7
parent 7916 3cb310f40a3a
child 7918 2979b3b75dbd
HahnBanach update by Gertrud Bauer;
src/HOL/IsaMakefile
src/HOL/Real/HahnBanach/Aux.thy
src/HOL/Real/HahnBanach/Bounds.thy
src/HOL/Real/HahnBanach/FunctionNorm.thy
src/HOL/Real/HahnBanach/FunctionOrder.thy
src/HOL/Real/HahnBanach/HahnBanach.thy
src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy
src/HOL/Real/HahnBanach/HahnBanachSupLemmas.thy
src/HOL/Real/HahnBanach/HahnBanach_h0_lemmas.thy
src/HOL/Real/HahnBanach/HahnBanach_lemmas.thy
src/HOL/Real/HahnBanach/LinearSpace.thy
src/HOL/Real/HahnBanach/Linearform.thy
src/HOL/Real/HahnBanach/NormedSpace.thy
src/HOL/Real/HahnBanach/Subspace.thy
src/HOL/Real/HahnBanach/VectorSpace.thy
src/HOL/Real/HahnBanach/ZornLemma.thy
src/HOL/Real/HahnBanach/Zorn_Lemma.thy
src/HOL/Real/HahnBanach/document/notation.tex
src/HOL/Real/HahnBanach/document/root.tex
     1.1 --- a/src/HOL/IsaMakefile	Fri Oct 22 18:41:00 1999 +0200
     1.2 +++ b/src/HOL/IsaMakefile	Fri Oct 22 20:14:31 1999 +0200
     1.3 @@ -101,12 +101,12 @@
     1.4  $(LOG)/HOL-Real-HahnBanach.gz: $(OUT)/HOL-Real Real/HahnBanach/Aux.thy \
     1.5    Real/HahnBanach/Bounds.thy Real/HahnBanach/FunctionNorm.thy \
     1.6    Real/HahnBanach/FunctionOrder.thy Real/HahnBanach/HahnBanach.thy \
     1.7 -  Real/HahnBanach/HahnBanach_h0_lemmas.thy	\
     1.8 -  Real/HahnBanach/HahnBanach_lemmas.thy		\
     1.9 -  Real/HahnBanach/LinearSpace.thy Real/HahnBanach/Linearform.thy \
    1.10 -  Real/HahnBanach/NormedSpace.thy Real/HahnBanach/ROOT.ML \
    1.11 -  Real/HahnBanach/Subspace.thy Real/HahnBanach/Zorn_Lemma.thy \
    1.12 -  Real/HahnBanach/document/notation.tex		\
    1.13 +  Real/HahnBanach/HahnBanachExtLemmas.thy	\
    1.14 +  Real/HahnBanach/HahnBanachSupLemmas.thy	\
    1.15 +  Real/HahnBanach/Linearform.thy Real/HahnBanach/NormedSpace.thy \
    1.16 +  Real/HahnBanach/README.html Real/HahnBanach/ROOT.ML \
    1.17 +  Real/HahnBanach/Subspace.thy Real/HahnBanach/VectorSpace.thy \
    1.18 +  Real/HahnBanach/ZornLemma.thy Real/HahnBanach/document/notation.tex \
    1.19    Real/HahnBanach/document/root.tex
    1.20  	@cd Real; $(ISATOOL) usedir $(OUT)/HOL-Real HahnBanach
    1.21  
     2.1 --- a/src/HOL/Real/HahnBanach/Aux.thy	Fri Oct 22 18:41:00 1999 +0200
     2.2 +++ b/src/HOL/Real/HahnBanach/Aux.thy	Fri Oct 22 20:14:31 1999 +0200
     2.3 @@ -7,17 +7,42 @@
     2.4  
     2.5  theory Aux = Real + Zorn:;
     2.6  
     2.7 +text {* Some existing theorems are declared as extra introduction
     2.8 +or elimination rules, respectively. *};
     2.9 +
    2.10 +lemmas [intro!!] = isLub_isUb;
    2.11  lemmas [intro!!] = chainD; 
    2.12  lemmas chainE2 = chainD2 [elimify];
    2.13 -lemmas [intro!!] = isLub_isUb;
    2.14 +
    2.15 +text_raw {* \medskip *};
    2.16 +text{* Lemmas about sets: *};
    2.17 +
    2.18 +lemma Int_singletonD: "[| A Int B = {v}; x:A; x:B |] ==> x = v";
    2.19 +  by (fast elim: equalityE);
    2.20 +
    2.21 +lemma set_less_imp_diff_not_empty: "H < E ==> EX x0:E. x0 ~: H";
    2.22 + by (force simp add: psubset_eq);
    2.23 +
    2.24 +text_raw {* \medskip *};
    2.25 +text{* Some lemmas about orders: *};
    2.26  
    2.27 -theorem real_linear_split:
    2.28 - "[| x < a ==> Q; x = a ==> Q; a < (x::real) ==> Q |] ==> Q";
    2.29 -  by (rule real_linear [of x a, elimify], elim disjE, force+);
    2.30 +lemma lt_imp_not_eq: "x < (y::'a::order) ==> x ~= y"; 
    2.31 +  by (rule order_less_le[RS iffD1, RS conjunct2]);
    2.32 +
    2.33 +lemma le_noteq_imp_less: 
    2.34 +  "[| x <= (r::'a::order); x ~= r |] ==> x < r";
    2.35 +proof -;
    2.36 +  assume "x <= (r::'a::order)" and ne:"x ~= r";
    2.37 +  hence "x < r | x = r"; by (simp add: order_le_less);
    2.38 +  with ne; show ?thesis; by simp;
    2.39 +qed;
    2.40 +
    2.41 +text_raw {* \medskip *};
    2.42 +text {* Some lemmas about linear orders. *};
    2.43  
    2.44  theorem linorder_linear_split: 
    2.45  "[| x < a ==> Q; x = a ==> Q; a < (x::'a::linorder) ==> Q |] ==> Q";
    2.46 -  by (rule linorder_less_linear [of x a, elimify], elim disjE, force+);
    2.47 +  by (rule linorder_less_linear [of x a, elimify]) force+;
    2.48  
    2.49  lemma le_max1: "x <= max x (y::'a::linorder)";
    2.50    by (simp add: le_max_iff_disj[of x x y]);
    2.51 @@ -25,11 +50,8 @@
    2.52  lemma le_max2: "y <= max x (y::'a::linorder)"; 
    2.53    by (simp add: le_max_iff_disj[of y x y]);
    2.54  
    2.55 -lemma lt_imp_not_eq: "x < (y::'a::order) ==> x ~= y"; 
    2.56 -  by (rule order_less_le[RS iffD1, RS conjunct2]);
    2.57 -
    2.58 -lemma Int_singletonD: "[| A Int B = {v}; x:A; x:B |] ==> x = v";
    2.59 -  by (fast elim: equalityE);
    2.60 +text_raw {* \medskip *};
    2.61 +text{* Some lemmas for the reals. *};
    2.62  
    2.63  lemma real_add_minus_eq: "x - y = 0r ==> x = y";
    2.64  proof -;
    2.65 @@ -106,14 +128,6 @@
    2.66    finally; show ?thesis; .;
    2.67  qed;
    2.68  
    2.69 -lemma le_noteq_imp_less: 
    2.70 -  "[| x <= (r::'a::order); x ~= r |] ==> x < r";
    2.71 -proof -;
    2.72 -  assume "x <= (r::'a::order)" and ne:"x ~= r";
    2.73 -  then; have "x < r | x = r"; by (simp add: order_le_less);
    2.74 -  with ne; show ?thesis; by simp;
    2.75 -qed;
    2.76 -
    2.77  lemma real_minus_le: "- (x::real) <= y ==> - y <= x";
    2.78    by simp;
    2.79  
    2.80 @@ -121,7 +135,4 @@
    2.81    "(d::real) - b <= c + a ==> - a - b <= c - d";
    2.82    by simp;
    2.83  
    2.84 -lemma set_less_imp_diff_not_empty: "H < E ==> EX x0:E. x0 ~: H";
    2.85 - by (force simp add: psubset_eq);
    2.86 -
    2.87  end;
    2.88 \ No newline at end of file
     3.1 --- a/src/HOL/Real/HahnBanach/Bounds.thy	Fri Oct 22 18:41:00 1999 +0200
     3.2 +++ b/src/HOL/Real/HahnBanach/Bounds.thy	Fri Oct 22 20:14:31 1999 +0200
     3.3 @@ -7,18 +7,19 @@
     3.4  
     3.5  theory Bounds = Main + Real:;
     3.6  
     3.7 +text_raw {* \begin{comment} *};
     3.8  
     3.9  subsection {* The sets of lower and upper bounds *};
    3.10  
    3.11  constdefs
    3.12    is_LowerBound :: "('a::order) set => 'a set => 'a => bool"
    3.13 -  "is_LowerBound A B == %x. x:A & (ALL y:B. x <= y)"
    3.14 +  "is_LowerBound A B == \<lambda>x. x:A & (ALL y:B. x <= y)"
    3.15     
    3.16    LowerBounds :: "('a::order) set => 'a set => 'a set"
    3.17    "LowerBounds A B == Collect (is_LowerBound A B)"
    3.18  
    3.19    is_UpperBound :: "('a::order) set => 'a set => 'a => bool"
    3.20 -  "is_UpperBound A B == %x. x:A & (ALL y:B. y <= x)"
    3.21 +  "is_UpperBound A B == \<lambda>x. x:A & (ALL y:B. y <= x)"
    3.22   
    3.23    UpperBounds :: "('a::order) set => 'a set => 'a set"
    3.24    "UpperBounds A B == Collect (is_UpperBound A B)";
    3.25 @@ -34,9 +35,9 @@
    3.26      ("(3LOWER'_BOUNDS _./ _)" 10);
    3.27  
    3.28  translations
    3.29 -  "UPPER_BOUNDS x:A. P" == "UpperBounds A (Collect (%x. P))"
    3.30 +  "UPPER_BOUNDS x:A. P" == "UpperBounds A (Collect (\<lambda>x. P))"
    3.31    "UPPER_BOUNDS x. P" == "UPPER_BOUNDS x:UNIV. P"
    3.32 -  "LOWER_BOUNDS x:A. P" == "LowerBounds A (Collect (%x. P))"
    3.33 +  "LOWER_BOUNDS x:A. P" == "LowerBounds A (Collect (\<lambda>x. P))"
    3.34    "LOWER_BOUNDS x. P" == "LOWER_BOUNDS x:UNIV. P";
    3.35  
    3.36  
    3.37 @@ -68,42 +69,67 @@
    3.38  
    3.39  subsection {* Infimum and Supremum *};
    3.40  
    3.41 +text_raw {* \end{comment} *};
    3.42 +
    3.43 +text {* A supremum of an ordered set $B$ w.~r.~t.~$A$ 
    3.44 +is defined as a least upperbound of $B$, which lies in $A$.
    3.45 +The definition of the supremum is based on the
    3.46 +existing definition (see HOL/Real/Lubs.thy).*};
    3.47 +   
    3.48 +text{* If a supremum exists, then $\idt{Sup}\ap A\ap B$
    3.49 +is equal to the supremum. *};
    3.50 +
    3.51  constdefs
    3.52    is_Sup :: "('a::order) set => 'a set => 'a => bool"
    3.53    "is_Sup A B x == isLub A B x"
    3.54 -   
    3.55 +
    3.56    Sup :: "('a::order) set => 'a set => 'a"
    3.57 -  "Sup A B == Eps (is_Sup A B)"
    3.58 +  "Sup A B == Eps (is_Sup A B)";
    3.59 +;
    3.60 +text_raw {* \begin{comment} *};
    3.61  
    3.62 -  is_Inf :: "('a::order) set => 'a set => 'a => bool"  
    3.63 +constdefs
    3.64 +  is_Inf :: "('a::order) set => 'a set => 'a => bool"
    3.65    "is_Inf A B x == x:A & is_Greatest (LowerBounds A B) x"
    3.66  
    3.67    Inf :: "('a::order) set => 'a set => 'a"
    3.68    "Inf A B == Eps (is_Inf A B)";
    3.69  
    3.70  syntax
    3.71 -  "_SUP" :: "[pttrn, 'a set, 'a => bool] => 'a set"     
    3.72 +  "_SUP" :: "[pttrn, 'a set, 'a => bool] => 'a set"
    3.73      ("(3SUP _:_./ _)" 10)
    3.74 -  "_SUP_U" :: "[pttrn, 'a => bool] => 'a set"           
    3.75 +  "_SUP_U" :: "[pttrn, 'a => bool] => 'a set"
    3.76      ("(3SUP _./ _)" 10)
    3.77 -  "_INF" :: "[pttrn, 'a set, 'a => bool] => 'a set"     
    3.78 +  "_INF" :: "[pttrn, 'a set, 'a => bool] => 'a set"
    3.79      ("(3INF _:_./ _)" 10)
    3.80 -  "_INF_U" :: "[pttrn, 'a => bool] => 'a set"           
    3.81 +  "_INF_U" :: "[pttrn, 'a => bool] => 'a set"
    3.82      ("(3INF _./ _)" 10);
    3.83  
    3.84  translations
    3.85 -  "SUP x:A. P" == "Sup A (Collect (%x. P))"
    3.86 +  "SUP x:A. P" == "Sup A (Collect (\<lambda>x. P))"
    3.87    "SUP x. P" == "SUP x:UNIV. P"
    3.88 -  "INF x:A. P" == "Inf A (Collect (%x. P))"
    3.89 +  "INF x:A. P" == "Inf A (Collect (\<lambda>x. P))"
    3.90    "INF x. P" == "INF x:UNIV. P";
    3.91  
    3.92 +text_raw {* \end{comment} *};
    3.93 +;
    3.94 +
    3.95 +text{* The supremum of $B$ is less than every upper bound
    3.96 +of $B$.*};
    3.97 +
    3.98  lemma sup_le_ub: "isUb A B y ==> is_Sup A B s ==> s <= y";
    3.99    by (unfold is_Sup_def, rule isLub_le_isUb);
   3.100  
   3.101 +text {* The supremum $B$ is an upperbound for $B$. *};
   3.102 +
   3.103  lemma sup_ub: "y:B ==> is_Sup A B s ==> y <= s";
   3.104    by (unfold is_Sup_def, rule isLubD2);
   3.105  
   3.106 -lemma sup_ub1: "ALL y:B. a <= y ==> is_Sup A B s ==> x:B ==> a <= s";
   3.107 +text{* The supremum of a non-empty set $B$ is greater
   3.108 +than a lower bound of $B$. *};
   3.109 +
   3.110 +lemma sup_ub1: 
   3.111 +  "[| ALL y:B. a <= y; is_Sup A B s; x:B |] ==> a <= s";
   3.112  proof -; 
   3.113    assume "ALL y:B. a <= y" "is_Sup A B s" "x:B";
   3.114    have "a <= x"; by (rule bspec);
     4.1 --- a/src/HOL/Real/HahnBanach/FunctionNorm.thy	Fri Oct 22 18:41:00 1999 +0200
     4.2 +++ b/src/HOL/Real/HahnBanach/FunctionNorm.thy	Fri Oct 22 20:14:31 1999 +0200
     4.3 @@ -7,13 +7,23 @@
     4.4  
     4.5  theory FunctionNorm = NormedSpace + FunctionOrder:;
     4.6  
     4.7 +subsection {* Continous linearforms*};
     4.8 +
     4.9 +text{* A linearform $f$ on a normed vector space $(V, \norm{\cdot})$
    4.10 +is \emph{continous}, iff it is bounded, i.~e.
    4.11 +\[\exists\ap c\in R.\ap \forall\ap x\in V.\ap 
    4.12 +|f\ap x| \leq c \cdot \norm x.\]
    4.13 +In our application no other functions than linearforms are considered,
    4.14 +so we can define continous linearforms as follows:
    4.15 +*};
    4.16  
    4.17  constdefs
    4.18 -  is_continous :: "['a set, 'a => real, 'a => real] => bool" 
    4.19 +  is_continous ::
    4.20 +  "['a::{minus, plus} set, 'a => real, 'a => real] => bool" 
    4.21    "is_continous V norm f == 
    4.22 -    (is_linearform V f & (EX c. ALL x:V. rabs (f x) <= c * norm x))";
    4.23 +    is_linearform V f & (EX c. ALL x:V. rabs (f x) <= c * norm x)";
    4.24  
    4.25 -lemma lipschitz_continousI [intro]: 
    4.26 +lemma continousI [intro]: 
    4.27    "[| is_linearform V f; !! x. x:V ==> rabs (f x) <= c * norm x |] 
    4.28    ==> is_continous V norm f";
    4.29  proof (unfold is_continous_def, intro exI conjI ballI);
    4.30 @@ -26,173 +36,283 @@
    4.31    by (unfold is_continous_def) force;
    4.32  
    4.33  lemma continous_bounded [intro!!]:
    4.34 -  "is_continous V norm f ==> EX c. ALL x:V. rabs (f x) <= c * norm x";
    4.35 +  "is_continous V norm f 
    4.36 +  ==> EX c. ALL x:V. rabs (f x) <= c * norm x";
    4.37    by (unfold is_continous_def) force;
    4.38  
    4.39 +subsection{* The norm of a linearform *};
    4.40 +
    4.41 +
    4.42 +text{* The least real number $c$ for which holds
    4.43 +\[\forall\ap x\in V.\ap |f\ap x| \leq c \cdot \norm x\]
    4.44 +is called the \emph{norm} of $f$.
    4.45 +
    4.46 +For the non-trivial vector space $V$ the norm can be defined as 
    4.47 +\[\fnorm {f} =\sup_{x\neq\zero}\frac{|f\ap x|}{\norm x}. \] 
    4.48 +
    4.49 +For the case that the vector space $V$ contains only the zero vector 
    4.50 +set, the set $B$ this supremum is taken from would be empty, and any 
    4.51 +real number is a supremum of $B$. So it must be guarateed that there 
    4.52 +is an element in $B$. This element must be greater or equal $0$ so 
    4.53 +that $\idt{function{\dsh}norm}$ has the norm properties. Furthermore 
    4.54 +it does not have to change the norm in all other cases, so it must be
    4.55 +$0$, as all other elements of $B$ are greater or equal $0$.
    4.56 +
    4.57 +Thus $B$ is defined as follows.
    4.58 +*};
    4.59 +
    4.60  constdefs
    4.61 -  B:: "[ 'a set, 'a => real, 'a => real ] => real set"
    4.62 +  B :: "[ 'a set, 'a => real, 'a => real ] => real set"
    4.63    "B V norm f == 
    4.64 -    {z. z = 0r | (EX x:V. x ~= <0> & z = rabs (f x) * rinv (norm (x)))}";
    4.65 +  {z. z = 0r | (EX x:V. x ~= <0> & z = rabs (f x) * rinv (norm x))}";
    4.66 +
    4.67 +text{* $\idt{function{\dsh}norm}$ is equal to the supremum of $B$, 
    4.68 +if there exists a supremum. *};
    4.69  
    4.70  constdefs 
    4.71    function_norm :: " ['a set, 'a => real, 'a => real] => real"
    4.72 -  "function_norm V norm f == 
    4.73 -     Sup UNIV (B V norm f)";
    4.74 +  "function_norm V norm f == Sup UNIV (B V norm f)";
    4.75 +
    4.76 +text{* $\idt{is{\dsh}function{\dsh}norm}$ also guarantees that there 
    4.77 +is a funciton norm .*};
    4.78  
    4.79  constdefs 
    4.80 -  is_function_norm :: " ['a set, 'a => real, 'a => real] => real => bool"
    4.81 -  "is_function_norm V norm f fn == 
    4.82 -     is_Sup UNIV (B V norm f) fn";
    4.83 +  is_function_norm :: 
    4.84 +  " ['a set, 'a => real, 'a => real] => real => bool"
    4.85 +  "is_function_norm V norm f fn == is_Sup UNIV (B V norm f) fn";
    4.86  
    4.87  lemma B_not_empty: "0r : B V norm f";
    4.88    by (unfold B_def, force);
    4.89  
    4.90 +text {* The following lemma states every continous linearform on a 
    4.91 +normed space $(V, \norm{\cdot})$ has a function norm. *};
    4.92 +
    4.93  lemma ex_fnorm [intro!!]: 
    4.94    "[| is_normed_vectorspace V norm; is_continous V norm f|]
    4.95       ==> is_function_norm V norm f (function_norm V norm f)"; 
    4.96 -proof (unfold function_norm_def is_function_norm_def is_continous_def 
    4.97 -       Sup_def, elim conjE, rule selectI2EX);
    4.98 +proof (unfold function_norm_def is_function_norm_def 
    4.99 +  is_continous_def Sup_def, elim conjE, rule selectI2EX);
   4.100    assume "is_normed_vectorspace V norm";
   4.101    assume "is_linearform V f" 
   4.102    and e: "EX c. ALL x:V. rabs (f x) <= c * norm x";
   4.103 +
   4.104 +  txt {* The existence of the supremum is shown using the 
   4.105 +  completeness of the reals. Completeness means, that
   4.106 +  for every non-empty and bounded set of reals there exists a 
   4.107 +  supremum. *};
   4.108    show  "EX a. is_Sup UNIV (B V norm f) a"; 
   4.109    proof (unfold is_Sup_def, rule reals_complete);
   4.110 +
   4.111 +    txt {* First we have to show that $B$ is non-empty. *}; 
   4.112 +
   4.113      show "EX X. X : B V norm f"; 
   4.114      proof (intro exI);
   4.115        show "0r : (B V norm f)"; by (unfold B_def, force);
   4.116      qed;
   4.117  
   4.118 +    txt {* Then we have to show that $B$ is bounded. *};
   4.119 +
   4.120      from e; show "EX Y. isUb UNIV (B V norm f) Y";
   4.121      proof;
   4.122 +
   4.123 +      txt {* We know that $f$ is bounded by some value $c$. *};  
   4.124 +  
   4.125        fix c; assume a: "ALL x:V. rabs (f x) <= c * norm x";
   4.126        def b == "max c 0r";
   4.127  
   4.128 -      show "EX Y. isUb UNIV (B V norm f) Y";
   4.129 +      show "?thesis";
   4.130        proof (intro exI isUbI setleI ballI, unfold B_def, 
   4.131  	elim CollectE disjE bexE conjE);
   4.132 -	fix x y; assume "x:V" "x ~= <0>" "y = rabs (f x) * rinv (norm x)";
   4.133 -        from a; have le: "rabs (f x) <= c * norm x"; ..;
   4.134 -        have "y = rabs (f x) * rinv (norm x)";.;
   4.135 -        also; from _  le; have "... <= c * norm x * rinv (norm x)";
   4.136 -        proof (rule real_mult_le_le_mono2);
   4.137 -          show "0r <= rinv (norm x)";
   4.138 +
   4.139 +        txt{* To proof the thesis, we have to show that there is 
   4.140 +        some constant b, which is greater than every $y$ in $B$. 
   4.141 +        Due to the definition of $B$ there are two cases for
   4.142 +        $y\in B$. If $y = 0$ then $y$ is less than 
   4.143 +        $\idt{max}\ap c\ap 0$: *};
   4.144 +
   4.145 +	fix y; assume "y = 0r";
   4.146 +        show "y <= b"; by (simp! add: le_max2);
   4.147 +
   4.148 +        txt{* The second case is 
   4.149 +        $y = \frac{|f\ap x|}{\norm x}$ for some 
   4.150 +        $x\in V$ with $x \neq \zero$. *};
   4.151 +
   4.152 +      next;
   4.153 +	fix x y;
   4.154 +        assume "x:V" "x ~= <0>"; (***
   4.155 +
   4.156 +         have ge: "0r <= rinv (norm x)";
   4.157 +          by (rule real_less_imp_le, rule real_rinv_gt_zero, 
   4.158 +                rule normed_vs_norm_gt_zero); (***
   4.159            proof (rule real_less_imp_le);
   4.160              show "0r < rinv (norm x)";
   4.161              proof (rule real_rinv_gt_zero);
   4.162                show "0r < norm x"; ..;
   4.163              qed;
   4.164 -          qed;  (*** or:
   4.165 -          by (rule real_less_imp_le, rule real_rinv_gt_zero, 
   4.166 -              rule normed_vs_norm_gt_zero); ***)
   4.167 +          qed; ***)
   4.168 +        have nz: "norm x ~= 0r"; 
   4.169 +          by (rule not_sym, rule lt_imp_not_eq, 
   4.170 +              rule normed_vs_norm_gt_zero); (***
   4.171 +          proof (rule not_sym);
   4.172 +            show "0r ~= norm x"; 
   4.173 +            proof (rule lt_imp_not_eq);
   4.174 +              show "0r < norm x"; ..;
   4.175 +            qed;
   4.176 +          qed; ***)***)
   4.177 +
   4.178 +        txt {* The thesis follows by a short calculation using the 
   4.179 +        fact that $f$ is bounded. *};
   4.180 +    
   4.181 +        assume "y = rabs (f x) * rinv (norm x)";
   4.182 +        also; have "... <= c * norm x * rinv (norm x)";
   4.183 +        proof (rule real_mult_le_le_mono2);
   4.184 +          show "0r <= rinv (norm x)";
   4.185 +            by (rule real_less_imp_le, rule real_rinv_gt_zero, 
   4.186 +                rule normed_vs_norm_gt_zero);
   4.187 +          from a; show "rabs (f x) <= c * norm x"; ..;
   4.188          qed;
   4.189          also; have "... = c * (norm x * rinv (norm x))"; 
   4.190            by (rule real_mult_assoc);
   4.191          also; have "(norm x * rinv (norm x)) = 1r"; 
   4.192          proof (rule real_mult_inv_right);
   4.193 -          show "norm x ~= 0r"; 
   4.194 -          proof (rule not_sym);
   4.195 -            show "0r ~= norm x"; 
   4.196 -            proof (rule lt_imp_not_eq);
   4.197 -              show "0r < norm x"; ..;
   4.198 -            qed;
   4.199 -          qed; (*** or:  
   4.200 -          by (rule not_sym, rule lt_imp_not_eq, 
   4.201 -              rule normed_vs_norm_gt_zero); ***)
   4.202 +          show nz: "norm x ~= 0r"; 
   4.203 +            by (rule not_sym, rule lt_imp_not_eq, 
   4.204 +              rule normed_vs_norm_gt_zero);
   4.205          qed;
   4.206 -        also; have "c * ... = c"; by (simp!);
   4.207 -        also; have "... <= b"; by (simp! add: le_max1);
   4.208 +        also; have "c * ... <= b "; by (simp! add: le_max1);
   4.209  	finally; show "y <= b"; .;
   4.210 -      next; 
   4.211 -	fix y; assume "y = 0r"; show "y <= b"; by (simp! add: le_max2);
   4.212        qed simp;
   4.213      qed;
   4.214    qed;
   4.215  qed;
   4.216  
   4.217 +text {* The norm of a continous function is always $\geq 0$. *};
   4.218 +
   4.219  lemma fnorm_ge_zero [intro!!]: 
   4.220    "[| is_continous V norm f; is_normed_vectorspace V norm|]
   4.221     ==> 0r <= function_norm V norm f";
   4.222  proof -;
   4.223 -  assume c: "is_continous V norm f" and n: "is_normed_vectorspace V norm";
   4.224 -  have "is_function_norm V norm f (function_norm V norm f)"; ..;
   4.225 -  hence s: "is_Sup UNIV (B V norm f) (function_norm V norm f)"; 
   4.226 -    by (simp add: is_function_norm_def);
   4.227 +  assume c: "is_continous V norm f" 
   4.228 +     and n: "is_normed_vectorspace V norm";
   4.229 +
   4.230 +  txt {* The function norm is defined as the supremum of $B$. 
   4.231 +  So it is $\geq 0$ if all elements in $B$ are $\geq 0$, provided
   4.232 +  the supremum exists and $B$ is not empty. *};
   4.233 +
   4.234    show ?thesis; 
   4.235    proof (unfold function_norm_def, rule sup_ub1);
   4.236      show "ALL x:(B V norm f). 0r <= x"; 
   4.237 -    proof (intro ballI, unfold B_def, elim CollectE bexE conjE disjE);
   4.238 -      fix x r; assume "x : V" "x ~= <0>" 
   4.239 -        "r = rabs (f x) * rinv (norm x)"; 
   4.240 -      show  "0r <= r";
   4.241 -      proof (simp!, rule real_le_mult_order);
   4.242 -        show "0r <= rabs (f x)"; by (simp! only: rabs_ge_zero);
   4.243 -        show "0r <= rinv (norm x)";
   4.244 +    proof (intro ballI, unfold B_def, 
   4.245 +           elim CollectE bexE conjE disjE);
   4.246 +      fix x r; 
   4.247 +      assume "x : V" "x ~= <0>" 
   4.248 +        and r: "r = rabs (f x) * rinv (norm x)";
   4.249 +
   4.250 +      have ge: "0r <= rabs (f x)"; by (simp! only: rabs_ge_zero);
   4.251 +      have "0r <= rinv (norm x)"; 
   4.252 +        by (rule real_less_imp_le, rule real_rinv_gt_zero, rule);(***
   4.253          proof (rule real_less_imp_le);
   4.254            show "0r < rinv (norm x)"; 
   4.255            proof (rule real_rinv_gt_zero);
   4.256              show "0r < norm x"; ..;
   4.257            qed;
   4.258 -        qed;
   4.259 -      qed;
   4.260 +        qed; ***)
   4.261 +      with ge; show "0r <= r";
   4.262 +       by (simp only: r,rule real_le_mult_order);
   4.263      qed (simp!);
   4.264 -    from ex_fnorm [OF n c]; 
   4.265 -    show "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))"; 
   4.266 -      by (simp! add: is_function_norm_def function_norm_def); 
   4.267 +
   4.268 +    txt {* Since $f$ is continous the function norm exists. *};
   4.269 +
   4.270 +    have "is_function_norm V norm f (function_norm V norm f)"; ..;
   4.271 +    thus "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))"; 
   4.272 +      by (unfold is_function_norm_def, unfold function_norm_def);
   4.273 +
   4.274 +    txt {* $B$ is non-empty by construction. *};
   4.275 +
   4.276      show "0r : B V norm f"; by (rule B_not_empty);
   4.277    qed;
   4.278  qed;
   4.279    
   4.280 +text{* The basic property of function norms is: 
   4.281 +\begin{matharray}{l}
   4.282 +| f\ap x | \leq {\fnorm {f}} \cdot {\norm x}  
   4.283 +\end{matharray}
   4.284 +*};
   4.285 +
   4.286  lemma norm_fx_le_norm_f_norm_x: 
   4.287    "[| is_normed_vectorspace V norm; x:V; is_continous V norm f |] 
   4.288      ==> rabs (f x) <= (function_norm V norm f) * norm x"; 
   4.289  proof -; 
   4.290 -  assume "is_normed_vectorspace V norm" "x:V" and c: "is_continous V norm f";
   4.291 +  assume "is_normed_vectorspace V norm" "x:V" 
   4.292 +  and c: "is_continous V norm f";
   4.293    have v: "is_vectorspace V"; ..;
   4.294    assume "x:V";
   4.295 +
   4.296 + txt{* The proof is by case analysis on $x$. *};
   4.297 + 
   4.298    show "?thesis";
   4.299 -  proof (rule case_split [of "x = <0>"]);
   4.300 +  proof (rule case_split);
   4.301 +
   4.302 +    txt {* For the case $x = \zero$ the thesis follows
   4.303 +    from the linearity of $f$: for every linear function
   4.304 +    holds $f\ap \zero = 0$. *};
   4.305 +
   4.306 +    assume "x = <0>";
   4.307 +    have "rabs (f x) = rabs (f <0>)"; by (simp!);
   4.308 +    also; from v continous_linearform; have "f <0> = 0r"; ..;
   4.309 +    also; note rabs_zero;
   4.310 +    also; have "0r <= function_norm V norm f * norm x";
   4.311 +    proof (rule real_le_mult_order);
   4.312 +      show "0r <= function_norm V norm f"; ..;
   4.313 +      show "0r <= norm x"; ..;
   4.314 +    qed;
   4.315 +    finally; 
   4.316 +    show "rabs (f x) <= function_norm V norm f * norm x"; .;
   4.317 +
   4.318 +  next;
   4.319      assume "x ~= <0>";
   4.320 -    show "?thesis";
   4.321 -    proof -;
   4.322 -      have n: "0r <= norm x"; ..;
   4.323 -      have le: "rabs (f x) * rinv (norm x) <= function_norm V norm f"; 
   4.324 -        proof (unfold function_norm_def, rule sup_ub);
   4.325 -          from ex_fnorm [OF _ c]; show "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))"; 
   4.326 -             by (simp! add: is_function_norm_def function_norm_def); 
   4.327 -          show "rabs (f x) * rinv (norm x) : B V norm f"; 
   4.328 -            by (unfold B_def, intro CollectI disjI2 bexI [of _ x] conjI, simp);
   4.329 -        qed;
   4.330 -      have "rabs (f x) = rabs (f x) * 1r"; by (simp!);
   4.331 -      also; have "1r = rinv (norm x) * norm x"; 
   4.332 -      proof (rule real_mult_inv_left [RS sym]);
   4.333 -        show "norm x ~= 0r";
   4.334 -        proof (rule lt_imp_not_eq[RS not_sym]);
   4.335 -          show "0r < norm x"; ..;
   4.336 -        qed;
   4.337 -      qed;
   4.338 -      also; have "rabs (f x) * ... = rabs (f x) * rinv (norm x) * norm x"; 
   4.339 -        by (simp! add: real_mult_assoc [of "rabs (f x)"]);
   4.340 -      also; have "rabs (f x) * rinv (norm x) * norm x <= function_norm V norm f * norm x"; 
   4.341 -        by (rule real_mult_le_le_mono2 [OF n le]);
   4.342 -      finally; show "rabs (f x) <= function_norm V norm f * norm x"; .;
   4.343 +    have n: "0r <= norm x"; ..;
   4.344 +    have nz: "norm x ~= 0r";
   4.345 +    proof (rule lt_imp_not_eq [RS not_sym]);
   4.346 +      show "0r < norm x"; ..;
   4.347      qed;
   4.348 -  next; 
   4.349 -    assume "x = <0>";
   4.350 -    then; show "?thesis";
   4.351 -    proof -;
   4.352 -      have "rabs (f x) = rabs (f <0>)"; by (simp!);
   4.353 -      also; from v continous_linearform; have "f <0> = 0r"; ..;
   4.354 -      also; note rabs_zero;
   4.355 -      also; have" 0r <= function_norm V norm f * norm x";
   4.356 -      proof (rule real_le_mult_order);
   4.357 -        show "0r <= function_norm V norm f"; ..;
   4.358 -        show "0r <= norm x"; ..;
   4.359 -      qed;
   4.360 -      finally; show "rabs (f x) <= function_norm V norm f * norm x"; .;
   4.361 +
   4.362 +    txt {* For the case $x\neq \zero$ we derive the following
   4.363 +    fact from the definition of the function norm:*};
   4.364 +
   4.365 +    have l: "rabs (f x) * rinv (norm x) <= function_norm V norm f";
   4.366 +    proof (unfold function_norm_def, rule sup_ub);
   4.367 +      from ex_fnorm [OF _ c];
   4.368 +      show "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))";
   4.369 +         by (simp! add: is_function_norm_def function_norm_def);
   4.370 +      show "rabs (f x) * rinv (norm x) : B V norm f"; 
   4.371 +        by (unfold B_def, intro CollectI disjI2 bexI [of _ x]
   4.372 +            conjI, simp);
   4.373      qed;
   4.374 +
   4.375 +    txt {* The thesis follows by a short calculation: *};
   4.376 +
   4.377 +    have "rabs (f x) = rabs (f x) * 1r"; by (simp!);
   4.378 +    also; from nz; have "1r = rinv (norm x) * norm x"; 
   4.379 +      by (rule real_mult_inv_left [RS sym]);
   4.380 +    also; 
   4.381 +    have "rabs (f x) * ... = rabs (f x) * rinv (norm x) * norm x";
   4.382 +      by (simp! add: real_mult_assoc [of "rabs (f x)"]);
   4.383 +    also; have "... <= function_norm V norm f * norm x"; 
   4.384 +      by (rule real_mult_le_le_mono2 [OF n l]);
   4.385 +    finally; 
   4.386 +    show "rabs (f x) <= function_norm V norm f * norm x"; .;
   4.387    qed;
   4.388  qed;
   4.389  
   4.390 +text{* The function norm is the least positive real number for 
   4.391 +which the inequation
   4.392 +\begin{matharray}{l}
   4.393 +| f\ap x | \leq c \cdot {\norm x}  
   4.394 +\end{matharray} 
   4.395 +holds.
   4.396 +*};
   4.397 +
   4.398  lemma fnorm_le_ub: 
   4.399    "[| is_normed_vectorspace V norm; is_continous V norm f;
   4.400       ALL x:V. rabs (f x) <= c * norm x; 0r <= c |]
   4.401 @@ -202,42 +322,62 @@
   4.402    assume c: "is_continous V norm f";
   4.403    assume fb: "ALL x:V. rabs (f x) <= c * norm x"
   4.404           and "0r <= c";
   4.405 +
   4.406 +  txt {* Suppose the inequation holds for some $c\geq 0$.
   4.407 +  If $c$ is an upper bound of $B$, then $c$ is greater 
   4.408 +  than the function norm since the function norm is the
   4.409 +  least upper bound.
   4.410 +  *};
   4.411 +
   4.412    show "Sup UNIV (B V norm f) <= c"; 
   4.413    proof (rule sup_le_ub);
   4.414      from ex_fnorm [OF _ c]; 
   4.415      show "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))"; 
   4.416        by (simp! add: is_function_norm_def function_norm_def); 
   4.417 +  
   4.418 +    txt {* $c$ is an upper bound of $B$, i.~e.~every
   4.419 +    $y\in B$ is less than $c$. *};
   4.420 +
   4.421      show "isUb UNIV (B V norm f) c";  
   4.422      proof (intro isUbI setleI ballI);
   4.423        fix y; assume "y: B V norm f";
   4.424        thus le: "y <= c";
   4.425 -      proof (unfold B_def, elim CollectE disjE bexE);
   4.426 -	fix x; assume Px: "x ~= <0> & y = rabs (f x) * rinv (norm x)";
   4.427 -	assume x: "x : V";
   4.428 -        have lt: "0r < norm x";  by (simp! add: normed_vs_norm_gt_zero);
   4.429 +      proof (unfold B_def, elim CollectE disjE bexE conjE);
   4.430 +
   4.431 +       txt {* The first case for $y\in B$ is $y=0$. *};
   4.432 +
   4.433 +        assume "y = 0r";
   4.434 +        show "y <= c"; by (force!);
   4.435 +
   4.436 +        txt{* The second case is 
   4.437 +        $y = \frac{|f\ap x|}{\norm x}$ for some 
   4.438 +        $x\in V$ with $x \neq \zero$. *};  
   4.439 +
   4.440 +      next;
   4.441 +	fix x; 
   4.442 +        assume "x : V" "x ~= <0>"; 
   4.443 +
   4.444 +        have lz: "0r < norm x"; 
   4.445 +          by (simp! add: normed_vs_norm_gt_zero);
   4.446            
   4.447 -        have neq: "norm x ~= 0r"; 
   4.448 +        have nz: "norm x ~= 0r"; 
   4.449          proof (rule not_sym);
   4.450 -          from lt; show "0r ~= norm x";
   4.451 -          by (simp! add: order_less_imp_not_eq);
   4.452 +          from lz; show "0r ~= norm x";
   4.453 +            by (simp! add: order_less_imp_not_eq);
   4.454          qed;
   4.455              
   4.456 -	from lt; have "0r < rinv (norm x)";
   4.457 +	from lz; have "0r < rinv (norm x)";
   4.458  	  by (simp! add: real_rinv_gt_zero);
   4.459 -	then; have inv_leq: "0r <= rinv (norm x)";
   4.460 +	hence rinv_gez: "0r <= rinv (norm x)";
   4.461            by (rule real_less_imp_le);
   4.462  
   4.463 -	from Px; have "y = rabs (f x) * rinv (norm x)"; ..;
   4.464 -	also; from inv_leq; have "... <= c * norm x * rinv (norm x)";
   4.465 +	assume "y = rabs (f x) * rinv (norm x)"; 
   4.466 +	also; from rinv_gez; have "... <= c * norm x * rinv (norm x)";
   4.467  	  proof (rule real_mult_le_le_mono2);
   4.468 -	    from fb x; show "rabs (f x) <= c * norm x"; ..;
   4.469 +	    show "rabs (f x) <= c * norm x"; by (rule bspec);
   4.470  	  qed;
   4.471 -	also; have "... <= c";
   4.472 -	  by (simp add: neq real_mult_assoc);
   4.473 +	also; have "... <= c"; by (simp add: nz real_mult_assoc);
   4.474  	finally; show ?thesis; .;
   4.475 -      next;
   4.476 -        assume "y = 0r";
   4.477 -        show "y <= c"; by (force!);
   4.478        qed;
   4.479      qed force;
   4.480    qed;
     5.1 --- a/src/HOL/Real/HahnBanach/FunctionOrder.thy	Fri Oct 22 18:41:00 1999 +0200
     5.2 +++ b/src/HOL/Real/HahnBanach/FunctionOrder.thy	Fri Oct 22 20:14:31 1999 +0200
     5.3 @@ -3,28 +3,29 @@
     5.4      Author:     Gertrud Bauer, TU Munich
     5.5  *)
     5.6  
     5.7 -header {* An Order on Functions *};
     5.8 +header {* An Order on functions *};
     5.9  
    5.10  theory FunctionOrder = Subspace + Linearform:;
    5.11  
    5.12  
    5.13 -
    5.14 -subsection {* The graph of a function *}
    5.15 +subsection {* The graph of a function *};
    5.16  
    5.17 +text{* We define the \emph{graph} of a (real) function $f$ with the 
    5.18 +domain $F$ as the set 
    5.19 +\begin{matharray}{l}
    5.20 +\{(x, f\ap x). \ap x:F\}.
    5.21 +\end{matharray}
    5.22 +So we are modelling partial functions by specifying the domain and 
    5.23 +the mapping function. We use the notion 'function' also for the graph
    5.24 +of a function. 
    5.25 +*};
    5.26  
    5.27 -types 'a graph = "('a * real) set";
    5.28 +types 'a graph = "('a::{minus, plus} * real) set";
    5.29  
    5.30  constdefs
    5.31    graph :: "['a set, 'a => real] => 'a graph "
    5.32 -  "graph F f == {p. EX x. p = (x, f x) & x:F}"; (* == {(x, f x). x:F} *)
    5.33 -
    5.34 -constdefs
    5.35 -  domain :: "'a graph => 'a set" 
    5.36 -  "domain g == {x. EX y. (x, y):g}";
    5.37 -
    5.38 -constdefs
    5.39 -  funct :: "'a graph => ('a => real)"
    5.40 -  "funct g == %x. (@ y. (x, y):g)";
    5.41 +  "graph F f == {p. EX x. p = (x, f x) & x:F}"; (* 
    5.42 +   == {(x, f x). x:F} *)
    5.43  
    5.44  lemma graphI [intro!!]: "x:F ==> (x, f x) : graph F f";
    5.45    by (unfold graph_def, intro CollectI exI) force;
    5.46 @@ -38,16 +39,46 @@
    5.47  lemma graphD2 [intro!!]: "(x, y): graph H h ==> y = h x";
    5.48    by (unfold graph_def, elim CollectE exE) force; 
    5.49  
    5.50 +subsection {* Functions ordered by domain extension *};
    5.51 +
    5.52 +text{* The function $h'$ is an extension of $h$, iff the graph of 
    5.53 +$h$ is a subset of the graph of $h'$.*};
    5.54 +
    5.55 +lemma graph_extI: 
    5.56 +  "[| !! x. x: H ==> h x = h' x; H <= H'|]
    5.57 +  ==> graph H h <= graph H' h'";
    5.58 +  by (unfold graph_def, force);
    5.59 +
    5.60  lemma graph_extD1 [intro!!]: 
    5.61    "[| graph H h <= graph H' h'; x:H |] ==> h x = h' x";
    5.62    by (unfold graph_def, force);
    5.63  
    5.64 -lemma graph_extD2 [intro!!]: "[| graph H h <= graph H' h' |] ==> H <= H'";
    5.65 +lemma graph_extD2 [intro!!]: 
    5.66 +  "[| graph H h <= graph H' h' |] ==> H <= H'";
    5.67    by (unfold graph_def, force);
    5.68  
    5.69 -lemma graph_extI: 
    5.70 -  "[| !! x. x: H ==> h x = h' x; H <= H'|] ==> graph H h <= graph H' h'";
    5.71 -  by (unfold graph_def, force);
    5.72 +subsection {* Domain and function of a graph *};
    5.73 +
    5.74 +text{* The inverse functions to $\idt{graph}$ are $\idt{domain}$ and 
    5.75 +$\idt{funct}$.*};
    5.76 +
    5.77 +constdefs
    5.78 +  domain :: "'a graph => 'a set" 
    5.79 +  "domain g == {x. EX y. (x, y):g}"
    5.80 +
    5.81 +  funct :: "'a graph => ('a => real)"
    5.82 +  "funct g == \<lambda>x. (SOME y. (x, y):g)";
    5.83 +
    5.84 +(*text{*  The equations 
    5.85 +\begin{matharray}
    5.86 +\idt{domain} graph F f = F {\rm and}\\ 
    5.87 +\idt{funct} graph F f = f
    5.88 +\end{matharray}
    5.89 +hold, but are not proved here.
    5.90 +*};*)
    5.91 +
    5.92 +text {* The following lemma states that $g$ is the graph of a function
    5.93 +if the relation induced by $g$ is unique. *};
    5.94  
    5.95  lemma graph_domain_funct: 
    5.96    "(!!x y z. (x, y):g ==> (x, z):g ==> z = y) 
    5.97 @@ -65,46 +96,50 @@
    5.98  
    5.99  
   5.100  
   5.101 -subsection {* The set of norm preserving extensions of a function *}
   5.102 +subsection {* Norm preserving extensions of a function *};
   5.103 +
   5.104 +text {* Given a function $f$ on the space $F$ and a quasinorm $p$ on 
   5.105 +$E$. The set of all linear extensions of $f$, to superspaces $H$ of 
   5.106 +$F$, which are bounded by $p$, is defined as follows. *};
   5.107  
   5.108  
   5.109  constdefs
   5.110    norm_pres_extensions :: 
   5.111 -   "['a set, 'a  => real, 'a set, 'a => real] => 'a graph set"
   5.112 -  "norm_pres_extensions E p F f == {g. EX H h. graph H h = g 
   5.113 -                                             & is_linearform H h 
   5.114 -                                             & is_subspace H E
   5.115 -                                             & is_subspace F H
   5.116 -                                             & (graph F f <= graph H h)
   5.117 -                                             & (ALL x:H. h x <= p x)}";
   5.118 +    "['a::{minus, plus} set, 'a  => real, 'a set, 'a => real] 
   5.119 +    => 'a graph set"
   5.120 +    "norm_pres_extensions E p F f 
   5.121 +    == {g. EX H h. graph H h = g 
   5.122 +                & is_linearform H h 
   5.123 +                & is_subspace H E
   5.124 +                & is_subspace F H
   5.125 +                & graph F f <= graph H h
   5.126 +                & (ALL x:H. h x <= p x)}";
   5.127                         
   5.128  lemma norm_pres_extension_D:  
   5.129 -  "(g: norm_pres_extensions E p F f) ==> (EX H h. graph H h = g 
   5.130 -                                              & is_linearform H h 
   5.131 -                                              & is_subspace H E
   5.132 -                                              & is_subspace F H
   5.133 -                                              & (graph F f <= graph H h)
   5.134 -                                              & (ALL x:H. h x <= p x))";
   5.135 - by (unfold norm_pres_extensions_def) force;
   5.136 +  "g : norm_pres_extensions E p F f
   5.137 +  ==> EX H h. graph H h = g 
   5.138 +            & is_linearform H h 
   5.139 +            & is_subspace H E
   5.140 +            & is_subspace F H
   5.141 +            & graph F f <= graph H h
   5.142 +            & (ALL x:H. h x <= p x)";
   5.143 +  by (unfold norm_pres_extensions_def) force;
   5.144  
   5.145  lemma norm_pres_extensionI2 [intro]:  
   5.146 -   "[| is_linearform H h;    
   5.147 -       is_subspace H E;
   5.148 -       is_subspace F H;
   5.149 -       (graph F f <= graph H h);
   5.150 -       (ALL x:H. h x <= p x) |]
   5.151 -   ==> (graph H h : norm_pres_extensions E p F f)";
   5.152 +  "[| is_linearform H h; is_subspace H E; is_subspace F H;
   5.153 +  graph F f <= graph H h; ALL x:H. h x <= p x |]
   5.154 +  ==> (graph H h : norm_pres_extensions E p F f)";
   5.155   by (unfold norm_pres_extensions_def) force;
   5.156  
   5.157  lemma norm_pres_extensionI [intro]:  
   5.158 -   "(EX H h. graph H h = g 
   5.159 -             & is_linearform H h    
   5.160 -             & is_subspace H E
   5.161 -             & is_subspace F H
   5.162 -             & (graph F f <= graph H h)
   5.163 -             & (ALL x:H. h x <= p x))
   5.164 -   ==> (g: norm_pres_extensions E p F f) ";
   5.165 - by (unfold norm_pres_extensions_def) force;
   5.166 +  "EX H h. graph H h = g 
   5.167 +         & is_linearform H h    
   5.168 +         & is_subspace H E
   5.169 +         & is_subspace F H
   5.170 +         & graph F f <= graph H h
   5.171 +         & (ALL x:H. h x <= p x)
   5.172 +  ==> g: norm_pres_extensions E p F f";
   5.173 +  by (unfold norm_pres_extensions_def) force;
   5.174  
   5.175  end;
   5.176  
     6.1 --- a/src/HOL/Real/HahnBanach/HahnBanach.thy	Fri Oct 22 18:41:00 1999 +0200
     6.2 +++ b/src/HOL/Real/HahnBanach/HahnBanach.thy	Fri Oct 22 20:14:31 1999 +0200
     6.3 @@ -1,23 +1,25 @@
     6.4  (*  Title:      HOL/Real/HahnBanach/HahnBanach.thy
     6.5      ID:         $Id$
     6.6 -    Author:     Gertrud Bauer, TU Munich
     6.7 +    Author:     Gertrud Baueer, TU Munich
     6.8  *)
     6.9  
    6.10 -header {* The Hahn-Banach theorem *};
    6.11 +header {* The Hahn-Banach Theorem *};
    6.12  
    6.13 -theory HahnBanach = HahnBanach_lemmas + HahnBanach_h0_lemmas:;
    6.14 +theory HahnBanach
    6.15 +     = HahnBanachSupLemmas + HahnBanachExtLemmas + ZornLemma:;
    6.16  
    6.17  text {*
    6.18 -  The proof of two different versions of the Hahn-Banach theorem, 
    6.19 -  following \cite{Heuser}.
    6.20 +  We present the proof of two different versions of the Hahn-Banach 
    6.21 +  Theorem, closely following \cite{Heuser:1986}.
    6.22  *};
    6.23  
    6.24 -subsection {* The Hahn-Banach theorem for general linear spaces *};
    6.25 +subsection {* The case of general linear spaces *};
    6.26  
    6.27 -text  {* Every linear function f on a subspace of E, which is bounded by a 
    6.28 - quasinorm on E, can be extended norm preserving to a function on E *};
    6.29 +text  {* Every linearform $f$ on a subspace $F$ of $E$, which is 
    6.30 + bounded by some  quasinorm $q$ on $E$, can be extended 
    6.31 + to a function on $E$ in a norm preseving way. *};
    6.32  
    6.33 -theorem hahnbanach: 
    6.34 +theorem HahnBanach: 
    6.35    "[| is_vectorspace E; is_subspace F E; is_quasinorm E p; 
    6.36    is_linearform F f; ALL x:F. f x <= p x |]
    6.37    ==> EX h. is_linearform E h
    6.38 @@ -27,52 +29,60 @@
    6.39    assume "is_vectorspace E" "is_subspace F E" "is_quasinorm E p"
    6.40           "is_linearform F f" "ALL x:F. f x <= p x";
    6.41    
    6.42 +  txt{* We define $M$ to be the set of all linear extensions 
    6.43 +  of $f$ to superspaces of $F$, which are bounded by $p$. *};
    6.44 +
    6.45    def M == "norm_pres_extensions E p F f";
    6.46 +  
    6.47 +  txt{* We show that $M$ is non-empty: *};
    6.48   
    6.49    have aM: "graph F f : norm_pres_extensions E p F f";
    6.50    proof (rule norm_pres_extensionI2);
    6.51 -    show "is_subspace F F"; 
    6.52 -    proof;
    6.53 -      show "is_vectorspace F"; ..;
    6.54 -    qed;
    6.55 +    have "is_vectorspace F"; ..;
    6.56 +    thus "is_subspace F F"; ..;
    6.57    qed (blast!)+;
    6.58  
    6.59 -  subsubsect {* Existence of a supremum of the norm preserving functions *}; 
    6.60 +  subsubsect {* Existence of a limit function of the norm preserving
    6.61 +  extensions *}; 
    6.62  
    6.63 -  have "!! (c:: 'a graph set). c : chain M ==> EX x. x:c 
    6.64 -    ==> (Union c) : M";  
    6.65 +  txt {* For every non-empty chain of norm preserving functions
    6.66 +  the union of all functions in the chain is again a norm preserving
    6.67 +  function. (The union is an upper bound for all elements. 
    6.68 +  It is even the least upper bound, because every upper bound of $M$
    6.69 +  is also an upper bound for $\cup\; c$.) *};
    6.70 +
    6.71 +  have "!! c. [| c : chain M; EX x. x:c |] ==> Union c : M";  
    6.72    proof -;
    6.73 -    fix c; assume "c:chain M"; assume "EX x. x:c";
    6.74 -    show "(Union c) : M"; 
    6.75 +    fix c; assume "c:chain M" "EX x. x:c";
    6.76 +    show "Union c : M";
    6.77  
    6.78      proof (unfold M_def, rule norm_pres_extensionI);
    6.79        show "EX (H::'a set) h::'a => real. graph H h = Union c
    6.80                & is_linearform H h 
    6.81                & is_subspace H E 
    6.82                & is_subspace F H 
    6.83 -              & (graph F f <= graph H h)
    6.84 -              & (ALL x::'a:H. h x <= p x)" 
    6.85 -      (is "EX (H::'a set) h::'a => real. ?Q H h");
    6.86 +              & graph F f <= graph H h
    6.87 +              & (ALL x::'a:H. h x <= p x)";
    6.88        proof (intro exI conjI);
    6.89          let ?H = "domain (Union c)";
    6.90          let ?h = "funct (Union c)";
    6.91  
    6.92 -        show a: "graph ?H ?h = Union c"; 
    6.93 +        show a [simp]: "graph ?H ?h = Union c"; 
    6.94          proof (rule graph_domain_funct);
    6.95            fix x y z; assume "(x, y) : Union c" "(x, z) : Union c";
    6.96 -          show "z = y"; by (rule sup_uniq);
    6.97 +          show "z = y"; by (rule sup_definite);
    6.98          qed;
    6.99              
   6.100 -        show "is_linearform ?H ?h";
   6.101 -          by (simp! add: sup_lf a);       
   6.102 +        show "is_linearform ?H ?h"; 
   6.103 +          by (simp! add: sup_lf a);
   6.104  
   6.105 -        show "is_subspace ?H E";
   6.106 +        show "is_subspace ?H E"; 
   6.107            by (rule sup_subE, rule a) (simp!)+;
   6.108   
   6.109 -        show "is_subspace F ?H";
   6.110 +        show "is_subspace F ?H"; 
   6.111            by (rule sup_supF, rule a) (simp!)+;
   6.112  
   6.113 -        show "graph F f <= graph ?H ?h";       
   6.114 +        show "graph F f <= graph ?H ?h"; 
   6.115            by (rule sup_ext, rule a) (simp!)+;
   6.116  
   6.117          show "ALL x::'a:?H. ?h x <= p x"; 
   6.118 @@ -81,7 +91,8 @@
   6.119      qed;
   6.120    qed;
   6.121   
   6.122 -  txt {* there exists a maximal norm-preserving function g. *};
   6.123 +  txt {* According to Zorn's Lemma there exists 
   6.124 +  a maximal norm-preserving extension $g\in M$. *};
   6.125    
   6.126    with aM; have bex_g: "EX g:M. ALL x:M. g <= x --> g = x";
   6.127      by (simp! add: Zorn's_Lemma);
   6.128 @@ -90,204 +101,200 @@
   6.129    proof;
   6.130      fix g; assume g: "g:M" "ALL x:M. g <= x --> g = x";
   6.131   
   6.132 -    have ex_Hh: "EX H h. graph H h = g 
   6.133 -                         & is_linearform H h 
   6.134 -                         & is_subspace H E 
   6.135 -                         & is_subspace F H
   6.136 -                         & (graph F f <= graph H h)
   6.137 -                         & (ALL x:H. h x <= p x) "; 
   6.138 +    have ex_Hh: 
   6.139 +      "EX H h. graph H h = g 
   6.140 +           & is_linearform H h 
   6.141 +           & is_subspace H E 
   6.142 +           & is_subspace F H
   6.143 +           & graph F f <= graph H h
   6.144 +           & (ALL x:H. h x <= p x) "; 
   6.145        by (simp! add: norm_pres_extension_D);
   6.146      thus ?thesis;
   6.147 -    proof (elim exE conjE);
   6.148 +    proof (elim exE conjE, intro exI);
   6.149        fix H h; 
   6.150        assume "graph H h = g" "is_linearform (H::'a set) h" 
   6.151               "is_subspace H E" "is_subspace F H"
   6.152 -      and h_ext: "(graph F f <= graph H h)"
   6.153 -      and h_bound: "ALL x:H. h x <= p x";
   6.154 +        and h_ext: "graph F f <= graph H h"
   6.155 +        and h_bound: "ALL x:H. h x <= p x";
   6.156  
   6.157 -      show ?thesis; 
   6.158 -      proof;
   6.159 -        have h: "is_vectorspace H"; ..;
   6.160 -        have f: "is_vectorspace F"; ..;
   6.161 +      have h: "is_vectorspace H"; ..;
   6.162 +      have f: "is_vectorspace F"; ..;
   6.163  
   6.164 -subsubsect {* The supremal norm-preserving function is defined on the 
   6.165 - whole vectorspace *};
   6.166 +subsubsect {* The domain of the limit function. *};
   6.167  
   6.168  have eq: "H = E"; 
   6.169  proof (rule classical);
   6.170  
   6.171 -txt {* assume h is not defined on whole E *};
   6.172 -
   6.173 +txt {* Assume the domain of the supremum is not $E$. *};
   6.174 +;
   6.175    assume "H ~= E";
   6.176 -  show ?thesis; 
   6.177 -  proof -;
   6.178 -
   6.179 -    have "EX x:M. g <= x & g ~= x";
   6.180 -    proof -;
   6.181 -
   6.182 -      txt {* h can be extended norm-preserving to H0 *};
   6.183 +  have "H <= E"; ..;
   6.184 +  hence "H < E"; ..;
   6.185 + 
   6.186 +  txt{* Then there exists an element $x_0$ in 
   6.187 +  the difference of $E$ and $H$. *};
   6.188  
   6.189 -      have "EX H0 h0. g <= graph H0 h0 & g ~= graph H0 h0 
   6.190 -                    & graph H0 h0 : M";
   6.191 -      proof-;
   6.192 -        have "H <= E"; ..;
   6.193 -        hence "H < E"; ..;
   6.194 -        hence "EX x0:E. x0~:H"; 
   6.195 -          by (rule set_less_imp_diff_not_empty);
   6.196 -        thus ?thesis;
   6.197 -        proof;
   6.198 -          fix x0; assume "x0:E" "x0~:H";
   6.199 -
   6.200 -          have x0:  "x0 ~= <0>";
   6.201 -          proof (rule classical);
   6.202 -            presume "x0 = <0>"; 
   6.203 -            with h; have "x0:H"; by simp;
   6.204 -            thus ?thesis; by contradiction;
   6.205 -          qed force;
   6.206 +  hence "EX x0:E. x0~:H"; 
   6.207 +    by (rule set_less_imp_diff_not_empty);
   6.208  
   6.209 -          def H0 == "vectorspace_sum H (lin x0)";
   6.210 -          have "EX h0. g <= graph H0 h0 & g ~= graph H0 h0 
   6.211 -                     & graph H0 h0 : M"; 
   6.212 -          proof -;
   6.213 -            from h; 
   6.214 -            have xi: "EX xi. (ALL y:H. - p (y [+] x0) - h y <= xi) 
   6.215 -                           & (ALL y:H. xi <= p (y [+] x0) - h y)"; 
   6.216 -            proof (rule ex_xi);
   6.217 -              fix u v; assume "u:H" "v:H"; 
   6.218 -              show "- p (u [+] x0) - h u <= p (v [+] x0) - h v";
   6.219 -              proof (rule real_diff_ineq_swap);
   6.220 +  txt {* We get that $h$ can be extended  in a 
   6.221 +  norm-preserving way to some $H_0$. *};
   6.222 +;  
   6.223 +  hence "EX H0 h0. g <= graph H0 h0 & g ~= graph H0 h0 
   6.224 +                 & graph H0 h0 : M";
   6.225 +  proof;
   6.226 +    fix x0; assume "x0:E" "x0~:H";
   6.227  
   6.228 -                show "h v - h u <= p (v [+] x0) + p (u [+] x0)"; 
   6.229 -                proof -;
   6.230 -                  from h; have "h v - h u = h (v [-] u)";
   6.231 -                     by (simp! add: linearform_diff_linear);
   6.232 -                  also; from h_bound; have "... <= p (v [-] u)"; 
   6.233 -                    by (simp!);
   6.234 -                  also; 
   6.235 -                  have "v [-] u = x0 [+] [-] x0 [+] v [+] [-] u"; 
   6.236 -                    by (unfold diff_def) (simp!);
   6.237 -                  also; have "... = v [+] x0 [+] [-] (u [+] x0)"; 
   6.238 -                    by (simp!);
   6.239 -                  also; have "... = (v [+] x0) [-] (u [+] x0)";
   6.240 -                    by (unfold diff_def) (simp!);
   6.241 -                  also; have "p ... <= p (v [+] x0) + p (u [+] x0)";
   6.242 -                     by (rule quasinorm_diff_triangle_ineq) 
   6.243 -                        (simp!)+;
   6.244 -                  finally; show ?thesis; .;
   6.245 -                qed;
   6.246 -              qed;
   6.247 -            qed;
   6.248 -            
   6.249 -            thus ?thesis;
   6.250 -            proof (elim exE, intro exI conjI);
   6.251 -              fix xi; 
   6.252 -              assume a: "(ALL y:H. - p (y [+] x0) - h y <= xi) 
   6.253 -                        & (ALL y:H. xi <= p (y [+] x0) - h y)";
   6.254 -              def h0 == 
   6.255 -                "%x. let (y,a) = @(y,a). (x = y [+] a [*] x0 & y:H )
   6.256 -                     in (h y) + a * xi";
   6.257 +    have x0: "x0 ~= <0>";
   6.258 +    proof (rule classical);
   6.259 +      presume "x0 = <0>";
   6.260 +      with h; have "x0:H"; by simp;
   6.261 +      thus ?thesis; by contradiction;
   6.262 +    qed blast;
   6.263 +
   6.264 +    txt {* Define $H_0$ as the (direct) sum of H and the 
   6.265 +    linear closure of $x_0$.*};
   6.266 +
   6.267 +    def H0 == "H + lin x0";
   6.268  
   6.269 -	      have "graph H h <= graph H0 h0"; 
   6.270 -              proof (rule graph_extI);
   6.271 -                fix t; assume "t:H"; 
   6.272 -                show "h t = h0 t";
   6.273 -                proof -;
   6.274 -                  have "(@ (y, a). t = y [+] a [*] x0 & y : H) 
   6.275 -                         = (t,0r)";
   6.276 -                    by (rule decomp1, rule x0); 
   6.277 -                  thus ?thesis; by (simp! add: Let_def);
   6.278 -                qed;
   6.279 -              next;
   6.280 -                show "H <= H0";
   6.281 -		proof (rule subspace_subset);
   6.282 -	          show "is_subspace H H0";
   6.283 -		  proof (unfold H0_def, rule subspace_vs_sum1);
   6.284 -		    show "is_vectorspace H"; ..;
   6.285 -		    show "is_vectorspace (lin x0)"; ..;
   6.286 -		  qed;
   6.287 -		qed;
   6.288 -	      qed;
   6.289 -              thus "g <= graph H0 h0"; by (simp!);
   6.290 -
   6.291 -              have "graph H h ~= graph H0 h0";
   6.292 -              proof;
   6.293 -                assume e: "graph H h = graph H0 h0";
   6.294 -                have "x0:H0"; 
   6.295 -                proof (unfold H0_def, rule vs_sumI);
   6.296 -                  show "x0 = <0> [+] x0"; by (simp!);
   6.297 -                  show "x0 :lin x0"; by (rule x_lin_x);
   6.298 -                  from h; show "<0> : H"; ..;
   6.299 -                qed;
   6.300 -                hence "(x0, h0 x0) : graph H0 h0"; by (rule graphI);
   6.301 -                with e; have "(x0, h0 x0) : graph H h"; by simp;
   6.302 -                hence "x0 : H"; ..;
   6.303 -                thus "False"; by contradiction;
   6.304 -              qed;
   6.305 -              thus "g ~= graph H0 h0"; by (simp!);
   6.306 -
   6.307 -              have "graph H0 h0 : norm_pres_extensions E p F f";
   6.308 -              proof (rule norm_pres_extensionI2);
   6.309 -
   6.310 -                show "is_linearform H0 h0";
   6.311 -                  by (rule h0_lf, rule x0) (simp!)+;
   6.312 +    from h; have xi: "EX xi. (ALL y:H. - p (y + x0) - h y <= xi)
   6.313 +                     & (ALL y:H. xi <= p (y + x0) - h y)";
   6.314 +    proof (rule ex_xi);
   6.315 +      fix u v; assume "u:H" "v:H";
   6.316 +      from h; have "h v - h u = h (v - u)";
   6.317 +         by (simp! add: linearform_diff_linear);
   6.318 +      also; from h_bound; have "... <= p (v - u)";
   6.319 +        by (simp!);
   6.320 +      also; have "v - u = x0 + - x0 + v + - u";
   6.321 +        by (simp! add: diff_eq1);
   6.322 +      also; have "... = v + x0 + - (u + x0)";
   6.323 +        by (simp!);
   6.324 +      also; have "... = (v + x0) - (u + x0)";
   6.325 +        by (simp! add: diff_eq1);
   6.326 +      also; have "p ... <= p (v + x0) + p (u + x0)";
   6.327 +         by (rule quasinorm_diff_triangle_ineq) (simp!)+;
   6.328 +      finally; have "h v - h u <= p (v + x0) + p (u + x0)"; .;
   6.329  
   6.330 -                show "is_subspace H0 E";
   6.331 -                  by (unfold H0_def, rule vs_sum_subspace, 
   6.332 -                     rule lin_subspace);
   6.333 +      thus "- p (u + x0) - h u <= p (v + x0) - h v";
   6.334 +        by (rule real_diff_ineq_swap);
   6.335 +    qed;
   6.336 +    hence "EX h0. g <= graph H0 h0 & g ~= graph H0 h0
   6.337 +               & graph H0 h0 : M"; 
   6.338 +    proof (elim exE, intro exI conjI);
   6.339 +      fix xi; 
   6.340 +      assume a: "(ALL y:H. - p (y + x0) - h y <= xi) 
   6.341 +               & (ALL y:H. xi <= p (y + x0) - h y)";
   6.342 +     
   6.343 +      txt {* Define $h_0$ as the linear extension of $h$ on $H_0$:*};  
   6.344  
   6.345 -                show f_h0: "is_subspace F H0";
   6.346 -                proof (rule subspace_trans [of F H H0]);
   6.347 -                  from h lin_vs; 
   6.348 -                  have "is_subspace H (vectorspace_sum H (lin x0))"; 
   6.349 -                    ..;
   6.350 -                  thus "is_subspace H H0"; by (unfold H0_def);
   6.351 -                qed;
   6.352 -
   6.353 -                show "graph F f <= graph H0 h0";
   6.354 -                proof (rule graph_extI);
   6.355 -                  fix x; assume "x:F";
   6.356 -                  show "f x = h0 x";
   6.357 -                  proof -;
   6.358 -                    have eq: 
   6.359 -                      "(@(y, a). x = y [+] a [*] x0 & y : H) 
   6.360 -                        = (x, 0r)";
   6.361 -                      by (rule decomp1, rule x0) (simp!)+;
   6.362 +      def h0 ==
   6.363 +          "\<lambda>x. let (y,a) = SOME (y, a). (x = y + a <*> x0 & y:H)
   6.364 +               in (h y) + a * xi";
   6.365  
   6.366 -                    have "f x = h x"; ..;
   6.367 -                    also; have " ... = h x + 0r * xi"; by simp;
   6.368 -                    also; have 
   6.369 -                       "... = (let (y,a) = (x, 0r) in h y + a * xi)";
   6.370 -                       by (simp add: Let_def);
   6.371 -                    also; from eq; have 
   6.372 -                      "... = (let (y,a) = @ (y,a). 
   6.373 -                                          x = y [+] a [*] x0 & y : H
   6.374 -                            in h y + a * xi)"; by simp;
   6.375 -                    also; have "... = h0 x"; by (simp!);
   6.376 -                    finally; show ?thesis; .;
   6.377 -                  qed;
   6.378 -                next;
   6.379 -                  from f_h0; show "F <= H0"; ..;
   6.380 -                qed;
   6.381 -
   6.382 -                show "ALL x:H0. h0 x <= p x";
   6.383 -                  by (rule h0_norm_pres, rule x0) 
   6.384 -                     (assumption | (simp!))+;
   6.385 -              qed;
   6.386 -              thus "graph H0 h0 : M"; by (simp!);
   6.387 -            qed;
   6.388 +      txt {* We get that the graph of $h_0$ extend that of
   6.389 +      $h$. *};
   6.390 +        
   6.391 +      have  "graph H h <= graph H0 h0"; 
   6.392 +      proof (rule graph_extI);
   6.393 +        fix t; assume "t:H"; 
   6.394 +        have "(SOME (y, a). t = y + a <*> x0 & y : H) = (t,0r)";
   6.395 +          by (rule decomp_H0_H, rule x0); 
   6.396 +        thus "h t = h0 t"; by (simp! add: Let_def);
   6.397 +      next;
   6.398 +        show "H <= H0";
   6.399 +        proof (rule subspace_subset);
   6.400 +	  show "is_subspace H H0";
   6.401 +          proof (unfold H0_def, rule subspace_vs_sum1);
   6.402 +       	    show "is_vectorspace H"; ..;
   6.403 +            show "is_vectorspace (lin x0)"; ..;
   6.404            qed;
   6.405 -          thus ?thesis; ..;
   6.406          qed;
   6.407        qed;
   6.408 +      thus "g <= graph H0 h0"; by (simp!);
   6.409  
   6.410 -      thus ?thesis;
   6.411 -        by (elim exE conjE, intro bexI conjI);
   6.412 +      txt {* Apparently $h_0$ is not equal to $h$. *};
   6.413 +
   6.414 +      have "graph H h ~= graph H0 h0";
   6.415 +      proof;
   6.416 +        assume e: "graph H h = graph H0 h0";
   6.417 +        have "x0 : H0"; 
   6.418 +        proof (unfold H0_def, rule vs_sumI);
   6.419 +          show "x0 = <0> + x0"; by (simp!);
   6.420 +          from h; show "<0> : H"; ..;
   6.421 +          show "x0 : lin x0"; by (rule x_lin_x);
   6.422 +        qed;
   6.423 +        hence "(x0, h0 x0) : graph H0 h0"; ..;
   6.424 +        with e; have "(x0, h0 x0) : graph H h"; by simp;
   6.425 +        hence "x0 : H"; ..;
   6.426 +        thus False; by contradiction;
   6.427 +      qed;
   6.428 +      thus "g ~= graph H0 h0"; by (simp!);
   6.429 +
   6.430 +      txt {* Furthermore  $h_0$ is a norm preserving extension 
   6.431 +     of $f$. *};
   6.432 +
   6.433 +      have "graph H0 h0 : norm_pres_extensions E p F f";
   6.434 +      proof (rule norm_pres_extensionI2);
   6.435 +
   6.436 +        show "is_linearform H0 h0";
   6.437 +          by (rule h0_lf, rule x0) (simp!)+;
   6.438 +
   6.439 +        show "is_subspace H0 E";
   6.440 +          by (unfold H0_def, rule vs_sum_subspace, 
   6.441 +             rule lin_subspace);
   6.442 +
   6.443 +        have "is_subspace F H"; .;
   6.444 +        also; from h lin_vs; 
   6.445 +	have [fold H0_def]: "is_subspace H (H + lin x0)"; ..;
   6.446 +        finally (subspace_trans [OF _ h]); 
   6.447 +	show f_h0: "is_subspace F H0"; .; (*** 
   6.448 +        backwards:
   6.449 +        show f_h0: "is_subspace F H0"; .;
   6.450 +        proof (rule subspace_trans [of F H H0]);
   6.451 +          from h lin_vs; 
   6.452 +          have "is_subspace H (H + lin x0)"; ..;
   6.453 +          thus "is_subspace H H0"; by (unfold H0_def);
   6.454 +        qed; ***)
   6.455 +
   6.456 +        show "graph F f <= graph H0 h0";
   6.457 +        proof (rule graph_extI);
   6.458 +          fix x; assume "x:F";
   6.459 +          have "f x = h x"; ..;
   6.460 +          also; have " ... = h x + 0r * xi"; by simp;
   6.461 +          also; have "... = (let (y,a) = (x, 0r) in h y + a * xi)";
   6.462 +            by (simp add: Let_def);
   6.463 +          also; have 
   6.464 +            "(x, 0r) = (SOME (y, a). x = y + a <*> x0 & y : H)";
   6.465 +            by (rule decomp_H0_H [RS sym], rule x0) (simp!)+;
   6.466 +          also; have 
   6.467 +            "(let (y,a) = (SOME (y,a). x = y + a <*> x0 & y : H)
   6.468 +              in h y + a * xi) 
   6.469 +             = h0 x"; by (simp!);
   6.470 +          finally; show "f x = h0 x"; .;
   6.471 +        next;
   6.472 +          from f_h0; show "F <= H0"; ..;
   6.473 +        qed;
   6.474 +
   6.475 +        show "ALL x:H0. h0 x <= p x";
   6.476 +          by (rule h0_norm_pres, rule x0) (assumption | (simp!))+;
   6.477 +      qed;
   6.478 +      thus "graph H0 h0 : M"; by (simp!);
   6.479      qed;
   6.480 -    hence "~ (ALL x:M. g <= x --> g = x)"; by force;
   6.481 -    thus ?thesis; by contradiction;
   6.482 +    thus ?thesis; ..;
   6.483    qed;
   6.484 +
   6.485 +  txt {* We have shown, that $h$ can still be extended to 
   6.486 +  some $h_0$, in contradiction to the assumption that 
   6.487 +  $h$ is a maximal element. *};
   6.488 +
   6.489 +  hence "EX x:M. g <= x & g ~= x"; 
   6.490 +    by (elim exE conjE, intro bexI conjI);
   6.491 +  hence "~ (ALL x:M. g <= x --> g = x)"; by simp;
   6.492 +  thus ?thesis; by contradiction;
   6.493  qed; 
   6.494  
   6.495 +txt{* It follows $H = E$ and the thesis can be shown. *};
   6.496 +
   6.497  show "is_linearform E h & (ALL x:F. h x = f x) 
   6.498       & (ALL x:E. h x <= p x)";
   6.499  proof (intro conjI); 
   6.500 @@ -297,15 +304,26 @@
   6.501      fix x; assume "x:F"; show "f x = h x "; ..;
   6.502    qed;
   6.503    from eq; show "ALL x:E. h x <= p x"; by (force!);
   6.504 -qed; 
   6.505 -qed; 
   6.506 -qed; 
   6.507 -qed; 
   6.508 +qed;
   6.509 +
   6.510 +qed;
   6.511 +qed;
   6.512  qed;
   6.513  
   6.514 -subsection  {* Alternative formulation of the theorem *};
   6.515 +
   6.516 +
   6.517 +subsection  {* An alternative formulation of the theorem *};
   6.518  
   6.519 -theorem rabs_hahnbanach:
   6.520 +text {* The following alternative formulation of the 
   6.521 +Hahn-Banach Theorem uses the fact that for
   6.522 +real numbers the following inequations are equivalent:
   6.523 +\begin{matharray}{ll}
   6.524 +\forall x\in H.\ap |h\ap x|\leq p\ap x& {\rm and}\\
   6.525 +\forall x\in H.\ap h\ap x\leq p\ap x\\
   6.526 +\end{matharray}
   6.527 +(This was shown in lemma $\idt{rabs{\dsh}ineq}$.) *};
   6.528 +
   6.529 +theorem rabs_HahnBanach:
   6.530    "[| is_vectorspace E; is_subspace F E; is_quasinorm E p; 
   6.531    is_linearform F f; ALL x:F. rabs (f x) <= p x |]
   6.532    ==> EX g. is_linearform E g
   6.533 @@ -314,141 +332,191 @@
   6.534  proof -; 
   6.535    assume e: "is_vectorspace E" "is_subspace F E" "is_quasinorm E p" 
   6.536              "is_linearform F f"  "ALL x:F. rabs (f x) <= p x";
   6.537 -  have "ALL x:F. f x <= p x"; by (rule rabs_ineq [RS iffD1]);
   6.538 +  have "ALL x:F. f x <= p x"; 
   6.539 +    by (rule rabs_ineq_iff [RS iffD1]);
   6.540    hence "EX g. is_linearform E g & (ALL x:F. g x = f x) 
   6.541                & (ALL x:E. g x <= p x)";
   6.542 -    by (simp! only: hahnbanach);
   6.543 +    by (simp! only: HahnBanach);
   6.544    thus ?thesis;
   6.545    proof (elim exE conjE);
   6.546      fix g; assume "is_linearform E g" "ALL x:F. g x = f x" 
   6.547                    "ALL x:E. g x <= p x";
   6.548      show ?thesis;
   6.549 -    proof (intro exI conjI)+;
   6.550 +    proof (intro exI conjI);
   6.551        from e; show "ALL x:E. rabs (g x) <= p x"; 
   6.552 -        by (simp! add: rabs_ineq [OF subspace_refl]);
   6.553 +        by (simp! add: rabs_ineq_iff [OF subspace_refl]);
   6.554      qed;
   6.555    qed;
   6.556  qed;
   6.557  
   6.558  
   6.559 -subsection {* The Hahn-Banach theorem for normed spaces *};
   6.560 +subsection {* The Hahn-Banach Theorem for normed spaces *};
   6.561  
   6.562 -text  {* Every continous linear function f on a subspace of E, 
   6.563 -     can be extended to a continous function on E with the same norm *};
   6.564 +text  {* Every continous linear function $f$ on a subspace of $E$, 
   6.565 +  can be extended to a continous function on $E$ with the same 
   6.566 +  function norm. *};
   6.567  
   6.568 -theorem norm_hahnbanach:
   6.569 -  "[| is_normed_vectorspace E norm; is_subspace F E; is_linearform F f;
   6.570 -      is_continous F norm f |] 
   6.571 +theorem norm_HahnBanach:
   6.572 +  "[| is_normed_vectorspace E norm; is_subspace F E; 
   6.573 +  is_linearform F f; is_continous F norm f |] 
   6.574    ==> EX g. is_linearform E g
   6.575           & is_continous E norm g 
   6.576           & (ALL x:F. g x = f x) 
   6.577 -         & function_norm E norm g = function_norm F norm f"
   6.578 -  (concl is "EX g::'a=>real. ?P g");
   6.579 +         & function_norm E norm g = function_norm F norm f";
   6.580  proof -;
   6.581 -  assume a: "is_normed_vectorspace E norm";
   6.582 -  assume b: "is_subspace F E" "is_linearform F f";
   6.583 -  assume c: "is_continous F norm f";
   6.584 +  assume e_norm: "is_normed_vectorspace E norm";
   6.585 +  assume f: "is_subspace F E" "is_linearform F f";
   6.586 +  assume f_cont: "is_continous F norm f";
   6.587    have e: "is_vectorspace E"; ..;
   6.588 -  from _ e; have f: "is_normed_vectorspace F norm"; ..;
   6.589 +  with _; have f_norm: "is_normed_vectorspace F norm"; ..;
   6.590  
   6.591 -  def p == "%x::'a. (function_norm F norm f) * norm x";
   6.592 +  txt{* We define the function $p$ on $E$ as follows:
   6.593 +  \begin{matharray}{l}
   6.594 +  p\ap x = \fnorm f * \norm x\\
   6.595 +  % p\ap x = \fnorm f * \fnorm x.\\
   6.596 +  \end{matharray}
   6.597 +  *};
   6.598 +
   6.599 +  def p == "\<lambda>x. function_norm F norm f * norm x";
   6.600    
   6.601 -  let ?P' = "%g. is_linearform E g & (ALL x:F. g x = f x) 
   6.602 -              & (ALL x:E. rabs (g x) <= p x)";
   6.603 +  txt{* $p$ is a quasinorm on $E$: *};
   6.604  
   6.605    have q: "is_quasinorm E p";
   6.606    proof;
   6.607      fix x y a; assume "x:E" "y:E";
   6.608  
   6.609 +    txt{* $p$ is positive definite: *};
   6.610 +
   6.611      show "0r <= p x";
   6.612      proof (unfold p_def, rule real_le_mult_order);
   6.613 -      from _ f; show "0r <= function_norm F norm f"; ..;
   6.614 +      from _ f_norm; show "0r <= function_norm F norm f"; ..;
   6.615        show "0r <= norm x"; ..;
   6.616      qed;
   6.617  
   6.618 -    show "p (a [*] x) = (rabs a) * (p x)";
   6.619 +    txt{* $p$ is multiplicative: *};
   6.620 +
   6.621 +    show "p (a <*> x) = rabs a * p x";
   6.622      proof -; 
   6.623 -      have "p (a [*] x) = (function_norm F norm f) * norm (a [*] x)"; 
   6.624 +      have "p (a <*> x) = function_norm F norm f * norm (a <*> x)";
   6.625          by (simp!);
   6.626 -      also; have "norm (a [*] x) = rabs a * norm x"; 
   6.627 +      also; have "norm (a <*> x) = rabs a * norm x"; 
   6.628          by (rule normed_vs_norm_mult_distrib);
   6.629 -      also; have "(function_norm F norm f) * ... 
   6.630 -        = rabs a * ((function_norm F norm f) * norm x)";
   6.631 +      also; have "function_norm F norm f * (rabs a * norm x) 
   6.632 +        = rabs a * (function_norm F norm f * norm x)";
   6.633          by (simp! only: real_mult_left_commute);
   6.634 -      also; have "... = (rabs a) * (p x)"; by (simp!);
   6.635 +      also; have "... = rabs a * p x"; by (simp!);
   6.636        finally; show ?thesis; .;
   6.637      qed;
   6.638  
   6.639 -    show "p (x [+] y) <= p x + p y";
   6.640 +    txt{* Furthermore $p$ obeys the triangle inequation: *};
   6.641 +
   6.642 +    show "p (x + y) <= p x + p y";
   6.643      proof -;
   6.644 -      have "p (x [+] y) = (function_norm F norm f) * norm (x [+] y)"; 
   6.645 +      have "p (x + y) = function_norm F norm f * norm (x + y)";
   6.646          by (simp!);
   6.647 -      also; have "... <= (function_norm F norm f) * (norm x + norm y)";
   6.648 +      also; 
   6.649 +      have "... <= function_norm F norm f * (norm x + norm y)";
   6.650        proof (rule real_mult_le_le_mono1);
   6.651 -        from _ f; show "0r <= function_norm F norm f"; ..;
   6.652 -        show "norm (x [+] y) <= norm x + norm y"; ..;
   6.653 +        from _ f_norm; show "0r <= function_norm F norm f"; ..;
   6.654 +        show "norm (x + y) <= norm x + norm y"; ..;
   6.655        qed;
   6.656 -      also; have "... = (function_norm F norm f) * (norm x) 
   6.657 -                        + (function_norm F norm f) * (norm y)";
   6.658 +      also; have "... = function_norm F norm f * norm x 
   6.659 +                        + function_norm F norm f * norm y";
   6.660          by (simp! only: real_add_mult_distrib2);
   6.661        finally; show ?thesis; by (simp!);
   6.662      qed;
   6.663    qed;
   6.664 - 
   6.665 +
   6.666 +  txt{* $f$ is bounded by $p$. *}; 
   6.667 +
   6.668    have "ALL x:F. rabs (f x) <= p x";
   6.669    proof;
   6.670      fix x; assume "x:F";
   6.671 -     from f; show "rabs (f x) <= p x"; 
   6.672 +     from f_norm; show "rabs (f x) <= p x"; 
   6.673         by (simp! add: norm_fx_le_norm_f_norm_x);
   6.674    qed;
   6.675  
   6.676 -  with e b q; have "EX g. ?P' g";
   6.677 -    by (simp! add: rabs_hahnbanach);
   6.678 +  txt{* Using the facts that $p$ is a quasinorm and 
   6.679 +  $f$ is bounded we can apply the Hahn-Banach Theorem for real
   6.680 +  vector spaces. 
   6.681 +  So $f$ can be extended in a norm preserving way to some function
   6.682 +  $g$ on the whole vector space $E$. *};
   6.683  
   6.684 -  thus "?thesis";
   6.685 -  proof (elim exE conjE, intro exI conjI);
   6.686 +  with e f q; 
   6.687 +  have "EX g. is_linearform E g & (ALL x:F. g x = f x) 
   6.688 +            & (ALL x:E. rabs (g x) <= p x)";
   6.689 +    by (simp! add: rabs_HahnBanach);
   6.690 +
   6.691 +  thus ?thesis;
   6.692 +  proof (elim exE conjE); 
   6.693      fix g;
   6.694      assume "is_linearform E g" and a: "ALL x:F. g x = f x" 
   6.695         and "ALL x:E. rabs (g x) <= p x";
   6.696 -    show ce: "is_continous E norm g";
   6.697 -    proof (rule lipschitz_continousI);
   6.698 -      fix x; assume "x:E";
   6.699 -      show "rabs (g x) <= function_norm F norm f * norm x";
   6.700 -        by (rule bspec [of _ _ x], (simp!));
   6.701 -    qed;
   6.702 -    show "function_norm E norm g = function_norm F norm f";
   6.703 -    proof (rule order_antisym);
   6.704 -      from _ ce; 
   6.705 -      show "function_norm E norm g <= function_norm F norm f";
   6.706 -      proof (rule fnorm_le_ub);
   6.707 -        show "ALL x:E. rabs (g x) <=  function_norm F norm f * norm x";
   6.708 +
   6.709 +    show "EX g. is_linearform E g 
   6.710 +            & is_continous E norm g 
   6.711 +            & (ALL x:F. g x = f x) 
   6.712 +            & function_norm E norm g = function_norm F norm f";
   6.713 +    proof (intro exI conjI);
   6.714 +
   6.715 +    txt{* To complete the proof, we show that this function
   6.716 +    $g$ is also continous and has the same function norm as
   6.717 +    $f$. *};
   6.718 +
   6.719 +      show g_cont: "is_continous E norm g";
   6.720 +      proof;
   6.721 +        fix x; assume "x:E";
   6.722 +        show "rabs (g x) <= function_norm F norm f * norm x";
   6.723 +          by (rule bspec [of _ _ x], (simp!));
   6.724 +      qed; 
   6.725 +
   6.726 +      show "function_norm E norm g = function_norm F norm f"
   6.727 +        (is "?L = ?R");
   6.728 +      proof (rule order_antisym);
   6.729 +
   6.730 +        txt{* $\idt{function{\dsh}norm}\ap F\ap \idt{norm}\ap f$ is 
   6.731 +        a solution
   6.732 +        for the inequation 
   6.733 +        \begin{matharray}{l}
   6.734 +        \forall\ap x\in E.\ap |g\ap x| \leq c * \norm x.
   6.735 +        \end{matharray} *};
   6.736 +
   6.737 +        have "ALL x:E. rabs (g x) <= function_norm F norm f * norm x";
   6.738          proof;
   6.739            fix x; assume "x:E"; 
   6.740            show "rabs (g x) <= function_norm F norm f * norm x";
   6.741 -            by (rule bspec [of _ _ x], (simp!));
   6.742 +            by (simp!);
   6.743          qed;
   6.744 -        from c f; show "0r <= function_norm F norm f"; ..;
   6.745 -      qed;
   6.746 -      show "function_norm F norm f <= function_norm E norm g"; 
   6.747 -      proof (rule fnorm_le_ub);
   6.748 -        show "ALL x:F. rabs (f x) <=  function_norm E norm g * norm x";
   6.749 +
   6.750 +        txt{* Since
   6.751 +         $\idt{function{\dsh}norm}\ap E\ap \idt{norm}\ap g$
   6.752 +        is the smallest solution for this inequation, we have: *};
   6.753 +
   6.754 +        with _ g_cont;
   6.755 +        show "?L <= ?R";
   6.756 +        proof (rule fnorm_le_ub);
   6.757 +          from f_cont f_norm; show "0r <= function_norm F norm f"; ..;
   6.758 +        qed;
   6.759 +
   6.760 +        txt{* The other direction is achieved by a similar 
   6.761 +        argument. *};
   6.762 +
   6.763 +        have "ALL x:F. rabs (f x) <= function_norm E norm g * norm x";
   6.764          proof;
   6.765            fix x; assume "x : F"; 
   6.766            from a; have "g x = f x"; ..;
   6.767            hence "rabs (f x) = rabs (g x)"; by simp;
   6.768 -          also; from _ _ ce; 
   6.769 -          have "... <= function_norm E norm g * norm x"; 
   6.770 -          proof (rule norm_fx_le_norm_f_norm_x);
   6.771 -            show "x : E";
   6.772 -            proof (rule subsetD); 
   6.773 -              show "F <= E"; ..;
   6.774 -            qed;
   6.775 -          qed;
   6.776 +          also; from _ _ g_cont; 
   6.777 +          have "... <= function_norm E norm g * norm x";
   6.778 +            by (rule norm_fx_le_norm_f_norm_x) (simp!)+;
   6.779            finally; 
   6.780            show "rabs (f x) <= function_norm E norm g * norm x"; .;
   6.781          qed;
   6.782 -        from _ e; show "is_normed_vectorspace F norm"; ..;
   6.783 -        from ce; show "0r <= function_norm E norm g"; ..;
   6.784 +  
   6.785 +        with f_norm f_cont; show "?R <= ?L"; 
   6.786 +        proof (rule fnorm_le_ub);
   6.787 +          from g_cont; show "0r <= function_norm E norm g"; ..;
   6.788 +        qed;
   6.789        qed;
   6.790      qed;
   6.791    qed;
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy	Fri Oct 22 20:14:31 1999 +0200
     7.3 @@ -0,0 +1,346 @@
     7.4 +(*  Title:      HOL/Real/HahnBanach/HahnBanachExtLemmas.thy
     7.5 +    ID:         $Id$
     7.6 +    Author:     Gertrud Bauer, TU Munich
     7.7 +*)
     7.8 +
     7.9 +header {* Extending a non-ma\-xi\-mal function *};
    7.10 +
    7.11 +theory HahnBanachExtLemmas = FunctionNorm:;
    7.12 +
    7.13 +text{* In this section the following context is presumed.
    7.14 +Let $E$ be a real vector space with a 
    7.15 +quasinorm $q$ on $E$. $F$ is a subspace of $E$ and $f$ a linear 
    7.16 +function on $F$. We consider a subspace $H$ of $E$ that is a 
    7.17 +superspace of $F$ and a linearform $h$ on $H$. $H$ is a not equal 
    7.18 +to $E$ and $x_0$ is an element in $E \backslash H$.
    7.19 +$H$ is extended to the direct sum  $H_0 = H + \idt{lin}\ap x_0$, so for
    7.20 +any $x\in H_0$ the decomposition of $x = y + a \mult x$ 
    7.21 +with $y\in H$ is unique. $h_0$ is defined on $H_0$ by  
    7.22 +$h_0 x = h y + a \cdot \xi$ for some $\xi$.
    7.23 +
    7.24 +Subsequently we show some properties of this extension $h_0$ of $h$.
    7.25 +*}; 
    7.26 +
    7.27 +
    7.28 +text {* This lemma will be used to show the existence of a linear 
    7.29 +extension of $f$. It is a conclusion of the completenesss of the 
    7.30 +reals. To show 
    7.31 +\begin{matharray}{l}
    7.32 +\exists \xi. \ap (\forall y\in F.\ap a\ap y \leq \xi) \land (\forall y\in F.\ap xi \leq b\ap y)
    7.33 +\end{matharray}
    7.34 +it suffices to show that 
    7.35 +\begin{matharray}{l}
    7.36 +\forall u\in F. \ap\forall v\in F. \ap a\ap u \leq b \ap v.
    7.37 +\end{matharray}
    7.38 +*};
    7.39 +
    7.40 +lemma ex_xi: 
    7.41 +  "[| is_vectorspace F; !! u v. [| u:F; v:F |] ==> a u <= b v |]
    7.42 +  ==> EX (xi::real). (ALL y:F. a y <= xi) & (ALL y:F. xi <= b y)"; 
    7.43 +proof -;
    7.44 +  assume vs: "is_vectorspace F";
    7.45 +  assume r: "(!! u v. [| u:F; v:F |] ==> a u <= (b v::real))";
    7.46 +
    7.47 +  txt {* From the completeness of the reals follows:
    7.48 +  The set $S = \{a\ap u.\ap u\in F\}$ has a supremum, if
    7.49 +  it is non-empty and if it has an upperbound. *};
    7.50 +
    7.51 +  let ?S = "{s::real. EX u:F. s = a u}";
    7.52 +
    7.53 +  have "EX xi. isLub UNIV ?S xi";  
    7.54 +  proof (rule reals_complete);
    7.55 +  
    7.56 +    txt {* The set $S$ is non-empty, since $a\ap\zero \in S$ *};
    7.57 +
    7.58 +    from vs; have "a <0> : ?S"; by force;
    7.59 +    thus "EX X. X : ?S"; ..;
    7.60 +
    7.61 +    txt {* $b\ap \zero$ is an upperboud of $S$. *};
    7.62 +
    7.63 +    show "EX Y. isUb UNIV ?S Y"; 
    7.64 +    proof; 
    7.65 +      show "isUb UNIV ?S (b <0>)";
    7.66 +      proof (intro isUbI setleI ballI);
    7.67 +
    7.68 +        txt {* Every element $y\in S$ is less than $b\ap \zero$ *};  
    7.69 +
    7.70 +        fix y; assume y: "y : ?S"; 
    7.71 +        from y; have "EX u:F. y = a u"; ..;
    7.72 +        thus "y <= b <0>"; 
    7.73 +        proof;
    7.74 +          fix u; assume "u:F"; assume "y = a u";
    7.75 +          also; have "a u <= b <0>"; by (rule r) (simp!)+;
    7.76 +          finally; show ?thesis; .;
    7.77 +        qed;
    7.78 +      next;
    7.79 +        show "b <0> : UNIV"; by simp;
    7.80 +      qed;
    7.81 +    qed;
    7.82 +  qed;
    7.83 +
    7.84 +  thus "EX xi. (ALL y:F. a y <= xi) & (ALL y:F. xi <= b y)"; 
    7.85 +  proof (elim exE);
    7.86 +    fix xi; assume "isLub UNIV ?S xi"; 
    7.87 +    show ?thesis;
    7.88 +    proof (intro exI conjI ballI); 
    7.89 +   
    7.90 +      txt {* For all $y\in F$ is $a\ap y \leq \xi$. *};
    7.91 +     
    7.92 +      fix y; assume y: "y:F";
    7.93 +      show "a y <= xi";    
    7.94 +      proof (rule isUbD);  
    7.95 +        show "isUb UNIV ?S xi"; ..;
    7.96 +      qed (force!);
    7.97 +    next;
    7.98 +
    7.99 +      txt {* For all $y\in F$ is $\xi\leq b\ap y$. *};
   7.100 +
   7.101 +      fix y; assume "y:F";
   7.102 +      show "xi <= b y";  
   7.103 +      proof (intro isLub_le_isUb isUbI setleI);
   7.104 +        show "b y : UNIV"; by simp;
   7.105 +        show "ALL ya : ?S. ya <= b y"; 
   7.106 +        proof;
   7.107 +          fix au; assume au: "au : ?S ";
   7.108 +          hence "EX u:F. au = a u"; ..;
   7.109 +          thus "au <= b y";
   7.110 +          proof;
   7.111 +            fix u; assume "u:F"; assume "au = a u";  
   7.112 +            also; have "... <= b y"; by (rule r);
   7.113 +            finally; show ?thesis; .;
   7.114 +          qed;
   7.115 +        qed;
   7.116 +      qed; 
   7.117 +    qed;
   7.118 +  qed;
   7.119 +qed;
   7.120 +
   7.121 +text{* The function $h_0$ is defined as a linear extension of $h$
   7.122 +to $H_0$. $h_0$ is linear. *};
   7.123 +
   7.124 +lemma h0_lf: 
   7.125 +  "[| h0 = (\<lambda>x. let (y, a) = SOME (y, a). x = y + a <*> x0 & y:H 
   7.126 +                in h y + a * xi);
   7.127 +  H0 = H + lin x0; is_subspace H E; is_linearform H h; x0 ~: H; 
   7.128 +  x0 : E; x0 ~= <0>; is_vectorspace E |]
   7.129 +  ==> is_linearform H0 h0";
   7.130 +proof -;
   7.131 +  assume h0_def: 
   7.132 +    "h0 = (\<lambda>x. let (y, a) = SOME (y, a). x = y + a <*> x0 & y:H 
   7.133 +               in h y + a * xi)"
   7.134 +      and H0_def: "H0 = H + lin x0" 
   7.135 +      and vs: "is_subspace H E" "is_linearform H h" "x0 ~: H"
   7.136 +        "x0 ~= <0>" "x0 : E" "is_vectorspace E";
   7.137 +
   7.138 +  have h0: "is_vectorspace H0"; 
   7.139 +  proof (simp only: H0_def, rule vs_sum_vs);
   7.140 +    show "is_subspace (lin x0) E"; ..;
   7.141 +  qed; 
   7.142 +
   7.143 +  show ?thesis;
   7.144 +  proof;
   7.145 +    fix x1 x2; assume x1: "x1 : H0" and x2: "x2 : H0"; 
   7.146 +
   7.147 +    txt{* We now have to show that $h_0$ is linear 
   7.148 +    w.~r.~t.~addition, i.~e.~
   7.149 +    $h_0 \ap (x_1\plus x_2) = h_0\ap x_1 + h_0\ap x_2$
   7.150 +    for $x_1, x_2\in H$. *}; 
   7.151 +
   7.152 +    have x1x2: "x1 + x2 : H0"; 
   7.153 +      by (rule vs_add_closed, rule h0); 
   7.154 +    from x1; 
   7.155 +    have ex_x1: "EX y1 a1. x1 = y1 + a1 <*> x0  & y1 : H"; 
   7.156 +      by (simp add: H0_def vs_sum_def lin_def) blast;
   7.157 +    from x2; 
   7.158 +    have ex_x2: "EX y2 a2. x2 = y2 + a2 <*> x0 & y2 : H"; 
   7.159 +      by (simp add: H0_def vs_sum_def lin_def) blast;
   7.160 +    from x1x2; 
   7.161 +    have ex_x1x2: "EX y a. x1 + x2 = y + a <*> x0 & y : H";
   7.162 +      by (simp add: H0_def vs_sum_def lin_def) force;
   7.163 +
   7.164 +    from ex_x1 ex_x2 ex_x1x2;
   7.165 +    show "h0 (x1 + x2) = h0 x1 + h0 x2";
   7.166 +    proof (elim exE conjE);
   7.167 +      fix y1 y2 y a1 a2 a;
   7.168 +      assume y1: "x1 = y1 + a1 <*> x0"     and y1': "y1 : H"
   7.169 +         and y2: "x2 = y2 + a2 <*> x0"     and y2': "y2 : H" 
   7.170 +         and y: "x1 + x2 = y + a <*> x0"   and y':  "y  : H"; 
   7.171 +
   7.172 +      have ya: "y1 + y2 = y & a1 + a2 = a"; 
   7.173 +      proof (rule decomp_H0); 
   7.174 +        show "y1 + y2 + (a1 + a2) <*> x0 = y + a <*> x0"; 
   7.175 +          by (simp! add: vs_add_mult_distrib2 [of E]);
   7.176 +        show "y1 + y2 : H"; ..;
   7.177 +      qed;
   7.178 +
   7.179 +      have "h0 (x1 + x2) = h y + a * xi";
   7.180 +	by (rule h0_definite);
   7.181 +      also; have "... = h (y1 + y2) + (a1 + a2) * xi"; 
   7.182 +        by (simp add: ya);
   7.183 +      also; from vs y1' y2'; 
   7.184 +      have "... = h y1 + h y2 + a1 * xi + a2 * xi"; 
   7.185 +	by (simp add: linearform_add_linear [of H] 
   7.186 +                      real_add_mult_distrib);
   7.187 +      also; have "... = (h y1 + a1 * xi) + (h y2 + a2 * xi)"; 
   7.188 +        by simp;
   7.189 +      also; have "h y1 + a1 * xi = h0 x1"; 
   7.190 +        by (rule h0_definite [RS sym]);
   7.191 +      also; have "h y2 + a2 * xi = h0 x2"; 
   7.192 +        by (rule h0_definite [RS sym]);
   7.193 +      finally; show ?thesis; .;
   7.194 +    qed;
   7.195 + 
   7.196 +    txt{* We further have to show that $h_0$ is linear 
   7.197 +    w.~r.~t.~scalar multiplication, 
   7.198 +    i.~e.~ $c\in real$ $h_0\ap (c \mult x_1) = c \cdot h_0\ap x_1$
   7.199 +    for $x\in H$ and real $c$. 
   7.200 +    *}; 
   7.201 +
   7.202 +  next;  
   7.203 +    fix c x1; assume x1: "x1 : H0";    
   7.204 +    have ax1: "c <*> x1 : H0";
   7.205 +      by (rule vs_mult_closed, rule h0);
   7.206 +    from x1; have ex_x1: "EX y1 a1. x1 = y1 + a1 <*> x0 & y1 : H";
   7.207 +      by (simp add: H0_def vs_sum_def lin_def) fast;
   7.208 +    from x1; have ex_x: "!! x. x: H0 
   7.209 +                        ==> EX y a. x = y + a <*> x0 & y : H";
   7.210 +      by (simp add: H0_def vs_sum_def lin_def) fast;
   7.211 +    note ex_ax1 = ex_x [of "c <*> x1", OF ax1];
   7.212 +
   7.213 +    with ex_x1; show "h0 (c <*> x1) = c * (h0 x1)";  
   7.214 +    proof (elim exE conjE);
   7.215 +      fix y1 y a1 a; 
   7.216 +      assume y1: "x1 = y1 + a1 <*> x0"       and y1': "y1 : H"
   7.217 +        and y: "c <*> x1 = y  + a  <*> x0"   and y':  "y  : H"; 
   7.218 +
   7.219 +      have ya: "c <*> y1 = y & c * a1 = a"; 
   7.220 +      proof (rule decomp_H0); 
   7.221 +	show "c <*> y1 + (c * a1) <*> x0 = y + a <*> x0"; 
   7.222 +          by (simp! add: add: vs_add_mult_distrib1);
   7.223 +        show "c <*> y1 : H"; ..;
   7.224 +      qed;
   7.225 +
   7.226 +      have "h0 (c <*> x1) = h y + a * xi"; 
   7.227 +	by (rule h0_definite);
   7.228 +      also; have "... = h (c <*> y1) + (c * a1) * xi";
   7.229 +        by (simp add: ya);
   7.230 +      also; from vs y1'; have "... = c * h y1 + c * a1 * xi"; 
   7.231 +	by (simp add: linearform_mult_linear [of H]);
   7.232 +      also; from vs y1'; have "... = c * (h y1 + a1 * xi)"; 
   7.233 +	by (simp add: real_add_mult_distrib2 real_mult_assoc);
   7.234 +      also; have "h y1 + a1 * xi = h0 x1"; 
   7.235 +        by (rule h0_definite [RS sym]);
   7.236 +      finally; show ?thesis; .;
   7.237 +    qed;
   7.238 +  qed;
   7.239 +qed;
   7.240 +
   7.241 +text{* $h_0$ is bounded by the quasinorm $p$. *};
   7.242 +
   7.243 +lemma h0_norm_pres:
   7.244 +  "[| h0 = (\<lambda>x. let (y, a) = SOME (y, a). x = y + a <*> x0 & y:H 
   7.245 +                in h y + a * xi);
   7.246 +  H0 = H + lin x0; x0 ~: H; x0 : E; x0 ~= <0>; is_vectorspace E; 
   7.247 +  is_subspace H E; is_quasinorm E p; is_linearform H h; 
   7.248 +  ALL y:H. h y <= p y; (ALL y:H. - p (y + x0) - h y <= xi) 
   7.249 +  & (ALL y:H. xi <= p (y + x0) - h y) |]
   7.250 +   ==> ALL x:H0. h0 x <= p x"; 
   7.251 +proof; 
   7.252 +  assume h0_def: 
   7.253 +    "h0 = (\<lambda>x. let (y, a) = SOME (y, a). x = y + a <*> x0 & y:H 
   7.254 +               in (h y) + a * xi)"
   7.255 +    and H0_def: "H0 = H + lin x0" 
   7.256 +    and vs: "x0 ~: H" "x0 : E" "x0 ~= <0>" "is_vectorspace E" 
   7.257 +            "is_subspace H E" "is_quasinorm E p" "is_linearform H h" 
   7.258 +    and a:      " ALL y:H. h y <= p y";
   7.259 +  presume a1: "ALL y:H. - p (y + x0) - h y <= xi";
   7.260 +  presume a2: "ALL y:H. xi <= p (y + x0) - h y";
   7.261 +  fix x; assume "x : H0"; 
   7.262 +  have ex_x: 
   7.263 +    "!! x. x : H0 ==> EX y a. x = y + a <*> x0 & y : H";
   7.264 +    by (simp add: H0_def vs_sum_def lin_def) fast;
   7.265 +  have "EX y a. x = y + a <*> x0 & y : H";
   7.266 +    by (rule ex_x);
   7.267 +  thus "h0 x <= p x";
   7.268 +  proof (elim exE conjE);
   7.269 +    fix y a; assume x: "x = y + a <*> x0" and y: "y : H";
   7.270 +    have "h0 x = h y + a * xi";
   7.271 +      by (rule h0_definite);
   7.272 +
   7.273 +    txt{* Now we show  
   7.274 +    $h\ap y + a * xi\leq  p\ap (y\plus a \mult x_0)$ 
   7.275 +    by case analysis on $a$. *};
   7.276 +
   7.277 +    also; have "... <= p (y + a <*> x0)";
   7.278 +    proof (rule linorder_linear_split); 
   7.279 +
   7.280 +      assume z: "a = 0r"; 
   7.281 +      with vs y a; show ?thesis; by simp;
   7.282 +
   7.283 +    txt {* In the case $a < 0$ we use $a_1$ with $y$ taken as
   7.284 +    $\frac{y}{a}$. *};
   7.285 +
   7.286 +    next;
   7.287 +      assume lz: "a < 0r"; hence nz: "a ~= 0r"; by simp;
   7.288 +      from a1; 
   7.289 +      have "- p (rinv a <*> y + x0) - h (rinv a <*> y) <= xi";
   7.290 +        by (rule bspec)(simp!);
   7.291 + 
   7.292 +      txt {* The thesis now follows by a short calculation. *};      
   7.293 +
   7.294 +      hence "a * xi 
   7.295 +            <= a * (- p (rinv a <*> y + x0) - h (rinv a <*> y))";
   7.296 +        by (rule real_mult_less_le_anti [OF lz]);
   7.297 +      also; have "... = - a * (p (rinv a <*> y + x0)) 
   7.298 +                        - a * (h (rinv a <*> y))";
   7.299 +        by (rule real_mult_diff_distrib);
   7.300 +      also; from lz vs y; have "- a * (p (rinv a <*> y + x0)) 
   7.301 +                               = p (a <*> (rinv a <*> y + x0))";
   7.302 +        by (simp add: quasinorm_mult_distrib rabs_minus_eqI2);
   7.303 +      also; from nz vs y; have "... = p (y + a <*> x0)";
   7.304 +        by (simp add: vs_add_mult_distrib1);
   7.305 +      also; from nz vs y; have "a * (h (rinv a <*> y)) =  h y";
   7.306 +        by (simp add: linearform_mult_linear [RS sym]);
   7.307 +      finally; have "a * xi <= p (y + a <*> x0) - h y"; .;
   7.308 +
   7.309 +      hence "h y + a * xi <= h y + p (y + a <*> x0) - h y";
   7.310 +        by (simp add: real_add_left_cancel_le);
   7.311 +      thus ?thesis; by simp;
   7.312 +
   7.313 +      txt {* In the case $a > 0$ we use $a_2$ with $y$ taken
   7.314 +      as $\frac{y}{a}$. *};
   7.315 +    next; 
   7.316 +      assume gz: "0r < a"; hence nz: "a ~= 0r"; by simp;
   7.317 +      have "xi <= p (rinv a <*> y + x0) - h (rinv a <*> y)";
   7.318 +        by (rule bspec [OF a2]) (simp!);
   7.319 +
   7.320 +      txt {* The thesis follows by a short calculation. *};
   7.321 +
   7.322 +      with gz; have "a * xi 
   7.323 +            <= a * (p (rinv a <*> y + x0) - h (rinv a <*> y))";
   7.324 +        by (rule real_mult_less_le_mono);
   7.325 +      also; have "... = a * p (rinv a <*> y + x0) 
   7.326 +                        - a * h (rinv a <*> y)";
   7.327 +        by (rule real_mult_diff_distrib2); 
   7.328 +      also; from gz vs y; 
   7.329 +      have "a * p (rinv a <*> y + x0) 
   7.330 +           = p (a <*> (rinv a <*> y + x0))";
   7.331 +        by (simp add: quasinorm_mult_distrib rabs_eqI2);
   7.332 +      also; from nz vs y; 
   7.333 +      have "... = p (y + a <*> x0)";
   7.334 +        by (simp add: vs_add_mult_distrib1);
   7.335 +      also; from nz vs y; have "a * h (rinv a <*> y) = h y";
   7.336 +        by (simp add: linearform_mult_linear [RS sym]); 
   7.337 +      finally; have "a * xi <= p (y + a <*> x0) - h y"; .;
   7.338 + 
   7.339 +      hence "h y + a * xi <= h y + (p (y + a <*> x0) - h y)";
   7.340 +        by (simp add: real_add_left_cancel_le);
   7.341 +      thus ?thesis; by simp;
   7.342 +    qed;
   7.343 +    also; from x; have "... = p x"; by simp;
   7.344 +    finally; show ?thesis; .;
   7.345 +  qed;
   7.346 +qed blast+; 
   7.347 +
   7.348 +
   7.349 +end;
   7.350 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/HOL/Real/HahnBanach/HahnBanachSupLemmas.thy	Fri Oct 22 20:14:31 1999 +0200
     8.3 @@ -0,0 +1,692 @@
     8.4 +(*  Title:      HOL/Real/HahnBanach/HahnBanachSupLemmas.thy
     8.5 +    ID:         $Id$
     8.6 +    Author:     Gertrud Bauer, TU Munich
     8.7 +*)
     8.8 +
     8.9 +header {* The supremum w.r.t.~the function order *};
    8.10 +
    8.11 +theory HahnBanachSupLemmas = FunctionNorm + ZornLemma:;
    8.12 +
    8.13 +
    8.14 +
    8.15 +text{* This section contains some lemmas that will be used in the
    8.16 +proof of the Hahn-Banach theorem.
    8.17 +In this section the following context is presumed. 
    8.18 +Let $E$ be a real vector space with a quasinorm $q$ on $E$. 
    8.19 +$F$ is a subspace of $E$ and $f$ a linearform on $F$. We 
    8.20 +consider a chain $c$ of norm preserving extensions of $f$, such that
    8.21 +$\cup\; c = \idt{graph}\ap H\ap h$. 
    8.22 +We will show some properties about the limit function $h$, 
    8.23 +i.~e.~the supremum of the chain $c$.
    8.24 +*}; 
    8.25 +
    8.26 +(***
    8.27 +lemma some_H'h't:
    8.28 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
    8.29 +  graph H h = Union c; x:H|]
    8.30 +   ==> EX H' h' t. t : graph H h & t = (x, h x) & graph H' h':c 
    8.31 +       & t:graph H' h' & is_linearform H' h' & is_subspace H' E 
    8.32 +       & is_subspace F H' & graph F f <= graph H' h' 
    8.33 +       & (ALL x:H'. h' x <= p x)";
    8.34 +proof -;
    8.35 +  assume m: "M = norm_pres_extensions E p F f" and cM: "c: chain M"
    8.36 +     and u: "graph H h = Union c" "x:H";
    8.37 +
    8.38 +  let ?P = "\<lambda>H h. is_linearform H h
    8.39 +                & is_subspace H E
    8.40 +                & is_subspace F H
    8.41 +                & graph F f <= graph H h
    8.42 +                & (ALL x:H. h x <= p x)";
    8.43 +
    8.44 +  have "EX t : graph H h. t = (x, h x)"; 
    8.45 +    by (rule graphI2);
    8.46 +  thus ?thesis;
    8.47 +  proof (elim bexE); 
    8.48 +    fix t; assume t: "t : graph H h" "t = (x, h x)";
    8.49 +    with u; have ex1: "EX g:c. t:g";
    8.50 +      by (simp only: Union_iff);
    8.51 +    thus ?thesis;
    8.52 +    proof (elim bexE);
    8.53 +      fix g; assume g: "g:c" "t:g";
    8.54 +      from cM; have "c <= M"; by (rule chainD2);
    8.55 +      hence "g : M"; ..;
    8.56 +      hence "g : norm_pres_extensions E p F f"; by (simp only: m);
    8.57 +      hence "EX H' h'. graph H' h' = g & ?P H' h'"; 
    8.58 +        by (rule norm_pres_extension_D);
    8.59 +      thus ?thesis; 
    8.60 +       by (elim exE conjE, intro exI conjI) (simp | simp!)+;
    8.61 +    qed;
    8.62 +  qed;
    8.63 +qed;
    8.64 +***)
    8.65 +
    8.66 +text{* Let $c$ be a chain of norm preserving extensions of the 
    8.67 +function $f$ and let $\idt{graph}\ap H\ap h$ be the supremum of $c$. 
    8.68 +Every element in $H$ is member of
    8.69 +one of the elements of the chain. *};
    8.70 +
    8.71 +lemma some_H'h't:
    8.72 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
    8.73 +  graph H h = Union c; x:H|]
    8.74 +   ==> EX H' h'. graph H' h' : c & (x, h x) : graph H' h' 
    8.75 +       & is_linearform H' h' & is_subspace H' E 
    8.76 +       & is_subspace F H' & graph F f <= graph H' h' 
    8.77 +       & (ALL x:H'. h' x <= p x)";
    8.78 +proof -;
    8.79 +  assume m: "M = norm_pres_extensions E p F f" and "c: chain M"
    8.80 +     and u: "graph H h = Union c" "x:H";
    8.81 +
    8.82 +  have h: "(x, h x) : graph H h"; ..;
    8.83 +  with u; have "(x, h x) : Union c"; by simp;
    8.84 +  hence ex1: "EX g:c. (x, h x) : g"; 
    8.85 +    by (simp only: Union_iff);
    8.86 +  thus ?thesis;
    8.87 +  proof (elim bexE);
    8.88 +    fix g; assume g: "g:c" "(x, h x) : g";
    8.89 +    have "c <= M"; by (rule chainD2);
    8.90 +    hence "g : M"; ..;
    8.91 +    hence "g : norm_pres_extensions E p F f"; by (simp only: m);
    8.92 +    hence "EX H' h'. graph H' h' = g 
    8.93 +                  & is_linearform H' h'
    8.94 +                  & is_subspace H' E
    8.95 +                  & is_subspace F H'
    8.96 +                  & graph F f <= graph H' h'
    8.97 +                  & (ALL x:H'. h' x <= p x)";
    8.98 +      by (rule norm_pres_extension_D);
    8.99 +    thus ?thesis;
   8.100 +    proof (elim exE conjE); 
   8.101 +      fix H' h'; 
   8.102 +      assume "graph H' h' = g" "is_linearform H' h'" 
   8.103 +        "is_subspace H' E" "is_subspace F H'" 
   8.104 +        "graph F f <= graph H' h'" "ALL x:H'. h' x <= p x";
   8.105 +      show ?thesis; 
   8.106 +      proof (intro exI conjI);
   8.107 +        show "graph H' h' : c"; by (simp!);
   8.108 +        show "(x, h x) : graph H' h'"; by (simp!);
   8.109 +      qed;
   8.110 +    qed;
   8.111 +  qed;
   8.112 +qed;
   8.113 +
   8.114 +
   8.115 +text{*  Let $c$ be a chain of norm preserving extensions of the
   8.116 +function $f$ and let $\idt{graph}\ap H\ap h$ be the supremum of $c$. 
   8.117 +Every element in the domain $H$ of the supremum function is member of
   8.118 +the domain $H'$ of some function $h'$, such that $h$ extends $h'$.
   8.119 +*};
   8.120 +
   8.121 +lemma some_H'h': 
   8.122 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
   8.123 +  graph H h = Union c; x:H|] 
   8.124 +  ==> EX H' h'. x:H' & graph H' h' <= graph H h 
   8.125 +      & is_linearform H' h' & is_subspace H' E & is_subspace F H'
   8.126 +      & graph F f <= graph H' h' & (ALL x:H'. h' x <= p x)"; 
   8.127 +proof -;
   8.128 +  assume "M = norm_pres_extensions E p F f" and cM: "c: chain M"
   8.129 +     and u: "graph H h = Union c" "x:H";  
   8.130 +
   8.131 +  have "EX H' h'. graph H' h' : c & (x, h x) : graph H' h' 
   8.132 +       & is_linearform H' h' & is_subspace H' E 
   8.133 +       & is_subspace F H' & graph F f <= graph H' h' 
   8.134 +       & (ALL x:H'. h' x <= p x)";
   8.135 +    by (rule some_H'h't);
   8.136 +  thus ?thesis; 
   8.137 +  proof (elim exE conjE);
   8.138 +    fix H' h'; assume "(x, h x) : graph H' h'" "graph H' h' : c"
   8.139 +      "is_linearform H' h'" "is_subspace H' E" "is_subspace F H'" 
   8.140 +      "graph F f <= graph H' h'" "ALL x:H'. h' x <= p x";
   8.141 +    show ?thesis;
   8.142 +    proof (intro exI conjI);
   8.143 +      show "x:H'"; by (rule graphD1);
   8.144 +      from cM u; show "graph H' h' <= graph H h"; 
   8.145 +        by (simp! only: chain_ball_Union_upper);
   8.146 +    qed;
   8.147 +  qed;
   8.148 +qed;
   8.149 +
   8.150 +(***
   8.151 +lemma some_H'h': 
   8.152 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
   8.153 +  graph H h = Union c; x:H|] 
   8.154 +  ==> EX H' h'. x:H' & graph H' h' <= graph H h 
   8.155 +      & is_linearform H' h' & is_subspace H' E & is_subspace F H'
   8.156 +      & graph F f <= graph H' h' & (ALL x:H'. h' x <= p x)"; 
   8.157 +proof -;
   8.158 +  assume m: "M = norm_pres_extensions E p F f" and cM: "c: chain M"
   8.159 +     and u: "graph H h = Union c" "x:H";  
   8.160 +  have "(x, h x): graph H h"; by (rule graphI); 
   8.161 +  hence "(x, h x) : Union c"; by (simp!);
   8.162 +  hence "EX g:c. (x, h x):g"; by (simp only: Union_iff);
   8.163 +  thus ?thesis; 
   8.164 +  proof (elim bexE);
   8.165 +    fix g; assume g: "g:c" "(x, h x):g";
   8.166 +    from cM; have "c <= M"; by (rule chainD2);
   8.167 +    hence "g : M"; ..;
   8.168 +    hence "g : norm_pres_extensions E p F f"; by (simp only: m);
   8.169 +    hence "EX H' h'. graph H' h' = g 
   8.170 +                   & is_linearform H' h'
   8.171 +                   & is_subspace H' E
   8.172 +                   & is_subspace F H'
   8.173 +                   & graph F f <= graph H' h'
   8.174 +                   & (ALL x:H'. h' x <= p x)"; 
   8.175 +      by (rule norm_pres_extension_D);
   8.176 +    thus ?thesis; 
   8.177 +    proof (elim exE conjE, intro exI conjI);
   8.178 +      fix H' h'; assume g': "graph H' h' = g";
   8.179 +      with g; have "(x, h x): graph H' h'"; by simp;
   8.180 +      thus "x:H'"; by (rule graphD1);
   8.181 +      from g g'; have "graph H' h' : c"; by simp;
   8.182 +      with cM u; show "graph H' h' <= graph H h"; 
   8.183 +        by (simp only: chain_ball_Union_upper);
   8.184 +    qed simp+;
   8.185 +  qed;
   8.186 +qed;
   8.187 +***)
   8.188 +
   8.189 +
   8.190 +text{* Any two elements $x$ and $y$ in the domain $H$ of the 
   8.191 +supremum function $h$ lie both in the domain $H'$ of some function 
   8.192 +$h'$, such that $h$ extends $h'$. *};
   8.193 +
   8.194 +lemma some_H'h'2: 
   8.195 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
   8.196 +  graph H h = Union c;  x:H; y:H |] 
   8.197 +  ==> EX H' h'. x:H' & y:H' & graph H' h' <= graph H h 
   8.198 +      & is_linearform H' h' & is_subspace H' E & is_subspace F H'
   8.199 +      & graph F f <= graph H' h' & (ALL x:H'. h' x <= p x)"; 
   8.200 +proof -;
   8.201 +  assume "M = norm_pres_extensions E p F f" "c: chain M" 
   8.202 +         "graph H h = Union c" "x:H" "y:H";
   8.203 +
   8.204 +  txt {* $x$ is in the domain $H'$ of some function $h'$, 
   8.205 +  such that $h$ extends $h'$. *}; 
   8.206 +
   8.207 +  have e1: "EX H' h'. graph H' h' : c & (x, h x) : graph H' h'
   8.208 +       & is_linearform H' h' & is_subspace H' E 
   8.209 +       & is_subspace F H' & graph F f <= graph H' h' 
   8.210 +       & (ALL x:H'. h' x <= p x)";
   8.211 +    by (rule some_H'h't);
   8.212 +
   8.213 +  txt {* $y$ is in the domain $H''$ of some function $h''$,
   8.214 +  such that $h$ extends $h''$. *}; 
   8.215 +
   8.216 +  have e2: "EX H'' h''. graph H'' h'' : c & (y, h y) : graph H'' h''
   8.217 +       & is_linearform H'' h'' & is_subspace H'' E 
   8.218 +       & is_subspace F H'' & graph F f <= graph H'' h'' 
   8.219 +       & (ALL x:H''. h'' x <= p x)";
   8.220 +    by (rule some_H'h't);
   8.221 +
   8.222 +  from e1 e2; show ?thesis; 
   8.223 +  proof (elim exE conjE);
   8.224 +    fix H' h'; assume "(y, h y): graph H' h'" "graph H' h' : c"
   8.225 +      "is_linearform H' h'" "is_subspace H' E" "is_subspace F H'" 
   8.226 +      "graph F f <= graph H' h'" "ALL x:H'. h' x <= p x";
   8.227 +
   8.228 +    fix H'' h''; assume "(x, h x): graph H'' h''" "graph H'' h'' : c"
   8.229 +      "is_linearform H'' h''" "is_subspace H'' E" "is_subspace F H''"
   8.230 +      "graph F f <= graph H'' h''" "ALL x:H''. h'' x <= p x";
   8.231 +
   8.232 +   txt {* Since both $h'$ and $h''$ are elements of the chain,  
   8.233 +   $h''$ is an extension of $h'$ or vice versa. Thus both 
   8.234 +   $x$ and $y$ are contained in the greater one. *};
   8.235 +
   8.236 +    have "graph H'' h'' <= graph H' h' | graph H' h' <= graph H'' h''"
   8.237 +      (is "?case1 | ?case2");
   8.238 +      by (rule chainD);
   8.239 +    thus ?thesis;
   8.240 +    proof; 
   8.241 +      assume ?case1;
   8.242 +      show ?thesis;
   8.243 +      proof (intro exI conjI);
   8.244 +        have "(x, h x) : graph H'' h''"; .;
   8.245 +        also; have "... <= graph H' h'"; .;
   8.246 +        finally; have xh: "(x, h x): graph H' h'"; .;
   8.247 +        thus x: "x:H'"; ..;
   8.248 +        show y: "y:H'"; ..;
   8.249 +        show "graph H' h' <= graph H h";
   8.250 +          by (simp! only: chain_ball_Union_upper);
   8.251 +      qed;
   8.252 +    next;
   8.253 +      assume ?case2;
   8.254 +      show ?thesis;
   8.255 +      proof (intro exI conjI);
   8.256 +        show x: "x:H''"; ..;
   8.257 +        have "(y, h y) : graph H' h'"; by (simp!);
   8.258 +        also; have "... <= graph H'' h''"; .;
   8.259 +        finally; have yh: "(y, h y): graph H'' h''"; .;
   8.260 +        thus y: "y:H''"; ..;
   8.261 +        show "graph H'' h'' <= graph H h";
   8.262 +          by (simp! only: chain_ball_Union_upper);
   8.263 +      qed;
   8.264 +    qed;
   8.265 +  qed;
   8.266 +qed;
   8.267 +
   8.268 +(***
   8.269 +lemma some_H'h'2: 
   8.270 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
   8.271 +  graph H h = Union c;  x:H; y:H|] 
   8.272 +  ==> EX H' h'. x:H' & y:H' & graph H' h' <= graph H h 
   8.273 +      & is_linearform H' h' & is_subspace H' E & is_subspace F H' 
   8.274 +      & graph F f <= graph H' h' & (ALL x:H'. h' x <= p x)"; 
   8.275 +proof -;
   8.276 +  assume "M = norm_pres_extensions E p F f" "c: chain M" 
   8.277 +         "graph H h = Union c";
   8.278 + 
   8.279 +  let ?P = "\<lambda>H h. is_linearform H h 
   8.280 +                & is_subspace H E 
   8.281 +                & is_subspace F H
   8.282 +                & graph F f <= graph H h
   8.283 +                & (ALL x:H. h x <= p x)";
   8.284 +  assume "x:H";
   8.285 +  have e1: "EX H' h' t. t : graph H h & t = (x, h x) 
   8.286 +            & graph H' h' : c & t : graph H' h' & ?P H' h'";
   8.287 +    by (rule some_H'h't); 
   8.288 +  assume "y:H";
   8.289 +  have e2: "EX H' h' t. t : graph H h & t = (y, h y) 
   8.290 +            & graph H' h' : c & t:graph H' h' & ?P H' h'";
   8.291 +    by (rule some_H'h't); 
   8.292 +
   8.293 +  from e1 e2; show ?thesis; 
   8.294 +  proof (elim exE conjE);
   8.295 +    fix H' h' t' H'' h'' t''; 
   8.296 +    assume 
   8.297 +      "t' : graph H h"             "t'' : graph H h" 
   8.298 +      "t' = (y, h y)"              "t'' = (x, h x)"
   8.299 +      "graph H' h' : c"            "graph H'' h'' : c"
   8.300 +      "t' : graph H' h'"           "t'' : graph H'' h''" 
   8.301 +      "is_linearform H' h'"        "is_linearform H'' h''"
   8.302 +      "is_subspace H' E"           "is_subspace H'' E"
   8.303 +      "is_subspace F H'"           "is_subspace F H''"
   8.304 +      "graph F f <= graph H' h'"   "graph F f <= graph H'' h''"
   8.305 +      "ALL x:H'. h' x <= p x"      "ALL x:H''. h'' x <= p x";
   8.306 +
   8.307 +    have "graph H'' h'' <= graph H' h' 
   8.308 +         | graph H' h' <= graph H'' h''";
   8.309 +      by (rule chainD);
   8.310 +    thus "?thesis";
   8.311 +    proof; 
   8.312 +      assume "graph H'' h'' <= graph H' h'";
   8.313 +      show ?thesis;
   8.314 +      proof (intro exI conjI);
   8.315 +        note [trans] = subsetD;
   8.316 +        have "(x, h x) : graph H'' h''"; by (simp!);
   8.317 +	also; have "... <= graph H' h'"; .;
   8.318 +        finally; have xh: "(x, h x): graph H' h'"; .;
   8.319 +	thus x: "x:H'"; by (rule graphD1);
   8.320 +	show y: "y:H'"; by (simp!, rule graphD1);
   8.321 +	show "graph H' h' <= graph H h";
   8.322 +	  by (simp! only: chain_ball_Union_upper);
   8.323 +      qed;
   8.324 +    next;
   8.325 +      assume "graph H' h' <= graph H'' h''";
   8.326 +      show ?thesis;
   8.327 +      proof (intro exI conjI);
   8.328 +	show x: "x:H''"; by (simp!, rule graphD1);
   8.329 +        have "(y, h y) : graph H' h'"; by (simp!);
   8.330 +        also; have "... <= graph H'' h''"; .;
   8.331 +	finally; have yh: "(y, h y): graph H'' h''"; .;
   8.332 +        thus y: "y:H''"; by (rule graphD1);
   8.333 +        show "graph H'' h'' <= graph H h";
   8.334 +          by (simp! only: chain_ball_Union_upper);
   8.335 +      qed;
   8.336 +    qed;
   8.337 +  qed;
   8.338 +qed;
   8.339 +
   8.340 +***)
   8.341 +
   8.342 +text{* The relation induced by the graph of the supremum
   8.343 +of a chain $c$ is definite, i.~e.~it is the graph of a function. *};
   8.344 +
   8.345 +lemma sup_definite: 
   8.346 +  "[| M == norm_pres_extensions E p F f; c : chain M; 
   8.347 +  (x, y) : Union c; (x, z) : Union c |] ==> z = y";
   8.348 +proof -; 
   8.349 +  assume "c:chain M" "M == norm_pres_extensions E p F f"
   8.350 +    "(x, y) : Union c" "(x, z) : Union c";
   8.351 +  thus ?thesis;
   8.352 +  proof (elim UnionE chainE2);
   8.353 +
   8.354 +    txt{* Since both $(x, y) \in \cup\; c$ and $(x, z) \in cup c$
   8.355 +    they are menbers of some graphs $G_1$ and $G_2$, resp.~, such that
   8.356 +    both $G_1$ and $G_2$ are members of $c$*};
   8.357 +
   8.358 +    fix G1 G2; assume
   8.359 +      "(x, y) : G1" "G1 : c" "(x, z) : G2" "G2 : c" "c <= M";
   8.360 +
   8.361 +    have "G1 : M"; ..;
   8.362 +    hence e1: "EX H1 h1. graph H1 h1 = G1";  
   8.363 +      by (force! dest: norm_pres_extension_D);
   8.364 +    have "G2 : M"; ..;
   8.365 +    hence e2: "EX H2 h2. graph H2 h2 = G2";  
   8.366 +      by (force! dest: norm_pres_extension_D);
   8.367 +    from e1 e2; show ?thesis; 
   8.368 +    proof (elim exE);
   8.369 +      fix H1 h1 H2 h2; 
   8.370 +      assume "graph H1 h1 = G1" "graph H2 h2 = G2";
   8.371 +
   8.372 +      txt{* Since both h $G_1$ and $G_2$ are members of $c$, 
   8.373 +      $G_1$ is contained in $G_2$ or vice versa. *};
   8.374 +
   8.375 +      have "G1 <= G2 | G2 <= G1" (is "?case1 | ?case2"); ..;
   8.376 +      thus ?thesis;
   8.377 +      proof;
   8.378 +        assume ?case1;
   8.379 +        have "(x, y) : graph H2 h2"; by (force!);
   8.380 +        hence "y = h2 x"; ..;
   8.381 +        also; have "(x, z) : graph H2 h2"; by (simp!);
   8.382 +        hence "z = h2 x"; ..;
   8.383 +        finally; show ?thesis; .;
   8.384 +      next;
   8.385 +        assume ?case2;
   8.386 +        have "(x, y) : graph H1 h1"; by (simp!);
   8.387 +        hence "y = h1 x"; ..;
   8.388 +        also; have "(x, z) : graph H1 h1"; by (force!);
   8.389 +        hence "z = h1 x"; ..;
   8.390 +        finally; show ?thesis; .;
   8.391 +      qed;
   8.392 +    qed;
   8.393 +  qed;
   8.394 +qed;
   8.395 +
   8.396 +text{* The limit function $h$ is linear: Every element $x$
   8.397 +in the domain of $h$ is in the domain of 
   8.398 +a function $h'$ in the chain of norm preserving extensions.
   8.399 +Futher $h$ is an extension of $h'$ so the value
   8.400 +of $x$ are identical for $h'$ and $h$.
   8.401 +Finally, the function $h'$ is linear by construction of $M$.
   8.402 +*};
   8.403 +
   8.404 +lemma sup_lf: 
   8.405 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
   8.406 +  graph H h = Union c |] ==> is_linearform H h";
   8.407 +proof -; 
   8.408 +  assume "M = norm_pres_extensions E p F f" "c: chain M"
   8.409 +         "graph H h = Union c";
   8.410 + 
   8.411 +  show "is_linearform H h";
   8.412 +  proof;
   8.413 +    fix x y; assume "x : H" "y : H"; 
   8.414 +    have "EX H' h'. x:H' & y:H' & graph H' h' <= graph H h 
   8.415 +            & is_linearform H' h' & is_subspace H' E 
   8.416 +            & is_subspace F H' & graph F f <= graph H' h'
   8.417 +            & (ALL x:H'. h' x <= p x)";
   8.418 +      by (rule some_H'h'2);
   8.419 +
   8.420 +    txt {* We have to show that h is linear w.~r.~t. 
   8.421 +    addition. *};
   8.422 +
   8.423 +    thus "h (x + y) = h x + h y"; 
   8.424 +    proof (elim exE conjE);
   8.425 +      fix H' h'; assume "x:H'" "y:H'" 
   8.426 +        and b: "graph H' h' <= graph H h" 
   8.427 +        and "is_linearform H' h'" "is_subspace H' E";
   8.428 +      have "h' (x + y) = h' x + h' y"; 
   8.429 +        by (rule linearform_add_linear);
   8.430 +      also; have "h' x = h x"; ..;
   8.431 +      also; have "h' y = h y"; ..;
   8.432 +      also; have "x + y : H'"; ..;
   8.433 +      with b; have "h' (x + y) = h (x + y)"; ..;
   8.434 +      finally; show ?thesis; .;
   8.435 +    qed;
   8.436 +  next;  
   8.437 +    fix a x; assume "x : H";
   8.438 +    have "EX H' h'. x:H' & graph H' h' <= graph H h 
   8.439 +            & is_linearform H' h' & is_subspace H' E
   8.440 +            & is_subspace F H' & graph F f <= graph H' h' 
   8.441 +            & (ALL x:H'. h' x <= p x)";
   8.442 +      by (rule some_H'h');
   8.443 +
   8.444 +    txt{* We have to show that h is linear w.~r.~t. 
   8.445 +    skalar multiplication. *};
   8.446 +
   8.447 +    thus "h (a <*> x) = a * h x";
   8.448 +    proof (elim exE conjE);
   8.449 +      fix H' h'; assume "x:H'"
   8.450 +        and b: "graph H' h' <= graph H h" 
   8.451 +        and "is_linearform H' h'" "is_subspace H' E";
   8.452 +      have "h' (a <*> x) = a * h' x"; 
   8.453 +        by (rule linearform_mult_linear);
   8.454 +      also; have "h' x = h x"; ..;
   8.455 +      also; have "a <*> x : H'"; ..;
   8.456 +      with b; have "h' (a <*> x) = h (a <*> x)"; ..;
   8.457 +      finally; show ?thesis; .;
   8.458 +    qed;
   8.459 +  qed;
   8.460 +qed;
   8.461 +
   8.462 +text{* The limit of a non-empty chain of norm
   8.463 +preserving extensions of $f$ is an extension of $f$,
   8.464 +since every element of the chain is an extension
   8.465 +of $f$ and the supremum is an extension
   8.466 +for every element of the chain.*};
   8.467 +
   8.468 +lemma sup_ext:
   8.469 +  "[| M = norm_pres_extensions E p F f; c: chain M; EX x. x:c; 
   8.470 +  graph H h = Union c|] ==> graph F f <= graph H h";
   8.471 +proof -;
   8.472 +  assume "M = norm_pres_extensions E p F f" "c: chain M" 
   8.473 +         "graph H h = Union c";
   8.474 +  assume "EX x. x:c";
   8.475 +  thus ?thesis; 
   8.476 +  proof;
   8.477 +    fix x; assume "x:c"; 
   8.478 +    have "c <= M"; by (rule chainD2);
   8.479 +    hence "x:M"; ..;
   8.480 +    hence "x : norm_pres_extensions E p F f"; by (simp!);
   8.481 +
   8.482 +    hence "EX G g. graph G g = x
   8.483 +             & is_linearform G g 
   8.484 +             & is_subspace G E
   8.485 +             & is_subspace F G
   8.486 +             & graph F f <= graph G g 
   8.487 +             & (ALL x:G. g x <= p x)";
   8.488 +      by (simp! add: norm_pres_extension_D);
   8.489 +
   8.490 +    thus ?thesis; 
   8.491 +    proof (elim exE conjE); 
   8.492 +      fix G g; assume "graph G g = x" "graph F f <= graph G g";
   8.493 +      have "graph F f <= graph G g"; .;
   8.494 +      also; have "graph G g <= graph H h"; by (simp!, fast);
   8.495 +      finally; show ?thesis; .;
   8.496 +    qed;
   8.497 +  qed;
   8.498 +qed;
   8.499 +
   8.500 +text{* The domain $H$ of the limit function is a superspace
   8.501 +of $F$, since $F$ is a subset of $H$. The existence of 
   8.502 +the $\zero$ element in $F$ and the closeness properties
   8.503 +follow from the fact that $F$ is a vectorspace. *};
   8.504 +
   8.505 +lemma sup_supF: 
   8.506 +  "[| M = norm_pres_extensions E p F f; c: chain M; EX x. x:c;
   8.507 +  graph H h = Union c; is_subspace F E; is_vectorspace E |] 
   8.508 +  ==> is_subspace F H";
   8.509 +proof -; 
   8.510 +  assume "M = norm_pres_extensions E p F f" "c: chain M" "EX x. x:c"
   8.511 +    "graph H h = Union c" "is_subspace F E" "is_vectorspace E";
   8.512 +
   8.513 +  show ?thesis; 
   8.514 +  proof;
   8.515 +    show "<0> : F"; ..;
   8.516 +    show "F <= H"; 
   8.517 +    proof (rule graph_extD2);
   8.518 +      show "graph F f <= graph H h";
   8.519 +        by (rule sup_ext);
   8.520 +    qed;
   8.521 +    show "ALL x:F. ALL y:F. x + y : F"; 
   8.522 +    proof (intro ballI); 
   8.523 +      fix x y; assume "x:F" "y:F";
   8.524 +      show "x + y : F"; by (simp!);
   8.525 +    qed;
   8.526 +    show "ALL x:F. ALL a. a <*> x : F";
   8.527 +    proof (intro ballI allI);
   8.528 +      fix x a; assume "x:F";
   8.529 +      show "a <*> x : F"; by (simp!);
   8.530 +    qed;
   8.531 +  qed;
   8.532 +qed;
   8.533 +
   8.534 +text{* The domain $H$ of the limt function is a subspace
   8.535 +of $E$. *};
   8.536 +
   8.537 +lemma sup_subE: 
   8.538 +  "[| M = norm_pres_extensions E p F f; c: chain M; EX x. x:c; 
   8.539 +  graph H h = Union c; is_subspace F E; is_vectorspace E |] 
   8.540 +  ==> is_subspace H E";
   8.541 +proof -; 
   8.542 +  assume "M = norm_pres_extensions E p F f" "c: chain M" "EX x. x:c"
   8.543 +    "graph H h = Union c" "is_subspace F E" "is_vectorspace E";
   8.544 +  show ?thesis; 
   8.545 +  proof;
   8.546 + 
   8.547 +    txt {* The $\zero$ element lies in $H$, as $F$ is a subset 
   8.548 +    of $H$. *};
   8.549 +
   8.550 +    have "<0> : F"; ..;
   8.551 +    also; have "is_subspace F H"; by (rule sup_supF); 
   8.552 +    hence "F <= H"; ..;
   8.553 +    finally; show "<0> : H"; .;
   8.554 +
   8.555 +    txt{* $H$ is a subset of $E$. *};
   8.556 +
   8.557 +    show "H <= E"; 
   8.558 +    proof;
   8.559 +      fix x; assume "x:H";
   8.560 +      have "EX H' h'. x:H' & graph H' h' <= graph H h
   8.561 +              & is_linearform H' h' & is_subspace H' E 
   8.562 +              & is_subspace F H' & graph F f <= graph H' h' 
   8.563 +              & (ALL x:H'. h' x <= p x)"; 
   8.564 +	by (rule some_H'h');
   8.565 +      thus "x:E"; 
   8.566 +      proof (elim exE conjE);
   8.567 +	fix H' h'; assume "x:H'" "is_subspace H' E";
   8.568 +        have "H' <= E"; ..;
   8.569 +	thus "x:E"; ..;
   8.570 +      qed;
   8.571 +    qed;
   8.572 +
   8.573 +    txt{* $H$ is closed under addition. *};
   8.574 +
   8.575 +    show "ALL x:H. ALL y:H. x + y : H"; 
   8.576 +    proof (intro ballI); 
   8.577 +      fix x y; assume "x:H" "y:H";
   8.578 +      have "EX H' h'. x:H' & y:H' & graph H' h' <= graph H h 
   8.579 +              & is_linearform H' h' & is_subspace H' E 
   8.580 +              & is_subspace F H' & graph F f <= graph H' h' 
   8.581 +              & (ALL x:H'. h' x <= p x)"; 
   8.582 +	by (rule some_H'h'2); 
   8.583 +      thus "x + y : H"; 
   8.584 +      proof (elim exE conjE); 
   8.585 +	fix H' h'; 
   8.586 +        assume "x:H'" "y:H'" "is_subspace H' E" 
   8.587 +          "graph H' h' <= graph H h";
   8.588 +        have "x + y : H'"; ..;
   8.589 +	also; have "H' <= H"; ..;
   8.590 +	finally; show ?thesis; .;
   8.591 +      qed;
   8.592 +    qed;      
   8.593 +
   8.594 +    txt{* $H$ is closed under skalar multiplication. *};
   8.595 +
   8.596 +    show "ALL x:H. ALL a. a <*> x : H"; 
   8.597 +    proof (intro ballI allI); 
   8.598 +      fix x a; assume "x:H"; 
   8.599 +      have "EX H' h'. x:H' & graph H' h' <= graph H h
   8.600 +              & is_linearform H' h' & is_subspace H' E 
   8.601 +              & is_subspace F H' & graph F f <= graph H' h' 
   8.602 +              & (ALL x:H'. h' x <= p x)"; 
   8.603 +	by (rule some_H'h'); 
   8.604 +      thus "a <*> x : H"; 
   8.605 +      proof (elim exE conjE);
   8.606 +	fix H' h'; 
   8.607 +        assume "x:H'" "is_subspace H' E" "graph H' h' <= graph H h";
   8.608 +        have "a <*> x : H'"; ..;
   8.609 +        also; have "H' <= H"; ..;
   8.610 +	finally; show ?thesis; .;
   8.611 +      qed;
   8.612 +    qed;
   8.613 +  qed;
   8.614 +qed;
   8.615 +
   8.616 +text {* The limit functon is bounded by 
   8.617 +the norm $p$ as well, simce all elements in the chain are norm preserving.
   8.618 +*};
   8.619 +
   8.620 +lemma sup_norm_pres: 
   8.621 +  "[| M = norm_pres_extensions E p F f; c: chain M; 
   8.622 +  graph H h = Union c |] ==> ALL x:H. h x <= p x";
   8.623 +proof;
   8.624 +  assume "M = norm_pres_extensions E p F f" "c: chain M" 
   8.625 +         "graph H h = Union c";
   8.626 +  fix x; assume "x:H";
   8.627 +  have "EX H' h'. x:H' & graph H' h' <= graph H h 
   8.628 +          & is_linearform H' h' & is_subspace H' E & is_subspace F H'
   8.629 +          & graph F f <= graph H' h' & (ALL x:H'. h' x <= p x)"; 
   8.630 +    by (rule some_H'h');
   8.631 +  thus "h x <= p x"; 
   8.632 +  proof (elim exE conjE);
   8.633 +    fix H' h'; 
   8.634 +    assume "x: H'" "graph H' h' <= graph H h" 
   8.635 +      and a: "ALL x: H'. h' x <= p x";
   8.636 +    have [RS sym]: "h' x = h x"; ..;
   8.637 +    also; from a; have "h' x <= p x "; ..;
   8.638 +    finally; show ?thesis; .;  
   8.639 +  qed;
   8.640 +qed;
   8.641 +
   8.642 +
   8.643 +text_raw{* \medskip *}
   8.644 +text{* The following lemma is a property of real linearforms on 
   8.645 +real vector spaces. It will be used for the lemma 
   8.646 +$\idt{rabs{\dsh}HahnBanach}$.
   8.647 +For real vector spaces the following inequations are equivalent:
   8.648 +\begin{matharray}{ll} 
   8.649 +\forall x\in H.\ap |h\ap x|\leq p\ap x& {\rm and}\\ 
   8.650 +\forall x\in H.\ap h\ap x\leq p\ap x\\ 
   8.651 +\end{matharray}
   8.652 +*};
   8.653 +
   8.654 +lemma rabs_ineq_iff: 
   8.655 +  "[| is_subspace H E; is_vectorspace E; is_quasinorm E p; 
   8.656 +  is_linearform H h |] 
   8.657 +  ==> (ALL x:H. rabs (h x) <= p x) = (ALL x:H. h x <= p x)" 
   8.658 +  (concl is "?L = ?R");
   8.659 +proof -;
   8.660 +  assume "is_subspace H E" "is_vectorspace E" "is_quasinorm E p" 
   8.661 +         "is_linearform H h";
   8.662 +  have h: "is_vectorspace H"; ..;
   8.663 +  show ?thesis;
   8.664 +  proof; 
   8.665 +    assume l: ?L;
   8.666 +    show ?R;
   8.667 +    proof;
   8.668 +      fix x; assume x: "x:H";
   8.669 +      have "h x <= rabs (h x)"; by (rule rabs_ge_self);
   8.670 +      also; from l; have "... <= p x"; ..;
   8.671 +      finally; show "h x <= p x"; .;
   8.672 +    qed;
   8.673 +  next;
   8.674 +    assume r: ?R;
   8.675 +    show ?L;
   8.676 +    proof; 
   8.677 +      fix x; assume "x:H";
   8.678 +      show "!! a b. [| - a <= b; b <= a |] ==> rabs b <= a";
   8.679 +        by arith;
   8.680 +      show "- p x <= h x";
   8.681 +      proof (rule real_minus_le);
   8.682 +	from h; have "- h x = h (- x)"; 
   8.683 +          by (rule linearform_neg_linear [RS sym]);
   8.684 +	also; from r; have "... <= p (- x)"; by (simp!);
   8.685 +	also; have "... = p x"; 
   8.686 +          by (rule quasinorm_minus, rule subspace_subsetD);
   8.687 +	finally; show "- h x <= p x"; .; 
   8.688 +      qed;
   8.689 +      from r; show "h x <= p x"; ..; 
   8.690 +    qed;
   8.691 +  qed;
   8.692 +qed;  
   8.693 +
   8.694 +
   8.695 +end;
   8.696 \ No newline at end of file
     9.1 --- a/src/HOL/Real/HahnBanach/HahnBanach_h0_lemmas.thy	Fri Oct 22 18:41:00 1999 +0200
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,300 +0,0 @@
     9.4 -(*  Title:      HOL/Real/HahnBanach/HahnBanach_h0_lemmas.thy
     9.5 -    ID:         $Id$
     9.6 -    Author:     Gertrud Bauer, TU Munich
     9.7 -*)
     9.8 -
     9.9 -header {* Lemmas about the extension of a non-maximal function *};
    9.10 -
    9.11 -theory HahnBanach_h0_lemmas = FunctionNorm:;
    9.12 -
    9.13 -lemma ex_xi: 
    9.14 -  "[| is_vectorspace F;  (!! u v. [| u:F; v:F |] ==> a u <= b v )|]
    9.15 -  ==> EX xi::real. (ALL y:F. (a::'a => real) y <= xi) 
    9.16 -                 & (ALL y:F. xi <= b y)"; 
    9.17 -proof -;
    9.18 -  assume vs: "is_vectorspace F";
    9.19 -  assume r: "(!! u v. [| u:F; v:F |] ==> a u <= (b v::real))";
    9.20 -  have "EX t. isLub UNIV {s::real . EX u:F. s = a u} t";  
    9.21 -  proof (rule reals_complete);
    9.22 -    from vs; have "a <0> : {s. EX u:F. s = a u}"; by (force);
    9.23 -    thus "EX X. X : {s. EX u:F. s = a u}"; ..;
    9.24 -
    9.25 -    show "EX Y. isUb UNIV {s. EX u:F. s = a u} Y"; 
    9.26 -    proof; 
    9.27 -      show "isUb UNIV {s. EX u:F. s = a u} (b <0>)";
    9.28 -      proof (intro isUbI setleI ballI, fast);
    9.29 -        fix y; assume y: "y : {s. EX u:F. s = a u}"; 
    9.30 -        show "y <= b <0>"; 
    9.31 -        proof -;
    9.32 -          from y; have "EX u:F. y = a u"; by (fast);
    9.33 -          thus ?thesis;
    9.34 -          proof;
    9.35 -            fix u; assume "u:F"; 
    9.36 -            assume "y = a u";
    9.37 -            also; have "a u <= b <0>"; 
    9.38 -            proof (rule r);
    9.39 -              show "<0> : F"; ..;
    9.40 -            qed;
    9.41 -            finally; show ?thesis;.;
    9.42 -          qed;
    9.43 -        qed;
    9.44 -      qed;
    9.45 -    qed;
    9.46 -  qed;
    9.47 -  thus "EX xi. (ALL y:F. a y <= xi) & (ALL y:F. xi <= b y)"; 
    9.48 -  proof (elim exE);
    9.49 -    fix t; assume "isLub UNIV {s::real . EX u:F. s = a u} t"; 
    9.50 -    show ?thesis;
    9.51 -    proof (intro exI conjI ballI); 
    9.52 -      fix y; assume y: "y:F";
    9.53 -      show "a y <= t";    
    9.54 -      proof (rule isUbD);  
    9.55 -        show"isUb UNIV {s. EX u:F. s = a u} t"; ..;
    9.56 -      qed (force simp add: y);
    9.57 -    next;
    9.58 -      fix y; assume "y:F";
    9.59 -      show "t <= b y";  
    9.60 -      proof (intro isLub_le_isUb isUbI setleI);
    9.61 -        show "ALL ya : {s. EX u:F. s = a u}. ya <= b y"; 
    9.62 -        proof (intro ballI); 
    9.63 -          fix au; 
    9.64 -          assume au: "au : {s. EX u:F. s = a u} ";
    9.65 -          show "au <= b y";
    9.66 -          proof -; 
    9.67 -            from au; have "EX u:F. au = a u"; by (fast); 
    9.68 -            thus "au <= b y";
    9.69 -            proof;
    9.70 -              fix u; assume "u:F";
    9.71 -              assume "au = a u";  
    9.72 -              also; have "... <= b y"; by (rule r);
    9.73 -              finally; show ?thesis; .;
    9.74 -            qed;
    9.75 -          qed;
    9.76 -        qed;
    9.77 -        show "b y : UNIV"; by fast;
    9.78 -      qed; 
    9.79 -    qed;
    9.80 -  qed;
    9.81 -qed;
    9.82 -
    9.83 -lemma h0_lf: 
    9.84 -  "[| h0 = (%x. let (y, a) = @ (y, a). (x = y [+] a [*] x0 & y:H) 
    9.85 -                in (h y) + a * xi);
    9.86 -  H0 = vectorspace_sum H (lin x0); is_subspace H E; is_linearform H h; 
    9.87 -  x0 ~: H; x0 : E; x0 ~= <0>; is_vectorspace E |]
    9.88 -  ==> is_linearform H0 h0";
    9.89 -proof -;
    9.90 -  assume h0_def: 
    9.91 -    "h0 = (%x. let (y, a) = @ (y, a). (x = y [+] a [*] x0 & y:H) 
    9.92 -               in (h y) + a * xi)"
    9.93 -  and H0_def: "H0 = vectorspace_sum H (lin x0)"
    9.94 -  and vs: "is_subspace H E" "is_linearform H h" "x0 ~: H" "x0 ~= <0>" 
    9.95 -          "x0 : E" "is_vectorspace E";
    9.96 -
    9.97 -  have h0: "is_vectorspace H0"; 
    9.98 -  proof (simp only: H0_def, rule vs_sum_vs);
    9.99 -    show "is_subspace (lin x0) E"; by (rule lin_subspace); 
   9.100 -  qed; 
   9.101 -
   9.102 -  show ?thesis;
   9.103 -  proof;
   9.104 -    fix x1 x2; assume x1: "x1 : H0" and x2: "x2 : H0"; 
   9.105 -    have x1x2: "x1 [+] x2 : H0"; 
   9.106 -      by (rule vs_add_closed, rule h0);
   9.107 -  
   9.108 -    from x1; have ex_x1: "? y1 a1. (x1 = y1 [+] a1 [*] x0  & y1 : H)"; 
   9.109 -      by (simp add: H0_def vectorspace_sum_def lin_def) blast;
   9.110 -    from x2; have ex_x2: "? y2 a2. (x2 = y2 [+] a2 [*] x0 & y2 : H)"; 
   9.111 -      by (simp add: H0_def vectorspace_sum_def lin_def) blast;
   9.112 -    from x1x2; have ex_x1x2: "? y a. (x1 [+] x2 = y [+] a [*] x0  & y : H)";
   9.113 -      by (simp add: H0_def vectorspace_sum_def lin_def) force;
   9.114 -    from ex_x1 ex_x2 ex_x1x2;
   9.115 -    show "h0 (x1 [+] x2) = h0 x1 + h0 x2";
   9.116 -    proof (elim exE conjE);
   9.117 -      fix y1 y2 y a1 a2 a;
   9.118 -      assume y1: "x1 = y1 [+] a1 [*] x0"       and y1': "y1 : H"
   9.119 -         and y2: "x2 = y2 [+] a2 [*] x0"       and y2': "y2 : H" 
   9.120 -         and y: "x1 [+] x2 = y  [+] a  [*] x0" and y': "y  : H"; 
   9.121 -
   9.122 -      have ya: "y1 [+] y2 = y & a1 + a2 = a"; 
   9.123 -      proof (rule decomp4); 
   9.124 -        show "y1 [+] y2 [+] (a1 + a2) [*] x0 = y [+] a [*] x0"; 
   9.125 -        proof -;
   9.126 -          have "y [+] a [*] x0 = x1 [+] x2"; by (rule sym);
   9.127 -          also; from y1 y2; 
   9.128 -          have "... = y1 [+] a1 [*] x0 [+] (y2 [+] a2 [*] x0)"; by simp; 
   9.129 -          also; from vs y1' y2'; 
   9.130 -          have "... = y1 [+] y2 [+] (a1 [*] x0 [+] a2 [*] x0)"; by simp;
   9.131 -          also; from vs y1' y2'; 
   9.132 -          have "... = y1 [+] y2 [+] (a1 + a2) [*] x0"; 
   9.133 -            by (simp add: vs_add_mult_distrib2[of E]);
   9.134 -          finally; show ?thesis; by (rule sym);
   9.135 -        qed;
   9.136 -        show "y1 [+] y2 : H"; ..;
   9.137 -      qed;
   9.138 -      have y: "y1 [+] y2 = y"; by (rule conjunct1 [OF ya]);
   9.139 -      have a: "a1 + a2 = a";  by (rule conjunct2 [OF ya]);
   9.140 -
   9.141 -      have "h0 (x1 [+] x2) = h y + a * xi";
   9.142 -	by (rule decomp3);
   9.143 -      also; have "... = h (y1 [+] y2) + (a1 + a2) * xi"; by (simp add: y a);
   9.144 -      also; from vs y1' y2'; have  "... = h y1 + h y2 + a1 * xi + a2 * xi"; 
   9.145 -	by (simp add: linearform_add_linear [of H] real_add_mult_distrib);
   9.146 -      also; have "... = (h y1 + a1 * xi) + (h y2 + a2 * xi)"; by (simp);
   9.147 -      also; have "h y1 + a1 * xi = h0 x1"; by (rule decomp3 [RS sym]);
   9.148 -      also; have "h y2 + a2 * xi = h0 x2"; by (rule decomp3 [RS sym]);
   9.149 -      finally; show ?thesis; .;
   9.150 -    qed;
   9.151 - 
   9.152 -  next;  
   9.153 -    fix c x1; assume x1: "x1 : H0";
   9.154 -    
   9.155 -    have ax1: "c [*] x1 : H0";
   9.156 -      by (rule vs_mult_closed, rule h0);
   9.157 -    from x1; have ex_x1: "? y1 a1. (x1 = y1 [+] a1 [*] x0 & y1 : H)";
   9.158 -      by (simp add: H0_def vectorspace_sum_def lin_def, fast);
   9.159 -    from x1; 
   9.160 -    have ex_x: "!! x. x: H0 ==> ? y a. (x = y [+] a [*] x0 & y : H)"; 
   9.161 -      by (simp add: H0_def vectorspace_sum_def lin_def, fast);
   9.162 -    note ex_ax1 = ex_x [of "c [*] x1", OF ax1];
   9.163 -    from ex_x1 ex_ax1; show "h0 (c [*] x1) = c * (h0 x1)";  
   9.164 -    proof (elim exE conjE);
   9.165 -      fix y1 y a1 a; 
   9.166 -      assume y1: "x1 = y1 [+] a1 [*] x0"        and y1': "y1 : H"
   9.167 -	 and y:  "c [*] x1 = y  [+] a  [*] x0"  and y':  "y  : H"; 
   9.168 -
   9.169 -      have ya: "c [*] y1 = y & c * a1 = a"; 
   9.170 -      proof (rule decomp4); 
   9.171 -	show "c [*] y1 [+] (c * a1) [*] x0 = y [+] a [*] x0"; 
   9.172 -	proof -; 
   9.173 -          have "y [+] a [*] x0 = c [*] x1"; by (rule sym);
   9.174 -          also; from y1; have "... = c [*] (y1 [+] a1 [*] x0)"; by simp;
   9.175 -          also; from vs y1'; have "... = c [*] y1 [+] c [*] (a1 [*] x0)"; 
   9.176 -            by (simp add: vs_add_mult_distrib1);
   9.177 -          also; from vs y1'; have "... = c [*] y1 [+] (c * a1) [*] x0"; 
   9.178 -            by simp;
   9.179 -          finally; show ?thesis; by (rule sym);
   9.180 -        qed;
   9.181 -        show "c [*] y1: H"; ..;
   9.182 -      qed;
   9.183 -      have y: "c [*] y1 = y"; by (rule conjunct1 [OF ya]);
   9.184 -      have a: "c * a1 = a"; by (rule conjunct2 [OF ya]);
   9.185 -      
   9.186 -      have "h0 (c [*] x1) = h y + a * xi"; 
   9.187 -	by (rule decomp3);
   9.188 -      also; have "... = h (c [*] y1) + (c * a1) * xi";
   9.189 -        by (simp add: y a);
   9.190 -      also; from vs y1'; have  "... = c * h y1 + c * a1 * xi"; 
   9.191 -	by (simp add: linearform_mult_linear [of H] real_add_mult_distrib);
   9.192 -      also; from vs y1'; have "... = c * (h y1 + a1 * xi)"; 
   9.193 -	by (simp add: real_add_mult_distrib2 real_mult_assoc);
   9.194 -      also; have "h y1 + a1 * xi = h0 x1"; by (rule decomp3 [RS sym]);
   9.195 -      finally; show ?thesis; .;
   9.196 -    qed;
   9.197 -  qed;
   9.198 -qed;
   9.199 -
   9.200 -lemma h0_norm_pres:
   9.201 -  "[| h0 = (%x. let (y, a) = @ (y, a). (x = y [+] a [*] x0 & y:H) 
   9.202 -                in (h y) + a * xi);
   9.203 -  H0 = vectorspace_sum H (lin x0); x0 ~: H; x0 : E; x0 ~= <0>; 
   9.204 -  is_vectorspace E; is_subspace H E; is_quasinorm E p; is_linearform H h; 
   9.205 -  ALL y:H. h y <= p y;
   9.206 -  (ALL y:H. - p (y [+] x0) - h y <= xi) 
   9.207 -  & (ALL y:H. xi <= p (y [+] x0) - h y)|]
   9.208 -   ==> ALL x:H0. h0 x <= p x"; 
   9.209 -proof; 
   9.210 -  assume h0_def: 
   9.211 -    "h0 = (%x. let (y, a) = @ (y, a). (x = y [+] a [*] x0 & y:H) 
   9.212 -               in (h y) + a * xi)"
   9.213 -    and H0_def: "H0 = vectorspace_sum H (lin x0)" 
   9.214 -    and vs:     "x0 ~: H" "x0 : E" "x0 ~= <0>" "is_vectorspace E" 
   9.215 -                "is_subspace H E" "is_quasinorm E p" "is_linearform H h" 
   9.216 -    and a:      " ALL y:H. h y <= p y";
   9.217 -  presume a1: "(ALL y:H. - p (y [+] x0) - h y <= xi)";
   9.218 -  presume a2: "(ALL y:H. xi <= p (y [+] x0) - h y)";
   9.219 -  fix x; assume "x : H0"; 
   9.220 -  show "h0 x <= p x"; 
   9.221 -  proof -; 
   9.222 -    have ex_x: "!! x. x : H0 ==> ? y a. (x = y [+] a [*] x0 & y : H)";
   9.223 -      by (simp add: H0_def vectorspace_sum_def lin_def, fast);
   9.224 -    have "? y a. (x = y [+] a [*] x0 & y : H)";
   9.225 -      by (rule ex_x);
   9.226 -    thus ?thesis;
   9.227 -    proof (elim exE conjE);
   9.228 -      fix y a; assume x: "x = y [+] a [*] x0" and y: "y : H";
   9.229 -      show ?thesis;
   9.230 -      proof -;
   9.231 -        have "h0 x = h y + a * xi";
   9.232 -          by (rule decomp3);
   9.233 -        also; have "... <= p (y [+] a [*] x0)";
   9.234 -        proof (rule real_linear_split [of a "0r"]); (*** case analysis ***)
   9.235 -          assume lz: "a < 0r"; hence nz: "a ~= 0r"; by force;
   9.236 -          show ?thesis;
   9.237 -          proof -;
   9.238 -            from a1; 
   9.239 -            have "- p (rinv a [*] y [+] x0) - h (rinv a [*] y) <= xi";
   9.240 -              by (rule bspec, simp!);
   9.241 -            
   9.242 -            with lz; 
   9.243 -            have "a * xi <= a * (- p (rinv a [*] y [+] x0) - h (rinv a [*] y))";
   9.244 -              by (rule real_mult_less_le_anti);
   9.245 -            also; have "... = - a * (p (rinv a [*] y [+] x0)) - a * (h (rinv a [*] y))";
   9.246 -              by (rule real_mult_diff_distrib);
   9.247 -            also; from lz vs y; 
   9.248 -            have "- a * (p (rinv a [*] y [+] x0)) = p (a [*] (rinv a [*] y [+] x0))";
   9.249 -              by (simp add: quasinorm_mult_distrib rabs_minus_eqI2 [RS sym]);
   9.250 -            also; from nz vs y; have "... = p (y [+] a [*] x0)";
   9.251 -              by (simp add: vs_add_mult_distrib1);
   9.252 -            also; from nz vs y; have "a * (h (rinv a [*] y)) =  h y";
   9.253 -              by (simp add: linearform_mult_linear [RS sym]);
   9.254 -            finally; have "a * xi <= p (y [+] a [*] x0) - h y"; .;
   9.255 -
   9.256 -            hence "h y + a * xi <= h y + (p (y [+] a [*] x0) - h y)";
   9.257 -              by (rule real_add_left_cancel_le [RS iffD2]);
   9.258 -            thus ?thesis; 
   9.259 -              by simp;
   9.260 -	  qed;
   9.261 -
   9.262 -        next;
   9.263 -          assume z: "a = 0r"; 
   9.264 -          with vs y a; show ?thesis; by simp;
   9.265 -
   9.266 -        next; 
   9.267 -          assume gz: "0r < a"; hence nz: "a ~= 0r"; by force;
   9.268 -          show ?thesis;
   9.269 -          proof -;
   9.270 -            from a2; 
   9.271 -            have "xi <= p (rinv a [*] y [+] x0) - h (rinv a [*] y)";
   9.272 -              by (rule bspec, simp!);
   9.273 -
   9.274 -            with gz; 
   9.275 -            have "a * xi <= a * (p (rinv a [*] y [+] x0) - h (rinv a [*] y))";
   9.276 -              by (rule real_mult_less_le_mono);
   9.277 -            also; 
   9.278 -            have "... = a * (p (rinv a [*] y [+] x0)) - a * (h (rinv a [*] y))";
   9.279 -              by (rule real_mult_diff_distrib2); 
   9.280 -            also; from gz vs y; 
   9.281 -            have "a * (p (rinv a [*] y [+] x0)) = p (a [*] (rinv a [*] y [+] x0))";
   9.282 -              by (simp add: quasinorm_mult_distrib rabs_eqI2);
   9.283 -            also; from nz vs y; 
   9.284 -            have "... = p (y [+] a [*] x0)";
   9.285 -              by (simp add: vs_add_mult_distrib1);
   9.286 -            also; from nz vs y; have "a * (h (rinv a [*] y)) = h y";
   9.287 -              by (simp add: linearform_mult_linear [RS sym]); 
   9.288 -            finally; have "a * xi <= p (y [+] a [*] x0) - h y"; .;
   9.289 - 
   9.290 -            hence "h y + a * xi <= h y + (p (y [+] a [*] x0) - h y)";
   9.291 -              by (rule real_add_left_cancel_le [RS iffD2]);
   9.292 -            thus ?thesis; 
   9.293 -              by simp;
   9.294 -          qed;
   9.295 -        qed;
   9.296 -        also; from x; have "... = p x"; by (simp);
   9.297 -        finally; show ?thesis; .;
   9.298 -      qed; 
   9.299 -    qed;
   9.300 -  qed; 
   9.301 -qed blast+;
   9.302 -
   9.303 -end;
   9.304 \ No newline at end of file
    10.1 --- a/src/HOL/Real/HahnBanach/HahnBanach_lemmas.thy	Fri Oct 22 18:41:00 1999 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,497 +0,0 @@
    10.4 -(*  Title:      HOL/Real/HahnBanach/HahnBanach_lemmas.thy
    10.5 -    ID:         $Id$
    10.6 -    Author:     Gertrud Bauer, TU Munich
    10.7 -*)
    10.8 -
    10.9 -header {* Lemmas about the supremal function w.r.t.~the function order *};
   10.10 -
   10.11 -theory HahnBanach_lemmas = FunctionNorm + Zorn_Lemma:;
   10.12 -
   10.13 -lemma rabs_ineq: 
   10.14 -  "[| is_subspace H E; is_vectorspace E; is_quasinorm E p; is_linearform H h |] 
   10.15 -  ==>  (ALL x:H. rabs (h x) <= p x)  = ( ALL x:H. h x <= p x)" 
   10.16 -  (concl is "?L = ?R");
   10.17 -proof -;
   10.18 -  assume "is_subspace H E" "is_vectorspace E" "is_quasinorm E p" 
   10.19 -         "is_linearform H h";
   10.20 -  have h: "is_vectorspace H"; ..;
   10.21 -  show ?thesis;
   10.22 -  proof; 
   10.23 -    assume l: ?L;
   10.24 -    then; show ?R;
   10.25 -    proof (intro ballI); 
   10.26 -      fix x; assume x: "x:H";
   10.27 -      have "h x <= rabs (h x)"; by (rule rabs_ge_self);
   10.28 -      also; from l; have "... <= p x"; ..;
   10.29 -      finally; show "h x <= p x"; .;
   10.30 -    qed;
   10.31 -  next;
   10.32 -    assume r: ?R;
   10.33 -    then; show ?L;
   10.34 -    proof (intro ballI);
   10.35 -      fix x; assume "x:H";
   10.36 - 
   10.37 -      show "rabs (h x) <= p x"; 
   10.38 -      proof -; 
   10.39 -        show "!! r x. [| - r <= x; x <= r |] ==> rabs x <= r";
   10.40 -          by arith;
   10.41 -	show "- p x <= h x";
   10.42 -	proof (rule real_minus_le);
   10.43 -	  from h; have "- h x = h ([-] x)"; 
   10.44 -            by (rule linearform_neg_linear [RS sym]);
   10.45 -	  also; from r; have "... <= p ([-] x)"; by (simp!);
   10.46 -	  also; have "... = p x"; 
   10.47 -            by (rule quasinorm_minus, rule subspace_subsetD);
   10.48 -	  finally; show "- h x <= p x"; .; 
   10.49 -	qed;
   10.50 -	from r; show "h x <= p x"; ..; 
   10.51 -      qed;
   10.52 -    qed;
   10.53 -  qed;
   10.54 -qed;  
   10.55 -
   10.56 -lemma  some_H'h't:
   10.57 -  "[| M = norm_pres_extensions E p F f; c: chain M; graph H h = Union c; 
   10.58 -  x:H|]
   10.59 -   ==> EX H' h' t. t : (graph H h) & t = (x, h x) & (graph H' h'):c 
   10.60 -                 & t:graph H' h' & is_linearform H' h' & is_subspace H' E 
   10.61 -                 & is_subspace F H' & (graph F f <= graph H' h') 
   10.62 -                 & (ALL x:H'. h' x <= p x)";
   10.63 -proof -;
   10.64 -  assume m: "M = norm_pres_extensions E p F f" and cM: "c: chain M" 
   10.65 -     and u: "graph H h = Union c" "x:H";
   10.66 -
   10.67 -  let ?P = "%H h. is_linearform H h
   10.68 -                    & is_subspace H E
   10.69 -                    & is_subspace F H
   10.70 -                    & (graph F f <= graph H h)
   10.71 -                    & (ALL x:H. h x <= p x)";
   10.72 -
   10.73 -  have "EX t : (graph H h). t = (x, h x)"; 
   10.74 -    by (rule graphI2);
   10.75 -  thus ?thesis;
   10.76 -  proof (elim bexE); 
   10.77 -    fix t; assume t: "t : (graph H h)" "t = (x, h x)";
   10.78 -    with u; have ex1: "EX g:c. t:g";
   10.79 -      by (simp only: Union_iff);
   10.80 -    thus ?thesis;
   10.81 -    proof (elim bexE);
   10.82 -      fix g; assume g: "g:c" "t:g";
   10.83 -      from cM; have "c <= M"; by (rule chainD2);
   10.84 -      hence "g : M"; ..;
   10.85 -      hence "g : norm_pres_extensions E p F f"; by (simp only: m);
   10.86 -      hence "EX H' h'. graph H' h' = g & ?P H' h'"; 
   10.87 -        by (rule norm_pres_extension_D);
   10.88 -      thus ?thesis; by (elim exE conjE, intro exI conjI) (simp | simp!)+;
   10.89 -    qed;
   10.90 -  qed;
   10.91 -qed;
   10.92 -      
   10.93 -lemma some_H'h': "[| M = norm_pres_extensions E p F f; c: chain M; 
   10.94 -  graph H h = Union c; x:H|] 
   10.95 -  ==> EX H' h'. x:H' & (graph H' h' <= graph H h) & 
   10.96 -                is_linearform H' h' & is_subspace H' E & is_subspace F H' & 
   10.97 -                (graph F f <= graph H' h') & (ALL x:H'. h' x <= p x)"; 
   10.98 -proof -;
   10.99 -  assume m: "M = norm_pres_extensions E p F f" and cM: "c: chain M" 
  10.100 -     and u: "graph H h = Union c" "x:H";  
  10.101 -  have "(x, h x): graph H h"; by (rule graphI); 
  10.102 -  also; have "... = Union c"; .;
  10.103 -  finally; have "(x, h x) : Union c"; .;
  10.104 -  hence "EX g:c. (x, h x):g"; by (simp only: Union_iff);
  10.105 -  thus ?thesis; 
  10.106 -  proof (elim bexE);
  10.107 -    fix g; assume g: "g:c" "(x, h x):g";
  10.108 -    from cM; have "c <= M"; by (rule chainD2);
  10.109 -    hence "g : M"; ..;
  10.110 -    hence "g : norm_pres_extensions E p F f"; by (simp only: m);
  10.111 -    hence "EX H' h'. graph H' h' = g 
  10.112 -                   & is_linearform H' h'
  10.113 -                   & is_subspace H' E
  10.114 -                   & is_subspace F H'
  10.115 -                   & (graph F f <= graph H' h')
  10.116 -                   & (ALL x:H'. h' x <= p x)"; 
  10.117 -      by (rule norm_pres_extension_D);
  10.118 -    thus ?thesis; 
  10.119 -    proof (elim exE conjE, intro exI conjI);
  10.120 -      fix H' h'; assume g': "graph H' h' = g";
  10.121 -      with g; have "(x, h x): graph H' h'"; by simp;
  10.122 -      thus "x:H'"; by (rule graphD1);
  10.123 -      from g g'; have "graph H' h' : c"; by simp;
  10.124 -      with cM u; show "graph H' h' <= graph H h"; 
  10.125 -        by (simp only: chain_ball_Union_upper);
  10.126 -    qed simp+;
  10.127 -  qed;
  10.128 -qed;
  10.129 -
  10.130 -lemma some_H'h'2: 
  10.131 -  "[| M = norm_pres_extensions E p F f; c: chain M; graph H h = Union c; 
  10.132 -  x:H; y:H|] 
  10.133 -  ==> EX H' h'. x:H' & y:H' & (graph H' h' <= graph H h) 
  10.134 -  & is_linearform H' h' & is_subspace H' E & is_subspace F H' & 
  10.135 -                (graph F f <= graph H' h') & (ALL x:H'. h' x <= p x)"; 
  10.136 -proof -;
  10.137 -  assume "M = norm_pres_extensions E p F f" "c: chain M" 
  10.138 -         "graph H h = Union c";
  10.139 - 
  10.140 -  let ?P = "%H h. is_linearform H h 
  10.141 -                    & is_subspace H E 
  10.142 -                    & is_subspace F H
  10.143 -                    & (graph F f <= graph H h)
  10.144 -                    & (ALL x:H. h x <= p x)";
  10.145 -  assume "x:H";
  10.146 -  have e1: "EX H' h' t. t : (graph H h) & t = (x, h x) & (graph H' h'):c 
  10.147 -                      & t:graph H' h' & ?P H' h'";
  10.148 -    by (rule some_H'h't); 
  10.149 -  assume "y:H";
  10.150 -  have e2: "EX H' h' t. t : (graph H h) & t = (y, h y) & (graph H' h'):c 
  10.151 -                      & t:graph H' h' & ?P H' h'";
  10.152 -    by (rule some_H'h't); 
  10.153 -
  10.154 -  from e1 e2; show ?thesis; 
  10.155 -  proof (elim exE conjE);
  10.156 -    fix H' h' t' H'' h'' t''; 
  10.157 -    assume "t' : graph H h"             "t'' : graph H h" 
  10.158 -           "t' = (y, h y)"              "t'' = (x, h x)"
  10.159 -           "graph H' h' : c"            "graph H'' h'' : c"
  10.160 -           "t' : graph H' h'"           "t'' : graph H'' h''" 
  10.161 -           "is_linearform H' h'"        "is_linearform H'' h''"
  10.162 -           "is_subspace H' E"           "is_subspace H'' E"
  10.163 -           "is_subspace F H'"           "is_subspace F H''"
  10.164 -           "graph F f <= graph H' h'"   "graph F f <= graph H'' h''"
  10.165 -           "ALL x:H'. h' x <= p x"      "ALL x:H''. h'' x <= p x";
  10.166 -
  10.167 -    have "(graph H'' h'') <= (graph H' h') 
  10.168 -         | (graph H' h') <= (graph H'' h'')";
  10.169 -      by (rule chainD);
  10.170 -    thus "?thesis";
  10.171 -    proof; 
  10.172 -      assume "(graph H'' h'') <= (graph H' h')";
  10.173 -      show ?thesis;
  10.174 -      proof (intro exI conjI);
  10.175 -        note [trans] = subsetD;
  10.176 -        have "(x, h x) : graph H'' h''"; by (simp!);
  10.177 -	also; have "... <= graph H' h'"; .;
  10.178 -        finally; have xh: "(x, h x): graph H' h'"; .;
  10.179 -	thus x: "x:H'"; by (rule graphD1);
  10.180 -	show y: "y:H'"; by (simp!, rule graphD1);
  10.181 -	show "(graph H' h') <= (graph H h)";
  10.182 -	  by (simp! only: chain_ball_Union_upper);
  10.183 -      qed;
  10.184 -    next;
  10.185 -      assume "(graph H' h') <= (graph H'' h'')";
  10.186 -      show ?thesis;
  10.187 -      proof (intro exI conjI);
  10.188 -	show x: "x:H''"; by (simp!, rule graphD1);
  10.189 -        have "(y, h y) : graph H' h'"; by (simp!);
  10.190 -        also; have "... <= graph H'' h''"; .;
  10.191 -	finally; have yh: "(y, h y): graph H'' h''"; .;
  10.192 -        thus y: "y:H''"; by (rule graphD1);
  10.193 -        show "(graph H'' h'') <= (graph H h)";
  10.194 -          by (simp! only: chain_ball_Union_upper);
  10.195 -      qed;
  10.196 -    qed;
  10.197 -  qed;
  10.198 -qed;
  10.199 -
  10.200 -lemma sup_uniq: 
  10.201 -  "[| is_vectorspace E; is_subspace F E; is_quasinorm E p; 
  10.202 -  is_linearform F f; ALL x:F. f x <= p x; M == norm_pres_extensions E p F f;
  10.203 -   c : chain M; EX x. x : c; (x, y) : Union c; (x, z) : Union c |]
  10.204 -   ==> z = y";
  10.205 -proof -;
  10.206 -  assume "M == norm_pres_extensions E p F f" "c : chain M" 
  10.207 -         "(x, y) : Union c" " (x, z) : Union c";
  10.208 -  hence "EX H h. (x, y) : graph H h & (x, z) : graph H h"; 
  10.209 -  proof (elim UnionE chainE2); 
  10.210 -    fix G1 G2; 
  10.211 -    assume "(x, y) : G1" "G1 : c" "(x, z) : G2" "G2 : c" "c <= M";
  10.212 -    have "G1 : M"; ..;
  10.213 -    hence e1: "EX H1 h1. graph H1 h1 = G1";  
  10.214 -      by (force! dest: norm_pres_extension_D);
  10.215 -    have "G2 : M"; ..;
  10.216 -    hence e2: "EX H2 h2. graph H2 h2 = G2";  
  10.217 -      by (force! dest: norm_pres_extension_D);
  10.218 -    from e1 e2; show ?thesis; 
  10.219 -    proof (elim exE);
  10.220 -      fix H1 h1 H2 h2; assume "graph H1 h1 = G1" "graph H2 h2 = G2";
  10.221 -      have "G1 <= G2 | G2 <= G1"; ..;
  10.222 -      thus ?thesis;
  10.223 -      proof;
  10.224 -        assume "G1 <= G2";
  10.225 -        thus ?thesis;
  10.226 -        proof (intro exI conjI);
  10.227 -          show "(x, y) : graph H2 h2"; by (force!);
  10.228 -          show "(x, z) : graph H2 h2"; by (simp!);
  10.229 -        qed;
  10.230 -      next;
  10.231 -        assume "G2 <= G1";
  10.232 -        thus ?thesis;
  10.233 -        proof (intro exI conjI);
  10.234 -          show "(x, y) : graph H1 h1"; by (simp!);
  10.235 -          show "(x, z) : graph H1 h1"; by (force!);
  10.236 -        qed;
  10.237 -      qed;
  10.238 -    qed;
  10.239 -  qed;
  10.240 -  thus ?thesis; 
  10.241 -  proof (elim exE conjE);
  10.242 -    fix H h; assume "(x, y) : graph H h" "(x, z) : graph H h";
  10.243 -    have "y = h x"; ..;
  10.244 -    also; have "... = z"; by (rule sym, rule);
  10.245 -    finally; show "z = y"; by (rule sym);
  10.246 -  qed;
  10.247 -qed;
  10.248 -
  10.249 -lemma sup_lf: 
  10.250 -  "[| M = norm_pres_extensions E p F f; c: chain M; graph H h = Union c|] 
  10.251 -   ==> is_linearform H h";
  10.252 -proof -; 
  10.253 -  assume "M = norm_pres_extensions E p F f" "c: chain M"
  10.254 -         "graph H h = Union c";
  10.255 - 
  10.256 -  let ?P = "%H h. is_linearform H h 
  10.257 -                    & is_subspace H E 
  10.258 -                    & is_subspace F H
  10.259 -                    & (graph F f <= graph H h)
  10.260 -                    & (ALL x:H. h x <= p x)";
  10.261 -
  10.262 -  show "is_linearform H h";
  10.263 -  proof;
  10.264 -    fix x y; assume "x : H" "y : H"; 
  10.265 -    show "h (x [+] y) = h x + h y"; 
  10.266 -    proof -;
  10.267 -      have "EX H' h'. x:H' & y:H' & (graph H' h' <= graph H h) 
  10.268 -                    & is_linearform H' h' & is_subspace H' E 
  10.269 -                    & is_subspace F H' &  (graph F f <= graph H' h') 
  10.270 -                    & (ALL x:H'. h' x <= p x)";
  10.271 -        by (rule some_H'h'2);
  10.272 -      thus ?thesis; 
  10.273 -      proof (elim exE conjE);
  10.274 -        fix H' h'; assume "x:H'" "y:H'" 
  10.275 -          and b: "graph H' h' <= graph H h" 
  10.276 -          and "is_linearform H' h'" "is_subspace H' E";
  10.277 -        have h'x: "h' x = h x"; ..;
  10.278 -        have h'y: "h' y = h y"; ..;
  10.279 -        have h'xy: "h' (x [+] y) = h' x + h' y"; 
  10.280 -          by (rule linearform_add_linear);
  10.281 -        have "h' (x [+] y) = h (x [+] y)";  
  10.282 -        proof -;
  10.283 -          have "x [+] y : H'"; ..;
  10.284 -          with b; show ?thesis; ..;
  10.285 -        qed;
  10.286 -        with h'x h'y h'xy; show ?thesis;
  10.287 -          by (simp!); 
  10.288 -      qed;
  10.289 -    qed;
  10.290 -  next;  
  10.291 -    fix a x; assume  "x : H";
  10.292 -    show "h (a [*] x) = a * (h x)"; 
  10.293 -    proof -;
  10.294 -      have "EX H' h'. x:H' & (graph H' h' <= graph H h) 
  10.295 -                    & is_linearform H' h' & is_subspace H' E
  10.296 -                    & is_subspace F H' & (graph F f <= graph H' h') 
  10.297 -                    & (ALL x:H'. h' x <= p x)";
  10.298 -	by (rule some_H'h');
  10.299 -      thus ?thesis; 
  10.300 -      proof (elim exE conjE);
  10.301 -	fix H' h';
  10.302 -	assume b: "graph H' h' <= graph H h";
  10.303 -	assume "x:H'" "is_linearform H' h'" "is_subspace H' E";
  10.304 -	have h'x: "h' x = h x"; ..;
  10.305 -	have h'ax: "h' (a [*] x) = a * h' x"; 
  10.306 -          by (rule linearform_mult_linear);
  10.307 -	have "h' (a [*] x) = h (a [*] x)";
  10.308 -	proof -;
  10.309 -	  have "a [*] x : H'"; ..;
  10.310 -	  with b; show ?thesis; ..;
  10.311 -	qed;
  10.312 -	with h'x h'ax; show ?thesis;
  10.313 -	  by (simp!);
  10.314 -      qed;
  10.315 -    qed;
  10.316 -  qed;
  10.317 -qed;
  10.318 -
  10.319 -lemma sup_ext:
  10.320 -  "[| M = norm_pres_extensions E p F f; c: chain M; EX x. x:c; 
  10.321 -  graph H h = Union c|] ==> graph F f <= graph H h";
  10.322 -proof -;
  10.323 -  assume "M = norm_pres_extensions E p F f" "c: chain M" 
  10.324 -         "graph H h = Union c"
  10.325 -  and e: "EX x. x:c";
  10.326 - 
  10.327 -  thus ?thesis; 
  10.328 -  proof (elim exE);
  10.329 -    fix x; assume "x:c"; 
  10.330 -    show ?thesis;    
  10.331 -    proof -;
  10.332 -      have "x:norm_pres_extensions E p F f"; 
  10.333 -      proof (rule subsetD);
  10.334 -	show "c <= norm_pres_extensions E p F f"; by (simp! add: chainD2);
  10.335 -      qed;
  10.336 - 
  10.337 -      hence "(EX G g. graph G g = x
  10.338 -                    & is_linearform G g 
  10.339 -                    & is_subspace G E
  10.340 -                    & is_subspace F G
  10.341 -                    & (graph F f <= graph G g) 
  10.342 -                    & (ALL x:G. g x <= p x))";
  10.343 -	by (simp! add: norm_pres_extension_D);
  10.344 -
  10.345 -      thus ?thesis; 
  10.346 -      proof (elim exE conjE); 
  10.347 -	fix G g; assume "graph G g = x" "graph F f <= graph G g";
  10.348 -	show ?thesis; 
  10.349 -        proof -; 
  10.350 -          have "graph F f <= graph G g"; .;
  10.351 -          also; have "graph G g <= graph H h"; by ((simp!), fast);
  10.352 -          finally; show ?thesis; .;
  10.353 -        qed;
  10.354 -      qed;
  10.355 -    qed;
  10.356 -  qed;
  10.357 -qed;
  10.358 -
  10.359 -
  10.360 -lemma sup_supF: 
  10.361 -  "[| M = norm_pres_extensions E p F f; c: chain M; EX x. x:c;
  10.362 -  graph H h = Union c; is_subspace F E |] ==> is_subspace F H";
  10.363 -proof -; 
  10.364 -  assume "M = norm_pres_extensions E p F f" "c: chain M" "EX x. x:c" 
  10.365 -         "graph H h = Union c"
  10.366 -    "is_subspace F E";
  10.367 -
  10.368 -  show ?thesis; 
  10.369 -  proof (rule subspaceI);
  10.370 -    show "<0> : F"; ..;
  10.371 -    show "F <= H"; 
  10.372 -    proof (rule graph_extD2);
  10.373 -      show "graph F f <= graph H h";
  10.374 -        by (rule sup_ext);
  10.375 -    qed;
  10.376 -    show "ALL x:F. ALL y:F. x [+] y : F"; 
  10.377 -    proof (intro ballI); 
  10.378 -      fix x y; assume "x:F" "y:F";
  10.379 -      show "x [+] y : F"; by (simp!);
  10.380 -    qed;
  10.381 -    show "ALL x:F. ALL a. a [*] x : F";
  10.382 -    proof (intro ballI allI);
  10.383 -      fix x a; assume "x:F";
  10.384 -      show "a [*] x : F"; by (simp!);
  10.385 -    qed;
  10.386 -  qed;
  10.387 -qed;
  10.388 -
  10.389 -
  10.390 -lemma sup_subE: 
  10.391 -  "[| M = norm_pres_extensions E p F f; c: chain M; EX x. x:c; 
  10.392 -  graph H h = Union c; is_subspace F E|] ==> is_subspace H E";
  10.393 -proof -; 
  10.394 -  assume "M = norm_pres_extensions E p F f" "c: chain M" "EX x. x:c" 
  10.395 -         "graph H h = Union c" "is_subspace F E";
  10.396 -
  10.397 -  show ?thesis; 
  10.398 -  proof;
  10.399 -
  10.400 -    show "<0> : H"; 
  10.401 -    proof (rule subsetD [of F H]);
  10.402 -      have "is_subspace F H"; by (rule sup_supF);
  10.403 -      thus "F <= H"; ..;
  10.404 -      show  "<0> : F"; ..;
  10.405 -    qed;
  10.406 -
  10.407 -    show "H <= E"; 
  10.408 -    proof;
  10.409 -      fix x; assume "x:H";
  10.410 -      show "x:E";
  10.411 -      proof -;
  10.412 -	have "EX H' h'. x:H' & (graph H' h' <= graph H h) 
  10.413 -              & is_linearform H' h' & is_subspace H' E & is_subspace F H' 
  10.414 -              & (graph F f <= graph H' h') & (ALL x:H'. h' x <= p x)"; 
  10.415 -	  by (rule some_H'h');
  10.416 -	thus ?thesis;
  10.417 -	proof (elim exE conjE);
  10.418 -	  fix H' h'; assume "x:H'" "is_subspace H' E";
  10.419 -	  show "x:E"; 
  10.420 -	  proof (rule subsetD);
  10.421 -	    show "H' <= E"; ..;
  10.422 -	  qed;
  10.423 -	qed;
  10.424 -      qed;
  10.425 -    qed;
  10.426 -
  10.427 -    show "ALL x:H. ALL y:H. x [+] y : H"; 
  10.428 -    proof (intro ballI); 
  10.429 -      fix x y; assume "x:H" "y:H";
  10.430 -      show "x [+] y : H";   
  10.431 -      proof -;
  10.432 - 	have "EX H' h'. x:H' & y:H' & (graph H' h' <= graph H h) 
  10.433 -              & is_linearform H' h' & is_subspace H' E & is_subspace F H'
  10.434 -              & (graph F f <= graph H' h') & (ALL x:H'. h' x <= p x)"; 
  10.435 -	  by (rule some_H'h'2); 
  10.436 -	thus ?thesis;
  10.437 -	proof (elim exE conjE); 
  10.438 -	  fix H' h'; 
  10.439 -          assume "x:H'" "y:H'" "is_subspace H' E" 
  10.440 -                 "graph H' h' <= graph H h";
  10.441 -	  have "H' <= H"; ..;
  10.442 -	  thus ?thesis;
  10.443 -	  proof (rule subsetD);
  10.444 -	    show "x [+] y : H'"; ..; 
  10.445 -	  qed;
  10.446 -	qed;
  10.447 -      qed;
  10.448 -    qed;      
  10.449 -
  10.450 -    show "ALL x:H. ALL a. a [*] x : H"; 
  10.451 -    proof (intro ballI allI); 
  10.452 -      fix x and a::real; assume "x:H";
  10.453 -      show "a [*] x : H"; 
  10.454 -      proof -;
  10.455 -	have "EX H' h'. x:H' & (graph H' h' <= graph H h) & 
  10.456 -               is_linearform H' h' & is_subspace H' E & is_subspace F H' & 
  10.457 -               (graph F f <= graph H' h') & (ALL x:H'. h' x <= p x)"; 
  10.458 -	  by (rule some_H'h'); 
  10.459 -	thus ?thesis;
  10.460 -	proof (elim exE conjE);
  10.461 -	  fix H' h'; 
  10.462 -          assume "x:H'" "is_subspace H' E" "graph H' h' <= graph H h";
  10.463 -  	  have "H' <= H"; ..;
  10.464 -	  thus ?thesis;
  10.465 -	  proof (rule subsetD);
  10.466 -	    show "a [*] x : H'"; ..;
  10.467 -	  qed;
  10.468 -	qed;
  10.469 -      qed;
  10.470 -    qed;
  10.471 -  qed;
  10.472 -qed;
  10.473 -
  10.474 -lemma sup_norm_pres: "[| M = norm_pres_extensions E p F f; c: chain M; 
  10.475 -  graph H h = Union c|] ==> ALL x::'a:H. h x <= p x";
  10.476 -proof;
  10.477 -  assume "M = norm_pres_extensions E p F f" "c: chain M" 
  10.478 -         "graph H h = Union c";
  10.479 -  fix x; assume "x:H";
  10.480 -  show "h x <= p x"; 
  10.481 -  proof -; 
  10.482 -    have "EX H' h'. x:H' & (graph H' h' <= graph H h) 
  10.483 -                & is_linearform H' h' & is_subspace H' E & is_subspace F H'
  10.484 -                & (graph F f <= graph H' h') & (ALL x:H'. h' x <= p x)"; 
  10.485 -      by (rule some_H'h');
  10.486 -    thus ?thesis; 
  10.487 -    proof (elim exE conjE);
  10.488 -      fix H' h'; assume "x: H'" "graph H' h' <= graph H h" 
  10.489 -      and a: "ALL x: H'. h' x <= p x" ;
  10.490 -      have "h x = h' x"; 
  10.491 -      proof (rule sym); 
  10.492 -        show "h' x = h x"; ..;
  10.493 -      qed;
  10.494 -      also; from a; have "... <= p x "; ..;
  10.495 -      finally; show ?thesis; .;  
  10.496 -    qed;
  10.497 -  qed;
  10.498 -qed;
  10.499 -
  10.500 -end;
  10.501 \ No newline at end of file
    11.1 --- a/src/HOL/Real/HahnBanach/LinearSpace.thy	Fri Oct 22 18:41:00 1999 +0200
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,525 +0,0 @@
    11.4 -(*  Title:      HOL/Real/HahnBanach/LinearSpace.thy
    11.5 -    ID:         $Id$
    11.6 -    Author:     Gertrud Bauer, TU Munich
    11.7 -*)
    11.8 -
    11.9 -header {* Linear Spaces *};
   11.10 -
   11.11 -theory LinearSpace = Bounds + Aux:;
   11.12 -
   11.13 -subsection {* Signature *};
   11.14 -
   11.15 -consts
   11.16 -  sum	:: "['a, 'a] => 'a"                              (infixl "[+]" 65)
   11.17 -  prod  :: "[real, 'a] => 'a"                            (infixr "[*]" 70) 
   11.18 -  zero  :: 'a                                            ("<0>");
   11.19 -
   11.20 -constdefs
   11.21 -  negate :: "'a => 'a"                                   ("[-] _" [100] 100)
   11.22 -  "[-] x == (- 1r) [*] x"
   11.23 -  diff :: "'a => 'a => 'a"                               (infixl "[-]" 68)
   11.24 -  "x [-] y == x [+] [-] y";
   11.25 -
   11.26 -subsection {* Vector space laws *}
   11.27 -(***
   11.28 -constdefs
   11.29 -  is_vectorspace :: "'a set => bool"
   11.30 -  "is_vectorspace V == V ~= {} 
   11.31 -   & (ALL x: V. ALL a. a [*] x: V)
   11.32 -   & (ALL x: V. ALL y: V. x [+] y = y [+] x)
   11.33 -   & (ALL x: V. ALL y: V. ALL z: V. x [+] y [+] z =  x [+] (y [+] z))
   11.34 -   & (ALL x: V. ALL y: V. x [+] y: V)
   11.35 -   & (ALL x: V. x [-] x = <0>)
   11.36 -   & (ALL x: V. <0> [+] x = x)
   11.37 -   & (ALL x: V. ALL y: V. ALL a. a [*] (x [+] y) = a [*] x [+] a [*] y)
   11.38 -   & (ALL x: V. ALL a b. (a + b) [*] x = a [*] x [+] b [*] x)
   11.39 -   & (ALL x: V. ALL a b. (a * b) [*] x = a [*] b [*] x)
   11.40 -   & (ALL x: V. 1r [*] x = x)"; 
   11.41 -***)
   11.42 -constdefs
   11.43 -  is_vectorspace :: "'a set => bool"
   11.44 -  "is_vectorspace V == V ~= {} 
   11.45 -   & (ALL x:V. ALL y:V. ALL z:V. ALL a b. 
   11.46 -        x [+] y: V 
   11.47 -      & a [*] x: V                         
   11.48 -      & x [+] y [+] z = x [+] (y [+] z)  
   11.49 -      & x [+] y = y [+] x             
   11.50 -      & x [-] x = <0>         
   11.51 -      & <0> [+] x = x 
   11.52 -      & a [*] (x [+] y) = a [*] x [+] a [*] y
   11.53 -      & (a + b) [*] x = a [*] x [+] b [*] x
   11.54 -      & (a * b) [*] x = a [*] b [*] x     
   11.55 -      & 1r [*] x = x)";
   11.56 -
   11.57 -lemma vsI [intro]:
   11.58 -  "[| <0>:V; \
   11.59 -       ALL x: V. ALL y: V. x [+] y: V;
   11.60 -       ALL x: V. ALL a. a [*] x: V;    
   11.61 -       ALL x: V. ALL y: V. ALL z: V. x [+] y [+] z =  x [+] (y [+] z);
   11.62 -       ALL x: V. ALL y: V. x [+] y = y [+] x;
   11.63 -       ALL x: V. x [-] x = <0>;
   11.64 -       ALL x: V. <0> [+] x = x;
   11.65 -       ALL x: V. ALL y: V. ALL a. a [*] (x [+] y) = a [*] x [+] a [*] y;
   11.66 -       ALL x: V. ALL a b. (a + b) [*] x = a [*] x [+] b [*] x;
   11.67 -       ALL x: V. ALL a b. (a * b) [*] x = a [*] b [*] x; \
   11.68 -       ALL x: V. 1r [*] x = x |] ==> is_vectorspace V";
   11.69 -proof (unfold is_vectorspace_def, intro conjI ballI allI);
   11.70 -  fix x y z; assume "x:V" "y:V" "z:V"; 
   11.71 -  assume "ALL x: V. ALL y: V. ALL z: V. x [+] y [+] z =  x [+] (y [+] z)";
   11.72 -  thus "x [+] y [+] z =  x [+] (y [+] z)"; by (elim bspec[elimify]);
   11.73 -qed force+;
   11.74 -
   11.75 -lemma vs_not_empty [intro !!]: "is_vectorspace V ==> (V ~= {})"; 
   11.76 -  by (unfold is_vectorspace_def) simp;
   11.77 - 
   11.78 -lemma vs_add_closed [simp, intro!!]: 
   11.79 -  "[| is_vectorspace V; x: V; y: V|] ==> x [+] y: V"; 
   11.80 -  by (unfold is_vectorspace_def) simp;
   11.81 -
   11.82 -lemma vs_mult_closed [simp, intro!!]: 
   11.83 -  "[| is_vectorspace V; x: V |] ==> a [*] x: V"; 
   11.84 -  by (unfold is_vectorspace_def) simp;
   11.85 -
   11.86 -lemma vs_diff_closed [simp, intro!!]: 
   11.87 - "[| is_vectorspace V; x: V; y: V|] ==> x [-] y: V";
   11.88 -  by (unfold diff_def negate_def) simp;
   11.89 -
   11.90 -lemma vs_neg_closed  [simp, intro!!]: 
   11.91 -  "[| is_vectorspace V; x: V |] ==>  [-] x: V";
   11.92 -  by (unfold negate_def) simp;
   11.93 -
   11.94 -lemma vs_add_assoc [simp]:  
   11.95 -  "[| is_vectorspace V; x: V; y: V; z: V|]
   11.96 -   ==> x [+] y [+] z = x [+] (y [+] z)";
   11.97 -  by (unfold is_vectorspace_def) fast;
   11.98 -
   11.99 -lemma vs_add_commute [simp]: 
  11.100 -  "[| is_vectorspace V; x:V; y:V |] ==> y [+] x = x [+] y";
  11.101 -  by (unfold is_vectorspace_def) simp;
  11.102 -
  11.103 -lemma vs_add_left_commute [simp]:
  11.104 -  "[| is_vectorspace V; x:V; y:V; z:V |] 
  11.105 -  ==> x [+] (y [+] z) = y [+] (x [+] z)";
  11.106 -proof -;
  11.107 -  assume "is_vectorspace V" "x:V" "y:V" "z:V";
  11.108 -  hence "x [+] (y [+] z) = (x [+] y) [+] z"; 
  11.109 -    by (simp only: vs_add_assoc);
  11.110 -  also; have "... = (y [+] x) [+] z"; by (simp! only: vs_add_commute);
  11.111 -  also; have "... = y [+] (x [+] z)"; by (simp! only: vs_add_assoc);
  11.112 -  finally; show ?thesis; .;
  11.113 -qed;
  11.114 -
  11.115 -theorems vs_add_ac = vs_add_assoc vs_add_commute vs_add_left_commute;
  11.116 -
  11.117 -lemma vs_diff_self [simp]: 
  11.118 -  "[| is_vectorspace V; x:V |] ==>  x [-] x = <0>"; 
  11.119 -  by (unfold is_vectorspace_def) simp;
  11.120 -
  11.121 -lemma zero_in_vs [simp, intro]: "is_vectorspace V ==> <0>:V";
  11.122 -proof -; 
  11.123 -  assume "is_vectorspace V";
  11.124 -  have "V ~= {}"; ..;
  11.125 -  hence "EX x. x:V"; by force;
  11.126 -  thus ?thesis; 
  11.127 -  proof; 
  11.128 -    fix x; assume "x:V"; 
  11.129 -    have "<0> = x [-] x"; by (simp!);
  11.130 -    also; have "... : V"; by (simp! only: vs_diff_closed);
  11.131 -    finally; show ?thesis; .;
  11.132 -  qed;
  11.133 -qed;
  11.134 -
  11.135 -lemma vs_add_zero_left [simp]: 
  11.136 -  "[| is_vectorspace V; x:V |] ==>  <0> [+] x = x";
  11.137 -  by (unfold is_vectorspace_def) simp;
  11.138 -
  11.139 -lemma vs_add_zero_right [simp]: 
  11.140 -  "[| is_vectorspace V; x:V |] ==>  x [+] <0> = x";
  11.141 -proof -;
  11.142 -  assume "is_vectorspace V" "x:V";
  11.143 -  hence "x [+] <0> = <0> [+] x"; by simp;
  11.144 -  also; have "... = x"; by (simp!);
  11.145 -  finally; show ?thesis; .;
  11.146 -qed;
  11.147 -
  11.148 -lemma vs_add_mult_distrib1: 
  11.149 -  "[| is_vectorspace V; x:V; y:V |] 
  11.150 -  ==> a [*] (x [+] y) = a [*] x [+] a [*] y";
  11.151 -  by (unfold is_vectorspace_def) simp;
  11.152 -
  11.153 -lemma vs_add_mult_distrib2: 
  11.154 -  "[| is_vectorspace V; x:V |] ==> (a + b) [*] x = a [*] x [+] b [*] x"; 
  11.155 -  by (unfold is_vectorspace_def) simp;
  11.156 -
  11.157 -lemma vs_mult_assoc: 
  11.158 -  "[| is_vectorspace V; x:V |] ==> (a * b) [*] x = a [*] (b [*] x)";   
  11.159 -  by (unfold is_vectorspace_def) simp;
  11.160 -
  11.161 -lemma vs_mult_assoc2 [simp]: 
  11.162 - "[| is_vectorspace V; x:V |] ==> a [*] b [*] x = (a * b) [*] x";
  11.163 -  by (simp only: vs_mult_assoc);
  11.164 -
  11.165 -lemma vs_mult_1 [simp]: 
  11.166 -  "[| is_vectorspace V; x:V |] ==> 1r [*] x = x"; 
  11.167 -  by (unfold is_vectorspace_def) simp;
  11.168 -
  11.169 -lemma vs_diff_mult_distrib1: 
  11.170 -  "[| is_vectorspace V; x:V; y:V |] 
  11.171 -  ==> a [*] (x [-] y) = a [*] x [-] a [*] y";
  11.172 -  by (simp add: diff_def negate_def vs_add_mult_distrib1);
  11.173 -
  11.174 -lemma vs_minus_eq: "[| is_vectorspace V; x:V |] 
  11.175 -  ==> - b [*] x = [-] (b [*] x)";
  11.176 -  by (simp add: negate_def);
  11.177 -
  11.178 -lemma vs_diff_mult_distrib2: 
  11.179 -  "[| is_vectorspace V; x:V |] 
  11.180 -  ==> (a - b) [*] x = a [*] x [-] (b [*] x)";
  11.181 -proof -;
  11.182 -  assume "is_vectorspace V" "x:V";
  11.183 -  have " (a - b) [*] x = (a + - b ) [*] x"; 
  11.184 -    by (unfold real_diff_def, simp);
  11.185 -  also; have "... = a [*] x [+] (- b) [*] x"; 
  11.186 -    by (rule vs_add_mult_distrib2);
  11.187 -  also; have "... = a [*] x [+] [-] (b [*] x)"; 
  11.188 -    by (simp! add: vs_minus_eq);
  11.189 -  also; have "... = a [*] x [-] (b [*] x)"; by (unfold diff_def, simp);
  11.190 -  finally; show ?thesis; .;
  11.191 -qed;
  11.192 -
  11.193 -lemma vs_mult_zero_left [simp]: 
  11.194 -  "[| is_vectorspace V; x: V|] ==> 0r [*] x = <0>";
  11.195 -proof -;
  11.196 -  assume "is_vectorspace V" "x:V";
  11.197 -  have  "0r [*] x = (1r - 1r) [*] x"; by (simp only: real_diff_self);
  11.198 -  also; have "... = (1r + - 1r) [*] x"; by simp;
  11.199 -  also; have "... =  1r [*] x [+] (- 1r) [*] x"; 
  11.200 -    by (rule vs_add_mult_distrib2);
  11.201 -  also; have "... = x [+] (- 1r) [*] x"; by (simp!);
  11.202 -  also; have "... = x [+] [-] x"; by (fold negate_def) simp;
  11.203 -  also; have "... = x [-] x"; by (fold diff_def) simp;
  11.204 -  also; have "... = <0>"; by (simp!);
  11.205 -  finally; show ?thesis; .;
  11.206 -qed;
  11.207 -
  11.208 -lemma vs_mult_zero_right [simp]: 
  11.209 -  "[| is_vectorspace (V:: 'a set) |] ==> a [*] <0> = (<0>::'a)";
  11.210 -proof -;
  11.211 -  assume "is_vectorspace V";
  11.212 -  have "a [*] <0> = a [*] (<0> [-] (<0>::'a))"; by (simp!);
  11.213 -  also; have "... =  a [*] <0> [-] a [*] <0>";
  11.214 -     by (rule vs_diff_mult_distrib1) (simp!)+;
  11.215 -  also; have "... = <0>"; by (simp!);
  11.216 -  finally; show ?thesis; .;
  11.217 -qed;
  11.218 -
  11.219 -lemma vs_minus_mult_cancel [simp]:  
  11.220 -  "[| is_vectorspace V; x:V |] ==> (- a) [*] [-] x = a [*] x";
  11.221 -  by (unfold negate_def) simp;
  11.222 -
  11.223 -lemma vs_add_minus_left_eq_diff: 
  11.224 -  "[| is_vectorspace V; x:V; y:V |] ==> [-] x [+] y = y [-] x";
  11.225 -proof -; 
  11.226 -  assume "is_vectorspace V" "x:V" "y:V";
  11.227 -  have "[-] x [+] y = y [+] [-] x"; 
  11.228 -    by (simp! add: vs_add_commute [RS sym, of V "[-] x"]);
  11.229 -  also; have "... = y [-] x"; by (unfold diff_def) simp;
  11.230 -  finally; show ?thesis; .;
  11.231 -qed;
  11.232 -
  11.233 -lemma vs_add_minus [simp]: 
  11.234 -  "[| is_vectorspace V; x:V|] ==> x [+] [-] x = <0>";
  11.235 -  by (fold diff_def) simp;
  11.236 -
  11.237 -lemma vs_add_minus_left [simp]: 
  11.238 -  "[| is_vectorspace V; x:V |] ==> [-] x [+]  x = <0>";
  11.239 -  by (fold diff_def) simp;
  11.240 -
  11.241 -lemma vs_minus_minus [simp]: 
  11.242 -  "[| is_vectorspace V; x:V|] ==> [-] [-] x = x";
  11.243 -  by (unfold negate_def) simp;
  11.244 -
  11.245 -lemma vs_minus_zero [simp]: 
  11.246 -  "[| is_vectorspace (V::'a set)|] ==> [-] (<0>::'a) = <0>"; 
  11.247 -  by (unfold negate_def) simp;
  11.248 -
  11.249 -lemma vs_minus_zero_iff [simp]:
  11.250 -  "[| is_vectorspace V; x:V|] ==> ([-] x = <0>) = (x = <0>)" 
  11.251 -  (concl is "?L = ?R");
  11.252 -proof -;
  11.253 -  assume vs: "is_vectorspace V" "x:V";
  11.254 -  show "?L = ?R";
  11.255 -  proof;
  11.256 -    assume l: ?L;
  11.257 -    have "x = [-] [-] x"; by (rule vs_minus_minus [RS sym]);
  11.258 -    also; have "... = [-] <0>"; by (simp only: l);
  11.259 -    also; have "... = <0>"; by (rule vs_minus_zero);
  11.260 -    finally; show ?R; .;
  11.261 -  next;
  11.262 -    assume ?R;
  11.263 -    with vs; show ?L; by simp;
  11.264 -  qed;
  11.265 -qed;
  11.266 -
  11.267 -lemma vs_add_minus_cancel [simp]:  
  11.268 -  "[| is_vectorspace V; x:V; y:V|] ==>  x [+] ([-] x [+] y) = y"; 
  11.269 -  by (simp add: vs_add_assoc [RS sym] del: vs_add_commute); 
  11.270 -
  11.271 -lemma vs_minus_add_cancel [simp]: 
  11.272 -  "[| is_vectorspace V; x:V; y:V |] ==>  [-] x [+] (x [+] y) = y"; 
  11.273 -  by (simp add: vs_add_assoc [RS sym] del: vs_add_commute); 
  11.274 -
  11.275 -lemma vs_minus_add_distrib [simp]:  
  11.276 -  "[| is_vectorspace V; x:V; y:V|] 
  11.277 -  ==> [-] (x [+] y) = [-] x [+] [-] y";
  11.278 -  by (unfold negate_def, simp add: vs_add_mult_distrib1);
  11.279 -
  11.280 -lemma vs_diff_zero [simp]: 
  11.281 -  "[| is_vectorspace V; x:V |] ==> x [-] <0> = x";
  11.282 -  by (unfold diff_def) simp;  
  11.283 -
  11.284 -lemma vs_diff_zero_right [simp]: 
  11.285 -  "[| is_vectorspace V; x:V |] ==> <0> [-] x = [-] x";
  11.286 -  by (unfold diff_def) simp;
  11.287 -
  11.288 -lemma vs_add_left_cancel:
  11.289 -  "[| is_vectorspace V; x:V; y:V; z:V|] 
  11.290 -   ==> (x [+] y = x [+] z) = (y = z)"  
  11.291 -  (concl is "?L = ?R");
  11.292 -proof;
  11.293 -  assume "is_vectorspace V" "x:V" "y:V" "z:V";
  11.294 -  assume l: ?L; 
  11.295 -  have "y = <0> [+] y"; by (simp!);
  11.296 -  also; have "... = [-] x [+] x [+] y"; by (simp!);
  11.297 -  also; have "... = [-] x [+] (x [+] y)"; 
  11.298 -    by (simp! only: vs_add_assoc vs_neg_closed);
  11.299 -  also; have "...  = [-] x [+] (x [+] z)"; by (simp only: l);
  11.300 -  also; have "... = [-] x [+] x [+] z"; 
  11.301 -    by (rule vs_add_assoc [RS sym]) (simp!)+;
  11.302 -  also; have "... = z"; by (simp!);
  11.303 -  finally; show ?R;.;
  11.304 -next;    
  11.305 -  assume ?R;
  11.306 -  thus ?L; by force;
  11.307 -qed;
  11.308 -
  11.309 -lemma vs_add_right_cancel: 
  11.310 -  "[| is_vectorspace V; x:V; y:V; z:V |] 
  11.311 -  ==> (y [+] x = z [+] x) = (y = z)";  
  11.312 -  by (simp only: vs_add_commute vs_add_left_cancel);
  11.313 -
  11.314 -lemma vs_add_assoc_cong [tag FIXME simp]: 
  11.315 -  "[| is_vectorspace V; x:V; y:V; x':V; y':V; z:V |] 
  11.316 -  ==> x [+] y = x' [+] y' ==> x [+] (y [+] z) = x' [+] (y' [+] z)"; 
  11.317 -  by (simp del: vs_add_commute vs_add_assoc add: vs_add_assoc [RS sym]); 
  11.318 -
  11.319 -lemma vs_mult_left_commute: 
  11.320 -  "[| is_vectorspace V; x:V; y:V; z:V |] 
  11.321 -  ==> x [*] y [*] z = y [*] x [*] z";  
  11.322 -  by (simp add: real_mult_commute);
  11.323 -
  11.324 -lemma vs_mult_zero_uniq :
  11.325 -  "[| is_vectorspace V; x:V; a [*] x = <0>; x ~= <0> |] ==> a = 0r";
  11.326 -proof (rule classical);
  11.327 -  assume "is_vectorspace V" "x:V" "a [*] x = <0>" "x ~= <0>";
  11.328 -  assume "a ~= 0r";
  11.329 -  have "x = (rinv a * a) [*] x"; by (simp!);
  11.330 -  also; have "... = (rinv a) [*] (a [*] x)"; by (rule vs_mult_assoc);
  11.331 -  also; have "... = (rinv a) [*] <0>"; by (simp!);
  11.332 -  also; have "... = <0>"; by (simp!);
  11.333 -  finally; have "x = <0>"; .;
  11.334 -  thus "a = 0r"; by contradiction; 
  11.335 -qed;
  11.336 -
  11.337 -lemma vs_mult_left_cancel: 
  11.338 -  "[| is_vectorspace V; x:V; y:V; a ~= 0r |] ==> 
  11.339 -  (a [*] x = a [*] y) = (x = y)"
  11.340 -  (concl is "?L = ?R");
  11.341 -proof;
  11.342 -  assume "is_vectorspace V" "x:V" "y:V" "a ~= 0r";
  11.343 -  assume l: ?L;
  11.344 -  have "x = 1r [*] x"; by (simp!);
  11.345 -  also; have "... = (rinv a * a) [*] x"; by (simp!);
  11.346 -  also; have "... = rinv a [*] (a [*] x)"; 
  11.347 -    by (simp! only: vs_mult_assoc);
  11.348 -  also; have "... = rinv a [*] (a [*] y)"; by (simp only: l);
  11.349 -  also; have "... = y"; by (simp!);
  11.350 -  finally; show ?R;.;
  11.351 -next;
  11.352 -  assume ?R;
  11.353 -  thus ?L; by simp;
  11.354 -qed;
  11.355 -
  11.356 -lemma vs_mult_right_cancel: (*** forward ***)
  11.357 -  "[| is_vectorspace V; x:V; x ~= <0> |] ==>  (a [*] x = b [*] x) = (a = b)"
  11.358 -  (concl is "?L = ?R");
  11.359 -proof;
  11.360 -  assume "is_vectorspace V" "x:V" "x ~= <0>";
  11.361 -  assume l: ?L;
  11.362 -  have "(a - b) [*] x = a [*] x [-] b [*] x"; by (simp! add: vs_diff_mult_distrib2);
  11.363 -  also; from l; have "a [*] x [-] b [*] x = <0>"; by (simp!);
  11.364 -  finally; have "(a - b) [*] x  = <0>"; .; 
  11.365 -  hence "a - b = 0r"; by (simp! add:  vs_mult_zero_uniq);
  11.366 -  thus "a = b"; by (rule real_add_minus_eq);
  11.367 -next;
  11.368 -  assume ?R;
  11.369 -  thus ?L; by simp;
  11.370 -qed; (*** backward :
  11.371 -lemma vs_mult_right_cancel: 
  11.372 -  "[| is_vectorspace V; x:V; x ~= <0> |] ==>  (a [*] x = b [*] x) = (a = b)"
  11.373 -  (concl is "?L = ?R");
  11.374 -proof;
  11.375 -  assume "is_vectorspace V" "x:V" "x ~= <0>";
  11.376 -  assume l: ?L; 
  11.377 -  show "a = b"; 
  11.378 -  proof (rule real_add_minus_eq);
  11.379 -    show "a - b = 0r"; 
  11.380 -    proof (rule vs_mult_zero_uniq);
  11.381 -      have "(a - b) [*] x = a [*] x [-] b [*] x"; by (simp! add: vs_diff_mult_distrib2);
  11.382 -      also; from l; have "a [*] x [-] b [*] x = <0>"; by (simp!);
  11.383 -      finally; show "(a - b) [*] x  = <0>"; .; 
  11.384 -    qed;
  11.385 -  qed;
  11.386 -next;
  11.387 -  assume ?R;
  11.388 -  thus ?L; by simp;
  11.389 -qed;
  11.390 -**)
  11.391 -
  11.392 -lemma vs_eq_diff_eq: 
  11.393 -  "[| is_vectorspace V; x:V; y:V; z:V |] ==> 
  11.394 -  (x = z [-] y) = (x [+] y = z)"
  11.395 -   (concl is "?L = ?R" );  
  11.396 -proof -;
  11.397 -  assume vs: "is_vectorspace V" "x:V" "y:V" "z:V";
  11.398 -  show "?L = ?R";   
  11.399 -  proof;
  11.400 -    assume l: ?L;
  11.401 -    have "x [+] y = z [-] y [+] y"; by (simp add: l);
  11.402 -    also; have "... = z [+] [-] y [+] y"; by (unfold diff_def) simp;
  11.403 -    also; have "... = z [+] ([-] y [+] y)"; 
  11.404 -      by (rule vs_add_assoc) (simp!)+;
  11.405 -    also; from vs; have "... = z [+] <0>"; 
  11.406 -      by (simp only: vs_add_minus_left);
  11.407 -    also; from vs; have "... = z"; by (simp only: vs_add_zero_right);
  11.408 -    finally; show ?R;.;
  11.409 -  next;
  11.410 -    assume r: ?R;
  11.411 -    have "z [-] y = (x [+] y) [-] y"; by (simp only: r);
  11.412 -    also; from vs; have "... = x [+] y [+] [-] y"; 
  11.413 -      by (unfold diff_def) simp;
  11.414 -    also; have "... = x [+] (y [+] [-] y)"; 
  11.415 -      by (rule vs_add_assoc) (simp!)+;
  11.416 -    also; have "... = x"; by (simp!);
  11.417 -    finally; show ?L; by (rule sym);
  11.418 -  qed;
  11.419 -qed;
  11.420 -
  11.421 -lemma vs_add_minus_eq_minus: 
  11.422 -  "[| is_vectorspace V; x:V; y:V; <0> = x [+] y|] ==> y = [-] x"; 
  11.423 -proof -;
  11.424 -  assume vs: "is_vectorspace V" "x:V" "y:V"; 
  11.425 -  assume "<0> = x [+] y";
  11.426 -  have "[-] x = [-] x [+] <0>"; by (simp!);
  11.427 -  also; have "... = [-] x [+] (x [+] y)";  by (simp!);
  11.428 -  also; have "... = [-] x [+] x [+] y"; 
  11.429 -    by (rule vs_add_assoc [RS sym]) (simp!)+;
  11.430 -  also; have "... = (x [+] [-] x) [+] y"; by (simp!);
  11.431 -  also; have "... = y"; by (simp!);
  11.432 -  finally; show ?thesis; by (rule sym);
  11.433 -qed;  
  11.434 -
  11.435 -lemma vs_add_minus_eq: 
  11.436 -  "[| is_vectorspace V; x:V; y:V; x [-] y = <0> |] ==> x = y"; 
  11.437 -proof -;
  11.438 -  assume "is_vectorspace V" "x:V" "y:V" "x [-] y = <0>";
  11.439 -  have "x [+] [-] y = x [-] y"; by (unfold diff_def, simp);
  11.440 -  also; have "... = <0>"; .;
  11.441 -  finally; have e: "<0> = x [+] [-] y"; by (rule sym);
  11.442 -  have "x = [-] [-] x"; by (simp!);
  11.443 -  also; have "[-] x = [-] y"; 
  11.444 -    by (rule vs_add_minus_eq_minus [RS sym]) (simp! add: e)+;
  11.445 -  also; have "[-] ... = y"; by (simp!); 
  11.446 -  finally; show "x = y"; .;
  11.447 -qed;
  11.448 -
  11.449 -lemma vs_add_diff_swap:
  11.450 -  "[| is_vectorspace V; a:V; b:V; c:V; d:V; a [+] b = c [+] d|] 
  11.451 -  ==> a [-] c = d [-] b";
  11.452 -proof -; 
  11.453 -  assume vs: "is_vectorspace V" "a:V" "b:V" "c:V" "d:V" 
  11.454 -  and eq: "a [+] b = c [+] d";
  11.455 -  have "[-] c [+] (a [+] b) = [-] c [+] (c [+] d)"; 
  11.456 -    by (simp! add: vs_add_left_cancel);
  11.457 -  also; have "... = d"; by (rule vs_minus_add_cancel);
  11.458 -  finally; have eq: "[-] c [+] (a [+] b) = d"; .;
  11.459 -  from vs; have "a [-] c = ([-] c [+] (a [+] b)) [+] [-] b"; 
  11.460 -    by (simp add: vs_add_ac diff_def);
  11.461 -  also; from eq; have "...  = d [+] [-] b"; 
  11.462 -    by (simp! add: vs_add_right_cancel);
  11.463 -  also; have "... = d [-] b"; by (simp add : diff_def);
  11.464 -  finally; show "a [-] c = d [-] b"; .;
  11.465 -qed;
  11.466 -
  11.467 -lemma vs_add_cancel_21: 
  11.468 -  "[| is_vectorspace V; x:V; y:V; z:V; u:V|] 
  11.469 -  ==> (x [+] (y [+] z) = y [+] u) = ((x [+] z) = u)"
  11.470 -  (concl is "?L = ?R" ); 
  11.471 -proof -; 
  11.472 -  assume vs: "is_vectorspace V" "x:V" "y:V""z:V" "u:V";
  11.473 -  show "?L = ?R";
  11.474 -  proof;
  11.475 -    assume l: ?L;
  11.476 -    have "u = <0> [+] u"; by (simp!);
  11.477 -    also; have "... = [-] y [+] y [+] u"; by (simp!);
  11.478 -    also; have "... = [-] y [+] (y [+] u)"; 
  11.479 -      by (rule vs_add_assoc) (simp!)+;
  11.480 -    also; have "... = [-] y [+] (x [+] (y [+] z))"; by (simp only: l);
  11.481 -    also; have "... = [-] y [+] (y [+] (x [+] z))"; by (simp!);
  11.482 -    also; have "... = [-] y [+] y [+] (x [+] z)"; 
  11.483 -      by (rule vs_add_assoc [RS sym]) (simp!)+;
  11.484 -    also; have "... = (x [+] z)"; by (simp!);
  11.485 -    finally; show ?R; by (rule sym);
  11.486 -  next;
  11.487 -    assume r: ?R;
  11.488 -    have "x [+] (y [+] z) = y [+] (x [+] z)"; 
  11.489 -      by (simp! only: vs_add_left_commute [of V x]);
  11.490 -    also; have "... = y [+] u"; by (simp only: r);
  11.491 -    finally; show ?L; .;
  11.492 -  qed;
  11.493 -qed;
  11.494 -
  11.495 -lemma vs_add_cancel_end: 
  11.496 -  "[| is_vectorspace V;  x:V; y:V; z:V |] 
  11.497 -  ==> (x [+] (y [+] z) = y) = (x = [-] z)"
  11.498 -  (concl is "?L = ?R" );
  11.499 -proof -;
  11.500 -  assume vs: "is_vectorspace V" "x:V" "y:V" "z:V";
  11.501 -  show "?L = ?R";
  11.502 -  proof;
  11.503 -    assume l: ?L;
  11.504 -    have "<0> = x [+] z";
  11.505 -    proof (rule vs_add_left_cancel [RS iffD1]);
  11.506 -      have "y [+] <0> = y"; by (simp! only: vs_add_zero_right); 
  11.507 -      also; have "... =  x [+] (y [+] z)"; by (simp only: l); 
  11.508 -      also; have "... = y [+] (x [+] z)"; 
  11.509 -        by (simp! only: vs_add_left_commute); 
  11.510 -      finally; show "y [+] <0> = y [+] (x [+] z)"; .;
  11.511 -  qed (simp!)+;
  11.512 -    hence "z = [-] x"; by (simp! only: vs_add_minus_eq_minus);
  11.513 -    then; show ?R; by (simp!); 
  11.514 -  next;
  11.515 -    assume r: ?R;
  11.516 -    have "x [+] (y [+] z) = [-] z [+] (y [+] z)"; by (simp only: r); 
  11.517 -    also; have "... = y [+] ([-] z [+] z)"; 
  11.518 -      by (simp! only: vs_add_left_commute);
  11.519 -    also; have "... = y [+] <0>";  by (simp!);
  11.520 -    also; have "... = y";  by (simp!);
  11.521 -    finally; show ?L; .;
  11.522 -  qed;
  11.523 -qed;
  11.524 -
  11.525 -lemma it: "[| x = y; x' = y'|] ==> x [+] x' = y [+] y'";
  11.526 -  by simp; 
  11.527 -
  11.528 -end;
  11.529 \ No newline at end of file
    12.1 --- a/src/HOL/Real/HahnBanach/Linearform.thy	Fri Oct 22 18:41:00 1999 +0200
    12.2 +++ b/src/HOL/Real/HahnBanach/Linearform.thy	Fri Oct 22 20:14:31 1999 +0200
    12.3 @@ -5,33 +5,38 @@
    12.4  
    12.5  header {* Linearforms *};
    12.6  
    12.7 -theory Linearform = LinearSpace:;
    12.8 +theory Linearform = VectorSpace:;
    12.9 +
   12.10 +text{* A \emph{linearform} is a function on a vector
   12.11 +space into the reals that is linear w.~r.~t.~addition and skalar
   12.12 +multiplikation. *};
   12.13  
   12.14  constdefs
   12.15 -  is_linearform :: "['a set, 'a => real] => bool" 
   12.16 +  is_linearform :: "['a::{minus, plus} set, 'a => real] => bool" 
   12.17    "is_linearform V f == 
   12.18 -      (ALL x: V. ALL y: V. f (x [+] y) = f x + f y) &
   12.19 -      (ALL x: V. ALL a. f (a [*] x) = a * (f x))"; 
   12.20 +      (ALL x: V. ALL y: V. f (x + y) = f x + f y) &
   12.21 +      (ALL x: V. ALL a. f (a <*> x) = a * (f x))"; 
   12.22  
   12.23  lemma is_linearformI [intro]: 
   12.24 -  "[| !! x y. [| x : V; y : V |] ==> f (x [+] y) = f x + f y;
   12.25 -    !! x c. x : V ==> f (c [*] x) = c * f x |]
   12.26 +  "[| !! x y. [| x : V; y : V |] ==> f (x + y) = f x + f y;
   12.27 +    !! x c. x : V ==> f (c <*> x) = c * f x |]
   12.28   ==> is_linearform V f";
   12.29   by (unfold is_linearform_def) force;
   12.30  
   12.31  lemma linearform_add_linear [intro!!]: 
   12.32 -  "[| is_linearform V f; x:V; y:V |] ==> f (x [+] y) = f x + f y";
   12.33 -  by (unfold is_linearform_def) auto;
   12.34 +  "[| is_linearform V f; x:V; y:V |] ==> f (x + y) = f x + f y";
   12.35 +  by (unfold is_linearform_def) fast;
   12.36  
   12.37  lemma linearform_mult_linear [intro!!]: 
   12.38 -  "[| is_linearform V f; x:V |] ==>  f (a [*] x) = a * (f x)"; 
   12.39 -  by (unfold is_linearform_def) auto;
   12.40 +  "[| is_linearform V f; x:V |] ==>  f (a <*> x) = a * (f x)"; 
   12.41 +  by (unfold is_linearform_def) fast;
   12.42  
   12.43  lemma linearform_neg_linear [intro!!]:
   12.44 -  "[|  is_vectorspace V; is_linearform V f; x:V|] ==> f ([-] x) = - f x";
   12.45 +  "[|  is_vectorspace V; is_linearform V f; x:V|] 
   12.46 +  ==> f (- x) = - f x";
   12.47  proof -; 
   12.48    assume "is_linearform V f" "is_vectorspace V" "x:V"; 
   12.49 -  have "f ([-] x) = f ((- 1r) [*] x)"; by (unfold negate_def) simp;
   12.50 +  have "f (- x) = f ((- 1r) <*> x)"; by (simp! add: negate_eq1);
   12.51    also; have "... = (- 1r) * (f x)"; by (rule linearform_mult_linear);
   12.52    also; have "... = - (f x)"; by (simp!);
   12.53    finally; show ?thesis; .;
   12.54 @@ -39,21 +44,23 @@
   12.55  
   12.56  lemma linearform_diff_linear [intro!!]: 
   12.57    "[| is_vectorspace V; is_linearform V f; x:V; y:V |] 
   12.58 -  ==> f (x [-] y) = f x - f y";  
   12.59 +  ==> f (x - y) = f x - f y";  
   12.60  proof -;
   12.61    assume "is_vectorspace V" "is_linearform V f" "x:V" "y:V";
   12.62 -  have "f (x [-] y) = f (x [+] [-] y)"; by (simp only: diff_def);
   12.63 -  also; have "... = f x + f ([-] y)"; 
   12.64 +  have "f (x - y) = f (x + - y)"; by (simp! only: diff_eq1);
   12.65 +  also; have "... = f x + f (- y)"; 
   12.66      by (rule linearform_add_linear) (simp!)+;
   12.67 -  also; have "f ([-] y) = - f y"; by (rule linearform_neg_linear);
   12.68 -  finally; show "f (x [-] y) = f x - f y"; by (simp!);
   12.69 +  also; have "f (- y) = - f y"; by (rule linearform_neg_linear);
   12.70 +  finally; show "f (x - y) = f x - f y"; by (simp!);
   12.71  qed;
   12.72  
   12.73 +text{* Every linearform yields $0$ for the $\zero$ vector.*};
   12.74 +
   12.75  lemma linearform_zero [intro!!, simp]: 
   12.76    "[| is_vectorspace V; is_linearform V f |] ==> f <0> = 0r"; 
   12.77  proof -; 
   12.78    assume "is_vectorspace V" "is_linearform V f";
   12.79 -  have "f <0> = f (<0> [-] <0>)"; by (simp!);
   12.80 +  have "f <0> = f (<0> - <0>)"; by (simp!);
   12.81    also; have "... = f <0> - f <0>"; 
   12.82      by (rule linearform_diff_linear) (simp!)+;
   12.83    also; have "... = 0r"; by simp;
    13.1 --- a/src/HOL/Real/HahnBanach/NormedSpace.thy	Fri Oct 22 18:41:00 1999 +0200
    13.2 +++ b/src/HOL/Real/HahnBanach/NormedSpace.thy	Fri Oct 22 20:14:31 1999 +0200
    13.3 @@ -11,19 +11,21 @@
    13.4  
    13.5  subsection {* Quasinorms *};
    13.6  
    13.7 +text{* A \emph{quasinorm} $\norm{\cdot}$ is a  function on a real vector space into the reals 
    13.8 +that has the following properties: *};
    13.9  
   13.10  constdefs
   13.11 -  is_quasinorm :: "['a set,  'a => real] => bool"
   13.12 +  is_quasinorm :: "['a::{plus, minus} set, 'a => real] => bool"
   13.13    "is_quasinorm V norm == ALL x: V. ALL y:V. ALL a. 
   13.14          0r <= norm x 
   13.15 -      & norm (a [*] x) = (rabs a) * (norm x)
   13.16 -      & norm (x [+] y) <= norm x + norm y";
   13.17 +      & norm (a <*> x) = (rabs a) * (norm x)
   13.18 +      & norm (x + y) <= norm x + norm y";
   13.19  
   13.20  lemma is_quasinormI [intro]: 
   13.21    "[| !! x y a. [| x:V; y:V|] ==>  0r <= norm x;
   13.22 -      !! x a. x:V ==> norm (a [*] x) = (rabs a) * (norm x);
   13.23 -      !! x y. [|x:V; y:V |] ==> norm (x [+] y) <= norm x + norm y |] 
   13.24 -    ==> is_quasinorm V norm";
   13.25 +  !! x a. x:V ==> norm (a <*> x) = (rabs a) * (norm x);
   13.26 +  !! x y. [|x:V; y:V |] ==> norm (x + y) <= norm x + norm y |] 
   13.27 +  ==> is_quasinorm V norm";
   13.28    by (unfold is_quasinorm_def, force);
   13.29  
   13.30  lemma quasinorm_ge_zero [intro!!]:
   13.31 @@ -32,55 +34,54 @@
   13.32  
   13.33  lemma quasinorm_mult_distrib: 
   13.34    "[| is_quasinorm V norm; x:V |] 
   13.35 -  ==> norm (a [*] x) = (rabs a) * (norm x)";
   13.36 +  ==> norm (a <*> x) = (rabs a) * (norm x)";
   13.37    by (unfold is_quasinorm_def, force);
   13.38  
   13.39  lemma quasinorm_triangle_ineq: 
   13.40    "[| is_quasinorm V norm; x:V; y:V |] 
   13.41 -  ==> norm (x [+] y) <= norm x + norm y";
   13.42 +  ==> norm (x + y) <= norm x + norm y";
   13.43    by (unfold is_quasinorm_def, force);
   13.44  
   13.45  lemma quasinorm_diff_triangle_ineq: 
   13.46    "[| is_quasinorm V norm; x:V; y:V; is_vectorspace V |] 
   13.47 -  ==> norm (x [-] y) <= norm x + norm y";
   13.48 +  ==> norm (x - y) <= norm x + norm y";
   13.49  proof -;
   13.50    assume "is_quasinorm V norm" "x:V" "y:V" "is_vectorspace V";
   13.51 -  have "norm (x [-] y) = norm (x [+] - 1r [*] y)";  
   13.52 -    by (simp add: diff_def negate_def);
   13.53 -  also; have "... <= norm x + norm  (- 1r [*] y)"; 
   13.54 +  have "norm (x - y) = norm (x + - 1r <*> y)";  
   13.55 +    by (simp! add: diff_eq2 negate_eq2);
   13.56 +  also; have "... <= norm x + norm  (- 1r <*> y)"; 
   13.57      by (simp! add: quasinorm_triangle_ineq);
   13.58 -  also; have "norm (- 1r [*] y) = rabs (- 1r) * norm y"; 
   13.59 +  also; have "norm (- 1r <*> y) = rabs (- 1r) * norm y"; 
   13.60      by (rule quasinorm_mult_distrib);
   13.61    also; have "rabs (- 1r) = 1r"; by (rule rabs_minus_one);
   13.62 -  finally; show "norm (x [-] y) <= norm x + norm y"; by simp;
   13.63 +  finally; show "norm (x - y) <= norm x + norm y"; by simp;
   13.64  qed;
   13.65  
   13.66  lemma quasinorm_minus: 
   13.67    "[| is_quasinorm V norm; x:V; is_vectorspace V |] 
   13.68 -  ==> norm ([-] x) = norm x";
   13.69 +  ==> norm (- x) = norm x";
   13.70  proof -;
   13.71    assume "is_quasinorm V norm" "x:V" "is_vectorspace V";
   13.72 -  have "norm ([-] x) = norm (-1r [*] x)"; by (unfold negate_def) force;
   13.73 +  have "norm (- x) = norm (-1r <*> x)"; by (simp! only: negate_eq1);
   13.74    also; have "... = rabs (-1r) * norm x"; 
   13.75      by (rule quasinorm_mult_distrib);
   13.76    also; have "rabs (- 1r) = 1r"; by (rule rabs_minus_one);
   13.77 -  finally; show "norm ([-] x) = norm x"; by simp;
   13.78 +  finally; show "norm (- x) = norm x"; by simp;
   13.79  qed;
   13.80  
   13.81  
   13.82 -
   13.83  subsection {* Norms *};
   13.84  
   13.85 +text{* A \emph{norm} $\norm{\cdot}$ is a quasinorm that maps only $\zero$ to $0$. *};
   13.86  
   13.87  constdefs
   13.88 -  is_norm :: "['a set, 'a => real] => bool"
   13.89 +  is_norm :: "['a::{minus, plus} set, 'a => real] => bool"
   13.90    "is_norm V norm == ALL x: V.  is_quasinorm V norm 
   13.91        & (norm x = 0r) = (x = <0>)";
   13.92  
   13.93  lemma is_normI [intro]: 
   13.94    "ALL x: V.  is_quasinorm V norm  & (norm x = 0r) = (x = <0>) 
   13.95 -  ==> is_norm V norm";
   13.96 -  by (unfold is_norm_def, force);
   13.97 +  ==> is_norm V norm"; by (simp only: is_norm_def);
   13.98  
   13.99  lemma norm_is_quasinorm [intro!!]: 
  13.100    "[| is_norm V norm; x:V |] ==> is_quasinorm V norm";
  13.101 @@ -97,9 +98,12 @@
  13.102  
  13.103  subsection {* Normed vector spaces *};
  13.104  
  13.105 +text{* A vector space together with a norm is called
  13.106 +a \emph{normed space}. *};
  13.107  
  13.108  constdefs
  13.109 -  is_normed_vectorspace :: "['a set, 'a => real] => bool"
  13.110 +  is_normed_vectorspace :: 
  13.111 +  "['a::{plus, minus} set, 'a => real] => bool"
  13.112    "is_normed_vectorspace V norm ==
  13.113        is_vectorspace V &
  13.114        is_norm V norm";
  13.115 @@ -138,19 +142,22 @@
  13.116  
  13.117  lemma normed_vs_norm_mult_distrib [intro!!]: 
  13.118    "[| is_normed_vectorspace V norm; x:V |] 
  13.119 -  ==> norm (a [*] x) = (rabs a) * (norm x)";
  13.120 +  ==> norm (a <*> x) = (rabs a) * (norm x)";
  13.121    by (rule quasinorm_mult_distrib, rule norm_is_quasinorm, 
  13.122        rule normed_vs_norm);
  13.123  
  13.124  lemma normed_vs_norm_triangle_ineq [intro!!]: 
  13.125    "[| is_normed_vectorspace V norm; x:V; y:V |] 
  13.126 -  ==> norm (x [+] y) <= norm x + norm y";
  13.127 +  ==> norm (x + y) <= norm x + norm y";
  13.128    by (rule quasinorm_triangle_ineq, rule norm_is_quasinorm, 
  13.129       rule normed_vs_norm);
  13.130  
  13.131 +text{* Any subspace of a normed vector space is again a 
  13.132 +normed vectorspace.*};
  13.133 +
  13.134  lemma subspace_normed_vs [intro!!]: 
  13.135 -  "[| is_subspace F E; is_vectorspace E; is_normed_vectorspace E norm |] 
  13.136 -   ==> is_normed_vectorspace F norm";
  13.137 +  "[| is_subspace F E; is_vectorspace E; 
  13.138 +  is_normed_vectorspace E norm |] ==> is_normed_vectorspace F norm";
  13.139  proof (rule normed_vsI);
  13.140    assume "is_subspace F E" "is_vectorspace E" 
  13.141           "is_normed_vectorspace E norm";
  13.142 @@ -161,9 +168,9 @@
  13.143      proof;
  13.144        fix x y a; presume "x : E";
  13.145        show "0r <= norm x"; ..;
  13.146 -      show "norm (a [*] x) = rabs a * norm x"; ..;
  13.147 +      show "norm (a <*> x) = rabs a * norm x"; ..;
  13.148        presume "y : E";
  13.149 -      show "norm (x [+] y) <= norm x + norm y"; ..;
  13.150 +      show "norm (x + y) <= norm x + norm y"; ..;
  13.151      qed (simp!)+;
  13.152  
  13.153      fix x; assume "x : F";
    14.1 --- a/src/HOL/Real/HahnBanach/Subspace.thy	Fri Oct 22 18:41:00 1999 +0200
    14.2 +++ b/src/HOL/Real/HahnBanach/Subspace.thy	Fri Oct 22 20:14:31 1999 +0200
    14.3 @@ -6,28 +6,30 @@
    14.4  
    14.5  header {* Subspaces *};
    14.6  
    14.7 -theory Subspace = LinearSpace:;
    14.8 +theory Subspace = VectorSpace:;
    14.9  
   14.10  
   14.11 -subsection {* Subspaces *};
   14.12 +subsection {* Definition *};
   14.13  
   14.14 -constdefs
   14.15 -  is_subspace ::  "['a set, 'a set] => bool"
   14.16 -  "is_subspace U V ==  <0>:U  & U <= V 
   14.17 -     &  (ALL x:U. ALL y:U. ALL a. x [+] y : U                          
   14.18 -                       & a [*] x : U)";                            
   14.19 +text {* A non-empty subset $U$ of a vector space $V$ is a 
   14.20 +\emph{subspace} of $V$, iff $U$ is closed under addition and 
   14.21 +scalar multiplication. *};
   14.22 +
   14.23 +constdefs 
   14.24 +  is_subspace ::  "['a::{minus, plus} set, 'a set] => bool"
   14.25 +  "is_subspace U V ==  U ~= {}  & U <= V 
   14.26 +     &  (ALL x:U. ALL y:U. ALL a. x + y : U & a <*> x : U)";
   14.27  
   14.28  lemma subspaceI [intro]: 
   14.29 -  "[| <0>:U; U <= V; ALL x:U. ALL y:U. (x [+] y : U); 
   14.30 -  ALL x:U. ALL a. a [*] x : U |]
   14.31 +  "[| <0>:U; U <= V; ALL x:U. ALL y:U. (x + y : U); 
   14.32 +  ALL x:U. ALL a. a <*> x : U |]
   14.33    ==> is_subspace U V";
   14.34 -  by (unfold is_subspace_def) simp;
   14.35 +proof (unfold is_subspace_def, intro conjI); 
   14.36 +  assume "<0>:U"; thus "U ~= {}"; by fast;
   14.37 +qed (simp+);
   14.38  
   14.39 -lemma "is_subspace U V ==> U ~= {}";
   14.40 -  by (unfold is_subspace_def) force;
   14.41 -
   14.42 -lemma zero_in_subspace [intro !!]: "is_subspace U V ==> <0>:U";
   14.43 -  by (unfold is_subspace_def) simp;;
   14.44 +lemma subspace_not_empty [intro!!]: "is_subspace U V ==> U ~= {}";
   14.45 +  by (unfold is_subspace_def) simp; 
   14.46  
   14.47  lemma subspace_subset [intro !!]: "is_subspace U V ==> U <= V";
   14.48    by (unfold is_subspace_def) simp;
   14.49 @@ -37,20 +39,44 @@
   14.50    by (unfold is_subspace_def) force;
   14.51  
   14.52  lemma subspace_add_closed [simp, intro!!]: 
   14.53 -  "[| is_subspace U V; x: U; y: U |] ==> x [+] y: U";
   14.54 +  "[| is_subspace U V; x: U; y: U |] ==> x + y : U";
   14.55    by (unfold is_subspace_def) simp;
   14.56  
   14.57  lemma subspace_mult_closed [simp, intro!!]: 
   14.58 -  "[| is_subspace U V; x: U |] ==> a [*] x: U";
   14.59 +  "[| is_subspace U V; x: U |] ==> a <*> x: U";
   14.60    by (unfold is_subspace_def) simp;
   14.61  
   14.62  lemma subspace_diff_closed [simp, intro!!]: 
   14.63 -  "[| is_subspace U V; x: U; y: U |] ==> x [-] y: U";
   14.64 -  by (unfold diff_def negate_def) simp;
   14.65 +  "[| is_subspace U V; is_vectorspace V; x: U; y: U |] 
   14.66 +  ==> x - y: U";
   14.67 +  by (simp! add: diff_eq1 negate_eq1);
   14.68 +
   14.69 +text {* Similar as for linear spaces, the existence of the 
   14.70 +zero element in every subspace follws from the non-emptyness 
   14.71 +of the subspace and vector space laws.*};
   14.72 +
   14.73 +lemma zero_in_subspace [intro !!]:
   14.74 +  "[| is_subspace U V; is_vectorspace V |] ==> <0>:U";
   14.75 +proof -; 
   14.76 +  assume "is_subspace U V" and v: "is_vectorspace V";
   14.77 +  have "U ~= {}"; ..;
   14.78 +  hence "EX x. x:U"; by force;
   14.79 +  thus ?thesis; 
   14.80 +  proof; 
   14.81 +    fix x; assume u: "x:U"; 
   14.82 +    hence "x:V"; by (simp!);
   14.83 +    with v; have "<0> = x - x"; by (simp!);
   14.84 +    also; have "... : U"; by (rule subspace_diff_closed);
   14.85 +    finally; show ?thesis; .;
   14.86 +  qed;
   14.87 +qed;
   14.88  
   14.89  lemma subspace_neg_closed [simp, intro!!]: 
   14.90 -  "[| is_subspace U V; x: U |] ==> [-] x: U";
   14.91 -  by (unfold negate_def) simp;
   14.92 +  "[| is_subspace U V; is_vectorspace V; x: U |] ==> - x: U";
   14.93 +  by (simp add: negate_eq1);
   14.94 +
   14.95 +text_raw {* \medskip *};
   14.96 +text {* Further derived laws: Every subspace is a vector space. *};
   14.97  
   14.98  lemma subspace_vs [intro!!]:
   14.99    "[| is_subspace U V; is_vectorspace V |] ==> is_vectorspace U";
  14.100 @@ -59,40 +85,48 @@
  14.101    show ?thesis;
  14.102    proof; 
  14.103      show "<0>:U"; ..;
  14.104 -    show "ALL x:U. ALL a. a [*] x : U"; by (simp!);
  14.105 -    show "ALL x:U. ALL y:U. x [+] y : U"; by (simp!);
  14.106 +    show "ALL x:U. ALL a. a <*> x : U"; by (simp!);
  14.107 +    show "ALL x:U. ALL y:U. x + y : U"; by (simp!);
  14.108 +    show "ALL x:U. - x = -1r <*> x"; by (simp! add: negate_eq1);
  14.109 +    show "ALL x:U. ALL y:U. x - y =  x + - y"; 
  14.110 +      by (simp! add: diff_eq1);
  14.111    qed (simp! add: vs_add_mult_distrib1 vs_add_mult_distrib2)+;
  14.112  qed;
  14.113  
  14.114 +text {* The subspace relation is reflexive. *};
  14.115 +
  14.116  lemma subspace_refl [intro]: "is_vectorspace V ==> is_subspace V V";
  14.117  proof; 
  14.118    assume "is_vectorspace V";
  14.119    show "<0> : V"; ..;
  14.120    show "V <= V"; ..;
  14.121 -  show "ALL x:V. ALL y:V. x [+] y : V"; by (simp!);
  14.122 -  show "ALL x:V. ALL a. a [*] x : V"; by (simp!);
  14.123 +  show "ALL x:V. ALL y:V. x + y : V"; by (simp!);
  14.124 +  show "ALL x:V. ALL a. a <*> x : V"; by (simp!);
  14.125  qed;
  14.126  
  14.127 +text {* The subspace relation is transitive. *};
  14.128 +
  14.129  lemma subspace_trans: 
  14.130 -  "[| is_subspace U V; is_subspace V W |] ==> is_subspace U W";
  14.131 +  "[| is_subspace U V; is_vectorspace V; is_subspace V W |] 
  14.132 +  ==> is_subspace U W";
  14.133  proof; 
  14.134 -  assume "is_subspace U V" "is_subspace V W";
  14.135 +  assume "is_subspace U V" "is_subspace V W" "is_vectorspace V";
  14.136    show "<0> : U"; ..;
  14.137  
  14.138    have "U <= V"; ..;
  14.139    also; have "V <= W"; ..;
  14.140    finally; show "U <= W"; .;
  14.141  
  14.142 -  show "ALL x:U. ALL y:U. x [+] y : U"; 
  14.143 +  show "ALL x:U. ALL y:U. x + y : U"; 
  14.144    proof (intro ballI);
  14.145      fix x y; assume "x:U" "y:U";
  14.146 -    show "x [+] y : U"; by (simp!);
  14.147 +    show "x + y : U"; by (simp!);
  14.148    qed;
  14.149  
  14.150 -  show "ALL x:U. ALL a. a [*] x : U";
  14.151 +  show "ALL x:U. ALL a. a <*> x : U";
  14.152    proof (intro ballI allI);
  14.153      fix x a; assume "x:U";
  14.154 -    show "a [*] x : U"; by (simp!);
  14.155 +    show "a <*> x : U"; by (simp!);
  14.156    qed;
  14.157  qed;
  14.158  
  14.159 @@ -100,60 +134,68 @@
  14.160  
  14.161  subsection {* Linear closure *};
  14.162  
  14.163 +text {* The \emph{linear closure} of a vector $x$ is the set of all 
  14.164 +multiples of $x$. *};
  14.165  
  14.166  constdefs
  14.167    lin :: "'a => 'a set"
  14.168 -  "lin x == {y. ? a. y = a [*] x}";
  14.169 +  "lin x == {y. EX a. y = a <*> x}";
  14.170  
  14.171 -lemma linD: "x : lin v = (? a::real. x = a [*] v)";
  14.172 +lemma linD: "x : lin v = (EX a::real. x = a <*> v)";
  14.173    by (unfold lin_def) force;
  14.174  
  14.175 -lemma linI [intro!!]: "a [*] x0 : lin x0";
  14.176 +lemma linI [intro!!]: "a <*> x0 : lin x0";
  14.177    by (unfold lin_def) force;
  14.178  
  14.179 +text {* Every vector is contained in its linear closure. *};
  14.180 +
  14.181  lemma x_lin_x: "[| is_vectorspace V; x:V |] ==> x:lin x";
  14.182  proof (unfold lin_def, intro CollectI exI);
  14.183    assume "is_vectorspace V" "x:V";
  14.184 -  show "x = 1r [*] x"; by (simp!);
  14.185 +  show "x = 1r <*> x"; by (simp!);
  14.186  qed;
  14.187  
  14.188 +text {* Any linear closure is a subspace. *};
  14.189 +
  14.190  lemma lin_subspace [intro!!]: 
  14.191    "[| is_vectorspace V; x:V |] ==> is_subspace (lin x) V";
  14.192  proof;
  14.193    assume "is_vectorspace V" "x:V";
  14.194    show "<0> : lin x"; 
  14.195    proof (unfold lin_def, intro CollectI exI);
  14.196 -    show "<0> = 0r [*] x"; by (simp!);
  14.197 +    show "<0> = 0r <*> x"; by (simp!);
  14.198    qed;
  14.199  
  14.200    show "lin x <= V";
  14.201    proof (unfold lin_def, intro subsetI, elim CollectE exE); 
  14.202 -    fix xa a; assume "xa = a [*] x"; 
  14.203 +    fix xa a; assume "xa = a <*> x"; 
  14.204      show "xa:V"; by (simp!);
  14.205    qed;
  14.206  
  14.207 -  show "ALL x1 : lin x. ALL x2 : lin x. x1 [+] x2 : lin x"; 
  14.208 +  show "ALL x1 : lin x. ALL x2 : lin x. x1 + x2 : lin x"; 
  14.209    proof (intro ballI);
  14.210      fix x1 x2; assume "x1 : lin x" "x2 : lin x"; 
  14.211 -    thus "x1 [+] x2 : lin x";
  14.212 +    thus "x1 + x2 : lin x";
  14.213      proof (unfold lin_def, elim CollectE exE, intro CollectI exI);
  14.214 -      fix a1 a2; assume "x1 = a1 [*] x" "x2 = a2 [*] x";
  14.215 -      show "x1 [+] x2 = (a1 + a2) [*] x"; 
  14.216 +      fix a1 a2; assume "x1 = a1 <*> x" "x2 = a2 <*> x";
  14.217 +      show "x1 + x2 = (a1 + a2) <*> x"; 
  14.218          by (simp! add: vs_add_mult_distrib2);
  14.219      qed;
  14.220    qed;
  14.221  
  14.222 -  show "ALL xa:lin x. ALL a. a [*] xa : lin x"; 
  14.223 +  show "ALL xa:lin x. ALL a. a <*> xa : lin x"; 
  14.224    proof (intro ballI allI);
  14.225      fix x1 a; assume "x1 : lin x"; 
  14.226 -    thus "a [*] x1 : lin x";
  14.227 +    thus "a <*> x1 : lin x";
  14.228      proof (unfold lin_def, elim CollectE exE, intro CollectI exI);
  14.229 -      fix a1; assume "x1 = a1 [*] x";
  14.230 -      show "a [*] x1 = (a * a1) [*] x"; by (simp!);
  14.231 +      fix a1; assume "x1 = a1 <*> x";
  14.232 +      show "a <*> x1 = (a * a1) <*> x"; by (simp!);
  14.233      qed;
  14.234    qed; 
  14.235  qed;
  14.236  
  14.237 +text {* Any linear closure is a vector space. *};
  14.238 +
  14.239  lemma lin_vs [intro!!]: 
  14.240    "[| is_vectorspace V; x:V |] ==> is_vectorspace (lin x)";
  14.241  proof (rule subspace_vs);
  14.242 @@ -165,139 +207,166 @@
  14.243  
  14.244  subsection {* Sum of two vectorspaces *};
  14.245  
  14.246 +text {* The \emph{sum} of two vectorspaces $U$ and $V$ is the set of
  14.247 +all sums of elements from $U$ and $V$. *};
  14.248  
  14.249 +instance set :: (plus) plus; by intro_classes;
  14.250 +
  14.251 +defs vs_sum_def:
  14.252 +  "U + V == {x. EX u:U. EX v:V. x = u + v}";
  14.253 +
  14.254 +(***
  14.255  constdefs 
  14.256 -  vectorspace_sum :: "['a set, 'a set] => 'a set"
  14.257 -  "vectorspace_sum U V == {x. ? u:U. ? v:V. x = u [+] v}";
  14.258 +  vs_sum :: 
  14.259 +  "['a::{minus, plus} set, 'a set] => 'a set"         (infixl "+" 65)
  14.260 +  "vs_sum U V == {x. EX u:U. EX v:V. x = u + v}";
  14.261 +***)
  14.262  
  14.263 -lemma vs_sumD: "x:vectorspace_sum U V = (? u:U. ? v:V. x = u [+] v)";
  14.264 -  by (unfold vectorspace_sum_def) simp;
  14.265 +lemma vs_sumD: 
  14.266 +  "x: U + V = (EX u:U. EX v:V. x = u + v)";
  14.267 +  by (unfold vs_sum_def) simp;
  14.268  
  14.269  lemmas vs_sumE = vs_sumD [RS iffD1, elimify];
  14.270  
  14.271  lemma vs_sumI [intro!!]: 
  14.272 -  "[| x: U; y:V; (t::'a) = x [+] y |] 
  14.273 -  ==> (t::'a) : vectorspace_sum U V";
  14.274 -  by (unfold vectorspace_sum_def, intro CollectI bexI); 
  14.275 +  "[| x:U; y:V; t= x + y |] ==> t : U + V";
  14.276 +  by (unfold vs_sum_def, intro CollectI bexI); 
  14.277 +
  14.278 +text{* $U$ is a subspace of $U + V$. *};
  14.279  
  14.280  lemma subspace_vs_sum1 [intro!!]: 
  14.281 -  "[| is_vectorspace U; is_vectorspace V |] 
  14.282 -  ==> is_subspace U (vectorspace_sum U V)";
  14.283 +  "[| is_vectorspace U; is_vectorspace V |]
  14.284 +  ==> is_subspace U (U + V)";
  14.285  proof; 
  14.286    assume "is_vectorspace U" "is_vectorspace V";
  14.287    show "<0> : U"; ..;
  14.288 -  show "U <= vectorspace_sum U V";
  14.289 +  show "U <= U + V";
  14.290    proof (intro subsetI vs_sumI);
  14.291    fix x; assume "x:U";
  14.292 -    show "x = x [+] <0>"; by (simp!);
  14.293 +    show "x = x + <0>"; by (simp!);
  14.294      show "<0> : V"; by (simp!);
  14.295    qed;
  14.296 -  show "ALL x:U. ALL y:U. x [+] y : U"; 
  14.297 +  show "ALL x:U. ALL y:U. x + y : U"; 
  14.298    proof (intro ballI);
  14.299 -    fix x y; assume "x:U" "y:U"; show "x [+] y : U"; by (simp!);
  14.300 +    fix x y; assume "x:U" "y:U"; show "x + y : U"; by (simp!);
  14.301    qed;
  14.302 -  show "ALL x:U. ALL a. a [*] x : U"; 
  14.303 +  show "ALL x:U. ALL a. a <*> x : U"; 
  14.304    proof (intro ballI allI);
  14.305 -    fix x a; assume "x:U"; show "a [*] x : U"; by (simp!);
  14.306 +    fix x a; assume "x:U"; show "a <*> x : U"; by (simp!);
  14.307    qed;
  14.308  qed;
  14.309  
  14.310 +text{* The sum of two subspaces is again a subspace.*};
  14.311 +
  14.312  lemma vs_sum_subspace [intro!!]: 
  14.313    "[| is_subspace U E; is_subspace V E; is_vectorspace E |] 
  14.314 -  ==> is_subspace (vectorspace_sum U V) E";
  14.315 +  ==> is_subspace (U + V) E";
  14.316  proof; 
  14.317 -  assume "is_subspace U E" "is_subspace V E" and e: "is_vectorspace E";
  14.318 -  show "<0> : vectorspace_sum U V";
  14.319 +  assume "is_subspace U E" "is_subspace V E" "is_vectorspace E";
  14.320 +  show "<0> : U + V";
  14.321    proof (intro vs_sumI);
  14.322      show "<0> : U"; ..;
  14.323      show "<0> : V"; ..;
  14.324 -    show "(<0>::'a) = <0> [+] <0>"; by (simp!);
  14.325 +    show "(<0>::'a) = <0> + <0>"; by (simp!);
  14.326    qed;
  14.327    
  14.328 -  show "vectorspace_sum U V <= E";
  14.329 +  show "U + V <= E";
  14.330    proof (intro subsetI, elim vs_sumE bexE);
  14.331 -    fix x u v; assume "u : U" "v : V" "x = u [+] v";
  14.332 +    fix x u v; assume "u : U" "v : V" "x = u + v";
  14.333      show "x:E"; by (simp!);
  14.334    qed;
  14.335    
  14.336 -  show "ALL x:vectorspace_sum U V. ALL y:vectorspace_sum U V. 
  14.337 -        x [+] y : vectorspace_sum U V";
  14.338 +  show "ALL x: U + V. ALL y: U + V. x + y : U + V";
  14.339    proof (intro ballI);
  14.340 -    fix x y; assume "x:vectorspace_sum U V" "y:vectorspace_sum U V";
  14.341 -    thus "x [+] y : vectorspace_sum U V";
  14.342 +    fix x y; assume "x : U + V" "y : U + V";
  14.343 +    thus "x + y : U + V";
  14.344      proof (elim vs_sumE bexE, intro vs_sumI);
  14.345        fix ux vx uy vy; 
  14.346 -      assume "ux : U" "vx : V" "x = ux [+] vx" "uy : U" "vy : V" 
  14.347 -             "y = uy [+] vy";
  14.348 -      show "x [+] y = (ux [+] uy) [+] (vx [+] vy)"; by (simp!);
  14.349 +      assume "ux : U" "vx : V" "x = ux + vx" 
  14.350 +	and "uy : U" "vy : V" "y = uy + vy";
  14.351 +      show "x + y = (ux + uy) + (vx + vy)"; by (simp!);
  14.352      qed (simp!)+;
  14.353    qed;
  14.354  
  14.355 -  show "ALL x:vectorspace_sum U V. ALL a. 
  14.356 -        a [*] x : vectorspace_sum U V";
  14.357 +  show "ALL x: U + V. ALL a. a <*> x : U + V";
  14.358    proof (intro ballI allI);
  14.359 -    fix x a; assume "x:vectorspace_sum U V";
  14.360 -    thus "a [*] x : vectorspace_sum U V";
  14.361 +    fix x a; assume "x : U + V";
  14.362 +    thus "a <*> x : U + V";
  14.363      proof (elim vs_sumE bexE, intro vs_sumI);
  14.364 -      fix a x u v; assume "u : U" "v : V" "x = u [+] v";
  14.365 -      show "a [*] x = (a [*] u) [+] (a [*] v)"; 
  14.366 +      fix a x u v; assume "u : U" "v : V" "x = u + v";
  14.367 +      show "a <*> x = (a <*> u) + (a <*> v)"; 
  14.368          by (simp! add: vs_add_mult_distrib1);
  14.369      qed (simp!)+;
  14.370    qed;
  14.371  qed;
  14.372  
  14.373 +text{* The sum of two subspaces is a vectorspace. *};
  14.374 +
  14.375  lemma vs_sum_vs [intro!!]: 
  14.376    "[| is_subspace U E; is_subspace V E; is_vectorspace E |] 
  14.377 -  ==> is_vectorspace (vectorspace_sum U V)";
  14.378 +  ==> is_vectorspace (U + V)";
  14.379  proof (rule subspace_vs);
  14.380    assume "is_subspace U E" "is_subspace V E" "is_vectorspace E";
  14.381 -  show "is_subspace (vectorspace_sum U V) E"; ..;
  14.382 +  show "is_subspace (U + V) E"; ..;
  14.383  qed;
  14.384  
  14.385  
  14.386  
  14.387 -subsection {* A special case *}
  14.388 +subsection {* Direct sums *};
  14.389  
  14.390  
  14.391 -text {* direct sum of a vectorspace and a linear closure of a vector 
  14.392 -*};
  14.393 +text {* The sum of $U$ and $V$ is called \emph{direct}, iff the zero 
  14.394 +element is the only common element of $U$ and $V$. For every element
  14.395 +$x$ of the direct sum of $U$ and $V$ the decomposition in
  14.396 +$x = u + v$ with $u:U$ and $v:V$ is unique.*}; 
  14.397  
  14.398 -lemma decomp: "[| is_vectorspace E; is_subspace U E; is_subspace V E; 
  14.399 -  U Int V = {<0>}; u1:U; u2:U; v1:V; v2:V; u1 [+] v1 = u2 [+] v2 |] 
  14.400 +lemma decomp: 
  14.401 +  "[| is_vectorspace E; is_subspace U E; is_subspace V E; 
  14.402 +  U Int V = {<0>}; u1:U; u2:U; v1:V; v2:V; u1 + v1 = u2 + v2 |] 
  14.403    ==> u1 = u2 & v1 = v2"; 
  14.404  proof; 
  14.405    assume "is_vectorspace E" "is_subspace U E" "is_subspace V E"  
  14.406      "U Int V = {<0>}" "u1:U" "u2:U" "v1:V" "v2:V" 
  14.407 -    "u1 [+] v1 = u2 [+] v2"; 
  14.408 -  have eq: "u1 [-] u2 = v2 [-] v1"; by (simp! add: vs_add_diff_swap);
  14.409 -  have u: "u1 [-] u2 : U"; by (simp!); 
  14.410 -  with eq; have v': "v2 [-] v1 : U"; by simp; 
  14.411 -  have v: "v2 [-] v1 : V"; by (simp!); 
  14.412 -  with eq; have u': "u1 [-] u2 : V"; by simp;
  14.413 +    "u1 + v1 = u2 + v2"; 
  14.414 +  have eq: "u1 - u2 = v2 - v1"; by (simp! add: vs_add_diff_swap);
  14.415 +  have u: "u1 - u2 : U"; by (simp!); 
  14.416 +  with eq; have v': "v2 - v1 : U"; by simp; 
  14.417 +  have v: "v2 - v1 : V"; by (simp!); 
  14.418 +  with eq; have u': "u1 - u2 : V"; by simp;
  14.419    
  14.420    show "u1 = u2";
  14.421    proof (rule vs_add_minus_eq);
  14.422 -    show "u1 [-] u2 = <0>"; by (rule Int_singletonD [OF _ u u']); 
  14.423 -  qed (rule);
  14.424 +    show "u1 - u2 = <0>"; by (rule Int_singletonD [OF _ u u']); 
  14.425 +    show "u1 : E"; ..;
  14.426 +    show "u2 : E"; ..;
  14.427 +  qed;
  14.428  
  14.429    show "v1 = v2";
  14.430    proof (rule vs_add_minus_eq [RS sym]);
  14.431 -    show "v2 [-] v1 = <0>"; by (rule Int_singletonD [OF _ v' v]); 
  14.432 -  qed (rule);
  14.433 +    show "v2 - v1 = <0>"; by (rule Int_singletonD [OF _ v' v]);
  14.434 +    show "v1 : E"; ..;
  14.435 +    show "v2 : E"; ..;
  14.436 +  qed;
  14.437  qed;
  14.438  
  14.439 -lemma decomp4: "[| is_vectorspace E; is_subspace H E; y1 : H; y2 : H; 
  14.440 -  x0 ~: H; x0 :E; x0 ~= <0>; y1 [+] a1 [*] x0 = y2 [+] a2 [*] x0 |]
  14.441 +text {* An application of the previous lemma will be used in the 
  14.442 +proof of the Hahn-Banach theorem: for an element $y + a \mult x_0$ 
  14.443 +of the direct sum of a vectorspace $H$ and the linear closure of 
  14.444 +$x_0$ the components $y:H$ and $a$ are unique. *}; 
  14.445 +
  14.446 +lemma decomp_H0: 
  14.447 +  "[| is_vectorspace E; is_subspace H E; y1 : H; y2 : H; 
  14.448 +  x0 ~: H; x0 : E; x0 ~= <0>; y1 + a1 <*> x0 = y2 + a2 <*> x0 |]
  14.449    ==> y1 = y2 & a1 = a2";
  14.450  proof;
  14.451    assume "is_vectorspace E" and h: "is_subspace H E"
  14.452       and "y1 : H" "y2 : H" "x0 ~: H" "x0 : E" "x0 ~= <0>" 
  14.453 -         "y1 [+] a1 [*] x0 = y2 [+] a2 [*] x0";
  14.454 +         "y1 + a1 <*> x0 = y2 + a2 <*> x0";
  14.455  
  14.456 -  have c: "y1 = y2 & a1 [*] x0 = a2 [*] x0";
  14.457 +  have c: "y1 = y2 & a1 <*> x0 = a2 <*> x0";
  14.458    proof (rule decomp); 
  14.459 -    show "a1 [*] x0 : lin x0"; ..; 
  14.460 -    show "a2 [*] x0 : lin x0"; ..;
  14.461 +    show "a1 <*> x0 : lin x0"; ..; 
  14.462 +    show "a2 <*> x0 : lin x0"; ..;
  14.463      show "H Int (lin x0) = {<0>}"; 
  14.464      proof;
  14.465        show "H Int lin x0 <= {<0>}"; 
  14.466 @@ -305,15 +374,15 @@
  14.467          fix x; assume "x:H" "x:lin x0"; 
  14.468          thus "x = <0>";
  14.469          proof (unfold lin_def, elim CollectE exE);
  14.470 -          fix a; assume "x = a [*] x0";
  14.471 +          fix a; assume "x = a <*> x0";
  14.472            show ?thesis;
  14.473 -          proof (rule case_split [of "a = 0r"]);
  14.474 +          proof (rule case_split);
  14.475              assume "a = 0r"; show ?thesis; by (simp!);
  14.476            next;
  14.477              assume "a ~= 0r"; 
  14.478 -            from h; have "(rinv a) [*] a [*] x0 : H"; 
  14.479 +            from h; have "rinv a <*> a <*> x0 : H"; 
  14.480                by (rule subspace_mult_closed) (simp!);
  14.481 -            also; have "(rinv a) [*] a [*] x0 = x0"; by (simp!);
  14.482 +            also; have "rinv a <*> a <*> x0 = x0"; by (simp!);
  14.483              finally; have "x0 : H"; .;
  14.484              thus ?thesis; by contradiction;
  14.485            qed;
  14.486 @@ -332,58 +401,68 @@
  14.487    
  14.488    show  "a1 = a2"; 
  14.489    proof (rule vs_mult_right_cancel [RS iffD1]);
  14.490 -    from c; show "a1 [*] x0 = a2 [*] x0"; by simp; 
  14.491 +    from c; show "a1 <*> x0 = a2 <*> x0"; by simp;
  14.492    qed;
  14.493  qed;
  14.494  
  14.495 -lemma decomp1: 
  14.496 -  "[| is_vectorspace E; is_subspace H E; t:H; x0~:H; x0:E; x0 ~= <0> |]
  14.497 -  ==> (@ (y, a). t = y [+] a [*] x0 & y : H) = (t, 0r)";
  14.498 +text {* Since for an element $y + a \mult x_0$ of the direct sum 
  14.499 +of a vectorspace $H$ and the linear closure of $x_0$ the components
  14.500 +$y\in H$ and $a$ are unique, follows from $y\in H$ the fact that 
  14.501 +$a = 0$.*}; 
  14.502 +
  14.503 +lemma decomp_H0_H: 
  14.504 +  "[| is_vectorspace E; is_subspace H E; t:H; x0~:H; x0:E;
  14.505 +  x0 ~= <0> |] 
  14.506 +  ==> (SOME (y, a). t = y + a <*> x0 & y : H) = (t, 0r)";
  14.507  proof (rule, unfold split_paired_all);
  14.508 -  assume "is_vectorspace E" "is_subspace H E" "t:H" "x0~:H" "x0:E" 
  14.509 +  assume "is_vectorspace E" "is_subspace H E" "t:H" "x0~:H" "x0:E"
  14.510      "x0 ~= <0>";
  14.511    have h: "is_vectorspace H"; ..;
  14.512 -  fix y a; presume t1: "t = y [+] a [*] x0" and "y : H";
  14.513 +  fix y a; presume t1: "t = y + a <*> x0" and "y : H";
  14.514    have "y = t & a = 0r"; 
  14.515 -    by (rule decomp4) (assumption | (simp!))+; 
  14.516 +    by (rule decomp_H0) (assumption | (simp!))+;
  14.517    thus "(y, a) = (t, 0r)"; by (simp!);
  14.518  qed (simp!)+;
  14.519  
  14.520 -lemma decomp3:
  14.521 -  "[| h0 = (%x. let (y, a) = @ (y, a). (x = y [+] a [*] x0 & y:H) 
  14.522 +text {* The components $y\in H$ and $a$ in $y \plus a \mult x_0$ 
  14.523 +are unique, so the function $h_0$ defined by 
  14.524 +$h_0 (y \plus a \mult x_0) = h y + a * xi$ is definite. *};
  14.525 +
  14.526 +lemma h0_definite:
  14.527 +  "[| h0 = (\<lambda>x. let (y, a) = SOME (y, a). (x = y + a <*> x0 & y:H)
  14.528                  in (h y) + a * xi);
  14.529 -  x = y [+] a [*] x0; is_vectorspace E; is_subspace H E;    
  14.530 +  x = y + a <*> x0; is_vectorspace E; is_subspace H E;
  14.531    y:H; x0 ~: H; x0:E; x0 ~= <0> |]
  14.532    ==> h0 x = h y + a * xi";
  14.533  proof -;  
  14.534 -  assume "h0 = (%x. let (y, a) = @ (y, a). (x = y [+] a [*] x0 & y:H) 
  14.535 -                    in (h y) + a * xi)"
  14.536 -         "x = y [+] a [*] x0" "is_vectorspace E" "is_subspace H E" 
  14.537 -         "y:H" "x0 ~: H" "x0:E" "x0 ~= <0>";
  14.538 -  have "x : vectorspace_sum H (lin x0)"; 
  14.539 -    by (simp! add: vectorspace_sum_def lin_def, intro bexI exI conjI) 
  14.540 -       force+;
  14.541 -  have "EX! xa. ((%(y, a). x = y [+] a [*] x0 & y:H) xa)"; 
  14.542 -  proof%%;
  14.543 -    show "EX xa. ((%(y, a). x = y [+] a [*] x0 & y:H) xa)";
  14.544 +  assume 
  14.545 +    "h0 = (\<lambda>x. let (y, a) = SOME (y, a). (x = y + a <*> x0 & y:H)
  14.546 +               in (h y) + a * xi)"
  14.547 +    "x = y + a <*> x0" "is_vectorspace E" "is_subspace H E"
  14.548 +    "y:H" "x0 ~: H" "x0:E" "x0 ~= <0>";
  14.549 +  have "x : H + (lin x0)"; 
  14.550 +    by (simp! add: vs_sum_def lin_def) force+;
  14.551 +  have "EX! xa. ((\<lambda>(y, a). x = y + a <*> x0 & y:H) xa)"; 
  14.552 +  proof;
  14.553 +    show "EX xa. ((%(y, a). x = y + a <*> x0 & y:H) xa)";
  14.554        by (force!);
  14.555    next;
  14.556      fix xa ya;
  14.557 -    assume "(%(y,a). x = y [+] a [*] x0 & y : H) xa"
  14.558 -           "(%(y,a). x = y [+] a [*] x0 & y : H) ya";
  14.559 +    assume "(%(y,a). x = y + a <*> x0 & y : H) xa"
  14.560 +           "(%(y,a). x = y + a <*> x0 & y : H) ya";
  14.561      show "xa = ya"; ;
  14.562      proof -;
  14.563        show "fst xa = fst ya & snd xa = snd ya ==> xa = ya"; 
  14.564          by (rule Pair_fst_snd_eq [RS iffD2]);
  14.565 -      have x: "x = (fst xa) [+] (snd xa) [*] x0 & (fst xa) : H"; 
  14.566 +      have x: "x = (fst xa) + (snd xa) <*> x0 & (fst xa) : H"; 
  14.567          by (force!);
  14.568 -      have y: "x = (fst ya) [+] (snd ya) [*] x0 & (fst ya) : H"; 
  14.569 +      have y: "x = (fst ya) + (snd ya) <*> x0 & (fst ya) : H"; 
  14.570          by (force!);
  14.571        from x y; show "fst xa = fst ya & snd xa = snd ya"; 
  14.572 -        by (elim conjE) (rule decomp4, (simp!)+);
  14.573 +        by (elim conjE) (rule decomp_H0, (simp!)+);
  14.574      qed;
  14.575    qed;
  14.576 -  hence eq: "(@ (y, a). (x = y [+] a [*] x0 & y:H)) = (y, a)"; 
  14.577 +  hence eq: "(SOME (y, a). (x = y + a <*> x0 & y:H)) = (y, a)"; 
  14.578      by (rule select1_equality) (force!);
  14.579    thus "h0 x = h y + a * xi"; by (simp! add: Let_def);
  14.580  qed;
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/src/HOL/Real/HahnBanach/VectorSpace.thy	Fri Oct 22 20:14:31 1999 +0200
    15.3 @@ -0,0 +1,537 @@
    15.4 +(*  Title:      HOL/Real/HahnBanach/VectorSpace.thy
    15.5 +    ID:         $Id$
    15.6 +    Author:     Gertrud Bauer, TU Munich
    15.7 +*)
    15.8 +
    15.9 +header {* Vector spaces *};
   15.10 +
   15.11 +theory VectorSpace = Bounds + Aux:;
   15.12 +
   15.13 +subsection {* Signature *};
   15.14 +
   15.15 +text {* For the definition of real vector spaces a type $\alpha$ is 
   15.16 +considered, on which the operations addition and real scalar
   15.17 +multiplication are defined, and which has an zero element.*};
   15.18 +
   15.19 +consts
   15.20 +(***
   15.21 +  sum	:: "['a, 'a] => 'a"                         (infixl "+" 65)
   15.22 +***)
   15.23 +  prod  :: "[real, 'a] => 'a"                       (infixr "<*>" 70)
   15.24 +  zero  :: 'a                                       ("<0>");
   15.25 +
   15.26 +syntax (symbols)
   15.27 +  prod  :: "[real, 'a] => 'a"                       (infixr "\<prod>" 70)
   15.28 +  zero  :: 'a                                       ("\<zero>");
   15.29 +
   15.30 +text {* The unary and binary minus can be considered as 
   15.31 +abbreviations: *};
   15.32 +
   15.33 +(***
   15.34 +constdefs 
   15.35 +  negate :: "'a => 'a"                           ("- _" [100] 100)
   15.36 +  "- x == (- 1r) <*> x"
   15.37 +  diff :: "'a => 'a => 'a"                       (infixl "-" 68)
   15.38 +  "x - y == x + - y";
   15.39 +***)
   15.40 +
   15.41 +subsection {* Vector space laws *};
   15.42 +
   15.43 +text {* A \emph{vector space} is a non-empty set $V$ of elements 
   15.44 +from $\alpha$ with the following vector space laws: 
   15.45 +The set $V$ is closed under addition and scalar multiplication, 
   15.46 +addition is associative and  commutative. $\minus x$ is the inverse
   15.47 +of $x$ w.~r.~t.~addition and $\zero$ is the neutral element of 
   15.48 +addition. 
   15.49 +Addition and multiplication are distributive. 
   15.50 +Scalar multiplication is associative and the real $1$ is the neutral 
   15.51 +element of scalar multiplication.
   15.52 +*};
   15.53 +
   15.54 +constdefs
   15.55 +  is_vectorspace :: "('a::{plus,minus}) set => bool"
   15.56 +  "is_vectorspace V == V ~= {} 
   15.57 +   & (ALL x:V. ALL y:V. ALL z:V. ALL a b.
   15.58 +        x + y : V                                 
   15.59 +      & a <*> x : V                                 
   15.60 +      & x + y + z = x + (y + z)             
   15.61 +      & x + y = y + x                           
   15.62 +      & x - x = <0>                               
   15.63 +      & <0> + x = x                               
   15.64 +      & a <*> (x + y) = a <*> x + a <*> y       
   15.65 +      & (a + b) <*> x = a <*> x + b <*> x         
   15.66 +      & (a * b) <*> x = a <*> b <*> x               
   15.67 +      & 1r <*> x = x
   15.68 +      & - x = (- 1r) <*> x
   15.69 +      & x - y = x + - y)";                             
   15.70 +
   15.71 +text_raw {* \medskip *};
   15.72 +text {* The corresponding introduction rule is:*};
   15.73 +
   15.74 +lemma vsI [intro]:
   15.75 +  "[| <0>:V; 
   15.76 +  ALL x:V. ALL y:V. x + y : V; 
   15.77 +  ALL x:V. ALL a. a <*> x : V;    
   15.78 +  ALL x:V. ALL y:V. ALL z:V. x + y + z = x + (y + z);
   15.79 +  ALL x:V. ALL y:V. x + y = y + x;
   15.80 +  ALL x:V. x - x = <0>;
   15.81 +  ALL x:V. <0> + x = x;
   15.82 +  ALL x:V. ALL y:V. ALL a. a <*> (x + y) = a <*> x + a <*> y;
   15.83 +  ALL x:V. ALL a b. (a + b) <*> x = a <*> x + b <*> x;
   15.84 +  ALL x:V. ALL a b. (a * b) <*> x = a <*> b <*> x; 
   15.85 +  ALL x:V. 1r <*> x = x; 
   15.86 +  ALL x:V. - x = (- 1r) <*> x; 
   15.87 +  ALL x:V. ALL y:V. x - y = x + - y|] ==> is_vectorspace V";
   15.88 +proof (unfold is_vectorspace_def, intro conjI ballI allI);
   15.89 +  fix x y z; 
   15.90 +  assume "x:V" "y:V" "z:V"
   15.91 +    "ALL x:V. ALL y:V. ALL z:V. x + y + z = x + (y + z)";
   15.92 +  thus "x + y + z =  x + (y + z)"; by (elim bspec[elimify]);
   15.93 +qed force+;
   15.94 +
   15.95 +text_raw {* \medskip *};
   15.96 +text {* The corresponding destruction rules are: *};
   15.97 +
   15.98 +lemma negate_eq1: 
   15.99 +  "[| is_vectorspace V; x:V |] ==> - x = (- 1r) <*> x";
  15.100 +  by (unfold is_vectorspace_def) simp;
  15.101 +
  15.102 +lemma diff_eq1: 
  15.103 +  "[| is_vectorspace V; x:V; y:V |] ==> x - y = x + - y";
  15.104 +  by (unfold is_vectorspace_def) simp; 
  15.105 +
  15.106 +lemma negate_eq2: 
  15.107 +  "[| is_vectorspace V; x:V |] ==> (- 1r) <*> x = - x";
  15.108 +  by (unfold is_vectorspace_def) simp;
  15.109 +
  15.110 +lemma diff_eq2: 
  15.111 +  "[| is_vectorspace V; x:V; y:V |] ==> x + - y = x - y";
  15.112 +  by (unfold is_vectorspace_def) simp;  
  15.113 +
  15.114 +lemma vs_not_empty [intro !!]: "is_vectorspace V ==> (V ~= {})"; 
  15.115 +  by (unfold is_vectorspace_def) simp;
  15.116 + 
  15.117 +lemma vs_add_closed [simp, intro!!]: 
  15.118 +  "[| is_vectorspace V; x:V; y:V|] ==> x + y : V"; 
  15.119 +  by (unfold is_vectorspace_def) simp;
  15.120 +
  15.121 +lemma vs_mult_closed [simp, intro!!]: 
  15.122 +  "[| is_vectorspace V; x:V |] ==> a <*> x : V"; 
  15.123 +  by (unfold is_vectorspace_def) simp;
  15.124 +
  15.125 +lemma vs_diff_closed [simp, intro!!]: 
  15.126 + "[| is_vectorspace V; x:V; y:V|] ==> x - y : V";
  15.127 +  by (simp add: diff_eq1 negate_eq1);
  15.128 +
  15.129 +lemma vs_neg_closed  [simp, intro!!]: 
  15.130 +  "[| is_vectorspace V; x:V |] ==> - x : V";
  15.131 +  by (simp add: negate_eq1);
  15.132 +
  15.133 +lemma vs_add_assoc [simp]:  
  15.134 +  "[| is_vectorspace V; x:V; y:V; z:V|]
  15.135 +   ==> x + y + z = x + (y + z)";
  15.136 +  by (unfold is_vectorspace_def) fast;
  15.137 +
  15.138 +lemma vs_add_commute [simp]: 
  15.139 +  "[| is_vectorspace V; x:V; y:V |] ==> y + x = x + y";
  15.140 +  by (unfold is_vectorspace_def) simp;
  15.141 +
  15.142 +lemma vs_add_left_commute [simp]:
  15.143 +  "[| is_vectorspace V; x:V; y:V; z:V |] 
  15.144 +  ==> x + (y + z) = y + (x + z)";
  15.145 +proof -;
  15.146 +  assume "is_vectorspace V" "x:V" "y:V" "z:V";
  15.147 +  hence "x + (y + z) = (x + y) + z"; 
  15.148 +    by (simp only: vs_add_assoc);
  15.149 +  also; have "... = (y + x) + z"; by (simp! only: vs_add_commute);
  15.150 +  also; have "... = y + (x + z)"; by (simp! only: vs_add_assoc);
  15.151 +  finally; show ?thesis; .;
  15.152 +qed;
  15.153 +
  15.154 +theorems vs_add_ac = vs_add_assoc vs_add_commute vs_add_left_commute;
  15.155 +
  15.156 +lemma vs_diff_self [simp]: 
  15.157 +  "[| is_vectorspace V; x:V |] ==>  x - x = <0>"; 
  15.158 +  by (unfold is_vectorspace_def) simp;
  15.159 +
  15.160 +text {* The existence of the zero element a vector space
  15.161 +follows from the non-emptyness of the vector space. *};
  15.162 +
  15.163 +lemma zero_in_vs [simp, intro]: "is_vectorspace V ==> <0>:V";
  15.164 +proof -; 
  15.165 +  assume "is_vectorspace V";
  15.166 +  have "V ~= {}"; ..;
  15.167 +  hence "EX x. x:V"; by force;
  15.168 +  thus ?thesis; 
  15.169 +  proof; 
  15.170 +    fix x; assume "x:V"; 
  15.171 +    have "<0> = x - x"; by (simp!);
  15.172 +    also; have "... : V"; by (simp! only: vs_diff_closed);
  15.173 +    finally; show ?thesis; .;
  15.174 +  qed;
  15.175 +qed;
  15.176 +
  15.177 +lemma vs_add_zero_left [simp]: 
  15.178 +  "[| is_vectorspace V; x:V |] ==>  <0> + x = x";
  15.179 +  by (unfold is_vectorspace_def) simp;
  15.180 +
  15.181 +lemma vs_add_zero_right [simp]: 
  15.182 +  "[| is_vectorspace V; x:V |] ==>  x + <0> = x";
  15.183 +proof -;
  15.184 +  assume "is_vectorspace V" "x:V";
  15.185 +  hence "x + <0> = <0> + x"; by simp;
  15.186 +  also; have "... = x"; by (simp!);
  15.187 +  finally; show ?thesis; .;
  15.188 +qed;
  15.189 +
  15.190 +lemma vs_add_mult_distrib1: 
  15.191 +  "[| is_vectorspace V; x:V; y:V |] 
  15.192 +  ==> a <*> (x + y) = a <*> x + a <*> y";
  15.193 +  by (unfold is_vectorspace_def) simp;
  15.194 +
  15.195 +lemma vs_add_mult_distrib2: 
  15.196 +  "[| is_vectorspace V; x:V |] 
  15.197 +  ==> (a + b) <*> x = a <*> x + b <*> x"; 
  15.198 +  by (unfold is_vectorspace_def) simp;
  15.199 +
  15.200 +lemma vs_mult_assoc: 
  15.201 +  "[| is_vectorspace V; x:V |] ==> (a * b) <*> x = a <*> (b <*> x)";
  15.202 +  by (unfold is_vectorspace_def) simp;
  15.203 +
  15.204 +lemma vs_mult_assoc2 [simp]: 
  15.205 + "[| is_vectorspace V; x:V |] ==> a <*> b <*> x = (a * b) <*> x";
  15.206 +  by (simp only: vs_mult_assoc);
  15.207 +
  15.208 +lemma vs_mult_1 [simp]: 
  15.209 +  "[| is_vectorspace V; x:V |] ==> 1r <*> x = x"; 
  15.210 +  by (unfold is_vectorspace_def) simp;
  15.211 +
  15.212 +lemma vs_diff_mult_distrib1: 
  15.213 +  "[| is_vectorspace V; x:V; y:V |] 
  15.214 +  ==> a <*> (x - y) = a <*> x - a <*> y";
  15.215 +  by (simp add: diff_eq1 negate_eq1 vs_add_mult_distrib1);
  15.216 +
  15.217 +lemma vs_diff_mult_distrib2: 
  15.218 +  "[| is_vectorspace V; x:V |] 
  15.219 +  ==> (a - b) <*> x = a <*> x - (b <*> x)";
  15.220 +proof -;
  15.221 +  assume "is_vectorspace V" "x:V";
  15.222 +  have " (a - b) <*> x = (a + - b ) <*> x"; 
  15.223 +    by (unfold real_diff_def, simp);
  15.224 +  also; have "... = a <*> x + (- b) <*> x"; 
  15.225 +    by (rule vs_add_mult_distrib2);
  15.226 +  also; have "... = a <*> x + - (b <*> x)"; 
  15.227 +    by (simp! add: negate_eq1);
  15.228 +  also; have "... = a <*> x - (b <*> x)"; 
  15.229 +    by (simp! add: diff_eq1);
  15.230 +  finally; show ?thesis; .;
  15.231 +qed;
  15.232 +
  15.233 +(*text_raw {* \paragraph {Further derived laws:} *};*)
  15.234 +text_raw {* \medskip *};
  15.235 +text{* Further derived laws: *};
  15.236 +
  15.237 +lemma vs_mult_zero_left [simp]: 
  15.238 +  "[| is_vectorspace V; x:V|] ==> 0r <*> x = <0>";
  15.239 +proof -;
  15.240 +  assume "is_vectorspace V" "x:V";
  15.241 +  have  "0r <*> x = (1r - 1r) <*> x"; by (simp only: real_diff_self);
  15.242 +  also; have "... = (1r + - 1r) <*> x"; by simp;
  15.243 +  also; have "... =  1r <*> x + (- 1r) <*> x"; 
  15.244 +    by (rule vs_add_mult_distrib2);
  15.245 +  also; have "... = x + (- 1r) <*> x"; by (simp!);
  15.246 +  also; have "... = x + - x"; by (simp! add: negate_eq2);;
  15.247 +  also; have "... = x - x"; by (simp! add: diff_eq2);
  15.248 +  also; have "... = <0>"; by (simp!);
  15.249 +  finally; show ?thesis; .;
  15.250 +qed;
  15.251 +
  15.252 +lemma vs_mult_zero_right [simp]: 
  15.253 +  "[| is_vectorspace (V:: 'a::{plus, minus} set) |] 
  15.254 +  ==> a <*> <0> = (<0>::'a)";
  15.255 +proof -;
  15.256 +  assume "is_vectorspace V";
  15.257 +  have "a <*> <0> = a <*> (<0> - (<0>::'a))"; by (simp!);
  15.258 +  also; have "... =  a <*> <0> - a <*> <0>";
  15.259 +     by (rule vs_diff_mult_distrib1) (simp!)+;
  15.260 +  also; have "... = <0>"; by (simp!);
  15.261 +  finally; show ?thesis; .;
  15.262 +qed;
  15.263 +
  15.264 +lemma vs_minus_mult_cancel [simp]:  
  15.265 +  "[| is_vectorspace V; x:V |] ==> (- a) <*> - x = a <*> x";
  15.266 +  by (simp add: negate_eq1);
  15.267 +
  15.268 +lemma vs_add_minus_left_eq_diff: 
  15.269 +  "[| is_vectorspace V; x:V; y:V |] ==> - x + y = y - x";
  15.270 +proof -; 
  15.271 +  assume "is_vectorspace V" "x:V" "y:V";
  15.272 +  have "- x + y = y + - x"; 
  15.273 +    by (simp! add: vs_add_commute [RS sym, of V "- x"]);
  15.274 +  also; have "... = y - x"; by (simp! add: diff_eq1);
  15.275 +  finally; show ?thesis; .;
  15.276 +qed;
  15.277 +
  15.278 +lemma vs_add_minus [simp]: 
  15.279 +  "[| is_vectorspace V; x:V |] ==> x + - x = <0>";
  15.280 +  by (simp! add: diff_eq2);
  15.281 +
  15.282 +lemma vs_add_minus_left [simp]: 
  15.283 +  "[| is_vectorspace V; x:V |] ==> - x + x = <0>";
  15.284 +  by (simp! add: diff_eq2);
  15.285 +
  15.286 +lemma vs_minus_minus [simp]: 
  15.287 +  "[| is_vectorspace V; x:V |] ==> - (- x) = x";
  15.288 +  by (simp add: negate_eq1);
  15.289 +
  15.290 +lemma vs_minus_zero [simp]: 
  15.291 +  "is_vectorspace (V::'a::{minus, plus} set) ==> - (<0>::'a) = <0>"; 
  15.292 +  by (simp add: negate_eq1);
  15.293 +
  15.294 +lemma vs_minus_zero_iff [simp]:
  15.295 +  "[| is_vectorspace V; x:V |] ==> (- x = <0>) = (x = <0>)" 
  15.296 +  (concl is "?L = ?R");
  15.297 +proof -;
  15.298 +  assume "is_vectorspace V" "x:V";
  15.299 +  show "?L = ?R";
  15.300 +  proof;
  15.301 +    have "x = - (- x)"; by (rule vs_minus_minus [RS sym]);
  15.302 +    also; assume ?L;
  15.303 +    also; have "- ... = <0>"; by (rule vs_minus_zero);
  15.304 +    finally; show ?R; .;
  15.305 +  qed (simp!);
  15.306 +qed;
  15.307 +
  15.308 +lemma vs_add_minus_cancel [simp]:  
  15.309 +  "[| is_vectorspace V; x:V; y:V |] ==>  x + (- x + y) = y"; 
  15.310 +  by (simp add: vs_add_assoc [RS sym] del: vs_add_commute); 
  15.311 +
  15.312 +lemma vs_minus_add_cancel [simp]: 
  15.313 +  "[| is_vectorspace V; x:V; y:V |] ==>  - x + (x + y) = y"; 
  15.314 +  by (simp add: vs_add_assoc [RS sym] del: vs_add_commute); 
  15.315 +
  15.316 +lemma vs_minus_add_distrib [simp]:  
  15.317 +  "[| is_vectorspace V; x:V; y:V |] 
  15.318 +  ==> - (x + y) = - x + - y";
  15.319 +  by (simp add: negate_eq1 vs_add_mult_distrib1);
  15.320 +
  15.321 +lemma vs_diff_zero [simp]: 
  15.322 +  "[| is_vectorspace V; x:V |] ==> x - <0> = x";
  15.323 +  by (simp add: diff_eq1);  
  15.324 +
  15.325 +lemma vs_diff_zero_right [simp]: 
  15.326 +  "[| is_vectorspace V; x:V |] ==> <0> - x = - x";
  15.327 +  by (simp add:diff_eq1);
  15.328 +
  15.329 +lemma vs_add_left_cancel:
  15.330 +  "[| is_vectorspace V; x:V; y:V; z:V|] 
  15.331 +   ==> (x + y = x + z) = (y = z)"  
  15.332 +  (concl is "?L = ?R");
  15.333 +proof;
  15.334 +  assume "is_vectorspace V" "x:V" "y:V" "z:V";
  15.335 +  have "y = <0> + y"; by (simp!);
  15.336 +  also; have "... = - x + x + y"; by (simp!);
  15.337 +  also; have "... = - x + (x + y)"; 
  15.338 +    by (simp! only: vs_add_assoc vs_neg_closed);
  15.339 +  also; assume ?L; 
  15.340 +  also; have "- x + ... = - x + x + z"; 
  15.341 +    by (rule vs_add_assoc [RS sym]) (simp!)+;
  15.342 +  also; have "... = z"; by (simp!);
  15.343 +  finally; show ?R;.;
  15.344 +qed force;
  15.345 +
  15.346 +lemma vs_add_right_cancel: 
  15.347 +  "[| is_vectorspace V; x:V; y:V; z:V |] 
  15.348 +  ==> (y + x = z + x) = (y = z)";  
  15.349 +  by (simp only: vs_add_commute vs_add_left_cancel);
  15.350 +
  15.351 +lemma vs_add_assoc_cong: 
  15.352 +  "[| is_vectorspace V; x:V; y:V; x':V; y':V; z:V |] 
  15.353 +  ==> x + y = x' + y' ==> x + (y + z) = x' + (y' + z)";
  15.354 +  by (simp only: vs_add_assoc [RS sym]); 
  15.355 +
  15.356 +lemma vs_mult_left_commute: 
  15.357 +  "[| is_vectorspace V; x:V; y:V; z:V |] 
  15.358 +  ==> x <*> y <*> z = y <*> x <*> z";  
  15.359 +  by (simp add: real_mult_commute);
  15.360 +
  15.361 +lemma vs_mult_zero_uniq :
  15.362 +  "[| is_vectorspace V; x:V; a <*> x = <0>; x ~= <0> |] ==> a = 0r";
  15.363 +proof (rule classical);
  15.364 +  assume "is_vectorspace V" "x:V" "a <*> x = <0>" "x ~= <0>";
  15.365 +  assume "a ~= 0r";
  15.366 +  have "x = (rinv a * a) <*> x"; by (simp!);
  15.367 +  also; have "... = rinv a <*> (a <*> x)"; by (rule vs_mult_assoc);
  15.368 +  also; have "... = rinv a <*> <0>"; by (simp!);
  15.369 +  also; have "... = <0>"; by (simp!);
  15.370 +  finally; have "x = <0>"; .;
  15.371 +  thus "a = 0r"; by contradiction; 
  15.372 +qed;
  15.373 +
  15.374 +lemma vs_mult_left_cancel: 
  15.375 +  "[| is_vectorspace V; x:V; y:V; a ~= 0r |] ==> 
  15.376 +  (a <*> x = a <*> y) = (x = y)"
  15.377 +  (concl is "?L = ?R");
  15.378 +proof;
  15.379 +  assume "is_vectorspace V" "x:V" "y:V" "a ~= 0r";
  15.380 +  have "x = 1r <*> x"; by (simp!);
  15.381 +  also; have "... = (rinv a * a) <*> x"; by (simp!);
  15.382 +  also; have "... = rinv a <*> (a <*> x)"; 
  15.383 +    by (simp! only: vs_mult_assoc);
  15.384 +  also; assume ?L;
  15.385 +  also; have "rinv a <*> ... = y"; by (simp!);
  15.386 +  finally; show ?R;.;
  15.387 +qed simp;
  15.388 +
  15.389 +lemma vs_mult_right_cancel: (*** forward ***)
  15.390 +  "[| is_vectorspace V; x:V; x ~= <0> |] 
  15.391 +  ==> (a <*> x = b <*> x) = (a = b)" (concl is "?L = ?R");
  15.392 +proof;
  15.393 +  assume "is_vectorspace V" "x:V" "x ~= <0>";
  15.394 +  have "(a - b) <*> x = a <*> x - b <*> x"; 
  15.395 +    by (simp! add: vs_diff_mult_distrib2);
  15.396 +  also; assume ?L; hence "a <*> x - b <*> x = <0>"; by (simp!);
  15.397 +  finally; have "(a - b) <*> x = <0>"; .; 
  15.398 +  hence "a - b = 0r"; by (simp! add: vs_mult_zero_uniq);
  15.399 +  thus "a = b"; by (rule real_add_minus_eq);
  15.400 +qed simp; (*** 
  15.401 +
  15.402 +backward :
  15.403 +lemma vs_mult_right_cancel: 
  15.404 +  "[| is_vectorspace V; x:V; x ~= <0> |] ==>  
  15.405 +  (a <*> x = b <*> x) = (a = b)"
  15.406 +  (concl is "?L = ?R");
  15.407 +proof;
  15.408 +  assume "is_vectorspace V" "x:V" "x ~= <0>";
  15.409 +  assume l: ?L; 
  15.410 +  show "a = b"; 
  15.411 +  proof (rule real_add_minus_eq);
  15.412 +    show "a - b = 0r"; 
  15.413 +    proof (rule vs_mult_zero_uniq);
  15.414 +      have "(a - b) <*> x = a <*> x - b <*> x";
  15.415 +        by (simp! add: vs_diff_mult_distrib2);
  15.416 +      also; from l; have "a <*> x - b <*> x = <0>"; by (simp!);
  15.417 +      finally; show "(a - b) <*> x  = <0>"; .; 
  15.418 +    qed;
  15.419 +  qed;
  15.420 +next;
  15.421 +  assume ?R;
  15.422 +  thus ?L; by simp;
  15.423 +qed;
  15.424 +**)
  15.425 +
  15.426 +lemma vs_eq_diff_eq: 
  15.427 +  "[| is_vectorspace V; x:V; y:V; z:V |] ==> 
  15.428 +  (x = z - y) = (x + y = z)"
  15.429 +  (concl is "?L = ?R" );  
  15.430 +proof -;
  15.431 +  assume vs: "is_vectorspace V" "x:V" "y:V" "z:V";
  15.432 +  show "?L = ?R";   
  15.433 +  proof;
  15.434 +    assume ?L;
  15.435 +    hence "x + y = z - y + y"; by simp;
  15.436 +    also; have "... = z + - y + y"; by (simp! add: diff_eq1);
  15.437 +    also; have "... = z + (- y + y)"; 
  15.438 +      by (rule vs_add_assoc) (simp!)+;
  15.439 +    also; from vs; have "... = z + <0>"; 
  15.440 +      by (simp only: vs_add_minus_left);
  15.441 +    also; from vs; have "... = z"; by (simp only: vs_add_zero_right);
  15.442 +    finally; show ?R;.;
  15.443 +  next;
  15.444 +    assume ?R;
  15.445 +    hence "z - y = (x + y) - y"; by simp;
  15.446 +    also; from vs; have "... = x + y + - y"; 
  15.447 +      by (simp add: diff_eq1);
  15.448 +    also; have "... = x + (y + - y)"; 
  15.449 +      by (rule vs_add_assoc) (simp!)+;
  15.450 +    also; have "... = x"; by (simp!);
  15.451 +    finally; show ?L; by (rule sym);
  15.452 +  qed;
  15.453 +qed;
  15.454 +
  15.455 +lemma vs_add_minus_eq_minus: 
  15.456 +  "[| is_vectorspace V; x:V; y:V; x + y = <0>|] ==> x = - y"; 
  15.457 +proof -;
  15.458 +  assume "is_vectorspace V" "x:V" "y:V"; 
  15.459 +  have "x = (- y + y) + x"; by (simp!);
  15.460 +  also; have "... = - y + (x + y)"; by (simp!);
  15.461 +  also; assume "x + y = <0>";
  15.462 +  also; have "- y + <0> = - y"; by (simp!);
  15.463 +  finally; show "x = - y"; .;
  15.464 +qed;
  15.465 +
  15.466 +lemma vs_add_minus_eq: 
  15.467 +  "[| is_vectorspace V; x:V; y:V; x - y = <0> |] ==> x = y"; 
  15.468 +proof -;
  15.469 +  assume "is_vectorspace V" "x:V" "y:V" "x - y = <0>";
  15.470 +  assume "x - y = <0>";
  15.471 +  hence e: "x + - y = <0>"; by (simp! add: diff_eq1);
  15.472 +  with _ _ _; have "x = - (- y)"; 
  15.473 +    by (rule vs_add_minus_eq_minus) (simp!)+;
  15.474 +  thus "x = y"; by (simp!);
  15.475 +qed;
  15.476 +
  15.477 +lemma vs_add_diff_swap:
  15.478 +  "[| is_vectorspace V; a:V; b:V; c:V; d:V; a + b = c + d|] 
  15.479 +  ==> a - c = d - b";
  15.480 +proof -; 
  15.481 +  assume vs: "is_vectorspace V" "a:V" "b:V" "c:V" "d:V" 
  15.482 +  and eq: "a + b = c + d";
  15.483 +  have "- c + (a + b) = - c + (c + d)"; 
  15.484 +    by (simp! add: vs_add_left_cancel);
  15.485 +  also; have "... = d"; by (rule vs_minus_add_cancel);
  15.486 +  finally; have eq: "- c + (a + b) = d"; .;
  15.487 +  from vs; have "a - c = (- c + (a + b)) + - b"; 
  15.488 +    by (simp add: vs_add_ac diff_eq1);
  15.489 +  also; from eq; have "...  = d + - b"; 
  15.490 +    by (simp! add: vs_add_right_cancel);
  15.491 +  also; have "... = d - b"; by (simp! add : diff_eq2);
  15.492 +  finally; show "a - c = d - b"; .;
  15.493 +qed;
  15.494 +
  15.495 +lemma vs_add_cancel_21: 
  15.496 +  "[| is_vectorspace V; x:V; y:V; z:V; u:V|] 
  15.497 +  ==> (x + (y + z) = y + u) = ((x + z) = u)"
  15.498 +  (concl is "?L = ?R" ); 
  15.499 +proof -; 
  15.500 +  assume "is_vectorspace V" "x:V" "y:V""z:V" "u:V";
  15.501 +  show "?L = ?R";
  15.502 +  proof;
  15.503 +    have "x + z = - y + y + (x + z)"; by (simp!);
  15.504 +    also; have "... = - y + (y + (x + z))";
  15.505 +      by (rule vs_add_assoc) (simp!)+;
  15.506 +    also; have "y + (x + z) = x + (y + z)"; by (simp!);
  15.507 +    also; assume ?L;
  15.508 +    also; have "- y + (y + u) = u"; by (simp!);
  15.509 +    finally; show ?R; .;
  15.510 +  qed (simp! only: vs_add_left_commute [of V x]);
  15.511 +qed;
  15.512 +
  15.513 +lemma vs_add_cancel_end: 
  15.514 +  "[| is_vectorspace V;  x:V; y:V; z:V |] 
  15.515 +  ==> (x + (y + z) = y) = (x = - z)"
  15.516 +  (concl is "?L = ?R" );
  15.517 +proof -;
  15.518 +  assume "is_vectorspace V" "x:V" "y:V" "z:V";
  15.519 +  show "?L = ?R";
  15.520 +  proof;
  15.521 +    assume l: ?L;
  15.522 +    have "x + z = <0>"; 
  15.523 +    proof (rule vs_add_left_cancel [RS iffD1]);
  15.524 +      have "y + (x + z) = x + (y + z)"; by (simp!);
  15.525 +      also; note l;
  15.526 +      also; have "y = y + <0>"; by (simp!);
  15.527 +      finally; show "y + (x + z) = y + <0>"; .;
  15.528 +    qed (simp!)+;
  15.529 +    thus "x = - z"; by (simp! add: vs_add_minus_eq_minus);
  15.530 +  next;
  15.531 +    assume r: ?R;
  15.532 +    hence "x + (y + z) = - z + (y + z)"; by simp; 
  15.533 +    also; have "... = y + (- z + z)"; 
  15.534 +      by (simp! only: vs_add_left_commute);
  15.535 +    also; have "... = y";  by (simp!);
  15.536 +    finally; show ?L; .;
  15.537 +  qed;
  15.538 +qed;
  15.539 +
  15.540 +end;
  15.541 \ No newline at end of file
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/src/HOL/Real/HahnBanach/ZornLemma.thy	Fri Oct 22 20:14:31 1999 +0200
    16.3 @@ -0,0 +1,55 @@
    16.4 +(*  Title:      HOL/Real/HahnBanach/ZornLemma.thy
    16.5 +    ID:         $Id$
    16.6 +    Author:     Gertrud Bauer, TU Munich
    16.7 +*)
    16.8 +
    16.9 +header {* Zorn's Lemma *};
   16.10 +
   16.11 +theory ZornLemma = Aux + Zorn:;
   16.12 +
   16.13 +text{* 
   16.14 +Zorn's Lemmas says: if every linear ordered subset of an ordered set 
   16.15 +$S$ has an upper bound in $S$, then there exists a maximal element in $S$.
   16.16 +In our application $S$ is a set of sets, ordered by set inclusion. Since 
   16.17 +the union of a chain of sets is an upperbound for all elements of the 
   16.18 +chain, the conditions of Zorn's lemma can be modified:
   16.19 +If $S$ is non-empty, it suffices to show that for every non-empty 
   16.20 +chain $c$ in $S$ the union of $c$ also lies in $S$:
   16.21 +*};
   16.22 +
   16.23 +theorem Zorn's_Lemma: 
   16.24 +  "a:S ==> (!!c. c: chain S ==> EX x. x:c ==> Union c : S) 
   16.25 +  ==>  EX y: S. ALL z: S. y <= z --> y = z";
   16.26 +proof (rule Zorn_Lemma2);
   16.27 +  assume aS: "a:S";
   16.28 +  assume r: "!!c. c: chain S ==> EX x. x:c ==> Union c : S";
   16.29 +  show "ALL c:chain S. EX y:S. ALL z:c. z <= y";
   16.30 +  proof;
   16.31 +    fix c; assume "c:chain S"; 
   16.32 +    show "EX y:S. ALL z:c. z <= y";
   16.33 +    proof (rule case_split);
   16.34 + 
   16.35 +      txt{* If $c$ is an empty chain, then every element
   16.36 +      in $S$ is an upperbound of $c$. *};
   16.37 +
   16.38 +      assume "c={}"; 
   16.39 +      with aS; show ?thesis; by fast;
   16.40 +
   16.41 +      txt{* If $c$ is non-empty, then $\cup\; c$ 
   16.42 +      is an upperbound of $c$, that lies in $S$. *};
   16.43 +
   16.44 +    next;
   16.45 +      assume c: "c~={}";
   16.46 +      show ?thesis; 
   16.47 +      proof; 
   16.48 +        show "ALL z:c. z <= Union c"; by fast;
   16.49 +        show "Union c : S"; 
   16.50 +        proof (rule r);
   16.51 +          from c; show "EX x. x:c"; by fast;  
   16.52 +        qed;
   16.53 +      qed;
   16.54 +    qed;
   16.55 +  qed;
   16.56 +qed;
   16.57 +
   16.58 +end;
    17.1 --- a/src/HOL/Real/HahnBanach/Zorn_Lemma.thy	Fri Oct 22 18:41:00 1999 +0200
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,38 +0,0 @@
    17.4 -(*  Title:      HOL/Real/HahnBanach/Zorn_Lemma.thy
    17.5 -    ID:         $Id$
    17.6 -    Author:     Gertrud Bauer, TU Munich
    17.7 -*)
    17.8 -
    17.9 -header {* Zorn's Lemma *};
   17.10 -
   17.11 -theory Zorn_Lemma = Aux + Zorn:;
   17.12 -
   17.13 -lemma Zorn's_Lemma: 
   17.14 - "a:S ==> (!!c. c: chain S ==> EX x. x:c ==> Union c : S) ==>
   17.15 - EX y: S. ALL z: S. y <= z --> y = z";
   17.16 -proof (rule Zorn_Lemma2);
   17.17 -  assume aS: "a:S";
   17.18 -  assume r: "!!c. c: chain S ==> EX x. x:c ==> Union c : S";
   17.19 -  show "ALL c:chain S. EX y:S. ALL z:c. z <= y";
   17.20 -  proof;
   17.21 -    fix c; assume "c:chain S"; 
   17.22 -
   17.23 -    show "EX y:S. ALL z:c. z <= y";
   17.24 -    proof (rule case_split [of "c={}"]);
   17.25 -      assume "c={}"; 
   17.26 -      with aS; show  ?thesis; by fast;
   17.27 -    next;
   17.28 -      assume c: "c~={}";
   17.29 -      show ?thesis; 
   17.30 -      proof; 
   17.31 -        show "ALL z:c. z <= Union c"; by fast;
   17.32 -        show "Union c : S"; 
   17.33 -        proof (rule r);
   17.34 -          from c; show "EX x. x:c"; by fast;  
   17.35 -        qed;
   17.36 -      qed;
   17.37 -    qed;
   17.38 -  qed;
   17.39 -qed;
   17.40 -
   17.41 -end;
   17.42 \ No newline at end of file
    18.1 --- a/src/HOL/Real/HahnBanach/document/notation.tex	Fri Oct 22 18:41:00 1999 +0200
    18.2 +++ b/src/HOL/Real/HahnBanach/document/notation.tex	Fri Oct 22 20:14:31 1999 +0200
    18.3 @@ -1,5 +1,7 @@
    18.4  
    18.5  \renewcommand{\isamarkupheader}[1]{\section{#1}}
    18.6 +\newcommand{\isasymbollambda}{${\mathtt{\lambda}}$}
    18.7 +
    18.8  \parindent 0pt \parskip 0.5ex
    18.9  
   18.10  \newcommand{\name}[1]{\textsf{#1}}
   18.11 @@ -9,12 +11,50 @@
   18.12  \DeclareMathSymbol{\dshsym}{\mathalpha}{letters}{"2D}
   18.13  \newcommand{\dsh}{\dshsym}
   18.14  
   18.15 +\newenvironment{matharray}[1]{\[\begin{array}{#1}}{\end{array}\]}
   18.16 +
   18.17 +\newcommand{\ty}{{\mathbin{:\,}}}
   18.18  \newcommand{\To}{\to}
   18.19  \newcommand{\dt}{{\mathpunct.}}
   18.20 -\newcommand{\ap}{\mathbin{\!}}
   18.21 -\newcommand{\lam}[1]{\mathop{\lambda} #1\dt\;}
   18.22  \newcommand{\all}[1]{\forall #1\dt\;}
   18.23  \newcommand{\ex}[1]{\exists #1\dt\;}
   18.24 +\newcommand{\EX}[1]{\exists #1\dt\;}
   18.25 +\newcommand{\eps}[1]{\epsilon\; #1}
   18.26 +%\newcommand{\Forall}{\mathop\bigwedge}
   18.27 +\newcommand{\Forall}{\forall}
   18.28 +\newcommand{\All}[1]{\Forall #1\dt\;}
   18.29 +\newcommand{\ALL}[1]{\Forall #1\dt\;}
   18.30 +\newcommand{\Eps}[1]{\Epsilon #1\dt\;}
   18.31 +\newcommand{\Eq}{\mathbin{\,\equiv\,}}
   18.32 +\newcommand{\True}{\name{true}}
   18.33 +\newcommand{\False}{\name{false}}
   18.34 +\newcommand{\Impl}{\Rightarrow}
   18.35 +\newcommand{\And}{\;\land\;}
   18.36 +\newcommand{\Or}{\;\lor\;}
   18.37 +\newcommand{\Le}{\le}
   18.38 +\newcommand{\Lt}{\lt}
   18.39 +\newcommand{\lam}[1]{\mathop{\lambda} #1\dt\;}
   18.40 +\newcommand{\ap}{\mathbin{\!}}
   18.41 +
   18.42 +
   18.43 +\newcommand{\norm}[1]{\|\, #1\,\|}
   18.44 +\newcommand{\fnorm}[1]{\|\, #1\,\|}
   18.45 +\newcommand{\zero}{{\mathord{\mathbf {0}}}}
   18.46 +\newcommand{\plus}{{\mathbin{\;\mathtt {+}\;}}}
   18.47 +\newcommand{\minus}{{\mathbin{\;\mathtt {-}\;}}}
   18.48 +\newcommand{\mult}{{\mathbin{\;\mathbf {\odot}\;}}}
   18.49 +\newcommand{\1}{{\mathord{\mathrm{1}}}}
   18.50 +%\newcommand{\zero}{{\mathord{\small\sl\tt {<0>}}}}
   18.51 +%\newcommand{\plus}{{\mathbin{\;\small\sl\tt {[+]}\;}}}
   18.52 +%\newcommand{\minus}{{\mathbin{\;\small\sl\tt {[-]}\;}}}
   18.53 +%\newcommand{\mult}{{\mathbin{\;\small\sl\tt {[*]}\;}}}
   18.54 +%\newcommand{\1}{{\mathord{\mathrb{1}}}}
   18.55 +\newcommand{\fl}{{\mathord{\bf\underline{\phantom{i}}}}}
   18.56 +\renewcommand{\times}{\;{\mathbin{\cdot}}\;}
   18.57 +\newcommand{\qed}{\hfill~$\Box$}
   18.58 +
   18.59 +\newcommand{\isasymbolprod}{$\mult$}
   18.60 +\newcommand{\isasymbolzero}{$\zero$}
   18.61  
   18.62  %%% Local Variables: 
   18.63  %%% mode: latex
    19.1 --- a/src/HOL/Real/HahnBanach/document/root.tex	Fri Oct 22 18:41:00 1999 +0200
    19.2 +++ b/src/HOL/Real/HahnBanach/document/root.tex	Fri Oct 22 20:14:31 1999 +0200
    19.3 @@ -1,21 +1,63 @@
    19.4  
    19.5 -\documentclass[11pt,a4paper]{article}
    19.6 -\usepackage{isabelle,pdfsetup}
    19.7 +\documentclass[11pt,a4paper,twoside]{article}
    19.8 +
    19.9 +\usepackage{comment}
   19.10 +\usepackage{latexsym,theorem}
   19.11 +\usepackage{isabelle,pdfsetup} %last one!
   19.12  
   19.13  \input{notation}
   19.14  
   19.15  \begin{document}
   19.16  
   19.17 +\pagestyle{headings}
   19.18 +\pagenumbering{arabic}
   19.19 +
   19.20  \title{The Hahn-Banach Theorem for Real Vectorspaces}
   19.21  \author{Gertrud Bauer}
   19.22  \maketitle
   19.23  
   19.24  \begin{abstract}
   19.25 -  FIXME
   19.26 +The Hahn-Banach theorem is one of the most important theorems
   19.27 +of functional analysis. We present the fully formal proof of two versions of
   19.28 +the theorem, one for general linear spaces and one for normed spaces
   19.29 +as a corollary of the first. 
   19.30 +
   19.31 +The first part contains the definition of basic notions of
   19.32 +linear algebra, such as vector spaces, subspaces, normed spaces,
   19.33 +continous linearforms, norm of functions and an order on
   19.34 +functions by domain extension.
   19.35 +
   19.36 +The second part contains some lemmas about the supremum w.r.t. the
   19.37 +function order and the extension of a non-maximal function, 
   19.38 +which are needed for the proof of the main theorem.
   19.39 +
   19.40 +The third part is the proof of the theorem in its two different versions.
   19.41 +
   19.42  \end{abstract}
   19.43  
   19.44  \tableofcontents
   19.45  
   19.46 -\input{session}
   19.47 +\part {Basic notions}
   19.48 +
   19.49 +\input{Bounds.tex}
   19.50 +\input{Aux.tex}
   19.51 +\input{VectorSpace.tex}
   19.52 +\input{Subspace.tex}
   19.53 +\input{NormedSpace.tex}
   19.54 +\input{Linearform.tex}
   19.55 +\input{FunctionOrder.tex}
   19.56 +\input{FunctionNorm.tex}
   19.57 +\input{ZornLemma.tex}
   19.58 +
   19.59 +\part {Lemmas for the proof}
   19.60 +
   19.61 +\input{HahnBanachSupLemmas.tex}
   19.62 +\input{HahnBanachExtLemmas.tex}
   19.63 +
   19.64 +\part {The proof}
   19.65 +
   19.66 +\input{HahnBanach.tex}
   19.67 +\bibliographystyle{abbrv}
   19.68 +\bibliography{bib}
   19.69  
   19.70  \end{document}