src/HOL/Analysis/Topology_Euclidean_Space.thy
author hoelzl
Tue, 18 Oct 2016 12:01:54 +0200
changeset 64284 f3b905b2eee2
parent 64267 b9a1486e79be
child 64287 d85d88722745
permissions -rw-r--r--
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
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
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    18
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
    19
(* FIXME: move elsewhere *)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
    20
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    21
lemma Times_eq_image_sum:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    22
  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
    23
  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
    24
  by force
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    25
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    26
lemma halfspace_Int_eq:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    27
     "{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
    28
     "{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
    29
  by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    30
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
    31
definition (in monoid_add) support_on :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'b set"
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
where
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
  "support_on s f = {x\<in>s. 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
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
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
    36
  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
    37
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
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
    39
  "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
    40
  "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
    41
    (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
    42
  "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
    43
  "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
    44
  "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
    45
  "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
    46
  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
    47
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
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
    49
  "(\<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
    50
  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
    51
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
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
    53
  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
    54
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
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
    56
  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
    57
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
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
    59
  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
    60
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    61
(* TODO: is supp_sum really needed? TODO: Generalize to Finite_Set.fold *)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    62
definition (in comm_monoid_add) supp_sum :: "('b \<Rightarrow> 'a) \<Rightarrow> 'b set \<Rightarrow> '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
    63
where
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    64
  "supp_sum f s = (\<Sum>x\<in>support_on s f. f x)"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    65
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    66
lemma supp_sum_empty[simp]: "supp_sum f {} = 0"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    67
  unfolding supp_sum_def by auto
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    68
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    69
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
    70
  "finite (support_on s f) \<Longrightarrow>
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    71
    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
    72
  by (simp add: supp_sum_def in_support_on insert_absorb)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    73
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    74
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
    75
  by (cases "r = 0")
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    76
     (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
    77
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    78
(*END OF SUPPORT, ETC.*)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    79
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
    80
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
    81
  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
    82
  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
    83
            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
    84
            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
    85
  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
    86
  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
    87
  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
    88
  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
    89
  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
    90
  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
    91
  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
    92
  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
    93
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    94
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
    95
  "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
    96
  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
    97
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    98
lemma continuous_on_cases:
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    99
  "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
   100
    \<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
   101
    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
   102
  by (rule continuous_on_If) auto
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
   103
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   104
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   105
subsection \<open>Topological Basis\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   106
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   107
context topological_space
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   108
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   109
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   110
definition "topological_basis B \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   111
  (\<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
   112
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   113
lemma topological_basis:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   114
  "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
   115
  unfolding topological_basis_def
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   116
  apply safe
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   117
     apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   118
    apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   119
   apply (erule_tac x="x" in allE)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   120
   apply simp
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   121
   apply (rule_tac x="{x}" in exI)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   122
  apply auto
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   123
  done
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   124
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   125
lemma topological_basis_iff:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   126
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   127
  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
   128
    (is "_ \<longleftrightarrow> ?rhs")
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   129
proof safe
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   130
  fix O' and x::'a
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   131
  assume H: "topological_basis B" "open O'" "x \<in> O'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   132
  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
   133
  then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   134
  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
   135
next
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   136
  assume H: ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   137
  show "topological_basis B"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   138
    using assms unfolding topological_basis_def
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   139
  proof safe
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   140
    fix O' :: "'a set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   141
    assume "open O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   142
    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
   143
      by (force intro: bchoice simp: Bex_def)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   144
    then show "\<exists>B'\<subseteq>B. \<Union>B' = O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   145
      by (auto intro: exI[where x="{f x |x. x \<in> O'}"])
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   146
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   147
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   148
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   149
lemma topological_basisI:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   150
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   151
    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
   152
  shows "topological_basis B"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   153
  using assms by (subst topological_basis_iff) auto
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   154
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   155
lemma topological_basisE:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   156
  fixes O'
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   157
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   158
    and "open O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   159
    and "x \<in> O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   160
  obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   161
proof atomize_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   162
  from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   163
    by (simp add: topological_basis_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   164
  with topological_basis_iff assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   165
  show  "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   166
    using assms by (simp add: Bex_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   167
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   168
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   169
lemma topological_basis_open:
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   170
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   171
    and "X \<in> B"
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   172
  shows "open X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   173
  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
   174
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   175
lemma topological_basis_imp_subbasis:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   176
  assumes B: "topological_basis B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   177
  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
   178
proof (intro ext iffI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   179
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   180
  assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   181
  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
   182
    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
   183
  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
   184
    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
   185
next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   186
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   187
  assume "generate_topology B S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   188
  then show "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   189
    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
   190
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   191
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   192
lemma basis_dense:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   193
  fixes B :: "'a set set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   194
    and f :: "'a set \<Rightarrow> 'a"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   195
  assumes "topological_basis B"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   196
    and choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   197
  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
   198
proof (intro allI impI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   199
  fix X :: "'a set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   200
  assume "open X" and "X \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   201
  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
   202
  obtain B' where "B' \<in> B" "f X \<in> B'" "B' \<subseteq> X" .
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   203
  then show "\<exists>B'\<in>B. f B' \<in> X"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   204
    by (auto intro!: choosefrom_basis)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   205
qed
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   206
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   207
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   208
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   209
lemma topological_basis_prod:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   210
  assumes A: "topological_basis A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   211
    and B: "topological_basis B"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   212
  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
   213
  unfolding topological_basis_def
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   214
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   215
  fix S :: "('a \<times> 'b) set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   216
  assume "open S"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   217
  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
   218
  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
   219
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   220
    assume "(x, y) \<in> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   221
    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
   222
    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
   223
      by (metis mem_Sigma_iff)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   224
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   225
    from A a obtain A0 where "A0 \<in> A" "x \<in> A0" "A0 \<subseteq> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   226
      by (rule topological_basisE)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   227
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   228
    from B b obtain B0 where "B0 \<in> B" "y \<in> B0" "B0 \<subseteq> b"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   229
      by (rule topological_basisE)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   230
    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
   231
      by (intro UN_I[of "(A0, B0)"]) auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   232
  qed auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   233
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
   234
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   235
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   236
subsection \<open>Countable Basis\<close>
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   237
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   238
locale countable_basis =
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   239
  fixes B :: "'a::topological_space set set"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   240
  assumes is_basis: "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   241
    and countable_basis: "countable B"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   242
begin
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   243
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   244
lemma open_countable_basis_ex:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   245
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   246
  shows "\<exists>B' \<subseteq> B. X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   247
  using assms countable_basis is_basis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   248
  unfolding topological_basis_def by blast
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   249
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   250
lemma open_countable_basisE:
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   251
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   252
  obtains B' where "B' \<subseteq> B" "X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   253
  using assms open_countable_basis_ex
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   254
  by (atomize_elim) simp
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   255
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   256
lemma countable_dense_exists:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   257
  "\<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
   258
proof -
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   259
  let ?f = "(\<lambda>B'. SOME x. x \<in> B')"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   260
  have "countable (?f ` B)" using countable_basis by simp
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   261
  with basis_dense[OF is_basis, of ?f] show ?thesis
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   262
    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
   263
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   264
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   265
lemma countable_dense_setE:
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   266
  obtains D :: "'a set"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   267
  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
   268
  using countable_dense_exists by blast
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   269
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   270
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   271
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   272
lemma (in first_countable_topology) first_countable_basisE:
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   273
  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
   274
    "\<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
   275
  using first_countable_basis[of x]
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   276
  apply atomize_elim
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   277
  apply (elim exE)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   278
  apply (rule_tac x="range A" in exI)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   279
  apply auto
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   280
  done
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   281
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   282
lemma (in first_countable_topology) first_countable_basis_Int_stableE:
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   283
  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
   284
    "\<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
   285
    "\<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
   286
proof atomize_elim
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   287
  obtain A' where A':
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   288
    "countable A'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   289
    "\<And>a. a \<in> A' \<Longrightarrow> x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   290
    "\<And>a. a \<in> A' \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   291
    "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A'. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   292
    by (rule first_countable_basisE) blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   293
  define A where [abs_def]:
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   294
    "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
   295
  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
   296
        (\<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
   297
  proof (safe intro!: exI[where x=A])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   298
    show "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   299
      unfolding A_def by (intro countable_image countable_Collect_finite)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   300
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   301
    assume "a \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   302
    then show "x \<in> a" "open a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   303
      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
   304
  next
52141
eff000cab70f weaker precendence of syntax for big intersection and union on sets
haftmann
parents: 51773
diff changeset
   305
    let ?int = "\<lambda>N. \<Inter>(from_nat_into A' ` N)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   306
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   307
    assume "a \<in> A" "b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   308
    then obtain N M where "a = ?int N" "b = ?int M" "finite (N \<union> M)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   309
      by (auto simp: A_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   310
    then show "a \<inter> b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   311
      by (auto simp: A_def intro!: image_eqI[where x="N \<union> M"])
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   312
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   313
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   314
    assume "open S" "x \<in> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   315
    then obtain a where a: "a\<in>A'" "a \<subseteq> S" using A' by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   316
    then show "\<exists>a\<in>A. a \<subseteq> S" using a A'
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   317
      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
   318
  qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   319
qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   320
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   321
lemma (in topological_space) first_countableI:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   322
  assumes "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   323
    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
   324
    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
   325
  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
   326
proof (safe intro!: exI[of _ "from_nat_into A"])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   327
  fix i
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   328
  have "A \<noteq> {}" using 2[of UNIV] by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   329
  show "x \<in> from_nat_into A i" "open (from_nat_into A i)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   330
    using range_from_nat_into_subset[OF \<open>A \<noteq> {}\<close>] 1 by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   331
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   332
  fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   333
  assume "open S" "x\<in>S" from 2[OF this]
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   334
  show "\<exists>i. from_nat_into A i \<subseteq> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   335
    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
   336
qed
51350
490f34774a9a eventually nhds represented using sequentially
hoelzl
parents: 51349
diff changeset
   337
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   338
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   339
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   340
  fix x :: "'a \<times> 'b"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   341
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   342
      "countable A"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   343
      "\<And>a. a \<in> A \<Longrightarrow> fst x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   344
      "\<And>a. a \<in> A \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   345
      "\<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
   346
    by (rule first_countable_basisE[of "fst x"]) blast
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   347
  obtain B where B:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   348
      "countable B"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   349
      "\<And>a. a \<in> B \<Longrightarrow> snd x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   350
      "\<And>a. a \<in> B \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   351
      "\<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
   352
    by (rule first_countable_basisE[of "snd x"]) blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   353
  show "\<exists>A::nat \<Rightarrow> ('a \<times> 'b) set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   354
    (\<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
   355
  proof (rule first_countableI[of "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   356
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   357
    assume x: "a \<in> A" "b \<in> B"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   358
    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
   359
      unfolding mem_Times_iff
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   360
      by (auto intro: open_Times)
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   361
  next
53255
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"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   364
    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
   365
      by (rule open_prod_elim)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   366
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   367
    from a'b' A(4)[of a'] B(4)[of b']
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   368
    obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   369
      by auto
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   370
    ultimately
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   371
    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
   372
      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
   373
  qed (simp add: A B)
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   374
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   375
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   376
class second_countable_topology = topological_space +
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   377
  assumes ex_countable_subbasis:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   378
    "\<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
   379
begin
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   380
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   381
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
   382
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   383
  from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   384
    by blast
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   385
  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
   386
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   387
  show ?thesis
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   388
  proof (intro exI conjI)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   389
    show "countable ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   390
      by (intro countable_image countable_Collect_finite_subset B)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   391
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   392
      fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   393
      assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   394
      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
   395
        unfolding B
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   396
      proof induct
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   397
        case UNIV
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   398
        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
   399
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   400
        case (Int a b)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   401
        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
   402
          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
   403
          by blast
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   404
        show ?case
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   405
          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
   406
          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
   407
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   408
        case (UN K)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   409
        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
   410
        then obtain k where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   411
            "\<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
   412
          unfolding bchoice_iff ..
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   413
        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
   414
          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
   415
      next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   416
        case (Basis S)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   417
        then show ?case
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   418
          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
   419
      qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   420
      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
   421
        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
   422
    then show "topological_basis ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   423
      unfolding topological_space_class.topological_basis_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   424
      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
   425
         (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
   426
  qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   427
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   428
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   429
end
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   430
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   431
sublocale second_countable_topology <
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   432
  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
   433
  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
   434
  by unfold_locales safe
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   435
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   436
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
   437
proof
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   438
  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
   439
    using ex_countable_basis by auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   440
  moreover
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   441
  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
   442
    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
   443
  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
   444
    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
   445
      topological_basis_imp_subbasis)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   446
qed
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   447
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   448
instance second_countable_topology \<subseteq> first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   449
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   450
  fix x :: 'a
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   451
  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
   452
  then have B: "countable B" "topological_basis B"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   453
    using countable_basis is_basis
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   454
    by (auto simp: countable_basis is_basis)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   455
  then show "\<exists>A::nat \<Rightarrow> 'a set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   456
    (\<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
   457
    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
   458
       (fastforce simp: topological_space_class.topological_basis_def)+
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   459
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   460
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   461
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   462
lemma countable_separating_set_linorder1:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   463
  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
   464
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   465
  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
   466
  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
   467
  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
   468
  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
   469
  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
   470
  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
   471
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   472
    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
   473
    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
   474
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   475
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   476
    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
   477
    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
   478
    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
   479
    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
   480
    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
   481
    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
   482
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   483
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   484
    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
   485
    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
   486
    define U where "U = {x<..}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   487
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   488
    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
   489
    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
   490
    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
   491
    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
   492
    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
   493
    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
   494
    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
   495
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   496
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   497
  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
   498
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   499
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   500
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   501
lemma countable_separating_set_linorder2:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   502
  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
   503
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   504
  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
   505
  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
   506
  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
   507
  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
   508
  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
   509
  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
   510
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   511
    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
   512
    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
   513
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   514
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   515
    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
   516
    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
   517
    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
   518
    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
   519
    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
   520
    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
   521
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   522
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   523
    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
   524
    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
   525
    define U where "U = {..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   526
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   527
    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
   528
    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
   529
    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
   530
    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
   531
    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
   532
    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
   533
    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
   534
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   535
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   536
  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
   537
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   538
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   539
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   540
lemma countable_separating_set_dense_linorder:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   541
  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
   542
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   543
  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
   544
    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
   545
  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
   546
  proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   547
    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
   548
    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
   549
    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
   550
    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
   551
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   552
  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
   553
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   554
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   555
subsection \<open>Polish spaces\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   556
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   557
text \<open>Textbooks define Polish spaces as completely metrizable.
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   558
  We assume the topology to be complete for a given metric.\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   559
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   560
class polish_space = complete_space + second_countable_topology
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   561
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   562
subsection \<open>General notion of a topology as a value\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   563
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   564
definition "istopology L \<longleftrightarrow>
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   565
  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
   566
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 49711
diff changeset
   567
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   568
  morphisms "openin" "topology"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   569
  unfolding istopology_def by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   570
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
   571
lemma istopology_openin[intro]: "istopology(openin U)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   572
  using openin[of U] by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   573
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   574
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
   575
  using topology_inverse[unfolded mem_Collect_eq] .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   576
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   577
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
   578
  using topology_inverse[of U] istopology_openin[of "topology U"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   579
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   580
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   581
proof
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   582
  assume "T1 = T2"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   583
  then show "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   584
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   585
  assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   586
  then have "openin T1 = openin T2" by (simp add: fun_eq_iff)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   587
  then have "topology (openin T1) = topology (openin T2)" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   588
  then show "T1 = T2" unfolding openin_inverse .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   589
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   590
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   591
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
   592
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   593
definition "topspace T = \<Union>{S. openin T S}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   594
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   595
subsubsection \<open>Main properties of open sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   596
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   597
lemma openin_clauses:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   598
  fixes U :: "'a topology"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   599
  shows
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   600
    "openin U {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   601
    "\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   602
    "\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   603
  using openin[of U] unfolding istopology_def mem_Collect_eq by fast+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   604
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   605
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   606
  unfolding topspace_def by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   607
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   608
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
   609
  by (rule openin_clauses)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   610
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   611
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
   612
  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
   613
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   614
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
   615
  using openin_clauses by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   616
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   617
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
   618
  using openin_Union[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   619
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   620
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
   621
  by (force simp add: openin_Union topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   622
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   623
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
   624
  (is "?lhs \<longleftrightarrow> ?rhs")
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   625
proof
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   626
  assume ?lhs
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   627
  then show ?rhs by auto
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   628
next
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   629
  assume H: ?rhs
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   630
  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
   631
  have "openin U ?t" by (force simp add: openin_Union)
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   632
  also have "?t = S" using H by auto
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   633
  finally show "openin U S" .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   634
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   635
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   636
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   637
subsubsection \<open>Closed sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   638
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   639
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
   640
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   641
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   642
  by (metis closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   643
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   644
lemma closedin_empty[simp]: "closedin U {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   645
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   646
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   647
lemma closedin_topspace[intro, simp]: "closedin U (topspace U)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   648
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   649
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   650
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
   651
  by (auto simp add: Diff_Un closedin_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   652
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   653
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union>{A - s|s. s\<in>S}"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   654
  by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   655
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   656
lemma closedin_Union:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   657
  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
   658
    shows "closedin U (\<Union>S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   659
  using assms by induction auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   660
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   661
lemma closedin_Inter[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   662
  assumes Ke: "K \<noteq> {}"
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   663
    and Kc: "\<And>S. S \<in>K \<Longrightarrow> closedin U S"
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   664
  shows "closedin U (\<Inter>K)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   665
  using Ke Kc unfolding closedin_def Diff_Inter by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   666
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   667
lemma closedin_INT[intro]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   668
  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
   669
  shows "closedin U (\<Inter>x\<in>A. B x)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   670
  apply (rule closedin_Inter)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   671
  using assms
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   672
  apply auto
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   673
  done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   674
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   675
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
   676
  using closedin_Inter[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   677
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   678
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
   679
  apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   680
  apply (metis openin_subset subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   681
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   682
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   683
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
   684
  by (simp add: openin_closedin_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   685
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   686
lemma openin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   687
  assumes oS: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   688
    and cT: "closedin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   689
  shows "openin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   690
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   691
  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
   692
    by (auto simp add: topspace_def openin_subset)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   693
  then show ?thesis using oS cT
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   694
    by (auto simp add: closedin_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   695
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   696
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   697
lemma closedin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   698
  assumes oS: "closedin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   699
    and cT: "openin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   700
  shows "closedin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   701
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   702
  have "S - T = S \<inter> (topspace U - T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   703
    using closedin_subset[of U S] oS cT by (auto simp add: topspace_def)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   704
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   705
    using oS cT by (auto simp add: openin_closedin_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   706
qed
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   707
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   708
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   709
subsubsection \<open>Subspace topology\<close>
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   710
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   711
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
   712
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   713
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
   714
  (is "istopology ?L")
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   715
proof -
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   716
  have "?L {}" by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   717
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   718
    fix A B
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   719
    assume A: "?L A" and B: "?L B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   720
    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
   721
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   722
    have "A \<inter> B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   723
      using Sa Sb by blast+
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   724
    then have "?L (A \<inter> B)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   725
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   726
  moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   727
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   728
    fix K
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   729
    assume K: "K \<subseteq> Collect ?L"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   730
    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
   731
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   732
    from K[unfolded th0 subset_image_iff]
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   733
    obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   734
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   735
    have "\<Union>K = (\<Union>Sk) \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   736
      using Sk by auto
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   737
    moreover have "openin U (\<Union>Sk)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   738
      using Sk by (auto simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   739
    ultimately have "?L (\<Union>K)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   740
  }
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   741
  ultimately show ?thesis
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
   742
    unfolding subset_eq mem_Collect_eq istopology_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   743
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   744
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   745
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
   746
  unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   747
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   748
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   749
lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \<inter> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   750
  by (auto simp add: topspace_def openin_subtopology)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   751
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   752
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
   753
  unfolding closedin_def topspace_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   754
  by (auto simp add: openin_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   755
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   756
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   757
  unfolding openin_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   758
  by auto (metis IntD1 in_mono openin_subset)
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   759
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   760
lemma subtopology_superset:
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   761
  assumes UV: "topspace U \<subseteq> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   762
  shows "subtopology U V = U"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   763
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   764
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   765
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   766
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   767
      fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   768
      assume T: "openin U T" "S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   769
      from T openin_subset[OF T(1)] UV have eq: "S = T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   770
        by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   771
      have "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   772
        unfolding eq using T by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   773
    }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   774
    moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   775
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   776
      assume S: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   777
      then have "\<exists>T. openin U T \<and> S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   778
        using openin_subset[OF S] UV by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   779
    }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   780
    ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   781
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   782
  }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   783
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   784
    unfolding topology_eq openin_subtopology by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   785
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   786
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   787
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   788
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   789
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   790
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   791
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   792
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   793
lemma openin_subtopology_empty:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   794
   "openin (subtopology U {}) s \<longleftrightarrow> s = {}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   795
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
   796
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   797
lemma closedin_subtopology_empty:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   798
   "closedin (subtopology U {}) s \<longleftrightarrow> s = {}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   799
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
   800
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   801
lemma closedin_subtopology_refl:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   802
   "closedin (subtopology U u) u \<longleftrightarrow> u \<subseteq> topspace U"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   803
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
   804
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   805
lemma openin_imp_subset:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   806
   "openin (subtopology U s) t \<Longrightarrow> t \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   807
by (metis Int_iff openin_subtopology subsetI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   808
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   809
lemma closedin_imp_subset:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   810
   "closedin (subtopology U s) t \<Longrightarrow> t \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   811
by (simp add: closedin_def topspace_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   812
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   813
lemma openin_subtopology_Un:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   814
    "openin (subtopology U t) s \<and> openin (subtopology U u) s
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   815
     \<Longrightarrow> openin (subtopology U (t \<union> u)) s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   816
by (simp add: openin_subtopology) blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   817
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   818
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   819
subsubsection \<open>The standard Euclidean topology\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   820
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   821
definition euclidean :: "'a::topological_space topology"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   822
  where "euclidean = topology open"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   823
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   824
lemma open_openin: "open S \<longleftrightarrow> openin euclidean S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   825
  unfolding euclidean_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   826
  apply (rule cong[where x=S and y=S])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   827
  apply (rule topology_inverse[symmetric])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   828
  apply (auto simp add: istopology_def)
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   829
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   830
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   831
declare open_openin [symmetric, simp]
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   832
63492
a662e8139804 More advanced theorems about retracts, homotopies., etc
paulson <lp15@cam.ac.uk>
parents: 63469
diff changeset
   833
lemma topspace_euclidean [simp]: "topspace euclidean = UNIV"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   834
  by (force simp add: topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   835
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   836
lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   837
  by (simp add: topspace_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   838
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   839
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   840
  by (simp add: closed_def closedin_def Compl_eq_Diff_UNIV)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   841
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   842
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
   843
  using openI by auto
33175
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_self [simp]: "openin (subtopology euclidean S) S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   846
  by (metis openin_topspace topspace_euclidean_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   847
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   848
text \<open>Basic "localization" results are handy for connectedness.\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   849
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   850
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
   851
  by (auto simp add: openin_subtopology)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   852
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   853
lemma openin_Int_open:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   854
   "\<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
   855
        \<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
   856
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
   857
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   858
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
   859
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   860
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   861
lemma open_openin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   862
  "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
   863
  by (metis Int_absorb1  openin_open_Int)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   864
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   865
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
   866
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   867
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   868
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
   869
  by (simp add: closedin_subtopology closed_closedin Int_ac)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   870
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   871
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
   872
  by (metis closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   873
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   874
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
   875
  by (auto simp add: closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   876
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   877
lemma finite_imp_closedin:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   878
  fixes S :: "'a::t1_space set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   879
  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
   880
    by (simp add: finite_imp_closed closed_subset)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   881
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   882
lemma closedin_singleton [simp]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   883
  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
   884
  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
   885
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
   886
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   887
lemma openin_euclidean_subtopology_iff:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   888
  fixes S U :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   889
  shows "openin (subtopology euclidean U) S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   890
    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
   891
  (is "?lhs \<longleftrightarrow> ?rhs")
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   892
proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   893
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   894
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   895
    unfolding openin_open open_dist by blast
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   896
next
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   897
  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
   898
  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
   899
    unfolding T_def
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   900
    apply clarsimp
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   901
    apply (rule_tac x="d - dist x a" in exI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   902
    apply (clarsimp simp add: less_diff_eq)
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   903
    by (metis dist_commute dist_triangle_lt)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   904
  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
   905
    unfolding T_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   906
    by auto (metis dist_self)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   907
  from 1 2 show ?lhs
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   908
    unfolding openin_open open_dist by fast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   909
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
   910
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
   911
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
   912
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   913
       ~(\<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
   914
                 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
   915
                 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
   916
  apply (simp add: connected_def openin_open, safe)
63988
wenzelm
parents: 63967
diff changeset
   917
  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
   918
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   919
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
   920
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
   921
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   922
       ~(\<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
   923
                 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
   924
                 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
   925
                 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
   926
  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
   927
  apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   928
  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
   929
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
   930
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
   931
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   932
       ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   933
             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
   934
             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
   935
             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
   936
             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
   937
proof -
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   938
  { 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
   939
    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
   940
       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
   941
       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
   942
       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
   943
    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
   944
    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
   945
      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
   946
    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
   947
      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
   948
    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
   949
      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
   950
    then have False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   951
      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
   952
  } note * = this
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   953
  show ?thesis
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   954
    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
   955
    apply (safe; simp)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   956
    apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   957
    apply (blast intro: *)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   958
    done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   959
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   960
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
   961
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
   962
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   963
           ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   964
                 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
   965
                 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
   966
                 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
   967
                 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
   968
  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
   969
  apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   970
  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
   971
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   972
text \<open>These "transitivity" results are handy too\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   973
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   974
lemma openin_trans[trans]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   975
  "openin (subtopology euclidean T) S \<Longrightarrow> openin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   976
    openin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   977
  unfolding open_openin openin_open by blast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   978
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   979
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
   980
  by (auto simp add: openin_open intro: openin_trans)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   981
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   982
lemma closedin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   983
  "closedin (subtopology euclidean T) S \<Longrightarrow> closedin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   984
    closedin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   985
  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
   986
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   987
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
   988
  by (auto simp add: closedin_closed intro: closedin_trans)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   989
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
   990
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
   991
   "\<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
   992
  by (auto simp: openin_subtopology)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   993
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   994
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
   995
  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
   996
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   997
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   998
subsection \<open>Open and closed balls\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   999
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1000
definition ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1001
  where "ball x e = {y. dist x y < e}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1002
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1003
definition cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1004
  where "cball x e = {y. dist x y \<le> e}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1005
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
  1006
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
  1007
  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
  1008
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
  1009
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
  1010
  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
  1011
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
  1012
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
  1013
  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
  1014
61848
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1015
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
  1016
  by (simp add: sphere_def)
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1017
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1018
lemma ball_trivial [simp]: "ball x 0 = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1019
  by (simp add: ball_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1020
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1021
lemma cball_trivial [simp]: "cball x 0 = {x}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1022
  by (simp add: cball_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1023
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1024
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
  1025
  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
  1026
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1027
lemma mem_ball_0 [simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1028
  fixes x :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1029
  shows "x \<in> ball 0 e \<longleftrightarrow> norm x < e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1030
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1031
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1032
lemma mem_cball_0 [simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1033
  fixes x :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1034
  shows "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1035
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1036
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1037
lemma mem_sphere_0 [simp]:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1038
  fixes x :: "'a::real_normed_vector"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1039
  shows "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1040
  by (simp add: dist_norm)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1041
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1042
lemma sphere_empty [simp]:
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1043
  fixes a :: "'a::metric_space"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1044
  shows "r < 0 \<Longrightarrow> sphere a r = {}"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1045
by auto
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1046
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1047
lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1048
  by simp
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1049
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1050
lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1051
  by simp
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1052
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1053
lemma ball_subset_cball [simp,intro]: "ball x e \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1054
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1055
61907
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1056
lemma sphere_cball [simp,intro]: "sphere z r \<subseteq> cball z r"
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1057
  by force
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1058
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1059
lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1060
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1061
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1062
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1063
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1064
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1065
lemma ball_max_Un: "ball a (max r s) = ball a r \<union> ball a s"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  1066
  by (simp add: set_eq_iff) arith
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1067
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1068
lemma ball_min_Int: "ball a (min r s) = ball a r \<inter> ball a s"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  1069
  by (simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1070
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1071
lemma cball_diff_eq_sphere: "cball a r - ball a r =  {x. dist x a = r}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1072
  by (auto simp: cball_def ball_def dist_commute)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1073
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1074
lemma image_add_ball [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1075
  fixes a :: "'a::real_normed_vector"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1076
  shows "op + b ` ball a r = ball (a+b) r"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1077
apply (intro equalityI subsetI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1078
apply (force simp: dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1079
apply (rule_tac x="x-b" in image_eqI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1080
apply (auto simp: dist_norm algebra_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1081
done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1082
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1083
lemma image_add_cball [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1084
  fixes a :: "'a::real_normed_vector"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1085
  shows "op + b ` cball a r = cball (a+b) r"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1086
apply (intro equalityI subsetI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1087
apply (force simp: dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1088
apply (rule_tac x="x-b" in image_eqI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1089
apply (auto simp: dist_norm algebra_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1090
done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1091
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1092
lemma open_ball [intro, simp]: "open (ball x e)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1093
proof -
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1094
  have "open (dist x -` {..<e})"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  1095
    by (intro open_vimage open_lessThan continuous_intros)
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1096
  also have "dist x -` {..<e} = ball x e"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1097
    by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1098
  finally show ?thesis .
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1099
qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1100
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1101
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)"
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  1102
  by (simp add: open_dist subset_eq mem_ball Ball_def dist_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1103
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1104
lemma openI [intro?]: "(\<And>x. x\<in>S \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> S) \<Longrightarrow> open S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson