src/HOL/Multivariate_Analysis/Linear_Algebra.thy
changeset 44529 d4d9ea33703c
parent 44528 0b8e0dbb2bdd
child 44629 1cd782f3458b
equal deleted inserted replaced
44528:0b8e0dbb2bdd 44529:d4d9ea33703c
  1356     }
  1356     }
  1357     hence "\<forall>i<DIM('a). P i (?x$$i)" by metis
  1357     hence "\<forall>i<DIM('a). P i (?x$$i)" by metis
  1358     hence ?rhs by metis }
  1358     hence ?rhs by metis }
  1359   ultimately show ?thesis by metis
  1359   ultimately show ?thesis by metis
  1360 qed
  1360 qed
  1361 
       
  1362 subsection {* An ordering on euclidean spaces that will allow us to talk about intervals *}
       
  1363 
       
  1364 class ordered_euclidean_space = ord + euclidean_space +
       
  1365   assumes eucl_le: "x \<le> y \<longleftrightarrow> (\<forall>i < DIM('a). x $$ i \<le> y $$ i)"
       
  1366   and eucl_less: "x < y \<longleftrightarrow> (\<forall>i < DIM('a). x $$ i < y $$ i)"
       
  1367 
       
  1368 lemma eucl_less_not_refl[simp, intro!]: "\<not> x < (x::'a::ordered_euclidean_space)"
       
  1369   unfolding eucl_less[where 'a='a] by auto
       
  1370 
       
  1371 lemma euclidean_trans[trans]:
       
  1372   fixes x y z :: "'a::ordered_euclidean_space"
       
  1373   shows "x < y \<Longrightarrow> y < z \<Longrightarrow> x < z"
       
  1374   and "x \<le> y \<Longrightarrow> y < z \<Longrightarrow> x < z"
       
  1375   and "x \<le> y \<Longrightarrow> y \<le> z \<Longrightarrow> x \<le> z"
       
  1376   by (force simp: eucl_less[where 'a='a] eucl_le[where 'a='a])+
       
  1377 
  1361 
  1378 subsection {* Linearity and Bilinearity continued *}
  1362 subsection {* Linearity and Bilinearity continued *}
  1379 
  1363 
  1380 lemma linear_bounded:
  1364 lemma linear_bounded:
  1381   fixes f:: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  1365   fixes f:: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  2725 apply (simp add: field_simps)
  2709 apply (simp add: field_simps)
  2726 apply simp
  2710 apply simp
  2727 apply simp
  2711 apply simp
  2728 done
  2712 done
  2729 
  2713 
  2730 subsection "Instantiate @{typ real} and @{typ complex} as typeclass @{text ordered_euclidean_space}."
  2714 subsection {* An ordering on euclidean spaces that will allow us to talk about intervals *}
       
  2715 
       
  2716 class ordered_euclidean_space = ord + euclidean_space +
       
  2717   assumes eucl_le: "x \<le> y \<longleftrightarrow> (\<forall>i < DIM('a). x $$ i \<le> y $$ i)"
       
  2718   and eucl_less: "x < y \<longleftrightarrow> (\<forall>i < DIM('a). x $$ i < y $$ i)"
       
  2719 
       
  2720 lemma eucl_less_not_refl[simp, intro!]: "\<not> x < (x::'a::ordered_euclidean_space)"
       
  2721   unfolding eucl_less[where 'a='a] by auto
       
  2722 
       
  2723 lemma euclidean_trans[trans]:
       
  2724   fixes x y z :: "'a::ordered_euclidean_space"
       
  2725   shows "x < y \<Longrightarrow> y < z \<Longrightarrow> x < z"
       
  2726   and "x \<le> y \<Longrightarrow> y < z \<Longrightarrow> x < z"
       
  2727   and "x \<le> y \<Longrightarrow> y \<le> z \<Longrightarrow> x \<le> z"
       
  2728   unfolding eucl_less[where 'a='a] eucl_le[where 'a='a]
       
  2729   by (fast intro: less_trans, fast intro: le_less_trans,
       
  2730     fast intro: order_trans)
  2731 
  2731 
  2732 lemma basis_real_range: "basis ` {..<1} = {1::real}" by auto
  2732 lemma basis_real_range: "basis ` {..<1} = {1::real}" by auto
  2733 
  2733 
  2734 instance real::ordered_euclidean_space
  2734 instance real::ordered_euclidean_space
  2735   by default (auto simp add: euclidean_component_def)
  2735   by default (auto simp add: euclidean_component_def)
  2744 
  2744 
  2745 lemma complex_basis[simp]:
  2745 lemma complex_basis[simp]:
  2746   shows "basis 0 = (1::complex)" and "basis 1 = ii" and "basis (Suc 0) = ii"
  2746   shows "basis 0 = (1::complex)" and "basis 1 = ii" and "basis (Suc 0) = ii"
  2747   unfolding basis_complex_def by auto
  2747   unfolding basis_complex_def by auto
  2748 
  2748 
  2749 subsection {* Products Spaces *}
       
  2750 
       
  2751 lemma DIM_prod[simp]: "DIM('a \<times> 'b) = DIM('b::euclidean_space) + DIM('a::euclidean_space)"
  2749 lemma DIM_prod[simp]: "DIM('a \<times> 'b) = DIM('b::euclidean_space) + DIM('a::euclidean_space)"
  2752   (* FIXME: why this orientation? Why not "DIM('a) + DIM('b)" ? *)
  2750   (* FIXME: why this orientation? Why not "DIM('a) + DIM('b)" ? *)
  2753   unfolding dimension_prod_def by (rule add_commute)
  2751   unfolding dimension_prod_def by (rule add_commute)
  2754 
  2752 
  2755 instantiation prod :: (ordered_euclidean_space, ordered_euclidean_space) ordered_euclidean_space
  2753 instantiation prod :: (ordered_euclidean_space, ordered_euclidean_space) ordered_euclidean_space
  2759 definition "x < (y::('a\<times>'b)) \<longleftrightarrow> (\<forall>i<DIM('a\<times>'b). x $$ i < y $$ i)"
  2757 definition "x < (y::('a\<times>'b)) \<longleftrightarrow> (\<forall>i<DIM('a\<times>'b). x $$ i < y $$ i)"
  2760 
  2758 
  2761 instance proof qed (auto simp: less_prod_def less_eq_prod_def)
  2759 instance proof qed (auto simp: less_prod_def less_eq_prod_def)
  2762 end
  2760 end
  2763 
  2761 
  2764 
       
  2765 end
  2762 end