# HG changeset patch # User huffman # Date 1244413132 25200 # Node ID f7310185481d429c21e44d19009c3344fccd640a # Parent c350f3ad6b0d929740361cbd07557f265978905d generalize tendsto lemmas for products diff -r c350f3ad6b0d -r f7310185481d src/HOL/Library/Product_Vector.thy --- a/src/HOL/Library/Product_Vector.thy Sun Jun 07 12:00:03 2009 -0700 +++ b/src/HOL/Library/Product_Vector.thy Sun Jun 07 15:18:52 2009 -0700 @@ -160,45 +160,61 @@ unfolding dist_prod_def by simp lemma tendsto_fst: - assumes "tendsto f a net" - shows "tendsto (\x. fst (f x)) (fst a) net" -proof (rule tendstoI) - fix r :: real assume "0 < r" - have "eventually (\x. dist (f x) a < r) net" - using `tendsto f a net` `0 < r` by (rule tendstoD) - thus "eventually (\x. dist (fst (f x)) (fst a) < r) net" - by (rule eventually_elim1) - (rule le_less_trans [OF dist_fst_le]) + assumes "(f ---> a) net" + shows "((\x. fst (f x)) ---> fst a) net" +proof (rule topological_tendstoI) + fix S assume "S \ topo" "fst a \ S" + then have "fst -` S \ topo" "a \ fst -` S" + unfolding topo_prod_def + apply simp_all + apply clarify + apply (erule rev_bexI, simp) + apply (rule rev_bexI [OF topo_UNIV]) + apply auto + done + with assms have "eventually (\x. f x \ fst -` S) net" + by (rule topological_tendstoD) + then show "eventually (\x. fst (f x) \ S) net" + by simp qed lemma tendsto_snd: - assumes "tendsto f a net" - shows "tendsto (\x. snd (f x)) (snd a) net" -proof (rule tendstoI) - fix r :: real assume "0 < r" - have "eventually (\x. dist (f x) a < r) net" - using `tendsto f a net` `0 < r` by (rule tendstoD) - thus "eventually (\x. dist (snd (f x)) (snd a) < r) net" - by (rule eventually_elim1) - (rule le_less_trans [OF dist_snd_le]) + assumes "(f ---> a) net" + shows "((\x. snd (f x)) ---> snd a) net" +proof (rule topological_tendstoI) + fix S assume "S \ topo" "snd a \ S" + then have "snd -` S \ topo" "a \ snd -` S" + unfolding topo_prod_def + apply simp_all + apply clarify + apply (rule rev_bexI [OF topo_UNIV]) + apply (erule rev_bexI) + apply auto + done + with assms have "eventually (\x. f x \ snd -` S) net" + by (rule topological_tendstoD) + then show "eventually (\x. snd (f x) \ S) net" + by simp qed lemma tendsto_Pair: - assumes "tendsto X a net" and "tendsto Y b net" - shows "tendsto (\i. (X i, Y i)) (a, b) net" -proof (rule tendstoI) - fix r :: real assume "0 < r" - then have "0 < r / sqrt 2" (is "0 < ?s") - by (simp add: divide_pos_pos) - have "eventually (\i. dist (X i) a < ?s) net" - using `tendsto X a net` `0 < ?s` by (rule tendstoD) + assumes "(f ---> a) net" and "(g ---> b) net" + shows "((\x. (f x, g x)) ---> (a, b)) net" +proof (rule topological_tendstoI) + fix S assume "S \ topo" "(a, b) \ S" + then obtain A B where "A \ topo" "B \ topo" "a \ A" "b \ B" "A \ B \ S" + unfolding topo_prod_def by auto + have "eventually (\x. f x \ A) net" + using `(f ---> a) net` `A \ topo` `a \ A` + by (rule topological_tendstoD) moreover - have "eventually (\i. dist (Y i) b < ?s) net" - using `tendsto Y b net` `0 < ?s` by (rule tendstoD) + have "eventually (\x. g x \ B) net" + using `(g ---> b) net` `B \ topo` `b \ B` + by (rule topological_tendstoD) ultimately - show "eventually (\i. dist (X i, Y i) (a, b) < r) net" + show "eventually (\x. (f x, g x) \ S) net" by (rule eventually_elim2) - (simp add: real_sqrt_sum_squares_less dist_Pair_Pair) + (simp add: subsetD [OF `A \ B \ S`]) qed lemma LIMSEQ_fst: "(X ----> a) \ (\n. fst (X n)) ----> fst a"