src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
author hoelzl
Tue, 05 Nov 2013 09:45:02 +0100
changeset 54263 c4159fe6fa46
parent 54260 6a967667fd45
child 54489 03ff4d1e6784
permissions -rw-r--r--
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
     1
(*  title:      HOL/Library/Topology_Euclidian_Space.thy
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
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     7
header {* Elementary topology in Euclidean space. *}
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
50938
hoelzl
parents: 50937
diff changeset
    11
  Complex_Main
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
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    18
lemma dist_0_norm:
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    19
  fixes x :: "'a::real_normed_vector"
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    20
  shows "dist 0 x = norm x"
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    21
unfolding dist_norm by simp
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    22
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
    23
lemma dist_double: "dist x y < d / 2 \<Longrightarrow> dist x z < d / 2 \<Longrightarrow> dist y z < d"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
    24
  using dist_triangle[of y z x] by (simp add: dist_commute)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
    25
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    26
(* LEGACY *)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
    27
lemma lim_subseq: "subseq r \<Longrightarrow> s ----> l \<Longrightarrow> (s \<circ> r) ----> l"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    28
  by (rule LIMSEQ_subseq_LIMSEQ)
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
    29
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    30
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
    31
  "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
    32
  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
    33
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    34
lemma Lim_within_open:
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    35
  fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    36
  shows "a \<in> S \<Longrightarrow> open S \<Longrightarrow> (f ---> l)(at a within S) \<longleftrightarrow> (f ---> l)(at a)"
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    37
  by (fact tendsto_within_open)
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    38
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    39
lemma continuous_on_union:
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    40
  "closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f"
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    41
  by (fact continuous_on_closed_Un)
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    42
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    43
lemma continuous_on_cases:
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    44
  "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
    45
    \<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
    46
    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
    47
  by (rule continuous_on_If) auto
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
    48
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
    49
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    50
subsection {* Topological Basis *}
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    51
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    52
context topological_space
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    53
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    54
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
    55
definition "topological_basis B \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
    56
  (\<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
    57
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
    58
lemma topological_basis:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
    59
  "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
    60
  unfolding topological_basis_def
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    61
  apply safe
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    62
     apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    63
    apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    64
   apply (erule_tac x="x" in allE)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    65
   apply simp
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    66
   apply (rule_tac x="{x}" in exI)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    67
  apply auto
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    68
  done
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
    69
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    70
lemma topological_basis_iff:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    71
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    72
  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
    73
    (is "_ \<longleftrightarrow> ?rhs")
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    74
proof safe
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    75
  fix O' and x::'a
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    76
  assume H: "topological_basis B" "open O'" "x \<in> O'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    77
  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
    78
  then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    79
  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
    80
next
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    81
  assume H: ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    82
  show "topological_basis B"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    83
    using assms unfolding topological_basis_def
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    84
  proof safe
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
    85
    fix O' :: "'a set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    86
    assume "open O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    87
    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
    88
      by (force intro: bchoice simp: Bex_def)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    89
    then show "\<exists>B'\<subseteq>B. \<Union>B' = O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    90
      by (auto intro: exI[where x="{f x |x. x \<in> O'}"])
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    91
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    92
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    93
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    94
lemma topological_basisI:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    95
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    96
    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
    97
  shows "topological_basis B"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    98
  using assms by (subst topological_basis_iff) auto
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    99
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   100
lemma topological_basisE:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   101
  fixes O'
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   102
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   103
    and "open O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   104
    and "x \<in> O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   105
  obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   106
proof atomize_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   107
  from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   108
    by (simp add: topological_basis_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   109
  with topological_basis_iff assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   110
  show  "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   111
    using assms by (simp add: Bex_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   112
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   113
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   114
lemma topological_basis_open:
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   115
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   116
    and "X \<in> B"
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   117
  shows "open X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   118
  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
   119
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   120
lemma topological_basis_imp_subbasis:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   121
  assumes B: "topological_basis B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   122
  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
   123
proof (intro ext iffI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   124
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   125
  assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   126
  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
   127
    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
   128
  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
   129
    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
   130
next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   131
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   132
  assume "generate_topology B S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   133
  then show "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   134
    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
   135
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   136
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   137
lemma basis_dense:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   138
  fixes B :: "'a set set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   139
    and f :: "'a set \<Rightarrow> 'a"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   140
  assumes "topological_basis B"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   141
    and choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   142
  shows "(\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>B' \<in> B. f B' \<in> X))"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   143
proof (intro allI impI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   144
  fix X :: "'a set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   145
  assume "open X" and "X \<noteq> {}"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   146
  from topological_basisE[OF `topological_basis B` `open X` choosefrom_basis[OF `X \<noteq> {}`]]
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   147
  guess B' . note B' = this
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   148
  then show "\<exists>B'\<in>B. f B' \<in> X"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   149
    by (auto intro!: choosefrom_basis)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   150
qed
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   151
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   152
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   153
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   154
lemma topological_basis_prod:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   155
  assumes A: "topological_basis A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   156
    and B: "topological_basis B"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   157
  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
   158
  unfolding topological_basis_def
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   159
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   160
  fix S :: "('a \<times> 'b) set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   161
  assume "open S"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   162
  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
   163
  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
   164
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   165
    assume "(x, y) \<in> S"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   166
    from open_prod_elim[OF `open S` this]
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   167
    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
   168
      by (metis mem_Sigma_iff)
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   169
    moreover from topological_basisE[OF A a] guess A0 .
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   170
    moreover from topological_basisE[OF B b] guess B0 .
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   171
    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
   172
      by (intro UN_I[of "(A0, B0)"]) auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   173
  qed auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   174
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
   175
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   176
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   177
subsection {* Countable Basis *}
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   178
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   179
locale countable_basis =
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   180
  fixes B :: "'a::topological_space set set"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   181
  assumes is_basis: "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   182
    and countable_basis: "countable B"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   183
begin
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   184
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   185
lemma open_countable_basis_ex:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   186
  assumes "open X"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   187
  shows "\<exists>B' \<subseteq> B. X = Union B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   188
  using assms countable_basis is_basis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   189
  unfolding topological_basis_def by blast
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   190
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   191
lemma open_countable_basisE:
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   192
  assumes "open X"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   193
  obtains B' where "B' \<subseteq> B" "X = Union B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   194
  using assms open_countable_basis_ex
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   195
  by (atomize_elim) simp
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   196
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   197
lemma countable_dense_exists:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   198
  "\<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
   199
proof -
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   200
  let ?f = "(\<lambda>B'. SOME x. x \<in> B')"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   201
  have "countable (?f ` B)" using countable_basis by simp
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   202
  with basis_dense[OF is_basis, of ?f] show ?thesis
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   203
    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
   204
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   205
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   206
lemma countable_dense_setE:
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   207
  obtains D :: "'a set"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   208
  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
   209
  using countable_dense_exists by blast
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   210
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   211
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   212
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   213
lemma (in first_countable_topology) first_countable_basisE:
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   214
  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
   215
    "\<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
   216
  using first_countable_basis[of x]
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   217
  apply atomize_elim
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   218
  apply (elim exE)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   219
  apply (rule_tac x="range A" in exI)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   220
  apply auto
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   221
  done
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   222
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   223
lemma (in first_countable_topology) first_countable_basis_Int_stableE:
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   224
  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
   225
    "\<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
   226
    "\<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
   227
proof atomize_elim
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   228
  from first_countable_basisE[of x] guess A' . note A' = this
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   229
  def A \<equiv> "(\<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
   230
  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
   231
        (\<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
   232
  proof (safe intro!: exI[where x=A])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   233
    show "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   234
      unfolding A_def by (intro countable_image countable_Collect_finite)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   235
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   236
    assume "a \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   237
    then show "x \<in> a" "open a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   238
      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
   239
  next
52141
eff000cab70f weaker precendence of syntax for big intersection and union on sets
haftmann
parents: 51773
diff changeset
   240
    let ?int = "\<lambda>N. \<Inter>(from_nat_into A' ` N)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   241
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   242
    assume "a \<in> A" "b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   243
    then obtain N M where "a = ?int N" "b = ?int M" "finite (N \<union> M)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   244
      by (auto simp: A_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   245
    then show "a \<inter> b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   246
      by (auto simp: A_def intro!: image_eqI[where x="N \<union> M"])
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   247
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   248
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   249
    assume "open S" "x \<in> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   250
    then obtain a where a: "a\<in>A'" "a \<subseteq> S" using A' by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   251
    then show "\<exists>a\<in>A. a \<subseteq> S" using a A'
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   252
      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
   253
  qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   254
qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   255
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   256
lemma (in topological_space) first_countableI:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   257
  assumes "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   258
    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
   259
    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
   260
  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
   261
proof (safe intro!: exI[of _ "from_nat_into A"])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   262
  fix i
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   263
  have "A \<noteq> {}" using 2[of UNIV] by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   264
  show "x \<in> from_nat_into A i" "open (from_nat_into A i)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   265
    using range_from_nat_into_subset[OF `A \<noteq> {}`] 1 by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   266
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   267
  fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   268
  assume "open S" "x\<in>S" from 2[OF this]
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   269
  show "\<exists>i. from_nat_into A i \<subseteq> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   270
    using subset_range_from_nat_into[OF `countable A`] by auto
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   271
qed
51350
490f34774a9a eventually nhds represented using sequentially
hoelzl
parents: 51349
diff changeset
   272
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   273
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   274
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   275
  fix x :: "'a \<times> 'b"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   276
  from first_countable_basisE[of "fst x"] guess A :: "'a set set" . note A = this
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   277
  from first_countable_basisE[of "snd x"] guess B :: "'b set set" . note B = this
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   278
  show "\<exists>A::nat \<Rightarrow> ('a \<times> 'b) set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   279
    (\<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
   280
  proof (rule first_countableI[of "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   281
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   282
    assume x: "a \<in> A" "b \<in> B"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   283
    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
   284
      unfolding mem_Times_iff
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   285
      by (auto intro: open_Times)
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   286
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   287
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   288
    assume "open S" "x \<in> S"
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
   289
    from open_prod_elim[OF this] guess a' b' . note a'b' = this
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
   290
    moreover from a'b' A(4)[of a'] B(4)[of b']
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   291
    obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'" by auto
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   292
    ultimately show "\<exists>a\<in>(\<lambda>(a, b). a \<times> b) ` (A \<times> B). a \<subseteq> S"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   293
      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
   294
  qed (simp add: A B)
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   295
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   296
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   297
class second_countable_topology = topological_space +
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   298
  assumes ex_countable_subbasis:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   299
    "\<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
   300
begin
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   301
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   302
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
   303
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   304
  from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   305
    by blast
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   306
  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
   307
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   308
  show ?thesis
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   309
  proof (intro exI conjI)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   310
    show "countable ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   311
      by (intro countable_image countable_Collect_finite_subset B)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   312
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   313
      fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   314
      assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   315
      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
   316
        unfolding B
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   317
      proof induct
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   318
        case UNIV
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   319
        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
   320
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   321
        case (Int a b)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   322
        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
   323
          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
   324
          by blast
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   325
        show ?case
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   326
          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
   327
          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
   328
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   329
        case (UN K)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   330
        then have "\<forall>k\<in>K. \<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. UNION B' Inter = k" by auto
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   331
        then guess k unfolding bchoice_iff ..
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   332
        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
   333
          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
   334
      next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   335
        case (Basis S)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   336
        then show ?case
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   337
          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
   338
      qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   339
      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
   340
        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
   341
    then show "topological_basis ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   342
      unfolding topological_space_class.topological_basis_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   343
      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
   344
         (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
   345
  qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   346
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   347
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   348
end
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   349
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   350
sublocale second_countable_topology <
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   351
  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
   352
  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
   353
  by unfold_locales safe
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   354
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   355
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
   356
proof
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   357
  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
   358
    using ex_countable_basis by auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   359
  moreover
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   360
  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
   361
    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
   362
  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
   363
    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
   364
      topological_basis_imp_subbasis)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   365
qed
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   366
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   367
instance second_countable_topology \<subseteq> first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   368
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   369
  fix x :: 'a
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   370
  def B \<equiv> "SOME B::'a set set. countable B \<and> topological_basis B"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   371
  then have B: "countable B" "topological_basis B"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   372
    using countable_basis is_basis
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   373
    by (auto simp: countable_basis is_basis)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   374
  then show "\<exists>A::nat \<Rightarrow> 'a set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   375
    (\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))"
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   376
    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
   377
       (fastforce simp: topological_space_class.topological_basis_def)+
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   378
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   379
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   380
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   381
subsection {* Polish spaces *}
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   382
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   383
text {* Textbooks define Polish spaces as completely metrizable.
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   384
  We assume the topology to be complete for a given metric. *}
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   385
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   386
class polish_space = complete_space + second_countable_topology
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   387
44517
68e8eb0ce8aa minimize imports
huffman
parents: 44516
diff changeset
   388
subsection {* General notion of a topology as a value *}
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   389
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   390
definition "istopology L \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   391
  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))"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   392
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 49711
diff changeset
   393
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   394
  morphisms "openin" "topology"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   395
  unfolding istopology_def by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   396
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   397
lemma istopology_open_in[intro]: "istopology(openin U)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   398
  using openin[of U] by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   399
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   400
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
   401
  using topology_inverse[unfolded mem_Collect_eq] .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   402
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   403
lemma topology_inverse_iff: "istopology U \<longleftrightarrow> openin (topology U) = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   404
  using topology_inverse[of U] istopology_open_in[of "topology U"] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   405
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   406
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   407
proof
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   408
  assume "T1 = T2"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   409
  then show "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   410
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   411
  assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   412
  then have "openin T1 = openin T2" by (simp add: fun_eq_iff)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   413
  then have "topology (openin T1) = topology (openin T2)" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   414
  then show "T1 = T2" unfolding openin_inverse .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   415
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   416
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   417
text{* Infer the "universe" from union of all sets in the topology. *}
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   418
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   419
definition "topspace T = \<Union>{S. openin T S}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   420
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   421
subsubsection {* Main properties of open sets *}
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   422
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   423
lemma openin_clauses:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   424
  fixes U :: "'a topology"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   425
  shows
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   426
    "openin U {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   427
    "\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   428
    "\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   429
  using openin[of U] unfolding istopology_def mem_Collect_eq by fast+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   430
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   431
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   432
  unfolding topspace_def by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   433
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   434
lemma openin_empty[simp]: "openin U {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   435
  by (simp add: openin_clauses)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   436
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   437
lemma openin_Int[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<inter> T)"
36362
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
   438
  using openin_clauses by simp
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
   439
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
   440
lemma openin_Union[intro]: "(\<forall>S \<in>K. openin U S) \<Longrightarrow> openin U (\<Union> K)"
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
   441
  using openin_clauses by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   442
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   443
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
   444
  using openin_Union[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   445
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   446
lemma openin_topspace[intro, simp]: "openin U (topspace U)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   447
  by (simp add: openin_Union topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   448
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   449
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
   450
  (is "?lhs \<longleftrightarrow> ?rhs")
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   451
proof
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   452
  assume ?lhs
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   453
  then show ?rhs by auto
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   454
next
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   455
  assume H: ?rhs
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   456
  let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}"
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   457
  have "openin U ?t" by (simp add: openin_Union)
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   458
  also have "?t = S" using H by auto
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   459
  finally show "openin U S" .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   460
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   461
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   462
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   463
subsubsection {* Closed sets *}
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   464
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   465
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
   466
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   467
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   468
  by (metis closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   469
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   470
lemma closedin_empty[simp]: "closedin U {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   471
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   472
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   473
lemma closedin_topspace[intro, simp]: "closedin U (topspace U)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   474
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   475
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   476
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
   477
  by (auto simp add: Diff_Un closedin_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   478
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   479
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union> {A - s|s. s\<in>S}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   480
  by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   481
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   482
lemma closedin_Inter[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   483
  assumes Ke: "K \<noteq> {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   484
    and Kc: "\<forall>S \<in>K. closedin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   485
  shows "closedin U (\<Inter> K)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   486
  using Ke Kc unfolding closedin_def Diff_Inter by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   487
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   488
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
   489
  using closedin_Inter[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   490
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   491
lemma Diff_Diff_Int: "A - (A - B) = A \<inter> B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   492
  by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   493
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   494
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
   495
  apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   496
  apply (metis openin_subset subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   497
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   498
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   499
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
   500
  by (simp add: openin_closedin_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   501
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   502
lemma openin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   503
  assumes oS: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   504
    and cT: "closedin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   505
  shows "openin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   506
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   507
  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
   508
    by (auto simp add: topspace_def openin_subset)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   509
  then show ?thesis using oS cT
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   510
    by (auto simp add: closedin_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   511
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   512
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   513
lemma closedin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   514
  assumes oS: "closedin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   515
    and cT: "openin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   516
  shows "closedin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   517
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   518
  have "S - T = S \<inter> (topspace U - T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   519
    using closedin_subset[of U S] oS cT by (auto simp add: topspace_def)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   520
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   521
    using oS cT by (auto simp add: openin_closedin_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   522
qed
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   523
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   524
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   525
subsubsection {* Subspace topology *}
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   526
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   527
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
   528
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   529
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
   530
  (is "istopology ?L")
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   531
proof -
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   532
  have "?L {}" by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   533
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   534
    fix A B
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   535
    assume A: "?L A" and B: "?L B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   536
    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
   537
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   538
    have "A \<inter> B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   539
      using Sa Sb by blast+
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   540
    then have "?L (A \<inter> B)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   541
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   542
  moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   543
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   544
    fix K
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   545
    assume K: "K \<subseteq> Collect ?L"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   546
    have th0: "Collect ?L = (\<lambda>S. S \<inter> V) ` Collect (openin U)"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
   547
      apply (rule set_eqI)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   548
      apply (simp add: Ball_def image_iff)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   549
      apply metis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   550
      done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   551
    from K[unfolded th0 subset_image_iff]
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   552
    obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   553
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   554
    have "\<Union>K = (\<Union>Sk) \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   555
      using Sk by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   556
    moreover have "openin U (\<Union> Sk)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   557
      using Sk by (auto simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   558
    ultimately have "?L (\<Union>K)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   559
  }
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   560
  ultimately show ?thesis
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   561
    unfolding subset_eq mem_Collect_eq istopology_def by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   562
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   563
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   564
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
   565
  unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   566
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   567
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   568
lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \<inter> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   569
  by (auto simp add: topspace_def openin_subtopology)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   570
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   571
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
   572
  unfolding closedin_def topspace_subtopology
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   573
  apply (simp add: openin_subtopology)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   574
  apply (rule iffI)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   575
  apply clarify
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   576
  apply (rule_tac x="topspace U - T" in exI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   577
  apply auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   578
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   579
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   580
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   581
  unfolding openin_subtopology
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   582
  apply (rule iffI, clarify)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   583
  apply (frule openin_subset[of U])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   584
  apply blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   585
  apply (rule exI[where x="topspace U"])
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   586
  apply auto
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   587
  done
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   588
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   589
lemma subtopology_superset:
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   590
  assumes UV: "topspace U \<subseteq> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   591
  shows "subtopology U V = U"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   592
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   593
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   594
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   595
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   596
      fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   597
      assume T: "openin U T" "S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   598
      from T openin_subset[OF T(1)] UV have eq: "S = T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   599
        by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   600
      have "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   601
        unfolding eq using T by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   602
    }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   603
    moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   604
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   605
      assume S: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   606
      then have "\<exists>T. openin U T \<and> S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   607
        using openin_subset[OF S] UV by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   608
    }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   609
    ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   610
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   611
  }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   612
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   613
    unfolding topology_eq openin_subtopology by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   614
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   615
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   616
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   617
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   618
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   619
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   620
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   621
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   622
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   623
subsubsection {* The standard Euclidean topology *}
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   624
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   625
definition euclidean :: "'a::topological_space topology"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   626
  where "euclidean = topology open"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   627
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   628
lemma open_openin: "open S \<longleftrightarrow> openin euclidean S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   629
  unfolding euclidean_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   630
  apply (rule cong[where x=S and y=S])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   631
  apply (rule topology_inverse[symmetric])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   632
  apply (auto simp add: istopology_def)
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   633
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   634
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   635
lemma topspace_euclidean: "topspace euclidean = UNIV"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   636
  apply (simp add: topspace_def)
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
   637
  apply (rule set_eqI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   638
  apply (auto simp add: open_openin[symmetric])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   639
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   640
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   641
lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   642
  by (simp add: topspace_euclidean topspace_subtopology)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   643
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   644
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   645
  by (simp add: closed_def closedin_def topspace_euclidean open_openin Compl_eq_Diff_UNIV)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   646
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   647
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   648
  by (simp add: open_openin openin_subopen[symmetric])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   649
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   650
text {* Basic "localization" results are handy for connectedness. *}
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   651
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   652
lemma openin_open: "openin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. open T \<and> (S = U \<inter> T))"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   653
  by (auto simp add: openin_subtopology open_openin[symmetric])
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   654
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   655
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
   656
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   657
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   658
lemma open_openin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   659
  "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
   660
  by (metis Int_absorb1  openin_open_Int)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   661
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   662
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
   663
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   664
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   665
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
   666
  by (simp add: closedin_subtopology closed_closedin Int_ac)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   667
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   668
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
   669
  by (metis closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   670
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   671
lemma closed_closedin_trans:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   672
  "closed S \<Longrightarrow> closed T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> closedin (subtopology euclidean S) T"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   673
  apply (subgoal_tac "S \<inter> T = T" )
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   674
  apply auto
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   675
  apply (frule closedin_closed_Int[of T S])
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   676
  apply simp
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   677
  done
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   678
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   679
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
   680
  by (auto simp add: closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   681
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   682
lemma openin_euclidean_subtopology_iff:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   683
  fixes S U :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   684
  shows "openin (subtopology euclidean U) S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   685
    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
   686
  (is "?lhs \<longleftrightarrow> ?rhs")
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   687
proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   688
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   689
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   690
    unfolding openin_open open_dist by blast
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   691
next
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   692
  def T \<equiv> "{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}"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   693
  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
   694
    unfolding T_def
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   695
    apply clarsimp
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   696
    apply (rule_tac x="d - dist x a" in exI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   697
    apply (clarsimp simp add: less_diff_eq)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   698
    apply (erule rev_bexI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   699
    apply (rule_tac x=d in exI, clarify)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   700
    apply (erule le_less_trans [OF dist_triangle])
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   701
    done
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   702
  assume ?rhs then have 2: "S = U \<inter> T"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   703
    unfolding T_def
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   704
    apply auto
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   705
    apply (drule (1) bspec, erule rev_bexI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   706
    apply auto
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   707
    done
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   708
  from 1 2 show ?lhs
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   709
    unfolding openin_open open_dist by fast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   710
qed
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   711
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   712
text {* These "transitivity" results are handy too *}
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   713
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   714
lemma openin_trans[trans]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   715
  "openin (subtopology euclidean T) S \<Longrightarrow> openin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   716
    openin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   717
  unfolding open_openin openin_open by blast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   718
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   719
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
   720
  by (auto simp add: openin_open intro: openin_trans)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   721
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   722
lemma closedin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   723
  "closedin (subtopology euclidean T) S \<Longrightarrow> closedin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   724
    closedin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   725
  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
   726
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   727
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
   728
  by (auto simp add: closedin_closed intro: closedin_trans)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   729
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   730
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   731
subsection {* Open and closed balls *}
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   732
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   733
definition ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   734
  where "ball x e = {y. dist x y < e}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   735
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   736
definition cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   737
  where "cball x e = {y. dist x y \<le> e}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   738
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
   739
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
   740
  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
   741
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
   742
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
   743
  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
   744
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
   745
lemma mem_ball_0:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   746
  fixes x :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   747
  shows "x \<in> ball 0 e \<longleftrightarrow> norm x < e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   748
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   749
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
   750
lemma mem_cball_0:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   751
  fixes x :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   752
  shows "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   753
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   754
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
   755
lemma centre_in_ball: "x \<in> ball x e \<longleftrightarrow> 0 < 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
   756
  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
   757
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
   758
lemma centre_in_cball: "x \<in> cball x e \<longleftrightarrow> 0 \<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
   759
  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
   760
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   761
lemma ball_subset_cball[simp,intro]: "ball x e \<subseteq> cball x e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   762
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   763
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   764
lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   765
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   766
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   767
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   768
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   769
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   770
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
   771
  by (simp add: set_eq_iff) arith
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   772
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   773
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
   774
  by (simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   775
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   776
lemma diff_less_iff:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   777
  "(a::real) - b > 0 \<longleftrightarrow> a > b"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   778
  "(a::real) - b < 0 \<longleftrightarrow> a < b"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   779
  "a - b < c \<longleftrightarrow> a < c + b" "a - b > c \<longleftrightarrow> a > c + b"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   780
  by arith+
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   781
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   782
lemma diff_le_iff:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   783
  "(a::real) - b \<ge> 0 \<longleftrightarrow> a \<ge> b"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   784
  "(a::real) - b \<le> 0 \<longleftrightarrow> a \<le> b"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   785
  "a - b \<le> c \<longleftrightarrow> a \<le> c + b"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   786
  "a - b \<ge> c \<longleftrightarrow> a \<ge> c + b"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   787
  by arith+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   788
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   789
lemma open_vimage: (* TODO: move to Topological_Spaces.thy *)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   790
  assumes "open s" and "continuous_on UNIV f"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   791
  shows "open (vimage f s)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   792
  using assms unfolding continuous_on_open_vimage [OF open_UNIV]
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   793
  by simp
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   794
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   795
lemma open_ball [intro, simp]: "open (ball x e)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   796
proof -
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   797
  have "open (dist x -` {..<e})"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   798
    by (intro open_vimage open_lessThan continuous_on_intros)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   799
  also have "dist x -` {..<e} = ball x e"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   800
    by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   801
  finally show ?thesis .
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
   802
qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   803
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   804
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   805
  unfolding open_dist subset_eq mem_ball Ball_def dist_commute ..
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   806
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
   807
lemma openE[elim?]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   808
  assumes "open S" "x\<in>S"
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
   809
  obtains e where "e>0" "ball x e \<subseteq> S"
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
   810
  using assms unfolding open_contains_ball by auto
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
   811
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   812
lemma open_contains_ball_eq: "open S \<Longrightarrow> \<forall>x. x\<in>S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   813
  by (metis open_contains_ball subset_eq centre_in_ball)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   814
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   815
lemma ball_eq_empty[simp]: "ball x e = {} \<longleftrightarrow> e \<le> 0"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
   816
  unfolding mem_ball set_eq_iff
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   817
  apply (simp add: not_less)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   818
  apply (metis zero_le_dist order_trans dist_self)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   819
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   820
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   821
lemma ball_empty[intro]: "e \<le> 0 \<Longrightarrow> ball x e = {}" by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   822
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
   823
lemma euclidean_dist_l2:
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   824
  fixes x y :: "'a :: euclidean_space"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   825
  shows "dist x y = setL2 (\<lambda>i. dist (x \<bullet> i) (y \<bullet> i)) Basis"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   826
  unfolding dist_norm norm_eq_sqrt_inner setL2_def
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   827
  by (subst euclidean_inner) (simp add: power2_eq_square inner_diff_left)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   828
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   829
definition "box a b = {x. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   830
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   831
lemma rational_boxes:
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
   832
  fixes x :: "'a\<Colon>euclidean_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   833
  assumes "e > 0"
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
   834
  shows "\<exists>a b. (\<forall>i\<in>Basis. a \<bullet> i \<in> \<rat> \<and> b \<bullet> i \<in> \<rat> ) \<and> x \<in> box a b \<and> box a b \<subseteq> ball x e"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   835
proof -
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   836
  def e' \<equiv> "e / (2 * sqrt (real (DIM ('a))))"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   837
  then have e: "e' > 0"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   838
    using assms by (auto intro!: divide_pos_pos simp: DIM_positive)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   839
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x \<bullet> i \<and> x \<bullet> i - y < e'" (is "\<forall>i. ?th i")
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   840
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   841
    fix i
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   842
    from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   843
    show "?th i" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   844
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   845
  from choice[OF this] guess a .. note a = this
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
   846
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x \<bullet> i < y \<and> y - x \<bullet> i < e'" (is "\<forall>i. ?th i")
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   847
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   848
    fix i
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   849
    from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   850
    show "?th i" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   851
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   852
  from choice[OF this] guess b .. note b = this
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
   853
  let ?a = "\<Sum>i\<in>Basis. a i *\<^sub>R i" and ?b = "\<Sum>i\<in>Basis. b i *\<^sub>R i"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   854
  show ?thesis
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   855
  proof (rule exI[of _ ?a], rule exI[of _ ?b], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   856
    fix y :: 'a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   857
    assume *: "y \<in> box ?a ?b"
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
   858
    have "dist x y = sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2)"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   859
      unfolding setL2_def[symmetric] by (rule euclidean_dist_l2)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   860
    also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   861
    proof (rule real_sqrt_less_mono, rule setsum_strict_mono)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   862
      fix i :: "'a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   863
      assume i: "i \<in> Basis"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   864
      have "a i < y\<bullet>i \<and> y\<bullet>i < b i"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   865
        using * i by (auto simp: box_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   866
      moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   867
        using a by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   868
      moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   869
        using b by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   870
      ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   871
        by auto
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   872
      then have "dist (x \<bullet> i) (y \<bullet> i) < e/sqrt (real (DIM('a)))"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   873
        unfolding e'_def by (auto simp: dist_real_def)
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
   874
      then have "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < (e/sqrt (real (DIM('a))))\<^sup>2"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   875
        by (rule power_strict_mono) auto
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
   876
      then show "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < e\<^sup>2 / real DIM('a)"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   877
        by (simp add: power_divide)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   878
    qed auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   879
    also have "\<dots> = e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   880
      using `0 < e` by (simp add: real_eq_of_nat)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   881
    finally show "y \<in> ball x e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   882
      by (auto simp: ball_def)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   883
  qed (insert a b, auto simp: box_def)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   884
qed
51103
5dd7b89a16de generalized
immler
parents: 51102
diff changeset
   885
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
   886
lemma open_UNION_box:
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   887
  fixes M :: "'a\<Colon>euclidean_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   888
  assumes "open M"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   889
  defines "a' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   890
  defines "b' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
   891
  defines "I \<equiv> {f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. box (a' f) (b' f) \<subseteq> M}"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
   892
  shows "M = (\<Union>f\<in>I. box (a' f) (b' f))"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   893
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   894
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   895
    fix x assume "x \<in> M"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   896
    obtain e where e: "e > 0" "ball x e \<subseteq> M"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   897
      using openE[OF `open M` `x \<in> M`] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   898
    moreover obtain a b where ab:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   899
      "x \<in> box a b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   900
      "\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   901
      "\<forall>i\<in>Basis. b \<bullet> i \<in> \<rat>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   902
      "box a b \<subseteq> ball x e"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   903
      using rational_boxes[OF e(1)] by metis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   904
    ultimately have "x \<in> (\<Union>f\<in>I. box (a' f) (b' f))"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   905
       by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<bullet> i)"])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   906
          (auto simp: euclidean_representation I_def a'_def b'_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   907
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   908
  then show ?thesis by (auto simp: I_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   909
qed
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   910
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   911
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   912
subsection{* Connectedness *}
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   913
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   914
lemma connected_local:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   915
 "connected S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   916
  \<not> (\<exists>e1 e2.
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   917
      openin (subtopology euclidean S) e1 \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   918
      openin (subtopology euclidean S) e2 \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   919
      S \<subseteq> e1 \<union> e2 \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   920
      e1 \<inter> e2 = {} \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   921
      e1 \<noteq> {} \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   922
      e2 \<noteq> {})"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   923
  unfolding connected_def openin_open
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   924
  apply safe
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   925
  apply blast+
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   926
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   927
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
   928
lemma exists_diff:
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
   929
  fixes P :: "'a set \<Rightarrow> bool"
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
   930
  shows "(\<exists>S. P(- S)) \<longleftrightarrow> (\<exists>S. P S)" (is "?lhs \<longleftrightarrow> ?rhs")
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   931
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   932
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   933
    assume "?lhs"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   934
    then have ?rhs by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   935
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   936
  moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   937
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   938
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   939
    assume H: "P S"
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
   940
    have "S = - (- S)" by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   941
    with H have "P (- (- S))" by metis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   942
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   943
  ultimately show ?thesis by metis
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   944
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   945
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   946
lemma connected_clopen: "connected S \<longleftrightarrow>
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   947
  (\<forall>T. openin (subtopology euclidean S) T \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   948
     closedin (subtopology euclidean S) T \<longrightarrow> T = {} \<or> T = S)" (is "?lhs \<longleftrightarrow> ?rhs")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   949
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   950
  have "\<not> connected S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   951
    (\<exists>e1 e2. open e1 \<and> open (- e2) \<and> S \<subseteq> e1 \<union> (- e2) \<and> e1 \<inter> (- e2) \<inter> S = {} \<and> e1 \<inter> S \<noteq> {} \<and> (- e2) \<inter> S \<noteq> {})"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   952
    unfolding connected_def openin_open closedin_closed
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   953
    apply (subst exists_diff)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   954
    apply blast
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   955
    done
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   956
  then have th0: "connected S \<longleftrightarrow>
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   957
    \<not> (\<exists>e2 e1. closed e2 \<and> open e1 \<and> S \<subseteq> e1 \<union> (- e2) \<and> e1 \<inter> (- e2) \<inter> S = {} \<and> e1 \<inter> S \<noteq> {} \<and> (- e2) \<inter> S \<noteq> {})"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   958
    (is " _ \<longleftrightarrow> \<not> (\<exists>e2 e1. ?P e2 e1)")
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   959
    apply (simp add: closed_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   960
    apply metis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
   961
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   962
  have th1: "?rhs \<longleftrightarrow> \<not> (\<exists>t' t. closed t'\<and>t = S\<inter>t' \<and> t\<noteq>{} \<and> t\<noteq>S \<and> (\<exists>t'. open t' \<and> t = S \<inter> t'))"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   963
    (is "_ \<longleftrightarrow> \<not> (\<exists>t' t. ?Q t' t)")
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   964
    unfolding connected_def openin_open closedin_closed by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   965
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   966
    fix e2
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   967
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   968
      fix e1
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   969
      have "?P e2 e1 \<longleftrightarrow> (\<exists>t. closed e2 \<and> t = S\<inter>e2 \<and> open e1 \<and> t = S\<inter>e1 \<and> t\<noteq>{} \<and> t \<noteq> S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   970
        by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   971
    }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   972
    then have "(\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   973
      by metis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   974
  }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   975
  then have "\<forall>e2. (\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   976
    by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   977
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   978
    unfolding th0 th1 by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   979
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   980
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   981
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   982
subsection{* Limit points *}
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   983
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   984
definition (in topological_space) islimpt:: "'a \<Rightarrow> 'a set \<Rightarrow> bool"  (infixr "islimpt" 60)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   985
  where "x islimpt S \<longleftrightarrow> (\<forall>T. x\<in>T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y\<in>T \<and> y\<noteq>x))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   986
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   987
lemma islimptI:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   988
  assumes "\<And>T. x \<in> T \<Longrightarrow> open T \<Longrightarrow> \<exists>y\<in>S. y \<in> T \<and> y \<noteq> x"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   989
  shows "x islimpt S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   990
  using assms unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   991
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   992
lemma islimptE:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   993
  assumes "x islimpt S" and "x \<in> T" and "open T"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   994
  obtains y where "y \<in> S" and "y \<in> T" and "y \<noteq> x"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   995
  using assms unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   996
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
   997
lemma islimpt_iff_eventually: "x islimpt S \<longleftrightarrow> \<not> eventually (\<lambda>y. y \<notin> S) (at x)"
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
   998
  unfolding islimpt_def eventually_at_topological by auto
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
   999
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1000
lemma islimpt_subset: "x islimpt S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> x islimpt T"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1001
  unfolding islimpt_def by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1002
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1003
lemma islimpt_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1004
  fixes x :: "'a::metric_space"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1005
  shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e)"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1006
  unfolding islimpt_iff_eventually eventually_at by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1007
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1008
lemma islimpt_approachable_le:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1009
  fixes x :: "'a::metric_space"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  1010
  shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x \<le> e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1011
  unfolding islimpt_approachable
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1012
  using approachable_lt_le [where f="\<lambda>y. dist y x" and P="\<lambda>y. y \<notin> S \<or> y = x",
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1013
    THEN arg_cong [where f=Not]]
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1014
  by (simp add: Bex_def conj_commute conj_left_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1015
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1016
lemma islimpt_UNIV_iff: "x islimpt UNIV \<longleftrightarrow> \<not> open {x}"
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1017
  unfolding islimpt_def by (safe, fast, case_tac "T = {x}", fast, fast)
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1018
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1019
lemma islimpt_punctured: "x islimpt S = x islimpt (S-{x})"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1020
  unfolding islimpt_def by blast
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1021
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1022
text {* A perfect space has no isolated points. *}
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1023
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1024
lemma islimpt_UNIV [simp, intro]: "(x::'a::perfect_space) islimpt UNIV"
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1025
  unfolding islimpt_UNIV_iff by (rule not_open_singleton)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1026
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1027
lemma perfect_choose_dist:
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  1028
  fixes x :: "'a::{perfect_space, metric_space}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1029
  shows "0 < r \<Longrightarrow> \<exists>a. a \<noteq> x \<and> dist a x < r"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1030
  using islimpt_UNIV [of x]
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1031
  by (simp add: islimpt_approachable)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1032
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1033
lemma closed_limpt: "closed S \<longleftrightarrow> (\<forall>x. x islimpt S \<longrightarrow> x \<in> S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1034
  unfolding closed_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1035
  apply (subst open_subopen)
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  1036
  apply (simp add: islimpt_def subset_eq)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1037
  apply (metis ComplE ComplI)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1038
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1039
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1040
lemma islimpt_EMPTY[simp]: "\<not> x islimpt {}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1041
  unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1042
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1043
lemma finite_set_avoid:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1044
  fixes a :: "'a::metric_space"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1045
  assumes fS: "finite S"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  1046
  shows  "\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<longrightarrow> d \<le> dist a x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1047
proof (induct rule: finite_induct[OF fS])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1048
  case 1
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1049
  then show ?case by (auto intro: zero_less_one)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1050
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1051
  case (2 x F)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1052
  from 2 obtain d where d: "d >0" "\<forall>x\<in>F. x\<noteq>a \<longrightarrow> d \<le> dist a x"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1053
    by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1054
  show ?case
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1055
  proof (cases "x = a")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1056
    case True
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1057
    then show ?thesis using d by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1058
  next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1059
    case False
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1060
    let ?d = "min d (dist a x)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1061
    have dp: "?d > 0"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1062
      using False d(1) using dist_nz by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1063
    from d have d': "\<forall>x\<in>F. x\<noteq>a \<longrightarrow> ?d \<le> dist a x"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1064
      by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1065
    with dp False show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1066
      by (auto intro!: exI[where x="?d"])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1067
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1068
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1069
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1070
lemma islimpt_Un: "x islimpt (S \<union> T) \<longleftrightarrow> x islimpt S \<or> x islimpt T"
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  1071
  by (simp add: islimpt_iff_eventually eventually_conj_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1072
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1073
lemma discrete_imp_closed:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1074
  fixes S :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1075
  assumes e: "0 < e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1076
    and d: "\<forall>x \<in> S. \<forall>y \<in> S. dist y x < e \<longrightarrow> y = x"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1077
  shows "closed S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1078
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1079
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1080
    fix x
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1081
    assume C: "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1082
    from e have e2: "e/2 > 0" by arith
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1083
    from C[rule_format, OF e2] obtain y where y: "y \<in> S" "y \<noteq> x" "dist y x < e/2"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1084
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1085
    let ?m = "min (e/2) (dist x y) "
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1086
    from e2 y(2) have mp: "?m > 0"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  1087
      by (simp add: dist_nz[symmetric])
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1088
    from C[rule_format, OF mp] obtain z where z: "z \<in> S" "z \<noteq> x" "dist z x < ?m"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1089
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1090
    have th: "dist z y < e" using z y
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1091
      by (intro dist_triangle_lt [where z=x], simp)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1092
    from d[rule_format, OF y(1) z(1) th] y z
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1093
    have False by (auto simp add: dist_commute)}
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1094
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1095
    by (metis islimpt_approachable closed_limpt [where 'a='a])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1096
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1097
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1098
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1099
subsection {* Interior of a Set *}
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1100
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1101
definition "interior S = \<Union>{T. open T \<and> T \<subseteq> S}"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1102
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1103
lemma interiorI [intro?]:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1104
  assumes "open T" and "x \<in> T" and "T \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1105
  shows "x \<in> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1106
  using assms unfolding interior_def by fast
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1107
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1108
lemma interiorE [elim?]:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1109
  assumes "x \<in> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1110
  obtains T where "open T" and "x \<in> T" and "T \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1111
  using assms unfolding interior_def by fast
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1112
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1113
lemma open_interior [simp, intro]: "open (interior S)"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1114
  by (simp add: interior_def open_Union)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1115
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1116
lemma interior_subset: "interior S \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1117
  by (auto simp add: interior_def)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1118
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1119
lemma interior_maximal: "T \<subseteq> S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1120
  by (auto simp add: interior_def)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1121
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1122
lemma interior_open: "open S \<Longrightarrow> interior S = S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1123
  by (intro equalityI interior_subset interior_maximal subset_refl)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1124
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1125
lemma interior_eq: "interior S = S \<longleftrightarrow> open S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1126
  by (metis open_interior interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1127
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1128
lemma open_subset_interior: "open S \<Longrightarrow> S \<subseteq> interior T \<longleftrightarrow> S \<subseteq> T"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1129
  by (metis interior_maximal interior_subset subset_trans)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1130
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1131
lemma interior_empty [simp]: "interior {} = {}"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1132
  using open_empty by (rule interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1133
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  1134
lemma interior_UNIV [simp]: "interior UNIV = UNIV"
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  1135
  using open_UNIV by (rule interior_open)
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  1136
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1137
lemma interior_interior [simp]: "interior (interior S) = interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1138
  using open_interior by (rule interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1139
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  1140
lemma interior_mono: "S \<subseteq> T \<Longrightarrow> interior S \<subseteq> interior T"
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  1141
  by (auto simp add: interior_def)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1142
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1143
lemma interior_unique:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1144
  assumes "T \<subseteq> S" and "open T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1145
  assumes "\<And>T'. T' \<subseteq> S \<Longrightarrow> open T' \<Longrightarrow> T' \<subseteq> T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  1146
  shows &qu