diff -r 2d3df8633dad -r db890d9fc5c2 src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy Mon Dec 16 17:08:22 2013 +0100 +++ b/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy Mon Dec 16 17:08:22 2013 +0100 @@ -58,7 +58,7 @@ begin definition "x \ y \ (\i. x$i \ y$i)" -definition "x < y \ (\i. x$i < y$i)" +definition "x < (y::'a^'b) \ x \ y \ \ y \ x" instance .. end @@ -77,10 +77,11 @@ end -instantiation vec :: (linorder, cart_one) linorder -begin +instance vec:: (order, finite) order + by default (auto simp: less_eq_vec_def less_vec_def vec_eq_iff + intro: order.trans order.antisym order.strict_implies_order) -instance +instance vec :: (linorder, cart_one) linorder proof obtain a :: 'b where all: "\P. (\i. P i) \ P a" proof - @@ -89,17 +90,12 @@ then have "\P. (\i\UNIV. P i) \ P b" by auto then show thesis by (auto intro: that) qed - + fix x y :: "'a^'b::cart_one" note [simp] = less_eq_vec_def less_vec_def all vec_eq_iff field_simps - fix x y z :: "'a^'b::cart_one" - show "x \ x" "(x < y) = (x \ y \ \ y \ x)" "x \ y \ y \ x" by auto - { assume "x\y" "y\z" then show "x\z" by auto } - { assume "x\y" "y\x" then show "x=y" by auto } + show "x \ y \ y \ x" by auto qed -end - -text{* Constant Vectors *} +text{* Constant Vectors *} definition "vec x = (\ i. x)" @@ -332,14 +328,24 @@ using setsum_norm_allsubsets_bound[OF assms] by (simp add: DIM_cart Basis_real_def) -instance vec :: (ordered_euclidean_space, finite) ordered_euclidean_space -proof - fix x y::"'a^'b" - show "(x \ y) = (\i\Basis. x \ i \ y \ i)" - unfolding less_eq_vec_def apply(subst eucl_le) by (simp add: Basis_vec_def inner_axis) - show"(x < y) = (\i\Basis. x \ i < y \ i)" - unfolding less_vec_def apply(subst eucl_less) by (simp add: Basis_vec_def inner_axis) -qed +instantiation vec :: (ordered_euclidean_space, finite) ordered_euclidean_space +begin + +definition "inf x y = (\ i. inf (x $ i) (y $ i))" +definition "sup x y = (\ i. sup (x $ i) (y $ i))" +definition "Inf X = (\ i. (INF x:X. x $ i))" +definition "Sup X = (\ i. (SUP x:X. x $ i))" +definition "abs x = (\ i. abs (x $ i))" + +instance + apply default + unfolding euclidean_representation_setsum' + apply (auto simp: less_eq_vec_def inf_vec_def sup_vec_def Inf_vec_def Sup_vec_def inner_axis + Basis_vec_def inner_Basis_inf_left inner_Basis_sup_left inner_Basis_INF_left + inner_Basis_SUP_left eucl_le[where 'a='a] less_le_not_le abs_vec_def abs_inner) + done + +end subsection {* Matrix operations *} @@ -970,8 +976,6 @@ fixes a :: "'a::linorder^'n" shows "{a .. a} = {a} \ {a<..