# HG changeset patch # User huffman # Date 1272932017 25200 # Node ID 7c8eb32724ced5ef1f917a884d88af78184a0b9d # Parent f96aa31b739da4f98776e7bfc0d9d080c6882b58 add constants netmap and nhds diff -r f96aa31b739d -r 7c8eb32724ce src/HOL/Limits.thy --- a/src/HOL/Limits.thy Mon May 03 10:28:19 2010 -0700 +++ b/src/HOL/Limits.thy Mon May 03 17:13:37 2010 -0700 @@ -241,6 +241,34 @@ unfolding expand_net_eq by (auto elim: eventually_rev_mp) +subsection {* Map function for nets *} + +definition + netmap :: "('a \ 'b) \ 'a net \ 'b net" +where [code del]: + "netmap f net = Abs_net (\P. eventually (\x. P (f x)) net)" + +lemma eventually_netmap: + "eventually P (netmap f net) = eventually (\x. P (f x)) net" +unfolding netmap_def +apply (rule eventually_Abs_net) +apply (rule is_filter.intro) +apply (auto elim!: eventually_rev_mp) +done + +lemma netmap_ident: "netmap (\x. x) net = net" +by (simp add: expand_net_eq eventually_netmap) + +lemma netmap_netmap: "netmap f (netmap g net) = netmap (\x. f (g x)) net" +by (simp add: expand_net_eq eventually_netmap) + +lemma netmap_mono: "net \ net' \ netmap f net \ netmap f net'" +unfolding le_net_def eventually_netmap by simp + +lemma netmap_bot [simp]: "netmap f bot = bot" +by (simp add: expand_net_eq eventually_netmap) + + subsection {* Standard Nets *} definition @@ -254,9 +282,14 @@ "net within S = Abs_net (\P. eventually (\x. x \ S \ P x) net)" definition + nhds :: "'a::topological_space \ 'a net" +where [code del]: + "nhds a = Abs_net (\P. \S. open S \ a \ S \ (\x\S. P x))" + +definition at :: "'a::topological_space \ 'a net" where [code del]: - "at a = Abs_net (\P. \S. open S \ a \ S \ (\x\S. x \ a \ P x))" + "at a = nhds a within - {a}" lemma eventually_sequentially: "eventually P sequentially \ (\N. \n\N. P n)" @@ -278,24 +311,28 @@ lemma within_UNIV: "net within UNIV = net" unfolding expand_net_eq eventually_within by simp -lemma eventually_at_topological: - "eventually P (at a) \ (\S. open S \ a \ S \ (\x\S. x \ a \ P x))" -unfolding at_def +lemma eventually_nhds: + "eventually P (nhds a) \ (\S. open S \ a \ S \ (\x\S. P x))" +unfolding nhds_def proof (rule eventually_Abs_net, rule is_filter.intro) - have "open UNIV \ a \ UNIV \ (\x\UNIV. x \ a \ True)" by simp - thus "\S. open S \ a \ S \ (\x\S. x \ a \ True)" by - rule + have "open UNIV \ a \ UNIV \ (\x\UNIV. True)" by simp + thus "\S. open S \ a \ S \ (\x\S. True)" by - rule next fix P Q - assume "\S. open S \ a \ S \ (\x\S. x \ a \ P x)" - and "\T. open T \ a \ T \ (\x\T. x \ a \ Q x)" + assume "\S. open S \ a \ S \ (\x\S. P x)" + and "\T. open T \ a \ T \ (\x\T. Q x)" then obtain S T where - "open S \ a \ S \ (\x\S. x \ a \ P x)" - "open T \ a \ T \ (\x\T. x \ a \ Q x)" by auto - hence "open (S \ T) \ a \ S \ T \ (\x\(S \ T). x \ a \ P x \ Q x)" + "open S \ a \ S \ (\x\S. P x)" + "open T \ a \ T \ (\x\T. Q x)" by auto + hence "open (S \ T) \ a \ S \ T \ (\x\(S \ T). P x \ Q x)" by (simp add: open_Int) - thus "\S. open S \ a \ S \ (\x\S. x \ a \ P x \ Q x)" by - rule + thus "\S. open S \ a \ S \ (\x\S. P x \ Q x)" by - rule qed auto +lemma eventually_at_topological: + "eventually P (at a) \ (\S. open S \ a \ S \ (\x\S. x \ a \ P x))" +unfolding at_def eventually_within eventually_nhds by simp + lemma eventually_at: fixes a :: "'a::metric_space" shows "eventually P (at a) \ (\d>0. \x. x \ a \ dist x a < d \ P x)"