# HG changeset patch # User wenzelm # Date 1731789394 -3600 # Node ID 2575f1bd226be0e976633686b2e6a087292336de # Parent d8f77c1c97034e1a8d73ebdeb035cc3ecb14ef54 tuned proofs; diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Function_Norm.thy --- a/src/HOL/Hahn_Banach/Function_Norm.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Function_Norm.thy Sat Nov 16 21:36:34 2024 +0100 @@ -113,13 +113,13 @@ proof fix y assume y: "y \ B V f" show "y \ b" - proof cases - assume "y = 0" + proof (cases "y = 0") + case True then show ?thesis unfolding b_def by arith next txt \The second case is \y = \f x\ / \x\\ for some \x \ V\ with \x \ 0\.\ - assume "y \ 0" + case False with y obtain x where y_rep: "y = \f x\ * inverse \x\" and x: "x \ V" and neq: "x \ 0" by (auto simp add: B_def divide_inverse) @@ -132,7 +132,7 @@ also have "\f x\ * inverse \x\ \ (c * \x\) * inverse \x\" proof (rule mult_right_mono) from c x show "\f x\ \ c * \x\" .. - from gt have "0 < inverse \x\" + from gt have "0 < inverse \x\" by (rule positive_imp_inverse_positive) then show "0 \ inverse \x\" by (rule order_less_imp_le) qed @@ -140,7 +140,7 @@ by (rule Groups.mult.assoc) also from gt have "\x\ \ 0" by simp - then have "\x\ * inverse \x\ = 1" by simp + then have "\x\ * inverse \x\ = 1" by simp also have "c * 1 \ b" by (simp add: b_def) finally show "y \ b" . qed @@ -205,8 +205,8 @@ interpret continuous V f norm by fact interpret linearform V f by fact show ?thesis - proof cases - assume "x = 0" + proof (cases "x = 0") + case True then have "\f x\ = \f 0\" by simp also have "f 0 = 0" by rule unfold_locales also have "\\\ = 0" by simp @@ -216,7 +216,7 @@ with a have "0 \ \f\\V * \x\" by (simp add: zero_le_mult_iff) finally show "\f x\ \ \f\\V * \x\" . next - assume "x \ 0" + case False with x have neq: "\x\ \ 0" by simp then have "\f x\ = (\f x\ * inverse \x\) * \x\" by simp also have "\ \ \f\\V * \x\" @@ -250,11 +250,11 @@ proof (rule fn_norm_leastB [folded B_def fn_norm_def]) fix b assume b: "b \ B V f" show "b \ c" - proof cases - assume "b = 0" + proof (cases "b = 0") + case True with ge show ?thesis by simp next - assume "b \ 0" + case False with b obtain x where b_rep: "b = \f x\ * inverse \x\" and x_neq: "x \ 0" and x: "x \ V" by (auto simp add: B_def divide_inverse) @@ -272,7 +272,7 @@ qed finally show ?thesis . qed - qed (insert \continuous V f norm\, simp_all add: continuous_def) + qed (use \continuous V f norm\ in \simp_all add: continuous_def\) qed end diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Hahn_Banach.thy --- a/src/HOL/Hahn_Banach/Hahn_Banach.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Hahn_Banach.thy Sat Nov 16 21:36:34 2024 +0100 @@ -59,39 +59,36 @@ then have M: "M = \" by (simp only:) from E have F: "vectorspace F" .. note FE = \F \ E\ - { - fix c assume cM: "c \ chains M" and ex: "\x. x \ c" - have "\c \ M" - \ \Show that every non-empty chain \c\ of \M\ has an upper bound in \M\:\ - \ \\\c\ is greater than any element of the chain \c\, so it suffices to show \\c \ M\.\ - unfolding M_def - proof (rule norm_pres_extensionI) - let ?H = "domain (\c)" - let ?h = "funct (\c)" + have "\c \ M" if cM: "c \ chains M" and ex: "\x. x \ c" for c + \ \Show that every non-empty chain \c\ of \M\ has an upper bound in \M\:\ + \ \\\c\ is greater than any element of the chain \c\, so it suffices to show \\c \ M\.\ + unfolding M_def + proof (rule norm_pres_extensionI) + let ?H = "domain (\c)" + let ?h = "funct (\c)" - have a: "graph ?H ?h = \c" - proof (rule graph_domain_funct) - fix x y z assume "(x, y) \ \c" and "(x, z) \ \c" - with M_def cM show "z = y" by (rule sup_definite) - qed - moreover from M cM a have "linearform ?H ?h" - by (rule sup_lf) - moreover from a M cM ex FE E have "?H \ E" - by (rule sup_subE) - moreover from a M cM ex FE have "F \ ?H" - by (rule sup_supF) - moreover from a M cM ex have "graph F f \ graph ?H ?h" - by (rule sup_ext) - moreover from a M cM have "\x \ ?H. ?h x \ p x" - by (rule sup_norm_pres) - ultimately show "\H h. \c = graph H h - \ linearform H h - \ H \ E - \ F \ H - \ graph F f \ graph H h - \ (\x \ H. h x \ p x)" by blast + have a: "graph ?H ?h = \c" + proof (rule graph_domain_funct) + fix x y z assume "(x, y) \ \c" and "(x, z) \ \c" + with M_def cM show "z = y" by (rule sup_definite) qed - } + moreover from M cM a have "linearform ?H ?h" + by (rule sup_lf) + moreover from a M cM ex FE E have "?H \ E" + by (rule sup_subE) + moreover from a M cM ex FE have "F \ ?H" + by (rule sup_supF) + moreover from a M cM ex have "graph F f \ graph ?H ?h" + by (rule sup_ext) + moreover from a M cM have "\x \ ?H. ?h x \ p x" + by (rule sup_norm_pres) + ultimately show "\H h. \c = graph H h + \ linearform H h + \ H \ E + \ F \ H + \ graph F f \ graph H h + \ (\x \ H. h x \ p x)" by blast + qed then have "\g \ M. \x \ M. g \ x \ x = g" \ \With Zorn's Lemma we can conclude that there is a maximal element in \M\. \<^smallskip>\ proof (rule Zorn's_Lemma) @@ -371,11 +368,11 @@ have q: "seminorm E p" proof fix x y a assume x: "x \ E" and y: "y \ E" - + txt \\p\ is positive definite:\ have "0 \ \f\\F" by (rule ge_zero) moreover from x have "0 \ \x\" .. - ultimately show "0 \ p x" + ultimately show "0 \ p x" by (simp add: p_def zero_le_mult_iff) txt \\p\ is absolutely homogeneous:\ diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Hahn_Banach_Ext_Lemmas.thy --- a/src/HOL/Hahn_Banach/Hahn_Banach_Ext_Lemmas.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Hahn_Banach_Ext_Lemmas.thy Sat Nov 16 21:36:34 2024 +0100 @@ -61,21 +61,22 @@ then show "\u. \y \ ?S. y \ u" .. qed then obtain xi where xi: "lub ?S xi" .. - { - fix y assume "y \ F" - then have "a y \ ?S" by blast - with xi have "a y \ xi" by (rule lub.upper) - } - moreover { - fix y assume y: "y \ F" - from xi have "xi \ b y" + have "a y \ xi" if "y \ F" for y + proof - + from that have "a y \ ?S" by blast + with xi show ?thesis by (rule lub.upper) + qed + moreover have "xi \ b y" if y: "y \ F" for y + proof - + from xi + show ?thesis proof (rule lub.least) fix au assume "au \ ?S" then obtain u where u: "u \ F" and au: "au = a u" by blast from u y have "a u \ b y" by (rule r) with au show "au \ b y" by (simp only:) qed - } + qed ultimately show "\xi. \y \ F. a y \ xi \ xi \ b y" by blast qed @@ -106,83 +107,78 @@ have "lin x0 \ E" .. with HE show "vectorspace (H + lin x0)" using E .. qed - { - fix x1 x2 assume x1: "x1 \ H'" and x2: "x2 \ H'" - show "h' (x1 + x2) = h' x1 + h' x2" - proof - - from H' x1 x2 have "x1 + x2 \ H'" - by (rule vectorspace.add_closed) - with x1 x2 obtain y y1 y2 a a1 a2 where - x1x2: "x1 + x2 = y + a \ x0" and y: "y \ H" - and x1_rep: "x1 = y1 + a1 \ x0" and y1: "y1 \ H" - and x2_rep: "x2 = y2 + a2 \ x0" and y2: "y2 \ H" - unfolding H'_def sum_def lin_def by blast - - have ya: "y1 + y2 = y \ a1 + a2 = a" using E HE _ y x0 - proof (rule decomp_H') text_raw \\label{decomp-H-use}\ - from HE y1 y2 show "y1 + y2 \ H" - by (rule subspace.add_closed) - from x0 and HE y y1 y2 - have "x0 \ E" "y \ E" "y1 \ E" "y2 \ E" by auto - with x1_rep x2_rep have "(y1 + y2) + (a1 + a2) \ x0 = x1 + x2" - by (simp add: add_ac add_mult_distrib2) - also note x1x2 - finally show "(y1 + y2) + (a1 + a2) \ x0 = y + a \ x0" . - qed - - from h'_def x1x2 E HE y x0 - have "h' (x1 + x2) = h y + a * xi" - by (rule h'_definite) - also have "\ = h (y1 + y2) + (a1 + a2) * xi" - by (simp only: ya) - also from y1 y2 have "h (y1 + y2) = h y1 + h y2" - by simp - also have "\ + (a1 + a2) * xi = (h y1 + a1 * xi) + (h y2 + a2 * xi)" - by (simp add: distrib_right) - also from h'_def x1_rep E HE y1 x0 - have "h y1 + a1 * xi = h' x1" - by (rule h'_definite [symmetric]) - also from h'_def x2_rep E HE y2 x0 - have "h y2 + a2 * xi = h' x2" - by (rule h'_definite [symmetric]) - finally show ?thesis . + show "h' (x1 + x2) = h' x1 + h' x2" if x1: "x1 \ H'" and x2: "x2 \ H'" for x1 x2 + proof - + from H' x1 x2 have "x1 + x2 \ H'" + by (rule vectorspace.add_closed) + with x1 x2 obtain y y1 y2 a a1 a2 where + x1x2: "x1 + x2 = y + a \ x0" and y: "y \ H" + and x1_rep: "x1 = y1 + a1 \ x0" and y1: "y1 \ H" + and x2_rep: "x2 = y2 + a2 \ x0" and y2: "y2 \ H" + unfolding H'_def sum_def lin_def by blast + + have ya: "y1 + y2 = y \ a1 + a2 = a" using E HE _ y x0 + proof (rule decomp_H') text_raw \\label{decomp-H-use}\ + from HE y1 y2 show "y1 + y2 \ H" + by (rule subspace.add_closed) + from x0 and HE y y1 y2 + have "x0 \ E" "y \ E" "y1 \ E" "y2 \ E" by auto + with x1_rep x2_rep have "(y1 + y2) + (a1 + a2) \ x0 = x1 + x2" + by (simp add: add_ac add_mult_distrib2) + also note x1x2 + finally show "(y1 + y2) + (a1 + a2) \ x0 = y + a \ x0" . qed - next - fix x1 c assume x1: "x1 \ H'" - show "h' (c \ x1) = c * (h' x1)" - proof - - from H' x1 have ax1: "c \ x1 \ H'" - by (rule vectorspace.mult_closed) - with x1 obtain y a y1 a1 where - cx1_rep: "c \ x1 = y + a \ x0" and y: "y \ H" - and x1_rep: "x1 = y1 + a1 \ x0" and y1: "y1 \ H" - unfolding H'_def sum_def lin_def by blast - - have ya: "c \ y1 = y \ c * a1 = a" using E HE _ y x0 - proof (rule decomp_H') - from HE y1 show "c \ y1 \ H" - by (rule subspace.mult_closed) - from x0 and HE y y1 - have "x0 \ E" "y \ E" "y1 \ E" by auto - with x1_rep have "c \ y1 + (c * a1) \ x0 = c \ x1" - by (simp add: mult_assoc add_mult_distrib1) - also note cx1_rep - finally show "c \ y1 + (c * a1) \ x0 = y + a \ x0" . - qed - - from h'_def cx1_rep E HE y x0 have "h' (c \ x1) = h y + a * xi" - by (rule h'_definite) - also have "\ = h (c \ y1) + (c * a1) * xi" - by (simp only: ya) - also from y1 have "h (c \ y1) = c * h y1" - by simp - also have "\ + (c * a1) * xi = c * (h y1 + a1 * xi)" - by (simp only: distrib_left) - also from h'_def x1_rep E HE y1 x0 have "h y1 + a1 * xi = h' x1" - by (rule h'_definite [symmetric]) - finally show ?thesis . + + from h'_def x1x2 E HE y x0 + have "h' (x1 + x2) = h y + a * xi" + by (rule h'_definite) + also have "\ = h (y1 + y2) + (a1 + a2) * xi" + by (simp only: ya) + also from y1 y2 have "h (y1 + y2) = h y1 + h y2" + by simp + also have "\ + (a1 + a2) * xi = (h y1 + a1 * xi) + (h y2 + a2 * xi)" + by (simp add: distrib_right) + also from h'_def x1_rep E HE y1 x0 + have "h y1 + a1 * xi = h' x1" + by (rule h'_definite [symmetric]) + also from h'_def x2_rep E HE y2 x0 + have "h y2 + a2 * xi = h' x2" + by (rule h'_definite [symmetric]) + finally show ?thesis . + qed + show "h' (c \ x1) = c * (h' x1)" if x1: "x1 \ H'" for x1 c + proof - + from H' x1 have ax1: "c \ x1 \ H'" + by (rule vectorspace.mult_closed) + with x1 obtain y a y1 a1 where + cx1_rep: "c \ x1 = y + a \ x0" and y: "y \ H" + and x1_rep: "x1 = y1 + a1 \ x0" and y1: "y1 \ H" + unfolding H'_def sum_def lin_def by blast + + have ya: "c \ y1 = y \ c * a1 = a" using E HE _ y x0 + proof (rule decomp_H') + from HE y1 show "c \ y1 \ H" + by (rule subspace.mult_closed) + from x0 and HE y y1 + have "x0 \ E" "y \ E" "y1 \ E" by auto + with x1_rep have "c \ y1 + (c * a1) \ x0 = c \ x1" + by (simp add: mult_assoc add_mult_distrib1) + also note cx1_rep + finally show "c \ y1 + (c * a1) \ x0 = y + a \ x0" . qed - } + + from h'_def cx1_rep E HE y x0 have "h' (c \ x1) = h y + a * xi" + by (rule h'_definite) + also have "\ = h (c \ y1) + (c * a1) * xi" + by (simp only: ya) + also from y1 have "h (c \ y1) = c * h y1" + by simp + also have "\ + (c * a1) * xi = c * (h y1 + a1 * xi)" + by (simp only: distrib_left) + also from h'_def x1_rep E HE y1 x0 have "h y1 + a1 * xi = h' x1" + by (rule h'_definite [symmetric]) + finally show ?thesis . + qed qed qed @@ -218,7 +214,7 @@ unfolding H'_def sum_def lin_def by blast from y have y': "y \ E" .. from y have ay: "inverse a \ y \ H" by simp - + from h'_def x_rep E HE y x0 have "h' x = h y + a * xi" by (rule h'_definite) also have "\ \ p (y + a \ x0)" @@ -237,7 +233,7 @@ with lz have "a * xi \ a * (- p (inverse a \ y + x0) - h (inverse a \ y))" by (simp add: mult_left_mono_neg order_less_imp_le) - + also have "\ = - a * (p (inverse a \ y + x0)) - a * (h (inverse a \ y))" by (simp add: right_diff_distrib) diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Hahn_Banach_Sup_Lemmas.thy --- a/src/HOL/Hahn_Banach/Hahn_Banach_Sup_Lemmas.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Hahn_Banach_Sup_Lemmas.thy Sat Nov 16 21:36:34 2024 +0100 @@ -300,11 +300,10 @@ from FE show "F \ {}" by (rule subspace.non_empty) from graph M cM ex have "graph F f \ graph H h" by (rule sup_ext) then show "F \ H" .. - fix x y assume "x \ F" and "y \ F" - with FE show "x + y \ F" by (rule subspace.add_closed) -next - fix x a assume "x \ F" - with FE show "a \ x \ F" by (rule subspace.mult_closed) + show "x + y \ F" if "x \ F" and "y \ F" for x y + using FE that by (rule subspace.add_closed) + show "a \ x \ F" if "x \ F" for x a + using FE that by (rule subspace.mult_closed) qed text \ @@ -409,37 +408,32 @@ interpret seminorm E p by fact interpret linearform H h by fact have H: "vectorspace H" using \vectorspace E\ .. - { - assume l: ?L - show ?R - proof - fix x assume x: "x \ H" - have "h x \ \h x\" by arith - also from l x have "\ \ p x" .. - finally show "h x \ p x" . + show ?R if l: ?L + proof + fix x assume x: "x \ H" + have "h x \ \h x\" by arith + also from l x have "\ \ p x" .. + finally show "h x \ p x" . + qed + show ?L if r: ?R + proof + fix x assume x: "x \ H" + show "\b\ \ a" when "- a \ b" "b \ a" for a b :: real + using that by arith + from \linearform H h\ and H x + have "- h x = h (- x)" by (rule linearform.neg [symmetric]) + also + from H x have "- x \ H" by (rule vectorspace.neg_closed) + with r have "h (- x) \ p (- x)" .. + also have "\ = p x" + using \seminorm E p\ \vectorspace E\ + proof (rule seminorm.minus) + from x show "x \ E" .. qed - next - assume r: ?R - show ?L - proof - fix x assume x: "x \ H" - show "\b\ \ a" when "- a \ b" "b \ a" for a b :: real - using that by arith - from \linearform H h\ and H x - have "- h x = h (- x)" by (rule linearform.neg [symmetric]) - also - from H x have "- x \ H" by (rule vectorspace.neg_closed) - with r have "h (- x) \ p (- x)" .. - also have "\ = p x" - using \seminorm E p\ \vectorspace E\ - proof (rule seminorm.minus) - from x show "x \ E" .. - qed - finally have "- h x \ p x" . - then show "- p x \ h x" by simp - from r x show "h x \ p x" .. - qed - } + finally have "- h x \ p x" . + then show "- p x \ h x" by simp + from r x show "h x \ p x" .. + qed qed end diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Normed_Space.thy --- a/src/HOL/Hahn_Banach/Normed_Space.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Normed_Space.thy Sat Nov 16 21:36:34 2024 +0100 @@ -101,8 +101,8 @@ interpret normed_vectorspace E norm by fact show ?thesis proof - show "vectorspace F" by (rule vectorspace) unfold_locales - next + show "vectorspace F" + by (rule vectorspace) unfold_locales have "Normed_Space.norm E norm" .. with subset show "Normed_Space.norm F norm" by (simp add: norm_def seminorm_def norm_axioms_def) diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Subspace.thy --- a/src/HOL/Hahn_Banach/Subspace.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Subspace.thy Sat Nov 16 21:36:34 2024 +0100 @@ -110,9 +110,7 @@ proof show "V \ {}" .. show "V \ V" .. -next - fix x y assume x: "x \ V" and y: "y \ V" - fix a :: real + fix a :: real and x y assume x: "x \ V" and y: "y \ V" from x y show "x + y \ V" by simp from x show "a \ x \ V" by simp qed @@ -181,14 +179,13 @@ shows "lin x \ V" proof from x show "lin x \ {}" by auto -next show "lin x \ V" proof fix x' assume "x' \ lin x" then obtain a where "x' = a \ x" .. with x show "x' \ V" by simp qed -next + fix x' x'' assume x': "x' \ lin x" and x'': "x'' \ lin x" show "x' + x'' \ lin x" proof - @@ -199,8 +196,7 @@ also have "\ \ lin x" .. finally show ?thesis . qed - fix a :: real - show "a \ x' \ lin x" + show "a \ x' \ lin x" for a :: real proof - from x' obtain a' where "x' = a' \ x" .. with x have "a \ x' = (a * a') \ x" by (simp add: mult_assoc) @@ -294,7 +290,7 @@ "u \ U" and "v \ V" .. then show "x \ E" by simp qed - next + fix x y assume x: "x \ U + V" and y: "y \ U + V" show "x + y \ U + V" proof - @@ -308,7 +304,7 @@ using x y by (simp_all add: add_ac) then show ?thesis .. qed - fix a show "a \ x \ U + V" + show "a \ x \ U + V" for a proof - from x obtain u v where "x = u + v" and "u \ U" and "v \ V" .. then have "a \ u \ U" and "a \ v \ V" @@ -359,7 +355,7 @@ from v2 v1 have v: "v2 - v1 \ V" by (rule vectorspace.diff_closed [OF V]) with eq have u': " u1 - u2 \ V" by (simp only:) - + show "u1 = u2" proof (rule add_minus_eq) from u1 show "u1 \ E" .. @@ -405,14 +401,14 @@ then obtain a where xx': "x = a \ x'" by blast have "x = 0" - proof cases - assume "a = 0" + proof (cases "a = 0") + case True with xx' and x' show ?thesis by simp next - assume a: "a \ 0" + case False from x have "x \ H" .. with xx' have "inverse a \ a \ x' \ H" by simp - with a and x' have "x' \ H" by (simp add: mult_assoc2) + with False and x' have "x' \ H" by (simp add: mult_assoc2) with \x' \ H\ show ?thesis by contradiction qed then show "x \ {0}" .. diff -r d8f77c1c9703 -r 2575f1bd226b src/HOL/Hahn_Banach/Zorn_Lemma.thy --- a/src/HOL/Hahn_Banach/Zorn_Lemma.thy Sat Nov 16 20:22:26 2024 +0100 +++ b/src/HOL/Hahn_Banach/Zorn_Lemma.thy Sat Nov 16 21:36:34 2024 +0100 @@ -27,17 +27,15 @@ proof fix c assume "c \ chains S" show "\y \ S. \z \ c. z \ y" - proof cases + proof (cases "c = {}") txt \If \c\ is an empty chain, then every element in \S\ is an upper bound of \c\.\ - - assume "c = {}" + case True with aS show ?thesis by fast - + next txt \If \c\ is non-empty, then \\c\ is an upper bound of \c\, lying in \S\.\ - next - assume "c \ {}" + case False show ?thesis proof show "\z \ c. z \ \c" by fast