src/HOL/Analysis/Topology_Euclidean_Space.thy
author paulson <lp15@cam.ac.uk>
Mon, 09 Jan 2017 14:00:13 +0000
changeset 64845 e5d4bc2016a6
parent 64791 05a2b3b20664
child 64910 6108dddad9f0
permissions -rw-r--r--
Advanced topology
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
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    10
imports
61880
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
    11
  "~~/src/HOL/Library/Indicator_Function"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
    12
  "~~/src/HOL/Library/Countable_Set"
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
    13
  "~~/src/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:
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
    92
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> countable (F i)) \<Longrightarrow> countable (PiE I F)"
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
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    95
lemma continuous_on_cases:
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    96
  "closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t g \<Longrightarrow>
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    97
    \<forall>x. (x\<in>s \<and> \<not> P x) \<or> (x \<in> t \<and> P x) \<longrightarrow> f x = g x \<Longrightarrow>
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    98
    continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)"
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    99
  by (rule continuous_on_If) auto
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
   100
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   101
lemma open_sums:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   102
  fixes T :: "('b::real_normed_vector) set"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   103
  assumes "open S \<or> open T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   104
  shows "open (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   105
  using assms
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   106
proof
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   107
  assume S: "open S"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   108
  show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   109
  proof (clarsimp simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   110
    fix x y
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   111
    assume "x \<in> S" "y \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   112
    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
   113
      by (auto simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   114
    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
   115
      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
   116
    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
   117
      using \<open>0 < e\<close> \<open>x \<in> S\<close> by blast
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   118
  qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   119
next
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   120
  assume T: "open T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   121
  show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   122
  proof (clarsimp simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   123
    fix x y
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   124
    assume "x \<in> S" "y \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   125
    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
   126
      by (auto simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   127
    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
   128
      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
   129
    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
   130
      using \<open>0 < e\<close> \<open>y \<in> T\<close> by blast
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   131
  qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   132
qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   133
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   134
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   135
subsection \<open>Topological Basis\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   136
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   137
context topological_space
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   138
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   139
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   140
definition "topological_basis B \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   141
  (\<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
   142
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   143
lemma topological_basis:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   144
  "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
   145
  unfolding topological_basis_def
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   146
  apply safe
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   147
     apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   148
    apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   149
   apply (erule_tac x="x" in allE)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   150
   apply simp
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   151
   apply (rule_tac x="{x}" in exI)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   152
  apply auto
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   153
  done
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   154
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   155
lemma topological_basis_iff:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   156
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   157
  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
   158
    (is "_ \<longleftrightarrow> ?rhs")
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   159
proof safe
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   160
  fix O' and x::'a
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   161
  assume H: "topological_basis B" "open O'" "x \<in> O'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   162
  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
   163
  then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   164
  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
   165
next
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   166
  assume H: ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   167
  show "topological_basis B"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   168
    using assms unfolding topological_basis_def
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   169
  proof safe
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   170
    fix O' :: "'a set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   171
    assume "open O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   172
    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
   173
      by (force intro: bchoice simp: Bex_def)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   174
    then show "\<exists>B'\<subseteq>B. \<Union>B' = O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   175
      by (auto intro: exI[where x="{f x |x. x \<in> O'}"])
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   176
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   177
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   178
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   179
lemma topological_basisI:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   180
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   181
    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
   182
  shows "topological_basis B"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   183
  using assms by (subst topological_basis_iff) auto
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   184
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   185
lemma topological_basisE:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   186
  fixes O'
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   187
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   188
    and "open O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   189
    and "x \<in> O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   190
  obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   191
proof atomize_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   192
  from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   193
    by (simp add: topological_basis_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   194
  with topological_basis_iff assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   195
  show  "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   196
    using assms by (simp add: Bex_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   197
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   198
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   199
lemma topological_basis_open:
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   200
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   201
    and "X \<in> B"
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   202
  shows "open X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   203
  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
   204
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   205
lemma topological_basis_imp_subbasis:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   206
  assumes B: "topological_basis B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   207
  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
   208
proof (intro ext iffI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   209
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   210
  assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   211
  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
   212
    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
   213
  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
   214
    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
   215
next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   216
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   217
  assume "generate_topology B S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   218
  then show "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   219
    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
   220
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   221
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   222
lemma basis_dense:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   223
  fixes B :: "'a set set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   224
    and f :: "'a set \<Rightarrow> 'a"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   225
  assumes "topological_basis B"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   226
    and choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   227
  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
   228
proof (intro allI impI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   229
  fix X :: "'a set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   230
  assume "open X" and "X \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   231
  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
   232
  obtain B' where "B' \<in> B" "f X \<in> B'" "B' \<subseteq> X" .
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   233
  then show "\<exists>B'\<in>B. f B' \<in> X"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   234
    by (auto intro!: choosefrom_basis)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   235
qed
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   236
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   237
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   238
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   239
lemma topological_basis_prod:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   240
  assumes A: "topological_basis A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   241
    and B: "topological_basis B"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   242
  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
   243
  unfolding topological_basis_def
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   244
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   245
  fix S :: "('a \<times> 'b) set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   246
  assume "open S"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   247
  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
   248
  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
   249
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   250
    assume "(x, y) \<in> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   251
    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
   252
    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
   253
      by (metis mem_Sigma_iff)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   254
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   255
    from A a obtain A0 where "A0 \<in> A" "x \<in> A0" "A0 \<subseteq> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   256
      by (rule topological_basisE)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   257
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   258
    from B b obtain B0 where "B0 \<in> B" "y \<in> B0" "B0 \<subseteq> b"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   259
      by (rule topological_basisE)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   260
    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
   261
      by (intro UN_I[of "(A0, B0)"]) auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   262
  qed auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   263
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
   264
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   265
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   266
subsection \<open>Countable Basis\<close>
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   267
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   268
locale countable_basis =
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   269
  fixes B :: "'a::topological_space set set"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   270
  assumes is_basis: "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   271
    and countable_basis: "countable B"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   272
begin
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   273
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   274
lemma open_countable_basis_ex:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   275
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   276
  shows "\<exists>B' \<subseteq> B. X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   277
  using assms countable_basis is_basis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   278
  unfolding topological_basis_def by blast
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   279
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   280
lemma open_countable_basisE:
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   281
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   282
  obtains B' where "B' \<subseteq> B" "X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   283
  using assms open_countable_basis_ex
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   284
  by (atomize_elim) simp
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   285
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   286
lemma countable_dense_exists:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   287
  "\<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
   288
proof -
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   289
  let ?f = "(\<lambda>B'. SOME x. x \<in> B')"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   290
  have "countable (?f ` B)" using countable_basis by simp
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   291
  with basis_dense[OF is_basis, of ?f] show ?thesis
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   292
    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
   293
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   294
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   295
lemma countable_dense_setE:
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   296
  obtains D :: "'a set"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   297
  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
   298
  using countable_dense_exists by blast
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   299
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   300
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   301
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   302
lemma (in first_countable_topology) first_countable_basisE:
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   303
  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
   304
    "\<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
   305
  using first_countable_basis[of x]
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   306
  apply atomize_elim
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   307
  apply (elim exE)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   308
  apply (rule_tac x="range A" in exI)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   309
  apply auto
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   310
  done
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   311
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   312
lemma (in first_countable_topology) first_countable_basis_Int_stableE:
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   313
  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
   314
    "\<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
   315
    "\<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
   316
proof atomize_elim
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   317
  obtain A' where A':
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   318
    "countable A'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   319
    "\<And>a. a \<in> A' \<Longrightarrow> x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   320
    "\<And>a. a \<in> A' \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   321
    "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A'. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   322
    by (rule first_countable_basisE) blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   323
  define A where [abs_def]:
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   324
    "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
   325
  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
   326
        (\<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
   327
  proof (safe intro!: exI[where x=A])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   328
    show "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   329
      unfolding A_def by (intro countable_image countable_Collect_finite)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   330
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   331
    assume "a \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   332
    then show "x \<in> a" "open a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   333
      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
   334
  next
52141
eff000cab70f weaker precendence of syntax for big intersection and union on sets
haftmann
parents: 51773
diff changeset
   335
    let ?int = "\<lambda>N. \<Inter>(from_nat_into A' ` N)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   336
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   337
    assume "a \<in> A" "b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   338
    then obtain N M where "a = ?int N" "b = ?int M" "finite (N \<union> M)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   339
      by (auto simp: A_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   340
    then show "a \<inter> b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   341
      by (auto simp: A_def intro!: image_eqI[where x="N \<union> M"])
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   342
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   343
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   344
    assume "open S" "x \<in> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   345
    then obtain a where a: "a\<in>A'" "a \<subseteq> S" using A' by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   346
    then show "\<exists>a\<in>A. a \<subseteq> S" using a A'
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   347
      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
   348
  qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   349
qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   350
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   351
lemma (in topological_space) first_countableI:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   352
  assumes "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   353
    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
   354
    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
   355
  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
   356
proof (safe intro!: exI[of _ "from_nat_into A"])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   357
  fix i
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   358
  have "A \<noteq> {}" using 2[of UNIV] by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   359
  show "x \<in> from_nat_into A i" "open (from_nat_into A i)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   360
    using range_from_nat_into_subset[OF \<open>A \<noteq> {}\<close>] 1 by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   361
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   362
  fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   363
  assume "open S" "x\<in>S" from 2[OF this]
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   364
  show "\<exists>i. from_nat_into A i \<subseteq> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   365
    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
   366
qed
51350
490f34774a9a eventually nhds represented using sequentially
hoelzl
parents: 51349
diff changeset
   367
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   368
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   369
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   370
  fix x :: "'a \<times> 'b"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   371
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   372
      "countable A"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   373
      "\<And>a. a \<in> A \<Longrightarrow> fst x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   374
      "\<And>a. a \<in> A \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   375
      "\<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
   376
    by (rule first_countable_basisE[of "fst x"]) blast
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   377
  obtain B where B:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   378
      "countable B"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   379
      "\<And>a. a \<in> B \<Longrightarrow> snd x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   380
      "\<And>a. a \<in> B \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   381
      "\<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
   382
    by (rule first_countable_basisE[of "snd x"]) blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   383
  show "\<exists>A::nat \<Rightarrow> ('a \<times> 'b) set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   384
    (\<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
   385
  proof (rule first_countableI[of "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   386
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   387
    assume x: "a \<in> A" "b \<in> B"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   388
    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
   389
      unfolding mem_Times_iff
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   390
      by (auto intro: open_Times)
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   391
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   392
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   393
    assume "open S" "x \<in> S"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   394
    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
   395
      by (rule open_prod_elim)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   396
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   397
    from a'b' A(4)[of a'] B(4)[of b']
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   398
    obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   399
      by auto
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   400
    ultimately
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   401
    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
   402
      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
   403
  qed (simp add: A B)
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   404
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   405
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   406
class second_countable_topology = topological_space +
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   407
  assumes ex_countable_subbasis:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   408
    "\<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
   409
begin
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   410
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   411
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
   412
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   413
  from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   414
    by blast
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   415
  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
   416
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   417
  show ?thesis
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   418
  proof (intro exI conjI)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   419
    show "countable ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   420
      by (intro countable_image countable_Collect_finite_subset B)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   421
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   422
      fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   423
      assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   424
      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
   425
        unfolding B
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   426
      proof induct
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   427
        case UNIV
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   428
        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
   429
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   430
        case (Int a b)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   431
        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
   432
          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
   433
          by blast
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   434
        show ?case
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   435
          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
   436
          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
   437
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   438
        case (UN K)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   439
        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
   440
        then obtain k where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   441
            "\<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
   442
          unfolding bchoice_iff ..
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   443
        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
   444
          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
   445
      next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   446
        case (Basis S)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   447
        then show ?case
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   448
          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
   449
      qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   450
      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
   451
        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
   452
    then show "topological_basis ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   453
      unfolding topological_space_class.topological_basis_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   454
      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
   455
         (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
   456
  qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   457
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   458
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   459
end
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   460
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   461
sublocale second_countable_topology <
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   462
  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
   463
  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
   464
  by unfold_locales safe
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   465
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   466
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
   467
proof
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   468
  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
   469
    using ex_countable_basis by auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   470
  moreover
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   471
  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
   472
    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
   473
  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
   474
    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
   475
      topological_basis_imp_subbasis)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   476
qed
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   477
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   478
instance second_countable_topology \<subseteq> first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   479
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   480
  fix x :: 'a
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   481
  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
   482
  then have B: "countable B" "topological_basis B"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   483
    using countable_basis is_basis
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   484
    by (auto simp: countable_basis is_basis)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   485
  then show "\<exists>A::nat \<Rightarrow> 'a set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   486
    (\<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
   487
    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
   488
       (fastforce simp: topological_space_class.topological_basis_def)+
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   489
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   490
64320
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   491
instance nat :: second_countable_topology
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   492
proof
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   493
  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
   494
    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
   495
qed
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   496
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   497
lemma countable_separating_set_linorder1:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   498
  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
   499
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   500
  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
   501
  define B1 where "B1 = {(LEAST x. x \<in> U)| U. U \<in> A}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   502
  then have "countable B1" using `countable A` by (simp add: Setcompr_eq_image)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   503
  define B2 where "B2 = {(SOME x. x \<in> U)| U. U \<in> A}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   504
  then have "countable B2" using `countable A` by (simp add: Setcompr_eq_image)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   505
  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
   506
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   507
    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
   508
    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
   509
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   510
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   511
    moreover have "z \<in> U" using z U_def by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   512
    ultimately obtain V where "V \<in> A" "z \<in> V" "V \<subseteq> U" using topological_basisE[OF `topological_basis A`] by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   513
    define w where "w = (SOME x. x \<in> V)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   514
    then have "w \<in> V" using `z \<in> V` by (metis someI2)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   515
    then have "x < w \<and> w \<le> y" using `w \<in> V` `V \<subseteq> U` U_def by fastforce
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   516
    moreover have "w \<in> B1 \<union> B2" using w_def B2_def `V \<in> A` by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   517
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   518
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   519
    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
   520
    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
   521
    define U where "U = {x<..}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   522
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   523
    moreover have "y \<in> U" using `x < y` U_def by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   524
    ultimately obtain "V" where "V \<in> A" "y \<in> V" "V \<subseteq> U" using topological_basisE[OF `topological_basis A`] by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   525
    have "U = {y..}" unfolding U_def using * `x < y` by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   526
    then have "V \<subseteq> {y..}" using `V \<subseteq> U` by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   527
    then have "(LEAST w. w \<in> V) = y" using `y \<in> V` by (meson Least_equality atLeast_iff subsetCE)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   528
    then have "y \<in> B1 \<union> B2" using `V \<in> A` B1_def by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   529
    moreover have "x < y \<and> y \<le> y" using `x < y` by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   530
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   531
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   532
  moreover have "countable (B1 \<union> B2)" using `countable B1` `countable B2` by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   533
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   534
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   535
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   536
lemma countable_separating_set_linorder2:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   537
  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
   538
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   539
  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
   540
  define B1 where "B1 = {(GREATEST x. x \<in> U) | U. U \<in> A}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   541
  then have "countable B1" using `countable A` by (simp add: Setcompr_eq_image)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   542
  define B2 where "B2 = {(SOME x. x \<in> U)| U. U \<in> A}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   543
  then have "countable B2" using `countable A` by (simp add: Setcompr_eq_image)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   544
  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
   545
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   546
    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
   547
    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
   548
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   549
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   550
    moreover have "z \<in> U" using z U_def by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   551
    ultimately obtain "V" where "V \<in> A" "z \<in> V" "V \<subseteq> U" using topological_basisE[OF `topological_basis A`] by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   552
    define w where "w = (SOME x. x \<in> V)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   553
    then have "w \<in> V" using `z \<in> V` by (metis someI2)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   554
    then have "x \<le> w \<and> w < y" using `w \<in> V` `V \<subseteq> U` U_def by fastforce
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   555
    moreover have "w \<in> B1 \<union> B2" using w_def B2_def `V \<in> A` by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   556
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   557
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   558
    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
   559
    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
   560
    define U where "U = {..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   561
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   562
    moreover have "x \<in> U" using `x < y` U_def by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   563
    ultimately obtain "V" where "V \<in> A" "x \<in> V" "V \<subseteq> U" using topological_basisE[OF `topological_basis A`] by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   564
    have "U = {..x}" unfolding U_def using * `x < y` by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   565
    then have "V \<subseteq> {..x}" using `V \<subseteq> U` by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   566
    then have "(GREATEST x. x \<in> V) = x" using `x \<in> V` by (meson Greatest_equality atMost_iff subsetCE)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   567
    then have "x \<in> B1 \<union> B2" using `V \<in> A` B1_def by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   568
    moreover have "x \<le> x \<and> x < y" using `x < y` by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   569
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   570
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   571
  moreover have "countable (B1 \<union> B2)" using `countable B1` `countable B2` by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   572
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   573
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   574
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   575
lemma countable_separating_set_dense_linorder:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   576
  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
   577
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   578
  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
   579
    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
   580
  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
   581
  proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   582
    obtain z where "x < z" "z < y" using `x < y` dense by blast
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   583
    then obtain b where "b \<in> B" "x < b \<and> b \<le> z" using B(2) by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   584
    then have "x < b \<and> b < y" using `z < y` by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   585
    then show ?thesis using `b \<in> B` by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   586
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   587
  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
   588
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   589
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   590
subsection \<open>Polish spaces\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   591
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   592
text \<open>Textbooks define Polish spaces as completely metrizable.
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   593
  We assume the topology to be complete for a given metric.\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   594
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   595
class polish_space = complete_space + second_countable_topology
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   596
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   597
subsection \<open>General notion of a topology as a value\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   598
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   599
definition "istopology L \<longleftrightarrow>
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   600
  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
   601
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 49711
diff changeset
   602
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   603
  morphisms "openin" "topology"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   604
  unfolding istopology_def by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   605
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
   606
lemma istopology_openin[intro]: "istopology(openin U)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   607
  using openin[of U] by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   608
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   609
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
   610
  using topology_inverse[unfolded mem_Collect_eq] .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   611
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   612
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
   613
  using topology_inverse[of U] istopology_openin[of "topology U"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   614
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   615
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   616
proof
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   617
  assume "T1 = T2"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   618
  then show "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   619
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   620
  assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   621
  then have "openin T1 = openin T2" by (simp add: fun_eq_iff)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   622
  then have "topology (openin T1) = topology (openin T2)" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   623
  then show "T1 = T2" unfolding openin_inverse .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   624
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   625
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   626
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
   627
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   628
definition "topspace T = \<Union>{S. openin T S}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   629
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   630
subsubsection \<open>Main properties of open sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   631
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   632
lemma openin_clauses:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   633
  fixes U :: "'a topology"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   634
  shows
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   635
    "openin U {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   636
    "\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   637
    "\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   638
  using openin[of U] unfolding istopology_def mem_Collect_eq by fast+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   639
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   640
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   641
  unfolding topspace_def by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   642
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   643
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
   644
  by (rule openin_clauses)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   645
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   646
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
   647
  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
   648
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   649
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
   650
  using openin_clauses by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   651
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   652
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
   653
  using openin_Union[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   654
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   655
lemma openin_topspace[intro, simp]: "openin U (topspace 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
   656
  by (force simp add: openin_Union topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   657
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   658
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
   659
  (is "?lhs \<longleftrightarrow> ?rhs")
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   660
proof
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   661
  assume ?lhs
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   662
  then show ?rhs by auto
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   663
next
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   664
  assume H: ?rhs
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   665
  let ?t = "\<Union>{T. openin U 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
   666
  have "openin U ?t" by (force simp add: openin_Union)
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   667
  also have "?t = S" using H by auto
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   668
  finally show "openin U S" .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   669
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   670
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   671
lemma openin_INT [intro]:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   672
  assumes "finite I"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   673
          "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   674
  shows "openin T ((\<Inter>i \<in> I. U i) \<inter> topspace T)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   675
using assms by (induct, auto simp add: inf_sup_aci(2) openin_Int)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   676
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   677
lemma openin_INT2 [intro]:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   678
  assumes "finite I" "I \<noteq> {}"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   679
          "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   680
  shows "openin T (\<Inter>i \<in> I. U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   681
proof -
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   682
  have "(\<Inter>i \<in> I. U i) \<subseteq> topspace T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   683
    using `I \<noteq> {}` openin_subset[OF assms(3)] by auto
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   684
  then show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   685
    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
   686
qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   687
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   688
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   689
subsubsection \<open>Closed sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   690
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   691
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
   692
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   693
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   694
  by (metis closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   695
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   696
lemma closedin_empty[simp]: "closedin U {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   697
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   698
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   699
lemma closedin_topspace[intro, simp]: "closedin U (topspace U)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   700
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   701
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   702
lemma closedin_Un[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<union> T)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   703
  by (auto simp add: Diff_Un closedin_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   704
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   705
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union>{A - s|s. s\<in>S}"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   706
  by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   707
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   708
lemma closedin_Union:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   709
  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
   710
    shows "closedin U (\<Union>S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   711
  using assms by induction auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   712
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   713
lemma closedin_Inter[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   714
  assumes Ke: "K \<noteq> {}"
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   715
    and Kc: "\<And>S. S \<in>K \<Longrightarrow> closedin U S"
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   716
  shows "closedin U (\<Inter>K)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   717
  using Ke Kc unfolding closedin_def Diff_Inter by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   718
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   719
lemma closedin_INT[intro]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   720
  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
   721
  shows "closedin U (\<Inter>x\<in>A. B x)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   722
  apply (rule closedin_Inter)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   723
  using assms
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   724
  apply auto
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   725
  done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   726
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   727
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
   728
  using closedin_Inter[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   729
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   730
lemma openin_closedin_eq: "openin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> closedin U (topspace U - S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   731
  apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   732
  apply (metis openin_subset subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   733
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   734
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   735
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
   736
  by (simp add: openin_closedin_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   737
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   738
lemma openin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   739
  assumes oS: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   740
    and cT: "closedin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   741
  shows "openin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   742
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   743
  have "S - T = S \<inter> (topspace U - T)" using openin_subset[of U S]  oS cT
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   744
    by (auto simp add: topspace_def openin_subset)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   745
  then show ?thesis using oS cT
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   746
    by (auto simp add: closedin_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   747
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   748
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   749
lemma closedin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   750
  assumes oS: "closedin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   751
    and cT: "openin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   752
  shows "closedin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   753
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   754
  have "S - T = S \<inter> (topspace U - T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   755
    using closedin_subset[of U S] oS cT by (auto simp add: topspace_def)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   756
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   757
    using oS cT by (auto simp add: openin_closedin_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   758
qed
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   759
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   760
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   761
subsubsection \<open>Subspace topology\<close>
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   762
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   763
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
   764
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   765
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
   766
  (is "istopology ?L")
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   767
proof -
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   768
  have "?L {}" by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   769
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   770
    fix A B
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   771
    assume A: "?L A" and B: "?L B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   772
    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
   773
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   774
    have "A \<inter> B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   775
      using Sa Sb by blast+
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   776
    then have "?L (A \<inter> B)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   777
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   778
  moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   779
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   780
    fix K
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   781
    assume K: "K \<subseteq> Collect ?L"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   782
    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
   783
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   784
    from K[unfolded th0 subset_image_iff]
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   785
    obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   786
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   787
    have "\<Union>K = (\<Union>Sk) \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   788
      using Sk by auto
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   789
    moreover have "openin U (\<Union>Sk)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   790
      using Sk by (auto simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   791
    ultimately have "?L (\<Union>K)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   792
  }
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   793
  ultimately show ?thesis
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
   794
    unfolding subset_eq mem_Collect_eq istopology_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   795
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   796
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   797
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
   798
  unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   799
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   800
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   801
lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \<inter> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   802
  by (auto simp add: topspace_def openin_subtopology)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   803
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   804
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
   805
  unfolding closedin_def topspace_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   806
  by (auto simp add: openin_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   807
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   808
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   809
  unfolding openin_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   810
  by auto (metis IntD1 in_mono openin_subset)
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   811
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   812
lemma subtopology_superset:
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   813
  assumes UV: "topspace U \<subseteq> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   814
  shows "subtopology U V = U"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   815
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   816
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   817
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   818
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   819
      fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   820
      assume T: "openin U T" "S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   821
      from T openin_subset[OF T(1)] UV have eq: "S = T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   822
        by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   823
      have "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   824
        unfolding eq using T by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   825
    }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   826
    moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   827
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   828
      assume S: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   829
      then have "\<exists>T. openin U T \<and> S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   830
        using openin_subset[OF S] UV by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   831
    }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   832
    ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   833
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   834
  }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   835
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   836
    unfolding topology_eq openin_subtopology by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   837
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   838
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   839
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   840
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   841
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   842
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   843
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   844
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   845
lemma openin_subtopology_empty:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   846
   "openin (subtopology U {}) S \<longleftrightarrow> S = {}"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   847
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
   848
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   849
lemma closedin_subtopology_empty:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   850
   "closedin (subtopology U {}) S \<longleftrightarrow> S = {}"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   851
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
   852
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   853
lemma closedin_subtopology_refl [simp]:
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   854
   "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
   855
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
   856
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   857
lemma openin_imp_subset:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   858
   "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
   859
by (metis Int_iff openin_subtopology subsetI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   860
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   861
lemma closedin_imp_subset:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   862
   "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
   863
by (simp add: closedin_def topspace_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   864
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   865
lemma openin_subtopology_Un:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   866
    "openin (subtopology U T) S \<and> openin (subtopology U u) S
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   867
     \<Longrightarrow> openin (subtopology U (T \<union> u)) S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   868
by (simp add: openin_subtopology) blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
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])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   880
  apply (auto simp add: 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"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   886
  by (force simp add: 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
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   894
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
   895
  using openI by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   896
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   897
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
   898
  by (metis openin_topspace topspace_euclidean_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   899
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   900
text \<open>Basic "localization" results are handy for connectedness.\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   901
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   902
lemma openin_open: "openin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. open T \<and> (S = U \<inter> T))"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   903
  by (auto simp add: openin_subtopology)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   904
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   905
lemma openin_Int_open:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   906
   "\<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
   907
        \<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
   908
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
   909
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   910
lemma openin_open_Int[intro]: "open S \<Longrightarrow> openin (subtopology euclidean U) (U \<inter> S)"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   911
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   912
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   913
lemma open_openin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   914
  "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
   915
  by (metis Int_absorb1  openin_open_Int)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   916
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   917
lemma open_subset: "S \<subseteq> T \<Longrightarrow> open S \<Longrightarrow> openin (subtopology euclidean T) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   918
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   919
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   920
lemma closedin_closed: "closedin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. closed T \<and> S = U \<inter> T)"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   921
  by (simp add: closedin_subtopology closed_closedin Int_ac)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   922
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   923
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
   924
  by (metis closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   925
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   926
lemma closed_subset: "S \<subseteq> T \<Longrightarrow> closed S \<Longrightarrow> closedin (subtopology euclidean T) S"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   927
  by (auto simp add: closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   928
64791
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   929
lemma closedin_closed_subset:
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   930
 "\<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
   931
             \<Longrightarrow> closedin (subtopology euclidean T) S"
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   932
  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
   933
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   934
lemma finite_imp_closedin:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   935
  fixes S :: "'a::t1_space set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   936
  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
   937
    by (simp add: finite_imp_closed closed_subset)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   938
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   939
lemma closedin_singleton [simp]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   940
  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
   941
  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
   942
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
   943
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   944
lemma openin_euclidean_subtopology_iff:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   945
  fixes S U :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   946
  shows "openin (subtopology euclidean U) S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   947
    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
   948
  (is "?lhs \<longleftrightarrow> ?rhs")
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   949
proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   950
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   951
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   952
    unfolding openin_open open_dist by blast
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   953
next
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   954
  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
   955
  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
   956
    unfolding T_def
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   957
    apply clarsimp
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   958
    apply (rule_tac x="d - dist x a" in exI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   959
    apply (clarsimp simp add: less_diff_eq)
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   960
    by (metis dist_commute dist_triangle_lt)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   961
  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
   962
    unfolding T_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   963
    by auto (metis dist_self)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   964
  from 1 2 show ?lhs
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   965
    unfolding openin_open open_dist by fast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   966
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
   967
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
   968
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
   969
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   970
       ~(\<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
   971
                 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
   972
                 s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> 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
   973
  apply (simp add: connected_def openin_open, safe)
63988
wenzelm
parents: 63967
diff changeset
   974
  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
   975
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   976
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
   977
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
   978
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   979
       ~(\<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
   980
                 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
   981
                 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
   982
                 e1 \<noteq> {} \<and> e2 \<noteq> {})"
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
   983
  apply (simp add: connected_openin, safe)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   984
  apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   985
  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
   986
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
   987
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
   988
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   989
       ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   990
             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
   991
             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
   992
             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
   993
             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
   994
proof -
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   995
  { 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
   996
    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
   997
       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
   998
       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
   999
       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
  1000
    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
  1001
    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
  1002
      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
  1003
    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
  1004
      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
  1005
    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
  1006
      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
  1007
    then have False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1008
      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
  1009
  } note * = this
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1010
  show ?thesis
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1011
    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
  1012
    apply (safe; simp)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1013
    apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1014
    apply (blast intro: *)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1015
    done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1016
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1017
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
  1018
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
  1019
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1020
           ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1021
                 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
  1022
                 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
  1023
                 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
  1024
                 e1 \<noteq> {} \<and> e2 \<noteq> {})"
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
  1025
  apply (simp add: connected_closedin, safe)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1026
  apply blast
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"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1037
  by (auto simp add: openin_open intro: openin_trans)
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"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1042
  by (auto simp add: closedin_closed closed_closedin closed_Inter Int_assoc)
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"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1045
  by (auto simp add: closedin_closed intro: closedin_trans)
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"