src/HOL/Multivariate_Analysis/Euclidean_Space.thy
changeset 39198 f967a16dfcdd
parent 38656 d5d342611edb
child 39302 d7728f65b353
equal deleted inserted replaced
39166:19efc2af3e6c 39198:f967a16dfcdd
  2361       apply (rule span_setsum[OF C(1)])
  2361       apply (rule span_setsum[OF C(1)])
  2362       apply clarify
  2362       apply clarify
  2363       apply (rule span_mul)
  2363       apply (rule span_mul)
  2364       by (rule span_superset)}
  2364       by (rule span_superset)}
  2365   then have SC: "span ?C = span (insert a B)"
  2365   then have SC: "span ?C = span (insert a B)"
  2366     unfolding expand_set_eq span_breakdown_eq C(3)[symmetric] by auto
  2366     unfolding set_ext_iff span_breakdown_eq C(3)[symmetric] by auto
  2367   thm pairwise_def
  2367   thm pairwise_def
  2368   {fix x y assume xC: "x \<in> ?C" and yC: "y \<in> ?C" and xy: "x \<noteq> y"
  2368   {fix x y assume xC: "x \<in> ?C" and yC: "y \<in> ?C" and xy: "x \<noteq> y"
  2369     {assume xa: "x = ?a" and ya: "y = ?a"
  2369     {assume xa: "x = ?a" and ya: "y = ?a"
  2370       have "orthogonal x y" using xa ya xy by blast}
  2370       have "orthogonal x y" using xa ya xy by blast}
  2371     moreover
  2371     moreover
  2824   from linear_independent_extend[OF independent_injective_image, OF independent_basis, OF lf fi]
  2824   from linear_independent_extend[OF independent_injective_image, OF independent_basis, OF lf fi]
  2825   obtain h:: "'b => 'a" where h: "linear h"
  2825   obtain h:: "'b => 'a" where h: "linear h"
  2826     " \<forall>x \<in> f ` basis ` {..<DIM('a)}. h x = inv f x" by blast
  2826     " \<forall>x \<in> f ` basis ` {..<DIM('a)}. h x = inv f x" by blast
  2827   from h(2)
  2827   from h(2)
  2828   have th: "\<forall>i<DIM('a). (h \<circ> f) (basis i) = id (basis i)"
  2828   have th: "\<forall>i<DIM('a). (h \<circ> f) (basis i) = id (basis i)"
  2829     using inv_o_cancel[OF fi, unfolded expand_fun_eq id_def o_def]
  2829     using inv_o_cancel[OF fi, unfolded ext_iff id_def o_def]
  2830     by auto
  2830     by auto
  2831 
  2831 
  2832   from linear_eq_stdbasis[OF linear_compose[OF lf h(1)] linear_id th]
  2832   from linear_eq_stdbasis[OF linear_compose[OF lf h(1)] linear_id th]
  2833   have "h o f = id" .
  2833   have "h o f = id" .
  2834   then show ?thesis using h(1) by blast
  2834   then show ?thesis using h(1) by blast
  2841   from linear_independent_extend[OF independent_basis[where 'a='b],of "inv f"]
  2841   from linear_independent_extend[OF independent_basis[where 'a='b],of "inv f"]
  2842   obtain h:: "'b \<Rightarrow> 'a" where
  2842   obtain h:: "'b \<Rightarrow> 'a" where
  2843     h: "linear h" "\<forall> x\<in> basis ` {..<DIM('b)}. h x = inv f x" by blast
  2843     h: "linear h" "\<forall> x\<in> basis ` {..<DIM('b)}. h x = inv f x" by blast
  2844   from h(2)
  2844   from h(2)
  2845   have th: "\<forall>i<DIM('b). (f o h) (basis i) = id (basis i)"
  2845   have th: "\<forall>i<DIM('b). (f o h) (basis i) = id (basis i)"
  2846     using sf by(auto simp add: surj_iff o_def expand_fun_eq)
  2846     using sf by(auto simp add: surj_iff o_def ext_iff)
  2847   from linear_eq_stdbasis[OF linear_compose[OF h(1) lf] linear_id th]
  2847   from linear_eq_stdbasis[OF linear_compose[OF h(1) lf] linear_id th]
  2848   have "f o h = id" .
  2848   have "f o h = id" .
  2849   then show ?thesis using h(1) by blast
  2849   then show ?thesis using h(1) by blast
  2850 qed
  2850 qed
  2851 
  2851 
  2968   finally show "f = h" unfolding fg by simp
  2968   finally show "f = h" unfolding fg by simp
  2969 qed
  2969 qed
  2970 
  2970 
  2971 lemma isomorphism_expand:
  2971 lemma isomorphism_expand:
  2972   "f o g = id \<and> g o f = id \<longleftrightarrow> (\<forall>x. f(g x) = x) \<and> (\<forall>x. g(f x) = x)"
  2972   "f o g = id \<and> g o f = id \<longleftrightarrow> (\<forall>x. f(g x) = x) \<and> (\<forall>x. g(f x) = x)"
  2973   by (simp add: expand_fun_eq o_def id_def)
  2973   by (simp add: ext_iff o_def id_def)
  2974 
  2974 
  2975 lemma linear_injective_isomorphism: fixes f::"'a::euclidean_space => 'a::euclidean_space"
  2975 lemma linear_injective_isomorphism: fixes f::"'a::euclidean_space => 'a::euclidean_space"
  2976   assumes lf: "linear f" and fi: "inj f"
  2976   assumes lf: "linear f" and fi: "inj f"
  2977   shows "\<exists>f'. linear f' \<and> (\<forall>x. f' (f x) = x) \<and> (\<forall>x. f (f' x) = x)"
  2977   shows "\<exists>f'. linear f' \<and> (\<forall>x. f' (f x) = x) \<and> (\<forall>x. f (f' x) = x)"
  2978 unfolding isomorphism_expand[symmetric]
  2978 unfolding isomorphism_expand[symmetric]
  2993   shows "f o f' = id \<longleftrightarrow> f' o f = id"
  2993   shows "f o f' = id \<longleftrightarrow> f' o f = id"
  2994 proof-
  2994 proof-
  2995   {fix f f':: "'a => 'a"
  2995   {fix f f':: "'a => 'a"
  2996     assume lf: "linear f" "linear f'" and f: "f o f' = id"
  2996     assume lf: "linear f" "linear f'" and f: "f o f' = id"
  2997     from f have sf: "surj f"
  2997     from f have sf: "surj f"
  2998       apply (auto simp add: o_def expand_fun_eq id_def surj_def)
  2998       apply (auto simp add: o_def ext_iff id_def surj_def)
  2999       by metis
  2999       by metis
  3000     from linear_surjective_isomorphism[OF lf(1) sf] lf f
  3000     from linear_surjective_isomorphism[OF lf(1) sf] lf f
  3001     have "f' o f = id" unfolding expand_fun_eq o_def id_def
  3001     have "f' o f = id" unfolding ext_iff o_def id_def
  3002       by metis}
  3002       by metis}
  3003   then show ?thesis using lf lf' by metis
  3003   then show ?thesis using lf lf' by metis
  3004 qed
  3004 qed
  3005 
  3005 
  3006 text {* Moreover, a one-sided inverse is automatically linear. *}
  3006 text {* Moreover, a one-sided inverse is automatically linear. *}
  3007 
  3007 
  3008 lemma left_inverse_linear: fixes f::"'a::euclidean_space => 'a::euclidean_space"
  3008 lemma left_inverse_linear: fixes f::"'a::euclidean_space => 'a::euclidean_space"
  3009   assumes lf: "linear f" and gf: "g o f = id"
  3009   assumes lf: "linear f" and gf: "g o f = id"
  3010   shows "linear g"
  3010   shows "linear g"
  3011 proof-
  3011 proof-
  3012   from gf have fi: "inj f" apply (auto simp add: inj_on_def o_def id_def expand_fun_eq)
  3012   from gf have fi: "inj f" apply (auto simp add: inj_on_def o_def id_def ext_iff)
  3013     by metis
  3013     by metis
  3014   from linear_injective_isomorphism[OF lf fi]
  3014   from linear_injective_isomorphism[OF lf fi]
  3015   obtain h:: "'a \<Rightarrow> 'a" where
  3015   obtain h:: "'a \<Rightarrow> 'a" where
  3016     h: "linear h" "\<forall>x. h (f x) = x" "\<forall>x. f (h x) = x" by blast
  3016     h: "linear h" "\<forall>x. h (f x) = x" "\<forall>x. f (h x) = x" by blast
  3017   have "h = g" apply (rule ext) using gf h(2,3)
  3017   have "h = g" apply (rule ext) using gf h(2,3)
  3018     apply (simp add: o_def id_def expand_fun_eq)
  3018     apply (simp add: o_def id_def ext_iff)
  3019     by metis
  3019     by metis
  3020   with h(1) show ?thesis by blast
  3020   with h(1) show ?thesis by blast
  3021 qed
  3021 qed
  3022 
  3022 
  3023 subsection {* Infinity norm *}
  3023 subsection {* Infinity norm *}