src/HOL/Analysis/Abstract_Limits.thy
changeset 78750 f229090cb8a3
parent 78320 eb9a9690b8f5
child 82520 1b17f0a41aa3
equal deleted inserted replaced
78749:23215f71ab69 78750:f229090cb8a3
     7 
     7 
     8 definition nhdsin :: "'a topology \<Rightarrow> 'a \<Rightarrow> 'a filter"
     8 definition nhdsin :: "'a topology \<Rightarrow> 'a \<Rightarrow> 'a filter"
     9   where "nhdsin X a =
     9   where "nhdsin X a =
    10            (if a \<in> topspace X then (INF S\<in>{S. openin X S \<and> a \<in> S}. principal S) else bot)"
    10            (if a \<in> topspace X then (INF S\<in>{S. openin X S \<and> a \<in> S}. principal S) else bot)"
    11 
    11 
    12 definition atin :: "'a topology \<Rightarrow> 'a \<Rightarrow> 'a filter"
    12 definition atin_within :: "['a topology, 'a, 'a set] \<Rightarrow> 'a filter"
    13   where "atin X a \<equiv> inf (nhdsin X a) (principal (topspace X - {a}))"
    13   where "atin_within X a S = inf (nhdsin X a) (principal (topspace X \<inter> S - {a}))"
    14 
    14 
       
    15 abbreviation atin :: "'a topology \<Rightarrow> 'a \<Rightarrow> 'a filter"
       
    16   where "atin X a \<equiv> atin_within X a UNIV"
       
    17 
       
    18 lemma atin_def: "atin X a = inf (nhdsin X a) (principal (topspace X - {a}))"
       
    19   by (simp add: atin_within_def)
    15 
    20 
    16 lemma nhdsin_degenerate [simp]: "a \<notin> topspace X \<Longrightarrow> nhdsin X a = bot"
    21 lemma nhdsin_degenerate [simp]: "a \<notin> topspace X \<Longrightarrow> nhdsin X a = bot"
    17   and atin_degenerate [simp]: "a \<notin> topspace X \<Longrightarrow> atin X a = bot"
    22   and atin_degenerate [simp]: "a \<notin> topspace X \<Longrightarrow> atin X a = bot"
    18   by (simp_all add: nhdsin_def atin_def)
    23   by (simp_all add: nhdsin_def atin_def)
    19 
    24 
    26   also have "eventually P \<dots> \<longleftrightarrow> (\<exists>S. openin X S \<and> a \<in> S \<and> (\<forall>x\<in>S. P x))"
    31   also have "eventually P \<dots> \<longleftrightarrow> (\<exists>S. openin X S \<and> a \<in> S \<and> (\<forall>x\<in>S. P x))"
    27     using True by (subst eventually_INF_base) (auto simp: eventually_principal)
    32     using True by (subst eventually_INF_base) (auto simp: eventually_principal)
    28   finally show ?thesis using True by simp
    33   finally show ?thesis using True by simp
    29 qed auto
    34 qed auto
    30 
    35 
       
    36 lemma eventually_atin_within:
       
    37   "eventually P (atin_within X a S) \<longleftrightarrow> a \<notin> topspace X \<or> (\<exists>T. openin X T \<and> a \<in> T \<and> (\<forall>x\<in>T. x \<in> S \<and> x \<noteq> a \<longrightarrow> P x))"
       
    38 proof (cases "a \<in> topspace X")
       
    39   case True
       
    40   hence "eventually P (atin_within X a S) \<longleftrightarrow> 
       
    41          (\<exists>T. openin X T \<and> a \<in> T \<and>
       
    42           (\<forall>x\<in>T. x \<in> topspace X \<and> x \<in> S \<and> x \<noteq> a \<longrightarrow> P x))"
       
    43     by (simp add: atin_within_def eventually_inf_principal eventually_nhdsin)
       
    44   also have "\<dots> \<longleftrightarrow> (\<exists>T. openin X T \<and> a \<in> T \<and> (\<forall>x\<in>T. x \<in> S \<and> x \<noteq> a \<longrightarrow> P x))"
       
    45     using openin_subset by (intro ex_cong) auto
       
    46   finally show ?thesis by (simp add: True)
       
    47 qed (simp add: atin_within_def)
       
    48 
    31 lemma eventually_atin:
    49 lemma eventually_atin:
    32   "eventually P (atin X a) \<longleftrightarrow> a \<notin> topspace X \<or>
    50   "eventually P (atin X a) \<longleftrightarrow> a \<notin> topspace X \<or>
    33              (\<exists>U. openin X U \<and> a \<in> U \<and> (\<forall>x \<in> U - {a}. P x))"
    51              (\<exists>U. openin X U \<and> a \<in> U \<and> (\<forall>x \<in> U - {a}. P x))"
    34 proof (cases "a \<in> topspace X")
    52   by (auto simp add: eventually_atin_within)
    35   case True
       
    36   hence "eventually P (atin X a) \<longleftrightarrow> (\<exists>S. openin X S \<and>
       
    37            a \<in> S \<and> (\<forall>x\<in>S. x \<in> topspace X \<and> x \<noteq> a \<longrightarrow> P x))"
       
    38     by (simp add: atin_def eventually_inf_principal eventually_nhdsin)
       
    39   also have "\<dots> \<longleftrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> (\<forall>x \<in> U - {a}. P x))"
       
    40     using openin_subset by (intro ex_cong) auto
       
    41   finally show ?thesis by (simp add: True)
       
    42 qed auto
       
    43 
    53 
    44 lemma nontrivial_limit_atin:
    54 lemma nontrivial_limit_atin:
    45    "atin X a \<noteq> bot \<longleftrightarrow> a \<in> X derived_set_of topspace X"
    55    "atin X a \<noteq> bot \<longleftrightarrow> a \<in> X derived_set_of topspace X"
    46 proof 
    56 proof 
    47   assume L: "atin X a \<noteq> bot"
    57   assume L: "atin X a \<noteq> bot"
    62     then show False
    72     then show False
    63       by (smt (verit, best) a eventually_atin in_derived_set_of insertE insert_Diff)
    73       by (smt (verit, best) a eventually_atin in_derived_set_of insertE insert_Diff)
    64   qed
    74   qed
    65 qed
    75 qed
    66 
    76 
       
    77 lemma eventually_atin_subtopology:
       
    78   assumes "a \<in> topspace X"
       
    79   shows "eventually P (atin (subtopology X S) a) \<longleftrightarrow> 
       
    80     (a \<in> S \<longrightarrow> (\<exists>U. openin (subtopology X S) U \<and> a \<in> U \<and> (\<forall>x\<in>U - {a}. P x)))"
       
    81   using assms by (simp add: eventually_atin)
       
    82 
       
    83 lemma eventually_within_imp:
       
    84    "eventually P (atin_within X a S) \<longleftrightarrow> eventually (\<lambda>x. x \<in> S \<longrightarrow> P x) (atin X a)"
       
    85   by (auto simp add: eventually_atin_within eventually_atin)
       
    86 
       
    87 lemma atin_subtopology_within:
       
    88   assumes "a \<in> S"
       
    89   shows "atin (subtopology X S) a = atin_within X a S"
       
    90 proof -
       
    91   have "eventually P (atin (subtopology X S) a) \<longleftrightarrow> eventually P (atin_within X a S)" for P
       
    92     unfolding eventually_atin eventually_atin_within openin_subtopology
       
    93     using assms by auto
       
    94   then show ?thesis
       
    95     by (meson le_filter_def order.eq_iff)
       
    96 qed
       
    97 
       
    98 lemma atin_subtopology_within_if:
       
    99   shows "atin (subtopology X S) a = (if a \<in> S then atin_within X a S else bot)"
       
   100   by (simp add: atin_subtopology_within)
       
   101 
       
   102 lemma trivial_limit_atpointof_within:
       
   103    "trivial_limit(atin_within X a S) \<longleftrightarrow>
       
   104         (a \<notin> X derived_set_of S)"
       
   105   by (auto simp: trivial_limit_def eventually_atin_within in_derived_set_of)
       
   106 
       
   107 lemma derived_set_of_trivial_limit:
       
   108    "a \<in> X derived_set_of S \<longleftrightarrow> \<not> trivial_limit(atin_within X a S)"
       
   109   by (simp add: trivial_limit_atpointof_within)
       
   110 
    67 
   111 
    68 subsection\<open>Limits in a topological space\<close>
   112 subsection\<open>Limits in a topological space\<close>
    69 
   113 
    70 definition limitin :: "'a topology \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b filter \<Rightarrow> bool" where
   114 definition limitin :: "'a topology \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b filter \<Rightarrow> bool" where
    71   "limitin X f l F \<equiv> l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> eventually (\<lambda>x. f x \<in> U) F)"
   115   "limitin X f l F \<equiv> l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> eventually (\<lambda>x. f x \<in> U) F)"
       
   116 
       
   117 lemma limit_within_subset:
       
   118    "\<lbrakk>limitin X f l (atin_within Y a S); T \<subseteq> S\<rbrakk> \<Longrightarrow> limitin X f l (atin_within Y a T)"
       
   119   by (smt (verit) eventually_atin_within limitin_def subset_eq)
    72 
   120 
    73 lemma limitinD: "\<lbrakk>limitin X f l F; openin X U; l \<in> U\<rbrakk> \<Longrightarrow> eventually (\<lambda>x. f x \<in> U) F"
   121 lemma limitinD: "\<lbrakk>limitin X f l F; openin X U; l \<in> U\<rbrakk> \<Longrightarrow> eventually (\<lambda>x. f x \<in> U) F"
    74   by (simp add: limitin_def)
   122   by (simp add: limitin_def)
    75 
   123 
    76 lemma limitin_canonical_iff [simp]: "limitin euclidean f l F \<longleftrightarrow> (f \<longlongrightarrow> l) F"
   124 lemma limitin_canonical_iff [simp]: "limitin euclidean f l F \<longleftrightarrow> (f \<longlongrightarrow> l) F"
   215     by (auto simp: continuous_map_def topcontinuous_at_def)
   263     by (auto simp: continuous_map_def topcontinuous_at_def)
   216 next
   264 next
   217   assume R: ?rhs
   265   assume R: ?rhs
   218   then show ?lhs
   266   then show ?lhs
   219     apply (auto simp: continuous_map_def topcontinuous_at_def)
   267     apply (auto simp: continuous_map_def topcontinuous_at_def)
   220     apply (subst openin_subopen, safe)
   268     by (smt (verit, del_insts) mem_Collect_eq openin_subopen openin_subset subset_eq)
   221     apply (drule bspec, assumption)
       
   222     using openin_subset[of X] apply (auto simp: subset_iff dest!: spec)
       
   223     done
       
   224 qed
   269 qed
   225 
   270 
   226 lemma continuous_map_atin:
   271 lemma continuous_map_atin:
   227    "continuous_map X Y f \<longleftrightarrow> (\<forall>x \<in> topspace X. limitin Y f (f x) (atin X x))"
   272    "continuous_map X Y f \<longleftrightarrow> (\<forall>x \<in> topspace X. limitin Y f (f x) (atin X x))"
   228   by (auto simp: limitin_def topcontinuous_at_atin continuous_map_eq_topcontinuous_at)
   273   by (auto simp: limitin_def topcontinuous_at_atin continuous_map_eq_topcontinuous_at)
   229 
   274 
   230 lemma limitin_continuous_map:
   275 lemma limitin_continuous_map:
   231    "\<lbrakk>continuous_map X Y f; a \<in> topspace X; f a = b\<rbrakk> \<Longrightarrow> limitin Y f b (atin X a)"
   276    "\<lbrakk>continuous_map X Y f; a \<in> topspace X; f a = b\<rbrakk> \<Longrightarrow> limitin Y f b (atin X a)"
   232   by (auto simp: continuous_map_atin)
   277   by (auto simp: continuous_map_atin)
       
   278 
       
   279 lemma limit_continuous_map_within:
       
   280    "\<lbrakk>continuous_map (subtopology X S) Y f; a \<in> S; a \<in> topspace X\<rbrakk>
       
   281     \<Longrightarrow> limitin Y f (f a) (atin_within X a S)"
       
   282   by (metis Int_iff atin_subtopology_within continuous_map_atin topspace_subtopology)
   233 
   283 
   234 
   284 
   235 subsection\<open>Combining theorems for continuous functions into the reals\<close>
   285 subsection\<open>Combining theorems for continuous functions into the reals\<close>
   236 
   286 
   237 lemma continuous_map_canonical_const [continuous_intros]:
   287 lemma continuous_map_canonical_const [continuous_intros]: