equal
deleted
inserted
replaced
1597 proof (rule span_sum[of D "(\<lambda>b. b /\<^sub>R (2 * real (card D)))" D]) |
1597 proof (rule span_sum[of D "(\<lambda>b. b /\<^sub>R (2 * real (card D)))" D]) |
1598 { |
1598 { |
1599 fix x :: "'a::euclidean_space" |
1599 fix x :: "'a::euclidean_space" |
1600 assume "x \<in> D" |
1600 assume "x \<in> D" |
1601 then have "x \<in> span D" |
1601 then have "x \<in> span D" |
1602 using span_superset[of _ "D"] by auto |
1602 using span_base[of _ "D"] by auto |
1603 then have "x /\<^sub>R (2 * real (card D)) \<in> span D" |
1603 then have "x /\<^sub>R (2 * real (card D)) \<in> span D" |
1604 using span_mul[of x "D" "(inverse (real (card D)) / 2)"] by auto |
1604 using span_mul[of x "D" "(inverse (real (card D)) / 2)"] by auto |
1605 } |
1605 } |
1606 then show "\<And>x. x\<in>D \<Longrightarrow> x /\<^sub>R (2 * real (card D)) \<in> span D" |
1606 then show "\<And>x. x\<in>D \<Longrightarrow> x /\<^sub>R (2 * real (card D)) \<in> span D" |
1607 by auto |
1607 by auto |
5715 |
5715 |
5716 lemma dim_special_hyperplane: |
5716 lemma dim_special_hyperplane: |
5717 fixes k :: "'n::euclidean_space" |
5717 fixes k :: "'n::euclidean_space" |
5718 shows "k \<in> Basis \<Longrightarrow> dim {x. k \<bullet> x = 0} = DIM('n) - 1" |
5718 shows "k \<in> Basis \<Longrightarrow> dim {x. k \<bullet> x = 0} = DIM('n) - 1" |
5719 apply (simp add: special_hyperplane_span) |
5719 apply (simp add: special_hyperplane_span) |
5720 apply (rule Linear_Algebra.dim_unique [OF subset_refl]) |
5720 apply (rule dim_unique [OF subset_refl]) |
5721 apply (auto simp: Diff_subset independent_substdbasis) |
5721 apply (auto simp: Diff_subset independent_substdbasis) |
5722 apply (metis member_remove remove_def span_superset) |
5722 apply (metis member_remove remove_def span_base) |
5723 done |
5723 done |
5724 |
5724 |
5725 proposition dim_hyperplane: |
5725 proposition dim_hyperplane: |
5726 fixes a :: "'a::euclidean_space" |
5726 fixes a :: "'a::euclidean_space" |
5727 assumes "a \<noteq> 0" |
5727 assumes "a \<noteq> 0" |
6748 done |
6748 done |
6749 have "span (S \<union> insert a' U) = span (insert a' (S \<union> T))" |
6749 have "span (S \<union> insert a' U) = span (insert a' (S \<union> T))" |
6750 using spanU by simp |
6750 using spanU by simp |
6751 also have "... = span (insert a (S \<union> T))" |
6751 also have "... = span (insert a (S \<union> T))" |
6752 apply (rule eq_span_insert_eq) |
6752 apply (rule eq_span_insert_eq) |
6753 apply (simp add: a'_def span_neg span_sum span_superset span_mul) |
6753 apply (simp add: a'_def span_neg span_sum span_base span_mul) |
6754 done |
6754 done |
6755 also have "... = span (S \<union> insert a T)" |
6755 also have "... = span (S \<union> insert a T)" |
6756 by simp |
6756 by simp |
6757 finally show ?case |
6757 finally show ?case |
6758 by (rule_tac x="insert a' U" in exI) (use orthU in auto) |
6758 by (rule_tac x="insert a' U" in exI) (use orthU in auto) |
6920 obtains y where "y \<noteq> 0" "orthogonal x y" |
6920 obtains y where "y \<noteq> 0" "orthogonal x y" |
6921 proof - |
6921 proof - |
6922 have "dim {x} < DIM('a)" |
6922 have "dim {x} < DIM('a)" |
6923 using assms by auto |
6923 using assms by auto |
6924 then show thesis |
6924 then show thesis |
6925 by (rule orthogonal_to_subspace_exists) (simp add: orthogonal_commute span_superset that) |
6925 by (rule orthogonal_to_subspace_exists) (simp add: orthogonal_commute span_base that) |
6926 qed |
6926 qed |
6927 |
6927 |
6928 proposition%important orthogonal_subspace_decomp_exists: |
6928 proposition%important orthogonal_subspace_decomp_exists: |
6929 fixes S :: "'a :: euclidean_space set" |
6929 fixes S :: "'a :: euclidean_space set" |
6930 obtains y z where "y \<in> span S" "\<And>w. w \<in> span S \<Longrightarrow> orthogonal z w" "x = y + z" |
6930 obtains y z where "y \<in> span S" "\<And>w. w \<in> span S \<Longrightarrow> orthogonal z w" "x = y + z" |
7190 moreover have "?y \<notin> U" |
7190 moreover have "?y \<notin> U" |
7191 proof - |
7191 proof - |
7192 have "e/2 / norm a \<noteq> 0" |
7192 have "e/2 / norm a \<noteq> 0" |
7193 using \<open>0 < e\<close> \<open>a \<noteq> 0\<close> by auto |
7193 using \<open>0 < e\<close> \<open>a \<noteq> 0\<close> by auto |
7194 then show ?thesis |
7194 then show ?thesis |
7195 by (metis True \<open>a \<noteq> 0\<close> a orthogonal_scaleR orthogonal_self real_vector.scale_eq_0_iff span_add_eq span_superset) |
7195 by (metis True \<open>a \<noteq> 0\<close> a orthogonal_scaleR orthogonal_self real_vector.scale_eq_0_iff span_add_eq span_base) |
7196 qed |
7196 qed |
7197 ultimately show "?y \<in> S - U" by blast |
7197 ultimately show "?y \<in> S - U" by blast |
7198 qed |
7198 qed |
7199 next |
7199 next |
7200 case False |
7200 case False |
8006 { fix v |
8006 { fix v |
8007 let ?u = "\<Sum>b\<in>B. (v \<bullet> b) *\<^sub>R b" |
8007 let ?u = "\<Sum>b\<in>B. (v \<bullet> b) *\<^sub>R b" |
8008 have "v = ?u + (v - ?u)" |
8008 have "v = ?u + (v - ?u)" |
8009 by simp |
8009 by simp |
8010 moreover have "?u \<in> U" |
8010 moreover have "?u \<in> U" |
8011 by (metis (no_types, lifting) \<open>span B = U\<close> assms real_vector_class.subspace_sum span_superset span_mul) |
8011 by (metis (no_types, lifting) \<open>span B = U\<close> assms subspace_sum span_base span_mul) |
8012 moreover have "(v - ?u) \<in> U\<^sup>\<bottom>" |
8012 moreover have "(v - ?u) \<in> U\<^sup>\<bottom>" |
8013 proof (clarsimp simp: orthogonal_comp_def orthogonal_def) |
8013 proof (clarsimp simp: orthogonal_comp_def orthogonal_def) |
8014 fix y |
8014 fix y |
8015 assume "y \<in> U" |
8015 assume "y \<in> U" |
8016 with \<open>span B = U\<close> span_finite [OF \<open>finite B\<close>] |
8016 with \<open>span B = U\<close> span_finite [OF \<open>finite B\<close>] |