src/HOL/Analysis/Topology_Euclidean_Space.thy
author wenzelm
Thu, 15 Feb 2018 12:11:00 +0100
changeset 67613 ce654b0e6d69
parent 67443 3abf6a722518
child 67683 817944aeac3f
child 67685 bdff8bf0a75b
permissions -rw-r--r--
more symbols;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
     1
(*  Author:     L C Paulson, University of Cambridge
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     2
    Author:     Amine Chaieb, University of Cambridge
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     3
    Author:     Robert Himmelmann, TU Muenchen
44075
5952bd355779 generalize more lemmas about compactness
huffman
parents: 44074
diff changeset
     4
    Author:     Brian Huffman, Portland State University
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     5
*)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     6
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
     7
section \<open>Elementary topology in Euclidean space.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     8
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     9
theory Topology_Euclidean_Space
66827
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
    10
imports                                                         
66453
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 66447
diff changeset
    11
  "HOL-Library.Indicator_Function"
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 66447
diff changeset
    12
  "HOL-Library.Countable_Set"
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 66447
diff changeset
    13
  "HOL-Library.FuncSet"
50938
hoelzl
parents: 50937
diff changeset
    14
  Linear_Algebra
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    15
  Norm_Arith
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    16
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    17
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    18
(* FIXME: move elsewhere *)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
    19
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    20
lemma Times_eq_image_sum:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    21
  fixes S :: "'a :: comm_monoid_add set" and T :: "'b :: comm_monoid_add set"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    22
  shows "S \<times> T = {u + v |u v. u \<in> (\<lambda>x. (x, 0)) ` S \<and> v \<in> Pair 0 ` T}"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    23
  by force
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    24
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    25
lemma halfspace_Int_eq:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    26
     "{x. a \<bullet> x \<le> b} \<inter> {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    27
     "{x. b \<le> a \<bullet> x} \<inter> {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    28
  by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    29
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    30
definition (in monoid_add) support_on :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'b set"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
    31
  where "support_on s f = {x\<in>s. f x \<noteq> 0}"
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    32
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    33
lemma in_support_on: "x \<in> support_on s f \<longleftrightarrow> x \<in> s \<and> f x \<noteq> 0"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    34
  by (simp add: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    35
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    36
lemma support_on_simps[simp]:
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    37
  "support_on {} f = {}"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    38
  "support_on (insert x s) f =
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    39
    (if f x = 0 then support_on s f else insert x (support_on s f))"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    40
  "support_on (s \<union> t) f = support_on s f \<union> support_on t f"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    41
  "support_on (s \<inter> t) f = support_on s f \<inter> support_on t f"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    42
  "support_on (s - t) f = support_on s f - support_on t f"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    43
  "support_on (f ` s) g = f ` (support_on s (g \<circ> f))"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    44
  unfolding support_on_def by auto
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    45
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    46
lemma support_on_cong:
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    47
  "(\<And>x. x \<in> s \<Longrightarrow> f x = 0 \<longleftrightarrow> g x = 0) \<Longrightarrow> support_on s f = support_on s g"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    48
  by (auto simp: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    49
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    50
lemma support_on_if: "a \<noteq> 0 \<Longrightarrow> support_on A (\<lambda>x. if P x then a else 0) = {x\<in>A. P x}"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    51
  by (auto simp: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    52
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    53
lemma support_on_if_subset: "support_on A (\<lambda>x. if P x then a else 0) \<subseteq> {x \<in> A. P x}"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    54
  by (auto simp: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    55
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    56
lemma finite_support[intro]: "finite s \<Longrightarrow> finite (support_on s f)"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    57
  unfolding support_on_def by auto
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    58
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    59
(* TODO: is supp_sum really needed? TODO: Generalize to Finite_Set.fold *)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    60
definition (in comm_monoid_add) supp_sum :: "('b \<Rightarrow> 'a) \<Rightarrow> 'b set \<Rightarrow> 'a"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
    61
  where "supp_sum f s = (\<Sum>x\<in>support_on s f. f x)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    62
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    63
lemma supp_sum_empty[simp]: "supp_sum f {} = 0"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    64
  unfolding supp_sum_def by auto
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    65
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    66
lemma supp_sum_insert[simp]:
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    67
  "finite (support_on s f) \<Longrightarrow>
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    68
    supp_sum f (insert x s) = (if x \<in> s then supp_sum f s else f x + supp_sum f s)"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    69
  by (simp add: supp_sum_def in_support_on insert_absorb)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    70
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    71
lemma supp_sum_divide_distrib: "supp_sum f A / (r::'a::field) = supp_sum (\<lambda>n. f n / r) A"
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    72
  by (cases "r = 0")
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    73
     (auto simp: supp_sum_def sum_divide_distrib intro!: sum.cong support_on_cong)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    74
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    75
(*END OF SUPPORT, ETC.*)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    76
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    77
lemma image_affinity_interval:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    78
  fixes c :: "'a::ordered_real_vector"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    79
  shows "((\<lambda>x. m *\<^sub>R x + c) ` {a..b}) = (if {a..b}={} then {}
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    80
            else if 0 <= m then {m *\<^sub>R a + c .. m  *\<^sub>R b + c}
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    81
            else {m *\<^sub>R b + c .. m *\<^sub>R a + c})"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    82
  apply (case_tac "m=0", force)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    83
  apply (auto simp: scaleR_left_mono)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    84
  apply (rule_tac x="inverse m *\<^sub>R (x-c)" in rev_image_eqI, auto simp: pos_le_divideR_eq le_diff_eq scaleR_left_mono_neg)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    85
  apply (metis diff_le_eq inverse_inverse_eq order.not_eq_order_implies_strict pos_le_divideR_eq positive_imp_inverse_positive)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    86
  apply (rule_tac x="inverse m *\<^sub>R (x-c)" in rev_image_eqI, auto simp: not_le neg_le_divideR_eq diff_le_eq)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    87
  using le_diff_eq scaleR_le_cancel_left_neg
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    88
  apply fastforce
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    89
  done
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    90
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    91
lemma countable_PiE:
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
    92
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> countable (F i)) \<Longrightarrow> countable (Pi\<^sub>E I F)"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
    93
  by (induct I arbitrary: F rule: finite_induct) (auto simp: PiE_insert_eq)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
    94
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    95
lemma open_sums:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    96
  fixes T :: "('b::real_normed_vector) set"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    97
  assumes "open S \<or> open T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    98
  shows "open (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    99
  using assms
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   100
proof
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   101
  assume S: "open S"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   102
  show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   103
  proof (clarsimp simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   104
    fix x y
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   105
    assume "x \<in> S" "y \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   106
    with S obtain e where "e > 0" and e: "\<And>x'. dist x' x < e \<Longrightarrow> x' \<in> S"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   107
      by (auto simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   108
    then have "\<And>z. dist z (x + y) < e \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>T. z = x + y"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   109
      by (metis \<open>y \<in> T\<close> diff_add_cancel dist_add_cancel2)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   110
    then show "\<exists>e>0. \<forall>z. dist z (x + y) < e \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>T. z = x + y)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   111
      using \<open>0 < e\<close> \<open>x \<in> S\<close> by blast
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   112
  qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   113
next
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   114
  assume T: "open T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   115
  show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   116
  proof (clarsimp simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   117
    fix x y
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   118
    assume "x \<in> S" "y \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   119
    with T obtain e where "e > 0" and e: "\<And>x'. dist x' y < e \<Longrightarrow> x' \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   120
      by (auto simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   121
    then have "\<And>z. dist z (x + y) < e \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>T. z = x + y"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   122
      by (metis \<open>x \<in> S\<close> add_diff_cancel_left' add_diff_eq diff_diff_add dist_norm)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   123
    then show "\<exists>e>0. \<forall>z. dist z (x + y) < e \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>T. z = x + y)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   124
      using \<open>0 < e\<close> \<open>y \<in> T\<close> by blast
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   125
  qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   126
qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   127
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   128
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   129
subsection \<open>Topological Basis\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   130
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   131
context topological_space
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   132
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   133
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   134
definition "topological_basis B \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   135
  (\<forall>b\<in>B. open b) \<and> (\<forall>x. open x \<longrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   136
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   137
lemma topological_basis:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   138
  "topological_basis B \<longleftrightarrow> (\<forall>x. open x \<longleftrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   139
  unfolding topological_basis_def
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   140
  apply safe
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   141
     apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   142
    apply fastforce
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   143
   apply (erule_tac x=x in allE, simp)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   144
   apply (rule_tac x="{x}" in exI, auto)
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   145
  done
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   146
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   147
lemma topological_basis_iff:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   148
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   149
  shows "topological_basis B \<longleftrightarrow> (\<forall>O'. open O' \<longrightarrow> (\<forall>x\<in>O'. \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'))"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   150
    (is "_ \<longleftrightarrow> ?rhs")
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   151
proof safe
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   152
  fix O' and x::'a
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   153
  assume H: "topological_basis B" "open O'" "x \<in> O'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   154
  then have "(\<exists>B'\<subseteq>B. \<Union>B' = O')" by (simp add: topological_basis_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   155
  then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   156
  then show "\<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'" using H by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   157
next
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   158
  assume H: ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   159
  show "topological_basis B"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   160
    using assms unfolding topological_basis_def
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   161
  proof safe
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   162
    fix O' :: "'a set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   163
    assume "open O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   164
    with H obtain f where "\<forall>x\<in>O'. f x \<in> B \<and> x \<in> f x \<and> f x \<subseteq> O'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   165
      by (force intro: bchoice simp: Bex_def)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   166
    then show "\<exists>B'\<subseteq>B. \<Union>B' = O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   167
      by (auto intro: exI[where x="{f x |x. x \<in> O'}"])
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   168
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   169
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   170
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   171
lemma topological_basisI:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   172
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   173
    and "\<And>O' x. open O' \<Longrightarrow> x \<in> O' \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   174
  shows "topological_basis B"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   175
  using assms by (subst topological_basis_iff) auto
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   176
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   177
lemma topological_basisE:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   178
  fixes O'
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   179
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   180
    and "open O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   181
    and "x \<in> O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   182
  obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   183
proof atomize_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   184
  from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   185
    by (simp add: topological_basis_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   186
  with topological_basis_iff assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   187
  show  "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   188
    using assms by (simp add: Bex_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   189
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   190
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   191
lemma topological_basis_open:
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   192
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   193
    and "X \<in> B"
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   194
  shows "open X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   195
  using assms by (simp add: topological_basis_def)
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   196
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   197
lemma topological_basis_imp_subbasis:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   198
  assumes B: "topological_basis B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   199
  shows "open = generate_topology B"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   200
proof (intro ext iffI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   201
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   202
  assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   203
  with B obtain B' where "B' \<subseteq> B" "S = \<Union>B'"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   204
    unfolding topological_basis_def by blast
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   205
  then show "generate_topology B S"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   206
    by (auto intro: generate_topology.intros dest: topological_basis_open)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   207
next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   208
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   209
  assume "generate_topology B S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   210
  then show "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   211
    by induct (auto dest: topological_basis_open[OF B])
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   212
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   213
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   214
lemma basis_dense:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   215
  fixes B :: "'a set set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   216
    and f :: "'a set \<Rightarrow> 'a"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   217
  assumes "topological_basis B"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   218
    and choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   219
  shows "\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>B' \<in> B. f B' \<in> X)"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   220
proof (intro allI impI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   221
  fix X :: "'a set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   222
  assume "open X" and "X \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   223
  from topological_basisE[OF \<open>topological_basis B\<close> \<open>open X\<close> choosefrom_basis[OF \<open>X \<noteq> {}\<close>]]
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   224
  obtain B' where "B' \<in> B" "f X \<in> B'" "B' \<subseteq> X" .
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   225
  then show "\<exists>B'\<in>B. f B' \<in> X"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   226
    by (auto intro!: choosefrom_basis)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   227
qed
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   228
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   229
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   230
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   231
lemma topological_basis_prod:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   232
  assumes A: "topological_basis A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   233
    and B: "topological_basis B"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   234
  shows "topological_basis ((\<lambda>(a, b). a \<times> b) ` (A \<times> B))"
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   235
  unfolding topological_basis_def
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   236
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   237
  fix S :: "('a \<times> 'b) set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   238
  assume "open S"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   239
  then show "\<exists>X\<subseteq>A \<times> B. (\<Union>(a,b)\<in>X. a \<times> b) = S"
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   240
  proof (safe intro!: exI[of _ "{x\<in>A \<times> B. fst x \<times> snd x \<subseteq> S}"])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   241
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   242
    assume "(x, y) \<in> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   243
    from open_prod_elim[OF \<open>open S\<close> this]
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   244
    obtain a b where a: "open a""x \<in> a" and b: "open b" "y \<in> b" and "a \<times> b \<subseteq> S"
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   245
      by (metis mem_Sigma_iff)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   246
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   247
    from A a obtain A0 where "A0 \<in> A" "x \<in> A0" "A0 \<subseteq> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   248
      by (rule topological_basisE)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   249
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   250
    from B b obtain B0 where "B0 \<in> B" "y \<in> B0" "B0 \<subseteq> b"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   251
      by (rule topological_basisE)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   252
    ultimately show "(x, y) \<in> (\<Union>(a, b)\<in>{X \<in> A \<times> B. fst X \<times> snd X \<subseteq> S}. a \<times> b)"
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   253
      by (intro UN_I[of "(A0, B0)"]) auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   254
  qed auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   255
qed (metis A B topological_basis_open open_Times)
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   256
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   257
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   258
subsection \<open>Countable Basis\<close>
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   259
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   260
locale countable_basis =
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   261
  fixes B :: "'a::topological_space set set"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   262
  assumes is_basis: "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   263
    and countable_basis: "countable B"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   264
begin
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   265
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   266
lemma open_countable_basis_ex:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   267
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   268
  shows "\<exists>B' \<subseteq> B. X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   269
  using assms countable_basis is_basis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   270
  unfolding topological_basis_def by blast
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   271
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   272
lemma open_countable_basisE:
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   273
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   274
  obtains B' where "B' \<subseteq> B" "X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   275
  using assms open_countable_basis_ex
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   276
  by atomize_elim simp
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   277
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   278
lemma countable_dense_exists:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   279
  "\<exists>D::'a set. countable D \<and> (\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>d \<in> D. d \<in> X))"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   280
proof -
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   281
  let ?f = "(\<lambda>B'. SOME x. x \<in> B')"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   282
  have "countable (?f ` B)" using countable_basis by simp
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   283
  with basis_dense[OF is_basis, of ?f] show ?thesis
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   284
    by (intro exI[where x="?f ` B"]) (metis (mono_tags) all_not_in_conv imageI someI)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   285
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   286
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   287
lemma countable_dense_setE:
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   288
  obtains D :: "'a set"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   289
  where "countable D" "\<And>X. open X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<exists>d \<in> D. d \<in> X"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   290
  using countable_dense_exists by blast
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   291
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   292
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   293
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   294
lemma (in first_countable_topology) first_countable_basisE:
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   295
  obtains A where "countable A" "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   296
    "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   297
  using first_countable_basis[of x]
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   298
  apply atomize_elim
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   299
  apply (elim exE)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   300
  apply (rule_tac x="range A" in exI, auto)
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   301
  done
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   302
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   303
lemma (in first_countable_topology) first_countable_basis_Int_stableE:
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   304
  obtains A where "countable A" "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a"
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   305
    "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)"
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   306
    "\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> a \<inter> b \<in> A"
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   307
proof atomize_elim
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   308
  obtain A' where A':
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   309
    "countable A'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   310
    "\<And>a. a \<in> A' \<Longrightarrow> x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   311
    "\<And>a. a \<in> A' \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   312
    "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A'. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   313
    by (rule first_countable_basisE) blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   314
  define A where [abs_def]:
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   315
    "A = (\<lambda>N. \<Inter>((\<lambda>n. from_nat_into A' n) ` N)) ` (Collect finite::nat set set)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   316
  then show "\<exists>A. countable A \<and> (\<forall>a. a \<in> A \<longrightarrow> x \<in> a) \<and> (\<forall>a. a \<in> A \<longrightarrow> open a) \<and>
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   317
        (\<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)) \<and> (\<forall>a b. a \<in> A \<longrightarrow> b \<in> A \<longrightarrow> a \<inter> b \<in> A)"
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   318
  proof (safe intro!: exI[where x=A])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   319
    show "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   320
      unfolding A_def by (intro countable_image countable_Collect_finite)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   321
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   322
    assume "a \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   323
    then show "x \<in> a" "open a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   324
      using A'(4)[OF open_UNIV] by (auto simp: A_def intro: A' from_nat_into)
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   325
  next
52141
eff000cab70f weaker precendence of syntax for big intersection and union on sets
haftmann
parents: 51773
diff changeset
   326
    let ?int = "\<lambda>N. \<Inter>(from_nat_into A' ` N)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   327
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   328
    assume "a \<in> A" "b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   329
    then obtain N M where "a = ?int N" "b = ?int M" "finite (N \<union> M)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   330
      by (auto simp: A_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   331
    then show "a \<inter> b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   332
      by (auto simp: A_def intro!: image_eqI[where x="N \<union> M"])
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   333
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   334
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   335
    assume "open S" "x \<in> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   336
    then obtain a where a: "a\<in>A'" "a \<subseteq> S" using A' by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   337
    then show "\<exists>a\<in>A. a \<subseteq> S" using a A'
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   338
      by (intro bexI[where x=a]) (auto simp: A_def intro: image_eqI[where x="{to_nat_on A' a}"])
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   339
  qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   340
qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   341
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   342
lemma (in topological_space) first_countableI:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   343
  assumes "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   344
    and 1: "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   345
    and 2: "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A. a \<subseteq> S"
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   346
  shows "\<exists>A::nat \<Rightarrow> 'a set. (\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))"
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   347
proof (safe intro!: exI[of _ "from_nat_into A"])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   348
  fix i
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   349
  have "A \<noteq> {}" using 2[of UNIV] by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   350
  show "x \<in> from_nat_into A i" "open (from_nat_into A i)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   351
    using range_from_nat_into_subset[OF \<open>A \<noteq> {}\<close>] 1 by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   352
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   353
  fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   354
  assume "open S" "x\<in>S" from 2[OF this]
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   355
  show "\<exists>i. from_nat_into A i \<subseteq> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   356
    using subset_range_from_nat_into[OF \<open>countable A\<close>] by auto
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   357
qed
51350
490f34774a9a eventually nhds represented using sequentially
hoelzl
parents: 51349
diff changeset
   358
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   359
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   360
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   361
  fix x :: "'a \<times> 'b"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   362
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   363
      "countable A"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   364
      "\<And>a. a \<in> A \<Longrightarrow> fst x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   365
      "\<And>a. a \<in> A \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   366
      "\<And>S. open S \<Longrightarrow> fst x \<in> S \<Longrightarrow> \<exists>a\<in>A. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   367
    by (rule first_countable_basisE[of "fst x"]) blast
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   368
  obtain B where B:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   369
      "countable B"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   370
      "\<And>a. a \<in> B \<Longrightarrow> snd x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   371
      "\<And>a. a \<in> B \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   372
      "\<And>S. open S \<Longrightarrow> snd x \<in> S \<Longrightarrow> \<exists>a\<in>B. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   373
    by (rule first_countable_basisE[of "snd x"]) blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   374
  show "\<exists>A::nat \<Rightarrow> ('a \<times> 'b) set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   375
    (\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))"
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   376
  proof (rule first_countableI[of "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   377
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   378
    assume x: "a \<in> A" "b \<in> B"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   379
    with A(2, 3)[of a] B(2, 3)[of b] show "x \<in> a \<times> b" and "open (a \<times> b)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   380
      unfolding mem_Times_iff
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   381
      by (auto intro: open_Times)
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   382
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   383
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   384
    assume "open S" "x \<in> S"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   385
    then obtain a' b' where a'b': "open a'" "open b'" "x \<in> a' \<times> b'" "a' \<times> b' \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   386
      by (rule open_prod_elim)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   387
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   388
    from a'b' A(4)[of a'] B(4)[of b']
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   389
    obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   390
      by auto
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   391
    ultimately
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   392
    show "\<exists>a\<in>(\<lambda>(a, b). a \<times> b) ` (A \<times> B). a \<subseteq> S"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   393
      by (auto intro!: bexI[of _ "a \<times> b"] bexI[of _ a] bexI[of _ b])
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   394
  qed (simp add: A B)
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   395
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   396
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   397
class second_countable_topology = topological_space +
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   398
  assumes ex_countable_subbasis:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   399
    "\<exists>B::'a::topological_space set set. countable B \<and> open = generate_topology B"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   400
begin
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   401
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   402
lemma ex_countable_basis: "\<exists>B::'a set set. countable B \<and> topological_basis B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   403
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   404
  from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   405
    by blast
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   406
  let ?B = "Inter ` {b. finite b \<and> b \<subseteq> B }"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   407
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   408
  show ?thesis
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   409
  proof (intro exI conjI)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   410
    show "countable ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   411
      by (intro countable_image countable_Collect_finite_subset B)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   412
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   413
      fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   414
      assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   415
      then have "\<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. (\<Union>b\<in>B'. \<Inter>b) = S"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   416
        unfolding B
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   417
      proof induct
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   418
        case UNIV
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   419
        show ?case by (intro exI[of _ "{{}}"]) simp
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   420
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   421
        case (Int a b)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   422
        then obtain x y where x: "a = UNION x Inter" "\<And>i. i \<in> x \<Longrightarrow> finite i \<and> i \<subseteq> B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   423
          and y: "b = UNION y Inter" "\<And>i. i \<in> y \<Longrightarrow> finite i \<and> i \<subseteq> B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   424
          by blast
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   425
        show ?case
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   426
          unfolding x y Int_UN_distrib2
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   427
          by (intro exI[of _ "{i \<union> j| i j.  i \<in> x \<and> j \<in> y}"]) (auto dest: x(2) y(2))
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   428
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   429
        case (UN K)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   430
        then have "\<forall>k\<in>K. \<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. UNION B' Inter = k" by auto
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   431
        then obtain k where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   432
            "\<forall>ka\<in>K. k ka \<subseteq> {b. finite b \<and> b \<subseteq> B} \<and> UNION (k ka) Inter = ka"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   433
          unfolding bchoice_iff ..
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   434
        then show "\<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. UNION B' Inter = \<Union>K"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   435
          by (intro exI[of _ "UNION K k"]) auto
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   436
      next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   437
        case (Basis S)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   438
        then show ?case
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   439
          by (intro exI[of _ "{{S}}"]) auto
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   440
      qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   441
      then have "(\<exists>B'\<subseteq>Inter ` {b. finite b \<and> b \<subseteq> B}. \<Union>B' = S)"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   442
        unfolding subset_image_iff by blast }
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   443
    then show "topological_basis ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   444
      unfolding topological_space_class.topological_basis_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   445
      by (safe intro!: topological_space_class.open_Inter)
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   446
         (simp_all add: B generate_topology.Basis subset_eq)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   447
  qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   448
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   449
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   450
end
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   451
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   452
sublocale second_countable_topology <
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   453
  countable_basis "SOME B. countable B \<and> topological_basis B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   454
  using someI_ex[OF ex_countable_basis]
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   455
  by unfold_locales safe
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   456
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   457
instance prod :: (second_countable_topology, second_countable_topology) second_countable_topology
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   458
proof
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   459
  obtain A :: "'a set set" where "countable A" "topological_basis A"
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   460
    using ex_countable_basis by auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   461
  moreover
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   462
  obtain B :: "'b set set" where "countable B" "topological_basis B"
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   463
    using ex_countable_basis by auto
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   464
  ultimately show "\<exists>B::('a \<times> 'b) set set. countable B \<and> open = generate_topology B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   465
    by (auto intro!: exI[of _ "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"] topological_basis_prod
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   466
      topological_basis_imp_subbasis)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   467
qed
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   468
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   469
instance second_countable_topology \<subseteq> first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   470
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   471
  fix x :: 'a
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   472
  define B :: "'a set set" where "B = (SOME B. countable B \<and> topological_basis B)"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   473
  then have B: "countable B" "topological_basis B"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   474
    using countable_basis is_basis
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   475
    by (auto simp: countable_basis is_basis)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   476
  then show "\<exists>A::nat \<Rightarrow> 'a set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   477
    (\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))"
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   478
    by (intro first_countableI[of "{b\<in>B. x \<in> b}"])
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   479
       (fastforce simp: topological_space_class.topological_basis_def)+
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   480
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   481
64320
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   482
instance nat :: second_countable_topology
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   483
proof
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   484
  show "\<exists>B::nat set set. countable B \<and> open = generate_topology B"
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   485
    by (intro exI[of _ "range lessThan \<union> range greaterThan"]) (auto simp: open_nat_def)
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   486
qed
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   487
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   488
lemma countable_separating_set_linorder1:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   489
  shows "\<exists>B::('a::{linorder_topology, second_countable_topology} set). countable B \<and> (\<forall>x y. x < y \<longrightarrow> (\<exists>b \<in> B. x < b \<and> b \<le> y))"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   490
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   491
  obtain A::"'a set set" where "countable A" "topological_basis A" using ex_countable_basis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   492
  define B1 where "B1 = {(LEAST x. x \<in> U)| U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   493
  then have "countable B1" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   494
  define B2 where "B2 = {(SOME x. x \<in> U)| U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   495
  then have "countable B2" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   496
  have "\<exists>b \<in> B1 \<union> B2. x < b \<and> b \<le> y" if "x < y" for x y
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   497
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   498
    assume "\<exists>z. x < z \<and> z < y"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   499
    then obtain z where z: "x < z \<and> z < y" by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   500
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   501
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   502
    moreover have "z \<in> U" using z U_def by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   503
    ultimately obtain V where "V \<in> A" "z \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   504
    define w where "w = (SOME x. x \<in> V)"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   505
    then have "w \<in> V" using \<open>z \<in> V\<close> by (metis someI2)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   506
    then have "x < w \<and> w \<le> y" using \<open>w \<in> V\<close> \<open>V \<subseteq> U\<close> U_def by fastforce
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   507
    moreover have "w \<in> B1 \<union> B2" using w_def B2_def \<open>V \<in> A\<close> by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   508
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   509
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   510
    assume "\<not>(\<exists>z. x < z \<and> z < y)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   511
    then have *: "\<And>z. z > x \<Longrightarrow> z \<ge> y" by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   512
    define U where "U = {x<..}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   513
    then have "open U" by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   514
    moreover have "y \<in> U" using \<open>x < y\<close> U_def by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   515
    ultimately obtain "V" where "V \<in> A" "y \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   516
    have "U = {y..}" unfolding U_def using * \<open>x < y\<close> by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   517
    then have "V \<subseteq> {y..}" using \<open>V \<subseteq> U\<close> by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   518
    then have "(LEAST w. w \<in> V) = y" using \<open>y \<in> V\<close> by (meson Least_equality atLeast_iff subsetCE)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   519
    then have "y \<in> B1 \<union> B2" using \<open>V \<in> A\<close> B1_def by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   520
    moreover have "x < y \<and> y \<le> y" using \<open>x < y\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   521
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   522
  qed
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   523
  moreover have "countable (B1 \<union> B2)" using \<open>countable B1\<close> \<open>countable B2\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   524
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   525
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   526
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   527
lemma countable_separating_set_linorder2:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   528
  shows "\<exists>B::('a::{linorder_topology, second_countable_topology} set). countable B \<and> (\<forall>x y. x < y \<longrightarrow> (\<exists>b \<in> B. x \<le> b \<and> b < y))"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   529
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   530
  obtain A::"'a set set" where "countable A" "topological_basis A" using ex_countable_basis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   531
  define B1 where "B1 = {(GREATEST x. x \<in> U) | U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   532
  then have "countable B1" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   533
  define B2 where "B2 = {(SOME x. x \<in> U)| U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   534
  then have "countable B2" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   535
  have "\<exists>b \<in> B1 \<union> B2. x \<le> b \<and> b < y" if "x < y" for x y
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   536
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   537
    assume "\<exists>z. x < z \<and> z < y"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   538
    then obtain z where z: "x < z \<and> z < y" by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   539
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   540
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   541
    moreover have "z \<in> U" using z U_def by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   542
    ultimately obtain "V" where "V \<in> A" "z \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   543
    define w where "w = (SOME x. x \<in> V)"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   544
    then have "w \<in> V" using \<open>z \<in> V\<close> by (metis someI2)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   545
    then have "x \<le> w \<and> w < y" using \<open>w \<in> V\<close> \<open>V \<subseteq> U\<close> U_def by fastforce
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   546
    moreover have "w \<in> B1 \<union> B2" using w_def B2_def \<open>V \<in> A\<close> by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   547
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   548
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   549
    assume "\<not>(\<exists>z. x < z \<and> z < y)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   550
    then have *: "\<And>z. z < y \<Longrightarrow> z \<le> x" using leI by blast
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   551
    define U where "U = {..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   552
    then have "open U" by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   553
    moreover have "x \<in> U" using \<open>x < y\<close> U_def by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   554
    ultimately obtain "V" where "V \<in> A" "x \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   555
    have "U = {..x}" unfolding U_def using * \<open>x < y\<close> by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   556
    then have "V \<subseteq> {..x}" using \<open>V \<subseteq> U\<close> by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   557
    then have "(GREATEST x. x \<in> V) = x" using \<open>x \<in> V\<close> by (meson Greatest_equality atMost_iff subsetCE)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   558
    then have "x \<in> B1 \<union> B2" using \<open>V \<in> A\<close> B1_def by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   559
    moreover have "x \<le> x \<and> x < y" using \<open>x < y\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   560
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   561
  qed
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   562
  moreover have "countable (B1 \<union> B2)" using \<open>countable B1\<close> \<open>countable B2\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   563
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   564
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   565
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   566
lemma countable_separating_set_dense_linorder:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   567
  shows "\<exists>B::('a::{linorder_topology, dense_linorder, second_countable_topology} set). countable B \<and> (\<forall>x y. x < y \<longrightarrow> (\<exists>b \<in> B. x < b \<and> b < y))"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   568
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   569
  obtain B::"'a set" where B: "countable B" "\<And>x y. x < y \<Longrightarrow> (\<exists>b \<in> B. x < b \<and> b \<le> y)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   570
    using countable_separating_set_linorder1 by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   571
  have "\<exists>b \<in> B. x < b \<and> b < y" if "x < y" for x y
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   572
  proof -
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   573
    obtain z where "x < z" "z < y" using \<open>x < y\<close> dense by blast
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   574
    then obtain b where "b \<in> B" "x < b \<and> b \<le> z" using B(2) by auto
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   575
    then have "x < b \<and> b < y" using \<open>z < y\<close> by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   576
    then show ?thesis using \<open>b \<in> B\<close> by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   577
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   578
  then show ?thesis using B(1) by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   579
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   580
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   581
subsection \<open>Polish spaces\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   582
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   583
text \<open>Textbooks define Polish spaces as completely metrizable.
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   584
  We assume the topology to be complete for a given metric.\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   585
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   586
class polish_space = complete_space + second_countable_topology
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   587
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   588
subsection \<open>General notion of a topology as a value\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   589
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   590
definition "istopology L \<longleftrightarrow>
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   591
  L {} \<and> (\<forall>S T. L S \<longrightarrow> L T \<longrightarrow> L (S \<inter> T)) \<and> (\<forall>K. Ball K L \<longrightarrow> L (\<Union>K))"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   592
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 49711
diff changeset
   593
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   594
  morphisms "openin" "topology"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   595
  unfolding istopology_def by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   596
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   597
lemma istopology_openin[intro]: "istopology(openin U)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   598
  using openin[of U] by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   599
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   600
lemma topology_inverse': "istopology U \<Longrightarrow> openin (topology U) = U"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   601
  using topology_inverse[unfolded mem_Collect_eq] .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   602
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   603
lemma topology_inverse_iff: "istopology U \<longleftrightarrow> openin (topology U) = U"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   604
  using topology_inverse[of U] istopology_openin[of "topology U"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   605
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   606
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   607
proof
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   608
  assume "T1 = T2"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   609
  then show "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   610
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   611
  assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   612
  then have "openin T1 = openin T2" by (simp add: fun_eq_iff)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   613
  then have "topology (openin T1) = topology (openin T2)" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   614
  then show "T1 = T2" unfolding openin_inverse .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   615
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   616
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   617
text\<open>Infer the "universe" from union of all sets in the topology.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   618
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   619
definition "topspace T = \<Union>{S. openin T S}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   620
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   621
subsubsection \<open>Main properties of open sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   622
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   623
lemma openin_clauses:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   624
  fixes U :: "'a topology"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   625
  shows
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   626
    "openin U {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   627
    "\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   628
    "\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   629
  using openin[of U] unfolding istopology_def mem_Collect_eq by fast+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   630
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   631
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   632
  unfolding topspace_def by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   633
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   634
lemma openin_empty[simp]: "openin U {}"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   635
  by (rule openin_clauses)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   636
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   637
lemma openin_Int[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<inter> T)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   638
  by (rule openin_clauses)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   639
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   640
lemma openin_Union[intro]: "(\<And>S. S \<in> K \<Longrightarrow> openin U S) \<Longrightarrow> openin U (\<Union>K)"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
   641
  using openin_clauses by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   642
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   643
lemma openin_Un[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<union> T)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   644
  using openin_Union[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   645
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   646
lemma openin_topspace[intro, simp]: "openin U (topspace U)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   647
  by (force simp: openin_Union topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   648
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   649
lemma openin_subopen: "openin U S \<longleftrightarrow> (\<forall>x \<in> S. \<exists>T. openin U T \<and> x \<in> T \<and> T \<subseteq> S)"
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   650
  (is "?lhs \<longleftrightarrow> ?rhs")
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   651
proof
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   652
  assume ?lhs
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   653
  then show ?rhs by auto
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   654
next
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   655
  assume H: ?rhs
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   656
  let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   657
  have "openin U ?t" by (force simp: openin_Union)
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   658
  also have "?t = S" using H by auto
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   659
  finally show "openin U S" .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   660
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   661
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   662
lemma openin_INT [intro]:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   663
  assumes "finite I"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   664
          "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   665
  shows "openin T ((\<Inter>i \<in> I. U i) \<inter> topspace T)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   666
using assms by (induct, auto simp: inf_sup_aci(2) openin_Int)
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   667
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   668
lemma openin_INT2 [intro]:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   669
  assumes "finite I" "I \<noteq> {}"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   670
          "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   671
  shows "openin T (\<Inter>i \<in> I. U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   672
proof -
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   673
  have "(\<Inter>i \<in> I. U i) \<subseteq> topspace T"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   674
    using \<open>I \<noteq> {}\<close> openin_subset[OF assms(3)] by auto
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   675
  then show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   676
    using openin_INT[of _ _ U, OF assms(1) assms(3)] by (simp add: inf.absorb2 inf_commute)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   677
qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   678
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
   679
lemma openin_Inter [intro]:
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
   680
  assumes "finite \<F>" "\<F> \<noteq> {}" "\<And>X. X \<in> \<F> \<Longrightarrow> openin T X" shows "openin T (\<Inter>\<F>)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
   681
  by (metis (full_types) assms openin_INT2 image_ident)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
   682
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   683
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   684
subsubsection \<open>Closed sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   685
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   686
definition "closedin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> openin U (topspace U - S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   687
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   688
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   689
  by (metis closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   690
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   691
lemma closedin_empty[simp]: "closedin U {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   692
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   693
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   694
lemma closedin_topspace[intro, simp]: "closedin U (topspace U)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   695
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   696
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   697
lemma closedin_Un[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<union> T)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   698
  by (auto simp: Diff_Un closedin_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   699
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   700
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union>{A - s|s. s\<in>S}"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   701
  by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   702
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   703
lemma closedin_Union:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   704
  assumes "finite S" "\<And>T. T \<in> S \<Longrightarrow> closedin U T"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   705
    shows "closedin U (\<Union>S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   706
  using assms by induction auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   707
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   708
lemma closedin_Inter[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   709
  assumes Ke: "K \<noteq> {}"
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   710
    and Kc: "\<And>S. S \<in>K \<Longrightarrow> closedin U S"
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   711
  shows "closedin U (\<Inter>K)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   712
  using Ke Kc unfolding closedin_def Diff_Inter by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   713
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   714
lemma closedin_INT[intro]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   715
  assumes "A \<noteq> {}" "\<And>x. x \<in> A \<Longrightarrow> closedin U (B x)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   716
  shows "closedin U (\<Inter>x\<in>A. B x)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   717
  apply (rule closedin_Inter)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   718
  using assms
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   719
  apply auto
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   720
  done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   721
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   722
lemma closedin_Int[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<inter> T)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   723
  using closedin_Inter[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   724
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   725
lemma openin_closedin_eq: "openin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> closedin U (topspace U - S)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   726
  apply (auto simp: closedin_def Diff_Diff_Int inf_absorb2)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   727
  apply (metis openin_subset subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   728
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   729
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   730
lemma openin_closedin: "S \<subseteq> topspace U \<Longrightarrow> (openin U S \<longleftrightarrow> closedin U (topspace U - S))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   731
  by (simp add: openin_closedin_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   732
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   733
lemma openin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   734
  assumes oS: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   735
    and cT: "closedin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   736
  shows "openin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   737
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   738
  have "S - T = S \<inter> (topspace U - T)" using openin_subset[of U S]  oS cT
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   739
    by (auto simp: topspace_def openin_subset)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   740
  then show ?thesis using oS cT
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   741
    by (auto simp: closedin_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   742
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   743
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   744
lemma closedin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   745
  assumes oS: "closedin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   746
    and cT: "openin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   747
  shows "closedin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   748
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   749
  have "S - T = S \<inter> (topspace U - T)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   750
    using closedin_subset[of U S] oS cT by (auto simp: topspace_def)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   751
  then show ?thesis
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   752
    using oS cT by (auto simp: openin_closedin_eq)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   753
qed
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   754
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   755
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   756
subsubsection \<open>Subspace topology\<close>
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   757
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   758
definition "subtopology U V = topology (\<lambda>T. \<exists>S. T = S \<inter> V \<and> openin U S)"
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   759
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   760
lemma istopology_subtopology: "istopology (\<lambda>T. \<exists>S. T = S \<inter> V \<and> openin U S)"
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   761
  (is "istopology ?L")
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   762
proof -
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   763
  have "?L {}" by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   764
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   765
    fix A B
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   766
    assume A: "?L A" and B: "?L B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   767
    from A B obtain Sa and Sb where Sa: "openin U Sa" "A = Sa \<inter> V" and Sb: "openin U Sb" "B = Sb \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   768
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   769
    have "A \<inter> B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   770
      using Sa Sb by blast+
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   771
    then have "?L (A \<inter> B)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   772
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   773
  moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   774
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   775
    fix K
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   776
    assume K: "K \<subseteq> Collect ?L"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   777
    have th0: "Collect ?L = (\<lambda>S. S \<inter> V) ` Collect (openin U)"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   778
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   779
    from K[unfolded th0 subset_image_iff]
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   780
    obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   781
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   782
    have "\<Union>K = (\<Union>Sk) \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   783
      using Sk by auto
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   784
    moreover have "openin U (\<Union>Sk)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   785
      using Sk by (auto simp: subset_eq)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   786
    ultimately have "?L (\<Union>K)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   787
  }
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   788
  ultimately show ?thesis
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
   789
    unfolding subset_eq mem_Collect_eq istopology_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   790
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   791
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   792
lemma openin_subtopology: "openin (subtopology U V) S \<longleftrightarrow> (\<exists>T. openin U T \<and> S = T \<inter> V)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   793
  unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   794
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   795
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   796
lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \<inter> V"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   797
  by (auto simp: topspace_def openin_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   798
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   799
lemma closedin_subtopology: "closedin (subtopology U V) S \<longleftrightarrow> (\<exists>T. closedin U T \<and> S = T \<inter> V)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   800
  unfolding closedin_def topspace_subtopology
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   801
  by (auto simp: openin_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   802
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   803
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   804
  unfolding openin_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   805
  by auto (metis IntD1 in_mono openin_subset)
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   806
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   807
lemma subtopology_superset:
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   808
  assumes UV: "topspace U \<subseteq> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   809
  shows "subtopology U V = U"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   810
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   811
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   812
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   813
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   814
      fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   815
      assume T: "openin U T" "S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   816
      from T openin_subset[OF T(1)] UV have eq: "S = T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   817
        by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   818
      have "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   819
        unfolding eq using T by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   820
    }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   821
    moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   822
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   823
      assume S: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   824
      then have "\<exists>T. openin U T \<and> S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   825
        using openin_subset[OF S] UV by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   826
    }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   827
    ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   828
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   829
  }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   830
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   831
    unfolding topology_eq openin_subtopology by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   832
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   833
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   834
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   835
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   836
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   837
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   838
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   839
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   840
lemma openin_subtopology_empty:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   841
   "openin (subtopology U {}) S \<longleftrightarrow> S = {}"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   842
by (metis Int_empty_right openin_empty openin_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   843
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   844
lemma closedin_subtopology_empty:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   845
   "closedin (subtopology U {}) S \<longleftrightarrow> S = {}"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   846
by (metis Int_empty_right closedin_empty closedin_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   847
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   848
lemma closedin_subtopology_refl [simp]:
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   849
   "closedin (subtopology U X) X \<longleftrightarrow> X \<subseteq> topspace U"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   850
by (metis closedin_def closedin_topspace inf.absorb_iff2 le_inf_iff topspace_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   851
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   852
lemma openin_imp_subset:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   853
   "openin (subtopology U S) T \<Longrightarrow> T \<subseteq> S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   854
by (metis Int_iff openin_subtopology subsetI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   855
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   856
lemma closedin_imp_subset:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   857
   "closedin (subtopology U S) T \<Longrightarrow> T \<subseteq> S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   858
by (simp add: closedin_def topspace_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   859
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   860
lemma openin_subtopology_Un:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   861
    "\<lbrakk>openin (subtopology X T) S; openin (subtopology X U) S\<rbrakk>
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   862
     \<Longrightarrow> openin (subtopology X (T \<union> U)) S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   863
by (simp add: openin_subtopology) blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   864
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   865
lemma closedin_subtopology_Un:
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   866
    "\<lbrakk>closedin (subtopology X T) S; closedin (subtopology X U) S\<rbrakk>
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   867
     \<Longrightarrow> closedin (subtopology X (T \<union> U)) S"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   868
by (simp add: closedin_subtopology) blast
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   869
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   870
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   871
subsubsection \<open>The standard Euclidean topology\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   872
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   873
definition euclidean :: "'a::topological_space topology"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   874
  where "euclidean = topology open"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   875
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   876
lemma open_openin: "open S \<longleftrightarrow> openin euclidean S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   877
  unfolding euclidean_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   878
  apply (rule cong[where x=S and y=S])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   879
  apply (rule topology_inverse[symmetric])
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   880
  apply (auto simp: istopology_def)
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   881
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   882
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   883
declare open_openin [symmetric, simp]
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   884
63492
a662e8139804 More advanced theorems about retracts, homotopies., etc
paulson <lp15@cam.ac.uk>
parents: 63469
diff changeset
   885
lemma topspace_euclidean [simp]: "topspace euclidean = UNIV"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   886
  by (force simp: topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   887
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   888
lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   889
  by (simp add: topspace_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   890
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   891
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   892
  by (simp add: closed_def closedin_def Compl_eq_Diff_UNIV)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   893
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   894
declare closed_closedin [symmetric, simp]
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   895
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   896
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   897
  using openI by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   898
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   899
lemma openin_subtopology_self [simp]: "openin (subtopology euclidean S) S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   900
  by (metis openin_topspace topspace_euclidean_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   901
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   902
text \<open>Basic "localization" results are handy for connectedness.\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   903
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   904
lemma openin_open: "openin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. open T \<and> (S = U \<inter> T))"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   905
  by (auto simp: openin_subtopology)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   906
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   907
lemma openin_Int_open:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   908
   "\<lbrakk>openin (subtopology euclidean U) S; open T\<rbrakk>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   909
        \<Longrightarrow> openin (subtopology euclidean U) (S \<inter> T)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   910
by (metis open_Int Int_assoc openin_open)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   911
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   912
lemma openin_open_Int[intro]: "open S \<Longrightarrow> openin (subtopology euclidean U) (U \<inter> S)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   913
  by (auto simp: openin_open)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   914
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   915
lemma open_openin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   916
  "open S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> openin (subtopology euclidean S) T"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   917
  by (metis Int_absorb1  openin_open_Int)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   918
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   919
lemma open_subset: "S \<subseteq> T \<Longrightarrow> open S \<Longrightarrow> openin (subtopology euclidean T) S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   920
  by (auto simp: openin_open)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   921
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   922
lemma closedin_closed: "closedin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. closed T \<and> S = U \<inter> T)"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   923
  by (simp add: closedin_subtopology Int_ac)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   924
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   925
lemma closedin_closed_Int: "closed S \<Longrightarrow> closedin (subtopology euclidean U) (U \<inter> S)"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   926
  by (metis closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   927
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   928
lemma closed_subset: "S \<subseteq> T \<Longrightarrow> closed S \<Longrightarrow> closedin (subtopology euclidean T) S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   929
  by (auto simp: closedin_closed)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   930
64791
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   931
lemma closedin_closed_subset:
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   932
 "\<lbrakk>closedin (subtopology euclidean U) V; T \<subseteq> U; S = V \<inter> T\<rbrakk>
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   933
             \<Longrightarrow> closedin (subtopology euclidean T) S"
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   934
  by (metis (no_types, lifting) Int_assoc Int_commute closedin_closed inf.orderE)
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   935
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   936
lemma finite_imp_closedin:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   937
  fixes S :: "'a::t1_space set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   938
  shows "\<lbrakk>finite S; S \<subseteq> T\<rbrakk> \<Longrightarrow> closedin (subtopology euclidean T) S"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   939
    by (simp add: finite_imp_closed closed_subset)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   940
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   941
lemma closedin_singleton [simp]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   942
  fixes a :: "'a::t1_space"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   943
  shows "closedin (subtopology euclidean U) {a} \<longleftrightarrow> a \<in> U"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   944
using closedin_subset  by (force intro: closed_subset)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   945
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   946
lemma openin_euclidean_subtopology_iff:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   947
  fixes S U :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   948
  shows "openin (subtopology euclidean U) S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   949
    S \<subseteq> U \<and> (\<forall>x\<in>S. \<exists>e>0. \<forall>x'\<in>U. dist x' x < e \<longrightarrow> x'\<in> S)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   950
  (is "?lhs \<longleftrightarrow> ?rhs")
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   951
proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   952
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   953
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   954
    unfolding openin_open open_dist by blast
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   955
next
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   956
  define T where "T = {x. \<exists>a\<in>S. \<exists>d>0. (\<forall>y\<in>U. dist y a < d \<longrightarrow> y \<in> S) \<and> dist x a < d}"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   957
  have 1: "\<forall>x\<in>T. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> T"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   958
    unfolding T_def
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   959
    apply clarsimp
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   960
    apply (rule_tac x="d - dist x a" in exI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   961
    apply (clarsimp simp add: less_diff_eq)
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   962
    by (metis dist_commute dist_triangle_lt)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   963
  assume ?rhs then have 2: "S = U \<inter> T"
60141
833adf7db7d8 New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents: 60040
diff changeset
   964
    unfolding T_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   965
    by auto (metis dist_self)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   966
  from 1 2 show ?lhs
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   967
    unfolding openin_open open_dist by fast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   968
qed
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
   969
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   970
lemma connected_openin:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   971
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   972
       ~(\<exists>e1 e2. openin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   973
                 openin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   974
                 s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   975
  apply (simp add: connected_def openin_open disjoint_iff_not_equal, safe)
63988
wenzelm
parents: 63967
diff changeset
   976
  apply (simp_all, blast+)  (* SLOW *)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   977
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   978
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   979
lemma connected_openin_eq:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   980
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   981
       ~(\<exists>e1 e2. openin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   982
                 openin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   983
                 e1 \<union> e2 = s \<and> e1 \<inter> e2 = {} \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   984
                 e1 \<noteq> {} \<and> e2 \<noteq> {})"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
   985
  apply (simp add: connected_openin, safe, blast)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   986
  by (metis Int_lower1 Un_subset_iff openin_open subset_antisym)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   987
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   988
lemma connected_closedin:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   989
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   990
       ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   991
             closedin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   992
             closedin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   993
             s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   994
             e1 \<noteq> {} \<and> e2 \<noteq> {})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   995
proof -
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   996
  { fix A B x x'
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   997
    assume s_sub: "s \<subseteq> A \<union> B"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   998
       and disj: "A \<inter> B \<inter> s = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   999
       and x: "x \<in> s" "x \<in> B" and x': "x' \<in> s" "x' \<in> A"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1000
       and cl: "closed A" "closed B"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1001
    assume "\<forall>e1. (\<forall>T. closed T \<longrightarrow> e1 \<noteq> s \<inter> T) \<or> (\<forall>e2. e1 \<inter> e2 = {} \<longrightarrow> s \<subseteq> e1 \<union> e2 \<longrightarrow> (\<forall>T. closed T \<longrightarrow> e2 \<noteq> s \<inter> T) \<or> e1 = {} \<or> e2 = {})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1002
    then have "\<And>C D. s \<inter> C = {} \<or> s \<inter> D = {} \<or> s \<inter> (C \<inter> (s \<inter> D)) \<noteq> {} \<or> \<not> s \<subseteq> s \<inter> (C \<union> D) \<or> \<not> closed C \<or> \<not> closed D"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1003
      by (metis (no_types) Int_Un_distrib Int_assoc)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1004
    moreover have "s \<inter> (A \<inter> B) = {}" "s \<inter> (A \<union> B) = s" "s \<inter> B \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1005
      using disj s_sub x by blast+
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1006
    ultimately have "s \<inter> A = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1007
      using cl by (metis inf.left_commute inf_bot_right order_refl)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1008
    then have False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1009
      using x' by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1010
  } note * = this
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1011
  show ?thesis
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1012
    apply (simp add: connected_closed closedin_closed)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1013
    apply (safe; simp)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1014
    apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1015
    apply (blast intro: *)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1016
    done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1017
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1018
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1019
lemma connected_closedin_eq:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1020
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1021
           ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1022
                 closedin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1023
                 closedin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1024
                 e1 \<union> e2 = s \<and> e1 \<inter> e2 = {} \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1025
                 e1 \<noteq> {} \<and> e2 \<noteq> {})"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1026
  apply (simp add: connected_closedin, safe, blast)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1027
  by (metis Int_lower1 Un_subset_iff closedin_closed subset_antisym)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1028
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1029
text \<open>These "transitivity" results are handy too\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1030
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1031
lemma openin_trans[trans]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1032
  "openin (subtopology euclidean T) S \<Longrightarrow> openin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1033
    openin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1034
  unfolding open_openin openin_open by blast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1035
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1036
lemma openin_open_trans: "openin (subtopology euclidean T) S \<Longrightarrow> open T \<Longrightarrow> open S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1037
  by (auto simp: openin_open intro: openin_trans)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1038
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1039
lemma closedin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1040
  "closedin (subtopology euclidean T) S \<Longrightarrow> closedin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1041
    closedin (subtopology euclidean U) S"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  1042
  by (auto simp: closedin_closed closed_Inter Int_assoc)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1043
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1044
lemma closedin_closed_trans: "closedin (subtopology euclidean T) S \<Longrightarrow> closed T \<Longrightarrow> closed S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1045
  by (auto simp: closedin_closed intro: closedin_trans)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1046
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1047
lemma openin_subtopology_Int_subset:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1048
   "\<lbrakk>openin (subtopology euclidean u) (u \<inter> S); v \<subseteq> u\<rbrakk> \<Longrightarrow> openin (subtopology euclidean v) (v \<inter> S)"
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1049
  by (auto simp: openin_subtopology)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1050
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1051
lemma openin_open_eq: "open s \<Longrightarrow> (openin (subtopology euclidean s) t \<longleftrightarrow> open t \<and> t \<subseteq> s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1052
  using open_subset openin_open_trans openin_subset by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1053
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1054
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1055
subsection \<open>Open and closed balls\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1056
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1057
definition ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1058
  where "ball x e = {y. dist x y < e}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1059
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1060
definition cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1061
  where "cball x e = {y. dist x y \<le> e}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1062
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1063
definition sphere :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1064
  where "sphere x e = {y. dist x y = e}"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1065
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1066
lemma mem_ball [simp]: "y \<in> ball x e \<longleftrightarrow> dist x y < e"
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1067
  by (simp add: ball_def)
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1068
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1069
lemma mem_cball [simp]: "y \<in> cball x e \<longleftrightarrow> dist x y \<le> e"
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1070
  by (simp add: cball_def)
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1071
61848
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1072
lemma mem_sphere [simp]: "y \<in> sphere x e \<longleftrightarrow> dist x y = e"
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1073
  by (simp add: sphere_def)
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1074
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1075
lemma ball_trivial [simp]: "ball x 0 = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1076
  by (simp add: ball_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1077
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1078
lemma cball_trivial [simp]: "cball x 0 = {x}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1079
  by (simp add: cball_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1080
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1081
lemma sphere_trivial [simp]: "sphere x 0 = {x}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1082
  by (simp add: sphere_def)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1083
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1084
lemma mem_ball_0 [simp]: "x \<in> ball 0 e \<longleftrightarrow> norm x < e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1085
  for x :: "'a::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1086
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1087
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1088
lemma mem_cball_0 [simp]: "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1089
  for x :: "'a::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1090
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1091
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1092
lemma disjoint_ballI: "dist x y \<ge> r+s \<Longrightarrow> ball x r \<inter> ball y s = {}"
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1093
  using dist_triangle_less_add not_le by fastforce
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1094
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1095
lemma disjoint_cballI: "dist x y > r + s \<Longrightarrow> cball x r \<inter> cball y s = {}"
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1096
  by (metis add_mono disjoint_iff_not_equal dist_triangle2 dual_order.trans leD mem_cball)
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1097
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1098
lemma mem_sphere_0 [simp]: "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1099
  for x :: "'a::real_normed_vector"
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1100
  by (simp add: dist_norm)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1101
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1102
lemma sphere_empty [simp]: "r < 0 \<Longrightarrow> sphere a r = {}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1103
  for a :: "'a::metric_space"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1104
  by auto
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1105
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1106
lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1107
  by simp
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1108
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1109
lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1110
  by simp
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1111
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1112
lemma ball_subset_cball [simp, intro]: "ball x e \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1113
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1114
61907
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1115
lemma sphere_cball [simp,intro]: "sphere z r \<subseteq> cball z r"
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1116
  by force
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1117
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1118
lemma cball_diff_sphere: "cball a r - sphere a r = ball a r"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1119
  by auto
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1120
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1121
lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1122
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1123
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1124
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1125
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1126
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1127
lemma ball_max_Un: "ball a (max r s) = ball a r \<union> ball a s"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  1128
  by (simp add: set_eq_iff) arith
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1129
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1130
lemma ball_min_Int: "ball a (min r s) = ball a r \<inter> ball a s"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  1131
  by (simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1132
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1133
lemma cball_max_Un: "cball a (max r s) = cball a r \<union> cball a s"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1134
  by (simp add: set_eq_iff) arith
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1135
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1136
lemma cball_min_Int: "cball a (min r s) = cball a r \<inter> cball a s"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1137
  by (simp add: set_eq_iff)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1138
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  1139
lemma cball_diff_eq_sphere: "cball a r - ball a r =  sphere a r"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1140
  by (auto simp: cball_def ball_def dist_commute)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1141
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1142
lemma image_add_ball [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1143
  fixes a :: "'a::real_normed_vector"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67155
diff changeset
  1144
  shows "(+) b ` ball a r = ball (a+b) r"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1145
apply (intro equalityI subsetI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1146
apply (force simp: dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1147
apply (rule_tac x="x-b" in image_eqI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1148
apply (auto simp: dist_norm algebra_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1149
done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1150
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1151
lemma image_add_cball [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1152
  fixes a :: "'a::real_normed_vector"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67155
diff changeset
  1153
  shows "(+) b ` cball a r = cball (a+b) r"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1154
apply (intro equalityI subsetI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1155
apply (force simp: dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1156
apply (rule_tac x="x-b" in image_eqI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1157
apply (auto simp: dist_norm algebra_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1158
done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1159
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1160
lemma open_ball [intro, simp]: "open (ball x e)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1161
proof -
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1162
  have "open (dist x -` {..<e})"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  1163
    by (intro open_vimage open_lessThan continuous_intros)
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1164
  also have "dist x -` {..<e} = ball x e"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1165
    by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1166
  finally show ?thesis .
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1167
qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1168
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1169
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)"
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  1170
  by (simp add: open_dist subset_eq mem_ball Ball_def dist_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1171
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1172
lemma openI [intro?]: "(\<And>x. x\<in>S \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> S) \<Longrightarrow> open S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1173
  by (auto simp: open_contains_ball)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1174
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1175
lemma openE[elim?]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1176
  assumes "open S" "x\<in>S"
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1177
  obtains e where "e>0" "ball x e \<subseteq> S"
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1178
  using assms unfolding open_contains_ball by auto
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1179
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1180
lemma open_contains_ball_eq: "open S \<Longrightarrow> x\<in>S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1181
  by (metis open_contains_ball subset_eq centre_in_ball)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1182
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1183
lemma openin_contains_ball:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1184
    "openin (subtopology euclidean t) s \<longleftrightarrow>
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1185
     s \<subseteq> t \<and> (\<forall>x \<in> s. \<exists>e. 0 < e \<and> ball x e \<inter> t \<subseteq> s)"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1186
    (is "?lhs = ?rhs")
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1187
proof
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1188
  assume ?lhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1189
  then show ?rhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1190
    apply (simp add: openin_open)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1191
    apply (metis Int_commute Int_mono inf.cobounded2 open_contains_ball order_refl subsetCE)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1192
    done
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1193
next
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1194
  assume ?rhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1195
  then show ?lhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1196
    apply (simp add: openin_euclidean_subtopology_iff)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1197
    by (metis (no_types) Int_iff dist_commute inf.absorb_iff2 mem_ball)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1198
qed
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1199
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1200
lemma openin_contains_cball:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1201
   "openin (subtopology euclidean t) s \<longleftrightarrow>
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1202
        s \<subseteq> t \<and>
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1203
        (\<forall>x \<in> s. \<exists>e. 0 < e \<and> cball x e \<inter> t \<subseteq> s)"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1204
apply (simp add: openin_contains_ball)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1205
apply (rule iffI)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1206
apply (auto dest!: bspec)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1207
apply (rule_tac x="e/2" in exI, force+)
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1208
done
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  1209
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1210
lemma ball_eq_empty[simp]: "ball x e = {} \<longleftrightarrow> e \<le> 0"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  1211
  unfolding mem_ball set_eq_iff
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1212
  apply (simp add: not_less)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1213
  apply (metis zero_le_dist order_trans dist_self)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1214
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1215
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  1216
lemma ball_empty: "e \<le> 0 \<Longrightarrow> ball x e = {}" by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1217
66827
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1218
lemma closed_cball [iff]: "closed (cball x e)"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1219
proof -
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1220
  have "closed (dist x -` {..e})"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1221
    by (intro closed_vimage closed_atMost continuous_intros)
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1222
  also have "dist x -` {..e} = cball x e"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1223
    by auto
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1224
  finally show ?thesis .
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1225
qed
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1226
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1227
lemma open_contains_cball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0.  cball x e \<subseteq> S)"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1228
proof -
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1229
  {
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1230
    fix x and e::real
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1231
    assume "x\<in>S" "e>0" "ball x e \<subseteq> S"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1232
    then have "\<exists>d>0. cball x d \<subseteq> S" unfolding subset_eq by (rule_tac x="e/2" in exI, auto)
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1233
  }
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1234
  moreover
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1235
  {
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1236
    fix x and e::real
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1237
    assume "x\<in>S" "e>0" "cball x e \<subseteq> S"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1238
    then have "\<exists>d>0. ball x d \<subseteq> S"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1239
      unfolding subset_eq
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1240
      apply (rule_tac x="e/2" in exI, auto)
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1241
      done
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1242
  }
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1243
  ultimately show ?thesis
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1244
    unfolding open_contains_ball by auto
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1245
qed
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1246
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1247
lemma open_contains_cball_eq: "open S \<Longrightarrow> (\<forall>x. x \<in> S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S))"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1248
  by (metis open_contains_cball subset_eq order_less_imp_le centre_in_cball)
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  1249
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1250
lemma euclidean_dist_l2:
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1251
  fixes x y :: "'a :: euclidean_space"
67155
9e5b05d54f9d canonical name
nipkow
parents: 66939
diff changeset
  1252
  shows "dist x y = L2_set (\<lambda>i. dist (x \<bullet> i) (y \<bullet> i)) Basis"
9e5b05d54f9d canonical name
nipkow
parents: 66939
diff changeset
  1253
  unfolding dist_norm norm_eq_sqrt_inner L2_set_def
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1254
  by (subst euclidean_inner) (simp add: power2_eq_square inner_diff_left)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1255
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1256
lemma eventually_nhds_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>x. x \<in> ball z d) (nhds z)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1257
  by (rule eventually_nhds_in_open) simp_all
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1258
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1259
lemma eventually_at_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<in> A) (at z within A)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1260
  unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1261
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1262
lemma eventually_at_ball': "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<noteq> z \<and> t \<in> A) (at z within A)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1263
  unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1264
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1265
subsection \<open>Boxes\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1266
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1267
abbreviation One :: "'a::euclidean_space"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1268
  where "One \<equiv> \<Sum>Basis"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1269
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1270
lemma One_non_0: assumes "One = (0::'a::euclidean_space)" shows False
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1271
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1272
  have "dependent (Basis :: 'a set)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1273
    apply (simp add: dependent_finite)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1274
    apply (rule_tac x="\<lambda>i. 1" in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1275
    using SOME_Basis apply (auto simp: assms)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1276
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1277
  with independent_Basis show False by force
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1278
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1279
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1280
corollary One_neq_0[iff]: "One \<noteq> 0"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1281
  by (metis One_non_0)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1282
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1283
corollary Zero_neq_One[iff]: "0 \<noteq> One"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1284
  by (metis One_non_0)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1285
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1286
definition (in euclidean_space) eucl_less (infix "<e" 50)
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1287
  where "eucl_less a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i)"
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1288
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1289
definition box_eucl_less: "box a b = {x. a <e x \<and> x <e b}"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1290
definition "cbox a b = {x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i}"
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1291
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1292
lemma box_def: "box a b = {x. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i}"
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1293
  and in_box_eucl_less: "x \<in> box a b \<longleftrightarrow> a <e x \<and> x <e b"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1294
  and mem_box: "x \<in> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i)"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1295
    "x \<in> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i)"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1296
  by (auto simp: box_eucl_less eucl_less_def cbox_def)
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1297
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1298
lemma cbox_Pair_eq: "cbox (a, c) (b, d) = cbox a b \<times> cbox c d"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1299
  by (force simp: cbox_def Basis_prod_def)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1300
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1301
lemma cbox_Pair_iff [iff]: "(x, y) \<in> cbox (a, c) (b, d) \<longleftrightarrow> x \<in> cbox a b \<and> y \<in> cbox c d"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1302
  by (force simp: cbox_Pair_eq)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1303
65587
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1304
lemma cbox_Complex_eq: "cbox (Complex a c) (Complex b d) = (\<lambda>(x,y). Complex x y) ` (cbox a b \<times> cbox c d)"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1305
  apply (auto simp: cbox_def Basis_complex_def)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1306
  apply (rule_tac x = "(Re x, Im x)" in image_eqI)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1307
  using complex_eq by auto
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1308
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1309
lemma cbox_Pair_eq_0: "cbox (a, c) (b, d) = {} \<longleftrightarrow> cbox a b = {} \<or> cbox c d = {}"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1310
  by (force simp: cbox_Pair_eq)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1311
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1312
lemma swap_cbox_Pair [simp]: "prod.swap ` cbox (c, a) (d, b) = cbox (a,c) (b,d)"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1313
  by auto
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1314
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1315
lemma mem_box_real[simp]:
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1316
  "(x::real) \<in> box a b \<longleftrightarrow> a < x \<and> x < b"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1317
  "(x::real) \<in> cbox a b \<longleftrightarrow> a \<le> x \<and> x \<le> b"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1318
  by (auto simp: mem_box)
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1319
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1320
lemma box_real[simp]:
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1321
  fixes a b:: real
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1322
  shows "box a b = {a <..< b}" "cbox a b = {a .. b}"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1323
  by auto
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1324
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1325
lemma box_Int_box:
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1326
  fixes a :: "'a::euclidean_space"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1327
  shows "box a b \<inter> box c d =
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1328
    box (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1329
  unfolding set_eq_iff and Int_iff and mem_box by auto
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1330
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1331
lemma rational_boxes:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  1332
  fixes x :: "'a::euclidean_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  1333
  assumes "e > 0"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1334
  shows "\<exists>a b. (\<forall>i\<in>Basis. a \<bullet> i \<in> \<rat> \<and> b \<bullet> i \<in> \<rat>) \<and> x \<in> box a b \<and> box a b \<subseteq> ball x e"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1335
proof -
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  1336
  define e' where "e' = e / (2 * sqrt (real (DIM ('a))))"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  1337
  then have e: "e' > 0"
56541
0e3abadbef39 made divide_pos_pos a simp rule
nipkow
parents: 56371
diff changeset
  1338
    using assms by (auto simp: DIM_positive)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1339
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x \<bullet> i \<and> x \<bullet> i - y < e'" (is "\<forall>i. ?th i")
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1340
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1341
    fix i
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1342
    from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1343
    show "?th i" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1344
  qed
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1345
  from choice[OF this] obtain a where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1346
    a: "\<forall>xa. a xa \<in> \<rat> \<and> a xa < x \<bullet> xa \<and> x \<bullet> xa - a xa < e'" ..
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1347
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x \<bullet> i < y \<and> y - x \<bullet> i < e'" (is "\<forall>i. ?th i")
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1348
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1349
    fix i
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1350
    from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1351
    show "?th i" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1352
  qed
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1353
  from choice[OF this] obtain b where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1354
    b: "\<forall>xa. b xa \<in> \<rat> \<and> x \<bullet> xa < b xa \<and> b xa - x \<bullet> xa < e'" ..
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1355
  let ?a = "\<Sum>i\<in>Basis. a i *\<^sub>R i" and ?b = "\<Sum>i\<in>Basis. b i *\<^sub>R i"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1356
  show ?thesis
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1357
  proof (rule exI[of _ ?a], rule exI[of _ ?b], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1358
    fix y :: 'a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1359
    assume *: "y \<in> box ?a ?b"
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
  1360
    have "dist x y = sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2)"
67155
9e5b05d54f9d canonical name
nipkow
parents: 66939
diff changeset
  1361
      unfolding L2_set_def[symmetric] by (rule euclidean_dist_l2)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1362
    also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  1363
    proof (rule real_sqrt_less_mono, rule sum_strict_mono)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1364
      fix i :: "'a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1365
      assume i: "i \<in> Basis"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1366
      have "a i < y\<bullet>i \<and> y\<bullet>i < b i"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1367
        using * i by (auto simp: box_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1368
      moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1369
        using a by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1370
      moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1371
        using b by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1372
      ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1373
        by auto
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1374
      then have "dist (x \<bullet> i) (y \<bullet> i) < e/sqrt (real (DIM('a)))"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1375
        unfolding e'_def by (auto simp: dist_real_def)
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
  1376
      then have "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < (e/sqrt (real (DIM('a))))\<^sup>2"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1377
        by (rule power_strict_mono) auto
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
  1378
      then show "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < e\<^sup>2 / real DIM('a)"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1379
        by (simp add: power_divide)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1380
    qed auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1381
    also have "\<dots> = e"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1382
      using \<open>0 < e\<close> by simp
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1383
    finally show "y \<in> ball x e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1384
      by (auto simp: ball_def)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1385
  qed (insert a b, auto simp: box_def)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1386
qed
51103
5dd7b89a16de generalized
immler
parents: 51102
diff changeset
  1387
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1388
lemma open_UNION_box:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  1389
  fixes M :: "'a::euclidean_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1390
  assumes "open M"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1391
  defines "a' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1392
  defines "b' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
  1393
  defines "I \<equiv> {f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. box (a' f) (b' f) \<subseteq> M}"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1394
  shows "M = (\<Union>f\<in>I. box (a' f) (b' f))"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1395
proof -
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1396
  have "x \<in> (\<Union>f\<in>I. box (a' f) (b' f))" if "x \<in> M" for x
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1397
  proof -
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1398
    obtain e where e: "e > 0" "ball x e \<subseteq> M"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1399
      using openE[OF \<open>open M\<close> \<open>x \<in> M\<close>] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1400
    moreover obtain a b where ab:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1401
      "x \<in> box a b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1402
      "\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1403
      "\<forall>i\<in>Basis. b \<bullet> i \<in> \<rat>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1404
      "box a b \<subseteq> ball x e"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1405
      using rational_boxes[OF e(1)] by metis
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1406
    ultimately show ?thesis
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1407
       by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<bullet> i)"])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1408
          (auto simp: euclidean_representation I_def a'_def b'_def)
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1409
  qed
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1410
  then show ?thesis by (auto simp: I_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1411
qed
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1412
66154
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1413
corollary open_countable_Union_open_box:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1414
  fixes S :: "'a :: euclidean_space set"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1415
  assumes "open S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1416
  obtains \<D> where "countable \<D>" "\<D> \<subseteq> Pow S" "\<And>X. X \<in> \<D> \<Longrightarrow> \<exists>a b. X = box a b" "\<Union>\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1417
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1418
  let ?a = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1419
  let ?b = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1420
  let ?I = "{f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. box (?a f) (?b f) \<subseteq> S}"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1421
  let ?\<D> = "(\<lambda>f. box (?a f) (?b f)) ` ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1422
  show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1423
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1424
    have "countable ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1425
      by (simp add: countable_PiE countable_rat)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1426
    then show "countable ?\<D>"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1427
      by blast
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1428
    show "\<Union>?\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1429
      using open_UNION_box [OF assms] by metis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1430
  qed auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1431
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1432
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1433
lemma rational_cboxes:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1434
  fixes x :: "'a::euclidean_space"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1435
  assumes "e > 0"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1436
  shows "\<exists>a b. (\<forall>i\<in>Basis. a \<bullet> i \<in> \<rat> \<and> b \<bullet> i \<in> \<rat>) \<and> x \<in> cbox a b \<and> cbox a b \<subseteq> ball x e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1437
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1438
  define e' where "e' = e / (2 * sqrt (real (DIM ('a))))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1439
  then have e: "e' > 0"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1440
    using assms by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1441
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x \<bullet> i \<and> x \<bullet> i - y < e'" (is "\<forall>i. ?th i")
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1442
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1443
    fix i
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1444
    from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1445
    show "?th i" by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1446
  qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1447
  from choice[OF this] obtain a where
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1448
    a: "\<forall>u. a u \<in> \<rat> \<and> a u < x \<bullet> u \<and> x \<bullet> u - a u < e'" ..
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1449
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x \<bullet> i < y \<and> y - x \<bullet> i < e'" (is "\<forall>i. ?th i")
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1450
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1451
    fix i
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1452
    from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1453
    show "?th i" by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1454
  qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1455
  from choice[OF this] obtain b where
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1456
    b: "\<forall>u. b u \<in> \<rat> \<and> x \<bullet> u < b u \<and> b u - x \<bullet> u < e'" ..
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1457
  let ?a = "\<Sum>i\<in>Basis. a i *\<^sub>R i" and ?b = "\<Sum>i\<in>Basis. b i *\<^sub>R i"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1458
  show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1459
  proof (rule exI[of _ ?a], rule exI[of _ ?b], safe)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1460
    fix y :: 'a
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1461
    assume *: "y \<in> cbox ?a ?b"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1462
    have "dist x y = sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2)"
67155
9e5b05d54f9d canonical name
nipkow
parents: 66939
diff changeset
  1463
      unfolding L2_set_def[symmetric] by (rule euclidean_dist_l2)
66154
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1464
    also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1465
    proof (rule real_sqrt_less_mono, rule sum_strict_mono)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1466
      fix i :: "'a"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1467
      assume i: "i \<in> Basis"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1468
      have "a i \<le> y\<bullet>i \<and> y\<bullet>i \<le> b i"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1469
        using * i by (auto simp: cbox_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1470
      moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1471
        using a by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1472
      moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1473
        using b by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1474
      ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1475
        by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1476
      then have "dist (x \<bullet> i) (y \<bullet> i) < e/sqrt (real (DIM('a)))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1477
        unfolding e'_def by (auto simp: dist_real_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1478
      then have "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < (e/sqrt (real (DIM('a))))\<^sup>2"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1479
        by (rule power_strict_mono) auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1480
      then show "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < e\<^sup>2 / real DIM('a)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1481
        by (simp add: power_divide)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1482
    qed auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1483
    also have "\<dots> = e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1484
      using \<open>0 < e\<close> by simp
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1485
    finally show "y \<in> ball x e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1486
      by (auto simp: ball_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1487
  next
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1488
    show "x \<in> cbox (\<Sum>i\<in>Basis. a i *\<^sub>R i) (\<Sum>i\<in>Basis. b i *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1489
      using a b less_imp_le by (auto simp: cbox_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1490
  qed (use a b cbox_def in auto)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1491
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1492
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1493
lemma open_UNION_cbox:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1494
  fixes M :: "'a::euclidean_space set"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1495
  assumes "open M"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1496
  defines "a' \<equiv> \<lambda>f. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1497
  defines "b' \<equiv> \<lambda>f. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1498
  defines "I \<equiv> {f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. cbox (a' f) (b' f) \<subseteq> M}"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1499
  shows "M = (\<Union>f\<in>I. cbox (a' f) (b' f))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1500
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1501
  have "x \<in> (\<Union>f\<in>I. cbox (a' f) (b' f))" if "x \<in> M" for x
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1502
  proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1503
    obtain e where e: "e > 0" "ball x e \<subseteq> M"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1504
      using openE[OF \<open>open M\<close> \<open>x \<in> M\<close>] by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1505
    moreover obtain a b where ab: "x \<in> cbox a b" "\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1506
                                  "\<forall>i \<in> Basis. b \<bullet> i \<in> \<rat>" "cbox a b \<subseteq> ball x e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1507
      using rational_cboxes[OF e(1)] by metis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1508
    ultimately show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1509
       by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<bullet> i)"])
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1510
          (auto simp: euclidean_representation I_def a'_def b'_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1511
  qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1512
  then show ?thesis by (auto simp: I_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1513
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1514
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1515
corollary open_countable_Union_open_cbox:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1516
  fixes S :: "'a :: euclidean_space set"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1517
  assumes "open S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1518
  obtains \<D> where "countable \<D>" "\<D> \<subseteq> Pow S" "\<And>X. X \<in> \<D> \<Longrightarrow> \<exists>a b. X = cbox a b" "\<Union>\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1519
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1520
  let ?a = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1521
  let ?b = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1522
  let ?I = "{f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. cbox (?a f) (?b f) \<subseteq> S}"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1523
  let ?\<D> = "(\<lambda>f. cbox (?a f) (?b f)) ` ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1524
  show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1525
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1526
    have "countable ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1527
      by (simp add: countable_PiE countable_rat)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1528
    then show "countable ?\<D>"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1529
      by blast
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1530
    show "\<Union>?\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1531
      using open_UNION_cbox [OF assms] by metis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1532
  qed auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1533
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1534
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1535
lemma box_eq_empty:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1536
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1537
  shows "(box a b = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i \<le> a\<bullet>i))" (is ?th1)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1538
    and "(cbox a b = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i < a\<bullet>i))" (is ?th2)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1539
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1540
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1541
    fix i x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1542
    assume i: "i\<in>Basis" and as:"b\<bullet>i \<le> a\<bullet>i" and x:"x\<in>box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1543
    then have "a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1544
      unfolding mem_box by (auto simp: box_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1545
    then have "a\<bullet>i < b\<bullet>i" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1546
    then have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1547
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1548
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1549
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1550
    assume as: "\<forall>i\<in>Basis. \<not> (b\<bullet>i \<le> a\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1551
    let ?x = "(1/2) *\<^sub>R (a + b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1552
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1553
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1554
      assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1555
      have "a\<bullet>i < b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1556
        using as[THEN bspec[where x=i]] i by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1557
      then have "a\<bullet>i < ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i < b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1558
        by (auto simp: inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1559
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1560
    then have "box a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1561
      using mem_box(1)[of "?x" a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1562
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1563
  ultimately show ?th1 by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1564
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1565
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1566
    fix i x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1567
    assume i: "i \<in> Basis" and as:"b\<bullet>i < a\<bullet>i" and x:"x\<in>cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1568
    then have "a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1569
      unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1570
    then have "a\<bullet>i \<le> b\<bullet>i" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1571
    then have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1572
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1573
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1574
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1575
    assume as:"\<forall>i\<in>Basis. \<not> (b\<bullet>i < a\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1576
    let ?x = "(1/2) *\<^sub>R (a + b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1577
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1578
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1579
      assume i:"i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1580
      have "a\<bullet>i \<le> b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1581
        using as[THEN bspec[where x=i]] i by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1582
      then have "a\<bullet>i \<le> ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i \<le> b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1583
        by (auto simp: inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1584
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1585
    then have "cbox a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1586
      using mem_box(2)[of "?x" a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1587
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1588
  ultimately show ?th2 by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1589
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1590
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1591
lemma box_ne_empty:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1592
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1593
  shows "cbox a b \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1594
  and "box a b \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1595
  unfolding box_eq_empty[of a b] by fastforce+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1596
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1597
lemma
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1598
  fixes a :: "'a::euclidean_space"
66112
0e640e04fc56 New theorems; stronger theorems; tidier theorems. Also some renaming
paulson <lp15@cam.ac.uk>
parents: 66089
diff changeset
  1599
  shows cbox_sing [simp]: "cbox a a = {a}"
0e640e04fc56 New theorems; stronger theorems; tidier theorems. Also some renaming
paulson <lp15@cam.ac.uk>
parents: 66089
diff changeset
  1600
    and box_sing [simp]: "box a a = {}"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1601
  unfolding set_eq_iff mem_box eq_iff [symmetric]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1602
  by (auto intro!: euclidean_eqI[where 'a='a])
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1603
     (metis all_not_in_conv nonempty_Basis)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1604
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1605
lemma subset_box_imp:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1606
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1607
  shows "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> cbox c d \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1608
    and "(\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i) \<Longrightarrow> cbox c d \<subseteq> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1609
    and "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> box c d \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1610
     and "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> box c d \<subseteq> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1611
  unfolding subset_eq[unfolded Ball_def] unfolding mem_box
58757
7f4924f23158 tuned whitespace;
wenzelm
parents: 58184
diff changeset
  1612
  by (best intro: order_trans less_le_trans le_less_trans less_imp_le)+
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1613
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1614
lemma box_subset_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1615
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1616
  shows "box a b \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1617
  unfolding subset_eq [unfolded Ball_def] mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1618
  by (fast intro: less_imp_le)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1619
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1620
lemma subset_box:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1621
  fixes a :: "'a::euclidean_space"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1622
  shows "cbox c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i \<le> d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th1)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1623
    and "cbox c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i \<le> d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i)" (is ?th2)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1624
    and "box c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th3)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1625
    and "box c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th4)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1626
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1627
  show ?th1
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1628
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1629
    by (auto intro: order_trans)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1630
  show ?th2
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1631
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1632
    by (auto intro: le_less_trans less_le_trans order_trans less_imp_le)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1633
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1634
    assume as: "box c d \<subseteq> cbox a b" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1635
    then have "box c d \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1636
      unfolding box_eq_empty by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1637
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1638
    assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1639
    (** TODO combine the following two parts as done in the HOL_light version. **)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1640
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1641
      let ?x = "(\<Sum>j\<in>Basis. (if j=i then ((min (a\<bullet>j) (d\<bullet>j))+c\<bullet>j)/2 else (c\<bullet>j+d\<bullet>j)/2) *\<^sub>R j)::'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1642
      assume as2: "a\<bullet>i > c\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1643
      {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1644
        fix j :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1645
        assume j: "j \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1646
        then have "c \<bullet> j < ?x \<bullet> j \<and> ?x \<bullet> j < d \<bullet> j"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1647
          apply (cases "j = i")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1648
          using as(2)[THEN bspec[where x=j]] i
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1649
          apply (auto simp: as2)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1650
          done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1651
      }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1652
      then have "?x\<in>box c d"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1653
        using i unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1654
      moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1655
      have "?x \<notin> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1656
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1657
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1658
        apply (rule_tac x=i in bexI)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1659
        using as(2)[THEN bspec[where x=i]] and as2 i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1660
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1661
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1662
      ultimately have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1663
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1664
    then have "a\<bullet>i \<le> c\<bullet>i" by (rule ccontr) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1665
    moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1666
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1667
      let ?x = "(\<Sum>j\<in>Basis. (if j=i then ((max (b\<bullet>j) (c\<bullet>j))+d\<bullet>j)/2 else (c\<bullet>j+d\<bullet>j)/2) *\<^sub>R j)::'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1668
      assume as2: "b\<bullet>i < d\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1669
      {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1670
        fix j :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1671
        assume "j\<in>Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1672
        then have "d \<bullet> j > ?x \<bullet> j \<and> ?x \<bullet> j > c \<bullet> j"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1673
          apply (cases "j = i")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1674
          using as(2)[THEN bspec[where x=j]]
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1675
          apply (auto simp: as2)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1676
          done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1677
      }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1678
      then have "?x\<in>box c d"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1679
        unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1680
      moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1681
      have "?x\<notin>cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1682
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1683
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1684
        apply (rule_tac x=i in bexI)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1685
        using as(2)[THEN bspec[where x=i]] and as2 using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1686
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1687
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1688
      ultimately have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1689
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1690
    then have "b\<bullet>i \<ge> d\<bullet>i" by (rule ccontr) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1691
    ultimately
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1692
    have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1693
  } note part1 = this
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1694
  show ?th3
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1695
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1696
    apply (rule, rule, rule, rule)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1697
    apply (rule part1)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1698
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1699
    prefer 4
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1700
    apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1701
    apply (erule_tac x=xa in allE, erule_tac x=xa in allE, fastforce)+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1702
    done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1703
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1704
    assume as: "box c d \<subseteq> box a b" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1705
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1706
    assume i:"i\<in>Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1707
    from as(1) have "box c d \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1708
      using box_subset_cbox[of a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1709
    then have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1710
      using part1 and as(2) using i by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1711
  } note * = this
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1712
  show ?th4
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1713
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1714
    apply (rule, rule, rule, rule)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1715
    apply (rule *)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1716
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1717
    prefer 4
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1718
    apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1719
    apply (erule_tac x=xa in allE, simp)+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1720
    done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1721
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1722
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1723
lemma eq_cbox: "cbox a b = cbox c d \<longleftrightarrow> cbox a b = {} \<and> cbox c d = {} \<or> a = c \<and> b = d"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1724
      (is "?lhs = ?rhs")
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1725
proof
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1726
  assume ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1727
  then have "cbox a b \<subseteq> cbox c d" "cbox c d \<subseteq> cbox a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1728
    by auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1729
  then show ?rhs
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1730
    by (force simp: subset_box box_eq_empty intro: antisym euclidean_eqI)
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1731
next
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1732
  assume ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1733
  then show ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1734
    by force
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1735
qed
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1736
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1737
lemma eq_cbox_box [simp]: "cbox a b = box c d \<longleftrightarrow> cbox a b = {} \<and> box c d = {}"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1738
  (is "?lhs \<longleftrightarrow> ?rhs")
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1739
proof
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1740
  assume ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1741
  then have "cbox a b \<subseteq> box c d" "box c d \<subseteq>cbox a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1742
    by auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1743
  then show ?rhs
63957
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
  1744
    apply (simp add: subset_box)
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1745
    using \<open>cbox a b = box c d\<close> box_ne_empty box_sing
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1746
    apply (fastforce simp add:)
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1747
    done
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1748
next
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1749
  assume ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1750
  then show ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1751
    by force
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1752
qed
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1753
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1754
lemma eq_box_cbox [simp]: "box a b = cbox c d \<longleftrightarrow> box a b = {} \<and> cbox c d = {}"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1755
  by (metis eq_cbox_box)
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1756
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1757
lemma eq_box: "box a b = box c d \<longleftrightarrow> box a b = {} \<and> box c d = {} \<or> a = c \<and> b = d"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1758
  (is "?lhs \<longleftrightarrow> ?rhs")
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1759
proof
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1760
  assume ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1761
  then have "box a b \<subseteq> box c d" "box c d \<subseteq> box a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1762
    by auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1763
  then show ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1764
    apply (simp add: subset_box)
63957
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
  1765
    using box_ne_empty(2) \<open>box a b = box c d\<close>
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1766
    apply auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1767
     apply (meson euclidean_eqI less_eq_real_def not_less)+
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1768
    done
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1769
next
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1770
  assume ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1771
  then show ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1772
    by force
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1773
qed
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1774
66466
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1775
lemma subset_box_complex:
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1776
   "cbox a b \<subseteq> cbox c d \<longleftrightarrow>
66466
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1777
      (Re a \<le> Re b \<and> Im a \<le> Im b) \<longrightarrow> Re a \<ge> Re c \<and> Im a \<ge> Im c \<and> Re b \<le> Re d \<and> Im b \<le> Im d"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1778
   "cbox a b \<subseteq> box c d \<longleftrightarrow>
66466
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1779
      (Re a \<le> Re b \<and> Im a \<le> Im b) \<longrightarrow> Re a > Re c \<and> Im a > Im c \<and> Re b < Re d \<and> Im b < Im d"
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1780
   "box a b \<subseteq> cbox c d \<longleftrightarrow>
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1781
      (Re a < Re b \<and> Im a < Im b) \<longrightarrow> Re a \<ge> Re c \<and> Im a \<ge> Im c \<and> Re b \<le> Re d \<and> Im b \<le> Im d"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1782
   "box a b \<subseteq> box c d \<longleftrightarrow>
66466
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1783
      (Re a < Re b \<and> Im a < Im b) \<longrightarrow> Re a \<ge> Re c \<and> Im a \<ge> Im c \<and> Re b \<le> Re d \<and> Im b \<le> Im d"
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1784
  by (subst subset_box; force simp: Basis_complex_def)+
aec5d9c88d69 More lemmas for HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents: 66453
diff changeset
  1785
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1786
lemma Int_interval:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1787
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1788
  shows "cbox a b \<inter> cbox c d =
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1789
    cbox (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1790
  unfolding set_eq_iff and Int_iff and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1791
  by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1792
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1793
lemma disjoint_interval:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1794
  fixes a::"'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1795
  shows "cbox a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i < a\<bullet>i \<or> d\<bullet>i < c\<bullet>i \<or> b\<bullet>i < c\<bullet>i \<or> d\<bullet>i < a\<bullet>i))" (is ?th1)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1796
    and "cbox a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i < a\<bullet>i \<or> d\<bullet>i \<le> c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th2)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1797
    and "box a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i \<le> a\<bullet>i \<or> d\<bullet>i < c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th3)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1798
    and "box a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i \<le> a\<bullet>i \<or> d\<bullet>i \<le> c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th4)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1799
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1800
  let ?z = "(\<Sum>i\<in>Basis. (((max (a\<bullet>i) (c\<bullet>i)) + (min (b\<bullet>i) (d\<bullet>i))) / 2) *\<^sub>R i)::'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1801
  have **: "\<And>P Q. (\<And>i :: 'a. i \<in> Basis \<Longrightarrow> Q ?z i \<Longrightarrow> P i) \<Longrightarrow>
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1802
      (\<And>i x :: 'a. i \<in> Basis \<Longrightarrow> P i \<Longrightarrow> Q x i) \<Longrightarrow> (\<forall>x. \<exists>i\<in>Basis. Q x i) \<longleftrightarrow> (\<exists>i\<in>Basis. P i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1803
    by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1804
  note * = set_eq_iff Int_iff empty_iff mem_box ball_conj_distrib[symmetric] eq_False ball_simps(10)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1805
  show ?th1 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1806
  show ?th2 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1807
  show ?th3 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1808
  show ?th4 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1809
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1810
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1811
lemma UN_box_eq_UNIV: "(\<Union>i::nat. box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) = UNIV"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1812
proof -
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1813
  have "\<bar>x \<bullet> b\<bar> < real_of_int (\<lceil>Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)\<rceil> + 1)"
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1814
    if [simp]: "b \<in> Basis" for x b :: 'a
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1815
  proof -
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1816
    have "\<bar>x \<bullet> b\<bar> \<le> real_of_int \<lceil>\<bar>x \<bullet> b\<bar>\<rceil>"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1817
      by (rule le_of_int_ceiling)
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1818
    also have "\<dots> \<le> real_of_int \<lceil>Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)\<rceil>"
59587
8ea7b22525cb Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents: 58877
diff changeset
  1819
      by (auto intro!: ceiling_mono)
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1820
    also have "\<dots> < real_of_int (\<lceil>Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)\<rceil> + 1)"
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1821
      by simp
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1822
    finally show ?thesis .
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1823
  qed
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1824
  then have "\<exists>n::nat. \<forall>b\<in>Basis. \<bar>x \<bullet> b\<bar> < real n" for x :: 'a
59587
8ea7b22525cb Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents: 58877
diff changeset
  1825
    by (metis order.strict_trans reals_Archimedean2)
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1826
  moreover have "\<And>x b::'a. \<And>n::nat.  \<bar>x \<bullet> b\<bar> < real n \<longleftrightarrow> - real n < x \<bullet> b \<and> x \<bullet> b < real n"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1827
    by auto
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1828
  ultimately show ?thesis
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  1829
    by (auto simp: box_def inner_sum_left inner_Basis sum.If_cases)
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1830
qed
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1831
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1832
text \<open>Intervals in general, including infinite and mixtures of open and closed.\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1833
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1834
definition "is_interval (s::('a::euclidean_space) set) \<longleftrightarrow>
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1835
  (\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i\<in>Basis. ((a\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> b\<bullet>i) \<or> (b\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> a\<bullet>i))) \<longrightarrow> x \<in> s)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1836
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1837
lemma is_interval_cbox [simp]: "is_interval (cbox a (b::'a::euclidean_space))" (is ?th1)
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1838
  and is_interval_box [simp]: "is_interval (box a b)" (is ?th2)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1839
  unfolding is_interval_def mem_box Ball_def atLeastAtMost_iff
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1840
  by (meson order_trans le_less_trans less_le_trans less_trans)+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1841
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1842
lemma is_interval_empty [iff]: "is_interval {}"
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1843
  unfolding is_interval_def  by simp
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1844
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1845
lemma is_interval_univ [iff]: "is_interval UNIV"
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1846
  unfolding is_interval_def  by simp
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1847
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1848
lemma mem_is_intervalI:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1849
  assumes "is_interval s"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1850
    and "a \<in> s" "b \<in> s"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1851
    and "\<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i \<or> b \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> a \<bullet> i"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1852
  shows "x \<in> s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1853
  by (rule assms(1)[simplified is_interval_def, rule_format, OF assms(2,3,4)])
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1854
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1855
lemma interval_subst:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1856
  fixes S::"'a::euclidean_space set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1857
  assumes "is_interval S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1858
    and "x \<in> S" "y j \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1859
    and "j \<in> Basis"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1860
  shows "(\<Sum>i\<in>Basis. (if i = j then y i \<bullet> i else x \<bullet> i) *\<^sub>R i) \<in> S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1861
  by (rule mem_is_intervalI[OF assms(1,2)]) (auto simp: assms)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1862
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1863
lemma mem_box_componentwiseI:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1864
  fixes S::"'a::euclidean_space set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1865
  assumes "is_interval S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1866
  assumes "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i \<in> ((\<lambda>x. x \<bullet> i) ` S)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1867
  shows "x \<in> S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1868
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1869
  from assms have "\<forall>i \<in> Basis. \<exists>s \<in> S. x \<bullet> i = s \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1870
    by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1871
  with finite_Basis obtain s and bs::"'a list"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1872
    where s: "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i = s i \<bullet> i" "\<And>i. i \<in> Basis \<Longrightarrow> s i \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1873
      and bs: "set bs = Basis" "distinct bs"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1874
    by (metis finite_distinct_list)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1875
  from nonempty_Basis s obtain j where j: "j \<in> Basis" "s j \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1876
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  1877
  define y where
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  1878
    "y = rec_list (s j) (\<lambda>j _ Y. (\<Sum>i\<in>Basis. (if i = j then s i \<bullet> i else Y \<bullet> i) *\<^sub>R i))"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1879
  have "x = (\<Sum>i\<in>Basis. (if i \<in> set bs then s i \<bullet> i else s j \<bullet> i) *\<^sub>R i)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1880
    using bs by (auto simp: s(1)[symmetric] euclidean_representation)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1881
  also have [symmetric]: "y bs = \<dots>"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1882
    using bs(2) bs(1)[THEN equalityD1]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1883
    by (induct bs) (auto simp: y_def euclidean_representation intro!: euclidean_eqI[where 'a='a])
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1884
  also have "y bs \<in> S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1885
    using bs(1)[THEN equalityD1]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1886
    apply (induct bs)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1887
     apply (auto simp: y_def j)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1888
    apply (rule interval_subst[OF assms(1)])
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1889
      apply (auto simp: s)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1890
    done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1891
  finally show ?thesis .
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1892
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1893
63007
aa894a49f77d new theorems about convex hulls, etc.; also, renamed some theorems
paulson <lp15@cam.ac.uk>
parents: 62948
diff changeset
  1894
lemma cbox01_nonempty [simp]: "cbox 0 One \<noteq> {}"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  1895
  by (simp add: box_ne_empty inner_Basis inner_sum_left sum_nonneg)
63007
aa894a49f77d new theorems about convex hulls, etc.; also, renamed some theorems
paulson <lp15@cam.ac.uk>
parents: 62948
diff changeset
  1896
aa894a49f77d new theorems about convex hulls, etc.; also, renamed some theorems
paulson <lp15@cam.ac.uk>
parents: 62948
diff changeset
  1897
lemma box01_nonempty [simp]: "box 0 One \<noteq> {}"
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1898
  by (simp add: box_ne_empty inner_Basis inner_sum_left)
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  1899
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  1900
lemma empty_as_interval: "{} = cbox One (0::'a::euclidean_space)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  1901
  using nonempty_Basis box01_nonempty box_eq_empty(1) box_ne_empty(1) by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  1902
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1903
lemma interval_subset_is_interval:
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1904
  assumes "is_interval S"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1905
  shows "cbox a b \<subseteq> S \<longleftrightarrow> cbox a b = {} \<or> a \<in> S \<and> b \<in> S" (is "?lhs = ?rhs")
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1906
proof
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1907
  assume ?lhs
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1908
  then show ?rhs  using box_ne_empty(1) mem_box(2) by fastforce
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1909
next
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1910
  assume ?rhs
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1911
  have "cbox a b \<subseteq> S" if "a \<in> S" "b \<in> S"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1912
    using assms unfolding is_interval_def
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1913
    apply (clarsimp simp add: mem_box)
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1914
    using that by blast
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1915
  with \<open>?rhs\<close> show ?lhs
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1916
    by blast
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1917
qed
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1918
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1919
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1920
subsection \<open>Limit points\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1921
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1922
definition (in topological_space) islimpt:: "'a \<Rightarrow> 'a set \<Rightarrow> bool"  (infixr "islimpt" 60)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1923
  where "x islimpt S \<longleftrightarrow> (\<forall>T. x\<in>T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y\<in>T \<and> y\<noteq>x))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1924
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1925
lemma islimptI:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1926
  assumes "\<And>T. x \<in> T \<Longrightarrow> open T \<Longrightarrow> \<exists>y\<in>S. y \<in> T \<and> y \<noteq> x"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1927
  shows "x islimpt S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1928
  using assms unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1929
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1930
lemma islimptE:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1931
  assumes "x islimpt S" and "x \<in> T" and "open T"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1932
  obtains y where "y \<in> S" and "y \<in> T" and "y \<noteq> x"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1933
  using assms unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1934
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1935
lemma islimpt_iff_eventually: "x islimpt S \<longleftrightarrow> \<not> eventually (\<lambda>y. y \<notin> S) (at x)"
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1936
  unfolding islimpt_def eventually_at_topological by auto
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1937
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1938
lemma islimpt_subset: "x islimpt S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> x islimpt T"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1939
  unfolding islimpt_def by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1940
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1941
lemma islimpt_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1942
  fixes x :: "'a::metric_space"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1943
  shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e)"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1944
  unfolding islimpt_iff_eventually eventually_at by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1945
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1946
lemma islimpt_approachable_le: "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x \<le> e)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1947
  for x :: "'a::metric_space"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1948
  unfolding islimpt_approachable
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1949
  using approachable_lt_le [where f="\<lambda>y. dist y x" and P="\<lambda>y. y \<notin> S \<or> y = x",
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1950
    THEN arg_cong [where f=Not]]
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1951
  by (simp add: Bex_def conj_commute conj_left_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1952
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1953
lemma islimpt_UNIV_iff: "x islimpt UNIV \<longleftrightarrow> \<not> open {x}"
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1954
  unfolding islimpt_def by (safe, fast, case_tac "T = {x}", fast, fast)
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1955
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1956
lemma islimpt_punctured: "x islimpt S = x islimpt (S-{x})"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1957
  unfolding islimpt_def by blast
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1958
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1959
text \<open>A perfect space has no isolated points.\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1960
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1961
lemma islimpt_UNIV [simp, intro]: "x islimpt UNIV"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1962
  for x :: "'a::perfect_space"
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1963
  unfolding islimpt_UNIV_iff by (rule not_open_singleton)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1964
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1965
lemma perfect_choose_dist: "0 < r \<Longrightarrow> \<exists>a. a \<noteq> x \<and> dist a x < r"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1966
  for x :: "'a::{perfect_space,metric_space}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1967
  using islimpt_UNIV [of x] by (simp add: islimpt_approachable)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1968
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1969
lemma closed_limpt: "closed S \<longleftrightarrow> (\<forall>x. x islimpt S \<longrightarrow> x \<in> S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1970
  unfolding closed_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1971
  apply (subst open_subopen)
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  1972
  apply (simp add: islimpt_def subset_eq)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1973
  apply (metis ComplE ComplI)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1974
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1975
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1976
lemma islimpt_EMPTY[simp]: "\<not> x islimpt {}"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  1977
  by (auto simp: islimpt_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1978
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1979
lemma finite_set_avoid:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1980
  fixes a :: "'a::metric_space"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1981
  assumes fS: "finite S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1982
  shows "\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<longrightarrow> d \<le> dist a x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1983
proof (induct rule: finite_induct[OF fS])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1984
  case 1
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1985
  then show ?case by (auto intro: zero_less_one)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1986
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1987
  case (2 x F)
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1988
  from 2 obtain d where d: "d > 0" "\<forall>x\<in>F. x \<noteq> a \<longrightarrow> d \<le> dist a x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1989
    by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1990
  show ?case
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1991
  proof (cases "x = a")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1992
    case True
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1993
    with d show ?thesis by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1994
  next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1995
    case False
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1996
    let ?d = "min d (dist a x)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1997
    from False d(1) have dp: "?d > 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1998
      by auto
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1999
    from d have d': "\<forall>x\<in>F. x \<noteq> a \<longrightarrow> ?d \<le> dist a x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2000
      by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2001
    with dp False show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2002
      by (auto intro!: exI[where x="?d"])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2003
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2004
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2005
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2006
lemma islimpt_Un: "x islimpt (S \<union> T) \<longleftrightarrow> x islimpt S \<or> x islimpt T"
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  2007
  by (simp add: islimpt_iff_eventually eventually_conj_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2008
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2009
lemma discrete_imp_closed:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2010
  fixes S :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2011
  assumes e: "0 < e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2012
    and d: "\<forall>x \<in> S. \<forall>y \<in> S. dist y x < e \<longrightarrow> y = x"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2013
  shows "closed S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2014
proof -
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2015
  have False if C: "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2016
  proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2017
    from e have e2: "e/2 > 0" by arith
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2018
    from C[rule_format, OF e2] obtain y where y: "y \<in> S" "y \<noteq> x" "dist y x < e/2"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2019
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2020
    let ?m = "min (e/2) (dist x y) "
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2021
    from e2 y(2) have mp: "?m > 0"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  2022
      by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2023
    from C[rule_format, OF mp] obtain z where z: "z \<in> S" "z \<noteq> x" "dist z x < ?m"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2024
      by blast
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2025
    from z y have "dist z y < e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2026
      by (intro dist_triangle_lt [where z=x]) simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2027
    from d[rule_format, OF y(1) z(1) this] y z show ?thesis
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2028
      by (auto simp: dist_commute)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2029
  qed
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2030
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2031
    by (metis islimpt_approachable closed_limpt [where 'a='a])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2032
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2033
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2034
lemma closed_of_nat_image: "closed (of_nat ` A :: 'a::real_normed_algebra_1 set)"
61524
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2035
  by (rule discrete_imp_closed[of 1]) (auto simp: dist_of_nat)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2036
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2037
lemma closed_of_int_image: "closed (of_int ` A :: 'a::real_normed_algebra_1 set)"
61524
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2038
  by (rule discrete_imp_closed[of 1]) (auto simp: dist_of_int)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2039
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2040
lemma closed_Nats [simp]: "closed (\<nat> :: 'a :: real_normed_algebra_1 set)"
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2041
  unfolding Nats_def by (rule closed_of_nat_image)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2042
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2043
lemma closed_Ints [simp]: "closed (\<int> :: 'a :: real_normed_algebra_1 set)"
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2044
  unfolding Ints_def by (rule closed_of_int_image)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2045
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2046
lemma closed_subset_Ints:
66286
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2047
  fixes A :: "'a :: real_normed_algebra_1 set"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2048
  assumes "A \<subseteq> \<int>"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2049
  shows   "closed A"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2050
proof (intro discrete_imp_closed[OF zero_less_one] ballI impI, goal_cases)
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2051
  case (1 x y)
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2052
  with assms have "x \<in> \<int>" and "y \<in> \<int>" by auto
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2053
  with \<open>dist y x < 1\<close> show "y = x"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2054
    by (auto elim!: Ints_cases simp: dist_of_int)
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2055
qed
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2056
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2057
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2058
subsection \<open>Interior of a Set\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2059
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2060
definition "interior S = \<Union>{T. open T \<and> T \<subseteq> S}"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2061
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2062
lemma interiorI [intro?]:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2063
  assumes "open T" and "x \<in> T" and "T \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2064
  shows "x \<in> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2065
  using assms unfolding interior_def by fast
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2066
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2067
lemma interiorE [elim?]:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2068
  assumes "x \<in> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2069
  obtains T where "open T" and "x \<in> T" and "T \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2070
  using assms unfolding interior_def by fast
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2071
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2072
lemma open_interior [simp, intro]: "open (interior S)"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2073
  by (simp add: interior_def open_Union)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2074
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2075
lemma interior_subset: "interior S \<subseteq> S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2076
  by (auto simp: interior_def)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2077
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2078
lemma interior_maximal: "T \<subseteq> S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> interior S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2079
  by (auto simp: interior_def)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2080
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2081
lemma interior_open: "open S \<Longrightarrow> interior S = S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2082
  by (intro equalityI interior_subset interior_maximal subset_refl)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2083
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2084
lemma interior_eq: "interior S = S \<longleftrightarrow> open S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2085
  by (metis open_interior interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2086
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2087
lemma open_subset_interior: "open S \<Longrightarrow> S \<subseteq> interior T \<longleftrightarrow> S \<subseteq> T"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2088
  by (metis interior_maximal interior_subset subset_trans)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2089
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2090
lemma interior_empty [simp]: "interior {} = {}"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2091
  using open_empty by (rule interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2092
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2093
lemma interior_UNIV [simp]: "interior UNIV = UNIV"
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2094
  using open_UNIV by (rule interior_open)
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2095
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2096
lemma interior_interior [simp]: "interior (interior S) = interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2097
  using open_interior by (rule interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2098
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2099
lemma interior_mono: "S \<subseteq> T \<Longrightarrow> interior S \<subseteq> interior T"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2100
  by (auto simp: interior_def)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2101
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2102
lemma interior_unique:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2103
  assumes "T \<subseteq> S" and "open T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2104
  assumes "\<And>T'. T' \<subseteq> S \<Longrightarrow> open T' \<Longrightarrow> T' \<subseteq> T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2105
  shows "interior S = T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2106
  by (intro equalityI assms interior_subset open_interior interior_maximal)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2107
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2108
lemma interior_singleton [simp]: "interior {a} = {}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2109
  for a :: "'a::perfect_space"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2110
  apply (rule interior_unique, simp_all)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2111
  using not_open_singleton subset_singletonD
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2112
  apply fastforce
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2113
  done
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2114
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2115
lemma interior_Int [simp]: "interior (S \<inter> T) = interior S \<inter> interior T"
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2116
  by (intro equalityI Int_mono Int_greatest interior_mono Int_lower1
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2117
    Int_lower2 interior_maximal interior_subset open_Int open_interior)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2118
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2119
lemma mem_interior: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2120
  using open_contains_ball_eq [where S="interior S"]
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2121
  by (simp add: open_subset_interior)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2122
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2123
lemma eventually_nhds_in_nhd: "x \<in> interior s \<Longrightarrow> eventually (\<lambda>y. y \<in> s) (nhds x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2124
  using interior_subset[of s] by (subst eventually_nhds) blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2125
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2126
lemma interior_limit_point [intro]:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2127
  fixes x :: "'a::perfect_space"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2128
  assumes x: "x \<in> interior S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2129
  shows "x islimpt S"
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2130
  using x islimpt_UNIV [of x]
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2131
  unfolding interior_def islimpt_def
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2132
  apply (clarsimp, rename_tac T T')
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2133
  apply (drule_tac x="T \<inter> T'" in spec)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2134
  apply (auto simp: open_Int)
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2135
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2136
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2137
lemma interior_closed_Un_empty_interior:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2138
  assumes cS: "closed S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2139
    and iT: "interior T = {}"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2140
  shows "interior (S \<union> T) = interior S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2141
proof
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2142
  show "interior S \<subseteq> interior (S \<union> T)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2143
    by (rule interior_mono) (rule Un_upper1)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2144
  show "interior (S \<union> T) \<subseteq> interior S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2145
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2146
    fix x
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2147
    assume "x \<in> interior (S \<union> T)"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2148
    then obtain R where "open R" "x \<in> R" "R \<subseteq> S \<union> T" ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2149
    show "x \<in> interior S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2150
    proof (rule ccontr)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2151
      assume "x \<notin> interior S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2152
      with \<open>x \<in> R\<close> \<open>open R\<close> obtain y where "y \<in> R - S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2153
        unfolding interior_def by fast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2154
      from \<open>open R\<close> \<open>closed S\<close> have "open (R - S)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2155
        by (rule open_Diff)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2156
      from \<open>R \<subseteq> S \<union> T\<close> have "R - S \<subseteq> T"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2157
        by fast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2158
      from \<open>y \<in> R - S\<close> \<open>open (R - S)\<close> \<open>R - S \<subseteq> T\<close> \<open>interior T = {}\<close> show False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2159
        unfolding interior_def by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2160
    qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2161
  qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2162
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2163
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2164
lemma interior_Times: "interior (A \<times> B) = interior A \<times> interior B"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2165
proof (rule interior_unique)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2166
  show "interior A \<times> interior B \<subseteq> A \<times> B"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2167
    by (intro Sigma_mono interior_subset)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2168
  show "open (interior A \<times> interior B)"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2169
    by (intro open_Times open_interior)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2170
  fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2171
  assume "T \<subseteq> A \<times> B" and "open T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2172
  then show "T \<subseteq> interior A \<times> interior B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2173
  proof safe
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2174
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2175
    assume "(x, y) \<in> T"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2176
    then obtain C D where "open C" "open D" "C \<times> D \<subseteq> T" "x \<in> C" "y \<in> D"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2177
      using \<open>open T\<close> unfolding open_prod_def by fast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2178
    then have "open C" "open D" "C \<subseteq> A" "D \<subseteq> B" "x \<in> C" "y \<in> D"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2179
      using \<open>T \<subseteq> A \<times> B\<close> by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2180
    then show "x \<in> interior A" and "y \<in> interior B"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2181
      by (auto intro: interiorI)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2182
  qed
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2183
qed
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2184
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2185
lemma interior_Ici:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2186
  fixes x :: "'a :: {dense_linorder,linorder_topology}"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2187
  assumes "b < x"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2188
  shows "interior {x ..} = {x <..}"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2189
proof (rule interior_unique)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2190
  fix T
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2191
  assume "T \<subseteq> {x ..}" "open T"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2192
  moreover have "x \<notin> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2193
  proof
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2194
    assume "x \<in> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2195
    obtain y where "y < x" "{y <.. x} \<subseteq> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2196
      using open_left[OF \<open>open T\<close> \<open>x \<in> T\<close> \<open>b < x\<close>] by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2197
    with dense[OF \<open>y < x\<close>] obtain z where "z \<in> T" "z < x"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2198
      by (auto simp: subset_eq Ball_def)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2199
    with \<open>T \<subseteq> {x ..}\<close> show False by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2200
  qed
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2201
  ultimately show "T \<subseteq> {x <..}"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2202
    by (auto simp: subset_eq less_le)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2203
qed auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2204
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2205
lemma interior_Iic:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2206
  fixes x :: "'a ::{dense_linorder,linorder_topology}"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2207
  assumes "x < b"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2208
  shows "interior {.. x} = {..< x}"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2209
proof (rule interior_unique)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2210
  fix T
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2211
  assume "T \<subseteq> {.. x}" "open T"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2212
  moreover have "x \<notin> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2213
  proof
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2214
    assume "x \<in> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2215
    obtain y where "x < y" "{x ..< y} \<subseteq> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2216
      using open_right[OF \<open>open T\<close> \<open>x \<in> T\<close> \<open>x < b\<close>] by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2217
    with dense[OF \<open>x < y\<close>] obtain z where "z \<in> T" "x < z"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2218
      by (auto simp: subset_eq Ball_def less_le)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2219
    with \<open>T \<subseteq> {.. x}\<close> show False by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2220
  qed
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2221
  ultimately show "T \<subseteq> {..< x}"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2222
    by (auto simp: subset_eq less_le)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2223
qed auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2224
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2225
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2226
subsection \<open>Closure of a Set\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2227
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2228
definition "closure S = S \<union> {x | x. x islimpt S}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2229
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2230
lemma interior_closure: "interior S = - (closure (- S))"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2231
  by (auto simp: interior_def closure_def islimpt_def)
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2232
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2233
lemma closure_interior: "closure S = - interior (- S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2234
  by (simp add: interior_closure)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2235
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2236
lemma closed_closure[simp, intro]: "closed (closure S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2237
  by (simp add: closure_interior closed_Compl)
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2238
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2239
lemma closure_subset: "S \<subseteq> closure S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2240
  by (simp add: closure_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2241
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2242
lemma closure_hull: "closure S = closed hull S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2243
  by (auto simp: hull_def closure_interior interior_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2244
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2245
lemma closure_eq: "closure S = S \<longleftrightarrow> closed S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2246
  unfolding closure_hull using closed_Inter by (rule hull_eq)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2247
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2248
lemma closure_closed [simp]: "closed S \<Longrightarrow> closure S = S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2249
  by (simp only: closure_eq)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2250
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2251
lemma closure_closure [simp]: "closure (closure S) = closure S"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2252
  unfolding closure_hull by (rule hull_hull)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2253
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2254
lemma closure_mono: "S \<subseteq> T \<Longrightarrow> closure S \<subseteq> closure T"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2255
  unfolding closure_hull by (rule hull_mono)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2256
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2257
lemma closure_minimal: "S \<subseteq> T \<Longrightarrow> closed T \<Longrightarrow> closure S \<subseteq> T"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2258
  unfolding closure_hull by (rule hull_minimal)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2259
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2260
lemma closure_unique:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2261
  assumes "S \<subseteq> T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2262
    and "closed T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2263
    and "\<And>T'. S \<subseteq> T' \<Longrightarrow> closed T' \<Longrightarrow> T \<subseteq> T'"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2264
  shows "closure S = T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2265
  using assms unfolding closure_hull by (rule hull_unique)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2266
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2267
lemma closure_empty [simp]: "closure {} = {}"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2268
  using closed_empty by (rule closure_closed)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2269
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2270
lemma closure_UNIV [simp]: "closure UNIV = UNIV"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2271
  using closed_UNIV by (rule closure_closed)
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2272
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2273
lemma closure_Un [simp]: "closure (S \<union> T) = closure S \<union> closure T"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2274
  by (simp add: closure_interior)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2275
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  2276
lemma closure_eq_empty [iff]: "closure S = {} \<longleftrightarrow> S = {}"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2277
  using closure_empty closure_subset[of S] by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2278
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2279
lemma closure_subset_eq: "closure S \<subseteq> S \<longleftrightarrow> closed S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2280
  using closure_eq[of S] closure_subset[of S] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2281
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2282
lemma open_Int_closure_eq_empty: "open S \<Longrightarrow> (S \<inter> closure T) = {} \<longleftrightarrow> S \<inter> T = {}"
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2283
  using open_subset_interior[of S "- T"]
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2284
  using interior_subset[of "- T"]
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2285
  by (auto simp: closure_interior)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2286
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2287
lemma open_Int_closure_subset: "open S \<Longrightarrow> S \<inter> closure T \<subseteq> closure (S \<inter> T)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2288
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2289
  fix x
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2290
  assume *: "open S" "x \<in> S \<inter> closure T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2291
  have "x islimpt (S \<inter> T)" if **: "x islimpt T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2292
  proof (rule islimptI)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2293
    fix A
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2294
    assume "x \<in> A" "open A"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2295
    with * have "x \<in> A \<inter> S" "open (A \<inter> S)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2296
      by (simp_all add: open_Int)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2297
    with ** obtain y where "y \<in> T" "y \<in> A \<inter> S" "y \<noteq> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2298
      by (rule islimptE)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2299
    then have "y \<in> S \<inter> T" "y \<in> A \<and> y \<noteq> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2300
      by simp_all
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2301
    then show "\<exists>y\<in>(S \<inter> T). y \<in> A \<and> y \<noteq> x" ..
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2302
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2303
  with * show "x \<in> closure (S \<inter> T)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2304
    unfolding closure_def by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2305
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2306
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2307
lemma closure_complement: "closure (- S) = - interior S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2308
  by (simp add: closure_interior)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2309
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2310
lemma interior_complement: "interior (- S) = - closure S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2311
  by (simp add: closure_interior)
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
  2312
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
  2313
lemma interior_diff: "interior(S - T) = interior S - closure T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
  2314
  by (simp add: Diff_eq interior_complement)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2315
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2316
lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2317
proof (rule closure_unique)
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2318
  show "A \<times> B \<subseteq> closure A \<times> closure B"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2319
    by (intro Sigma_mono closure_subset)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2320
  show "closed (closure A \<times> closure B)"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2321
    by (intro closed_Times closed_closure)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2322
  fix T
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2323
  assume "A \<times> B \<subseteq> T" and "closed T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2324
  then show "closure A \<times> closure B \<subseteq> T"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2325
    apply (simp add: closed_def open_prod_def, clarify)
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2326
    apply (rule ccontr)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2327
    apply (drule_tac x="(a, b)" in bspec, simp, clarify, rename_tac C D)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2328
    apply (simp add: closure_interior interior_def)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2329
    apply (drule_tac x=C in spec)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2330
    apply (drule_tac x=D in spec, auto)
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2331
    done
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2332
qed
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2333
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2334
lemma closure_openin_Int_closure:
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2335
  assumes ope: "openin (subtopology euclidean U) S" and "T \<subseteq> U"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2336
  shows "closure(S \<inter> closure T) = closure(S \<inter> T)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2337
proof
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2338
  obtain V where "open V" and S: "S = U \<inter> V"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2339
    using ope using openin_open by metis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2340
  show "closure (S \<inter> closure T) \<subseteq> closure (S \<inter> T)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2341
    proof (clarsimp simp: S)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2342
      fix x
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2343
      assume  "x \<in> closure (U \<inter> V \<inter> closure T)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2344
      then have "V \<inter> closure T \<subseteq> A \<Longrightarrow> x \<in> closure A" for A
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2345
          by (metis closure_mono subsetD inf.coboundedI2 inf_assoc)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2346
      then have "x \<in> closure (T \<inter> V)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2347
         by (metis \<open>open V\<close> closure_closure inf_commute open_Int_closure_subset)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2348
      then show "x \<in> closure (U \<inter> V \<inter> T)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2349
        by (metis \<open>T \<subseteq> U\<close> inf.absorb_iff2 inf_assoc inf_commute)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2350
    qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2351
next
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2352
  show "closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2353
    by (meson Int_mono closure_mono closure_subset order_refl)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2354
qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  2355
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2356
lemma islimpt_in_closure: "(x islimpt S) = (x\<in>closure(S-{x}))"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  2357
  unfolding closure_def using islimpt_punctured by blast
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  2358
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2359
lemma connected_imp_connected_closure: "connected S \<Longrightarrow> connected (closure S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2360
  by (rule connectedI) (meson closure_subset open_Int open_Int_closure_eq_empty subset_trans connectedD)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2361
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2362
lemma limpt_of_limpts: "x islimpt {y. y islimpt S} \<Longrightarrow> x islimpt S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2363
  for x :: "'a::metric_space"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2364
  apply (clarsimp simp add: islimpt_approachable)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2365
  apply (drule_tac x="e/2" in spec)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2366
  apply (auto simp: simp del: less_divide_eq_numeral1)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2367
  apply (drule_tac x="dist x' x" in spec)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2368
  apply (auto simp: zero_less_dist_iff simp del: less_divide_eq_numeral1)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2369
  apply (erule rev_bexI)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2370
  apply (metis dist_commute dist_triangle_half_r less_trans less_irrefl)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2371
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2372
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2373
lemma closed_limpts:  "closed {x::'a::metric_space. x islimpt S}"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2374
  using closed_limpt limpt_of_limpts by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2375
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2376
lemma limpt_of_closure: "x islimpt closure S \<longleftrightarrow> x islimpt S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2377
  for x :: "'a::metric_space"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2378
  by (auto simp: closure_def islimpt_Un dest: limpt_of_limpts)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2379
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2380
lemma closedin_limpt:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2381
  "closedin (subtopology euclidean T) S \<longleftrightarrow> S \<subseteq> T \<and> (\<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2382
  apply (simp add: closedin_closed, safe)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2383
   apply (simp add: closed_limpt islimpt_subset)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2384
  apply (rule_tac x="closure S" in exI, simp)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2385
  apply (force simp: closure_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2386
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2387
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2388
lemma closedin_closed_eq: "closed S \<Longrightarrow> closedin (subtopology euclidean S) T \<longleftrightarrow> closed T \<and> T \<subseteq> S"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2389
  by (meson closedin_limpt closed_subset closedin_closed_trans)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2390
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  2391
lemma connected_closed_set:
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  2392
   "closed S
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  2393
    \<Longrightarrow> connected S \<longleftrightarrow> (\<nexists>A B. closed A \<and> closed B \<and> A \<noteq> {} \<and> B \<noteq> {} \<and> A \<union> B = S \<and> A \<inter> B = {})"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  2394
  unfolding connected_closedin_eq closedin_closed_eq connected_closedin_eq by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  2395
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2396
lemma closedin_subset_trans:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2397
  "closedin (subtopology euclidean U) S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> T \<subseteq> U \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2398
    closedin (subtopology euclidean T) S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2399
  by (meson closedin_limpt subset_iff)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2400
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2401
lemma openin_subset_trans:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2402
  "openin (subtopology euclidean U) S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> T \<subseteq> U \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2403
    openin (subtopology euclidean T) S"
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2404
  by (auto simp: openin_open)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2405
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2406
lemma openin_Times:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2407
  "openin (subtopology euclidean S) S' \<Longrightarrow> openin (subtopology euclidean T) T' \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2408
    openin (subtopology euclidean (S \<times> T)) (S' \<times> T')"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2409
  unfolding openin_open using open_Times by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2410
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2411
lemma Times_in_interior_subtopology:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2412
  fixes U :: "('a::metric_space \<times> 'b::metric_space) set"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2413
  assumes "(x, y) \<in> U" "openin (subtopology euclidean (S \<times> T)) U"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2414
  obtains V W where "openin (subtopology euclidean S) V" "x \<in> V"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2415
                    "openin (subtopology euclidean T) W" "y \<in> W" "(V \<times> W) \<subseteq> U"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2416
proof -
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2417
  from assms obtain e where "e > 0" and "U \<subseteq> S \<times> T"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2418
    and e: "\<And>x' y'. \<lbrakk>x'\<in>S; y'\<in>T; dist (x', y') (x, y) < e\<rbrakk> \<Longrightarrow> (x', y') \<in> U"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2419
    by (force simp: openin_euclidean_subtopology_iff)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2420
  with assms have "x \<in> S" "y \<in> T"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2421
    by auto
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2422
  show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2423
  proof
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2424
    show "openin (subtopology euclidean S) (ball x (e/2) \<inter> S)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2425
      by (simp add: Int_commute openin_open_Int)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2426
    show "x \<in> ball x (e / 2) \<inter> S"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2427
      by (simp add: \<open>0 < e\<close> \<open>x \<in> S\<close>)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2428
    show "openin (subtopology euclidean T) (ball y (e/2) \<inter> T)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2429
      by (simp add: Int_commute openin_open_Int)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2430
    show "y \<in> ball y (e / 2) \<inter> T"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2431
      by (simp add: \<open>0 < e\<close> \<open>y \<in> T\<close>)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2432
    show "(ball x (e / 2) \<inter> S) \<times> (ball y (e / 2) \<inter> T) \<subseteq> U"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2433
      by clarify (simp add: e dist_Pair_Pair \<open>0 < e\<close> dist_commute sqrt_sum_squares_half_less)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2434
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2435
qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2436
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2437
lemma openin_Times_eq:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2438
  fixes S :: "'a::metric_space set" and T :: "'b::metric_space set"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2439
  shows
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2440
    "openin (subtopology euclidean (S \<times> T)) (S' \<times> T') \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2441
      S' = {} \<or> T' = {} \<or> openin (subtopology euclidean S) S' \<and> openin (subtopology euclidean T) T'"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2442
    (is "?lhs = ?rhs")
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2443
proof (cases "S' = {} \<or> T' = {}")
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2444
  case True
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2445
  then show ?thesis by auto
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2446
next
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2447
  case False
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2448
  then obtain x y where "x \<in> S'" "y \<in> T'"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2449
    by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2450
  show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2451
  proof
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2452
    assume ?lhs
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2453
    have "openin (subtopology euclidean S) S'"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2454
      apply (subst openin_subopen, clarify)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2455
      apply (rule Times_in_interior_subtopology [OF _ \<open>?lhs\<close>])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2456
      using \<open>y \<in> T'\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2457
       apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2458
      done
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2459
    moreover have "openin (subtopology euclidean T) T'"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2460
      apply (subst openin_subopen, clarify)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2461
      apply (rule Times_in_interior_subtopology [OF _ \<open>?lhs\<close>])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2462
      using \<open>x \<in> S'\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2463
       apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2464
      done
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2465
    ultimately show ?rhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2466
      by simp
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2467
  next
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2468
    assume ?rhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2469
    with False show ?lhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2470
      by (simp add: openin_Times)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2471
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2472
qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2473
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2474
lemma closedin_Times:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2475
  "closedin (subtopology euclidean S) S' \<Longrightarrow> closedin (subtopology euclidean T) T' \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2476
    closedin (subtopology euclidean (S \<times> T)) (S' \<times> T')"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2477
  unfolding closedin_closed using closed_Times by blast
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2478
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2479
lemma bdd_below_closure:
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2480
  fixes A :: "real set"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2481
  assumes "bdd_below A"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2482
  shows "bdd_below (closure A)"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2483
proof -
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2484
  from assms obtain m where "\<And>x. x \<in> A \<Longrightarrow> m \<le> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2485
    by (auto simp: bdd_below_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2486
  then have "A \<subseteq> {m..}" by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2487
  then have "closure A \<subseteq> {m..}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2488
    using closed_real_atLeast by (rule closure_minimal)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2489
  then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2490
    by (auto simp: bdd_below_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2491
qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2492
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2493
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2494
subsection \<open>Frontier (also known as boundary)\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2495
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2496
definition "frontier S = closure S - interior S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2497
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  2498
lemma frontier_closed [iff]: "closed (frontier S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2499
  by (simp add: frontier_def closed_Diff)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2500
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2501
lemma frontier_closures: "frontier S = closure S \<inter> closure (- S)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2502
  by (auto simp: frontier_def interior_closure)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2503
66939
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2504
lemma frontier_Int: "frontier(S \<inter> T) = closure(S \<inter> T) \<inter> (frontier S \<union> frontier T)"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2505
proof -
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2506
  have "closure (S \<inter> T) \<subseteq> closure S" "closure (S \<inter> T) \<subseteq> closure T"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2507
    by (simp_all add: closure_mono)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2508
  then show ?thesis
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2509
    by (auto simp: frontier_closures)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2510
qed
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2511
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2512
lemma frontier_Int_subset: "frontier(S \<inter> T) \<subseteq> frontier S \<union> frontier T"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2513
  by (auto simp: frontier_Int)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2514
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2515
lemma frontier_Int_closed:
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2516
  assumes "closed S" "closed T"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2517
  shows "frontier(S \<inter> T) = (frontier S \<inter> T) \<union> (S \<inter> frontier T)"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2518
proof -
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2519
  have "closure (S \<inter> T) = T \<inter> S"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2520
    using assms by (simp add: Int_commute closed_Int)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2521
  moreover have "T \<inter> (closure S \<inter> closure (- S)) = frontier S \<inter> T"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2522
    by (simp add: Int_commute frontier_closures)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2523
  ultimately show ?thesis
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2524
    by (simp add: Int_Un_distrib Int_assoc Int_left_commute assms frontier_closures)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2525
qed
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2526
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2527
lemma frontier_straddle:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2528
  fixes a :: "'a::metric_space"
44909
1f5d6eb73549 shorten proof of frontier_straddle
huffman
parents: 44907
diff changeset
  2529
  shows "a \<in> frontier S \<longleftrightarrow> (\<forall>e>0. (\<exists>x\<in>S. dist a x < e) \<and> (\<exists>x. x \<notin> S \<and> dist a x < e))"
1f5d6eb73549 shorten proof of frontier_straddle
huffman
parents: 44907
diff changeset
  2530
  unfolding frontier_def closure_interior
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2531
  by (auto simp: mem_interior subset_eq ball_def)
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  2532
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2533
lemma frontier_subset_closed: "closed S \<Longrightarrow> frontier S \<subseteq> S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2534
  by (metis frontier_def closure_closed Diff_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2535
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  2536
lemma frontier_empty [simp]: "frontier {} = {}"
36362
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
  2537
  by (simp add: frontier_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2538
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2539
lemma frontier_subset_eq: "frontier S \<subseteq> S \<longleftrightarrow> closed S"
58757
7f4924f23158 tuned whitespace;
wenzelm
parents: 58184
diff changeset
  2540
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2541
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2542
    assume "frontier S \<subseteq> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2543
    then have "closure S \<subseteq> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2544
      using interior_subset unfolding frontier_def by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2545
    then have "closed S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2546
      using closure_subset_eq by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2547
  }
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2548
  then show ?thesis using frontier_subset_closed[of S] ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2549
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2550
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  2551
lemma frontier_complement [simp]: "frontier (- S) = frontier S"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2552
  by (auto simp: frontier_def closure_complement interior_complement)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2553
66939
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2554
lemma frontier_Un_subset: "frontier(S \<union> T) \<subseteq> frontier S \<union> frontier T"
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2555
  by (metis compl_sup frontier_Int_subset frontier_complement)
04678058308f New results in topology, mostly from HOL Light's moretop.ml
paulson <lp15@cam.ac.uk>
parents: 66884
diff changeset
  2556
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2557
lemma frontier_disjoint_eq: "frontier S \<inter> S = {} \<longleftrightarrow> open S"
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2558
  using frontier_complement frontier_subset_eq[of "- S"]
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2559
  unfolding open_closed by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2560
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2561
lemma frontier_UNIV [simp]: "frontier UNIV = {}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2562
  using frontier_complement frontier_empty by fastforce
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2563
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2564
lemma frontier_interiors: "frontier s = - interior(s) - interior(-s)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2565
  by (simp add: Int_commute frontier_def interior_closure)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2566
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2567
lemma frontier_interior_subset: "frontier(interior S) \<subseteq> frontier S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2568
  by (simp add: Diff_mono frontier_interiors interior_mono interior_subset)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2569
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2570
lemma connected_Int_frontier:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2571
     "\<lbrakk>connected s; s \<inter> t \<noteq> {}; s - t \<noteq> {}\<rbrakk> \<Longrightarrow> (s \<inter> frontier t \<noteq> {})"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2572
  apply (simp add: frontier_interiors connected_openin, safe)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2573
  apply (drule_tac x="s \<inter> interior t" in spec, safe)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2574
   apply (drule_tac [2] x="s \<inter> interior (-t)" in spec)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2575
   apply (auto simp: disjoint_eq_subset_Compl dest: interior_subset [THEN subsetD])
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2576
  done
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2577
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2578
lemma closure_Un_frontier: "closure S = S \<union> frontier S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2579
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2580
  have "S \<union> interior S = S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2581
    using interior_subset by auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2582
  then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2583
    using closure_subset by (auto simp: frontier_def)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2584
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2585
58757
7f4924f23158 tuned whitespace;
wenzelm
parents: 58184
diff changeset
  2586
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2587
subsection \<open>Filters and the ``eventually true'' quantifier\<close>
44081
730f7cced3a6 rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents: 44076
diff changeset
  2588
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2589
definition indirection :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> 'a filter"  (infixr "indirection" 70)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  2590
  where "a indirection v = at a within {b. \<exists>c\<ge>0. b - a = scaleR c v}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2591
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2592
text \<open>Identify Trivial limits, where we can't approach arbitrarily closely.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2593
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  2594
lemma trivial_limit_within: "trivial_limit (at a within S) \<longleftrightarrow> \<not> a islimpt S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2595
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2596
  assume "trivial_limit (at a within S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2597
  then show "\<not> a islimpt S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2598
    unfolding trivial_limit_def
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2599
    unfolding eventually_at_topological
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2600
    unfolding islimpt_def
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  2601
    apply (clarsimp simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2602
    apply (rename_tac T, rule_tac x=T in exI)
36358
246493d61204 define nets directly as filters, instead of as filter bases
huffman
parents: 36336
diff changeset
  2603
    apply (clarsimp, drule_tac x=y in bspec, simp_all)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2604
    done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2605
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2606
  assume "\<not> a islimpt S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2607
  then show "trivial_limit (at a within S)"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  2608
    unfolding trivial_limit_def eventually_at_topological islimpt_def
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  2609
    by metis
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2610
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2611
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2612
lemma trivial_limit_at_iff: "trivial_limit (at a) \<longleftrightarrow> \<not> a islimpt UNIV"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  2613
  using trivial_limit_within [of a UNIV] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2614
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2615
lemma trivial_limit_at: "\<not> trivial_limit (at a)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2616
  for a :: "'a::perfect_space"
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  2617
  by (rule at_neq_bot)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2618
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2619
lemma trivial_limit_at_infinity:
44081
730f7cced3a6 rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents: 44076
diff changeset
  2620
  "\<not> trivial_limit (at_infinity :: ('a::{real_normed_vector,perfect_space}) filter)"
36358
246493d61204 define nets directly as filters, instead of as filter bases
huffman
parents: 36336
diff changeset
  2621
  unfolding trivial_limit_def eventually_at_infinity
246493d61204 define nets directly as filters, instead of as filter bases
huffman
parents: 36336
diff changeset
  2622
  apply clarsimp
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2623
  apply (subgoal_tac "\<exists>x::'a. x \<noteq> 0", clarify)
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2624
   apply (rule_tac x="scaleR (b / norm x) x" in exI, simp)
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2625
  apply (cut_tac islimpt_UNIV [of "0::'a", unfolded islimpt_def])
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2626
  apply (drule_tac x=UNIV in spec, simp)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2627
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2628
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2629
lemma not_trivial_limit_within: "\<not> trivial_limit (at x within S) = (x \<in> closure (S - {x}))"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2630
  using islimpt_in_closure by (metis trivial_limit_within)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2631
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2632
lemma at_within_eq_bot_iff: "at c within A = bot \<longleftrightarrow> c \<notin> closure (A - {c})"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2633
  using not_trivial_limit_within[of c A] by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2634
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2635
text \<open>Some property holds "sufficiently close" to the limit point.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2636
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2637
lemma trivial_limit_eventually: "trivial_limit net \<Longrightarrow> eventually P net"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  2638
  by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2639
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2640
lemma trivial_limit_eq: "trivial_limit net \<longleftrightarrow> (\<forall>P. eventually P net)"
44342
8321948340ea redefine constant 'trivial_limit' as an abbreviation
huffman
parents: 44286
diff changeset
  2641
  by (simp add: filter_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2642
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2643
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2644
subsection \<open>Limits\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2645
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2646
lemma Lim: "(f \<longlongrightarrow> l) net \<longleftrightarrow> trivial_limit net \<or> (\<forall>e>0. eventually (\<lambda>x. dist (f x) l < e) net)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2647
  by (auto simp: tendsto_iff trivial_limit_eq)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2648
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2649
text \<open>Show that they yield usual definitions in the various cases.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2650
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2651
lemma Lim_within_le: "(f \<longlongrightarrow> l)(at a within S) \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2652
    (\<forall>e>0. \<exists>d>0. \<forall>x\<in>S. 0 < dist x a \<and> dist x a \<le> d \<longrightarrow> dist (f x) l < e)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2653
  by (auto simp: tendsto_iff eventually_at_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2654
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2655
lemma Lim_within: "(f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2656
    (\<forall>e >0. \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a  < d \<longrightarrow> dist (f x) l < e)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2657
  by (auto simp: tendsto_iff eventually_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2658
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2659
corollary Lim_withinI [intro?]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2660
  assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l \<le> e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2661
  shows "(f \<longlongrightarrow> l) (at a within S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2662
  apply (simp add: Lim_within, clarify)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2663
  apply (rule ex_forward [OF assms [OF half_gt_zero]], auto)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2664
  done
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2665
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2666
lemma Lim_at: "(f \<longlongrightarrow> l) (at a) \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2667
    (\<forall>e >0. \<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d  \<longrightarrow> dist (f x) l < e)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2668
  by (auto simp: tendsto_iff eventually_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2669
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2670
lemma Lim_at_infinity: "(f \<longlongrightarrow> l) at_infinity \<longleftrightarrow> (\<forall>e>0. \<exists>b. \<forall>x. norm x \<ge> b \<longrightarrow> dist (f x) l < e)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2671
  by (auto simp: tendsto_iff eventually_at_infinity)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2672
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2673
corollary Lim_at_infinityI [intro?]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2674
  assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>B. \<forall>x. norm x \<ge> B \<longrightarrow> dist (f x) l \<le> e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2675
  shows "(f \<longlongrightarrow> l) at_infinity"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2676
  apply (simp add: Lim_at_infinity, clarify)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  2677
  apply (rule ex_forward [OF assms [OF half_gt_zero]], auto)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2678
  done
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  2679
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2680
lemma Lim_eventually: "eventually (\<lambda>x. f x = l) net \<Longrightarrow> (f \<longlongrightarrow> l) net"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2681
  by (rule topological_tendstoI) (auto elim: eventually_mono)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2682
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2683
lemma Lim_transform_within_set:
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2684
  fixes a :: "'a::metric_space" and l :: "'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2685
  shows "\<lbrakk>(f \<longlongrightarrow> l) (at a within S); eventually (\<lambda>x. x \<in> S \<longleftrightarrow> x \<in> T) (at a)\<rbrakk>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2686
         \<Longrightarrow> (f \<longlongrightarrow> l) (at a within T)"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2687
apply (clarsimp simp: eventually_at Lim_within)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2688
apply (drule_tac x=e in spec, clarify)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2689
apply (rename_tac k)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2690
apply (rule_tac x="min d k" in exI, simp)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2691
done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2692
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2693
lemma Lim_transform_within_set_eq:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2694
  fixes a l :: "'a::real_normed_vector"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2695
  shows "eventually (\<lambda>x. x \<in> s \<longleftrightarrow> x \<in> t) (at a)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2696
         \<Longrightarrow> ((f \<longlongrightarrow> l) (at a within s) \<longleftrightarrow> (f \<longlongrightarrow> l) (at a within t))"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2697
  by (force intro: Lim_transform_within_set elim: eventually_mono)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2698
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2699
lemma Lim_transform_within_openin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2700
  fixes a :: "'a::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2701
  assumes f: "(f \<longlongrightarrow> l) (at a within T)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2702
    and "openin (subtopology euclidean T) S" "a \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2703
    and eq: "\<And>x. \<lbrakk>x \<in> S; x \<noteq> a\<rbrakk> \<Longrightarrow> f x = g x"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2704
  shows "(g \<longlongrightarrow> l) (at a within T)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2705
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2706
  obtain \<epsilon> where "0 < \<epsilon>" and \<epsilon>: "ball a \<epsilon> \<inter> T \<subseteq> S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2707
    using assms by (force simp: openin_contains_ball)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2708
  then have "a \<in> ball a \<epsilon>"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2709
    by simp
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2710
  show ?thesis
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2711
    by (rule Lim_transform_within [OF f \<open>0 < \<epsilon>\<close> eq]) (use \<epsilon> in \<open>auto simp: dist_commute subset_iff\<close>)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2712
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2713
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2714
lemma continuous_transform_within_openin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2715
  fixes a :: "'a::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2716
  assumes "continuous (at a within T) f"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2717
    and "openin (subtopology euclidean T) S" "a \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2718
    and eq: "\<And>x. x \<in> S \<Longrightarrow> f x = g x"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2719
  shows "continuous (at a within T) g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2720
  using assms by (simp add: Lim_transform_within_openin continuous_within)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2721
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2722
text \<open>The expected monotonicity property.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2723
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2724
lemma Lim_Un:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2725
  assumes "(f \<longlongrightarrow> l) (at x within S)" "(f \<longlongrightarrow> l) (at x within T)"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2726
  shows "(f \<longlongrightarrow> l) (at x within (S \<union> T))"
53860
f2d683432580 factor out new lemma
huffman
parents: 53859
diff changeset
  2727
  using assms unfolding at_within_union by (rule filterlim_sup)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2728
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2729
lemma Lim_Un_univ:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2730
  "(f \<longlongrightarrow> l) (at x within S) \<Longrightarrow> (f \<longlongrightarrow> l) (at x within T) \<Longrightarrow>
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2731
    S \<union> T = UNIV \<Longrightarrow> (f \<longlongrightarrow> l) (at x)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2732
  by (metis Lim_Un)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2733
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2734
text \<open>Interrelations between restricted and unrestricted limits.\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2735
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2736
lemma Lim_at_imp_Lim_at_within: "(f \<longlongrightarrow> l) (at x) \<Longrightarrow> (f \<longlongrightarrow> l) (at x within S)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2737
  by (metis order_refl filterlim_mono subset_UNIV at_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2738
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2739
lemma eventually_within_interior:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2740
  assumes "x \<in> interior S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2741
  shows "eventually P (at x within S) \<longleftrightarrow> eventually P (at x)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2742
  (is "?lhs = ?rhs")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2743
proof
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2744
  from assms obtain T where T: "open T" "x \<in> T" "T \<subseteq> S" ..
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2745
  {
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2746
    assume ?lhs
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2747
    then obtain A where "open A" and "x \<in> A" and "\<forall>y\<in>A. y \<noteq> x \<longrightarrow> y \<in> S \<longrightarrow> P y"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2748
      by (auto simp: eventually_at_topological)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2749
    with T have "open (A \<inter> T)" and "x \<in> A \<inter> T" and "\<forall>y \<in> A \<inter> T. y \<noteq> x \<longrightarrow> P y"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2750
      by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2751
    then show ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2752
      by (auto simp: eventually_at_topological)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2753
  next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2754
    assume ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2755
    then show ?lhs
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  2756
      by (auto elim: eventually_mono simp: eventually_at_filter)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  2757
  }
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2758
qed
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2759
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2760
lemma at_within_interior: "x \<in> interior S \<Longrightarrow> at x within S = at x"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2761
  unfolding filter_eq_iff by (intro allI eventually_within_interior)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2762
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2763
lemma Lim_within_LIMSEQ:
53862
cb1094587ee4 generalize lemma
huffman
parents: 53861
diff changeset
  2764
  fixes a :: "'a::first_countable_topology"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  2765
  assumes "\<forall>S. (\<forall>n. S n \<noteq> a \<and> S n \<in> T) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. X (S n)) \<longlonglongrightarrow> L"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2766
  shows "(X \<longlongrightarrow> L) (at a within T)"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  2767
  using assms unfolding tendsto_def [where l=L]
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  2768
  by (simp add: sequentially_imp_eventually_within)
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2769
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2770
lemma Lim_right_bound:
51773
9328c6681f3c spell conditional_ly_-complete lattices correct
hoelzl
parents: 51641
diff changeset
  2771
  fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder, no_top} \<Rightarrow>
9328c6681f3c spell conditional_ly_-complete lattices correct
hoelzl
parents: 51641
diff changeset
  2772
    'b::{linorder_topology, conditionally_complete_linorder}"
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2773
  assumes mono: "\<And>a b. a \<in> I \<Longrightarrow> b \<in> I \<Longrightarrow> x < a \<Longrightarrow> a \<le> b \<Longrightarrow> f a \<le> f b"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2774
    and bnd: "\<And>a. a \<in> I \<Longrightarrow> x < a \<Longrightarrow> K \<le> f a"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2775
  shows "(f \<longlongrightarrow> Inf (f ` ({x<..} \<inter> I))) (at x within ({x<..} \<inter> I))"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2776
proof (cases "{x<..} \<inter> I = {}")
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2777
  case True
53859
e6cb01686f7b replace lemma with more general simp rule
huffman
parents: 53813
diff changeset
  2778
  then show ?thesis by simp
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2779
next
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2780
  case False
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2781
  show ?thesis
51518
6a56b7088a6a separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents: 51481
diff changeset
  2782
  proof (rule order_tendstoI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2783
    fix a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2784
    assume a: "a < Inf (f ` ({x<..} \<inter> I))"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2785
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2786
      fix y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2787
      assume "y \<in> {x<..} \<inter> I"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2788
      with False bnd have "Inf (f ` ({x<..} \<inter> I)) \<le> f y"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  2789
        by (auto intro!: cInf_lower bdd_belowI2)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2790
      with a have "a < f y"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2791
        by (blast intro: less_le_trans)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2792
    }
51518
6a56b7088a6a separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents: 51481
diff changeset
  2793
    then show "eventually (\<lambda>x. a < f x) (at x within ({x<..} \<inter> I))"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2794
      by (auto simp: eventually_at_filter intro: exI[of _ 1] zero_less_one)
51518
6a56b7088a6a separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents: 51481
diff changeset
  2795
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2796
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2797
    assume "Inf (f ` ({x<..} \<inter> I)) < a"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2798
    from cInf_lessD[OF _ this] False obtain y where y: "x < y" "y \<in> I" "f y < a"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2799
      by auto
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2800
    then have "eventually (\<lambda>x. x \<in> I \<longrightarrow> f x < a) (at_right x)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2801
      unfolding eventually_at_right[OF \<open>x < y\<close>] by (metis less_imp_le le_less_trans mono)
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2802
    then show "eventually (\<lambda>x. f x < a) (at x within ({x<..} \<inter> I))"
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2803
      unfolding eventually_at_filter by eventually_elim simp
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2804
  qed
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2805
qed
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  2806
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2807
text \<open>Another limit point characterization.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2808
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2809
lemma limpt_sequential_inj:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2810
  fixes x :: "'a::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2811
  shows "x islimpt S \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2812
         (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> inj f \<and> (f \<longlongrightarrow> x) sequentially)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2813
         (is "?lhs = ?rhs")
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2814
proof
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2815
  assume ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2816
  then have "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2817
    by (force simp: islimpt_approachable)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2818
  then obtain y where y: "\<And>e. e>0 \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2819
    by metis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2820
  define f where "f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse(2 ^ (Suc n))) (dist fn x)))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2821
  have [simp]: "f 0 = y 1"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2822
               "f(Suc n) = y (min (inverse(2 ^ (Suc n))) (dist (f n) x))" for n
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2823
    by (simp_all add: f_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2824
  have f: "f n \<in> S \<and> (f n \<noteq> x) \<and> dist (f n) x < inverse(2 ^ n)" for n
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2825
  proof (induction n)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2826
    case 0 show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2827
      by (simp add: y)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2828
  next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2829
    case (Suc n) then show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2830
      apply (auto simp: y)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2831
      by (metis half_gt_zero_iff inverse_positive_iff_positive less_divide_eq_numeral1(1) min_less_iff_conj y zero_less_dist_iff zero_less_numeral zero_less_power)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2832
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2833
  show ?rhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2834
  proof (rule_tac x=f in exI, intro conjI allI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2835
    show "\<And>n. f n \<in> S - {x}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2836
      using f by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2837
    have "dist (f n) x < dist (f m) x" if "m < n" for m n
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2838
    using that
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2839
    proof (induction n)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2840
      case 0 then show ?case by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2841
    next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2842
      case (Suc n)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2843
      then consider "m < n" | "m = n" using less_Suc_eq by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2844
      then show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2845
      proof cases
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2846
        assume "m < n"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2847
        have "dist (f(Suc n)) x = dist (y (min (inverse(2 ^ (Suc n))) (dist (f n) x))) x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2848
          by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2849
        also have "... < dist (f n) x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2850
          by (metis dist_pos_lt f min.strict_order_iff min_less_iff_conj y)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2851
        also have "... < dist (f m) x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2852
          using Suc.IH \<open>m < n\<close> by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2853
        finally show ?thesis .
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2854
      next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2855
        assume "m = n" then show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2856
          by simp (metis dist_pos_lt f half_gt_zero_iff inverse_positive_iff_positive min_less_iff_conj y zero_less_numeral zero_less_power)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2857
      qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2858
    qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2859
    then show "inj f"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2860
      by (metis less_irrefl linorder_injI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2861
    show "f \<longlonglongrightarrow> x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2862
      apply (rule tendstoI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2863
      apply (rule_tac c="nat (ceiling(1/e))" in eventually_sequentiallyI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2864
      apply (rule less_trans [OF f [THEN conjunct2, THEN conjunct2]])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2865
      apply (simp add: field_simps)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2866
      by (meson le_less_trans mult_less_cancel_left not_le of_nat_less_two_power)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2867
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2868
next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2869
  assume ?rhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2870
  then show ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2871
    by (fastforce simp add: islimpt_approachable lim_sequentially)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2872
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2873
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2874
(*could prove directly from islimpt_sequential_inj, but only for metric spaces*)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2875
lemma islimpt_sequential:
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2876
  fixes x :: "'a::first_countable_topology"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2877
  shows "x islimpt S \<longleftrightarrow> (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> (f \<longlongrightarrow> x) sequentially)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2878
    (is "?lhs = ?rhs")
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2879
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2880
  assume ?lhs
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  2881
  from countable_basis_at_decseq[of x] obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  2882
      "\<And>i. open (A i)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  2883
      "\<And>i. x \<in> A i"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  2884
      "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  2885
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  2886
  define f where "f n = (SOME y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y)" for n
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2887
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2888
    fix n
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2889
    from \<open>?lhs\<close> have "\<exists>y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2890
      unfolding islimpt_def using A(1,2)[of n] by auto
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2891
    then have "f n \<in> S \<and> f n \<in> A n \<and> x \<noteq> f n"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2892
      unfolding f_def by (rule someI_ex)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2893
    then have "f n \<in> S" "f n \<in> A n" "x \<noteq> f n" by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2894
  }
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2895
  then have "\<forall>n. f n \<in> S - {x}" by auto
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  2896
  moreover have "(\<lambda>n. f n) \<longlonglongrightarrow> x"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2897
  proof (rule topological_tendstoI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2898
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2899
    assume "open S" "x \<in> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2900
    from A(3)[OF this] \<open>\<And>n. f n \<in> A n\<close>
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2901
    show "eventually (\<lambda>x. f x \<in> S) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  2902
      by (auto elim!: eventually_mono)
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  2903
  qed
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  2904
  ultimately show ?rhs by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2905
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2906
  assume ?rhs
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  2907
  then obtain f :: "nat \<Rightarrow> 'a" where f: "\<And>n. f n \<in> S - {x}" and lim: "f \<longlonglongrightarrow> x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2908
    by auto
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2909
  show ?lhs
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2910
    unfolding islimpt_def
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2911
  proof safe
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2912
    fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2913
    assume "open T" "x \<in> T"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2914
    from lim[THEN topological_tendstoD, OF this] f
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2915
    show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2916
      unfolding eventually_sequentially by auto
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  2917
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2918
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2919
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2920
lemma Lim_null:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2921
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2922
  shows "(f \<longlongrightarrow> l) net \<longleftrightarrow> ((\<lambda>x. f(x) - l) \<longlongrightarrow> 0) net"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2923
  by (simp add: Lim dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2924
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2925
lemma Lim_null_comparison:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2926
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2927
  assumes "eventually (\<lambda>x. norm (f x) \<le> g x) net" "(g \<longlongrightarrow> 0) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2928
  shows "(f \<longlongrightarrow> 0) net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2929
  using assms(2)
44252
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  2930
proof (rule metric_tendsto_imp_tendsto)
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  2931
  show "eventually (\<lambda>x. dist (f x) 0 \<le> dist (g x) 0) net"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  2932
    using assms(1) by (rule eventually_mono) (simp add: dist_norm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2933
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2934
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2935
lemma Lim_transform_bound:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2936
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2937
    and g :: "'a \<Rightarrow> 'c::real_normed_vector"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  2938
  assumes "eventually (\<lambda>n. norm (f n) \<le> norm (g n)) net"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2939
    and "(g \<longlongrightarrow> 0) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  2940
  shows "(f \<longlongrightarrow> 0) net"
44252
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  2941
  using assms(1) tendsto_norm_zero [OF assms(2)]
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  2942
  by (rule Lim_null_comparison)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2943
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2944
lemma lim_null_mult_right_bounded:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2945
  fixes f :: "'a \<Rightarrow> 'b::real_normed_div_algebra"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2946
  assumes f: "(f \<longlongrightarrow> 0) F" and g: "eventually (\<lambda>x. norm(g x) \<le> B) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2947
    shows "((\<lambda>z. f z * g z) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2948
proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2949
  have *: "((\<lambda>x. norm (f x) * B) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2950
    by (simp add: f tendsto_mult_left_zero tendsto_norm_zero)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2951
  have "((\<lambda>x. norm (f x) * norm (g x)) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2952
    apply (rule Lim_null_comparison [OF _ *])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2953
    apply (simp add: eventually_mono [OF g] mult_left_mono)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2954
    done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2955
  then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2956
    by (subst tendsto_norm_zero_iff [symmetric]) (simp add: norm_mult)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2957
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2958
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2959
lemma lim_null_mult_left_bounded:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2960
  fixes f :: "'a \<Rightarrow> 'b::real_normed_div_algebra"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2961
  assumes g: "eventually (\<lambda>x. norm(g x) \<le> B) F" and f: "(f \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2962
    shows "((\<lambda>z. g z * f z) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2963
proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2964
  have *: "((\<lambda>x. B * norm (f x)) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2965
    by (simp add: f tendsto_mult_right_zero tendsto_norm_zero)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2966
  have "((\<lambda>x. norm (g x) * norm (f x)) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2967
    apply (rule Lim_null_comparison [OF _ *])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2968
    apply (simp add: eventually_mono [OF g] mult_right_mono)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2969
    done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2970
  then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2971
    by (subst tendsto_norm_zero_iff [symmetric]) (simp add: norm_mult)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2972
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2973
63128
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2974
lemma lim_null_scaleR_bounded:
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2975
  assumes f: "(f \<longlongrightarrow> 0) net" and gB: "eventually (\<lambda>a. f a = 0 \<or> norm(g a) \<le> B) net"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2976
    shows "((\<lambda>n. f n *\<^sub>R g n) \<longlongrightarrow> 0) net"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2977
proof
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2978
  fix \<epsilon>::real
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2979
  assume "0 < \<epsilon>"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2980
  then have B: "0 < \<epsilon> / (abs B + 1)" by simp
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2981
  have *: "\<bar>f x\<bar> * norm (g x) < \<epsilon>" if f: "\<bar>f x\<bar> * (\<bar>B\<bar> + 1) < \<epsilon>" and g: "norm (g x) \<le> B" for x
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2982
  proof -
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2983
    have "\<bar>f x\<bar> * norm (g x) \<le> \<bar>f x\<bar> * B"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2984
      by (simp add: mult_left_mono g)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2985
    also have "... \<le> \<bar>f x\<bar> * (\<bar>B\<bar> + 1)"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2986
      by (simp add: mult_left_mono)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2987
    also have "... < \<epsilon>"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2988
      by (rule f)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2989
    finally show ?thesis .
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2990
  qed
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2991
  show "\<forall>\<^sub>F x in net. dist (f x *\<^sub>R g x) 0 < \<epsilon>"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2992
    apply (rule eventually_mono [OF eventually_conj [OF tendstoD [OF f B] gB] ])
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2993
    apply (auto simp: \<open>0 < \<epsilon>\<close> divide_simps * split: if_split_asm)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2994
    done
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2995
qed
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  2996
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2997
text\<open>Deducing things about the limit from the elements.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2998
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2999
lemma Lim_in_closed_set:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3000
  assumes "closed S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3001
    and "eventually (\<lambda>x. f(x) \<in> S) net"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3002
    and "\<not> trivial_limit net" "(f \<longlongrightarrow> l) net"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3003
  shows "l \<in> S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3004
proof (rule ccontr)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3005
  assume "l \<notin> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3006
  with \<open>closed S\<close> have "open (- S)" "l \<in> - S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3007
    by (simp_all add: open_Compl)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3008
  with assms(4) have "eventually (\<lambda>x. f x \<in> - S) net"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3009
    by (rule topological_tendstoD)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3010
  with assms(2) have "eventually (\<lambda>x. False) net"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3011
    by (rule eventually_elim2) simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3012
  with assms(3) show "False"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3013
    by (simp add: eventually_False)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3014
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3015
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3016
text\<open>Need to prove closed(cball(x,e)) before deducing this as a corollary.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3017
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3018
lemma Lim_dist_ubound:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3019
  assumes "\<not>(trivial_limit net)"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3020
    and "(f \<longlongrightarrow> l) net"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3021
    and "eventually (\<lambda>x. dist a (f x) \<le> e) net"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3022
  shows "dist a l \<le> e"
56290
801a72ad52d3 tuned proofs
huffman
parents: 56189
diff changeset
  3023
  using assms by (fast intro: tendsto_le tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3024
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3025
lemma Lim_norm_ubound:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3026
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3027
  assumes "\<not>(trivial_limit net)" "(f \<longlongrightarrow> l) net" "eventually (\<lambda>x. norm(f x) \<le> e) net"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3028
  shows "norm(l) \<le> e"
56290
801a72ad52d3 tuned proofs
huffman
parents: 56189
diff changeset
  3029
  using assms by (fast intro: tendsto_le tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3030
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3031
lemma Lim_norm_lbound:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3032
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3033
  assumes "\<not> trivial_limit net"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3034
    and "(f \<longlongrightarrow> l) net"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3035
    and "eventually (\<lambda>x. e \<le> norm (f x)) net"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3036
  shows "e \<le> norm l"
56290
801a72ad52d3 tuned proofs
huffman
parents: 56189
diff changeset
  3037
  using assms by (fast intro: tendsto_le tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3038
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3039
text\<open>Limit under bilinear function\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3040
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3041
lemma Lim_bilinear:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3042
  assumes "(f \<longlongrightarrow> l) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3043
    and "(g \<longlongrightarrow> m) net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3044
    and "bounded_bilinear h"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3045
  shows "((\<lambda>x. h (f x) (g x)) \<longlongrightarrow> (h l m)) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3046
  using \<open>bounded_bilinear h\<close> \<open>(f \<longlongrightarrow> l) net\<close> \<open>(g \<longlongrightarrow> m) net\<close>
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3047
  by (rule bounded_bilinear.tendsto)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3048
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3049
text\<open>These are special for limits out of the same vector space.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3050
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3051
lemma Lim_within_id: "(id \<longlongrightarrow> a) (at a within s)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3052
  unfolding id_def by (rule tendsto_ident_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3053
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3054
lemma Lim_at_id: "(id \<longlongrightarrow> a) (at a)"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  3055
  unfolding id_def by (rule tendsto_ident_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3056
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3057
lemma Lim_at_zero:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3058
  fixes a :: "'a::real_normed_vector"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3059
    and l :: "'b::topological_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3060
  shows "(f \<longlongrightarrow> l) (at a) \<longleftrightarrow> ((\<lambda>x. f(a + x)) \<longlongrightarrow> l) (at 0)"
44252
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  3061
  using LIM_offset_zero LIM_offset_zero_cancel ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3062
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3063
text\<open>It's also sometimes useful to extract the limit point from the filter.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3064
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3065
abbreviation netlimit :: "'a::t2_space filter \<Rightarrow> 'a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3066
  where "netlimit F \<equiv> Lim F (\<lambda>x. x)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3067
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3068
lemma netlimit_within: "\<not> trivial_limit (at a within S) \<Longrightarrow> netlimit (at a within S) = a"
51365
6b5250100db8 netlimit is abbreviation for Lim
hoelzl
parents: 51364
diff changeset
  3069
  by (rule tendsto_Lim) (auto intro: tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3070
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3071
lemma netlimit_at:
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  3072
  fixes a :: "'a::{perfect_space,t2_space}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3073
  shows "netlimit (at a) = a"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  3074
  using netlimit_within [of a UNIV] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3075
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3076
lemma lim_within_interior:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3077
  "x \<in> interior S \<Longrightarrow> (f \<longlongrightarrow> l) (at x within S) \<longleftrightarrow> (f \<longlongrightarrow> l) (at x)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3078
  by (metis at_within_interior)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3079
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3080
lemma netlimit_within_interior:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3081
  fixes x :: "'a::{t2_space,perfect_space}"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3082
  assumes "x \<in> interior S"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3083
  shows "netlimit (at x within S) = x"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3084
  using assms by (metis at_within_interior netlimit_at)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3085
61824
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3086
lemma netlimit_at_vector:
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3087
  fixes a :: "'a::real_normed_vector"
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3088
  shows "netlimit (at a) = a"
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3089
proof (cases "\<exists>x. x \<noteq> a")
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3090
  case True then obtain x where x: "x \<noteq> a" ..
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3091
  have "\<not> trivial_limit (at a)"
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3092
    unfolding trivial_limit_def eventually_at dist_norm
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3093
    apply clarsimp
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3094
    apply (rule_tac x="a + scaleR (d / 2) (sgn (x - a))" in exI)
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3095
    apply (simp add: norm_sgn sgn_zero_iff x)
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3096
    done
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3097
  then show ?thesis
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3098
    by (rule netlimit_within [of a UNIV])
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3099
qed simp
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3100
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3101
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3102
text\<open>Useful lemmas on closure and set of possible sequential limits.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3103
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3104
lemma closure_sequential:
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3105
  fixes l :: "'a::first_countable_topology"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3106
  shows "l \<in> closure S \<longleftrightarrow> (\<exists>x. (\<forall>n. x n \<in> S) \<and> (x \<longlongrightarrow> l) sequentially)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3107
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3108
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3109
  assume "?lhs"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3110
  moreover
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3111
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3112
    assume "l \<in> S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3113
    then have "?rhs" using tendsto_const[of l sequentially] by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3114
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3115
  moreover
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3116
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3117
    assume "l islimpt S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3118
    then have "?rhs" unfolding islimpt_sequential by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3119
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3120
  ultimately show "?rhs"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3121
    unfolding closure_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3122
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3123
  assume "?rhs"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3124
  then show "?lhs" unfolding closure_def islimpt_sequential by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3125
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3126
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3127
lemma closed_sequential_limits:
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3128
  fixes S :: "'a::first_countable_topology set"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3129
  shows "closed S \<longleftrightarrow> (\<forall>x l. (\<forall>n. x n \<in> S) \<and> (x \<longlongrightarrow> l) sequentially \<longrightarrow> l \<in> S)"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  3130
by (metis closure_sequential closure_subset_eq subset_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3131
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3132
lemma closure_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3133
  fixes S :: "'a::metric_space set"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3134
  shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3135
  apply (auto simp: closure_def islimpt_approachable)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3136
  apply (metis dist_self)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3137
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3138
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3139
lemma closure_approachable_le:
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3140
  fixes S :: "'a::metric_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3141
  shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x \<le> e)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3142
  unfolding closure_approachable
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3143
  using dense by force
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3144
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3145
lemma closed_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3146
  fixes S :: "'a::metric_space set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3147
  shows "closed S \<Longrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) \<longleftrightarrow> x \<in> S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3148
  by (metis closure_closed closure_approachable)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3149
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3150
lemma closure_contains_Inf:
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3151
  fixes S :: "real set"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3152
  assumes "S \<noteq> {}" "bdd_below S"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3153
  shows "Inf S \<in> closure S"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3154
proof -
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3155
  have *: "\<forall>x\<in>S. Inf S \<le> x"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3156
    using cInf_lower[of _ S] assms by metis
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3157
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3158
    fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3159
    assume "e > 0"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3160
    then have "Inf S < Inf S + e" by simp
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3161
    with assms obtain x where "x \<in> S" "x < Inf S + e"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3162
      by (subst (asm) cInf_less_iff) auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3163
    with * have "\<exists>x\<in>S. dist x (Inf S) < e"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3164
      by (intro bexI[of _ x]) (auto simp: dist_real_def)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3165
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3166
  then show ?thesis unfolding closure_approachable by auto
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3167
qed
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3168
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3169
lemma closure_Int_ballI:
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3170
  fixes S :: "'a :: metric_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3171
  assumes "\<And>U. \<lbrakk>openin (subtopology euclidean S) U; U \<noteq> {}\<rbrakk> \<Longrightarrow> T \<inter> U \<noteq> {}"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3172
 shows "S \<subseteq> closure T"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3173
proof (clarsimp simp: closure_approachable dist_commute)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3174
  fix x and e::real
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3175
  assume "x \<in> S" "0 < e"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3176
  with assms [of "S \<inter> ball x e"] show "\<exists>y\<in>T. dist x y < e"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3177
    by force
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3178
qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3179
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3180
lemma closed_contains_Inf:
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3181
  fixes S :: "real set"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3182
  shows "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> closed S \<Longrightarrow> Inf S \<in> S"
63092
a949b2a5f51d eliminated use of empty "assms";
wenzelm
parents: 63075
diff changeset
  3183
  by (metis closure_contains_Inf closure_closed)
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3184
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3185
lemma closed_subset_contains_Inf:
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3186
  fixes A C :: "real set"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3187
  shows "closed C \<Longrightarrow> A \<subseteq> C \<Longrightarrow> A \<noteq> {} \<Longrightarrow> bdd_below A \<Longrightarrow> Inf A \<in> C"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3188
  by (metis closure_contains_Inf closure_minimal subset_eq)
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3189
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3190
lemma atLeastAtMost_subset_contains_Inf:
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3191
  fixes A :: "real set" and a b :: real
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3192
  shows "A \<noteq> {} \<Longrightarrow> a \<le> b \<Longrightarrow> A \<subseteq> {a..b} \<Longrightarrow> Inf A \<in> {a..b}"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3193
  by (rule closed_subset_contains_Inf)
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3194
     (auto intro: closed_real_atLeastAtMost intro!: bdd_belowI[of A a])
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3195
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3196
lemma not_trivial_limit_within_ball:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3197
  "\<not> trivial_limit (at x within S) \<longleftrightarrow> (\<forall>e>0. S \<inter> ball x e - {x} \<noteq> {})"
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3198
  (is "?lhs \<longleftrightarrow> ?rhs")
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3199
proof
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3200
  show ?rhs if ?lhs
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3201
  proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3202
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3203
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3204
      assume "e > 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3205
      then obtain y where "y \<in> S - {x}" and "dist y x < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3206
        using \<open>?lhs\<close> not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"]
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3207
        by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3208
      then have "y \<in> S \<inter> ball x e - {x}"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3209
        unfolding ball_def by (simp add: dist_commute)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3210
      then have "S \<inter> ball x e - {x} \<noteq> {}" by blast
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3211
    }
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3212
    then show ?thesis by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3213
  qed
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3214
  show ?lhs if ?rhs
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3215
  proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3216
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3217
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3218
      assume "e > 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3219
      then obtain y where "y \<in> S \<inter> ball x e - {x}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3220
        using \<open>?rhs\<close> by blast
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3221
      then have "y \<in> S - {x}" and "dist y x < e"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3222
        unfolding ball_def by (simp_all add: dist_commute)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3223
      then have "\<exists>y \<in> S - {x}. dist y x < e"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3224
        by auto
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3225
    }
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3226
    then show ?thesis
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3227
      using not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3228
      by auto
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3229
  qed
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3230
qed
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3231
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3232
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3233
subsection \<open>Boundedness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3234
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3235
  (* FIXME: This has to be unified with BSEQ!! *)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3236
definition (in metric_space) bounded :: "'a set \<Rightarrow> bool"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3237
  where "bounded S \<longleftrightarrow> (\<exists>x e. \<forall>y\<in>S. dist x y \<le> e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3238
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3239
lemma bounded_subset_cball: "bounded S \<longleftrightarrow> (\<exists>e x. S \<subseteq> cball x e \<and> 0 \<le> e)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3240
  unfolding bounded_def subset_eq  by auto (meson order_trans zero_le_dist)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3241
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3242
lemma bounded_any_center: "bounded S \<longleftrightarrow> (\<exists>e. \<forall>y\<in>S. dist a y \<le> e)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3243
  unfolding bounded_def
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57448
diff changeset
  3244
  by auto (metis add.commute add_le_cancel_right dist_commute dist_triangle_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3245
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3246
lemma bounded_iff: "bounded S \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. norm x \<le> a)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3247
  unfolding bounded_any_center [where a=0]
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3248
  by (simp add: dist_norm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3249
61552
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
  3250
lemma bdd_above_norm: "bdd_above (norm ` X) \<longleftrightarrow> bounded X"
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
  3251
  by (simp add: bounded_iff bdd_above_def)
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
  3252
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3253
lemma bounded_norm_comp: "bounded ((\<lambda>x. norm (f x)) ` S) = bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3254
  by (simp add: bounded_iff)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3255
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  3256
lemma boundedI:
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  3257
  assumes "\<And>x. x \<in> S \<Longrightarrow> norm x \<le> B"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  3258
  shows "bounded S"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  3259
  using assms bounded_iff by blast
50104
de19856feb54 move theorems to be more generally useable
hoelzl
parents: 50094
diff changeset
  3260
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3261
lemma bounded_empty [simp]: "bounded {}"
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3262
  by (simp add: bounded_def)
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3263
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3264
lemma bounded_subset: "bounded T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> bounded S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3265
  by (metis bounded_def subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3266
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3267
lemma bounded_interior[intro]: "bounded S \<Longrightarrow> bounded(interior S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3268
  by (metis bounded_subset interior_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3269
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3270
lemma bounded_closure[intro]:
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3271
  assumes "bounded S"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3272
  shows "bounded (closure S)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3273
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3274
  from assms obtain x and a where a: "\<forall>y\<in>S. dist x y \<le> a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3275
    unfolding bounded_def by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3276
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3277
    fix y
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3278
    assume "y \<in> closure S"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3279
    then obtain f where f: "\<forall>n. f n \<in> S"  "(f \<longlongrightarrow> y) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3280
      unfolding closure_sequential by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3281
    have "\<forall>n. f n \<in> S \<longrightarrow> dist x (f n) \<le> a" using a by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3282
    then have "eventually (\<lambda>n. dist x (f n) \<le> a) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  3283
      by (simp add: f(1))
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3284
    have "dist x y \<le> a"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3285
      apply (rule Lim_dist_ubound [of sequentially f])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3286
      apply (rule trivial_limit_sequentially)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3287
      apply (rule f(2))
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3288
      apply fact
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3289
      done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3290
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3291
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3292
    unfolding bounded_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3293
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3294
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  3295
lemma bounded_closure_image: "bounded (f ` closure S) \<Longrightarrow> bounded (f ` S)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  3296
  by (simp add: bounded_subset closure_subset image_mono)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  3297
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3298
lemma bounded_cball[simp,intro]: "bounded (cball x e)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3299
  apply (simp add: bounded_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3300
  apply (rule_tac x=x in exI)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3301
  apply (rule_tac x=e in exI, auto)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3302
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3303
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3304
lemma bounded_ball[simp,intro]: "bounded (ball x e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3305
  by (metis ball_subset_cball bounded_cball bounded_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3306
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3307
lemma bounded_Un[simp]: "bounded (S \<union> T) \<longleftrightarrow> bounded S \<and> bounded T"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3308
  by (auto simp: bounded_def) (metis Un_iff bounded_any_center le_max_iff_disj)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3309
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3310
lemma bounded_Union[intro]: "finite F \<Longrightarrow> \<forall>S\<in>F. bounded S \<Longrightarrow> bounded (\<Union>F)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3311
  by (induct rule: finite_induct[of F]) auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3312
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  3313
lemma bounded_UN [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. bounded (B x) \<Longrightarrow> bounded (\<Union>x\<in>A. B x)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3314
  by (induct set: finite) auto
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  3315
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3316
lemma bounded_insert [simp]: "bounded (insert x S) \<longleftrightarrow> bounded S"
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3317
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3318
  have "\<forall>y\<in>{x}. dist x y \<le> 0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3319
    by simp
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3320
  then have "bounded {x}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3321
    unfolding bounded_def by fast
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3322
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3323
    by (metis insert_is_Un bounded_Un)
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3324
qed
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3325
65587
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3326
lemma bounded_subset_ballI: "S \<subseteq> ball x r \<Longrightarrow> bounded S"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3327
  by (meson bounded_ball bounded_subset)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3328
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3329
lemma bounded_subset_ballD:
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3330
  assumes "bounded S" shows "\<exists>r. 0 < r \<and> S \<subseteq> ball x r"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3331
proof -
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3332
  obtain e::real and y where "S \<subseteq> cball y e"  "0 \<le> e"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3333
    using assms by (auto simp: bounded_subset_cball)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3334
  then show ?thesis
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3335
    apply (rule_tac x="dist x y + e + 1" in exI)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3336
    apply (simp add: add.commute add_pos_nonneg)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3337
    apply (erule subset_trans)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3338
    apply (clarsimp simp add: cball_def)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3339
    by (metis add_le_cancel_right add_strict_increasing dist_commute dist_triangle_le zero_less_one)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3340
qed
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  3341
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3342
lemma finite_imp_bounded [intro]: "finite S \<Longrightarrow> bounded S"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3343
  by (induct set: finite) simp_all
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  3344
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3345
lemma bounded_pos: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x \<le> b)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3346
  apply (simp add: bounded_iff)
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  3347
  apply (subgoal_tac "\<And>x (y::real). 0 < 1 + \<bar>y\<bar> \<and> (x \<le> y \<longrightarrow> x \<le> 1 + \<bar>y\<bar>)")
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3348
  apply metis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3349
  apply arith
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3350
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3351
60762
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  3352
lemma bounded_pos_less: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x < b)"
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  3353
  apply (simp add: bounded_pos)
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  3354
  apply (safe; rule_tac x="b+1" in exI; force)
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  3355
  done
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  3356
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3357
lemma Bseq_eq_bounded:
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3358
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3359
  shows "Bseq f \<longleftrightarrow> bounded (range f)"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  3360
  unfolding Bseq_def bounded_pos by auto
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  3361
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3362
lemma bounded_Int[intro]: "bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3363
  by (metis Int_lower1 Int_lower2 bounded_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3364
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3365
lemma bounded_diff[intro]: "bounded S \<Longrightarrow> bounded (S - T)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3366
  by (metis Diff_subset bounded_subset)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3367
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3368
lemma not_bounded_UNIV[simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3369
  "\<not> bounded (UNIV :: 'a::{real_normed_vector, perfect_space} set)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3370
proof (auto simp: bounded_pos not_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3371
  obtain x :: 'a where "x \<noteq> 0"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3372
    using perfect_choose_dist [OF zero_less_one] by fast
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3373
  fix b :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3374
  assume b: "b >0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3375
  have b1: "b +1 \<ge> 0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3376
    using b by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3377
  with \<open>x \<noteq> 0\<close> have "b < norm (scaleR (b + 1) (sgn x))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3378
    by (simp add: norm_sgn)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3379
  then show "\<exists>x::'a. b < norm x" ..
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3380
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3381
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3382
corollary cobounded_imp_unbounded:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3383
    fixes S :: "'a::{real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3384
    shows "bounded (- S) \<Longrightarrow> ~ (bounded S)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3385
  using bounded_Un [of S "-S"]  by (simp add: sup_compl_top)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  3386
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3387
lemma bounded_dist_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3388
  assumes "bounded (f ` S)" "bounded (g ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3389
  shows "bounded ((\<lambda>x. dist (f x) (g x)) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3390
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3391
  from assms obtain M1 M2 where *: "dist (f x) undefined \<le> M1" "dist undefined (g x) \<le> M2" if "x \<in> S" for x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3392
    by (auto simp: bounded_any_center[of _ undefined] dist_commute)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3393
  have "dist (f x) (g x) \<le> M1 + M2" if "x \<in> S" for x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3394
    using *[OF that]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3395
    by (rule order_trans[OF dist_triangle add_mono])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3396
  then show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3397
    by (auto intro!: boundedI)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3398
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3399
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3400
lemma bounded_linear_image:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3401
  assumes "bounded S"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3402
    and "bounded_linear f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3403
  shows "bounded (f ` S)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3404
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3405
  from assms(1) obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3406
    unfolding bounded_pos by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3407
  from assms(2) obtain B where B: "B > 0" "\<forall>x. norm (f x) \<le> B * norm x"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3408
    using bounded_linear.pos_bounded by (auto simp: ac_simps)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3409
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3410
    fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3411
    assume "x \<in> S"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3412
    then have "norm x \<le> b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3413
      using b by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3414
    then have "norm (f x) \<le> B * b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3415
      using B(2)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3416
      apply (erule_tac x=x in allE)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3417
      apply (metis B(1) B(2) order_trans mult_le_cancel_left_pos)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3418
      done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3419
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3420
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3421
    unfolding bounded_pos
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3422
    apply (rule_tac x="b*B" in exI)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3423
    using b B by (auto simp: mult.commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3424
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3425
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3426
lemma bounded_scaling:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3427
  fixes S :: "'a::real_normed_vector set"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3428
  shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. c *\<^sub>R x) ` S)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3429
  apply (rule bounded_linear_image, assumption)
44282
f0de18b62d63 remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents: 44252
diff changeset
  3430
  apply (rule bounded_linear_scaleR_right)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3431
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3432
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3433
lemma bounded_scaleR_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3434
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3435
  assumes "bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3436
  shows "bounded ((\<lambda>x. r *\<^sub>R f x) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3437
  using bounded_scaling[of "f ` S" r] assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3438
  by (auto simp: image_image)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3439
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3440
lemma bounded_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3441
  fixes S :: "'a::real_normed_vector set"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3442
  assumes "bounded S"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3443
  shows "bounded ((\<lambda>x. a + x) ` S)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3444
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3445
  from assms obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3446
    unfolding bounded_pos by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3447
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3448
    fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3449
    assume "x \<in> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3450
    then have "norm (a + x) \<le> b + norm a"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3451
      using norm_triangle_ineq[of a x] b by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3452
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3453
  then show ?thesis
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3454
    unfolding bounded_pos
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3455
    using norm_ge_zero[of a] b(1) and add_strict_increasing[of b 0 "norm a"]
48048
87b94fb75198 remove stray reference to no-longer-existing theorem 'add'
huffman
parents: 47108
diff changeset
  3456
    by (auto intro!: exI[of _ "b + norm a"])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3457
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3458
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3459
lemma bounded_translation_minus:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3460
  fixes S :: "'a::real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3461
  shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. x - a) ` S)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3462
using bounded_translation [of S "-a"] by simp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3463
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  3464
lemma bounded_uminus [simp]:
62466
87ca8b5145b8 generalized
immler
parents: 62397
diff changeset
  3465
  fixes X :: "'a::real_normed_vector set"
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  3466
  shows "bounded (uminus ` X) \<longleftrightarrow> bounded X"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3467
by (auto simp: bounded_def dist_norm; rule_tac x="-x" in exI; force simp: add.commute norm_minus_commute)
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  3468
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3469
lemma uminus_bounded_comp [simp]:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3470
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3471
  shows "bounded ((\<lambda>x. - f x) ` S) \<longleftrightarrow> bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3472
  using bounded_uminus[of "f ` S"]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3473
  by (auto simp: image_image)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3474
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3475
lemma bounded_plus_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3476
  fixes f g::"'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3477
  assumes "bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3478
  assumes "bounded (g ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3479
  shows "bounded ((\<lambda>x. f x + g x) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3480
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3481
  {
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3482
    fix B C
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3483
    assume "\<And>x. x\<in>S \<Longrightarrow> norm (f x) \<le> B" "\<And>x. x\<in>S \<Longrightarrow> norm (g x) \<le> C"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3484
    then have "\<And>x. x \<in> S \<Longrightarrow> norm (f x + g x) \<le> B + C"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3485
      by (auto intro!: norm_triangle_le add_mono)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3486
  } then show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3487
    using assms by (fastforce simp: bounded_iff)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3488
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3489
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3490
lemma bounded_minus_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3491
  "bounded (f ` S) \<Longrightarrow> bounded (g ` S) \<Longrightarrow> bounded ((\<lambda>x. f x - g x) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3492
  for f g::"'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3493
  using bounded_plus_comp[of "f" S "\<lambda>x. - g x"]
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3494
  by auto
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  3495
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  3496
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3497
subsection \<open>Compactness\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3498
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3499
subsubsection \<open>Bolzano-Weierstrass property\<close>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3500
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3501
lemma heine_borel_imp_bolzano_weierstrass:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3502
  assumes "compact s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3503
    and "infinite t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3504
    and "t \<subseteq> s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3505
  shows "\<exists>x \<in> s. x islimpt t"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3506
proof (rule ccontr)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3507
  assume "\<not> (\<exists>x \<in> s. x islimpt t)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3508
  then obtain f where f: "\<forall>x\<in>s. x \<in> f x \<and> open (f x) \<and> (\<forall>y\<in>t. y \<in> f x \<longrightarrow> y = x)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3509
    unfolding islimpt_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3510
    using bchoice[of s "\<lambda> x T. x \<in> T \<and> open T \<and> (\<forall>y\<in>t. y \<in> T \<longrightarrow> y = x)"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3511
    by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3512
  obtain g where g: "g \<subseteq> {t. \<exists>x. x \<in> s \<and> t = f x}" "finite g" "s \<subseteq> \<Union>g"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3513
    using assms(1)[unfolded compact_eq_heine_borel, THEN spec[where x="{t. \<exists>x. x\<in>s \<and> t = f x}"]]
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3514
    using f by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3515
  from g(1,3) have g':"\<forall>x\<in>g. \<exists>xa \<in> s. x = f xa"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3516
    by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3517
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3518
    fix x y
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3519
    assume "x \<in> t" "y \<in> t" "f x = f y"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3520
    then have "x \<in> f x"  "y \<in> f x \<longrightarrow> y = x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3521
      using f[THEN bspec[where x=x]] and \<open>t \<subseteq> s\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3522
    then have "x = y"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3523
      using \<open>f x = f y\<close> and f[THEN bspec[where x=y]] and \<open>y \<in> t\<close> and \<open>t \<subseteq> s\<close>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3524
      by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3525
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3526
  then have "inj_on f t"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3527
    unfolding inj_on_def by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3528
  then have "infinite (f ` t)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3529
    using assms(2) using finite_imageD by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3530
  moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3531
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3532
    fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3533
    assume "x \<in> t" "f x \<notin> g"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3534
    from g(3) assms(3) \<open>x \<in> t\<close> obtain h where "h \<in> g" and "x \<in> h"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3535
      by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3536
    then obtain y where "y \<in> s" "h = f y"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3537
      using g'[THEN bspec[where x=h]] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3538
    then have "y = x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3539
      using f[THEN bspec[where x=y]] and \<open>x\<in>t\<close> and \<open>x\<in>h\<close>[unfolded \<open>h = f y\<close>]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3540
      by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3541
    then have False
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3542
      using \<open>f x \<notin> g\<close> \<open>h \<in> g\<close> unfolding \<open>h = f y\<close>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3543
      by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3544
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3545
  then have "f ` t \<subseteq> g" by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3546
  ultimately show False
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3547
    using g(2) using finite_subset by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3548
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3549
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3550
lemma acc_point_range_imp_convergent_subsequence:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3551
  fixes l :: "'a :: first_countable_topology"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3552
  assumes l: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> range f)"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  3553
  shows "\<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3554
proof -
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3555
  from countable_basis_at_decseq[of l]
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3556
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3557
      "\<And>i. open (A i)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3558
      "\<And>i. l \<in> A i"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3559
      "\<And>S. open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3560
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3561
  define s where "s n i = (SOME j. i < j \<and> f j \<in> A (Suc n))" for n i
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3562
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3563
    fix n i
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3564
    have "infinite (A (Suc n) \<inter> range f - f`{.. i})"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3565
      using l A by auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3566
    then have "\<exists>x. x \<in> A (Suc n) \<inter> range f - f`{.. i}"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3567
      unfolding ex_in_conv by (intro notI) simp
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3568
    then have "\<exists>j. f j \<in> A (Suc n) \<and> j \<notin> {.. i}"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3569
      by auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3570
    then have "\<exists>a. i < a \<and> f a \<in> A (Suc n)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3571
      by (auto simp: not_le)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3572
    then have "i < s n i" "f (s n i) \<in> A (Suc n)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3573
      unfolding s_def by (auto intro: someI2_ex)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3574
  }
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3575
  note s = this
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3576
  define r where "r = rec_nat (s 0 0) s"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  3577
  have "strict_mono r"
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  3578
    by (auto simp: r_def s strict_mono_Suc_iff)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3579
  moreover
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  3580
  have "(\<lambda>n. f (r n)) \<longlonglongrightarrow> l"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3581
  proof (rule topological_tendstoI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3582
    fix S
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3583
    assume "open S" "l \<in> S"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3584
    with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3585
      by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3586
    moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3587
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3588
      fix i
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3589
      assume "Suc 0 \<le> i"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3590
      then have "f (r i) \<in> A i"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3591
        by (cases i) (simp_all add: r_def s)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3592
    }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3593
    then have "eventually (\<lambda>i. f (r i) \<in> A i) sequentially"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3594
      by (auto simp: eventually_sequentially)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3595
    ultimately show "eventually (\<lambda>i. f (r i) \<in> S) sequentially"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3596
      by eventually_elim auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3597
  qed
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  3598
  ultimately show "\<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3599
    by (auto simp: convergent_def comp_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3600
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3601
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3602
lemma sequence_infinite_lemma:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3603
  fixes f :: "nat \<Rightarrow> 'a::t1_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3604
  assumes "\<forall>n. f n \<noteq> l"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3605
    and "(f \<longlongrightarrow> l) sequentially"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3606
  shows "infinite (range f)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3607
proof
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3608
  assume "finite (range f)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3609
  then have "closed (range f)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3610
    by (rule finite_imp_closed)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3611
  then have "open (- range f)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3612
    by (rule open_Compl)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3613
  from assms(1) have "l \<in> - range f"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3614
    by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3615
  from assms(2) have "eventually (\<lambda>n. f n \<in> - range f) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3616
    using \<open>open (- range f)\<close> \<open>l \<in> - range f\<close>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3617
    by (rule topological_tendstoD)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3618
  then show False
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3619
    unfolding eventually_sequentially
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3620
    by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3621
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3622
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3623
lemma closure_insert:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3624
  fixes x :: "'a::t1_space"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3625
  shows "closure (insert x s) = insert x (closure s)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3626
  apply (rule closure_unique)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3627
  apply (rule insert_mono [OF closure_subset])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3628
  apply (rule closed_insert [OF closed_closure])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3629
  apply (simp add: closure_minimal)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3630
  done
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3631
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3632
lemma islimpt_insert:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3633
  fixes x :: "'a::t1_space"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3634
  shows "x islimpt (insert a s) \<longleftrightarrow> x islimpt s"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3635
proof
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3636
  assume *: "x islimpt (insert a s)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3637
  show "x islimpt s"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3638
  proof (rule islimptI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3639
    fix t
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3640
    assume t: "x \<in> t" "open t"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3641
    show "\<exists>y\<in>s. y \<in> t \<and> y \<noteq> x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3642
    proof (cases "x = a")
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3643
      case True
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3644
      obtain y where "y \<in> insert a s" "y \<in> t" "y \<noteq> x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3645
        using * t by (rule islimptE)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3646
      with \<open>x = a\<close> show ?thesis by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3647
    next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3648
      case False
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3649
      with t have t': "x \<in> t - {a}" "open (t - {a})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3650
        by (simp_all add: open_Diff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3651
      obtain y where "y \<in> insert a s" "y \<in> t - {a}" "y \<noteq> x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3652
        using * t' by (rule islimptE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3653
      then show ?thesis by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3654
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3655
  qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3656
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3657
  assume "x islimpt s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3658
  then show "x islimpt (insert a s)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3659
    by (rule islimpt_subset) auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3660
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3661
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  3662
lemma islimpt_finite:
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  3663
  fixes x :: "'a::t1_space"
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  3664
  shows "finite s \<Longrightarrow> \<not> x islimpt s"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3665
  by (induct set: finite) (simp_all add: islimpt_insert)
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  3666
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3667
lemma islimpt_Un_finite:
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3668
  fixes x :: "'a::t1_space"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3669
  shows "finite s \<Longrightarrow> x islimpt (s \<union> t) \<longleftrightarrow> x islimpt t"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3670
  by (simp add: islimpt_Un islimpt_finite)
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  3671
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3672
lemma islimpt_eq_acc_point:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3673
  fixes l :: "'a :: t1_space"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3674
  shows "l islimpt S \<longleftrightarrow> (\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S))"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3675
proof (safe intro!: islimptI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3676
  fix U
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3677
  assume "l islimpt S" "l \<in> U" "open U" "finite (U \<inter> S)"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3678
  then have "l islimpt S" "l \<in> (U - (U \<inter> S - {l}))" "open (U - (U \<inter> S - {l}))"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3679
    by (auto intro: finite_imp_closed)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3680
  then show False
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3681
    by (rule islimptE) auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3682
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3683
  fix T
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3684
  assume *: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S)" "l \<in> T" "open T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3685
  then have "infinite (T \<inter> S - {l})"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3686
    by auto
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3687
  then have "\<exists>x. x \<in> (T \<inter> S - {l})"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3688
    unfolding ex_in_conv by (intro notI) simp
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3689
  then show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> l"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3690
    by auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3691
qed
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3692
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  3693
corollary infinite_openin:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  3694
  fixes S :: "'a :: t1_space set"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  3695
  shows "\<lbrakk>openin (subtopology euclidean U) S; x \<in> S; x islimpt U\<rbrakk> \<Longrightarrow> infinite S"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  3696
  by (clarsimp simp add: openin_open islimpt_eq_acc_point inf_commute)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  3697
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3698
lemma islimpt_range_imp_convergent_subsequence:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3699
  fixes l :: "'a :: {t1_space, first_countable_topology}"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3700
  assumes l: "l islimpt (range f)"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  3701
  shows "\<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3702
  using l unfolding islimpt_eq_acc_point
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3703
  by (rule acc_point_range_imp_convergent_subsequence)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  3704
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3705
lemma islimpt_eq_infinite_ball: "x islimpt S \<longleftrightarrow> (\<forall>e>0. infinite(S \<inter> ball x e))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3706
  apply (simp add: islimpt_eq_acc_point, safe)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3707
   apply (metis Int_commute open_ball centre_in_ball)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3708
  by (metis open_contains_ball Int_mono finite_subset inf_commute subset_refl)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3709
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3710
lemma islimpt_eq_infinite_cball: "x islimpt S \<longleftrightarrow> (\<forall>e>0. infinite(S \<inter> cball x e))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3711
  apply (simp add: islimpt_eq_infinite_ball, safe)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3712
   apply (meson Int_mono ball_subset_cball finite_subset order_refl)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3713
  by (metis open_ball centre_in_ball finite_Int inf.absorb_iff2 inf_assoc open_contains_cball_eq)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3714
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3715
lemma sequence_unique_limpt:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3716
  fixes f :: "nat \<Rightarrow> 'a::t2_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3717
  assumes "(f \<longlongrightarrow> l) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3718
    and "l' islimpt (range f)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3719
  shows "l' = l"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3720
proof (rule ccontr)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3721
  assume "l' \<noteq> l"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3722
  obtain s t where "open s" "open t" "l' \<in> s" "l \<in> t" "s \<inter> t = {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3723
    using hausdorff [OF \<open>l' \<noteq> l\<close>] by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3724
  have "eventually (\<lambda>n. f n \<in> t) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3725
    using assms(1) \<open>open t\<close> \<open>l \<in> t\<close> by (rule topological_tendstoD)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3726
  then obtain N where "\<forall>n\<ge>N. f n \<in> t"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3727
    unfolding eventually_sequentially by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3728
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3729
  have "UNIV = {..<N} \<union> {N..}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3730
    by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3731
  then have "l' islimpt (f ` ({..<N} \<union> {N..}))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3732
    using assms(2) by simp
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3733
  then have "l' islimpt (f ` {..<N} \<union> f ` {N..})"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3734
    by (simp add: image_Un)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3735
  then have "l' islimpt (f ` {N..})"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3736
    by (simp add: islimpt_Un_finite)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3737
  then obtain y where "y \<in> f ` {N..}" "y \<in> s" "y \<noteq> l'"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3738
    using \<open>l' \<in> s\<close> \<open>open s\<close> by (rule islimptE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3739
  then obtain n where "N \<le> n" "f n \<in> s" "f n \<noteq> l'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3740
    by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3741
  with \<open>\<forall>n\<ge>N. f n \<in> t\<close> have "f n \<in> s \<inter> t"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3742
    by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3743
  with \<open>s \<inter> t = {}\<close> show False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3744
    by simp
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3745
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3746
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3747
lemma bolzano_weierstrass_imp_closed:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3748
  fixes s :: "'a::{first_countable_topology,t2_space} set"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3749
  assumes "\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3750
  shows "closed s"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3751
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3752
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3753
    fix x l
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3754
    assume as: "\<forall>n::nat. x n \<in> s" "(x \<longlongrightarrow> l) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3755
    then have "l \<in> s"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3756
    proof (cases "\<forall>n. x n \<noteq> l")
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3757
      case False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3758
      then show "l\<in>s" using as(1) by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3759
    next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3760
      case True note cas = this
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3761
      with as(2) have "infinite (range x)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3762
        using sequence_infinite_lemma[of x l] by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3763
      then obtain l' where "l'\<in>s" "l' islimpt (range x)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3764
        using assms[THEN spec[where x="range x"]] as(1) by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3765
      then show "l\<in>s" using sequence_unique_limpt[of x l l']
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3766
        using as cas by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3767
    qed
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3768
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3769
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3770
    unfolding closed_sequential_limits by fast
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3771
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3772
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  3773
lemma compact_imp_bounded:
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3774
  assumes "compact U"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3775
  shows "bounded U"
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  3776
proof -
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3777
  have "compact U" "\<forall>x\<in>U. open (ball x 1)" "U \<subseteq> (\<Union>x\<in>U. ball x 1)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3778
    using assms by auto
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  3779
  then obtain D where D: "D \<subseteq> U" "finite D" "U \<subseteq> (\<Union>x\<in>D. ball x 1)"
65585
a043de9ad41e Some fixes related to compactE_image
paulson <lp15@cam.ac.uk>
parents: 65204
diff changeset
  3780
    by (metis compactE_image)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3781
  from \<open>finite D\<close> have "bounded (\<Union>x\<in>D. ball x 1)"
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  3782
    by (simp add: bounded_UN)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3783
  then show "bounded U" using \<open>U \<subseteq> (\<Union>x\<in>D. ball x 1)\<close>
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  3784
    by (rule bounded_subset)
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  3785
qed
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  3786
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3787
text\<open>In particular, some common special cases.\<close>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3788
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3789
lemma compact_Un [intro]:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3790
  assumes "compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3791
    and "compact t"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3792
  shows " compact (s \<union> t)"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  3793
proof (rule compactI)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3794
  fix f
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3795
  assume *: "Ball f open" "s \<union> t \<subseteq> \<Union>f"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3796
  from * \<open>compact s\<close> obtain s' where "s' \<subseteq> f \<and> finite s' \<and> s \<subseteq> \<Union>s'"
56073
29e308b56d23 enhanced simplifier solver for preconditions of rewrite rule, can now deal with conjunctions
nipkow
parents: 55927
diff changeset
  3797
    unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f])
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3798
  moreover
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3799
  from * \<open>compact t\<close> obtain t' where "t' \<subseteq> f \<and> finite t' \<and> t \<subseteq> \<Union>t'"
56073
29e308b56d23 enhanced simplifier solver for preconditions of rewrite rule, can now deal with conjunctions
nipkow
parents: 55927
diff changeset
  3800
    unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f])
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3801
  ultimately show "\<exists>f'\<subseteq>f. finite f' \<and> s \<union> t \<subseteq> \<Union>f'"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3802
    by (auto intro!: exI[of _ "s' \<union> t'"])
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3803
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3804
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3805
lemma compact_Union [intro]: "finite S \<Longrightarrow> (\<And>T. T \<in> S \<Longrightarrow> compact T) \<Longrightarrow> compact (\<Union>S)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3806
  by (induct set: finite) auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3807
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3808
lemma compact_UN [intro]:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3809
  "finite A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> compact (B x)) \<Longrightarrow> compact (\<Union>x\<in>A. B x)"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  3810
  by (rule compact_Union) auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3811
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3812
lemma closed_Int_compact [intro]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3813
  assumes "closed s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3814
    and "compact t"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3815
  shows "compact (s \<inter> t)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3816
  using compact_Int_closed [of t s] assms
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3817
  by (simp add: Int_commute)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3818
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3819
lemma compact_Int [intro]:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  3820
  fixes s t :: "'a :: t2_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3821
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3822
    and "compact t"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3823
  shows "compact (s \<inter> t)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3824
  using assms by (intro compact_Int_closed compact_imp_closed)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3825
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3826
lemma compact_sing [simp]: "compact {a}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3827
  unfolding compact_eq_heine_borel by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3828
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3829
lemma compact_insert [simp]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3830
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3831
  shows "compact (insert x s)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3832
proof -
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3833
  have "compact ({x} \<union> s)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3834
    using compact_sing assms by (rule compact_Un)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3835
  then show ?thesis by simp
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3836
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3837
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3838
lemma finite_imp_compact: "finite s \<Longrightarrow> compact s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3839
  by (induct set: finite) simp_all
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3840
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3841
lemma open_delete:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3842
  fixes s :: "'a::t1_space set"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3843
  shows "open s \<Longrightarrow> open (s - {x})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3844
  by (simp add: open_Diff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3845
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3846
lemma openin_delete:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3847
  fixes a :: "'a :: t1_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3848
  shows "openin (subtopology euclidean u) s
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3849
         \<Longrightarrow> openin (subtopology euclidean u) (s - {a})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3850
by (metis Int_Diff open_delete openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3851
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  3852
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3853
text\<open>Compactness expressed with filters\<close>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3854
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3855
lemma closure_iff_nhds_not_empty:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3856
  "x \<in> closure X \<longleftrightarrow> (\<forall>A. \<forall>S\<subseteq>A. open S \<longrightarrow> x \<in> S \<longrightarrow> X \<inter> A \<noteq> {})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3857
proof safe
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3858
  assume x: "x \<in> closure X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3859
  fix S A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3860
  assume "open S" "x \<in> S" "X \<inter> A = {}" "S \<subseteq> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3861
  then have "x \<notin> closure (-S)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3862
    by (auto simp: closure_complement subset_eq[symmetric] intro: interiorI)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3863
  with x have "x \<in> closure X - closure (-S)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3864
    by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3865
  also have "\<dots> \<subseteq> closure (X \<inter> S)"
63128
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3866
    using \<open>open S\<close> open_Int_closure_subset[of S X] by (simp add: closed_Compl ac_simps)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3867
  finally have "X \<inter> S \<noteq> {}" by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3868
  then show False using \<open>X \<inter> A = {}\<close> \<open>S \<subseteq> A\<close> by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3869
next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3870
  assume "\<forall>A S. S \<subseteq> A \<longrightarrow> open S \<longrightarrow> x \<in> S \<longrightarrow> X \<inter> A \<noteq> {}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3871
  from this[THEN spec, of "- X", THEN spec, of "- closure X"]
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3872
  show "x \<in> closure X"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3873
    by (simp add: closure_subset open_Compl)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3874
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3875
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3876
corollary closure_Int_ball_not_empty:
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3877
  assumes "S \<subseteq> closure T" "x \<in> S" "r > 0"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3878
  shows "T \<inter> ball x r \<noteq> {}"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3879
  using assms centre_in_ball closure_iff_nhds_not_empty by blast
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66466
diff changeset
  3880
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3881
lemma compact_filter:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3882
  "compact U \<longleftrightarrow> (\<forall>F. F \<noteq> bot \<longrightarrow> eventually (\<lambda>x. x \<in> U) F \<longrightarrow> (\<exists>x\<in>U. inf (nhds x) F \<noteq> bot))"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3883
proof (intro allI iffI impI compact_fip[THEN iffD2] notI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3884
  fix F
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3885
  assume "compact U"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3886
  assume F: "F \<noteq> bot" "eventually (\<lambda>x. x \<in> U) F"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3887
  then have "U \<noteq> {}"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3888
    by (auto simp: eventually_False)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3889
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3890
  define Z where "Z = closure ` {A. eventually (\<lambda>x. x \<in> A) F}"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3891
  then have "\<forall>z\<in>Z. closed z"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3892
    by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3893
  moreover
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3894
  have ev_Z: "\<And>z. z \<in> Z \<Longrightarrow> eventually (\<lambda>x. x \<in> z) F"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  3895
    unfolding Z_def by (auto elim: eventually_mono intro: set_mp[OF closure_subset])
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3896
  have "(\<forall>B \<subseteq> Z. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3897
  proof (intro allI impI)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3898
    fix B assume "finite B" "B \<subseteq> Z"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3899
    with \<open>finite B\<close> ev_Z F(2) have "eventually (\<lambda>x. x \<in> U \<inter> (\<Inter>B)) F"
60040
1fa1023b13b9 move MOST and INFM in Infinite_Set to Filter; change them to abbreviations over the cofinite filter
hoelzl
parents: 60017
diff changeset
  3900
      by (auto simp: eventually_ball_finite_distrib eventually_conj_iff)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3901
    with F show "U \<inter> \<Inter>B \<noteq> {}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3902
      by (intro notI) (simp add: eventually_False)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3903
  qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3904
  ultimately have "U \<inter> \<Inter>Z \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3905
    using \<open>compact U\<close> unfolding compact_fip by blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3906
  then obtain x where "x \<in> U" and x: "\<And>z. z \<in> Z \<Longrightarrow> x \<in> z"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3907
    by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3908
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3909
  have "\<And>P. eventually P (inf (nhds x) F) \<Longrightarrow> P \<noteq> bot"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3910
    unfolding eventually_inf eventually_nhds
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3911
  proof safe
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3912
    fix P Q R S
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3913
    assume "eventually R F" "open S" "x \<in> S"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  3914
    with open_Int_closure_eq_empty[of S "{x. R x}"] x[of "closure {x. R x}"]
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3915
    have "S \<inter> {x. R x} \<noteq> {}" by (auto simp: Z_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3916
    moreover assume "Ball S Q" "\<forall>x. Q x \<and> R x \<longrightarrow> bot x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3917
    ultimately show False by (auto simp: set_eq_iff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3918
  qed
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3919
  with \<open>x \<in> U\<close> show "\<exists>x\<in>U. inf (nhds x) F \<noteq> bot"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3920
    by (metis eventually_bot)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3921
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3922
  fix A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3923
  assume A: "\<forall>a\<in>A. closed a" "\<forall>B\<subseteq>A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}" "U \<inter> \<Inter>A = {}"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3924
  define F where "F = (INF a:insert U A. principal a)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3925
  have "F \<noteq> bot"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3926
    unfolding F_def
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3927
  proof (rule INF_filter_not_bot)
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  3928
    fix X
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  3929
    assume X: "X \<subseteq> insert U A" "finite X"
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  3930
    with A(2)[THEN spec, of "X - {U}"] have "U \<inter> \<Inter>(X - {U}) \<noteq> {}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3931
      by auto
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  3932
    with X show "(INF a:X. principal a) \<noteq> bot"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3933
      by (auto simp: INF_principal_finite principal_eq_bot_iff)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3934
  qed
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3935
  moreover
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3936
  have "F \<le> principal U"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3937
    unfolding F_def by auto
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3938
  then have "eventually (\<lambda>x. x \<in> U) F"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3939
    by (auto simp: le_filter_def eventually_principal)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3940
  moreover
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3941
  assume "\<forall>F. F \<noteq> bot \<longrightarrow> eventually (\<lambda>x. x \<in> U) F \<longrightarrow> (\<exists>x\<in>U. inf (nhds x) F \<noteq> bot)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3942
  ultimately obtain x where "x \<in> U" and x: "inf (nhds x) F \<noteq> bot"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3943
    by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3944
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3945
  { fix V assume "V \<in> A"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3946
    then have "F \<le> principal V"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3947
      unfolding F_def by (intro INF_lower2[of V]) auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3948
    then have V: "eventually (\<lambda>x. x \<in> V) F"
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  3949
      by (auto simp: le_filter_def eventually_principal)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3950
    have "x \<in> closure V"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3951
      unfolding closure_iff_nhds_not_empty
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3952
    proof (intro impI allI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3953
      fix S A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3954
      assume "open S" "x \<in> S" "S \<subseteq> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3955
      then have "eventually (\<lambda>x. x \<in> A) (nhds x)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3956
        by (auto simp: eventually_nhds)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3957
      with V have "eventually (\<lambda>x. x \<in> V \<inter> A) (inf (nhds x) F)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3958
        by (auto simp: eventually_inf)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3959
      with x show "V \<inter> A \<noteq> {}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3960
        by (auto simp del: Int_iff simp add: trivial_limit_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3961
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3962
    then have "x \<in> V"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3963
      using \<open>V \<in> A\<close> A(1) by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3964
  }
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3965
  with \<open>x\<in>U\<close> have "x \<in> U \<inter> \<Inter>A" by auto
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3966
  with \<open>U \<inter> \<Inter>A = {}\<close> show False by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3967
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3968
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3969
definition "countably_compact U \<longleftrightarrow>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3970
    (\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T))"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3971
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3972
lemma countably_compactE:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3973
  assumes "countably_compact s" and "\<forall>t\<in>C. open t" and "s \<subseteq> \<Union>C" "countable C"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3974
  obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> \<Union>C'"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3975
  using assms unfolding countably_compact_def by metis
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3976
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3977
lemma countably_compactI:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3978
  assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union>C \<Longrightarrow> countable C \<Longrightarrow> (\<exists>C'\<subseteq>C. finite C' \<and> s \<subseteq> \<Union>C')"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3979
  shows "countably_compact s"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3980
  using assms unfolding countably_compact_def by metis
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3981
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3982
lemma compact_imp_countably_compact: "compact U \<Longrightarrow> countably_compact U"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3983
  by (auto simp: compact_eq_heine_borel countably_compact_def)
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3984
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3985
lemma countably_compact_imp_compact:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3986
  assumes "countably_compact U"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3987
    and ccover: "countable B" "\<forall>b\<in>B. open b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3988
    and basis: "\<And>T x. open T \<Longrightarrow> x \<in> T \<Longrightarrow> x \<in> U \<Longrightarrow> \<exists>b\<in>B. x \<in> b \<and> b \<inter> U \<subseteq> T"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3989
  shows "compact U"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3990
  using \<open>countably_compact U\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3991
  unfolding compact_eq_heine_borel countably_compact_def
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3992
proof safe
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3993
  fix A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3994
  assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3995
  assume *: "\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3996
  moreover define C where "C = {b\<in>B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3997
  ultimately have "countable C" "\<forall>a\<in>C. open a"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  3998
    unfolding C_def using ccover by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  3999
  moreover
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4000
  have "\<Union>A \<inter> U \<subseteq> \<Union>C"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4001
  proof safe
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4002
    fix x a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4003
    assume "x \<in> U" "x \<in> a" "a \<in> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4004
    with basis[of a x] A obtain b where "b \<in> B" "x \<in> b" "b \<inter> U \<subseteq> a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4005
      by blast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4006
    with \<open>a \<in> A\<close> show "x \<in> \<Union>C"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4007
      unfolding C_def by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4008
  qed
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4009
  then have "U \<subseteq> \<Union>C" using \<open>U \<subseteq> \<Union>A\<close> by auto
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  4010
  ultimately obtain T where T: "T\<subseteq>C" "finite T" "U \<subseteq> \<Union>T"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4011
    using * by metis
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  4012
  then have "\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4013
    by (auto simp: C_def)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4014
  then obtain f where "\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4015
    unfolding bchoice_iff Bex_def ..
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  4016
  with T show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4017
    unfolding C_def by (intro exI[of _ "f`T"]) fastforce
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4018
qed
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4019
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4020
lemma countably_compact_imp_compact_second_countable:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4021
  "countably_compact U \<Longrightarrow> compact (U :: 'a :: second_countable_topology set)"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4022
proof (rule countably_compact_imp_compact)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4023
  fix T and x :: 'a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4024
  assume "open T" "x \<in> T"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4025
  from topological_basisE[OF is_basis this] obtain b where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4026
    "b \<in> (SOME B. countable B \<and> topological_basis B)" "x \<in> b" "b \<subseteq> T" .
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4027
  then show "\<exists>b\<in>SOME B. countable B \<and> topological_basis B. x \<in> b \<and> b \<inter> U \<subseteq> T"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4028
    by blast
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4029
qed (insert countable_basis topological_basis_open[OF is_basis], auto)
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  4030
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4031
lemma countably_compact_eq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4032
  "countably_compact U \<longleftrightarrow> compact (U :: 'a :: second_countable_topology set)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4033
  using countably_compact_imp_compact_second_countable compact_imp_countably_compact by blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4034
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4035
subsubsection\<open>Sequential compactness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4036
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4037
definition seq_compact :: "'a::topological_space set \<Rightarrow> bool"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4038
  where "seq_compact S \<longleftrightarrow>
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4039
    (\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4040
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4041
lemma seq_compactI:
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4042
  assumes "\<And>f. \<forall>n. f n \<in> S \<Longrightarrow> \<exists>l\<in>S. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4043
  shows "seq_compact S"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4044
  unfolding seq_compact_def using assms by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4045
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4046
lemma seq_compactE:
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4047
  assumes "seq_compact S" "\<forall>n. f n \<in> S"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4048
  obtains l r where "l \<in> S" "strict_mono (r :: nat \<Rightarrow> nat)" "((f \<circ> r) \<longlongrightarrow> l) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4049
  using assms unfolding seq_compact_def by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4050
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4051
lemma closed_sequentially: (* TODO: move upwards *)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4052
  assumes "closed s" and "\<forall>n. f n \<in> s" and "f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4053
  shows "l \<in> s"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4054
proof (rule ccontr)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4055
  assume "l \<notin> s"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4056
  with \<open>closed s\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "eventually (\<lambda>n. f n \<in> - s) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4057
    by (fast intro: topological_tendstoD)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4058
  with \<open>\<forall>n. f n \<in> s\<close> show "False"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4059
    by simp
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4060
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4061
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4062
lemma seq_compact_Int_closed:
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4063
  assumes "seq_compact s" and "closed t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4064
  shows "seq_compact (s \<inter> t)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4065
proof (rule seq_compactI)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4066
  fix f assume "\<forall>n::nat. f n \<in> s \<inter> t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4067
  hence "\<forall>n. f n \<in> s" and "\<forall>n. f n \<in> t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4068
    by simp_all
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4069
  from \<open>seq_compact s\<close> and \<open>\<forall>n. f n \<in> s\<close>
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4070
  obtain l r where "l \<in> s" and r: "strict_mono r" and l: "(f \<circ> r) \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4071
    by (rule seq_compactE)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4072
  from \<open>\<forall>n. f n \<in> t\<close> have "\<forall>n. (f \<circ> r) n \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4073
    by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4074
  from \<open>closed t\<close> and this and l have "l \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4075
    by (rule closed_sequentially)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4076
  with \<open>l \<in> s\<close> and r and l show "\<exists>l\<in>s \<inter> t. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4077
    by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4078
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4079
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4080
lemma seq_compact_closed_subset:
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4081
  assumes "closed s" and "s \<subseteq> t" and "seq_compact t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4082
  shows "seq_compact s"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4083
  using assms seq_compact_Int_closed [of t s] by (simp add: Int_absorb1)
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4084
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4085
lemma seq_compact_imp_countably_compact:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4086
  fixes U :: "'a :: first_countable_topology set"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4087
  assumes "seq_compact U"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4088
  shows "countably_compact U"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4089
proof (safe intro!: countably_compactI)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4090
  fix A
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4091
  assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" "countable A"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4092
  have subseq: "\<And>X. range X \<subseteq> U \<Longrightarrow> \<exists>r x. x \<in> U \<and> strict_mono (r :: nat \<Rightarrow> nat) \<and> (X \<circ> r) \<longlonglongrightarrow> x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4093
    using \<open>seq_compact U\<close> by (fastforce simp: seq_compact_def subset_eq)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4094
  show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4095
  proof cases
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4096
    assume "finite A"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4097
    with A show ?thesis by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4098
  next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4099
    assume "infinite A"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4100
    then have "A \<noteq> {}" by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4101
    show ?thesis
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4102
    proof (rule ccontr)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4103
      assume "\<not> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4104
      then have "\<forall>T. \<exists>x. T \<subseteq> A \<and> finite T \<longrightarrow> (x \<in> U - \<Union>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4105
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4106
      then obtain X' where T: "\<And>T. T \<subseteq> A \<Longrightarrow> finite T \<Longrightarrow> X' T \<in> U - \<Union>T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4107
        by metis
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4108
      define X where "X n = X' (from_nat_into A ` {.. n})" for n
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4109
      have X: "\<And>n. X n \<in> U - (\<Union>i\<le>n. from_nat_into A i)"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  4110
        using \<open>A \<noteq> {}\<close> unfolding X_def by (intro T) (auto intro: from_nat_into)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4111
      then have "range X \<subseteq> U"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4112
        by auto
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4113
      with subseq[of X] obtain r x where "x \<in> U" and r: "strict_mono r" "(X \<circ> r) \<longlonglongrightarrow> x"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4114
        by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4115
      from \<open>x\<in>U\<close> \<open>U \<subseteq> \<Union>A\<close> from_nat_into_surj[OF \<open>countable A\<close>]
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4116
      obtain n where "x \<in> from_nat_into A n" by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4117
      with r(2) A(1) from_nat_into[OF \<open>A \<noteq> {}\<close>, of n]
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4118
      have "eventually (\<lambda>i. X (r i) \<in> from_nat_into A n) sequentially"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4119
        unfolding tendsto_def by (auto simp: comp_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4120
      then obtain N where "\<And>i. N \<le> i \<Longrightarrow> X (r i) \<in> from_nat_into A n"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4121
        by (auto simp: eventually_sequentially)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4122
      moreover from X have "\<And>i. n \<le> r i \<Longrightarrow> X (r i) \<notin> from_nat_into A n"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4123
        by auto
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4124
      moreover from \<open>strict_mono r\<close>[THEN seq_suble, of "max n N"] have "\<exists>i. n \<le> r i \<and> N \<le> i"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4125
        by (auto intro!: exI[of _ "max n N"])
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4126
      ultimately show False
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4127
        by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4128
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4129
  qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4130
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4131
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4132
lemma compact_imp_seq_compact:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4133
  fixes U :: "'a :: first_countable_topology set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4134
  assumes "compact U"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4135
  shows "seq_compact U"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4136
  unfolding seq_compact_def
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4137
proof safe
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4138
  fix X :: "nat \<Rightarrow> 'a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4139
  assume "\<forall>n. X n \<in> U"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4140
  then have "eventually (\<lambda>x. x \<in> U) (filtermap X sequentially)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4141
    by (auto simp: eventually_filtermap)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4142
  moreover
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4143
  have "filtermap X sequentially \<noteq> bot"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4144
    by (simp add: trivial_limit_def eventually_filtermap)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4145
  ultimately
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4146
  obtain x where "x \<in> U" and x: "inf (nhds x) (filtermap X sequentially) \<noteq> bot" (is "?F \<noteq> _")
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4147
    using \<open>compact U\<close> by (auto simp: compact_filter)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4148
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4149
  from countable_basis_at_decseq[of x]
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4150
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4151
      "\<And>i. open (A i)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4152
      "\<And>i. x \<in> A i"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4153
      "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4154
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4155
  define s where "s n i = (SOME j. i < j \<and> X j \<in> A (Suc n))" for n i
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4156
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4157
    fix n i
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4158
    have "\<exists>a. i < a \<and> X a \<in> A (Suc n)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4159
    proof (rule ccontr)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4160
      assume "\<not> (\<exists>a>i. X a \<in> A (Suc n))"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4161
      then have "\<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4162
        by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4163
      then have "eventually (\<lambda>x. x \<notin> A (Suc n)) (filtermap X sequentially)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4164
        by (auto simp: eventually_filtermap eventually_sequentially)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4165
      moreover have "eventually (\<lambda>x. x \<in> A (Suc n)) (nhds x)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4166
        using A(1,2)[of "Suc n"] by (auto simp: eventually_nhds)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4167
      ultimately have "eventually (\<lambda>x. False) ?F"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4168
        by (auto simp: eventually_inf)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4169
      with x show False
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4170
        by (simp add: eventually_False)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4171
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4172
    then have "i < s n i" "X (s n i) \<in> A (Suc n)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4173
      unfolding s_def by (auto intro: someI2_ex)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4174
  }
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4175
  note s = this
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4176
  define r where "r = rec_nat (s 0 0) s"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4177
  have "strict_mono r"
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4178
    by (auto simp: r_def s strict_mono_Suc_iff)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4179
  moreover
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4180
  have "(\<lambda>n. X (r n)) \<longlonglongrightarrow> x"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4181
  proof (rule topological_tendstoI)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4182
    fix S
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4183
    assume "open S" "x \<in> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4184
    with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4185
      by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4186
    moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4187
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4188
      fix i
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4189
      assume "Suc 0 \<le> i"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4190
      then have "X (r i) \<in> A i"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4191
        by (cases i) (simp_all add: r_def s)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4192
    }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4193
    then have "eventually (\<lambda>i. X (r i) \<in> A i) sequentially"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4194
      by (auto simp: eventually_sequentially)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4195
    ultimately show "eventually (\<lambda>i. X (r i) \<in> S) sequentially"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4196
      by eventually_elim auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4197
  qed
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4198
  ultimately show "\<exists>x \<in> U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4199
    using \<open>x \<in> U\<close> by (auto simp: convergent_def comp_def)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4200
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4201
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4202
lemma countably_compact_imp_acc_point:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4203
  assumes "countably_compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4204
    and "countable t"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4205
    and "infinite t"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4206
    and "t \<subseteq> s"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4207
  shows "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4208
proof (rule ccontr)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4209
  define C where "C = (\<lambda>F. interior (F \<union> (- t))) ` {F. finite F \<and> F \<subseteq> t }"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4210
  note \<open>countably_compact s\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4211
  moreover have "\<forall>t\<in>C. open t"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4212
    by (auto simp: C_def)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4213
  moreover
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4214
  assume "\<not> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4215
  then have s: "\<And>x. x \<in> s \<Longrightarrow> \<exists>U. x\<in>U \<and> open U \<and> finite (U \<inter> t)" by metis
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4216
  have "s \<subseteq> \<Union>C"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4217
    using \<open>t \<subseteq> s\<close>
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  4218
    unfolding C_def
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4219
    apply (safe dest!: s)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4220
    apply (rule_tac a="U \<inter> t" in UN_I)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4221
    apply (auto intro!: interiorI simp add: finite_subset)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4222
    done
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4223
  moreover
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4224
  from \<open>countable t\<close> have "countable C"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4225
    unfolding C_def by (auto intro: countable_Collect_finite_subset)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4226
  ultimately
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4227
  obtain D where "D \<subseteq> C" "finite D" "s \<subseteq> \<Union>D"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4228
    by (rule countably_compactE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4229
  then obtain E where E: "E \<subseteq> {F. finite F \<and> F \<subseteq> t }" "finite E"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4230
    and s: "s \<subseteq> (\<Union>F\<in>E. interior (F \<union> (- t)))"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  4231
    by (metis (lifting) finite_subset_image C_def)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4232
  from s \<open>t \<subseteq> s\<close> have "t \<subseteq> \<Union>E"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4233
    using interior_subset by blast
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4234
  moreover have "finite (\<Union>E)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4235
    using E by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4236
  ultimately show False using \<open>infinite t\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4237
    by (auto simp: finite_subset)
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4238
qed
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4239
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4240
lemma countable_acc_point_imp_seq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4241
  fixes s :: "'a::first_countable_topology set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4242
  assumes "\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s \<longrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4243
    (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4244
  shows "seq_compact s"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4245
proof -
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4246
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4247
    fix f :: "nat \<Rightarrow> 'a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4248
    assume f: "\<forall>n. f n \<in> s"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4249
    have "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4250
    proof (cases "finite (range f)")
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4251
      case True
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4252
      obtain l where "infinite {n. f n = f l}"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4253
        using pigeonhole_infinite[OF _ True] by auto
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4254
      then obtain r :: "nat \<Rightarrow> nat" where "strict_mono  r" and fr: "\<forall>n. f (r n) = f l"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4255
        using infinite_enumerate by blast
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4256
      then have "strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> f l"
58729
e8ecc79aee43 add tendsto_const and tendsto_ident_at as simp and intro rules
hoelzl
parents: 58184
diff changeset
  4257
        by (simp add: fr o_def)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4258
      with f show "\<exists>l\<in>s. \<exists>r. strict_mono  r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4259
        by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4260
    next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4261
      case False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4262
      with f assms have "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4263
        by auto
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4264
      then obtain l where "l \<in> s" "\<forall>U. l\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)" ..
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4265
      from this(2) have "\<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4266
        using acc_point_range_imp_convergent_subsequence[of l f] by auto
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4267
      with \<open>l \<in> s\<close> show "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" ..
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4268
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4269
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4270
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4271
    unfolding seq_compact_def by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4272
qed
44075
5952bd355779 generalize more lemmas about compactness
huffman
parents: 44074
diff changeset
  4273
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4274
lemma seq_compact_eq_countably_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4275
  fixes U :: "'a :: first_countable_topology set"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4276
  shows "seq_compact U \<longleftrightarrow> countably_compact U"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4277
  using
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4278
    countable_acc_point_imp_seq_compact
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4279
    countably_compact_imp_acc_point
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4280
    seq_compact_imp_countably_compact
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4281
  by metis
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4282
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4283
lemma seq_compact_eq_acc_point:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4284
  fixes s :: "'a :: first_countable_topology set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4285
  shows "seq_compact s \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4286
    (\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s --> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t)))"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4287
  using
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4288
    countable_acc_point_imp_seq_compact[of s]
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4289
    countably_compact_imp_acc_point[of s]
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4290
    seq_compact_imp_countably_compact[of s]
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4291
  by metis
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4292
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4293
lemma seq_compact_eq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4294
  fixes U :: "'a :: second_countable_topology set"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4295
  shows "seq_compact U \<longleftrightarrow> compact U"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4296
  using seq_compact_eq_countably_compact countably_compact_eq_compact by blast
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4297
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4298
lemma bolzano_weierstrass_imp_seq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4299
  fixes s :: "'a::{t1_space, first_countable_topology} set"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  4300
  shows "\<forall>t. infinite t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> seq_compact s"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4301
  by (rule countable_acc_point_imp_seq_compact) (metis islimpt_eq_acc_point)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4302
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  4303
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4304
subsubsection\<open>Totally bounded\<close>
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4305
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  4306
lemma cauchy_def: "Cauchy s \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m n. m \<ge> N \<and> n \<ge> N \<longrightarrow> dist (s m) (s n) < e)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4307
  unfolding Cauchy_def by metis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4308
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4309
lemma seq_compact_imp_totally_bounded:
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4310
  assumes "seq_compact s"
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4311
  shows "\<forall>e>0. \<exists>k. finite k \<and> k \<subseteq> s \<and> s \<subseteq> (\<Union>x\<in>k. ball x e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4312
proof -
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4313
  { fix e::real assume "e > 0" assume *: "\<And>k. finite k \<Longrightarrow> k \<subseteq> s \<Longrightarrow> \<not> s \<subseteq> (\<Union>x\<in>k. ball x e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4314
    let ?Q = "\<lambda>x n r. r \<in> s \<and> (\<forall>m < (n::nat). \<not> (dist (x m) r < e))"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4315
    have "\<exists>x. \<forall>n::nat. ?Q x n (x n)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4316
    proof (rule dependent_wellorder_choice)
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4317
      fix n x assume "\<And>y. y < n \<Longrightarrow> ?Q x y (x y)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4318
      then have "\<not> s \<subseteq> (\<Union>x\<in>x ` {0..<n}. ball x e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4319
        using *[of "x ` {0 ..< n}"] by (auto simp: subset_eq)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4320
      then obtain z where z:"z\<in>s" "z \<notin> (\<Union>x\<in>x ` {0..<n}. ball x e)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4321
        unfolding subset_eq by auto
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4322
      show "\<exists>r. ?Q x n r"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4323
        using z by auto
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4324
    qed simp
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4325
    then obtain x where "\<forall>n::nat. x n \<in> s" and x:"\<And>n m. m < n \<Longrightarrow> \<not> (dist (x m) (x n) < e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4326
      by blast
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4327
    then obtain l r where "l \<in> s" and r:"strict_mono  r" and "((x \<circ> r) \<longlongrightarrow> l) sequentially"
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4328
      using assms by (metis seq_compact_def)
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4329
    from this(3) have "Cauchy (x \<circ> r)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4330
      using LIMSEQ_imp_Cauchy by auto
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4331
    then obtain N::nat where "\<And>m n. N \<le> m \<Longrightarrow> N \<le> n \<Longrightarrow> dist ((x \<circ> r) m) ((x \<circ> r) n) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4332
      unfolding cauchy_def using \<open>e > 0\<close> by blast
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4333
    then have False
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4334
      using x[of "r N" "r (N+1)"] r by (auto simp: strict_mono_def) }
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4335
  then show ?thesis
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4336
    by metis
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4337
qed
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4338
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4339
subsubsection\<open>Heine-Borel theorem\<close>
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4340
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4341
lemma seq_compact_imp_heine_borel:
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4342
  fixes s :: "'a :: metric_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4343
  assumes "seq_compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4344
  shows "compact s"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4345
proof -
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4346
  from seq_compact_imp_totally_bounded[OF \<open>seq_compact s\<close>]
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4347
  obtain f where f: "\<forall>e>0. finite (f e) \<and> f e \<subseteq> s \<and> s \<subseteq> (\<Union>x\<in>f e. ball x e)"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4348
    unfolding choice_iff' ..
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4349
  define K where "K = (\<lambda>(x, r). ball x r) ` ((\<Union>e \<in> \<rat> \<inter> {0 <..}. f e) \<times> \<rat>)"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4350
  have "countably_compact s"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4351
    using \<open>seq_compact s\<close> by (rule seq_compact_imp_countably_compact)
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4352
  then show "compact s"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4353
  proof (rule countably_compact_imp_compact)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4354
    show "countable K"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4355
      unfolding K_def using f
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4356
      by (auto intro: countable_finite countable_subset countable_rat
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4357
               intro!: countable_image countable_SIGMA countable_UN)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4358
    show "\<forall>b\<in>K. open b" by (auto simp: K_def)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4359
  next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4360
    fix T x
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4361
    assume T: "open T" "x \<in> T" and x: "x \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4362
    from openE[OF T] obtain e where "0 < e" "ball x e \<subseteq> T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4363
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4364
    then have "0 < e / 2" "ball x (e / 2) \<subseteq> T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4365
      by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4366
    from Rats_dense_in_real[OF \<open>0 < e / 2\<close>] obtain r where "r \<in> \<rat>" "0 < r" "r < e / 2"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4367
      by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4368
    from f[rule_format, of r] \<open>0 < r\<close> \<open>x \<in> s\<close> obtain k where "k \<in> f r" "x \<in> ball k r"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  4369
      by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4370
    from \<open>r \<in> \<rat>\<close> \<open>0 < r\<close> \<open>k \<in> f r\<close> have "ball k r \<in> K"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4371
      by (auto simp: K_def)
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4372
    then show "\<exists>b\<in>K. x \<in> b \<and> b \<inter> s \<subseteq> T"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4373
    proof (rule bexI[rotated], safe)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4374
      fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4375
      assume "y \<in> ball k r"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4376
      with \<open>r < e / 2\<close> \<open>x \<in> ball k r\<close> have "dist x y < e"
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  4377
        by (intro dist_triangle_half_r [of k _ e]) (auto simp: dist_commute)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4378
      with \<open>ball x e \<subseteq> T\<close> show "y \<in> T"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4379
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4380
    next
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4381
      show "x \<in> ball k r" by fact
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4382
    qed
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4383
  qed
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4384
qed
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4385
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4386
lemma compact_eq_seq_compact_metric:
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4387
  "compact (s :: 'a::metric_space set) \<longleftrightarrow> seq_compact s"
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4388
  using compact_imp_seq_compact seq_compact_imp_heine_borel by blast
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4389
67443
3abf6a722518 standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents: 67399
diff changeset
  4390
lemma compact_def: \<comment> \<open>this is the definition of compactness in HOL Light\<close>
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4391
  "compact (S :: 'a::metric_space set) \<longleftrightarrow>
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4392
   (\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l))"
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4393
  unfolding compact_eq_seq_compact_metric seq_compact_def by auto
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  4394
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4395
subsubsection \<open>Complete the chain of compactness variants\<close>
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4396
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4397
lemma compact_eq_bolzano_weierstrass:
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4398
  fixes s :: "'a::metric_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4399
  shows "compact s \<longleftrightarrow> (\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4400
  (is "?lhs = ?rhs")
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4401
proof
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4402
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4403
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4404
    using heine_borel_imp_bolzano_weierstrass[of s] by auto
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4405
next
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4406
  assume ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4407
  then show ?lhs
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4408
    unfolding compact_eq_seq_compact_metric by (rule bolzano_weierstrass_imp_seq_compact)
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4409
qed
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4410
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4411
lemma bolzano_weierstrass_imp_bounded:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4412
  "\<forall>t. infinite t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> bounded s"
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4413
  using compact_imp_bounded unfolding compact_eq_bolzano_weierstrass .
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4414
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4415
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4416
subsection \<open>Metric spaces with the Heine-Borel property\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4417
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4418
text \<open>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4419
  A metric space (or topological vector space) is said to have the
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4420
  Heine-Borel property if every closed and bounded subset is compact.
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4421
\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4422
44207
ea99698c2070 locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents: 44170
diff changeset
  4423
class heine_borel = metric_space +
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4424
  assumes bounded_imp_convergent_subsequence:
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4425
    "bounded (range f) \<Longrightarrow> \<exists>l r. strict_mono (r::nat\<Rightarrow>nat) \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4426
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4427
lemma bounded_closed_imp_seq_compact:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4428
  fixes s::"'a::heine_borel set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4429
  assumes "bounded s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4430
    and "closed s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4431
  shows "seq_compact s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4432
proof (unfold seq_compact_def, clarify)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4433
  fix f :: "nat \<Rightarrow> 'a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4434
  assume f: "\<forall>n. f n \<in> s"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4435
  with \<open>bounded s\<close> have "bounded (range f)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4436
    by (auto intro: bounded_subset)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4437
  obtain l r where r: "strict_mono (r :: nat \<Rightarrow> nat)" and l: "((f \<circ> r) \<longlongrightarrow> l) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4438
    using bounded_imp_convergent_subsequence [OF \<open>bounded (range f)\<close>] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4439
  from f have fr: "\<forall>n. (f \<circ> r) n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4440
    by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4441
  have "l \<in> s" using \<open>closed s\<close> fr l
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4442
    by (rule closed_sequentially)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4443
  show "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4444
    using \<open>l \<in> s\<close> r l by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4445
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4446
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4447
lemma compact_eq_bounded_closed:
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4448
  fixes s :: "'a::heine_borel set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4449
  shows "compact s \<longleftrightarrow> bounded s \<and> closed s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4450
  (is "?lhs = ?rhs")
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4451
proof
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4452
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4453
  then show ?rhs
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4454
    using compact_imp_closed compact_imp_bounded
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4455
    by blast
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4456
next
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4457
  assume ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4458
  then show ?lhs
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4459
    using bounded_closed_imp_seq_compact[of s]
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4460
    unfolding compact_eq_seq_compact_metric
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4461
    by auto
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4462
qed
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4463
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4464
lemma compact_Inter:
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4465
  fixes \<F> :: "'a :: heine_borel set set"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4466
  assumes com: "\<And>S. S \<in> \<F> \<Longrightarrow> compact S" and "\<F> \<noteq> {}"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4467
  shows "compact(\<Inter> \<F>)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4468
  using assms
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4469
  by (meson Inf_lower all_not_in_conv bounded_subset closed_Inter compact_eq_bounded_closed)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66643
diff changeset
  4470
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  4471
lemma compact_closure [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  4472
  fixes S :: "'a::heine_borel set"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  4473
  shows "compact(closure S) \<longleftrightarrow> bounded S"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  4474
by (meson bounded_closure bounded_subset closed_closure closure_subset compact_eq_bounded_closed)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  4475
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4476
lemma not_compact_UNIV[simp]:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4477
  fixes s :: "'a::{real_normed_vector,perfect_space,heine_borel} set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4478
  shows "~ compact (UNIV::'a set)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4479
    by (simp add: compact_eq_bounded_closed)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4480
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4481
instance real :: heine_borel
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4482
proof
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4483
  fix f :: "nat \<Rightarrow> real"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4484
  assume f: "bounded (range f)"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4485
  obtain r :: "nat \<Rightarrow> nat" where r: "strict_mono r" "monoseq (f \<circ> r)"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  4486
    unfolding comp_def by (metis seq_monosub)
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  4487
  then have "Bseq (f \<circ> r)"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  4488
    unfolding Bseq_eq_bounded using f by (force intro: bounded_subset)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4489
  with r show "\<exists>l r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  4490
    using Bseq_monoseq_convergent[of "f \<circ> r"] by (auto simp: convergent_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4491
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4492
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4493
lemma compact_lemma_general:
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4494
  fixes f :: "nat \<Rightarrow> 'a"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4495
  fixes proj::"'a \<Rightarrow> 'b \<Rightarrow> 'c::heine_borel" (infixl "proj" 60)
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4496
  fixes unproj:: "('b \<Rightarrow> 'c) \<Rightarrow> 'a"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4497
  assumes finite_basis: "finite basis"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4498
  assumes bounded_proj: "\<And>k. k \<in> basis \<Longrightarrow> bounded ((\<lambda>x. x proj k) ` range f)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4499
  assumes proj_unproj: "\<And>e k. k \<in> basis \<Longrightarrow> (unproj e) proj k = e k"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4500
  assumes unproj_proj: "\<And>x. unproj (\<lambda>k. x proj k) = x"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4501
  shows "\<forall>d\<subseteq>basis. \<exists>l::'a. \<exists> r::nat\<Rightarrow>nat.
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4502
    strict_mono r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) proj i) (l proj i) < e) sequentially)"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  4503
proof safe
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4504
  fix d :: "'b set"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4505
  assume d: "d \<subseteq> basis"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4506
  with finite_basis have "finite d"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4507
    by (blast intro: finite_subset)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4508
  from this d show "\<exists>l::'a. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and>
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4509
    (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) proj i) (l proj i) < e) sequentially)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4510
  proof (induct d)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4511
    case empty
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4512
    then show ?case
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4513
      unfolding strict_mono_def by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4514
  next
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4515
    case (insert k d)
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4516
    have k[intro]: "k \<in> basis"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4517
      using insert by auto
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4518
    have s': "bounded ((\<lambda>x. x proj k) ` range f)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4519
      using k
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4520
      by (rule bounded_proj)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4521
    obtain l1::"'a" and r1 where r1: "strict_mono r1"
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4522
      and lr1: "\<forall>e > 0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially"
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  4523
      using insert(3) using insert(4) by auto
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4524
    have f': "\<forall>n. f (r1 n) proj k \<in> (\<lambda>x. x proj k) ` range f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4525
      by simp
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4526
    have "bounded (range (\<lambda>i. f (r1 i) proj k))"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4527
      by (metis (lifting) bounded_subset f' image_subsetI s')
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4528
    then obtain l2 r2 where r2:"strict_mono r2" and lr2:"((\<lambda>i. f (r1 (r2 i)) proj k) \<longlongrightarrow> l2) sequentially"
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4529
      using bounded_imp_convergent_subsequence[of "\<lambda>i. f (r1 i) proj k"]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4530
      by (auto simp: o_def)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4531
    define r where "r = r1 \<circ> r2"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4532
    have r:"strict_mono r"
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4533
      using r1 and r2 unfolding r_def o_def strict_mono_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4534
    moreover
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4535
    define l where "l = unproj (\<lambda>i. if i = k then l2 else l1 proj i)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4536
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4537
      fix e::real
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4538
      assume "e > 0"
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4539
      from lr1 \<open>e > 0\<close> have N1: "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4540
        by blast
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4541
      from lr2 \<open>e > 0\<close> have N2:"eventually (\<lambda>n. dist (f (r1 (r2 n)) proj k) l2 < e) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4542
        by (rule tendstoD)
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4543
      from r2 N1 have N1': "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 (r2 n)) proj i) (l1 proj i) < e) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4544
        by (rule eventually_subseq)
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4545
      have "eventually (\<lambda>n. \<forall>i\<in>(insert k d). dist (f (r n) proj i) (l proj i) < e) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4546
        using N1' N2
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4547
        by eventually_elim (insert insert.prems, auto simp: l_def r_def o_def proj_unproj)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4548
    }
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4549
    ultimately show ?case by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4550
  qed
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  4551
qed
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  4552
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4553
lemma compact_lemma:
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4554
  fixes f :: "nat \<Rightarrow> 'a::euclidean_space"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4555
  assumes "bounded (range f)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4556
  shows "\<forall>d\<subseteq>Basis. \<exists>l::'a. \<exists> r.
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4557
    strict_mono r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially)"
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4558
  by (rule compact_lemma_general[where unproj="\<lambda>e. \<Sum>i\<in>Basis. e i *\<^sub>R i"])
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4559
     (auto intro!: assms bounded_linear_inner_left bounded_linear_image
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4560
       simp: euclidean_representation)
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  4561
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  4562
instance euclidean_space \<subseteq> heine_borel
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4563
proof
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4564
  fix f :: "nat \<Rightarrow> 'a"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4565
  assume f: "bounded (range f)"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4566
  then obtain l::'a and r where r: "strict_mono r"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  4567
    and l: "\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4568
    using compact_lemma [OF f] by blast
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4569
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4570
    fix e::real
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4571
    assume "e > 0"
56541
0e3abadbef39 made divide_pos_pos a simp rule
nipkow
parents: 56371
diff changeset
  4572
    hence "e / real_of_nat DIM('a) > 0" by (simp add: DIM_positive)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  4573
    with l have "eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4574
      by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4575
    moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4576
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4577
      fix n
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4578
      assume n: "\<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  4579
      have "dist (f (r n)) l \<le> (\<Sum>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i))"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4580
        apply (subst euclidean_dist_l2)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4581
        using zero_le_dist
67155
9e5b05d54f9d canonical name
nipkow
parents: 66939
diff changeset
  4582
        apply (rule L2_set_le_sum)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4583
        done
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  4584
      also have "\<dots> < (\<Sum>i\<in>(Basis::'a set). e / (real_of_nat DIM('a)))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  4585
        apply (rule sum_strict_mono)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4586
        using n
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4587
        apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4588
        done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4589
      finally have "dist (f (r n)) l < e"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  4590
        by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4591
    }
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4592
    ultimately have "eventually (\<lambda>n. dist (f (r n)) l < e) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  4593
      by (rule eventually_mono)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4594
  }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4595
  then have *: "((f \<circ> r) \<longlongrightarrow> l) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4596
    unfolding o_def tendsto_iff by simp
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4597
  with r show "\<exists>l r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4598
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4599
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4600
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4601
lemma bounded_fst: "bounded s \<Longrightarrow> bounded (fst ` s)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4602
  unfolding bounded_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  4603
  by (metis (erased, hide_lams) dist_fst_le image_iff order_trans)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4604
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4605
lemma bounded_snd: "bounded s \<Longrightarrow> bounded (snd ` s)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4606
  unfolding bounded_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  4607
  by (metis (no_types, hide_lams) dist_snd_le image_iff order.trans)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4608
37678
0040bafffdef "prod" and "sum" replace "*" and "+" respectively
haftmann
parents: 37649
diff changeset
  4609
instance prod :: (heine_borel, heine_borel) heine_borel
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4610
proof
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4611
  fix f :: "nat \<Rightarrow> 'a \<times> 'b"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4612
  assume f: "bounded (range f)"
56154
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  4613
  then have "bounded (fst ` range f)"
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  4614
    by (rule bounded_fst)
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  4615
  then have s1: "bounded (range (fst \<circ> f))"
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  4616
    by (simp add: image_comp)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4617
  obtain l1 r1 where r1: "strict_mono r1" and l1: "(\<lambda>n. fst (f (r1 n))) \<longlonglongrightarrow> l1"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4618
    using bounded_imp_convergent_subsequence [OF s1] unfolding o_def by fast
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4619
  from f have s2: "bounded (range (snd \<circ> f \<circ> r1))"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4620
    by (auto simp: image_comp intro: bounded_snd bounded_subset)
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4621
  obtain l2 r2 where r2: "strict_mono r2" and l2: "((\<lambda>n. snd (f (r1 (r2 n)))) \<longlongrightarrow> l2) sequentially"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  4622
    using bounded_imp_convergent_subsequence [OF s2]
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4623
    unfolding o_def by fast
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4624
  have l1': "((\<lambda>n. fst (f (r1 (r2 n)))) \<longlongrightarrow> l1) sequentially"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  4625
    using LIMSEQ_subseq_LIMSEQ [OF l1 r2] unfolding o_def .
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4626
  have l: "((f \<circ> (r1 \<circ> r2)) \<longlongrightarrow> (l1, l2)) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4627
    using tendsto_Pair [OF l1' l2] unfolding o_def by simp
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4628
  have r: "strict_mono (r1 \<circ> r2)"
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4629
    using r1 r2 unfolding strict_mono_def by simp
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4630
  show "\<exists>l r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4631
    using l r by fast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4632
qed
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
  4633
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4634
subsubsection \<open>Completeness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4635
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  4636
lemma (in metric_space) completeI:
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4637
  assumes "\<And>f. \<forall>n. f n \<in> s \<Longrightarrow> Cauchy f \<Longrightarrow> \<exists>l\<in>s. f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4638
  shows "complete s"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4639
  using assms unfolding complete_def by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4640
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  4641
lemma (in metric_space) completeE:
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4642
  assumes "complete s" and "\<forall>n. f n \<in> s" and "Cauchy f"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4643
  obtains l where "l \<in> s" and "f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4644
  using assms unfolding complete_def by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4645
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  4646
(* TODO: generalize to uniform spaces *)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4647
lemma compact_imp_complete:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  4648
  fixes s :: "'a::metric_space set"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4649
  assumes "compact s"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4650
  shows "complete s"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4651
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4652
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4653
    fix f
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4654
    assume as: "(\<forall>n::nat. f n \<in> s)" "Cauchy f"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4655
    from as(1) obtain l r where lr: "l\<in>s" "strict_mono r" "(f \<circ> r) \<longlonglongrightarrow> l"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4656
      using assms unfolding compact_def by blast
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4657
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4658
    note lr' = seq_suble [OF lr(2)]
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4659
    {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4660
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4661
      assume "e > 0"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4662
      from as(2) obtain N where N:"\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (f m) (f n) < e/2"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4663
        unfolding cauchy_def
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4664
        using \<open>e > 0\<close>
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4665
        apply (erule_tac x="e/2" in allE, auto)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4666
        done
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  4667
      from lr(3)[unfolded lim_sequentially, THEN spec[where x="e/2"]]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4668
      obtain M where M:"\<forall>n\<ge>M. dist ((f \<circ> r) n) l < e/2"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4669
        using \<open>e > 0\<close> by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4670
      {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4671
        fix n :: nat
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4672
        assume n: "n \<ge> max N M"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4673
        have "dist ((f \<circ> r) n) l < e/2"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4674
          using n M by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4675
        moreover have "r n \<ge> N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4676
          using lr'[of n] n by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4677
        then have "dist (f n) ((f \<circ> r) n) < e / 2"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4678
          using N and n by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4679
        ultimately have "dist (f n) l < e"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4680
          using dist_triangle_half_r[of "f (r n)" "f n" e l]
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4681
          by (auto simp: dist_commute)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4682
      }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4683
      then have "\<exists>N. \<forall>n\<ge>N. dist (f n) l < e" by blast
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4684
    }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4685
    then have "\<exists>l\<in>s. (f \<longlongrightarrow> l) sequentially" using \<open>l\<in>s\<close>
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  4686
      unfolding lim_sequentially by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4687
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4688
  then show ?thesis unfolding complete_def by auto
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4689
qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4690
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4691
lemma compact_eq_totally_bounded:
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  4692
  "compact s \<longleftrightarrow> complete s \<and> (\<forall>e>0. \<exists>k. finite k \<and> s \<subseteq> (\<Union>x\<in>k. ball x e))"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4693
    (is "_ \<longleftrightarrow> ?rhs")
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4694
proof
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4695
  assume assms: "?rhs"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4696
  then obtain k where k: "\<And>e. 0 < e \<Longrightarrow> finite (k e)" "\<And>e. 0 < e \<Longrightarrow> s \<subseteq> (\<Union>x\<in>k e. ball x e)"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4697
    by (auto simp: choice_iff')
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4698
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4699
  show "compact s"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4700
  proof cases
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4701
    assume "s = {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4702
    then show "compact s" by (simp add: compact_def)
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4703
  next
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4704
    assume "s \<noteq> {}"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4705
    show ?thesis
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4706
      unfolding compact_def
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4707
    proof safe
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4708
      fix f :: "nat \<Rightarrow> 'a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4709
      assume f: "\<forall>n. f n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4710
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4711
      define e where "e n = 1 / (2 * Suc n)" for n
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4712
      then have [simp]: "\<And>n. 0 < e n" by auto
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4713
      define B where "B n U = (SOME b. infinite {n. f n \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U))" for n U
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4714
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4715
        fix n U
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4716
        assume "infinite {n. f n \<in> U}"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4717
        then have "\<exists>b\<in>k (e n). infinite {i\<in>{n. f n \<in> U}. f i \<in> ball b (e n)}"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4718
          using k f by (intro pigeonhole_infinite_rel) (auto simp: subset_eq)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4719
        then obtain a where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4720
          "a \<in> k (e n)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4721
          "infinite {i \<in> {n. f n \<in> U}. f i \<in> ball a (e n)}" ..
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4722
        then have "\<exists>b. infinite {i. f i \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U)"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4723
          by (intro exI[of _ "ball a (e n) \<inter> U"] exI[of _ a]) (auto simp: ac_simps)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4724
        from someI_ex[OF this]
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4725
        have "infinite {i. f i \<in> B n U}" "\<exists>x. B n U \<subseteq> ball x (e n) \<inter> U"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4726
          unfolding B_def by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4727
      }
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4728
      note B = this
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4729
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4730
      define F where "F = rec_nat (B 0 UNIV) B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4731
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4732
        fix n
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4733
        have "infinite {i. f i \<in> F n}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4734
          by (induct n) (auto simp: F_def B)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4735
      }
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4736
      then have F: "\<And>n. \<exists>x. F (Suc n) \<subseteq> ball x (e n) \<inter> F n"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4737
        using B by (simp add: F_def)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4738
      then have F_dec: "\<And>m n. m \<le> n \<Longrightarrow> F n \<subseteq> F m"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4739
        using decseq_SucI[of F] by (auto simp: decseq_def)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4740
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4741
      obtain sel where sel: "\<And>k i. i < sel k i" "\<And>k i. f (sel k i) \<in> F k"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4742
      proof (atomize_elim, unfold all_conj_distrib[symmetric], intro choice allI)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4743
        fix k i
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4744
        have "infinite ({n. f n \<in> F k} - {.. i})"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4745
          using \<open>infinite {n. f n \<in> F k}\<close> by auto
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4746
        from infinite_imp_nonempty[OF this]
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4747
        show "\<exists>x>i. f x \<in> F k"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4748
          by (simp add: set_eq_iff not_le conj_commute)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4749
      qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4750
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4751
      define t where "t = rec_nat (sel 0 0) (\<lambda>n i. sel (Suc n) i)"
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4752
      have "strict_mono t"
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4753
        unfolding strict_mono_Suc_iff by (simp add: t_def sel)
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4754
      moreover have "\<forall>i. (f \<circ> t) i \<in> s"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4755
        using f by auto
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4756
      moreover
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4757
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4758
        fix n
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4759
        have "(f \<circ> t) n \<in> F n"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4760
          by (cases n) (simp_all add: t_def sel)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4761
      }
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4762
      note t = this
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4763
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4764
      have "Cauchy (f \<circ> t)"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4765
      proof (safe intro!: metric_CauchyI exI elim!: nat_approx_posE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4766
        fix r :: real and N n m
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4767
        assume "1 / Suc N < r" "Suc N \<le> n" "Suc N \<le> m"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4768
        then have "(f \<circ> t) n \<in> F (Suc N)" "(f \<circ> t) m \<in> F (Suc N)" "2 * e N < r"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  4769
          using F_dec t by (auto simp: e_def field_simps of_nat_Suc)
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4770
        with F[of N] obtain x where "dist x ((f \<circ> t) n) < e N" "dist x ((f \<circ> t) m) < e N"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4771
          by (auto simp: subset_eq)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4772
        with dist_triangle[of "(f \<circ> t) m" "(f \<circ> t) n" x] \<open>2 * e N < r\<close>
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4773
        show "dist ((f \<circ> t) m) ((f \<circ> t) n) < r"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4774
          by (simp add: dist_commute)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4775
      qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4776
66447
a1f5c5c26fa6 Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents: 66408
diff changeset
  4777
      ultimately show "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4778
        using assms unfolding complete_def by blast
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4779
    qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4780
  qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4781
qed (metis compact_imp_complete compact_imp_seq_compact seq_compact_imp_totally_bounded)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4782
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4783
lemma cauchy_imp_bounded:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4784
  assumes "Cauchy s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4785
  shows "bounded (range s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4786
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4787
  from assms obtain N :: nat where "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < 1"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4788
    unfolding cauchy_def by force
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4789
  then have N:"\<forall>n. N \<le> n \<longrightarrow> dist (s N) (s n) < 1" by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4790
  moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4791
  have "bounded (s ` {0..N})"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4792
    using finite_imp_bounded[of "s ` {1..N}"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4793
  then obtain a where a:"\<forall>x\<in>s ` {0..N}. dist (s N) x \<le> a"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4794
    unfolding bounded_any_center [where a="s N"] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4795
  ultimately show "?thesis"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4796
    unfolding bounded_any_center [where a="s N"]
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4797
    apply (rule_tac x="max a 1" in exI, auto)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4798
    apply (erule_tac x=y in allE)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4799
    apply (erule_tac x=y in ballE, auto)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4800
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4801
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4802
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4803
instance heine_borel < complete_space
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4804
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4805
  fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4806
  then have "bounded (range f)"
34104
22758f95e624 re-state lemmas using 'range'
huffman
parents: 33758
diff changeset
  4807
    by (rule cauchy_imp_bounded)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4808
  then have "compact (closure (range f))"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4809
    unfolding compact_eq_bounded_closed by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4810
  then have "complete (closure (range f))"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  4811
    by (rule compact_imp_complete)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4812
  moreover have "\<forall>n. f n \<in> closure (range f)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4813
    using closure_subset [of "range f"] by auto
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4814
  ultimately have "\<exists>l\<in>closure (range f). (f \<longlongrightarrow> l) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4815
    using \<open>Cauchy f\<close> unfolding complete_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4816
  then show "convergent f"
36660
1cc4ab4b7ff7 make (X ----> L) an abbreviation for (X ---> L) sequentially
huffman
parents: 36659
diff changeset
  4817
    unfolding convergent_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4818
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4819
44632
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  4820
instance euclidean_space \<subseteq> banach ..
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  4821
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4822
lemma complete_UNIV: "complete (UNIV :: ('a::complete_space) set)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4823
proof (rule completeI)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4824
  fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4825
  then have "convergent f" by (rule Cauchy_convergent)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4826
  then show "\<exists>l\<in>UNIV. f \<longlonglongrightarrow> l" unfolding convergent_def by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4827
qed
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4828
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4829
lemma complete_imp_closed:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4830
  fixes S :: "'a::metric_space set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4831
  assumes "complete S"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4832
  shows "closed S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4833
proof (unfold closed_sequential_limits, clarify)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4834
  fix f x assume "\<forall>n. f n \<in> S" and "f \<longlonglongrightarrow> x"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4835
  from \<open>f \<longlonglongrightarrow> x\<close> have "Cauchy f"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4836
    by (rule LIMSEQ_imp_Cauchy)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4837
  with \<open>complete S\<close> and \<open>\<forall>n. f n \<in> S\<close> obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4838
    by (rule completeE)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4839
  from \<open>f \<longlonglongrightarrow> x\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "x = l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4840
    by (rule LIMSEQ_unique)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4841
  with \<open>l \<in> S\<close> show "x \<in> S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4842
    by simp
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4843
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4844
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4845
lemma complete_Int_closed:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4846
  fixes S :: "'a::metric_space set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4847
  assumes "complete S" and "closed t"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4848
  shows "complete (S \<inter> t)"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4849
proof (rule completeI)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4850
  fix f assume "\<forall>n. f n \<in> S \<inter> t" and "Cauchy f"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4851
  then have "\<forall>n. f n \<in> S" and "\<forall>n. f n \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4852
    by simp_all
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4853
  from \<open>complete S\<close> obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4854
    using \<open>\<forall>n. f n \<in> S\<close> and \<open>Cauchy f\<close> by (rule completeE)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4855
  from \<open>closed t\<close> and \<open>\<forall>n. f n \<in> t\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "l \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4856
    by (rule closed_sequentially)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4857
  with \<open>l \<in> S\<close> and \<open>f \<longlonglongrightarrow> l\<close> show "\<exists>l\<in>S \<inter> t. f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4858
    by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4859
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4860
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4861
lemma complete_closed_subset:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4862
  fixes S :: "'a::metric_space set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4863
  assumes "closed S" and "S \<subseteq> t" and "complete t"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4864
  shows "complete S"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4865
  using assms complete_Int_closed [of t S] by (simp add: Int_absorb1)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4866
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4867
lemma complete_eq_closed:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4868
  fixes S :: "('a::complete_space) set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4869
  shows "complete S \<longleftrightarrow> closed S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4870
proof
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4871
  assume "closed S" then show "complete S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4872
    using subset_UNIV complete_UNIV by (rule complete_closed_subset)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4873
next
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4874
  assume "complete S" then show "closed S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4875
    by (rule complete_imp_closed)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4876
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4877
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4878
lemma convergent_eq_Cauchy:
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4879
  fixes S :: "nat \<Rightarrow> 'a::complete_space"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4880
  shows "(\<exists>l. (S \<longlongrightarrow> l) sequentially) \<longleftrightarrow> Cauchy S"
44632
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  4881
  unfolding Cauchy_convergent_iff convergent_def ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4882
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4883
lemma convergent_imp_bounded:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4884
  fixes S :: "nat \<Rightarrow> 'a::metric_space"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4885
  shows "(S \<longlongrightarrow> l) sequentially \<Longrightarrow> bounded (range S)"
50939
ae7cd20ed118 replace convergent_imp_cauchy by LIMSEQ_imp_Cauchy
hoelzl
parents: 50938
diff changeset
  4886
  by (intro cauchy_imp_bounded LIMSEQ_imp_Cauchy)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4887
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4888
lemma frontier_subset_compact:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4889
  fixes S :: "'a::heine_borel set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  4890
  shows "compact S \<Longrightarrow> frontier S \<subseteq> S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4891
  using frontier_subset_closed compact_eq_bounded_closed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4892
  by blast
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  4893
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4894
subsection \<open>Continuity\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4895
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4896
text\<open>Derive the epsilon-delta forms, which we often use as "definitions"\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4897
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4898
lemma continuous_within_eps_delta:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4899
  "continuous (at x within s) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'\<in> s.  dist x' x < d --> dist (f x') (f x) < e)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4900
  unfolding continuous_within and Lim_within
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4901
  apply auto
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4902
  apply (metis dist_nz dist_self, blast)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4903
  done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4904
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  4905
corollary continuous_at_eps_delta:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4906
  "continuous (at x) f \<longleftrightarrow> (\<forall>e > 0. \<exists>d > 0. \<forall>x'. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  4907
  using continuous_within_eps_delta [of x UNIV f] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4908
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  4909
lemma continuous_at_right_real_increasing:
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4910
  fixes f :: "real \<Rightarrow> real"
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4911
  assumes nondecF: "\<And>x y. x \<le> y \<Longrightarrow> f x \<le> f y"
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4912
  shows "continuous (at_right a) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f (a + d) - f a < e)"
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4913
  apply (simp add: greaterThan_def dist_real_def continuous_within Lim_within_le)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4914
  apply (intro all_cong ex_cong, safe)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4915
  apply (erule_tac x="a + d" in allE, simp)
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4916
  apply (simp add: nondecF field_simps)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4917
  apply (drule nondecF, simp)
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4918
  done
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  4919
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  4920
lemma continuous_at_left_real_increasing:
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  4921
  assumes nondecF: "\<And> x y. x \<le> y \<Longrightarrow> f x \<le> ((f y) :: real)"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  4922
  shows "(continuous (at_left (a :: real)) f) = (\<forall>e > 0. \<exists>delta > 0. f a - f (a - delta) < e)"
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4923
  apply (simp add: lessThan_def dist_real_def continuous_within Lim_within_le)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4924
  apply (intro all_cong ex_cong, safe)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4925
  apply (erule_tac x="a - d" in allE, simp)
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4926
  apply (simp add: nondecF field_simps)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4927
  apply (cut_tac x="a - d" and y=x in nondecF, simp_all)
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  4928
  done
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  4929
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4930
text\<open>Versions in terms of open balls.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4931
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4932
lemma continuous_within_ball:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4933
  "continuous (at x within s) f \<longleftrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4934
    (\<forall>e > 0. \<exists>d > 0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4935
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4936
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4937
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4938
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4939
    fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4940
    assume "e > 0"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4941
    then obtain d where d: "d>0" "\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4942
      using \<open>?lhs\<close>[unfolded continuous_within Lim_within] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4943
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4944
      fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4945
      assume "y \<in> f ` (ball x d \<inter> s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4946
      then have "y \<in> ball (f x) e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4947
        using d(2)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4948
        apply (auto simp: dist_commute)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4949
        apply (erule_tac x=xa in ballE, auto)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4950
        using \<open>e > 0\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4951
        apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4952
        done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4953
    }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4954
    then have "\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4955
      using \<open>d > 0\<close>
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4956
      unfolding subset_eq ball_def by (auto simp: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4957
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4958
  then show ?rhs by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4959
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4960
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4961
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4962
    unfolding continuous_within Lim_within ball_def subset_eq
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4963
    apply (auto simp: dist_commute)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4964
    apply (erule_tac x=e in allE, auto)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4965
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4966
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4967
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4968
lemma continuous_at_ball:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4969
  "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f ` (ball x d) \<subseteq> ball (f x) e)" (is "?lhs = ?rhs")
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4970
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4971
  assume ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4972
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4973
    unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4974
    apply auto
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4975
    apply (erule_tac x=e in allE, auto)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4976
    apply (rule_tac x=d in exI, auto)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4977
    apply (erule_tac x=xa in allE)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4978
    apply (auto simp: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4979
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4980
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4981
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4982
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4983
    unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4984
    apply auto
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4985
    apply (erule_tac x=e in allE, auto)
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4986
    apply (rule_tac x=d in exI, auto)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4987
    apply (erule_tac x="f xa" in allE)
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  4988
    apply (auto simp: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4989
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4990
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4991
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4992
text\<open>Define setwise continuity in terms of limits within the set.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4993
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  4994
lemma continuous_on_iff:
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  4995
  "continuous_on s f \<longleftrightarrow>
36440
89a70297564d simplify definition of continuous_on; generalize some lemmas
huffman
parents: 36439
diff changeset
  4996
    (\<forall>x\<in>s. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4997
  unfolding continuous_on_def Lim_within
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  4998
  by (metis dist_pos_lt dist_self)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4999
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5000
lemma continuous_within_E:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5001
  assumes "continuous (at x within s) f" "e>0"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5002
  obtains d where "d>0"  "\<And>x'. \<lbrakk>x'\<in> s; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5003
  using assms apply (simp add: continuous_within_eps_delta)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5004
  apply (drule spec [of _ e], clarify)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5005
  apply (rule_tac d="d/2" in that, auto)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5006
  done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5007
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5008
lemma continuous_onI [intro?]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5009
  assumes "\<And>x e. \<lbrakk>e > 0; x \<in> s\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) \<le> e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5010
  shows "continuous_on s f"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5011
apply (simp add: continuous_on_iff, clarify)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5012
apply (rule ex_forward [OF assms [OF half_gt_zero]], auto)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5013
done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5014
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5015
text\<open>Some simple consequential lemmas.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5016
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5017
lemma continuous_onE:
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  5018
    assumes "continuous_on s f" "x\<in>s" "e>0"
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5019
    obtains d where "d>0"  "\<And>x'. \<lbrakk>x' \<in> s; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5020
  using assms
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5021
  apply (simp add: continuous_on_iff)
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5022
  apply (elim ballE allE)
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5023
  apply (auto intro: that [where d="d/2" for d])
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5024
  done
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  5025
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5026
lemma uniformly_continuous_onE:
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5027
  assumes "uniformly_continuous_on s f" "0 < e"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5028
  obtains d where "d>0" "\<And>x x'. \<lbrakk>x\<in>s; x'\<in>s; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5029
using assms
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5030
by (auto simp: uniformly_continuous_on_def)
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5031
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5032
lemma continuous_at_imp_continuous_within:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5033
  "continuous (at x) f \<Longrightarrow> continuous (at x within s) f"
60762
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  5034
  unfolding continuous_within continuous_at using Lim_at_imp_Lim_at_within by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5035
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5036
lemma Lim_trivial_limit: "trivial_limit net \<Longrightarrow> (f \<longlongrightarrow> l) net"
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 51475
diff changeset
  5037
  by simp
36440
89a70297564d simplify definition of continuous_on; generalize some lemmas
huffman
parents: 36439
diff changeset
  5038
67443
3abf6a722518 standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents: 67399
diff changeset
  5039
lemmas continuous_on = continuous_on_def \<comment> \<open>legacy theorem name\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5040
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5041
lemma continuous_within_subset:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5042
  "continuous (at x within s) f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> continuous (at x within t) f"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  5043
  unfolding continuous_within by(metis tendsto_within_subset)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5044
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5045
lemma continuous_on_interior:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5046
  "continuous_on s f \<Longrightarrow> x \<in> interior s \<Longrightarrow> continuous (at x) f"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  5047
  by (metis continuous_on_eq_continuous_at continuous_on_subset interiorE)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5048
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5049
lemma continuous_on_eq:
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 61076
diff changeset
  5050
  "\<lbrakk>continuous_on s f; \<And>x. x \<in> s \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> continuous_on s g"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  5051
  unfolding continuous_on_def tendsto_def eventually_at_topological
36440
89a70297564d simplify definition of continuous_on; generalize some lemmas
huffman
parents: 36439
diff changeset
  5052
  by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5053
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5054
text \<open>Characterization of various kinds of continuity in terms of sequences.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5055
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5056
lemma continuous_within_sequentially:
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5057
  fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5058
  shows "continuous (at a within s) f \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5059
    (\<forall>x. (\<forall>n::nat. x n \<in> s) \<and> (x \<longlongrightarrow> a) sequentially
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5060
         \<longrightarrow> ((f \<circ> x) \<longlongrightarrow> f a) sequentially)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5061
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5062
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5063
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5064
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5065
    fix x :: "nat \<Rightarrow> 'a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5066
    assume x: "\<forall>n. x n \<in> s" "\<forall>e>0. eventually (\<lambda>n. dist (x n) a < e) sequentially"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5067
    fix T :: "'b set"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5068
    assume "open T" and "f a \<in> T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5069
    with \<open>?lhs\<close> obtain d where "d>0" and d:"\<forall>x\<in>s. 0 < dist x a \<and> dist x a < d \<longrightarrow> f x \<in> T"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  5070
      unfolding continuous_within tendsto_def eventually_at by auto
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5071
    have "eventually (\<lambda>n. dist (x n) a < d) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5072
      using x(2) \<open>d>0\<close> by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5073
    then have "eventually (\<lambda>n. (f \<circ> x) n \<in> T) sequentially"
46887
cb891d9a23c1 use eventually_elim method
noschinl
parents: 45776
diff changeset
  5074
    proof eventually_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5075
      case (elim n)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5076
      then show ?case
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  5077
        using d x(1) \<open>f a \<in> T\<close> by auto
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5078
    qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5079
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5080
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5081
    unfolding tendsto_iff tendsto_def by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5082
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5083
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5084
  then show ?lhs
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5085
    unfolding continuous_within tendsto_def [where l="f a"]
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5086
    by (simp add: sequentially_imp_eventually_within)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5087
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5088
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5089
lemma continuous_at_sequentially:
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5090
  fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5091
  shows "continuous (at a) f \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5092
    (\<forall>x. (x \<longlongrightarrow> a) sequentially --> ((f \<circ> x) \<longlongrightarrow> f a) sequentially)"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  5093
  using continuous_within_sequentially[of a UNIV f] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5094
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5095
lemma continuous_on_sequentially:
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  5096
  fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  5097
  shows "continuous_on s f \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5098
    (\<forall>x. \<forall>a \<in> s. (\<forall>n. x(n) \<in> s) \<and> (x \<longlongrightarrow> a) sequentially
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5099
      --> ((f \<circ> x) \<longlongrightarrow> f a) sequentially)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5100
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5101
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5102
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5103
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5104
    using continuous_within_sequentially[of _ s f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5105
    unfolding continuous_on_eq_continuous_within
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5106
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5107
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5108
  assume ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5109
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5110
    unfolding continuous_on_eq_continuous_within
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5111
    using continuous_within_sequentially[of _ s f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5112
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5113
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5114
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5115
lemma uniformly_continuous_on_sequentially:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  5116
  "uniformly_continuous_on s f \<longleftrightarrow> (\<forall>x y. (\<forall>n. x n \<in> s) \<and> (\<forall>n. y n \<in> s) \<and>
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5117
    (\<lambda>n. dist (x n) (y n)) \<longlonglongrightarrow> 0 \<longrightarrow> (\<lambda>n. dist (f(x n)) (f(y n))) \<longlonglongrightarrow> 0)" (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5118
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5119
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5120
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5121
    fix x y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5122
    assume x: "\<forall>n. x n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5123
      and y: "\<forall>n. y n \<in> s"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5124
      and xy: "((\<lambda>n. dist (x n) (y n)) \<longlongrightarrow> 0) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5125
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5126
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5127
      assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5128
      then obtain d where "d > 0" and d: "\<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5129
        using \<open>?lhs\<close>[unfolded uniformly_continuous_on_def, THEN spec[where x=e]] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5130
      obtain N where N: "\<forall>n\<ge>N. dist (x n) (y n) < d"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5131
        using xy[unfolded lim_sequentially dist_norm] and \<open>d>0\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5132
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5133
        fix n
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5134
        assume "n\<ge>N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5135
        then have "dist (f (x n)) (f (y n)) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5136
          using N[THEN spec[where x=n]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5137
          using d[THEN bspec[where x="x n"], THEN bspec[where x="y n"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5138
          using x and y
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  5139
          by (simp add: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5140
      }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5141
      then have "\<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5142
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5143
    }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5144
    then have "((\<lambda>n. dist (f(x n)) (f(y n))) \<longlongrightarrow> 0) sequentially"
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  5145
      unfolding lim_sequentially and dist_real_def by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5146
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5147
  then show ?rhs by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5148
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5149
  assume ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5150
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5151
    assume "\<not> ?lhs"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5152
    then obtain e where "e > 0" "\<forall>d>0. \<exists>x\<in>s. \<exists>x'\<in>s. dist x' x < d \<and> \<not> dist (f x') (f x) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5153
      unfolding uniformly_continuous_on_def by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5154
    then obtain fa where fa:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5155
      "\<forall>x. 0 < x \<longrightarrow> fst (fa x) \<in> s \<and> snd (fa x) \<in> s \<and> dist (fst (fa x)) (snd (fa x)) < x \<and> \<not> dist (f (fst (fa x))) (f (snd (fa x))) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5156
      using choice[of "\<lambda>d x. d>0 \<longrightarrow> fst x \<in> s \<and> snd x \<in> s \<and> dist (snd x) (fst x) < d \<and> \<not> dist (f (snd x)) (f (fst x)) < e"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5157
      unfolding Bex_def
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5158
      by (auto simp: dist_commute)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5159
    define x where "x n = fst (fa (inverse (real n + 1)))" for n
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5160
    define y where "y n = snd (fa (inverse (real n + 1)))" for n
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5161
    have xyn: "\<forall>n. x n \<in> s \<and> y n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5162
      and xy0: "\<forall>n. dist (x n) (y n) < inverse (real n + 1)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5163
      and fxy:"\<forall>n. \<not> dist (f (x n)) (f (y n)) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5164
      unfolding x_def and y_def using fa
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5165
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5166
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5167
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5168
      assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5169
      then obtain N :: nat where "N \<noteq> 0" and N: "0 < inverse (real N) \<and> inverse (real N) < e"
62623
dbc62f86a1a9 rationalisation of theorem names esp about "real Archimedian" etc.
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  5170
        unfolding real_arch_inverse[of e] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5171
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5172
        fix n :: nat
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5173
        assume "n \<ge> N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5174
        then have "inverse (real n + 1) < inverse (real N)"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5175
          using of_nat_0_le_iff and \<open>N\<noteq>0\<close> by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5176
        also have "\<dots> < e" using N by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5177
        finally have "inverse (real n + 1) < e" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5178
        then have "dist (x n) (y n) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5179
          using xy0[THEN spec[where x=n]] by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5180
      }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5181
      then have "\<exists>N. \<forall>n\<ge>N. dist (x n) (y n) < e" by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5182
    }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5183
    then have "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5184
      using \<open>?rhs\<close>[THEN spec[where x=x], THEN spec[where x=y]] and xyn
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  5185
      unfolding lim_sequentially dist_real_def by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5186
    then have False using fxy and \<open>e>0\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5187
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5188
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5189
    unfolding uniformly_continuous_on_def by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5190
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5191
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5192
lemma continuous_closed_imp_Cauchy_continuous:
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5193
  fixes S :: "('a::complete_space) set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5194
  shows "\<lbrakk>continuous_on S f; closed S; Cauchy \<sigma>; \<And>n. (\<sigma> n) \<in> S\<rbrakk> \<Longrightarrow> Cauchy(f o \<sigma>)"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5195
  apply (simp add: complete_eq_closed [symmetric] continuous_on_sequentially)
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5196
  by (meson LIMSEQ_imp_Cauchy complete_def)
61915
e9812a95d108 theory for type of bounded linear functions; differentiation under the integral sign
immler
parents: 61907
diff changeset
  5197
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5198
text\<open>The usual transformation theorems.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5199
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5200
lemma continuous_transform_within:
36667
21404f7dec59 generalize some lemmas
huffman
parents: 36660
diff changeset
  5201
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  5202
  assumes "continuous (at x within s) f"
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  5203
    and "0 < d"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5204
    and "x \<in> s"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  5205
    and "\<And>x'. \<lbrakk>x' \<in> s; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5206
  shows "continuous (at x within s) g"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  5207
  using assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5208
  unfolding continuous_within
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5209
  by (force intro: Lim_transform_within)
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5210
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5211
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5212
subsubsection \<open>Structural rules for pointwise continuity\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5213
51361
21e5b6efb317 changed continuous_intros into a named theorems collection
hoelzl
parents: 51351
diff changeset
  5214
lemma continuous_infnorm[continuous_intros]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5215
  "continuous F f \<Longrightarrow> continuous F (\<lambda>x. infnorm (f x))"
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  5216
  unfolding continuous_def by (rule tendsto_infnorm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5217
51361
21e5b6efb317 changed continuous_intros into a named theorems collection
hoelzl
parents: 51351
diff changeset
  5218
lemma continuous_inner[continuous_intros]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5219
  assumes "continuous F f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5220
    and "continuous F g"
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  5221
  shows "continuous F (\<lambda>x. inner (f x) (g x))"
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  5222
  using assms unfolding continuous_def by (rule tendsto_inner)
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  5223
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5224
subsubsection \<open>Structural rules for setwise continuity\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5225
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5226
lemma continuous_on_infnorm[continuous_intros]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5227
  "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. infnorm (f x))"
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  5228
  unfolding continuous_on by (fast intro: tendsto_infnorm)
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  5229
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5230
lemma continuous_on_inner[continuous_intros]:
44531
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  5231
  fixes g :: "'a::topological_space \<Rightarrow> 'b::real_inner"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5232
  assumes "continuous_on s f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5233
    and "continuous_on s g"
44531
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  5234
  shows "continuous_on s (\<lambda>x. inner (f x) (g x))"
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  5235
  using bounded_bilinear_inner assms
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  5236
  by (rule bounded_bilinear.continuous_on)
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  5237
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5238
subsubsection \<open>Structural rules for uniform continuity\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5239
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5240
lemma uniformly_continuous_on_dist[continuous_intros]:
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5241
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::metric_space"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5242
  assumes "uniformly_continuous_on s f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5243
    and "uniformly_continuous_on s g"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5244
  shows "uniformly_continuous_on s (\<lambda>x. dist (f x) (g x))"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5245
proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5246
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5247
    fix a b c d :: 'b
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5248
    have "\<bar>dist a b - dist c d\<bar> \<le> dist a c + dist b d"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5249
      using dist_triangle2 [of a b c] dist_triangle2 [of b c d]
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5250
      using dist_triangle3 [of c d a] dist_triangle [of a d b]
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5251
      by arith
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5252
  } note le = this
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5253
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5254
    fix x y
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5255
    assume f: "(\<lambda>n. dist (f (x n)) (f (y n))) \<longlonglongrightarrow> 0"
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5256
    assume g: "(\<lambda>n. dist (g (x n)) (g (y n))) \<longlonglongrightarrow> 0"
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5257
    have "(\<lambda>n. \<bar>dist (f (x n)) (g (x n)) - dist (f (y n)) (g (y n))\<bar>) \<longlonglongrightarrow> 0"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5258
      by (rule Lim_transform_bound [OF _ tendsto_add_zero [OF f g]],
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5259
        simp add: le)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5260
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5261
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5262
    using assms unfolding uniformly_continuous_on_sequentially
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5263
    unfolding dist_real_def by simp
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5264
qed
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5265
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5266
lemma uniformly_continuous_on_norm[continuous_intros]:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5267
  fixes f :: "'a :: metric_space \<Rightarrow> 'b :: real_normed_vector"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5268
  assumes "uniformly_continuous_on s f"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5269
  shows "uniformly_continuous_on s (\<lambda>x. norm (f x))"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5270
  unfolding norm_conv_dist using assms
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5271
  by (intro uniformly_continuous_on_dist uniformly_continuous_on_const)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5272
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5273
lemma (in bounded_linear) uniformly_continuous_on[continuous_intros]:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5274
  fixes g :: "_::metric_space \<Rightarrow> _"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5275
  assumes "uniformly_continuous_on s g"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5276
  shows "uniformly_continuous_on s (\<lambda>x. f (g x))"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5277
  using assms unfolding uniformly_continuous_on_sequentially
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5278
  unfolding dist_norm tendsto_norm_zero_iff diff[symmetric]
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5279
  by (auto intro: tendsto_zero)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5280
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5281
lemma uniformly_continuous_on_cmul[continuous_intros]:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  5282
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5283
  assumes "uniformly_continuous_on s f"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5284
  shows "uniformly_continuous_on s (\<lambda>x. c *\<^sub>R f(x))"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5285
  using bounded_linear_scaleR_right assms
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5286
  by (rule bounded_linear.uniformly_continuous_on)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5287
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5288
lemma dist_minus:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5289
  fixes x y :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5290
  shows "dist (- x) (- y) = dist x y"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5291
  unfolding dist_norm minus_diff_minus norm_minus_cancel ..
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5292
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5293
lemma uniformly_continuous_on_minus[continuous_intros]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5294
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5295
  shows "uniformly_continuous_on s f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. - f x)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5296
  unfolding uniformly_continuous_on_def dist_minus .
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5297
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5298
lemma uniformly_continuous_on_add[continuous_intros]:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  5299
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5300
  assumes "uniformly_continuous_on s f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5301
    and "uniformly_continuous_on s g"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5302
  shows "uniformly_continuous_on s (\<lambda>x. f x + g x)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5303
  using assms
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5304
  unfolding uniformly_continuous_on_sequentially
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5305
  unfolding dist_norm tendsto_norm_zero_iff add_diff_add
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5306
  by (auto intro: tendsto_add_zero)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5307
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  5308
lemma uniformly_continuous_on_diff[continuous_intros]:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  5309
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5310
  assumes "uniformly_continuous_on s f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5311
    and "uniformly_continuous_on s g"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  5312
  shows "uniformly_continuous_on s (\<lambda>x. f x - g x)"
54230
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 54070
diff changeset
  5313
  using assms uniformly_continuous_on_add [of s f "- g"]
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 54070
diff changeset
  5314
    by (simp add: fun_Compl_def uniformly_continuous_on_minus)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5315
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5316
text \<open>Continuity in terms of open preimages.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5317
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5318
lemma continuous_at_open:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5319
  "continuous (at x) f \<longleftrightarrow> (\<forall>t. open t \<and> f x \<in> t --> (\<exists>s. open s \<and> x \<in> s \<and> (\<forall>x' \<in> s. (f x') \<in> t)))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5320
  unfolding continuous_within_topological [of x UNIV f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5321
  unfolding imp_conjL
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5322
  by (intro all_cong imp_cong ex_cong conj_cong refl) auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5323
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5324
lemma continuous_imp_tendsto:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5325
  assumes "continuous (at x0) f"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5326
    and "x \<longlonglongrightarrow> x0"
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5327
  shows "(f \<circ> x) \<longlonglongrightarrow> (f x0)"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5328
proof (rule topological_tendstoI)
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5329
  fix S
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5330
  assume "open S" "f x0 \<in> S"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5331
  then obtain T where T_def: "open T" "x0 \<in> T" "\<forall>x\<in>T. f x \<in> S"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5332
     using assms continuous_at_open by metis
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5333
  then have "eventually (\<lambda>n. x n \<in> T) sequentially"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5334
    using assms T_def by (auto simp: tendsto_def)
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5335
  then show "eventually (\<lambda>n. (f \<circ> x) n \<in> S) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  5336
    using T_def by (auto elim!: eventually_mono)
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5337
qed
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  5338
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5339
lemma continuous_on_open:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5340
  "continuous_on S f \<longleftrightarrow>
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5341
    (\<forall>T. openin (subtopology euclidean (f ` S)) T \<longrightarrow>
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5342
      openin (subtopology euclidean S) (S \<inter> f -` T))"
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  5343
  unfolding continuous_on_open_invariant openin_open Int_def vimage_def Int_commute
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  5344
  by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong)
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  5345
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5346
lemma continuous_on_open_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5347
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5348
  assumes "f ` S \<subseteq> T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5349
    shows "continuous_on S f \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5350
             (\<forall>U. openin (subtopology euclidean T) U
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5351
                  \<longrightarrow> openin (subtopology euclidean S) (S \<inter> f -` U))"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5352
     (is "?lhs = ?rhs")
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5353
proof
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5354
  assume ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5355
  then show ?rhs
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5356
    apply (clarsimp simp: openin_euclidean_subtopology_iff continuous_on_iff)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5357
    by (metis assms image_subset_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5358
next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5359
  have ope: "openin (subtopology euclidean T) (ball y e \<inter> T)" for y e
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5360
    by (simp add: Int_commute openin_open_Int)
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5361
  assume R [rule_format]: ?rhs
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5362
  show ?lhs
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5363
  proof (clarsimp simp add: continuous_on_iff)
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5364
    fix x and e::real
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5365
    assume "x \<in> S" and "0 < e"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5366
    then have x: "x \<in> S \<inter> (f -` ball (f x) e \<inter> f -` T)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5367
      using assms by auto
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5368
    show "\<exists>d>0. \<forall>x'\<in>S. dist x' x < d \<longrightarrow> dist (f x') (f x) < e"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5369
      using R [of "ball (f x) e \<inter> T"] x
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5370
      by (fastforce simp add: ope openin_euclidean_subtopology_iff [of S] dist_commute)
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5371
  qed
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5372
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5373
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5374
lemma continuous_openin_preimage:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5375
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5376
  shows
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5377
   "\<lbrakk>continuous_on S f; f ` S \<subseteq> T; openin (subtopology euclidean T) U\<rbrakk>
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5378
        \<Longrightarrow> openin (subtopology euclidean S) (S \<inter> f -` U)"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5379
by (simp add: continuous_on_open_gen)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5380
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5381
text \<open>Similarly in terms of closed sets.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5382
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5383
lemma continuous_on_closed:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5384
  "continuous_on S f \<longleftrightarrow>
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5385
    (\<forall>T. closedin (subtopology euclidean (f ` S)) T \<longrightarrow>
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5386
      closedin (subtopology euclidean S) (S \<inter> f -` T))"
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  5387
  unfolding continuous_on_closed_invariant closedin_closed Int_def vimage_def Int_commute
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  5388
  by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5389
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5390
lemma continuous_on_closed_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5391
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5392
  assumes "f ` S \<subseteq> T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5393
    shows "continuous_on S f \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5394
             (\<forall>U. closedin (subtopology euclidean T) U
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5395
                  \<longrightarrow> closedin (subtopology euclidean S) (S \<inter> f -` U))"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5396
     (is "?lhs = ?rhs")
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5397
proof -
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5398
  have *: "U \<subseteq> T \<Longrightarrow> S \<inter> f -` (T - U) = S - (S \<inter> f -` U)" for U
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5399
    using assms by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5400
  show ?thesis
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5401
  proof
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5402
    assume L: ?lhs
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5403
    show ?rhs
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5404
    proof clarify
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5405
      fix U
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5406
      assume "closedin (subtopology euclidean T) U"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5407
      then show "closedin (subtopology euclidean S) (S \<inter> f -` U)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5408
        using L unfolding continuous_on_open_gen [OF assms]
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5409
        by (metis * closedin_def inf_le1 topspace_euclidean_subtopology)
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5410
    qed
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5411
  next
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5412
    assume R [rule_format]: ?rhs
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5413
    show ?lhs
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5414
      unfolding continuous_on_open_gen [OF assms]
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5415
      by (metis * R inf_le1 openin_closedin_eq topspace_euclidean_subtopology)
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5416
  qed
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5417
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5418
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5419
lemma continuous_closedin_preimage_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5420
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5421
  assumes "continuous_on S f" "f ` S \<subseteq> T" "closedin (subtopology euclidean T) U"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5422
    shows "closedin (subtopology euclidean S) (S \<inter> f -` U)"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5423
using assms continuous_on_closed_gen by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5424
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5425
lemma continuous_on_imp_closedin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5426
  assumes "continuous_on S f" "closedin (subtopology euclidean (f ` S)) T"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5427
    shows "closedin (subtopology euclidean S) (S \<inter> f -` T)"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5428
using assms continuous_on_closed by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5429
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  5430
subsection \<open>Half-global and completely global cases.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5431
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  5432
lemma continuous_openin_preimage_gen:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5433
  assumes "continuous_on S f"  "open T"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5434
  shows "openin (subtopology euclidean S) (S \<inter> f -` T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5435
proof -
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5436
  have *: "(S \<inter> f -` T) = (S \<inter> f -` (T \<inter> f ` S))"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5437
    by auto
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5438
  have "openin (subtopology euclidean (f ` S)) (T \<inter> f ` S)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5439
    using openin_open_Int[of T "f ` S", OF assms(2)] unfolding openin_open by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5440
  then show ?thesis
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5441
    using assms(1)[unfolded continuous_on_open, THEN spec[where x="T \<inter> f ` S"]]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5442
    using * by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5443
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5444
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  5445
lemma continuous_closedin_preimage:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5446
  assumes "continuous_on S f" and "closed T"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5447
  shows "closedin (subtopology euclidean S) (S \<inter> f -` T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5448
proof -
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5449
  have *: "(S \<inter> f -` T) = (S \<inter> f -` (T \<inter> f ` S))"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5450
    by auto
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5451
  have "closedin (subtopology euclidean (f ` S)) (T \<inter> f ` S)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5452
    using closedin_closed_Int[of T "f ` S", OF assms(2)]
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  5453
    by (simp add: Int_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5454
  then show ?thesis
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5455
    using assms(1)[unfolded continuous_on_closed, THEN spec[where x="T \<inter> f ` S"]]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5456
    using * by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5457
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5458
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5459
lemma continuous_openin_preimage_eq:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5460
   "continuous_on S f \<longleftrightarrow>
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5461
    (\<forall>T. open T \<longrightarrow> openin (subtopology euclidean S) (S \<inter> f -` T))"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5462
apply safe
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5463
apply (simp add: continuous_openin_preimage_gen)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5464
apply (fastforce simp add: continuous_on_open openin_open)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5465
done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5466
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5467
lemma continuous_closedin_preimage_eq:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5468
   "continuous_on S f \<longleftrightarrow>
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5469
    (\<forall>T. closed T \<longrightarrow> closedin (subtopology euclidean S) (S \<inter> f -` T))"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5470
apply safe
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5471
apply (simp add: continuous_closedin_preimage)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5472
apply (fastforce simp add: continuous_on_closed closedin_closed)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5473
done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  5474
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5475
lemma continuous_open_preimage:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5476
  assumes contf: "continuous_on S f" and "open S" "open T"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5477
  shows "open (S \<inter> f -` T)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5478
proof-
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5479
  obtain U where "open U" "(S \<inter> f -` T) = S \<inter> U"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5480
    using continuous_openin_preimage_gen[OF contf \<open>open T\<close>]
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5481
    unfolding openin_open by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5482
  then show ?thesis
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5483
    using open_Int[of S U, OF \<open>open S\<close>] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5484
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5485
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5486
lemma continuous_closed_preimage:
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5487
  assumes contf: "continuous_on S f" and "closed S" "closed T"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5488
  shows "closed (S \<inter> f -` T)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5489
proof-
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5490
  obtain U where "closed U" "(S \<inter> f -` T) = S \<inter> U"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5491
    using continuous_closedin_preimage[OF contf \<open>closed T\<close>]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5492
    unfolding closedin_closed by auto
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5493
  then show ?thesis using closed_Int[of S U, OF \<open>closed S\<close>] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5494
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5495
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5496
lemma continuous_open_vimage: "open S \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> open (f -` S)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5497
  by (metis continuous_on_eq_continuous_within open_vimage) 
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5498
 
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5499
lemma continuous_closed_vimage: "closed S \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> closed (f -` S)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5500
  by (simp add: closed_vimage continuous_on_eq_continuous_within)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5501
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  5502
lemma interior_image_subset:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5503
  assumes "inj f" "\<And>x. continuous (at x) f"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5504
  shows "interior (f ` S) \<subseteq> f ` (interior S)"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  5505
proof
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5506
  fix x assume "x \<in> interior (f ` S)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5507
  then obtain T where as: "open T" "x \<in> T" "T \<subseteq> f ` S" ..
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5508
  then have "x \<in> f ` S" by auto
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5509
  then obtain y where y: "y \<in> S" "x = f y" by auto
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5510
  have "open (f -` T)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5511
    using assms \<open>open T\<close> by (simp add: continuous_at_imp_continuous_on open_vimage)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  5512
  moreover have "y \<in> vimage f T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5513
    using \<open>x = f y\<close> \<open>x \<in> T\<close> by simp
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5514
  moreover have "vimage f T \<subseteq> S"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5515
    using \<open>T \<subseteq> image f S\<close> \<open>inj f\<close> unfolding inj_on_def subset_eq by auto
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5516
  ultimately have "y \<in> interior S" ..
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5517
  with \<open>x = f y\<close> show "x \<in> f ` interior S" ..
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5518
qed
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5519
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5520
subsection \<open>Topological properties of linear functions.\<close>
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5521
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5522
lemma linear_lim_0:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5523
  assumes "bounded_linear f"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5524
  shows "(f \<longlongrightarrow> 0) (at (0))"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5525
proof -
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5526
  interpret f: bounded_linear f by fact
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5527
  have "(f \<longlongrightarrow> f 0) (at 0)"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5528
    using tendsto_ident_at by (rule f.tendsto)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5529
  then show ?thesis unfolding f.zero .
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5530
qed
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5531
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5532
lemma linear_continuous_at:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5533
  assumes "bounded_linear f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5534
  shows "continuous (at a) f"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5535
  unfolding continuous_at using assms
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5536
  apply (rule bounded_linear.tendsto)
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5537
  apply (rule tendsto_ident_at)
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5538
  done
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5539
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5540
lemma linear_continuous_within:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5541
  "bounded_linear f \<Longrightarrow> continuous (at x within s) f"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5542
  using continuous_at_imp_continuous_within[of x f s] using linear_continuous_at[of f] by auto
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5543
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5544
lemma linear_continuous_on:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5545
  "bounded_linear f \<Longrightarrow> continuous_on s f"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5546
  using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  5547
66827
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5548
subsection \<open>Intervals\<close>
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  5549
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5550
text \<open>Openness of halfspaces.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5551
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5552
lemma open_halfspace_lt: "open {x. inner a x < b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  5553
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5554
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5555
lemma open_halfspace_gt: "open {x. inner a x > b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  5556
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5557
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5558
lemma open_halfspace_component_lt: "open {x::'a::euclidean_space. x\<bullet>i < a}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  5559
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5560
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5561
lemma open_halfspace_component_gt: "open {x::'a::euclidean_space. x\<bullet>i > a}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  5562
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5563
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5564
text \<open>This gives a simple derivation of limit component bounds.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5565
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5566
lemma open_box[intro]: "open (box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5567
proof -
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67155
diff changeset
  5568
  have "open (\<Inter>i\<in>Basis. ((\<bullet>) i) -` {a \<bullet> i <..< b \<bullet> i})"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  5569
    by (auto intro!: continuous_open_vimage continuous_inner continuous_ident continuous_const)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67155
diff changeset
  5570
  also have "(\<Inter>i\<in>Basis. ((\<bullet>) i) -` {a \<bullet> i <..< b \<bullet> i}) = box a b"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5571
    by (auto simp: box_def inner_commute)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5572
  finally show ?thesis .
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5573
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5574
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5575
instance euclidean_space \<subseteq> second_countable_topology
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5576
proof
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5577
  define a where "a f = (\<Sum>i\<in>Basis. fst (f i) *\<^sub>R i)" for f :: "'a \<Rightarrow> real \<times> real"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5578
  then have a: "\<And>f. (\<Sum>i\<in>Basis. fst (f i) *\<^sub>R i) = a f"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5579
    by simp
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5580
  define b where "b f = (\<Sum>i\<in>Basis. snd (f i) *\<^sub>R i)" for f :: "'a \<Rightarrow> real \<times> real"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5581
  then have b: "\<And>f. (\<Sum>i\<in>Basis. snd (f i) *\<^sub>R i) = b f"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5582
    by simp
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5583
  define B where "B = (\<lambda>f. box (a f) (b f)) ` (Basis \<rightarrow>\<^sub>E (\<rat> \<times> \<rat>))"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5584
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5585
  have "Ball B open" by (simp add: B_def open_box)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5586
  moreover have "(\<forall>A. open A \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union>B' = A))"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5587
  proof safe
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5588
    fix A::"'a set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5589
    assume "open A"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5590
    show "\<exists>B'\<subseteq>B. \<Union>B' = A"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5591
      apply (rule exI[of _ "{b\<in>B. b \<subseteq> A}"])
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5592
      apply (subst (3) open_UNION_box[OF \<open>open A\<close>])
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5593
      apply (auto simp: a b B_def)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5594
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5595
  qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5596
  ultimately
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5597
  have "topological_basis B"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5598
    unfolding topological_basis_def by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5599
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5600
  have "countable B"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5601
    unfolding B_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5602
    by (intro countable_image countable_PiE finite_Basis countable_SIGMA countable_rat)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5603
  ultimately show "\<exists>B::'a set set. countable B \<and> open = generate_topology B"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5604
    by (blast intro: topological_basis_imp_subbasis)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5605
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5606
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5607
instance euclidean_space \<subseteq> polish_space ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5608
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5609
lemma closed_cbox[intro]:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5610
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5611
  shows "closed (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5612
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5613
  have "closed (\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5614
    by (intro closed_INT ballI continuous_closed_vimage allI
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5615
      linear_continuous_at closed_real_atLeastAtMost finite_Basis bounded_linear_inner_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5616
  also have "(\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i}) = cbox a b"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5617
    by (auto simp: cbox_def)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5618
  finally show "closed (cbox a b)" .
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5619
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5620
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  5621
lemma interior_cbox [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5622
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5623
  shows "interior (cbox a b) = box a b" (is "?L = ?R")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5624
proof(rule subset_antisym)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5625
  show "?R \<subseteq> ?L"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5626
    using box_subset_cbox open_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5627
    by (rule interior_maximal)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5628
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5629
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5630
    assume "x \<in> interior (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5631
    then obtain s where s: "open s" "x \<in> s" "s \<subseteq> cbox a b" ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5632
    then obtain e where "e>0" and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5633
      unfolding open_dist and subset_eq by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5634
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5635
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5636
      assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5637
      have "dist (x - (e / 2) *\<^sub>R i) x < e"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5638
        and "dist (x + (e / 2) *\<^sub>R i) x < e"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5639
        unfolding dist_norm
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5640
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5641
        unfolding norm_minus_cancel
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5642
        using norm_Basis[OF i] \<open>e>0\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5643
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5644
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5645
      then have "a \<bullet> i \<le> (x - (e / 2) *\<^sub>R i) \<bullet> i" and "(x + (e / 2) *\<^sub>R i) \<bullet> i \<le> b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5646
        using e[THEN spec[where x="x - (e/2) *\<^sub>R i"]]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5647
          and e[THEN spec[where x="x + (e/2) *\<^sub>R i"]]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5648
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5649
        using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5650
        by blast+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5651
      then have "a \<bullet> i < x \<bullet> i" and "x \<bullet> i < b \<bullet> i"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5652
        using \<open>e>0\<close> i
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5653
        by (auto simp: inner_diff_left inner_Basis inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5654
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5655
    then have "x \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5656
      unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5657
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5658
  then show "?L \<subseteq> ?R" ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5659
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5660
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5661
lemma bounded_cbox [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5662
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5663
  shows "bounded (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5664
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5665
  let ?b = "\<Sum>i\<in>Basis. \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5666
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5667
    fix x :: "'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5668
    assume x: "\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5669
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5670
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5671
      assume "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5672
      then have "\<bar>x\<bullet>i\<bar> \<le> \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5673
        using x[THEN bspec[where x=i]] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5674
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5675
    then have "(\<Sum>i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<le> ?b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5676
      apply -
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5677
      apply (rule sum_mono, auto)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5678
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5679
    then have "norm x \<le> ?b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5680
      using norm_le_l1[of x] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5681
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5682
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5683
    unfolding cbox_def bounded_iff by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5684
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5685
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  5686
lemma bounded_box [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5687
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5688
  shows "bounded (box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5689
  using bounded_cbox[of a b]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5690
  using box_subset_cbox[of a b]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5691
  using bounded_subset[of "cbox a b" "box a b"]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5692
  by simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5693
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  5694
lemma not_interval_UNIV [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5695
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5696
  shows "cbox a b \<noteq> UNIV" "box a b \<noteq> UNIV"
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  5697
  using bounded_box[of a b] bounded_cbox[of a b] by force+
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  5698
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  5699
lemma not_interval_UNIV2 [simp]:
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  5700
  fixes a :: "'a::euclidean_space"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  5701
  shows "UNIV \<noteq> cbox a b" "UNIV \<noteq> box a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  5702
  using bounded_box[of a b] bounded_cbox[of a b] by force+
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  5703
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  5704
lemma compact_cbox [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5705
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5706
  shows "compact (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5707
  using bounded_closed_imp_seq_compact[of "cbox a b"] using bounded_cbox[of a b]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5708
  by (auto simp: compact_eq_seq_compact_metric)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5709
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5710
lemma box_midpoint:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5711
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5712
  assumes "box a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5713
  shows "((1/2) *\<^sub>R (a + b)) \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5714
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5715
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5716
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5717
    assume "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5718
    then have "a \<bullet> i < ((1 / 2) *\<^sub>R (a + b)) \<bullet> i \<and> ((1 / 2) *\<^sub>R (a + b)) \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5719
      using assms[unfolded box_ne_empty, THEN bspec[where x=i]] by (auto simp: inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5720
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5721
  then show ?thesis unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5722
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5723
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5724
lemma open_cbox_convex:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5725
  fixes x :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5726
  assumes x: "x \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5727
    and y: "y \<in> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5728
    and e: "0 < e" "e \<le> 1"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5729
  shows "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5730
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5731
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5732
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5733
    assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5734
    have "a \<bullet> i = e * (a \<bullet> i) + (1 - e) * (a \<bullet> i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5735
      unfolding left_diff_distrib by simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5736
    also have "\<dots> < e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5737
      apply (rule add_less_le_mono)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5738
      using e unfolding mult_less_cancel_left and mult_le_cancel_left
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5739
      apply simp_all
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5740
      using x unfolding mem_box using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5741
      apply simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5742
      using y unfolding mem_box using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5743
      apply simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5744
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5745
    finally have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5746
      unfolding inner_simps by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5747
    moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5748
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5749
      have "b \<bullet> i = e * (b\<bullet>i) + (1 - e) * (b\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5750
        unfolding left_diff_distrib by simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5751
      also have "\<dots> > e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)"
66827
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5752
      proof (rule add_less_le_mono)
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5753
        show "e * (x \<bullet> i) < e * (b \<bullet> i)"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5754
          using e(1) i mem_box(1) x by auto
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5755
        show "(1 - e) * (y \<bullet> i) \<le> (1 - e) * (b \<bullet> i)"
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5756
          by (meson diff_ge_0_iff_ge e(2) i mem_box(2) ordered_comm_semiring_class.comm_mult_left_mono y)
c94531b5007d Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
paulson <lp15@cam.ac.uk>
parents: 66794
diff changeset
  5757
      qed
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5758
      finally have "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5759
        unfolding inner_simps by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5760
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5761
    ultimately have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i \<and> (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5762
      by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5763
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5764
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5765
    unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5766
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5767
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  5768
lemma closure_cbox [simp]: "closure (cbox a b) = cbox a b"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  5769
  by (simp add: closed_cbox)
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  5770
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  5771
lemma closure_box [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5772
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5773
   assumes "box a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5774
  shows "closure (box a b) = cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5775
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5776
  have ab: "a <e b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5777
    using assms by (simp add: eucl_less_def box_ne_empty)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5778
  let ?c = "(1 / 2) *\<^sub>R (a + b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5779
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5780
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5781
    assume as:"x \<in> cbox a b"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5782
    define f where [abs_def]: "f n = x + (inverse (real n + 1)) *\<^sub>R (?c - x)" for n
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5783
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5784
      fix n
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5785
      assume fn: "f n <e b \<longrightarrow> a <e f n \<longrightarrow> f n = x" and xc: "x \<noteq> ?c"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5786
      have *: "0 < inverse (real n + 1)" "inverse (real n + 1) \<le> 1"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5787
        unfolding inverse_le_1_iff by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5788
      have "(inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b)) + (1 - inverse (real n + 1)) *\<^sub>R x =
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5789
        x + (inverse (real n + 1)) *\<^sub>R (((1 / 2) *\<^sub>R (a + b)) - x)"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5790
        by (auto simp: algebra_simps)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5791
      then have "f n <e b" and "a <e f n"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5792
        using open_cbox_convex[OF box_midpoint[OF assms] as *]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5793
        unfolding f_def by (auto simp: box_def eucl_less_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5794
      then have False
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5795
        using fn unfolding f_def using xc by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5796
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5797
    moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5798
    {
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5799
      assume "\<not> (f \<longlongrightarrow> x) sequentially"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5800
      {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5801
        fix e :: real
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5802
        assume "e > 0"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5803
        then have "\<exists>N::nat. inverse (real (N + 1)) < e"
62623
dbc62f86a1a9 rationalisation of theorem names esp about "real Archimedian" etc.
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  5804
          using real_arch_inverse[of e]
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5805
          apply (auto simp: Suc_pred')
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5806
          apply (metis Suc_pred' of_nat_Suc)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5807
          done
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5808
        then obtain N :: nat where N: "inverse (real (N + 1)) < e"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5809
          by auto
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5810
        have "inverse (real n + 1) < e" if "N \<le> n" for n
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5811
          by (auto intro!: that le_less_trans [OF _ N])
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5812
        then have "\<exists>N::nat. \<forall>n\<ge>N. inverse (real n + 1) < e" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5813
      }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5814
      then have "((\<lambda>n. inverse (real n + 1)) \<longlongrightarrow> 0) sequentially"
66643
f7e38b8583a0 Correction of typos and a bit of streamlining
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  5815
        unfolding lim_sequentially by(auto simp: dist_norm)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5816
      then have "(f \<longlongrightarrow> x) sequentially"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5817
        unfolding f_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5818
        using tendsto_add[OF tendsto_const, of "\<lambda>n::nat. (inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b) - x)" 0 sequentially x]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5819
        using tendsto_scaleR [OF _ tendsto_const, of "\<lambda>n::nat. inverse (real n + 1)" 0 sequentially "((1 / 2) *\<^sub>R (a + b) - x)"]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5820
        by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5821
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5822
    ultimately have "x \<in> closure (box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5823
      using as and box_midpoint[OF assms]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5824
      unfolding closure_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5825
      unfolding islimpt_sequential
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5826
      by (cases "x=?c") (auto simp: in_box_eucl_less)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5827
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5828
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5829
    using closure_minimal[OF box_subset_cbox, of a b] by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5830
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5831
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5832
lemma bounded_subset_box_symmetric:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5833
  fixes s::"('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5834
  assumes "bounded s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5835
  shows "\<exists>a. s \<subseteq> box (-a) a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5836
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5837
  obtain b where "b>0" and b: "\<forall>x\<in>s. norm x \<le> b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5838
    using assms[unfolded bounded_pos] by auto
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5839
  define a :: 'a where "a = (\<Sum>i\<in>Basis. (b + 1) *\<^sub>R i)"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5840
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5841
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5842
    assume "x \<in> s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5843
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5844
    assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5845
    then have "(-a)\<bullet>i < x\<bullet>i" and "x\<bullet>i < a\<bullet>i"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5846
      using b[THEN bspec[where x=x], OF \<open>x\<in>s\<close>]
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5847
      using Basis_le_norm[OF i, of x]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5848
      unfolding inner_simps and a_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5849
      by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5850
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5851
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5852
    by (auto intro: exI[where x=a] simp add: box_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5853
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5854
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5855
lemma bounded_subset_open_interval:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5856
  fixes s :: "('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5857
  shows "bounded s \<Longrightarrow> (\<exists>a b. s \<subseteq> box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5858
  by (auto dest!: bounded_subset_box_symmetric)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5859
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5860
lemma bounded_subset_cbox_symmetric:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5861
  fixes s :: "('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5862
   assumes "bounded s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5863
  shows "\<exists>a. s \<subseteq> cbox (-a) a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5864
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5865
  obtain a where "s \<subseteq> box (-a) a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5866
    using bounded_subset_box_symmetric[OF assms] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5867
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5868
    using box_subset_cbox[of "-a" a] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5869
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5870
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5871
lemma bounded_subset_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5872
  fixes s :: "('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5873
  shows "bounded s \<Longrightarrow> \<exists>a b. s \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5874
  using bounded_subset_cbox_symmetric[of s] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5875
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5876
lemma frontier_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5877
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5878
  shows "frontier (cbox a b) = cbox a b - box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5879
  unfolding frontier_def unfolding interior_cbox and closure_closed[OF closed_cbox] ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5880
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5881
lemma frontier_box:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5882
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5883
  shows "frontier (box a b) = (if box a b = {} then {} else cbox a b - box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5884
proof (cases "box a b = {}")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5885
  case True
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5886
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5887
    using frontier_empty by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5888
next
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5889
  case False
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5890
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5891
    unfolding frontier_def and closure_box[OF False] and interior_open[OF open_box]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5892
    by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5893
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5894
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
  5895
lemma Int_interval_mixed_eq_empty:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5896
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5897
   assumes "box c d \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5898
  shows "box a b \<inter> cbox c d = {} \<longleftrightarrow> box a b \<inter> box c d = {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5899
  unfolding closure_box[OF assms, symmetric]
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  5900
  unfolding open_Int_closure_eq_empty[OF open_box] ..
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5901
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5902
lemma eucl_less_eq_halfspaces:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  5903
  fixes a :: "'a::euclidean_space"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5904
  shows "{x. x <e a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i < a \<bullet> i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5905
    "{x. a <e x} = (\<Inter>i\<in>Basis. {x. a \<bullet> i < x \<bullet> i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5906
  by (auto simp: eucl_less_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5907
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5908
lemma open_Collect_eucl_less[simp, intro]:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  5909
  fixes a :: "'a::euclidean_space"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5910
  shows "open {x. x <e a}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5911
    "open {x. a <e x}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5912
  by (auto simp: eucl_less_eq_halfspaces open_halfspace_component_lt open_halfspace_component_gt)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  5913
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  5914
no_notation
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  5915
  eucl_less (infix "<e" 50)
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  5916
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5917
end