src/HOL/Analysis/Topology_Euclidean_Space.thy
author wenzelm
Tue, 01 Aug 2017 17:33:04 +0200
changeset 66304 cde6ceffcbc7
parent 66286 1c977b13414f
child 66408 46cfd348c373
permissions -rw-r--r--
isabelle update_cartouches -c -t;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
     1
(*  Author:     L C Paulson, University of Cambridge
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     2
    Author:     Amine Chaieb, University of Cambridge
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     3
    Author:     Robert Himmelmann, TU Muenchen
44075
5952bd355779 generalize more lemmas about compactness
huffman
parents: 44074
diff changeset
     4
    Author:     Brian Huffman, Portland State University
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     5
*)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     6
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
     7
section \<open>Elementary topology in Euclidean space.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     8
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
     9
theory Topology_Euclidean_Space
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    10
imports
61880
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
    11
  "~~/src/HOL/Library/Indicator_Function"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
    12
  "~~/src/HOL/Library/Countable_Set"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
    13
  "~~/src/HOL/Library/FuncSet"
50938
hoelzl
parents: 50937
diff changeset
    14
  Linear_Algebra
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    15
  Norm_Arith
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    16
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
    17
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    18
(* FIXME: move elsewhere *)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
    19
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    20
lemma Times_eq_image_sum:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    21
  fixes S :: "'a :: comm_monoid_add set" and T :: "'b :: comm_monoid_add set"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    22
  shows "S \<times> T = {u + v |u v. u \<in> (\<lambda>x. (x, 0)) ` S \<and> v \<in> Pair 0 ` T}"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    23
  by force
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
    24
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    25
lemma halfspace_Int_eq:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    26
     "{x. a \<bullet> x \<le> b} \<inter> {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    27
     "{x. b \<le> a \<bullet> x} \<inter> {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    28
  by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
    29
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    30
definition (in monoid_add) support_on :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'b set"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
    31
  where "support_on s f = {x\<in>s. f x \<noteq> 0}"
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    32
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    33
lemma in_support_on: "x \<in> support_on s f \<longleftrightarrow> x \<in> s \<and> f x \<noteq> 0"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    34
  by (simp add: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    35
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    36
lemma support_on_simps[simp]:
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    37
  "support_on {} f = {}"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    38
  "support_on (insert x s) f =
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    39
    (if f x = 0 then support_on s f else insert x (support_on s f))"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    40
  "support_on (s \<union> t) f = support_on s f \<union> support_on t f"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    41
  "support_on (s \<inter> t) f = support_on s f \<inter> support_on t f"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    42
  "support_on (s - t) f = support_on s f - support_on t f"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    43
  "support_on (f ` s) g = f ` (support_on s (g \<circ> f))"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    44
  unfolding support_on_def by auto
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    45
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    46
lemma support_on_cong:
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    47
  "(\<And>x. x \<in> s \<Longrightarrow> f x = 0 \<longleftrightarrow> g x = 0) \<Longrightarrow> support_on s f = support_on s g"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    48
  by (auto simp: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    49
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    50
lemma support_on_if: "a \<noteq> 0 \<Longrightarrow> support_on A (\<lambda>x. if P x then a else 0) = {x\<in>A. P x}"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    51
  by (auto simp: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    52
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    53
lemma support_on_if_subset: "support_on A (\<lambda>x. if P x then a else 0) \<subseteq> {x \<in> A. P x}"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    54
  by (auto simp: support_on_def)
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    55
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    56
lemma finite_support[intro]: "finite s \<Longrightarrow> finite (support_on s f)"
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    57
  unfolding support_on_def by auto
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    58
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    59
(* TODO: is supp_sum really needed? TODO: Generalize to Finite_Set.fold *)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    60
definition (in comm_monoid_add) supp_sum :: "('b \<Rightarrow> 'a) \<Rightarrow> 'b set \<Rightarrow> 'a"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
    61
  where "supp_sum f s = (\<Sum>x\<in>support_on s f. f x)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    62
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    63
lemma supp_sum_empty[simp]: "supp_sum f {} = 0"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    64
  unfolding supp_sum_def by auto
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    65
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    66
lemma supp_sum_insert[simp]:
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    67
  "finite (support_on s f) \<Longrightarrow>
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    68
    supp_sum f (insert x s) = (if x \<in> s then supp_sum f s else f x + supp_sum f s)"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    69
  by (simp add: supp_sum_def in_support_on insert_absorb)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    70
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    71
lemma supp_sum_divide_distrib: "supp_sum f A / (r::'a::field) = supp_sum (\<lambda>n. f n / r) A"
63593
bbcb05504fdc HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
hoelzl
parents: 63540
diff changeset
    72
  by (cases "r = 0")
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
    73
     (auto simp: supp_sum_def sum_divide_distrib intro!: sum.cong support_on_cong)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    74
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    75
(*END OF SUPPORT, ETC.*)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
    76
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    77
lemma image_affinity_interval:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    78
  fixes c :: "'a::ordered_real_vector"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    79
  shows "((\<lambda>x. m *\<^sub>R x + c) ` {a..b}) = (if {a..b}={} then {}
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    80
            else if 0 <= m then {m *\<^sub>R a + c .. m  *\<^sub>R b + c}
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    81
            else {m *\<^sub>R b + c .. m *\<^sub>R a + c})"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    82
  apply (case_tac "m=0", force)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    83
  apply (auto simp: scaleR_left_mono)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    84
  apply (rule_tac x="inverse m *\<^sub>R (x-c)" in rev_image_eqI, auto simp: pos_le_divideR_eq le_diff_eq scaleR_left_mono_neg)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    85
  apply (metis diff_le_eq inverse_inverse_eq order.not_eq_order_implies_strict pos_le_divideR_eq positive_imp_inverse_positive)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    86
  apply (rule_tac x="inverse m *\<^sub>R (x-c)" in rev_image_eqI, auto simp: not_le neg_le_divideR_eq diff_le_eq)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    87
  using le_diff_eq scaleR_le_cancel_left_neg
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    88
  apply fastforce
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    89
  done
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
    90
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
    91
lemma countable_PiE:
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
    92
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> countable (F i)) \<Longrightarrow> countable (Pi\<^sub>E I F)"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
    93
  by (induct I arbitrary: F rule: finite_induct) (auto simp: PiE_insert_eq)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
    94
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    95
lemma open_sums:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    96
  fixes T :: "('b::real_normed_vector) set"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    97
  assumes "open S \<or> open T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    98
  shows "open (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
    99
  using assms
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   100
proof
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   101
  assume S: "open S"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   102
  show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   103
  proof (clarsimp simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   104
    fix x y
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   105
    assume "x \<in> S" "y \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   106
    with S obtain e where "e > 0" and e: "\<And>x'. dist x' x < e \<Longrightarrow> x' \<in> S"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   107
      by (auto simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   108
    then have "\<And>z. dist z (x + y) < e \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>T. z = x + y"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   109
      by (metis \<open>y \<in> T\<close> diff_add_cancel dist_add_cancel2)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   110
    then show "\<exists>e>0. \<forall>z. dist z (x + y) < e \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>T. z = x + y)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   111
      using \<open>0 < e\<close> \<open>x \<in> S\<close> by blast
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   112
  qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   113
next
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   114
  assume T: "open T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   115
  show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   116
  proof (clarsimp simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   117
    fix x y
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   118
    assume "x \<in> S" "y \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   119
    with T obtain e where "e > 0" and e: "\<And>x'. dist x' y < e \<Longrightarrow> x' \<in> T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   120
      by (auto simp: open_dist)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   121
    then have "\<And>z. dist z (x + y) < e \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>T. z = x + y"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   122
      by (metis \<open>x \<in> S\<close> add_diff_cancel_left' add_diff_eq diff_diff_add dist_norm)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   123
    then show "\<exists>e>0. \<forall>z. dist z (x + y) < e \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>T. z = x + y)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   124
      using \<open>0 < e\<close> \<open>y \<in> T\<close> by blast
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   125
  qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   126
qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   127
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   128
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   129
subsection \<open>Topological Basis\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   130
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   131
context topological_space
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   132
begin
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   133
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   134
definition "topological_basis B \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   135
  (\<forall>b\<in>B. open b) \<and> (\<forall>x. open x \<longrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   136
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   137
lemma topological_basis:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   138
  "topological_basis B \<longleftrightarrow> (\<forall>x. open x \<longleftrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   139
  unfolding topological_basis_def
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   140
  apply safe
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   141
     apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   142
    apply fastforce
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   143
   apply (erule_tac x="x" in allE)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   144
   apply simp
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   145
   apply (rule_tac x="{x}" in exI)
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   146
  apply auto
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   147
  done
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
   148
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   149
lemma topological_basis_iff:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   150
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   151
  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
   152
    (is "_ \<longleftrightarrow> ?rhs")
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   153
proof safe
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   154
  fix O' and x::'a
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   155
  assume H: "topological_basis B" "open O'" "x \<in> O'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   156
  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
   157
  then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   158
  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
   159
next
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   160
  assume H: ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   161
  show "topological_basis B"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   162
    using assms unfolding topological_basis_def
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   163
  proof safe
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   164
    fix O' :: "'a set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   165
    assume "open O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   166
    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
   167
      by (force intro: bchoice simp: Bex_def)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   168
    then show "\<exists>B'\<subseteq>B. \<Union>B' = O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   169
      by (auto intro: exI[where x="{f x |x. x \<in> O'}"])
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   170
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   171
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   172
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   173
lemma topological_basisI:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   174
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   175
    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
   176
  shows "topological_basis B"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   177
  using assms by (subst topological_basis_iff) auto
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   178
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   179
lemma topological_basisE:
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   180
  fixes O'
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   181
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   182
    and "open O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   183
    and "x \<in> O'"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   184
  obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   185
proof atomize_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   186
  from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   187
    by (simp add: topological_basis_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   188
  with topological_basis_iff assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   189
  show  "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   190
    using assms by (simp add: Bex_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   191
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   192
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   193
lemma topological_basis_open:
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   194
  assumes "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   195
    and "X \<in> B"
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   196
  shows "open X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   197
  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
   198
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   199
lemma topological_basis_imp_subbasis:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   200
  assumes B: "topological_basis B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   201
  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
   202
proof (intro ext iffI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   203
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   204
  assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   205
  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
   206
    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
   207
  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
   208
    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
   209
next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   210
  fix S :: "'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   211
  assume "generate_topology B S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   212
  then show "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   213
    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
   214
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   215
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   216
lemma basis_dense:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   217
  fixes B :: "'a set set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   218
    and f :: "'a set \<Rightarrow> 'a"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   219
  assumes "topological_basis B"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   220
    and choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   221
  shows "\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>B' \<in> B. f B' \<in> X)"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   222
proof (intro allI impI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   223
  fix X :: "'a set"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   224
  assume "open X" and "X \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   225
  from topological_basisE[OF \<open>topological_basis B\<close> \<open>open X\<close> choosefrom_basis[OF \<open>X \<noteq> {}\<close>]]
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   226
  obtain B' where "B' \<in> B" "f X \<in> B'" "B' \<subseteq> X" .
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   227
  then show "\<exists>B'\<in>B. f B' \<in> X"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   228
    by (auto intro!: choosefrom_basis)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   229
qed
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   230
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   231
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   232
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   233
lemma topological_basis_prod:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   234
  assumes A: "topological_basis A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   235
    and B: "topological_basis B"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   236
  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
   237
  unfolding topological_basis_def
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   238
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   239
  fix S :: "('a \<times> 'b) set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   240
  assume "open S"
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   241
  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
   242
  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
   243
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   244
    assume "(x, y) \<in> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   245
    from open_prod_elim[OF \<open>open S\<close> this]
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   246
    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
   247
      by (metis mem_Sigma_iff)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   248
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   249
    from A a obtain A0 where "A0 \<in> A" "x \<in> A0" "A0 \<subseteq> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   250
      by (rule topological_basisE)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   251
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   252
    from B b obtain B0 where "B0 \<in> B" "y \<in> B0" "B0 \<subseteq> b"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   253
      by (rule topological_basisE)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   254
    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
   255
      by (intro UN_I[of "(A0, B0)"]) auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   256
  qed auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   257
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
   258
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   259
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   260
subsection \<open>Countable Basis\<close>
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   261
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   262
locale countable_basis =
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   263
  fixes B :: "'a::topological_space set set"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   264
  assumes is_basis: "topological_basis B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   265
    and countable_basis: "countable B"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   266
begin
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   267
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   268
lemma open_countable_basis_ex:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   269
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   270
  shows "\<exists>B' \<subseteq> B. X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   271
  using assms countable_basis is_basis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   272
  unfolding topological_basis_def by blast
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   273
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   274
lemma open_countable_basisE:
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   275
  assumes "open X"
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
   276
  obtains B' where "B' \<subseteq> B" "X = \<Union>B'"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   277
  using assms open_countable_basis_ex
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   278
  by (atomize_elim) simp
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   279
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   280
lemma countable_dense_exists:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   281
  "\<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
   282
proof -
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   283
  let ?f = "(\<lambda>B'. SOME x. x \<in> B')"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   284
  have "countable (?f ` B)" using countable_basis by simp
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   285
  with basis_dense[OF is_basis, of ?f] show ?thesis
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   286
    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
   287
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   288
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   289
lemma countable_dense_setE:
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   290
  obtains D :: "'a set"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   291
  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
   292
  using countable_dense_exists by blast
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50105
diff changeset
   293
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   294
end
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   295
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   296
lemma (in first_countable_topology) first_countable_basisE:
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   297
  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
   298
    "\<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
   299
  using first_countable_basis[of x]
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   300
  apply atomize_elim
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   301
  apply (elim exE)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   302
  apply (rule_tac x="range A" in exI)
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   303
  apply auto
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   304
  done
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   305
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   306
lemma (in first_countable_topology) first_countable_basis_Int_stableE:
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   307
  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
   308
    "\<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
   309
    "\<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
   310
proof atomize_elim
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   311
  obtain A' where A':
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   312
    "countable A'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   313
    "\<And>a. a \<in> A' \<Longrightarrow> x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   314
    "\<And>a. a \<in> A' \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   315
    "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A'. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   316
    by (rule first_countable_basisE) blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   317
  define A where [abs_def]:
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   318
    "A = (\<lambda>N. \<Inter>((\<lambda>n. from_nat_into A' n) ` N)) ` (Collect finite::nat set set)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   319
  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
   320
        (\<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
   321
  proof (safe intro!: exI[where x=A])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   322
    show "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   323
      unfolding A_def by (intro countable_image countable_Collect_finite)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   324
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   325
    assume "a \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   326
    then show "x \<in> a" "open a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   327
      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
   328
  next
52141
eff000cab70f weaker precendence of syntax for big intersection and union on sets
haftmann
parents: 51773
diff changeset
   329
    let ?int = "\<lambda>N. \<Inter>(from_nat_into A' ` N)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   330
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   331
    assume "a \<in> A" "b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   332
    then obtain N M where "a = ?int N" "b = ?int M" "finite (N \<union> M)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   333
      by (auto simp: A_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   334
    then show "a \<inter> b \<in> A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   335
      by (auto simp: A_def intro!: image_eqI[where x="N \<union> M"])
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   336
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   337
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   338
    assume "open S" "x \<in> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   339
    then obtain a where a: "a\<in>A'" "a \<subseteq> S" using A' by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   340
    then show "\<exists>a\<in>A. a \<subseteq> S" using a A'
51105
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   341
      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
   342
  qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   343
qed
a27fcd14c384 fine grained instantiations
immler
parents: 51103
diff changeset
   344
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   345
lemma (in topological_space) first_countableI:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   346
  assumes "countable A"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   347
    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
   348
    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
   349
  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
   350
proof (safe intro!: exI[of _ "from_nat_into A"])
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   351
  fix i
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   352
  have "A \<noteq> {}" using 2[of UNIV] by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   353
  show "x \<in> from_nat_into A i" "open (from_nat_into A i)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   354
    using range_from_nat_into_subset[OF \<open>A \<noteq> {}\<close>] 1 by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   355
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   356
  fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   357
  assume "open S" "x\<in>S" from 2[OF this]
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   358
  show "\<exists>i. from_nat_into A i \<subseteq> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   359
    using subset_range_from_nat_into[OF \<open>countable A\<close>] by auto
51473
1210309fddab move first_countable_topology to the HOL image
hoelzl
parents: 51472
diff changeset
   360
qed
51350
490f34774a9a eventually nhds represented using sequentially
hoelzl
parents: 51349
diff changeset
   361
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   362
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   363
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   364
  fix x :: "'a \<times> 'b"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   365
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   366
      "countable A"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   367
      "\<And>a. a \<in> A \<Longrightarrow> fst x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   368
      "\<And>a. a \<in> A \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   369
      "\<And>S. open S \<Longrightarrow> fst x \<in> S \<Longrightarrow> \<exists>a\<in>A. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   370
    by (rule first_countable_basisE[of "fst x"]) blast
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   371
  obtain B where B:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   372
      "countable B"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   373
      "\<And>a. a \<in> B \<Longrightarrow> snd x \<in> a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   374
      "\<And>a. a \<in> B \<Longrightarrow> open a"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   375
      "\<And>S. open S \<Longrightarrow> snd x \<in> S \<Longrightarrow> \<exists>a\<in>B. a \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   376
    by (rule first_countable_basisE[of "snd x"]) blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   377
  show "\<exists>A::nat \<Rightarrow> ('a \<times> 'b) set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   378
    (\<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
   379
  proof (rule first_countableI[of "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   380
    fix a b
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   381
    assume x: "a \<in> A" "b \<in> B"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   382
    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
   383
      unfolding mem_Times_iff
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   384
      by (auto intro: open_Times)
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   385
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   386
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   387
    assume "open S" "x \<in> S"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   388
    then obtain a' b' where a'b': "open a'" "open b'" "x \<in> a' \<times> b'" "a' \<times> b' \<subseteq> S"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   389
      by (rule open_prod_elim)
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   390
    moreover
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   391
    from a'b' A(4)[of a'] B(4)[of b']
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   392
    obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   393
      by auto
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   394
    ultimately
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   395
    show "\<exists>a\<in>(\<lambda>(a, b). a \<times> b) ` (A \<times> B). a \<subseteq> S"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   396
      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
   397
  qed (simp add: A B)
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   398
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   399
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   400
class second_countable_topology = topological_space +
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   401
  assumes ex_countable_subbasis:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   402
    "\<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
   403
begin
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   404
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   405
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
   406
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   407
  from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   408
    by blast
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   409
  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
   410
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   411
  show ?thesis
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   412
  proof (intro exI conjI)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   413
    show "countable ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   414
      by (intro countable_image countable_Collect_finite_subset B)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   415
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   416
      fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   417
      assume "open S"
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   418
      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
   419
        unfolding B
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   420
      proof induct
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   421
        case UNIV
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   422
        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
   423
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   424
        case (Int a b)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   425
        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
   426
          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
   427
          by blast
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   428
        show ?case
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   429
          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
   430
          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
   431
      next
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   432
        case (UN K)
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   433
        then have "\<forall>k\<in>K. \<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. UNION B' Inter = k" by auto
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   434
        then obtain k where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   435
            "\<forall>ka\<in>K. k ka \<subseteq> {b. finite b \<and> b \<subseteq> B} \<and> UNION (k ka) Inter = ka"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
   436
          unfolding bchoice_iff ..
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   437
        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
   438
          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
   439
      next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   440
        case (Basis S)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   441
        then show ?case
51343
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   442
          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
   443
      qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   444
      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
   445
        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
   446
    then show "topological_basis ?B"
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   447
      unfolding topological_space_class.topological_basis_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   448
      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
   449
         (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
   450
  qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   451
qed
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   452
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   453
end
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   454
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   455
sublocale second_countable_topology <
b61b32f62c78 use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents: 51342
diff changeset
   456
  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
   457
  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
   458
  by unfold_locales safe
50094
84ddcf5364b4 allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents: 50087
diff changeset
   459
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   460
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
   461
proof
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   462
  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
   463
    using ex_countable_basis by auto
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   464
  moreover
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   465
  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
   466
    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
   467
  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
   468
    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
   469
      topological_basis_imp_subbasis)
50882
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   470
qed
a382bf90867e move prod instantiation of second_countable_topology to its definition
hoelzl
parents: 50881
diff changeset
   471
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   472
instance second_countable_topology \<subseteq> first_countable_topology
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   473
proof
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   474
  fix x :: 'a
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   475
  define B :: "'a set set" where "B = (SOME B. countable B \<and> topological_basis B)"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   476
  then have B: "countable B" "topological_basis B"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   477
    using countable_basis is_basis
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   478
    by (auto simp: countable_basis is_basis)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   479
  then show "\<exists>A::nat \<Rightarrow> 'a set.
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   480
    (\<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
   481
    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
   482
       (fastforce simp: topological_space_class.topological_basis_def)+
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   483
qed
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
   484
64320
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   485
instance nat :: second_countable_topology
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   486
proof
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   487
  show "\<exists>B::nat set set. countable B \<and> open = generate_topology B"
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   488
    by (intro exI[of _ "range lessThan \<union> range greaterThan"]) (auto simp: open_nat_def)
ba194424b895 HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents: 64287
diff changeset
   489
qed
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   490
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   491
lemma countable_separating_set_linorder1:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   492
  shows "\<exists>B::('a::{linorder_topology, second_countable_topology} set). countable B \<and> (\<forall>x y. x < y \<longrightarrow> (\<exists>b \<in> B. x < b \<and> b \<le> y))"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   493
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   494
  obtain A::"'a set set" where "countable A" "topological_basis A" using ex_countable_basis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   495
  define B1 where "B1 = {(LEAST x. x \<in> U)| U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   496
  then have "countable B1" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   497
  define B2 where "B2 = {(SOME x. x \<in> U)| U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   498
  then have "countable B2" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   499
  have "\<exists>b \<in> B1 \<union> B2. x < b \<and> b \<le> y" if "x < y" for x y
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   500
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   501
    assume "\<exists>z. x < z \<and> z < y"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   502
    then obtain z where z: "x < z \<and> z < y" by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   503
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   504
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   505
    moreover have "z \<in> U" using z U_def by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   506
    ultimately obtain V where "V \<in> A" "z \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   507
    define w where "w = (SOME x. x \<in> V)"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   508
    then have "w \<in> V" using \<open>z \<in> V\<close> by (metis someI2)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   509
    then have "x < w \<and> w \<le> y" using \<open>w \<in> V\<close> \<open>V \<subseteq> U\<close> U_def by fastforce
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   510
    moreover have "w \<in> B1 \<union> B2" using w_def B2_def \<open>V \<in> A\<close> by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   511
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   512
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   513
    assume "\<not>(\<exists>z. x < z \<and> z < y)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   514
    then have *: "\<And>z. z > x \<Longrightarrow> z \<ge> y" by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   515
    define U where "U = {x<..}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   516
    then have "open U" by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   517
    moreover have "y \<in> U" using \<open>x < y\<close> U_def by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   518
    ultimately obtain "V" where "V \<in> A" "y \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   519
    have "U = {y..}" unfolding U_def using * \<open>x < y\<close> by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   520
    then have "V \<subseteq> {y..}" using \<open>V \<subseteq> U\<close> by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   521
    then have "(LEAST w. w \<in> V) = y" using \<open>y \<in> V\<close> by (meson Least_equality atLeast_iff subsetCE)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   522
    then have "y \<in> B1 \<union> B2" using \<open>V \<in> A\<close> B1_def by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   523
    moreover have "x < y \<and> y \<le> y" using \<open>x < y\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   524
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   525
  qed
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   526
  moreover have "countable (B1 \<union> B2)" using \<open>countable B1\<close> \<open>countable B2\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   527
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   528
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   529
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   530
lemma countable_separating_set_linorder2:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   531
  shows "\<exists>B::('a::{linorder_topology, second_countable_topology} set). countable B \<and> (\<forall>x y. x < y \<longrightarrow> (\<exists>b \<in> B. x \<le> b \<and> b < y))"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   532
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   533
  obtain A::"'a set set" where "countable A" "topological_basis A" using ex_countable_basis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   534
  define B1 where "B1 = {(GREATEST x. x \<in> U) | U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   535
  then have "countable B1" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   536
  define B2 where "B2 = {(SOME x. x \<in> U)| U. U \<in> A}"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   537
  then have "countable B2" using \<open>countable A\<close> by (simp add: Setcompr_eq_image)
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   538
  have "\<exists>b \<in> B1 \<union> B2. x \<le> b \<and> b < y" if "x < y" for x y
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   539
  proof (cases)
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   540
    assume "\<exists>z. x < z \<and> z < y"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   541
    then obtain z where z: "x < z \<and> z < y" by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   542
    define U where "U = {x<..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   543
    then have "open U" by simp
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   544
    moreover have "z \<in> U" using z U_def by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   545
    ultimately obtain "V" where "V \<in> A" "z \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   546
    define w where "w = (SOME x. x \<in> V)"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   547
    then have "w \<in> V" using \<open>z \<in> V\<close> by (metis someI2)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   548
    then have "x \<le> w \<and> w < y" using \<open>w \<in> V\<close> \<open>V \<subseteq> U\<close> U_def by fastforce
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   549
    moreover have "w \<in> B1 \<union> B2" using w_def B2_def \<open>V \<in> A\<close> by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   550
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   551
  next
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   552
    assume "\<not>(\<exists>z. x < z \<and> z < y)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   553
    then have *: "\<And>z. z < y \<Longrightarrow> z \<le> x" using leI by blast
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   554
    define U where "U = {..<y}"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   555
    then have "open U" by simp
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   556
    moreover have "x \<in> U" using \<open>x < y\<close> U_def by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   557
    ultimately obtain "V" where "V \<in> A" "x \<in> V" "V \<subseteq> U" using topological_basisE[OF \<open>topological_basis A\<close>] by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   558
    have "U = {..x}" unfolding U_def using * \<open>x < y\<close> by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   559
    then have "V \<subseteq> {..x}" using \<open>V \<subseteq> U\<close> by simp
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   560
    then have "(GREATEST x. x \<in> V) = x" using \<open>x \<in> V\<close> by (meson Greatest_equality atMost_iff subsetCE)
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   561
    then have "x \<in> B1 \<union> B2" using \<open>V \<in> A\<close> B1_def by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   562
    moreover have "x \<le> x \<and> x < y" using \<open>x < y\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   563
    ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   564
  qed
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   565
  moreover have "countable (B1 \<union> B2)" using \<open>countable B1\<close> \<open>countable B2\<close> by simp
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   566
  ultimately show ?thesis by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   567
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   568
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   569
lemma countable_separating_set_dense_linorder:
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   570
  shows "\<exists>B::('a::{linorder_topology, dense_linorder, second_countable_topology} set). countable B \<and> (\<forall>x y. x < y \<longrightarrow> (\<exists>b \<in> B. x < b \<and> b < y))"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   571
proof -
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   572
  obtain B::"'a set" where B: "countable B" "\<And>x y. x < y \<Longrightarrow> (\<exists>b \<in> B. x < b \<and> b \<le> y)"
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   573
    using countable_separating_set_linorder1 by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   574
  have "\<exists>b \<in> B. x < b \<and> b < y" if "x < y" for x y
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   575
  proof -
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   576
    obtain z where "x < z" "z < y" using \<open>x < y\<close> dense by blast
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   577
    then obtain b where "b \<in> B" "x < b \<and> b \<le> z" using B(2) by auto
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   578
    then have "x < b \<and> b < y" using \<open>z < y\<close> by auto
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   579
    then show ?thesis using \<open>b \<in> B\<close> by auto
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   580
  qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   581
  then show ?thesis using B(1) by auto
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   582
qed
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
   583
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   584
subsection \<open>Polish spaces\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   585
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   586
text \<open>Textbooks define Polish spaces as completely metrizable.
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   587
  We assume the topology to be complete for a given metric.\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   588
50881
ae630bab13da renamed countable_basis_space to second_countable_topology
hoelzl
parents: 50526
diff changeset
   589
class polish_space = complete_space + second_countable_topology
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
   590
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   591
subsection \<open>General notion of a topology as a value\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   592
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   593
definition "istopology L \<longleftrightarrow>
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   594
  L {} \<and> (\<forall>S T. L S \<longrightarrow> L T \<longrightarrow> L (S \<inter> T)) \<and> (\<forall>K. Ball K L \<longrightarrow> L (\<Union>K))"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   595
49834
b27bbb021df1 discontinued obsolete typedef (open) syntax;
wenzelm
parents: 49711
diff changeset
   596
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   597
  morphisms "openin" "topology"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   598
  unfolding istopology_def by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   599
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   600
lemma istopology_openin[intro]: "istopology(openin U)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   601
  using openin[of U] by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   602
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   603
lemma topology_inverse': "istopology U \<Longrightarrow> openin (topology U) = U"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   604
  using topology_inverse[unfolded mem_Collect_eq] .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   605
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   606
lemma topology_inverse_iff: "istopology U \<longleftrightarrow> openin (topology U) = U"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   607
  using topology_inverse[of U] istopology_openin[of "topology U"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   608
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   609
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   610
proof
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   611
  assume "T1 = T2"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   612
  then show "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   613
next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   614
  assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   615
  then have "openin T1 = openin T2" by (simp add: fun_eq_iff)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   616
  then have "topology (openin T1) = topology (openin T2)" by simp
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   617
  then show "T1 = T2" unfolding openin_inverse .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   618
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   619
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   620
text\<open>Infer the "universe" from union of all sets in the topology.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   621
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
   622
definition "topspace T = \<Union>{S. openin T S}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   623
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   624
subsubsection \<open>Main properties of open sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   625
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   626
lemma openin_clauses:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   627
  fixes U :: "'a topology"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   628
  shows
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   629
    "openin U {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   630
    "\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   631
    "\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   632
  using openin[of U] unfolding istopology_def mem_Collect_eq by fast+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   633
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   634
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   635
  unfolding topspace_def by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   636
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   637
lemma openin_empty[simp]: "openin U {}"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   638
  by (rule openin_clauses)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   639
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   640
lemma openin_Int[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<inter> T)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   641
  by (rule openin_clauses)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   642
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   643
lemma openin_Union[intro]: "(\<And>S. S \<in> K \<Longrightarrow> openin U S) \<Longrightarrow> openin U (\<Union>K)"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
   644
  using openin_clauses by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   645
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   646
lemma openin_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
   647
  using openin_Union[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   648
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   649
lemma openin_topspace[intro, simp]: "openin U (topspace U)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   650
  by (force simp add: openin_Union topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   651
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   652
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
   653
  (is "?lhs \<longleftrightarrow> ?rhs")
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   654
proof
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   655
  assume ?lhs
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   656
  then show ?rhs by auto
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   657
next
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   658
  assume H: ?rhs
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   659
  let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   660
  have "openin U ?t" by (force simp add: openin_Union)
36584
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   661
  also have "?t = S" using H by auto
1535841fc2e9 prove lemma openin_subopen without using choice
huffman
parents: 36442
diff changeset
   662
  finally show "openin U S" .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   663
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   664
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   665
lemma openin_INT [intro]:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   666
  assumes "finite I"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   667
          "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   668
  shows "openin T ((\<Inter>i \<in> I. U i) \<inter> topspace T)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   669
using assms by (induct, auto simp add: inf_sup_aci(2) openin_Int)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   670
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   671
lemma openin_INT2 [intro]:
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   672
  assumes "finite I" "I \<noteq> {}"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   673
          "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   674
  shows "openin T (\<Inter>i \<in> I. U i)"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   675
proof -
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   676
  have "(\<Inter>i \<in> I. U i) \<subseteq> topspace T"
64911
f0e07600de47 isabelle update_cartouches -c -t;
wenzelm
parents: 64910
diff changeset
   677
    using \<open>I \<noteq> {}\<close> openin_subset[OF assms(3)] by auto
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   678
  then show ?thesis
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   679
    using openin_INT[of _ _ U, OF assms(1) assms(3)] by (simp add: inf.absorb2 inf_commute)
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   680
qed
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
   681
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   682
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   683
subsubsection \<open>Closed sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   684
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   685
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
   686
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   687
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   688
  by (metis closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   689
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   690
lemma closedin_empty[simp]: "closedin U {}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   691
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   692
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   693
lemma closedin_topspace[intro, simp]: "closedin U (topspace U)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   694
  by (simp add: closedin_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   695
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   696
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
   697
  by (auto simp add: Diff_Un closedin_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   698
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   699
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union>{A - s|s. s\<in>S}"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   700
  by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   701
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   702
lemma closedin_Union:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   703
  assumes "finite S" "\<And>T. T \<in> S \<Longrightarrow> closedin U T"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   704
    shows "closedin U (\<Union>S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   705
  using assms by induction auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
   706
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   707
lemma closedin_Inter[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   708
  assumes Ke: "K \<noteq> {}"
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   709
    and Kc: "\<And>S. S \<in>K \<Longrightarrow> closedin U S"
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   710
  shows "closedin U (\<Inter>K)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   711
  using Ke Kc unfolding closedin_def Diff_Inter by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   712
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   713
lemma closedin_INT[intro]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   714
  assumes "A \<noteq> {}" "\<And>x. x \<in> A \<Longrightarrow> closedin U (B x)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   715
  shows "closedin U (\<Inter>x\<in>A. B x)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   716
  apply (rule closedin_Inter)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   717
  using assms
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   718
  apply auto
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   719
  done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
   720
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   721
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
   722
  using closedin_Inter[of "{S,T}" U] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   723
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   724
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
   725
  apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   726
  apply (metis openin_subset subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   727
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   728
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   729
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
   730
  by (simp add: openin_closedin_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   731
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   732
lemma openin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   733
  assumes oS: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   734
    and cT: "closedin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   735
  shows "openin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   736
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   737
  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
   738
    by (auto simp add: topspace_def openin_subset)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   739
  then show ?thesis using oS cT
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   740
    by (auto simp add: closedin_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   741
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   742
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   743
lemma closedin_diff[intro]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   744
  assumes oS: "closedin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   745
    and cT: "openin U T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   746
  shows "closedin U (S - T)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   747
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   748
  have "S - T = S \<inter> (topspace U - T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   749
    using closedin_subset[of U S] oS cT by (auto simp add: topspace_def)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   750
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   751
    using oS cT by (auto simp add: openin_closedin_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   752
qed
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   753
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   754
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   755
subsubsection \<open>Subspace topology\<close>
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   756
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   757
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
   758
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   759
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
   760
  (is "istopology ?L")
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   761
proof -
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   762
  have "?L {}" by blast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   763
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   764
    fix A B
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   765
    assume A: "?L A" and B: "?L B"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   766
    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
   767
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   768
    have "A \<inter> B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   769
      using Sa Sb by blast+
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   770
    then have "?L (A \<inter> B)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   771
  }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   772
  moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   773
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   774
    fix K
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   775
    assume K: "K \<subseteq> Collect ?L"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   776
    have th0: "Collect ?L = (\<lambda>S. S \<inter> V) ` Collect (openin U)"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   777
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   778
    from K[unfolded th0 subset_image_iff]
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   779
    obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   780
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   781
    have "\<Union>K = (\<Union>Sk) \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   782
      using Sk by auto
60585
48fdff264eb2 tuned whitespace;
wenzelm
parents: 60462
diff changeset
   783
    moreover have "openin U (\<Union>Sk)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   784
      using Sk by (auto simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   785
    ultimately have "?L (\<Union>K)" by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   786
  }
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   787
  ultimately show ?thesis
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
   788
    unfolding subset_eq mem_Collect_eq istopology_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   789
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   790
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   791
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
   792
  unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   793
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   794
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   795
lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \<inter> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   796
  by (auto simp add: topspace_def openin_subtopology)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   797
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   798
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
   799
  unfolding closedin_def topspace_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   800
  by (auto simp add: openin_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   801
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   802
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   803
  unfolding openin_subtopology
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   804
  by auto (metis IntD1 in_mono openin_subset)
49711
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   805
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   806
lemma subtopology_superset:
e5aaae7eadc9 tuned proofs;
wenzelm
parents: 48125
diff changeset
   807
  assumes UV: "topspace U \<subseteq> V"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   808
  shows "subtopology U V = U"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   809
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   810
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   811
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   812
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   813
      fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   814
      assume T: "openin U T" "S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   815
      from T openin_subset[OF T(1)] UV have eq: "S = T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   816
        by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   817
      have "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   818
        unfolding eq using T by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   819
    }
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   820
    moreover
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   821
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   822
      assume S: "openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   823
      then have "\<exists>T. openin U T \<and> S = T \<inter> V"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   824
        using openin_subset[OF S] UV by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   825
    }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   826
    ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   827
      by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   828
  }
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   829
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   830
    unfolding topology_eq openin_subtopology by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   831
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   832
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   833
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   834
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   835
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   836
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   837
  by (simp add: subtopology_superset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   838
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   839
lemma openin_subtopology_empty:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   840
   "openin (subtopology U {}) S \<longleftrightarrow> S = {}"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   841
by (metis Int_empty_right openin_empty openin_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   842
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   843
lemma closedin_subtopology_empty:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   844
   "closedin (subtopology U {}) S \<longleftrightarrow> S = {}"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   845
by (metis Int_empty_right closedin_empty closedin_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   846
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   847
lemma closedin_subtopology_refl [simp]:
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   848
   "closedin (subtopology U X) X \<longleftrightarrow> X \<subseteq> topspace U"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   849
by (metis closedin_def closedin_topspace inf.absorb_iff2 le_inf_iff topspace_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   850
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   851
lemma openin_imp_subset:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   852
   "openin (subtopology U S) T \<Longrightarrow> T \<subseteq> S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   853
by (metis Int_iff openin_subtopology subsetI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   854
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   855
lemma closedin_imp_subset:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   856
   "closedin (subtopology U S) T \<Longrightarrow> T \<subseteq> S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   857
by (simp add: closedin_def topspace_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   858
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   859
lemma openin_subtopology_Un:
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   860
    "openin (subtopology U T) S \<and> openin (subtopology U u) S
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
   861
     \<Longrightarrow> openin (subtopology U (T \<union> u)) S"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   862
by (simp add: openin_subtopology) blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   863
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   864
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   865
subsubsection \<open>The standard Euclidean topology\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   866
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   867
definition euclidean :: "'a::topological_space topology"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   868
  where "euclidean = topology open"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   869
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   870
lemma open_openin: "open S \<longleftrightarrow> openin euclidean S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   871
  unfolding euclidean_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   872
  apply (rule cong[where x=S and y=S])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   873
  apply (rule topology_inverse[symmetric])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   874
  apply (auto simp add: istopology_def)
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
   875
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   876
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   877
declare open_openin [symmetric, simp]
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   878
63492
a662e8139804 More advanced theorems about retracts, homotopies., etc
paulson <lp15@cam.ac.uk>
parents: 63469
diff changeset
   879
lemma topspace_euclidean [simp]: "topspace euclidean = UNIV"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   880
  by (force simp add: topspace_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   881
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   882
lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   883
  by (simp add: topspace_subtopology)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   884
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   885
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   886
  by (simp add: closed_def closedin_def Compl_eq_Diff_UNIV)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   887
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   888
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   889
  using openI by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
   890
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   891
lemma openin_subtopology_self [simp]: "openin (subtopology euclidean S) S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   892
  by (metis openin_topspace topspace_euclidean_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
   893
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
   894
text \<open>Basic "localization" results are handy for connectedness.\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   895
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   896
lemma openin_open: "openin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. open T \<and> (S = U \<inter> T))"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
   897
  by (auto simp add: openin_subtopology)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   898
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   899
lemma openin_Int_open:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   900
   "\<lbrakk>openin (subtopology euclidean U) S; open T\<rbrakk>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   901
        \<Longrightarrow> openin (subtopology euclidean U) (S \<inter> T)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   902
by (metis open_Int Int_assoc openin_open)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   903
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   904
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
   905
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   906
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   907
lemma open_openin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   908
  "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
   909
  by (metis Int_absorb1  openin_open_Int)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   910
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   911
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
   912
  by (auto simp add: openin_open)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   913
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   914
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
   915
  by (simp add: closedin_subtopology closed_closedin Int_ac)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   916
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
   917
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
   918
  by (metis closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   919
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   920
lemma 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
   921
  by (auto simp add: closedin_closed)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   922
64791
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   923
lemma closedin_closed_subset:
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   924
 "\<lbrakk>closedin (subtopology euclidean U) V; T \<subseteq> U; S = V \<inter> T\<rbrakk>
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   925
             \<Longrightarrow> closedin (subtopology euclidean T) S"
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   926
  by (metis (no_types, lifting) Int_assoc Int_commute closedin_closed inf.orderE)
05a2b3b20664 facts about ANRs, ENRs, covering spaces
paulson <lp15@cam.ac.uk>
parents: 64788
diff changeset
   927
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   928
lemma finite_imp_closedin:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   929
  fixes S :: "'a::t1_space set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   930
  shows "\<lbrakk>finite S; S \<subseteq> T\<rbrakk> \<Longrightarrow> closedin (subtopology euclidean T) S"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   931
    by (simp add: finite_imp_closed closed_subset)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
   932
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   933
lemma closedin_singleton [simp]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   934
  fixes a :: "'a::t1_space"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   935
  shows "closedin (subtopology euclidean U) {a} \<longleftrightarrow> a \<in> U"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   936
using closedin_subset  by (force intro: closed_subset)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
   937
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   938
lemma openin_euclidean_subtopology_iff:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   939
  fixes S U :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   940
  shows "openin (subtopology euclidean U) S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   941
    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
   942
  (is "?lhs \<longleftrightarrow> ?rhs")
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   943
proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
   944
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   945
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   946
    unfolding openin_open open_dist by blast
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   947
next
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
   948
  define T where "T = {x. \<exists>a\<in>S. \<exists>d>0. (\<forall>y\<in>U. dist y a < d \<longrightarrow> y \<in> S) \<and> dist x a < d}"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   949
  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
   950
    unfolding T_def
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   951
    apply clarsimp
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   952
    apply (rule_tac x="d - dist x a" in exI)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   953
    apply (clarsimp simp add: less_diff_eq)
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   954
    by (metis dist_commute dist_triangle_lt)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
   955
  assume ?rhs then have 2: "S = U \<inter> T"
60141
833adf7db7d8 New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents: 60040
diff changeset
   956
    unfolding T_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
   957
    by auto (metis dist_self)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   958
  from 1 2 show ?lhs
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   959
    unfolding openin_open open_dist by fast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
   960
qed
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
   961
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   962
lemma connected_openin:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   963
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   964
       ~(\<exists>e1 e2. openin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   965
                 openin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   966
                 s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   967
  apply (simp add: connected_def openin_open, safe)
63988
wenzelm
parents: 63967
diff changeset
   968
  apply (simp_all, blast+)  (* SLOW *)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   969
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   970
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   971
lemma connected_openin_eq:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   972
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   973
       ~(\<exists>e1 e2. openin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   974
                 openin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   975
                 e1 \<union> e2 = s \<and> e1 \<inter> e2 = {} \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   976
                 e1 \<noteq> {} \<and> e2 \<noteq> {})"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   977
  apply (simp add: connected_openin, safe)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   978
  apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   979
  by (metis Int_lower1 Un_subset_iff openin_open subset_antisym)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   980
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
   981
lemma connected_closedin:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   982
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   983
       ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   984
             closedin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   985
             closedin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   986
             s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   987
             e1 \<noteq> {} \<and> e2 \<noteq> {})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   988
proof -
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   989
  { fix A B x x'
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   990
    assume s_sub: "s \<subseteq> A \<union> B"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   991
       and disj: "A \<inter> B \<inter> s = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   992
       and x: "x \<in> s" "x \<in> B" and x': "x' \<in> s" "x' \<in> A"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   993
       and cl: "closed A" "closed B"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   994
    assume "\<forall>e1. (\<forall>T. closed T \<longrightarrow> e1 \<noteq> s \<inter> T) \<or> (\<forall>e2. e1 \<inter> e2 = {} \<longrightarrow> s \<subseteq> e1 \<union> e2 \<longrightarrow> (\<forall>T. closed T \<longrightarrow> e2 \<noteq> s \<inter> T) \<or> e1 = {} \<or> e2 = {})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   995
    then have "\<And>C D. s \<inter> C = {} \<or> s \<inter> D = {} \<or> s \<inter> (C \<inter> (s \<inter> D)) \<noteq> {} \<or> \<not> s \<subseteq> s \<inter> (C \<union> D) \<or> \<not> closed C \<or> \<not> closed D"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   996
      by (metis (no_types) Int_Un_distrib Int_assoc)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   997
    moreover have "s \<inter> (A \<inter> B) = {}" "s \<inter> (A \<union> B) = s" "s \<inter> B \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   998
      using disj s_sub x by blast+
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
   999
    ultimately have "s \<inter> A = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1000
      using cl by (metis inf.left_commute inf_bot_right order_refl)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1001
    then have False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1002
      using x' by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1003
  } note * = this
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1004
  show ?thesis
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1005
    apply (simp add: connected_closed closedin_closed)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1006
    apply (safe; simp)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1007
    apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1008
    apply (blast intro: *)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1009
    done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1010
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1011
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1012
lemma connected_closedin_eq:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1013
      "connected s \<longleftrightarrow>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1014
           ~(\<exists>e1 e2.
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1015
                 closedin (subtopology euclidean s) e1 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1016
                 closedin (subtopology euclidean s) e2 \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1017
                 e1 \<union> e2 = s \<and> e1 \<inter> e2 = {} \<and>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1018
                 e1 \<noteq> {} \<and> e2 \<noteq> {})"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1019
  apply (simp add: connected_closedin, safe)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1020
  apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  1021
  by (metis Int_lower1 Un_subset_iff closedin_closed subset_antisym)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1022
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1023
text \<open>These "transitivity" results are handy too\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1024
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1025
lemma openin_trans[trans]:
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1026
  "openin (subtopology euclidean T) S \<Longrightarrow> openin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1027
    openin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1028
  unfolding open_openin openin_open by blast
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1029
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1030
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
  1031
  by (auto simp add: openin_open intro: openin_trans)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1032
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1033
lemma closedin_trans[trans]:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1034
  "closedin (subtopology euclidean T) S \<Longrightarrow> closedin (subtopology euclidean U) T \<Longrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1035
    closedin (subtopology euclidean U) S"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1036
  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
  1037
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1038
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
  1039
  by (auto simp add: closedin_closed intro: closedin_trans)
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1040
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1041
lemma openin_subtopology_Int_subset:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1042
   "\<lbrakk>openin (subtopology euclidean u) (u \<inter> S); v \<subseteq> u\<rbrakk> \<Longrightarrow> openin (subtopology euclidean v) (v \<inter> S)"
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1043
  by (auto simp: openin_subtopology)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1044
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1045
lemma openin_open_eq: "open s \<Longrightarrow> (openin (subtopology euclidean s) t \<longleftrightarrow> open t \<and> t \<subseteq> s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1046
  using open_subset openin_open_trans openin_subset by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1047
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1048
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1049
subsection \<open>Open and closed balls\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1050
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1051
definition ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1052
  where "ball x e = {y. dist x y < e}"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1053
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1054
definition cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1055
  where "cball x e = {y. dist x y \<le> e}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1056
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1057
definition sphere :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1058
  where "sphere x e = {y. dist x y = e}"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1059
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
  1060
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
  1061
  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
  1062
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
  1063
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
  1064
  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
  1065
61848
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1066
lemma mem_sphere [simp]: "y \<in> sphere x e \<longleftrightarrow> dist x y = e"
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1067
  by (simp add: sphere_def)
9250e546ab23 New complex analysis material
paulson <lp15@cam.ac.uk>
parents: 61824
diff changeset
  1068
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1069
lemma ball_trivial [simp]: "ball x 0 = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1070
  by (simp add: ball_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1071
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1072
lemma cball_trivial [simp]: "cball x 0 = {x}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1073
  by (simp add: cball_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1074
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1075
lemma sphere_trivial [simp]: "sphere x 0 = {x}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1076
  by (simp add: sphere_def)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  1077
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1078
lemma mem_ball_0 [simp]: "x \<in> ball 0 e \<longleftrightarrow> norm x < e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1079
  for x :: "'a::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1080
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1081
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1082
lemma mem_cball_0 [simp]: "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1083
  for x :: "'a::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1084
  by (simp add: dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1085
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1086
lemma disjoint_ballI: "dist x y \<ge> r+s \<Longrightarrow> ball x r \<inter> ball y s = {}"
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1087
  using dist_triangle_less_add not_le by fastforce
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1088
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1089
lemma disjoint_cballI: "dist x y > r + s \<Longrightarrow> cball x r \<inter> cball y s = {}"
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1090
  by (metis add_mono disjoint_iff_not_equal dist_triangle2 dual_order.trans leD mem_cball)
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  1091
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1092
lemma mem_sphere_0 [simp]: "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1093
  for x :: "'a::real_normed_vector"
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1094
  by (simp add: dist_norm)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1095
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1096
lemma sphere_empty [simp]: "r < 0 \<Longrightarrow> sphere a r = {}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1097
  for a :: "'a::metric_space"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1098
  by auto
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1099
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1100
lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1101
  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
  1102
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1103
lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
45776
714100f5fda4 remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents: 45548
diff changeset
  1104
  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
  1105
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1106
lemma ball_subset_cball [simp, intro]: "ball x e \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1107
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1108
61907
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1109
lemma sphere_cball [simp,intro]: "sphere z r \<subseteq> cball z r"
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1110
  by force
f0c894ab18c9 Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents: 61880
diff changeset
  1111
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1112
lemma cball_diff_sphere: "cball a r - sphere a r = ball a r"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1113
  by auto
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1114
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1115
lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1116
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1117
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1118
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1119
  by (simp add: subset_eq)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1120
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1121
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
  1122
  by (simp add: set_eq_iff) arith
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1123
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1124
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
  1125
  by (simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1126
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1127
lemma cball_max_Un: "cball a (max r s) = cball a r \<union> cball a s"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1128
  by (simp add: set_eq_iff) arith
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1129
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1130
lemma cball_min_Int: "cball a (min r s) = cball a r \<inter> cball a s"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1131
  by (simp add: set_eq_iff)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  1132
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  1133
lemma cball_diff_eq_sphere: "cball a r - ball a r =  sphere a r"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1134
  by (auto simp: cball_def ball_def dist_commute)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  1135
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1136
lemma image_add_ball [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1137
  fixes a :: "'a::real_normed_vector"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1138
  shows "op + b ` ball a r = ball (a+b) r"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1139
apply (intro equalityI subsetI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1140
apply (force simp: dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1141
apply (rule_tac x="x-b" in image_eqI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1142
apply (auto simp: dist_norm algebra_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1143
done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1144
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1145
lemma image_add_cball [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1146
  fixes a :: "'a::real_normed_vector"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1147
  shows "op + b ` cball a r = cball (a+b) r"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1148
apply (intro equalityI subsetI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1149
apply (force simp: dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1150
apply (rule_tac x="x-b" in image_eqI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1151
apply (auto simp: dist_norm algebra_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1152
done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  1153
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1154
lemma open_ball [intro, simp]: "open (ball x e)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1155
proof -
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1156
  have "open (dist x -` {..<e})"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  1157
    by (intro open_vimage open_lessThan continuous_intros)
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1158
  also have "dist x -` {..<e} = ball x e"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1159
    by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1160
  finally show ?thesis .
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  1161
qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1162
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1163
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)"
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  1164
  by (simp add: open_dist subset_eq mem_ball Ball_def dist_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1165
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1166
lemma openI [intro?]: "(\<And>x. x\<in>S \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> S) \<Longrightarrow> open S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1167
  by (auto simp: open_contains_ball)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1168
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1169
lemma openE[elim?]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1170
  assumes "open S" "x\<in>S"
33714
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1171
  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
  1172
  using assms unfolding open_contains_ball by auto
eb2574ac4173 Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents: 33324
diff changeset
  1173
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  1174
lemma open_contains_ball_eq: "open S \<Longrightarrow> x\<in>S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1175
  by (metis open_contains_ball subset_eq centre_in_ball)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1176
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1177
lemma openin_contains_ball:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1178
    "openin (subtopology euclidean t) s \<longleftrightarrow>
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1179
     s \<subseteq> t \<and> (\<forall>x \<in> s. \<exists>e. 0 < e \<and> ball x e \<inter> t \<subseteq> s)"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1180
    (is "?lhs = ?rhs")
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1181
proof
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1182
  assume ?lhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1183
  then show ?rhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1184
    apply (simp add: openin_open)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1185
    apply (metis Int_commute Int_mono inf.cobounded2 open_contains_ball order_refl subsetCE)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1186
    done
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1187
next
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1188
  assume ?rhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1189
  then show ?lhs
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1190
    apply (simp add: openin_euclidean_subtopology_iff)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1191
    by (metis (no_types) Int_iff dist_commute inf.absorb_iff2 mem_ball)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1192
qed
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1193
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1194
lemma openin_contains_cball:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1195
   "openin (subtopology euclidean t) s \<longleftrightarrow>
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1196
        s \<subseteq> t \<and>
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1197
        (\<forall>x \<in> s. \<exists>e. 0 < e \<and> cball x e \<inter> t \<subseteq> s)"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1198
apply (simp add: openin_contains_ball)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1199
apply (rule iffI)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1200
apply (auto dest!: bspec)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1201
apply (rule_tac x="e/2" in exI)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1202
apply force+
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  1203
done
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  1204
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1205
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
  1206
  unfolding mem_ball set_eq_iff
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1207
  apply (simp add: not_less)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1208
  apply (metis zero_le_dist order_trans dist_self)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1209
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1210
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  1211
lemma ball_empty: "e \<le> 0 \<Longrightarrow> ball x e = {}" by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1212
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
  1213
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
  1214
  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
  1215
  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
  1216
  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
  1217
  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
  1218
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1219
lemma eventually_nhds_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>x. x \<in> ball z d) (nhds z)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1220
  by (rule eventually_nhds_in_open) simp_all
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1221
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1222
lemma eventually_at_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<in> A) (at z within A)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1223
  unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1224
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1225
lemma eventually_at_ball': "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<noteq> z \<and> t \<in> A) (at z within A)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1226
  unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  1227
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1228
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1229
subsection \<open>Boxes\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1230
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1231
abbreviation One :: "'a::euclidean_space"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1232
  where "One \<equiv> \<Sum>Basis"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1233
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1234
lemma One_non_0: assumes "One = (0::'a::euclidean_space)" shows False
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1235
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1236
  have "dependent (Basis :: 'a set)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1237
    apply (simp add: dependent_finite)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1238
    apply (rule_tac x="\<lambda>i. 1" in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1239
    using SOME_Basis apply (auto simp: assms)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1240
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1241
  with independent_Basis show False by force
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1242
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1243
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1244
corollary One_neq_0[iff]: "One \<noteq> 0"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1245
  by (metis One_non_0)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1246
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1247
corollary Zero_neq_One[iff]: "0 \<noteq> One"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1248
  by (metis One_non_0)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  1249
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1250
definition (in euclidean_space) eucl_less (infix "<e" 50)
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1251
  where "eucl_less a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i)"
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1252
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1253
definition box_eucl_less: "box a b = {x. a <e x \<and> x <e b}"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1254
definition "cbox a b = {x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i}"
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1255
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1256
lemma box_def: "box a b = {x. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i}"
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
  1257
  and in_box_eucl_less: "x \<in> box a b \<longleftrightarrow> a <e x \<and> x <e b"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1258
  and mem_box: "x \<in> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i)"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1259
    "x \<in> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i)"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1260
  by (auto simp: box_eucl_less eucl_less_def cbox_def)
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1261
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1262
lemma cbox_Pair_eq: "cbox (a, c) (b, d) = cbox a b \<times> cbox c d"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1263
  by (force simp: cbox_def Basis_prod_def)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1264
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1265
lemma cbox_Pair_iff [iff]: "(x, y) \<in> cbox (a, c) (b, d) \<longleftrightarrow> x \<in> cbox a b \<and> y \<in> cbox c d"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1266
  by (force simp: cbox_Pair_eq)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1267
65587
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1268
lemma cbox_Complex_eq: "cbox (Complex a c) (Complex b d) = (\<lambda>(x,y). Complex x y) ` (cbox a b \<times> cbox c d)"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1269
  apply (auto simp: cbox_def Basis_complex_def)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1270
  apply (rule_tac x = "(Re x, Im x)" in image_eqI)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1271
  using complex_eq by auto
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  1272
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1273
lemma cbox_Pair_eq_0: "cbox (a, c) (b, d) = {} \<longleftrightarrow> cbox a b = {} \<or> cbox c d = {}"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1274
  by (force simp: cbox_Pair_eq)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1275
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1276
lemma swap_cbox_Pair [simp]: "prod.swap ` cbox (c, a) (d, b) = cbox (a,c) (b,d)"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1277
  by auto
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  1278
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1279
lemma mem_box_real[simp]:
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1280
  "(x::real) \<in> box a b \<longleftrightarrow> a < x \<and> x < b"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1281
  "(x::real) \<in> cbox a b \<longleftrightarrow> a \<le> x \<and> x \<le> b"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1282
  by (auto simp: mem_box)
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1283
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1284
lemma box_real[simp]:
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1285
  fixes a b:: real
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1286
  shows "box a b = {a <..< b}" "cbox a b = {a .. b}"
0268784f60da use cbox to relax class constraints
immler
parents: 56166
diff changeset
  1287
  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
  1288
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1289
lemma box_Int_box:
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1290
  fixes a :: "'a::euclidean_space"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1291
  shows "box a b \<inter> box c d =
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1292
    box (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1293
  unfolding set_eq_iff and Int_iff and mem_box by auto
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1294
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1295
lemma rational_boxes:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  1296
  fixes x :: "'a::euclidean_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  1297
  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
  1298
  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
  1299
proof -
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  1300
  define e' where "e' = e / (2 * sqrt (real (DIM ('a))))"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  1301
  then have e: "e' > 0"
56541
0e3abadbef39 made divide_pos_pos a simp rule
nipkow
parents: 56371
diff changeset
  1302
    using assms by (auto simp: DIM_positive)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1303
  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
  1304
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1305
    fix i
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1306
    from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1307
    show "?th i" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1308
  qed
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1309
  from choice[OF this] obtain a where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1310
    a: "\<forall>xa. a xa \<in> \<rat> \<and> a xa < x \<bullet> xa \<and> x \<bullet> xa - a xa < e'" ..
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1311
  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
  1312
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1313
    fix i
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1314
    from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1315
    show "?th i" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1316
  qed
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1317
  from choice[OF this] obtain b where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  1318
    b: "\<forall>xa. b xa \<in> \<rat> \<and> x \<bullet> xa < b xa \<and> b xa - x \<bullet> xa < e'" ..
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  1319
  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
  1320
  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
  1321
  proof (rule exI[of _ ?a], rule exI[of _ ?b], safe)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1322
    fix y :: 'a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1323
    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
  1324
    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
  1325
      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
  1326
    also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  1327
    proof (rule real_sqrt_less_mono, rule sum_strict_mono)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1328
      fix i :: "'a"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1329
      assume i: "i \<in> Basis"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1330
      have "a i < y\<bullet>i \<and> y\<bullet>i < b i"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1331
        using * i by (auto simp: box_def)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1332
      moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1333
        using a by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1334
      moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1335
        using b by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1336
      ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1337
        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
  1338
      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
  1339
        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
  1340
      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
  1341
        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
  1342
      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
  1343
        by (simp add: power_divide)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  1344
    qed auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1345
    also have "\<dots> = e"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1346
      using \<open>0 < e\<close> by simp
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1347
    finally show "y \<in> ball x e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1348
      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
  1349
  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
  1350
qed
51103
5dd7b89a16de generalized
immler
parents: 51102
diff changeset
  1351
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
  1352
lemma open_UNION_box:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  1353
  fixes M :: "'a::euclidean_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1354
  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
  1355
  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
  1356
  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
  1357
  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
  1358
  shows "M = (\<Union>f\<in>I. box (a' f) (b' f))"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1359
proof -
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1360
  have "x \<in> (\<Union>f\<in>I. box (a' f) (b' f))" if "x \<in> M" for x
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1361
  proof -
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1362
    obtain e where e: "e > 0" "ball x e \<subseteq> M"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1363
      using openE[OF \<open>open M\<close> \<open>x \<in> M\<close>] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1364
    moreover obtain a b where ab:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1365
      "x \<in> box a b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1366
      "\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1367
      "\<forall>i\<in>Basis. b \<bullet> i \<in> \<rat>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1368
      "box a b \<subseteq> ball x e"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1369
      using rational_boxes[OF e(1)] by metis
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1370
    ultimately show ?thesis
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1371
       by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<bullet> i)"])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1372
          (auto simp: euclidean_representation I_def a'_def b'_def)
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1373
  qed
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1374
  then show ?thesis by (auto simp: I_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1375
qed
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1376
66154
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1377
corollary open_countable_Union_open_box:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1378
  fixes S :: "'a :: euclidean_space set"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1379
  assumes "open S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1380
  obtains \<D> where "countable \<D>" "\<D> \<subseteq> Pow S" "\<And>X. X \<in> \<D> \<Longrightarrow> \<exists>a b. X = box a b" "\<Union>\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1381
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1382
  let ?a = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1383
  let ?b = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1384
  let ?I = "{f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. box (?a f) (?b f) \<subseteq> S}"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1385
  let ?\<D> = "(\<lambda>f. box (?a f) (?b f)) ` ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1386
  show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1387
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1388
    have "countable ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1389
      by (simp add: countable_PiE countable_rat)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1390
    then show "countable ?\<D>"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1391
      by blast
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1392
    show "\<Union>?\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1393
      using open_UNION_box [OF assms] by metis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1394
  qed auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1395
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1396
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1397
lemma rational_cboxes:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1398
  fixes x :: "'a::euclidean_space"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1399
  assumes "e > 0"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1400
  shows "\<exists>a b. (\<forall>i\<in>Basis. a \<bullet> i \<in> \<rat> \<and> b \<bullet> i \<in> \<rat>) \<and> x \<in> cbox a b \<and> cbox a b \<subseteq> ball x e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1401
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1402
  define e' where "e' = e / (2 * sqrt (real (DIM ('a))))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1403
  then have e: "e' > 0"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1404
    using assms by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1405
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x \<bullet> i \<and> x \<bullet> i - y < e'" (is "\<forall>i. ?th i")
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1406
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1407
    fix i
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1408
    from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1409
    show "?th i" by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1410
  qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1411
  from choice[OF this] obtain a where
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1412
    a: "\<forall>u. a u \<in> \<rat> \<and> a u < x \<bullet> u \<and> x \<bullet> u - a u < e'" ..
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1413
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x \<bullet> i < y \<and> y - x \<bullet> i < e'" (is "\<forall>i. ?th i")
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1414
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1415
    fix i
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1416
    from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1417
    show "?th i" by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1418
  qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1419
  from choice[OF this] obtain b where
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1420
    b: "\<forall>u. b u \<in> \<rat> \<and> x \<bullet> u < b u \<and> b u - x \<bullet> u < e'" ..
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1421
  let ?a = "\<Sum>i\<in>Basis. a i *\<^sub>R i" and ?b = "\<Sum>i\<in>Basis. b i *\<^sub>R i"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1422
  show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1423
  proof (rule exI[of _ ?a], rule exI[of _ ?b], safe)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1424
    fix y :: 'a
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1425
    assume *: "y \<in> cbox ?a ?b"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1426
    have "dist x y = sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1427
      unfolding setL2_def[symmetric] by (rule euclidean_dist_l2)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1428
    also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1429
    proof (rule real_sqrt_less_mono, rule sum_strict_mono)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1430
      fix i :: "'a"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1431
      assume i: "i \<in> Basis"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1432
      have "a i \<le> y\<bullet>i \<and> y\<bullet>i \<le> b i"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1433
        using * i by (auto simp: cbox_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1434
      moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1435
        using a by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1436
      moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1437
        using b by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1438
      ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1439
        by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1440
      then have "dist (x \<bullet> i) (y \<bullet> i) < e/sqrt (real (DIM('a)))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1441
        unfolding e'_def by (auto simp: dist_real_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1442
      then have "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < (e/sqrt (real (DIM('a))))\<^sup>2"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1443
        by (rule power_strict_mono) auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1444
      then show "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < e\<^sup>2 / real DIM('a)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1445
        by (simp add: power_divide)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1446
    qed auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1447
    also have "\<dots> = e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1448
      using \<open>0 < e\<close> by simp
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1449
    finally show "y \<in> ball x e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1450
      by (auto simp: ball_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1451
  next
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1452
    show "x \<in> cbox (\<Sum>i\<in>Basis. a i *\<^sub>R i) (\<Sum>i\<in>Basis. b i *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1453
      using a b less_imp_le by (auto simp: cbox_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1454
  qed (use a b cbox_def in auto)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1455
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1456
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1457
lemma open_UNION_cbox:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1458
  fixes M :: "'a::euclidean_space set"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1459
  assumes "open M"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1460
  defines "a' \<equiv> \<lambda>f. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1461
  defines "b' \<equiv> \<lambda>f. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1462
  defines "I \<equiv> {f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. cbox (a' f) (b' f) \<subseteq> M}"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1463
  shows "M = (\<Union>f\<in>I. cbox (a' f) (b' f))"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1464
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1465
  have "x \<in> (\<Union>f\<in>I. cbox (a' f) (b' f))" if "x \<in> M" for x
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1466
  proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1467
    obtain e where e: "e > 0" "ball x e \<subseteq> M"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1468
      using openE[OF \<open>open M\<close> \<open>x \<in> M\<close>] by auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1469
    moreover obtain a b where ab: "x \<in> cbox a b" "\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1470
                                  "\<forall>i \<in> Basis. b \<bullet> i \<in> \<rat>" "cbox a b \<subseteq> ball x e"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1471
      using rational_cboxes[OF e(1)] by metis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1472
    ultimately show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1473
       by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<bullet> i)"])
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1474
          (auto simp: euclidean_representation I_def a'_def b'_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1475
  qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1476
  then show ?thesis by (auto simp: I_def)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1477
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1478
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1479
corollary open_countable_Union_open_cbox:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1480
  fixes S :: "'a :: euclidean_space set"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1481
  assumes "open S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1482
  obtains \<D> where "countable \<D>" "\<D> \<subseteq> Pow S" "\<And>X. X \<in> \<D> \<Longrightarrow> \<exists>a b. X = cbox a b" "\<Union>\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1483
proof -
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1484
  let ?a = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1485
  let ?b = "\<lambda>f. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1486
  let ?I = "{f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. cbox (?a f) (?b f) \<subseteq> S}"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1487
  let ?\<D> = "(\<lambda>f. cbox (?a f) (?b f)) ` ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1488
  show ?thesis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1489
  proof
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1490
    have "countable ?I"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1491
      by (simp add: countable_PiE countable_rat)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1492
    then show "countable ?\<D>"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1493
      by blast
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1494
    show "\<Union>?\<D> = S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1495
      using open_UNION_cbox [OF assms] by metis
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1496
  qed auto
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1497
qed
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  1498
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1499
lemma box_eq_empty:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1500
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1501
  shows "(box a b = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i \<le> a\<bullet>i))" (is ?th1)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1502
    and "(cbox a b = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i < a\<bullet>i))" (is ?th2)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1503
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1504
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1505
    fix i x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1506
    assume i: "i\<in>Basis" and as:"b\<bullet>i \<le> a\<bullet>i" and x:"x\<in>box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1507
    then have "a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1508
      unfolding mem_box by (auto simp: box_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1509
    then have "a\<bullet>i < b\<bullet>i" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1510
    then have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1511
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1512
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1513
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1514
    assume as: "\<forall>i\<in>Basis. \<not> (b\<bullet>i \<le> a\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1515
    let ?x = "(1/2) *\<^sub>R (a + b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1516
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1517
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1518
      assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1519
      have "a\<bullet>i < b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1520
        using as[THEN bspec[where x=i]] i by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1521
      then have "a\<bullet>i < ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i < b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1522
        by (auto simp: inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1523
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1524
    then have "box a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1525
      using mem_box(1)[of "?x" a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1526
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1527
  ultimately show ?th1 by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1528
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1529
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1530
    fix i x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1531
    assume i: "i \<in> Basis" and as:"b\<bullet>i < a\<bullet>i" and x:"x\<in>cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1532
    then have "a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1533
      unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1534
    then have "a\<bullet>i \<le> b\<bullet>i" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1535
    then have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1536
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1537
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1538
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1539
    assume as:"\<forall>i\<in>Basis. \<not> (b\<bullet>i < a\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1540
    let ?x = "(1/2) *\<^sub>R (a + b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1541
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1542
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1543
      assume i:"i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1544
      have "a\<bullet>i \<le> b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1545
        using as[THEN bspec[where x=i]] i by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1546
      then have "a\<bullet>i \<le> ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i \<le> b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1547
        by (auto simp: inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1548
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1549
    then have "cbox a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1550
      using mem_box(2)[of "?x" a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1551
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1552
  ultimately show ?th2 by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1553
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1554
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1555
lemma box_ne_empty:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1556
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1557
  shows "cbox a b \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1558
  and "box a b \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1559
  unfolding box_eq_empty[of a b] by fastforce+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1560
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1561
lemma
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1562
  fixes a :: "'a::euclidean_space"
66112
0e640e04fc56 New theorems; stronger theorems; tidier theorems. Also some renaming
paulson <lp15@cam.ac.uk>
parents: 66089
diff changeset
  1563
  shows cbox_sing [simp]: "cbox a a = {a}"
0e640e04fc56 New theorems; stronger theorems; tidier theorems. Also some renaming
paulson <lp15@cam.ac.uk>
parents: 66089
diff changeset
  1564
    and box_sing [simp]: "box a a = {}"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1565
  unfolding set_eq_iff mem_box eq_iff [symmetric]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1566
  by (auto intro!: euclidean_eqI[where 'a='a])
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1567
     (metis all_not_in_conv nonempty_Basis)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1568
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1569
lemma subset_box_imp:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1570
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1571
  shows "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> cbox c d \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1572
    and "(\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i) \<Longrightarrow> cbox c d \<subseteq> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1573
    and "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> box c d \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1574
     and "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> box c d \<subseteq> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1575
  unfolding subset_eq[unfolded Ball_def] unfolding mem_box
58757
7f4924f23158 tuned whitespace;
wenzelm
parents: 58184
diff changeset
  1576
  by (best intro: order_trans less_le_trans le_less_trans less_imp_le)+
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1577
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1578
lemma box_subset_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1579
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1580
  shows "box a b \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1581
  unfolding subset_eq [unfolded Ball_def] mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1582
  by (fast intro: less_imp_le)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1583
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1584
lemma subset_box:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1585
  fixes a :: "'a::euclidean_space"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1586
  shows "cbox c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i \<le> d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th1)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1587
    and "cbox c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i \<le> d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i)" (is ?th2)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1588
    and "box c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th3)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1589
    and "box c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i) \<longrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th4)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1590
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1591
  show ?th1
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1592
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1593
    by (auto intro: order_trans)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1594
  show ?th2
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1595
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1596
    by (auto intro: le_less_trans less_le_trans order_trans less_imp_le)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1597
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1598
    assume as: "box c d \<subseteq> cbox a b" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1599
    then have "box c d \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1600
      unfolding box_eq_empty by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1601
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1602
    assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1603
    (** TODO combine the following two parts as done in the HOL_light version. **)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1604
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1605
      let ?x = "(\<Sum>j\<in>Basis. (if j=i then ((min (a\<bullet>j) (d\<bullet>j))+c\<bullet>j)/2 else (c\<bullet>j+d\<bullet>j)/2) *\<^sub>R j)::'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1606
      assume as2: "a\<bullet>i > c\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1607
      {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1608
        fix j :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1609
        assume j: "j \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1610
        then have "c \<bullet> j < ?x \<bullet> j \<and> ?x \<bullet> j < d \<bullet> j"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1611
          apply (cases "j = i")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1612
          using as(2)[THEN bspec[where x=j]] i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1613
          apply (auto simp add: as2)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1614
          done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1615
      }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1616
      then have "?x\<in>box c d"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1617
        using i unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1618
      moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1619
      have "?x \<notin> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1620
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1621
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1622
        apply (rule_tac x=i in bexI)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1623
        using as(2)[THEN bspec[where x=i]] and as2 i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1624
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1625
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1626
      ultimately have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1627
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1628
    then have "a\<bullet>i \<le> c\<bullet>i" by (rule ccontr) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1629
    moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1630
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1631
      let ?x = "(\<Sum>j\<in>Basis. (if j=i then ((max (b\<bullet>j) (c\<bullet>j))+d\<bullet>j)/2 else (c\<bullet>j+d\<bullet>j)/2) *\<^sub>R j)::'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1632
      assume as2: "b\<bullet>i < d\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1633
      {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1634
        fix j :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1635
        assume "j\<in>Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1636
        then have "d \<bullet> j > ?x \<bullet> j \<and> ?x \<bullet> j > c \<bullet> j"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1637
          apply (cases "j = i")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1638
          using as(2)[THEN bspec[where x=j]]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1639
          apply (auto simp add: as2)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1640
          done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1641
      }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1642
      then have "?x\<in>box c d"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1643
        unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1644
      moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1645
      have "?x\<notin>cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1646
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1647
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1648
        apply (rule_tac x=i in bexI)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1649
        using as(2)[THEN bspec[where x=i]] and as2 using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1650
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1651
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1652
      ultimately have False using as by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1653
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1654
    then have "b\<bullet>i \<ge> d\<bullet>i" by (rule ccontr) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1655
    ultimately
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1656
    have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1657
  } note part1 = this
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1658
  show ?th3
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1659
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1660
    apply (rule, rule, rule, rule)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1661
    apply (rule part1)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1662
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1663
    prefer 4
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1664
    apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1665
    apply (erule_tac x=xa in allE, erule_tac x=xa in allE, fastforce)+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1666
    done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1667
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1668
    assume as: "box c d \<subseteq> box a b" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1669
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1670
    assume i:"i\<in>Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1671
    from as(1) have "box c d \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1672
      using box_subset_cbox[of a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1673
    then have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1674
      using part1 and as(2) using i by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1675
  } note * = this
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1676
  show ?th4
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1677
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1678
    apply (rule, rule, rule, rule)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1679
    apply (rule *)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1680
    unfolding subset_eq and Ball_def and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1681
    prefer 4
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1682
    apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1683
    apply (erule_tac x=xa in allE, simp)+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1684
    done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1685
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1686
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1687
lemma eq_cbox: "cbox a b = cbox c d \<longleftrightarrow> cbox a b = {} \<and> cbox c d = {} \<or> a = c \<and> b = d"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1688
      (is "?lhs = ?rhs")
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1689
proof
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1690
  assume ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1691
  then have "cbox a b \<subseteq> cbox c d" "cbox c d \<subseteq> cbox a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1692
    by auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1693
  then show ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1694
    by (force simp add: subset_box box_eq_empty intro: antisym euclidean_eqI)
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1695
next
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1696
  assume ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1697
  then show ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1698
    by force
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1699
qed
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1700
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1701
lemma eq_cbox_box [simp]: "cbox a b = box c d \<longleftrightarrow> cbox a b = {} \<and> box c d = {}"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1702
  (is "?lhs \<longleftrightarrow> ?rhs")
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1703
proof
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1704
  assume ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1705
  then have "cbox a b \<subseteq> box c d" "box c d \<subseteq>cbox a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1706
    by auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1707
  then show ?rhs
63957
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
  1708
    apply (simp add: subset_box)
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1709
    using \<open>cbox a b = box c d\<close> box_ne_empty box_sing
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1710
    apply (fastforce simp add:)
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1711
    done
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1712
next
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1713
  assume ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1714
  then show ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1715
    by force
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1716
qed
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1717
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1718
lemma eq_box_cbox [simp]: "box a b = cbox c d \<longleftrightarrow> box a b = {} \<and> cbox c d = {}"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1719
  by (metis eq_cbox_box)
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1720
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1721
lemma eq_box: "box a b = box c d \<longleftrightarrow> box a b = {} \<and> box c d = {} \<or> a = c \<and> b = d"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1722
  (is "?lhs \<longleftrightarrow> ?rhs")
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1723
proof
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1724
  assume ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1725
  then have "box a b \<subseteq> box c d" "box c d \<subseteq> box a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1726
    by auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1727
  then show ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1728
    apply (simp add: subset_box)
63957
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
  1729
    using box_ne_empty(2) \<open>box a b = box c d\<close>
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1730
    apply auto
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1731
     apply (meson euclidean_eqI less_eq_real_def not_less)+
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1732
    done
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1733
next
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1734
  assume ?rhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1735
  then show ?lhs
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1736
    by force
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1737
qed
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1738
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  1739
lemma Int_interval:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1740
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1741
  shows "cbox a b \<inter> cbox c d =
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1742
    cbox (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1743
  unfolding set_eq_iff and Int_iff and mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1744
  by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1745
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1746
lemma disjoint_interval:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1747
  fixes a::"'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1748
  shows "cbox a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i < a\<bullet>i \<or> d\<bullet>i < c\<bullet>i \<or> b\<bullet>i < c\<bullet>i \<or> d\<bullet>i < a\<bullet>i))" (is ?th1)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1749
    and "cbox a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i < a\<bullet>i \<or> d\<bullet>i \<le> c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th2)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1750
    and "box a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i \<le> a\<bullet>i \<or> d\<bullet>i < c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th3)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1751
    and "box a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i \<le> a\<bullet>i \<or> d\<bullet>i \<le> c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th4)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1752
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1753
  let ?z = "(\<Sum>i\<in>Basis. (((max (a\<bullet>i) (c\<bullet>i)) + (min (b\<bullet>i) (d\<bullet>i))) / 2) *\<^sub>R i)::'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1754
  have **: "\<And>P Q. (\<And>i :: 'a. i \<in> Basis \<Longrightarrow> Q ?z i \<Longrightarrow> P i) \<Longrightarrow>
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1755
      (\<And>i x :: 'a. i \<in> Basis \<Longrightarrow> P i \<Longrightarrow> Q x i) \<Longrightarrow> (\<forall>x. \<exists>i\<in>Basis. Q x i) \<longleftrightarrow> (\<exists>i\<in>Basis. P i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1756
    by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1757
  note * = set_eq_iff Int_iff empty_iff mem_box ball_conj_distrib[symmetric] eq_False ball_simps(10)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1758
  show ?th1 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1759
  show ?th2 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1760
  show ?th3 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1761
  show ?th4 unfolding * by (intro **) auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1762
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1763
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1764
lemma UN_box_eq_UNIV: "(\<Union>i::nat. box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) = UNIV"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1765
proof -
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1766
  have "\<bar>x \<bullet> b\<bar> < real_of_int (\<lceil>Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)\<rceil> + 1)"
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1767
    if [simp]: "b \<in> Basis" for x b :: 'a
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1768
  proof -
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1769
    have "\<bar>x \<bullet> b\<bar> \<le> real_of_int \<lceil>\<bar>x \<bullet> b\<bar>\<rceil>"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1770
      by (rule le_of_int_ceiling)
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1771
    also have "\<dots> \<le> real_of_int \<lceil>Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)\<rceil>"
59587
8ea7b22525cb Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents: 58877
diff changeset
  1772
      by (auto intro!: ceiling_mono)
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  1773
    also have "\<dots> < real_of_int (\<lceil>Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)\<rceil> + 1)"
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1774
      by simp
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1775
    finally show ?thesis .
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1776
  qed
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1777
  then have "\<exists>n::nat. \<forall>b\<in>Basis. \<bar>x \<bullet> b\<bar> < real n" for x :: 'a
59587
8ea7b22525cb Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents: 58877
diff changeset
  1778
    by (metis order.strict_trans reals_Archimedean2)
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1779
  moreover have "\<And>x b::'a. \<And>n::nat.  \<bar>x \<bullet> b\<bar> < real n \<longleftrightarrow> - real n < x \<bullet> b \<and> x \<bullet> b < real n"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1780
    by auto
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1781
  ultimately show ?thesis
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  1782
    by (auto simp: box_def inner_sum_left inner_Basis sum.If_cases)
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1783
qed
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  1784
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1785
text \<open>Intervals in general, including infinite and mixtures of open and closed.\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1786
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1787
definition "is_interval (s::('a::euclidean_space) set) \<longleftrightarrow>
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1788
  (\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i\<in>Basis. ((a\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> b\<bullet>i) \<or> (b\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> a\<bullet>i))) \<longrightarrow> x \<in> s)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1789
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1790
lemma is_interval_cbox [simp]: "is_interval (cbox a (b::'a::euclidean_space))" (is ?th1)
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1791
  and is_interval_box [simp]: "is_interval (box a b)" (is ?th2)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1792
  unfolding is_interval_def mem_box Ball_def atLeastAtMost_iff
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1793
  by (meson order_trans le_less_trans less_le_trans less_trans)+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1794
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1795
lemma is_interval_empty [iff]: "is_interval {}"
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1796
  unfolding is_interval_def  by simp
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1797
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1798
lemma is_interval_univ [iff]: "is_interval UNIV"
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  1799
  unfolding is_interval_def  by simp
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1800
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1801
lemma mem_is_intervalI:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1802
  assumes "is_interval s"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1803
    and "a \<in> s" "b \<in> s"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1804
    and "\<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i \<or> b \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> a \<bullet> i"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1805
  shows "x \<in> s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1806
  by (rule assms(1)[simplified is_interval_def, rule_format, OF assms(2,3,4)])
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1807
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1808
lemma interval_subst:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1809
  fixes S::"'a::euclidean_space set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1810
  assumes "is_interval S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1811
    and "x \<in> S" "y j \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1812
    and "j \<in> Basis"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1813
  shows "(\<Sum>i\<in>Basis. (if i = j then y i \<bullet> i else x \<bullet> i) *\<^sub>R i) \<in> S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1814
  by (rule mem_is_intervalI[OF assms(1,2)]) (auto simp: assms)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1815
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1816
lemma mem_box_componentwiseI:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1817
  fixes S::"'a::euclidean_space set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1818
  assumes "is_interval S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1819
  assumes "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i \<in> ((\<lambda>x. x \<bullet> i) ` S)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1820
  shows "x \<in> S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1821
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1822
  from assms have "\<forall>i \<in> Basis. \<exists>s \<in> S. x \<bullet> i = s \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1823
    by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1824
  with finite_Basis obtain s and bs::"'a list"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1825
    where s: "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i = s i \<bullet> i" "\<And>i. i \<in> Basis \<Longrightarrow> s i \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1826
      and bs: "set bs = Basis" "distinct bs"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1827
    by (metis finite_distinct_list)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1828
  from nonempty_Basis s obtain j where j: "j \<in> Basis" "s j \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1829
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  1830
  define y where
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  1831
    "y = rec_list (s j) (\<lambda>j _ Y. (\<Sum>i\<in>Basis. (if i = j then s i \<bullet> i else Y \<bullet> i) *\<^sub>R i))"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1832
  have "x = (\<Sum>i\<in>Basis. (if i \<in> set bs then s i \<bullet> i else s j \<bullet> i) *\<^sub>R i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1833
    using bs by (auto simp add: s(1)[symmetric] euclidean_representation)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1834
  also have [symmetric]: "y bs = \<dots>"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1835
    using bs(2) bs(1)[THEN equalityD1]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1836
    by (induct bs) (auto simp: y_def euclidean_representation intro!: euclidean_eqI[where 'a='a])
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1837
  also have "y bs \<in> S"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1838
    using bs(1)[THEN equalityD1]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1839
    apply (induct bs)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1840
     apply (auto simp: y_def j)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1841
    apply (rule interval_subst[OF assms(1)])
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1842
      apply (auto simp: s)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1843
    done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1844
  finally show ?thesis .
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1845
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  1846
63007
aa894a49f77d new theorems about convex hulls, etc.; also, renamed some theorems
paulson <lp15@cam.ac.uk>
parents: 62948
diff changeset
  1847
lemma cbox01_nonempty [simp]: "cbox 0 One \<noteq> {}"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  1848
  by (simp add: box_ne_empty inner_Basis inner_sum_left sum_nonneg)
63007
aa894a49f77d new theorems about convex hulls, etc.; also, renamed some theorems
paulson <lp15@cam.ac.uk>
parents: 62948
diff changeset
  1849
aa894a49f77d new theorems about convex hulls, etc.; also, renamed some theorems
paulson <lp15@cam.ac.uk>
parents: 62948
diff changeset
  1850
lemma box01_nonempty [simp]: "box 0 One \<noteq> {}"
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1851
  by (simp add: box_ne_empty inner_Basis inner_sum_left)
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  1852
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  1853
lemma empty_as_interval: "{} = cbox One (0::'a::euclidean_space)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  1854
  using nonempty_Basis box01_nonempty box_eq_empty(1) box_ne_empty(1) by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  1855
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1856
lemma interval_subset_is_interval:
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1857
  assumes "is_interval S"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1858
  shows "cbox a b \<subseteq> S \<longleftrightarrow> cbox a b = {} \<or> a \<in> S \<and> b \<in> S" (is "?lhs = ?rhs")
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1859
proof
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1860
  assume ?lhs
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1861
  then show ?rhs  using box_ne_empty(1) mem_box(2) by fastforce
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1862
next
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1863
  assume ?rhs
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1864
  have "cbox a b \<subseteq> S" if "a \<in> S" "b \<in> S"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1865
    using assms unfolding is_interval_def
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1866
    apply (clarsimp simp add: mem_box)
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1867
    using that by blast
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1868
  with \<open>?rhs\<close> show ?lhs
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1869
    by blast
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1870
qed
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1871
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  1872
  
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1873
subsection \<open>Connectedness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1874
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1875
lemma connected_local:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1876
 "connected S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1877
  \<not> (\<exists>e1 e2.
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1878
      openin (subtopology euclidean S) e1 \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1879
      openin (subtopology euclidean S) e2 \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1880
      S \<subseteq> e1 \<union> e2 \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1881
      e1 \<inter> e2 = {} \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1882
      e1 \<noteq> {} \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1883
      e2 \<noteq> {})"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1884
  unfolding connected_def openin_open
59765
26d1c71784f1 tweaked a few slow or very ugly proofs
paulson <lp15@cam.ac.uk>
parents: 59587
diff changeset
  1885
  by safe blast+
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1886
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  1887
lemma exists_diff:
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  1888
  fixes P :: "'a set \<Rightarrow> bool"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1889
  shows "(\<exists>S. P (- S)) \<longleftrightarrow> (\<exists>S. P S)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1890
    (is "?lhs \<longleftrightarrow> ?rhs")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1891
proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1892
  have ?rhs if ?lhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1893
    using that by blast
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1894
  moreover have "P (- (- S))" if "P S" for S
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1895
  proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1896
    have "S = - (- S)" by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1897
    with that show ?thesis by metis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1898
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1899
  ultimately show ?thesis by metis
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1900
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1901
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1902
lemma connected_clopen: "connected S \<longleftrightarrow>
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1903
  (\<forall>T. openin (subtopology euclidean S) T \<and>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1904
     closedin (subtopology euclidean S) T \<longrightarrow> T = {} \<or> T = S)" (is "?lhs \<longleftrightarrow> ?rhs")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1905
proof -
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1906
  have "\<not> connected S \<longleftrightarrow>
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1907
    (\<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
  1908
    unfolding connected_def openin_open closedin_closed
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  1909
    by (metis double_complement)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1910
  then have th0: "connected S \<longleftrightarrow>
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1911
    \<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
  1912
    (is " _ \<longleftrightarrow> \<not> (\<exists>e2 e1. ?P e2 e1)")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1913
    by (simp add: closed_def) metis
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1914
  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
  1915
    (is "_ \<longleftrightarrow> \<not> (\<exists>t' t. ?Q t' t)")
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1916
    unfolding connected_def openin_open closedin_closed by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1917
  have "(\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" for e2
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1918
  proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1919
    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)" for e1
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1920
      by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1921
    then show ?thesis
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1922
      by metis
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1923
  qed
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1924
  then have "\<forall>e2. (\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1925
    by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1926
  then show ?thesis
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1927
    by (simp add: th0 th1)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1928
qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1929
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1930
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1931
subsection \<open>Limit points\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1932
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  1933
definition (in topological_space) islimpt:: "'a \<Rightarrow> 'a set \<Rightarrow> bool"  (infixr "islimpt" 60)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1934
  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
  1935
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1936
lemma islimptI:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1937
  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
  1938
  shows "x islimpt S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1939
  using assms unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1940
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1941
lemma islimptE:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1942
  assumes "x islimpt S" and "x \<in> T" and "open T"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1943
  obtains y where "y \<in> S" and "y \<in> T" and "y \<noteq> x"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1944
  using assms unfolding islimpt_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1945
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1946
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
  1947
  unfolding islimpt_def eventually_at_topological by auto
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1948
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1949
lemma islimpt_subset: "x islimpt S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> x islimpt T"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1950
  unfolding islimpt_def by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1951
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1952
lemma islimpt_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1953
  fixes x :: "'a::metric_space"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1954
  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
  1955
  unfolding islimpt_iff_eventually eventually_at by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1956
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1957
lemma islimpt_approachable_le: "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x \<le> e)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1958
  for x :: "'a::metric_space"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1959
  unfolding islimpt_approachable
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1960
  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
  1961
    THEN arg_cong [where f=Not]]
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  1962
  by (simp add: Bex_def conj_commute conj_left_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1963
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1964
lemma islimpt_UNIV_iff: "x islimpt UNIV \<longleftrightarrow> \<not> open {x}"
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1965
  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
  1966
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1967
lemma islimpt_punctured: "x islimpt S = x islimpt (S-{x})"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1968
  unfolding islimpt_def by blast
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  1969
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  1970
text \<open>A perfect space has no isolated points.\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  1971
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1972
lemma islimpt_UNIV [simp, intro]: "x islimpt UNIV"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1973
  for x :: "'a::perfect_space"
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  1974
  unfolding islimpt_UNIV_iff by (rule not_open_singleton)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1975
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1976
lemma perfect_choose_dist: "0 < r \<Longrightarrow> \<exists>a. a \<noteq> x \<and> dist a x < r"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1977
  for x :: "'a::{perfect_space,metric_space}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1978
  using islimpt_UNIV [of x] by (simp add: islimpt_approachable)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1979
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1980
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
  1981
  unfolding closed_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1982
  apply (subst open_subopen)
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  1983
  apply (simp add: islimpt_def subset_eq)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1984
  apply (metis ComplE ComplI)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  1985
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1986
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1987
lemma islimpt_EMPTY[simp]: "\<not> x islimpt {}"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1988
  by (auto simp add: islimpt_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1989
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1990
lemma finite_set_avoid:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1991
  fixes a :: "'a::metric_space"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1992
  assumes fS: "finite S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  1993
  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
  1994
proof (induct rule: finite_induct[OF fS])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1995
  case 1
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  1996
  then show ?case by (auto intro: zero_less_one)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1997
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  1998
  case (2 x F)
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  1999
  from 2 obtain d where d: "d > 0" "\<forall>x\<in>F. x \<noteq> a \<longrightarrow> d \<le> dist a x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2000
    by blast
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2001
  show ?case
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2002
  proof (cases "x = a")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2003
    case True
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2004
    with d show ?thesis by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2005
  next
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2006
    case False
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2007
    let ?d = "min d (dist a x)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2008
    from False d(1) have dp: "?d > 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2009
      by auto
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  2010
    from d have d': "\<forall>x\<in>F. x \<noteq> a \<longrightarrow> ?d \<le> dist a x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2011
      by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2012
    with dp False show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2013
      by (auto intro!: exI[where x="?d"])
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2014
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2015
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2016
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2017
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
  2018
  by (simp add: islimpt_iff_eventually eventually_conj_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2019
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2020
lemma discrete_imp_closed:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2021
  fixes S :: "'a::metric_space set"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2022
  assumes e: "0 < e"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2023
    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
  2024
  shows "closed S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2025
proof -
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2026
  have False if C: "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2027
  proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2028
    from e have e2: "e/2 > 0" by arith
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2029
    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
  2030
      by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2031
    let ?m = "min (e/2) (dist x y) "
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2032
    from e2 y(2) have mp: "?m > 0"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  2033
      by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2034
    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
  2035
      by blast
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2036
    from z y have "dist z y < e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2037
      by (intro dist_triangle_lt [where z=x]) simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2038
    from d[rule_format, OF y(1) z(1) this] y z show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2039
      by (auto simp add: dist_commute)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2040
  qed
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2041
  then show ?thesis
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2042
    by (metis islimpt_approachable closed_limpt [where 'a='a])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2043
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2044
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2045
lemma closed_of_nat_image: "closed (of_nat ` A :: 'a::real_normed_algebra_1 set)"
61524
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2046
  by (rule discrete_imp_closed[of 1]) (auto simp: dist_of_nat)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2047
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2048
lemma closed_of_int_image: "closed (of_int ` A :: 'a::real_normed_algebra_1 set)"
61524
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2049
  by (rule discrete_imp_closed[of 1]) (auto simp: dist_of_int)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2050
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2051
lemma closed_Nats [simp]: "closed (\<nat> :: 'a :: real_normed_algebra_1 set)"
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2052
  unfolding Nats_def by (rule closed_of_nat_image)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2053
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2054
lemma closed_Ints [simp]: "closed (\<int> :: 'a :: real_normed_algebra_1 set)"
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2055
  unfolding Ints_def by (rule closed_of_int_image)
f2e51e704a96 added many small lemmas about setsum/setprod/powr/...
eberlm
parents: 61518
diff changeset
  2056
66286
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2057
lemma closed_subset_Ints: 
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2058
  fixes A :: "'a :: real_normed_algebra_1 set"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2059
  assumes "A \<subseteq> \<int>"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2060
  shows   "closed A"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2061
proof (intro discrete_imp_closed[OF zero_less_one] ballI impI, goal_cases)
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2062
  case (1 x y)
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2063
  with assms have "x \<in> \<int>" and "y \<in> \<int>" by auto
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2064
  with \<open>dist y x < 1\<close> show "y = x"
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2065
    by (auto elim!: Ints_cases simp: dist_of_int)
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2066
qed
1c977b13414f poles and residues of the Gamma function
eberlm <eberlm@in.tum.de>
parents: 66164
diff changeset
  2067
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2068
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2069
subsection \<open>Interior of a Set\<close>
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  2070
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2071
definition "interior S = \<Union>{T. open T \<and> T \<subseteq> S}"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2072
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2073
lemma interiorI [intro?]:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2074
  assumes "open T" and "x \<in> T" and "T \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2075
  shows "x \<in> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2076
  using assms unfolding interior_def by fast
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2077
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2078
lemma interiorE [elim?]:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2079
  assumes "x \<in> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2080
  obtains T where "open T" and "x \<in> T" and "T \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2081
  using assms unfolding interior_def by fast
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2082
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2083
lemma open_interior [simp, intro]: "open (interior S)"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2084
  by (simp add: interior_def open_Union)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2085
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2086
lemma interior_subset: "interior S \<subseteq> S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2087
  by (auto simp add: interior_def)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2088
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2089
lemma interior_maximal: "T \<subseteq> S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2090
  by (auto simp add: interior_def)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2091
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2092
lemma interior_open: "open S \<Longrightarrow> interior S = S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2093
  by (intro equalityI interior_subset interior_maximal subset_refl)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2094
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2095
lemma interior_eq: "interior S = S \<longleftrightarrow> open S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2096
  by (metis open_interior interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2097
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2098
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
  2099
  by (metis interior_maximal interior_subset subset_trans)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2100
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2101
lemma interior_empty [simp]: "interior {} = {}"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2102
  using open_empty by (rule interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2103
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2104
lemma interior_UNIV [simp]: "interior UNIV = UNIV"
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2105
  using open_UNIV by (rule interior_open)
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2106
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2107
lemma interior_interior [simp]: "interior (interior S) = interior S"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2108
  using open_interior by (rule interior_open)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2109
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2110
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
  2111
  by (auto simp add: interior_def)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2112
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2113
lemma interior_unique:
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2114
  assumes "T \<subseteq> S" and "open T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2115
  assumes "\<And>T'. T' \<subseteq> S \<Longrightarrow> open T' \<Longrightarrow> T' \<subseteq> T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2116
  shows "interior S = T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2117
  by (intro equalityI assms interior_subset open_interior interior_maximal)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2118
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2119
lemma interior_singleton [simp]: "interior {a} = {}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2120
  for a :: "'a::perfect_space"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2121
  apply (rule interior_unique)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2122
    apply simp_all
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2123
  using not_open_singleton subset_singletonD
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2124
  apply fastforce
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2125
  done
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2126
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2127
lemma interior_Int [simp]: "interior (S \<inter> T) = interior S \<inter> interior T"
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2128
  by (intro equalityI Int_mono Int_greatest interior_mono Int_lower1
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2129
    Int_lower2 interior_maximal interior_subset open_Int open_interior)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2130
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2131
lemma mem_interior: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2132
  using open_contains_ball_eq [where S="interior S"]
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2133
  by (simp add: open_subset_interior)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2134
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2135
lemma eventually_nhds_in_nhd: "x \<in> interior s \<Longrightarrow> eventually (\<lambda>y. y \<in> s) (nhds x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2136
  using interior_subset[of s] by (subst eventually_nhds) blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  2137
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2138
lemma interior_limit_point [intro]:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2139
  fixes x :: "'a::perfect_space"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2140
  assumes x: "x \<in> interior S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2141
  shows "x islimpt S"
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2142
  using x islimpt_UNIV [of x]
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2143
  unfolding interior_def islimpt_def
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2144
  apply (clarsimp, rename_tac T T')
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2145
  apply (drule_tac x="T \<inter> T'" in spec)
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2146
  apply (auto simp add: open_Int)
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2147
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2148
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2149
lemma interior_closed_Un_empty_interior:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2150
  assumes cS: "closed S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2151
    and iT: "interior T = {}"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2152
  shows "interior (S \<union> T) = interior S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2153
proof
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2154
  show "interior S \<subseteq> interior (S \<union> T)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2155
    by (rule interior_mono) (rule Un_upper1)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2156
  show "interior (S \<union> T) \<subseteq> interior S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2157
  proof
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2158
    fix x
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2159
    assume "x \<in> interior (S \<union> T)"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2160
    then obtain R where "open R" "x \<in> R" "R \<subseteq> S \<union> T" ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2161
    show "x \<in> interior S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2162
    proof (rule ccontr)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2163
      assume "x \<notin> interior S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2164
      with \<open>x \<in> R\<close> \<open>open R\<close> obtain y where "y \<in> R - S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2165
        unfolding interior_def by fast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2166
      from \<open>open R\<close> \<open>closed S\<close> have "open (R - S)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2167
        by (rule open_Diff)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2168
      from \<open>R \<subseteq> S \<union> T\<close> have "R - S \<subseteq> T"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2169
        by fast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2170
      from \<open>y \<in> R - S\<close> \<open>open (R - S)\<close> \<open>R - S \<subseteq> T\<close> \<open>interior T = {}\<close> show False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2171
        unfolding interior_def by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2172
    qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2173
  qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2174
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2175
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2176
lemma interior_Times: "interior (A \<times> B) = interior A \<times> interior B"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2177
proof (rule interior_unique)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2178
  show "interior A \<times> interior B \<subseteq> A \<times> B"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2179
    by (intro Sigma_mono interior_subset)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2180
  show "open (interior A \<times> interior B)"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2181
    by (intro open_Times open_interior)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2182
  fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2183
  assume "T \<subseteq> A \<times> B" and "open T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2184
  then show "T \<subseteq> interior A \<times> interior B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2185
  proof safe
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2186
    fix x y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2187
    assume "(x, y) \<in> T"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2188
    then obtain C D where "open C" "open D" "C \<times> D \<subseteq> T" "x \<in> C" "y \<in> D"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2189
      using \<open>open T\<close> unfolding open_prod_def by fast
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2190
    then have "open C" "open D" "C \<subseteq> A" "D \<subseteq> B" "x \<in> C" "y \<in> D"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2191
      using \<open>T \<subseteq> A \<times> B\<close> by auto
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2192
    then show "x \<in> interior A" and "y \<in> interior B"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2193
      by (auto intro: interiorI)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2194
  qed
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2195
qed
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2196
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2197
lemma interior_Ici:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2198
  fixes x :: "'a :: {dense_linorder,linorder_topology}"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2199
  assumes "b < x"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2200
  shows "interior {x ..} = {x <..}"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2201
proof (rule interior_unique)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2202
  fix T
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2203
  assume "T \<subseteq> {x ..}" "open T"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2204
  moreover have "x \<notin> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2205
  proof
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2206
    assume "x \<in> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2207
    obtain y where "y < x" "{y <.. x} \<subseteq> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2208
      using open_left[OF \<open>open T\<close> \<open>x \<in> T\<close> \<open>b < x\<close>] by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2209
    with dense[OF \<open>y < x\<close>] obtain z where "z \<in> T" "z < x"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2210
      by (auto simp: subset_eq Ball_def)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2211
    with \<open>T \<subseteq> {x ..}\<close> show False by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2212
  qed
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2213
  ultimately show "T \<subseteq> {x <..}"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2214
    by (auto simp: subset_eq less_le)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2215
qed auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2216
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2217
lemma interior_Iic:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2218
  fixes x :: "'a ::{dense_linorder,linorder_topology}"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2219
  assumes "x < b"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2220
  shows "interior {.. x} = {..< x}"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2221
proof (rule interior_unique)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2222
  fix T
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2223
  assume "T \<subseteq> {.. x}" "open T"
61245
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2224
  moreover have "x \<notin> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2225
  proof
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2226
    assume "x \<in> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2227
    obtain y where "x < y" "{x ..< y} \<subseteq> T"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2228
      using open_right[OF \<open>open T\<close> \<open>x \<in> T\<close> \<open>x < b\<close>] by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2229
    with dense[OF \<open>x < y\<close>] obtain z where "z \<in> T" "x < z"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2230
      by (auto simp: subset_eq Ball_def less_le)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2231
    with \<open>T \<subseteq> {.. x}\<close> show False by auto
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2232
  qed
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2233
  ultimately show "T \<subseteq> {..< x}"
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2234
    by (auto simp: subset_eq less_le)
b77bf45efe21 prove Liminf_inverse_ereal
hoelzl
parents: 61204
diff changeset
  2235
qed auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2236
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2237
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2238
subsection \<open>Closure of a Set\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2239
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2240
definition "closure S = S \<union> {x | x. x islimpt S}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2241
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2242
lemma interior_closure: "interior S = - (closure (- S))"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2243
  by (auto simp add: interior_def closure_def islimpt_def)
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2244
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2245
lemma closure_interior: "closure S = - interior (- S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2246
  by (simp add: interior_closure)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2247
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2248
lemma closed_closure[simp, intro]: "closed (closure S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2249
  by (simp add: closure_interior closed_Compl)
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2250
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2251
lemma closure_subset: "S \<subseteq> closure S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2252
  by (simp add: closure_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2253
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2254
lemma closure_hull: "closure S = closed hull S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2255
  by (auto simp add: hull_def closure_interior interior_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2256
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2257
lemma closure_eq: "closure S = S \<longleftrightarrow> closed S"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2258
  unfolding closure_hull using closed_Inter by (rule hull_eq)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2259
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2260
lemma closure_closed [simp]: "closed S \<Longrightarrow> closure S = S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2261
  by (simp only: closure_eq)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2262
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2263
lemma closure_closure [simp]: "closure (closure S) = closure S"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2264
  unfolding closure_hull by (rule hull_hull)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2265
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2266
lemma closure_mono: "S \<subseteq> T \<Longrightarrow> closure S \<subseteq> closure T"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2267
  unfolding closure_hull by (rule hull_mono)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2268
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2269
lemma closure_minimal: "S \<subseteq> T \<Longrightarrow> closed T \<Longrightarrow> closure S \<subseteq> T"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2270
  unfolding closure_hull by (rule hull_minimal)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2271
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2272
lemma closure_unique:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2273
  assumes "S \<subseteq> T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2274
    and "closed T"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2275
    and "\<And>T'. S \<subseteq> T' \<Longrightarrow> closed T' \<Longrightarrow> T \<subseteq> T'"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2276
  shows "closure S = T"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2277
  using assms unfolding closure_hull by (rule hull_unique)
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2278
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2279
lemma closure_empty [simp]: "closure {} = {}"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2280
  using closed_empty by (rule closure_closed)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2281
44522
2f7e9d890efe rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents: 44519
diff changeset
  2282
lemma closure_UNIV [simp]: "closure UNIV = UNIV"
44518
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2283
  using closed_UNIV by (rule closure_closed)
219a6fe4cfae add lemma closure_union;
huffman
parents: 44517
diff changeset
  2284
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2285
lemma closure_Un [simp]: "closure (S \<union> T) = closure S \<union> closure T"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2286
  by (simp add: closure_interior)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2287
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  2288
lemma closure_eq_empty [iff]: "closure S = {} \<longleftrightarrow> S = {}"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2289
  using closure_empty closure_subset[of S] by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2290
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2291
lemma closure_subset_eq: "closure S \<subseteq> S \<longleftrightarrow> closed S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2292
  using closure_eq[of S] closure_subset[of S] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2293
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2294
lemma open_Int_closure_eq_empty: "open S \<Longrightarrow> (S \<inter> closure T) = {} \<longleftrightarrow> S \<inter> T = {}"
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2295
  using open_subset_interior[of S "- T"]
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2296
  using interior_subset[of "- T"]
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2297
  by (auto simp: closure_interior)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2298
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2299
lemma open_Int_closure_subset: "open S \<Longrightarrow> S \<inter> closure T \<subseteq> closure (S \<inter> T)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2300
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2301
  fix x
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2302
  assume *: "open S" "x \<in> S \<inter> closure T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2303
  have "x islimpt (S \<inter> T)" if **: "x islimpt T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2304
  proof (rule islimptI)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2305
    fix A
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2306
    assume "x \<in> A" "open A"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2307
    with * have "x \<in> A \<inter> S" "open (A \<inter> S)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2308
      by (simp_all add: open_Int)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2309
    with ** obtain y where "y \<in> T" "y \<in> A \<inter> S" "y \<noteq> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2310
      by (rule islimptE)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2311
    then have "y \<in> S \<inter> T" "y \<in> A \<and> y \<noteq> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2312
      by simp_all
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2313
    then show "\<exists>y\<in>(S \<inter> T). y \<in> A \<and> y \<noteq> x" ..
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2314
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2315
  with * show "x \<in> closure (S \<inter> T)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2316
    unfolding closure_def by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2317
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2318
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2319
lemma closure_complement: "closure (- S) = - interior S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2320
  by (simp add: closure_interior)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2321
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2322
lemma interior_complement: "interior (- S) = - closure S"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2323
  by (simp add: closure_interior)
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
  2324
64845
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
  2325
lemma interior_diff: "interior(S - T) = interior S - closure T"
e5d4bc2016a6 Advanced topology
paulson <lp15@cam.ac.uk>
parents: 64791
diff changeset
  2326
  by (simp add: Diff_eq interior_complement)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2327
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2328
lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  2329
proof (rule closure_unique)
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2330
  show "A \<times> B \<subseteq> closure A \<times> closure B"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2331
    by (intro Sigma_mono closure_subset)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2332
  show "closed (closure A \<times> closure B)"
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2333
    by (intro closed_Times closed_closure)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2334
  fix T
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2335
  assume "A \<times> B \<subseteq> T" and "closed T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  2336
  then show "closure A \<times> closure B \<subseteq> T"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2337
    apply (simp add: closed_def open_prod_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2338
    apply clarify
44365
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2339
    apply (rule ccontr)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2340
    apply (drule_tac x="(a, b)" in bspec, simp, clarify, rename_tac C D)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2341
    apply (simp add: closure_interior interior_def)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2342
    apply (drule_tac x=C in spec)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2343
    apply (drule_tac x=D in spec)
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2344
    apply auto
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2345
    done
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2346
qed
5daa55003649 add lemmas interior_Times and closure_Times
huffman
parents: 44342
diff changeset
  2347
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  2348
lemma islimpt_in_closure: "(x islimpt S) = (x:closure(S-{x}))"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  2349
  unfolding closure_def using islimpt_punctured by blast
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  2350
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2351
lemma connected_imp_connected_closure: "connected S \<Longrightarrow> connected (closure S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2352
  by (rule connectedI) (meson closure_subset open_Int open_Int_closure_eq_empty subset_trans connectedD)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2353
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2354
lemma limpt_of_limpts: "x islimpt {y. y islimpt S} \<Longrightarrow> x islimpt S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2355
  for x :: "'a::metric_space"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2356
  apply (clarsimp simp add: islimpt_approachable)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2357
  apply (drule_tac x="e/2" in spec)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2358
  apply (auto simp: simp del: less_divide_eq_numeral1)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2359
  apply (drule_tac x="dist x' x" in spec)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2360
  apply (auto simp: zero_less_dist_iff simp del: less_divide_eq_numeral1)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2361
  apply (erule rev_bexI)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2362
  apply (metis dist_commute dist_triangle_half_r less_trans less_irrefl)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2363
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2364
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2365
lemma closed_limpts:  "closed {x::'a::metric_space. x islimpt S}"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2366
  using closed_limpt limpt_of_limpts by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2367
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2368
lemma limpt_of_closure: "x islimpt closure S \<longleftrightarrow> x islimpt S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2369
  for x :: "'a::metric_space"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2370
  by (auto simp: closure_def islimpt_Un dest: limpt_of_limpts)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2371
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2372
lemma closedin_limpt:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2373
  "closedin (subtopology euclidean T) S \<longleftrightarrow> S \<subseteq> T \<and> (\<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2374
  apply (simp add: closedin_closed, safe)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2375
   apply (simp add: closed_limpt islimpt_subset)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2376
  apply (rule_tac x="closure S" in exI)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2377
  apply simp
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2378
  apply (force simp: closure_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2379
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2380
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2381
lemma closedin_closed_eq: "closed S \<Longrightarrow> closedin (subtopology euclidean S) T \<longleftrightarrow> closed T \<and> T \<subseteq> S"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2382
  by (meson closedin_limpt closed_subset closedin_closed_trans)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2383
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2384
lemma closedin_subset_trans:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2385
  "closedin (subtopology euclidean U) S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> T \<subseteq> U \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2386
    closedin (subtopology euclidean T) S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2387
  by (meson closedin_limpt subset_iff)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2388
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2389
lemma openin_subset_trans:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2390
  "openin (subtopology euclidean U) S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> T \<subseteq> U \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2391
    openin (subtopology euclidean T) S"
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2392
  by (auto simp: openin_open)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2393
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2394
lemma openin_Times:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2395
  "openin (subtopology euclidean S) S' \<Longrightarrow> openin (subtopology euclidean T) T' \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2396
    openin (subtopology euclidean (S \<times> T)) (S' \<times> T')"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2397
  unfolding openin_open using open_Times by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2398
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2399
lemma Times_in_interior_subtopology:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2400
  fixes U :: "('a::metric_space \<times> 'b::metric_space) set"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2401
  assumes "(x, y) \<in> U" "openin (subtopology euclidean (S \<times> T)) U"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2402
  obtains V W where "openin (subtopology euclidean S) V" "x \<in> V"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2403
                    "openin (subtopology euclidean T) W" "y \<in> W" "(V \<times> W) \<subseteq> U"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2404
proof -
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2405
  from assms obtain e where "e > 0" and "U \<subseteq> S \<times> T"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2406
    and e: "\<And>x' y'. \<lbrakk>x'\<in>S; y'\<in>T; dist (x', y') (x, y) < e\<rbrakk> \<Longrightarrow> (x', y') \<in> U"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2407
    by (force simp: openin_euclidean_subtopology_iff)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2408
  with assms have "x \<in> S" "y \<in> T"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2409
    by auto
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2410
  show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2411
  proof
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2412
    show "openin (subtopology euclidean S) (ball x (e/2) \<inter> S)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2413
      by (simp add: Int_commute openin_open_Int)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2414
    show "x \<in> ball x (e / 2) \<inter> S"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2415
      by (simp add: \<open>0 < e\<close> \<open>x \<in> S\<close>)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2416
    show "openin (subtopology euclidean T) (ball y (e/2) \<inter> T)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2417
      by (simp add: Int_commute openin_open_Int)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2418
    show "y \<in> ball y (e / 2) \<inter> T"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2419
      by (simp add: \<open>0 < e\<close> \<open>y \<in> T\<close>)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2420
    show "(ball x (e / 2) \<inter> S) \<times> (ball y (e / 2) \<inter> T) \<subseteq> U"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2421
      by clarify (simp add: e dist_Pair_Pair \<open>0 < e\<close> dist_commute sqrt_sum_squares_half_less)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2422
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2423
qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2424
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2425
lemma openin_Times_eq:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2426
  fixes S :: "'a::metric_space set" and T :: "'b::metric_space set"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2427
  shows
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2428
    "openin (subtopology euclidean (S \<times> T)) (S' \<times> T') \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2429
      S' = {} \<or> T' = {} \<or> openin (subtopology euclidean S) S' \<and> openin (subtopology euclidean T) T'"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2430
    (is "?lhs = ?rhs")
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2431
proof (cases "S' = {} \<or> T' = {}")
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2432
  case True
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2433
  then show ?thesis by auto
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2434
next
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2435
  case False
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2436
  then obtain x y where "x \<in> S'" "y \<in> T'"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2437
    by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2438
  show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2439
  proof
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2440
    assume ?lhs
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2441
    have "openin (subtopology euclidean S) S'"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2442
      apply (subst openin_subopen, clarify)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2443
      apply (rule Times_in_interior_subtopology [OF _ \<open>?lhs\<close>])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2444
      using \<open>y \<in> T'\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2445
       apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2446
      done
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2447
    moreover have "openin (subtopology euclidean T) T'"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2448
      apply (subst openin_subopen, clarify)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2449
      apply (rule Times_in_interior_subtopology [OF _ \<open>?lhs\<close>])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2450
      using \<open>x \<in> S'\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2451
       apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2452
      done
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2453
    ultimately show ?rhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2454
      by simp
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2455
  next
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2456
    assume ?rhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2457
    with False show ?lhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2458
      by (simp add: openin_Times)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2459
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2460
qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  2461
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2462
lemma closedin_Times:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2463
  "closedin (subtopology euclidean S) S' \<Longrightarrow> closedin (subtopology euclidean T) T' \<Longrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2464
    closedin (subtopology euclidean (S \<times> T)) (S' \<times> T')"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2465
  unfolding closedin_closed using closed_Times by blast
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  2466
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2467
lemma bdd_below_closure:
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2468
  fixes A :: "real set"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2469
  assumes "bdd_below A"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2470
  shows "bdd_below (closure A)"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  2471
proof -
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2472
  from assms obtain m where "\<And>x. x \<in> A \<Longrightarrow> m \<le> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2473
    by (auto simp: bdd_below_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2474
  then have "A \<subseteq> {m..}" by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2475
  then have "closure A \<subseteq> {m..}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2476
    using closed_real_atLeast by (rule closure_minimal)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2477
  then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2478
    by (auto simp: bdd_below_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2479
qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2480
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2481
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2482
subsection \<open>Connected components, considered as a connectedness relation or a set\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2483
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2484
definition "connected_component s x y \<equiv> \<exists>t. connected t \<and> t \<subseteq> s \<and> x \<in> t \<and> y \<in> t"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2485
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2486
abbreviation "connected_component_set s x \<equiv> Collect (connected_component s x)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2487
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  2488
lemma connected_componentI:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2489
  "connected t \<Longrightarrow> t \<subseteq> s \<Longrightarrow> x \<in> t \<Longrightarrow> y \<in> t \<Longrightarrow> connected_component s x y"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  2490
  by (auto simp: connected_component_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  2491
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2492
lemma connected_component_in: "connected_component s x y \<Longrightarrow> x \<in> s \<and> y \<in> s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2493
  by (auto simp: connected_component_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2494
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2495
lemma connected_component_refl: "x \<in> s \<Longrightarrow> connected_component s x x"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2496
  by (auto simp: connected_component_def) (use connected_sing in blast)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2497
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2498
lemma connected_component_refl_eq [simp]: "connected_component s x x \<longleftrightarrow> x \<in> s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2499
  by (auto simp: connected_component_refl) (auto simp: connected_component_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2500
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2501
lemma connected_component_sym: "connected_component s x y \<Longrightarrow> connected_component s y x"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2502
  by (auto simp: connected_component_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2503
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2504
lemma connected_component_trans:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2505
  "connected_component s x y \<Longrightarrow> connected_component s y z \<Longrightarrow> connected_component s x z"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2506
  unfolding connected_component_def
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2507
  by (metis Int_iff Un_iff Un_subset_iff equals0D connected_Un)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2508
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2509
lemma connected_component_of_subset:
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2510
  "connected_component s x y \<Longrightarrow> s \<subseteq> t \<Longrightarrow> connected_component t x y"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2511
  by (auto simp: connected_component_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2512
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
  2513
lemma connected_component_Union: "connected_component_set s x = \<Union>{t. connected t \<and> x \<in> t \<and> t \<subseteq> s}"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2514
  by (auto simp: connected_component_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2515
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2516
lemma connected_connected_component [iff]: "connected (connected_component_set s x)"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2517
  by (auto simp: connected_component_Union intro: connected_Union)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2518
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2519
lemma connected_iff_eq_connected_component_set:
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2520
  "connected s \<longleftrightarrow> (\<forall>x \<in> s. connected_component_set s x = s)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2521
proof (cases "s = {}")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2522
  case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2523
  then show ?thesis by simp
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2524
next
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2525
  case False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2526
  then obtain x where "x \<in> s" by auto
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2527
  show ?thesis
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2528
  proof
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2529
    assume "connected s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2530
    then show "\<forall>x \<in> s. connected_component_set s x = s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2531
      by (force simp: connected_component_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2532
  next
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2533
    assume "\<forall>x \<in> s. connected_component_set s x = s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2534
    then show "connected s"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2535
      by (metis \<open>x \<in> s\<close> connected_connected_component)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2536
  qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2537
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2538
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2539
lemma connected_component_subset: "connected_component_set s x \<subseteq> s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2540
  using connected_component_in by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2541
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2542
lemma connected_component_eq_self: "connected s \<Longrightarrow> x \<in> s \<Longrightarrow> connected_component_set s x = s"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2543
  by (simp add: connected_iff_eq_connected_component_set)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2544
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2545
lemma connected_iff_connected_component:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2546
  "connected s \<longleftrightarrow> (\<forall>x \<in> s. \<forall>y \<in> s. connected_component s x y)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2547
  using connected_component_in by (auto simp: connected_iff_eq_connected_component_set)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2548
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2549
lemma connected_component_maximal:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2550
  "x \<in> t \<Longrightarrow> connected t \<Longrightarrow> t \<subseteq> s \<Longrightarrow> t \<subseteq> (connected_component_set s x)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2551
  using connected_component_eq_self connected_component_of_subset by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2552
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2553
lemma connected_component_mono:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2554
  "s \<subseteq> t \<Longrightarrow> connected_component_set s x \<subseteq> connected_component_set t x"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2555
  by (simp add: Collect_mono connected_component_of_subset)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2556
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2557
lemma connected_component_eq_empty [simp]: "connected_component_set s x = {} \<longleftrightarrow> x \<notin> s"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2558
  using connected_component_refl by (fastforce simp: connected_component_in)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2559
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2560
lemma connected_component_set_empty [simp]: "connected_component_set {} x = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2561
  using connected_component_eq_empty by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2562
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2563
lemma connected_component_eq:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2564
  "y \<in> connected_component_set s x \<Longrightarrow> (connected_component_set s y = connected_component_set s x)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2565
  by (metis (no_types, lifting)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2566
      Collect_cong connected_component_sym connected_component_trans mem_Collect_eq)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2567
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2568
lemma closed_connected_component:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2569
  assumes s: "closed s"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2570
  shows "closed (connected_component_set s x)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2571
proof (cases "x \<in> s")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2572
  case False
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2573
  then show ?thesis
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2574
    by (metis connected_component_eq_empty closed_empty)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2575
next
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2576
  case True
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2577
  show ?thesis
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2578
    unfolding closure_eq [symmetric]
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2579
  proof
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2580
    show "closure (connected_component_set s x) \<subseteq> connected_component_set s x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2581
      apply (rule connected_component_maximal)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2582
        apply (simp add: closure_def True)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2583
       apply (simp add: connected_imp_connected_closure)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2584
      apply (simp add: s closure_minimal connected_component_subset)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2585
      done
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2586
  next
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2587
    show "connected_component_set s x \<subseteq> closure (connected_component_set s x)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2588
      by (simp add: closure_subset)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2589
  qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2590
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2591
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2592
lemma connected_component_disjoint:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2593
  "connected_component_set s a \<inter> connected_component_set s b = {} \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2594
    a \<notin> connected_component_set s b"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2595
  apply (auto simp: connected_component_eq)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2596
  using connected_component_eq connected_component_sym
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2597
  apply blast
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2598
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2599
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2600
lemma connected_component_nonoverlap:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2601
  "connected_component_set s a \<inter> connected_component_set s b = {} \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2602
    a \<notin> s \<or> b \<notin> s \<or> connected_component_set s a \<noteq> connected_component_set s b"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2603
  apply (auto simp: connected_component_in)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2604
  using connected_component_refl_eq
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2605
    apply blast
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2606
   apply (metis connected_component_eq mem_Collect_eq)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2607
  apply (metis connected_component_eq mem_Collect_eq)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2608
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2609
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2610
lemma connected_component_overlap:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2611
  "connected_component_set s a \<inter> connected_component_set s b \<noteq> {} \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2612
    a \<in> s \<and> b \<in> s \<and> connected_component_set s a = connected_component_set s b"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2613
  by (auto simp: connected_component_nonoverlap)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2614
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2615
lemma connected_component_sym_eq: "connected_component s x y \<longleftrightarrow> connected_component s y x"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2616
  using connected_component_sym by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2617
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2618
lemma connected_component_eq_eq:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2619
  "connected_component_set s x = connected_component_set s y \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2620
    x \<notin> s \<and> y \<notin> s \<or> x \<in> s \<and> y \<in> s \<and> connected_component s x y"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2621
  apply (cases "y \<in> s")
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2622
   apply (simp add:)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2623
   apply (metis connected_component_eq connected_component_eq_empty connected_component_refl_eq mem_Collect_eq)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2624
  apply (cases "x \<in> s")
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2625
   apply (simp add:)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2626
   apply (metis connected_component_eq_empty)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2627
  using connected_component_eq_empty
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2628
  apply blast
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2629
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2630
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2631
lemma connected_iff_connected_component_eq:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2632
  "connected s \<longleftrightarrow> (\<forall>x \<in> s. \<forall>y \<in> s. connected_component_set s x = connected_component_set s y)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2633
  by (simp add: connected_component_eq_eq connected_iff_connected_component)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2634
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2635
lemma connected_component_idemp:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2636
  "connected_component_set (connected_component_set s x) x = connected_component_set s x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2637
  apply (rule subset_antisym)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2638
   apply (simp add: connected_component_subset)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2639
  apply (metis connected_component_eq_empty connected_component_maximal
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2640
      connected_component_refl_eq connected_connected_component mem_Collect_eq set_eq_subset)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2641
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2642
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2643
lemma connected_component_unique:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2644
  "\<lbrakk>x \<in> c; c \<subseteq> s; connected c;
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2645
    \<And>c'. x \<in> c' \<and> c' \<subseteq> s \<and> connected c'
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2646
              \<Longrightarrow> c' \<subseteq> c\<rbrakk>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2647
        \<Longrightarrow> connected_component_set s x = c"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2648
apply (rule subset_antisym)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2649
apply (meson connected_component_maximal connected_component_subset connected_connected_component contra_subsetD)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2650
by (simp add: connected_component_maximal)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2651
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2652
lemma joinable_connected_component_eq:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2653
  "\<lbrakk>connected t; t \<subseteq> s;
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2654
    connected_component_set s x \<inter> t \<noteq> {};
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2655
    connected_component_set s y \<inter> t \<noteq> {}\<rbrakk>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2656
    \<Longrightarrow> connected_component_set s x = connected_component_set s y"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2657
apply (simp add: ex_in_conv [symmetric])
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2658
apply (rule connected_component_eq)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2659
by (metis (no_types, hide_lams) connected_component_eq_eq connected_component_in connected_component_maximal subsetD mem_Collect_eq)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2660
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2661
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
  2662
lemma Union_connected_component: "\<Union>(connected_component_set s ` s) = s"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2663
  apply (rule subset_antisym)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2664
  apply (simp add: SUP_least connected_component_subset)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2665
  using connected_component_refl_eq
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2666
  by force
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2667
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2668
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2669
lemma complement_connected_component_unions:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2670
    "s - connected_component_set s x =
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
  2671
     \<Union>(connected_component_set s ` s - {connected_component_set s x})"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2672
  apply (subst Union_connected_component [symmetric], auto)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2673
  apply (metis connected_component_eq_eq connected_component_in)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2674
  by (metis connected_component_eq mem_Collect_eq)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2675
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2676
lemma connected_component_intermediate_subset:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2677
        "\<lbrakk>connected_component_set u a \<subseteq> t; t \<subseteq> u\<rbrakk>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2678
        \<Longrightarrow> connected_component_set t a = connected_component_set u a"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2679
  apply (case_tac "a \<in> u")
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2680
  apply (simp add: connected_component_maximal connected_component_mono subset_antisym)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2681
  using connected_component_eq_empty by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2682
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2683
proposition connected_Times:
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2684
  assumes S: "connected S" and T: "connected T"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2685
  shows "connected (S \<times> T)"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2686
proof (clarsimp simp add: connected_iff_connected_component)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2687
  fix x y x' y'
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2688
  assume xy: "x \<in> S" "y \<in> T" "x' \<in> S" "y' \<in> T"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2689
  with xy obtain U V where U: "connected U" "U \<subseteq> S" "x \<in> U" "x' \<in> U"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2690
                       and V: "connected V" "V \<subseteq> T" "y \<in> V" "y' \<in> V"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2691
    using S T \<open>x \<in> S\<close> \<open>x' \<in> S\<close> by blast+
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2692
  show "connected_component (S \<times> T) (x, y) (x', y')"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2693
    unfolding connected_component_def
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2694
  proof (intro exI conjI)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2695
    show "connected ((\<lambda>x. (x, y)) ` U \<union> Pair x' ` V)"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2696
    proof (rule connected_Un)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2697
      have "continuous_on U (\<lambda>x. (x, y))"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2698
        by (intro continuous_intros)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2699
      then show "connected ((\<lambda>x. (x, y)) ` U)"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2700
        by (rule connected_continuous_image) (rule \<open>connected U\<close>)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2701
      have "continuous_on V (Pair x')"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2702
        by (intro continuous_intros)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2703
      then show "connected (Pair x' ` V)"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2704
        by (rule connected_continuous_image) (rule \<open>connected V\<close>)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2705
    qed (use U V in auto)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2706
  qed (use U V in auto)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2707
qed
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2708
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2709
corollary connected_Times_eq [simp]:
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2710
   "connected (S \<times> T) \<longleftrightarrow> S = {} \<or> T = {} \<or> connected S \<and> connected T"  (is "?lhs = ?rhs")
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2711
proof
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2712
  assume L: ?lhs
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2713
  show ?rhs
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2714
  proof (cases "S = {} \<or> T = {}")
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2715
    case True
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2716
    then show ?thesis by auto
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2717
  next
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2718
    case False
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2719
    have "connected (fst ` (S \<times> T))" "connected (snd ` (S \<times> T))"
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2720
      using continuous_on_fst continuous_on_snd continuous_on_id
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2721
      by (blast intro: connected_continuous_image [OF _ L])+
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2722
    with False show ?thesis
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2723
      by auto
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2724
  qed
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2725
next
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2726
  assume ?rhs
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2727
  then show ?lhs
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2728
    by (auto simp: connected_Times)
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2729
qed
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  2730
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2731
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2732
subsection \<open>The set of connected components of a set\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2733
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2734
definition components:: "'a::topological_space set \<Rightarrow> 'a set set"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2735
  where "components s \<equiv> connected_component_set s ` s"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2736
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2737
lemma components_iff: "s \<in> components u \<longleftrightarrow> (\<exists>x. x \<in> u \<and> s = connected_component_set u x)"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2738
  by (auto simp: components_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2739
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2740
lemma componentsI: "x \<in> u \<Longrightarrow> connected_component_set u x \<in> components u"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2741
  by (auto simp: components_def)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2742
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2743
lemma componentsE:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2744
  assumes "s \<in> components u"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2745
  obtains x where "x \<in> u" "s = connected_component_set u x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2746
  using assms by (auto simp: components_def)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63332
diff changeset
  2747
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2748
lemma Union_components [simp]: "\<Union>(components u) = u"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2749
  apply (rule subset_antisym)
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2750
  using Union_connected_component components_def apply fastforce
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2751
  apply (metis Union_connected_component components_def set_eq_subset)
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2752
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2753
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2754
lemma pairwise_disjoint_components: "pairwise (\<lambda>X Y. X \<inter> Y = {}) (components u)"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2755
  apply (simp add: pairwise_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2756
  apply (auto simp: components_iff)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2757
  apply (metis connected_component_eq_eq connected_component_in)+
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2758
  done
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2759
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2760
lemma in_components_nonempty: "c \<in> components s \<Longrightarrow> c \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2761
    by (metis components_iff connected_component_eq_empty)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2762
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2763
lemma in_components_subset: "c \<in> components s \<Longrightarrow> c \<subseteq> s"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2764
  using Union_components by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2765
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2766
lemma in_components_connected: "c \<in> components s \<Longrightarrow> connected c"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2767
  by (metis components_iff connected_connected_component)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2768
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2769
lemma in_components_maximal:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2770
  "c \<in> components s \<longleftrightarrow>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2771
    c \<noteq> {} \<and> c \<subseteq> s \<and> connected c \<and> (\<forall>d. d \<noteq> {} \<and> c \<subseteq> d \<and> d \<subseteq> s \<and> connected d \<longrightarrow> d = c)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2772
  apply (rule iffI)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2773
   apply (simp add: in_components_nonempty in_components_connected)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2774
   apply (metis (full_types) components_iff connected_component_eq_self connected_component_intermediate_subset connected_component_refl in_components_subset mem_Collect_eq rev_subsetD)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2775
  apply (metis bot.extremum_uniqueI components_iff connected_component_eq_empty connected_component_maximal connected_component_subset connected_connected_component subset_emptyI)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2776
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2777
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2778
lemma joinable_components_eq:
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2779
  "connected t \<and> t \<subseteq> s \<and> c1 \<in> components s \<and> c2 \<in> components s \<and> c1 \<inter> t \<noteq> {} \<and> c2 \<inter> t \<noteq> {} \<Longrightarrow> c1 = c2"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2780
  by (metis (full_types) components_iff joinable_connected_component_eq)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2781
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2782
lemma closed_components: "\<lbrakk>closed s; c \<in> components s\<rbrakk> \<Longrightarrow> closed c"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2783
  by (metis closed_connected_component components_iff)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2784
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2785
lemma components_nonoverlap:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2786
    "\<lbrakk>c \<in> components s; c' \<in> components s\<rbrakk> \<Longrightarrow> (c \<inter> c' = {}) \<longleftrightarrow> (c \<noteq> c')"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2787
  apply (auto simp: in_components_nonempty components_iff)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2788
    using connected_component_refl apply blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2789
   apply (metis connected_component_eq_eq connected_component_in)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2790
  by (metis connected_component_eq mem_Collect_eq)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2791
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2792
lemma components_eq: "\<lbrakk>c \<in> components s; c' \<in> components s\<rbrakk> \<Longrightarrow> (c = c' \<longleftrightarrow> c \<inter> c' \<noteq> {})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2793
  by (metis components_nonoverlap)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2794
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2795
lemma components_eq_empty [simp]: "components s = {} \<longleftrightarrow> s = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2796
  by (simp add: components_def)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2797
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2798
lemma components_empty [simp]: "components {} = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2799
  by simp
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2800
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2801
lemma connected_eq_connected_components_eq: "connected s \<longleftrightarrow> (\<forall>c \<in> components s. \<forall>c' \<in> components s. c = c')"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2802
  by (metis (no_types, hide_lams) components_iff connected_component_eq_eq connected_iff_connected_component)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2803
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2804
lemma components_eq_sing_iff: "components s = {s} \<longleftrightarrow> connected s \<and> s \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2805
  apply (rule iffI)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2806
  using in_components_connected apply fastforce
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2807
  apply safe
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2808
  using Union_components apply fastforce
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2809
   apply (metis components_iff connected_component_eq_self)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2810
  using in_components_maximal
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2811
  apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2812
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2813
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2814
lemma components_eq_sing_exists: "(\<exists>a. components s = {a}) \<longleftrightarrow> connected s \<and> s \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2815
  apply (rule iffI)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2816
  using connected_eq_connected_components_eq apply fastforce
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2817
  apply (metis components_eq_sing_iff)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2818
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2819
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2820
lemma connected_eq_components_subset_sing: "connected s \<longleftrightarrow> components s \<subseteq> {s}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2821
  by (metis Union_components components_empty components_eq_sing_iff connected_empty insert_subset order_refl subset_singletonD)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2822
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2823
lemma connected_eq_components_subset_sing_exists: "connected s \<longleftrightarrow> (\<exists>a. components s \<subseteq> {a})"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2824
  by (metis components_eq_sing_exists connected_eq_components_subset_sing empty_iff subset_iff subset_singletonD)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2825
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2826
lemma in_components_self: "s \<in> components s \<longleftrightarrow> connected s \<and> s \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2827
  by (metis components_empty components_eq_sing_iff empty_iff in_components_connected insertI1)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2828
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2829
lemma components_maximal: "\<lbrakk>c \<in> components s; connected t; t \<subseteq> s; c \<inter> t \<noteq> {}\<rbrakk> \<Longrightarrow> t \<subseteq> c"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2830
  apply (simp add: components_def ex_in_conv [symmetric], clarify)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2831
  by (meson connected_component_def connected_component_trans)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2832
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2833
lemma exists_component_superset: "\<lbrakk>t \<subseteq> s; s \<noteq> {}; connected t\<rbrakk> \<Longrightarrow> \<exists>c. c \<in> components s \<and> t \<subseteq> c"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2834
  apply (cases "t = {}")
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2835
   apply force
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2836
  apply (metis components_def ex_in_conv connected_component_maximal contra_subsetD image_eqI)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2837
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2838
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2839
lemma components_intermediate_subset: "\<lbrakk>s \<in> components u; s \<subseteq> t; t \<subseteq> u\<rbrakk> \<Longrightarrow> s \<in> components t"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2840
  apply (auto simp: components_iff)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2841
  apply (metis connected_component_eq_empty connected_component_intermediate_subset)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2842
  done
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2843
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61945
diff changeset
  2844
lemma in_components_unions_complement: "c \<in> components s \<Longrightarrow> s - c = \<Union>(components s - {c})"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2845
  by (metis complement_connected_component_unions components_def components_iff)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2846
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2847
lemma connected_intermediate_closure:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2848
  assumes cs: "connected s" and st: "s \<subseteq> t" and ts: "t \<subseteq> closure s"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2849
  shows "connected t"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2850
proof (rule connectedI)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2851
  fix A B
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2852
  assume A: "open A" and B: "open B" and Alap: "A \<inter> t \<noteq> {}" and Blap: "B \<inter> t \<noteq> {}"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2853
    and disj: "A \<inter> B \<inter> t = {}" and cover: "t \<subseteq> A \<union> B"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2854
  have disjs: "A \<inter> B \<inter> s = {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2855
    using disj st by auto
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2856
  have "A \<inter> closure s \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2857
    using Alap Int_absorb1 ts by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2858
  then have Alaps: "A \<inter> s \<noteq> {}"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2859
    by (simp add: A open_Int_closure_eq_empty)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2860
  have "B \<inter> closure s \<noteq> {}"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2861
    using Blap Int_absorb1 ts by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2862
  then have Blaps: "B \<inter> s \<noteq> {}"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2863
    by (simp add: B open_Int_closure_eq_empty)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2864
  then show False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2865
    using cs [unfolded connected_def] A B disjs Alaps Blaps cover st
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2866
    by blast
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2867
qed
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2868
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  2869
lemma closedin_connected_component: "closedin (subtopology euclidean s) (connected_component_set s x)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2870
proof (cases "connected_component_set s x = {}")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2871
  case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2872
  then show ?thesis
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2873
    by (metis closedin_empty)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2874
next
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2875
  case False
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2876
  then obtain y where y: "connected_component s x y"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2877
    by blast
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2878
  have *: "connected_component_set s x \<subseteq> s \<inter> closure (connected_component_set s x)"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2879
    by (auto simp: closure_def connected_component_in)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2880
  have "connected_component s x y \<Longrightarrow> s \<inter> closure (connected_component_set s x) \<subseteq> connected_component_set s x"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2881
    apply (rule connected_component_maximal)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2882
      apply simp
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2883
    using closure_subset connected_component_in apply fastforce
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2884
    using * connected_intermediate_closure apply blast+
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  2885
    done
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2886
  with y * show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2887
    by (auto simp add: Topology_Euclidean_Space.closedin_closed)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2888
qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2889
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2890
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2891
subsection \<open>Frontier (also known as boundary)\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2892
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2893
definition "frontier S = closure S - interior S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2894
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  2895
lemma frontier_closed [iff]: "closed (frontier S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2896
  by (simp add: frontier_def closed_Diff)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2897
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2898
lemma frontier_closures: "frontier S = closure S \<inter> closure (- S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2899
  by (auto simp add: frontier_def interior_closure)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2900
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2901
lemma frontier_straddle:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2902
  fixes a :: "'a::metric_space"
44909
1f5d6eb73549 shorten proof of frontier_straddle
huffman
parents: 44907
diff changeset
  2903
  shows "a \<in> frontier S \<longleftrightarrow> (\<forall>e>0. (\<exists>x\<in>S. dist a x < e) \<and> (\<exists>x. x \<notin> S \<and> dist a x < e))"
1f5d6eb73549 shorten proof of frontier_straddle
huffman
parents: 44907
diff changeset
  2904
  unfolding frontier_def closure_interior
1f5d6eb73549 shorten proof of frontier_straddle
huffman
parents: 44907
diff changeset
  2905
  by (auto simp add: mem_interior subset_eq ball_def)
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  2906
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2907
lemma frontier_subset_closed: "closed S \<Longrightarrow> frontier S \<subseteq> S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2908
  by (metis frontier_def closure_closed Diff_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2909
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  2910
lemma frontier_empty [simp]: "frontier {} = {}"
36362
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
  2911
  by (simp add: frontier_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2912
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2913
lemma frontier_subset_eq: "frontier S \<subseteq> S \<longleftrightarrow> closed S"
58757
7f4924f23158 tuned whitespace;
wenzelm
parents: 58184
diff changeset
  2914
proof -
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2915
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2916
    assume "frontier S \<subseteq> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2917
    then have "closure S \<subseteq> S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2918
      using interior_subset unfolding frontier_def by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2919
    then have "closed S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2920
      using closure_subset_eq by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2921
  }
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2922
  then show ?thesis using frontier_subset_closed[of S] ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2923
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2924
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  2925
lemma frontier_complement [simp]: "frontier (- S) = frontier S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2926
  by (auto simp add: frontier_def closure_complement interior_complement)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2927
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2928
lemma frontier_disjoint_eq: "frontier S \<inter> S = {} \<longleftrightarrow> open S"
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2929
  using frontier_complement frontier_subset_eq[of "- S"]
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  2930
  unfolding open_closed by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2931
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2932
lemma frontier_UNIV [simp]: "frontier UNIV = {}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2933
  using frontier_complement frontier_empty by fastforce
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  2934
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2935
lemma frontier_interiors: "frontier s = - interior(s) - interior(-s)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2936
  by (simp add: Int_commute frontier_def interior_closure)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2937
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2938
lemma frontier_interior_subset: "frontier(interior S) \<subseteq> frontier S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2939
  by (simp add: Diff_mono frontier_interiors interior_mono interior_subset)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2940
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2941
lemma connected_Int_frontier:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2942
     "\<lbrakk>connected s; s \<inter> t \<noteq> {}; s - t \<noteq> {}\<rbrakk> \<Longrightarrow> (s \<inter> frontier t \<noteq> {})"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2943
  apply (simp add: frontier_interiors connected_openin, safe)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2944
  apply (drule_tac x="s \<inter> interior t" in spec, safe)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2945
   apply (drule_tac [2] x="s \<inter> interior (-t)" in spec)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2946
   apply (auto simp: disjoint_eq_subset_Compl dest: interior_subset [THEN subsetD])
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2947
  done
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2948
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2949
lemma closure_Un_frontier: "closure S = S \<union> frontier S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2950
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2951
  have "S \<union> interior S = S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2952
    using interior_subset by auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2953
  then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2954
    using closure_subset by (auto simp: frontier_def)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2955
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64773
diff changeset
  2956
58757
7f4924f23158 tuned whitespace;
wenzelm
parents: 58184
diff changeset
  2957
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2958
subsection \<open>Filters and the ``eventually true'' quantifier\<close>
44081
730f7cced3a6 rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents: 44076
diff changeset
  2959
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2960
definition indirection :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> 'a filter"  (infixr "indirection" 70)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  2961
  where "a indirection v = at a within {b. \<exists>c\<ge>0. b - a = scaleR c v}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2962
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  2963
text \<open>Identify Trivial limits, where we can't approach arbitrarily closely.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2964
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  2965
lemma trivial_limit_within: "trivial_limit (at a within S) \<longleftrightarrow> \<not> a islimpt S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2966
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2967
  assume "trivial_limit (at a within S)"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2968
  then show "\<not> a islimpt S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2969
    unfolding trivial_limit_def
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  2970
    unfolding eventually_at_topological
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2971
    unfolding islimpt_def
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  2972
    apply (clarsimp simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2973
    apply (rename_tac T, rule_tac x=T in exI)
36358
246493d61204 define nets directly as filters, instead of as filter bases
huffman
parents: 36336
diff changeset
  2974
    apply (clarsimp, drule_tac x=y in bspec, simp_all)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2975
    done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2976
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2977
  assume "\<not> a islimpt S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  2978
  then show "trivial_limit (at a within S)"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  2979
    unfolding trivial_limit_def eventually_at_topological islimpt_def
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  2980
    by metis
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2981
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2982
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2983
lemma trivial_limit_at_iff: "trivial_limit (at a) \<longleftrightarrow> \<not> a islimpt UNIV"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  2984
  using trivial_limit_within [of a UNIV] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2985
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2986
lemma trivial_limit_at: "\<not> trivial_limit (at a)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  2987
  for a :: "'a::perfect_space"
44571
bd91b77c4cd6 move class perfect_space into RealVector.thy;
huffman
parents: 44568
diff changeset
  2988
  by (rule at_neq_bot)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2989
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2990
lemma trivial_limit_at_infinity:
44081
730f7cced3a6 rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents: 44076
diff changeset
  2991
  "\<not> trivial_limit (at_infinity :: ('a::{real_normed_vector,perfect_space}) filter)"
36358
246493d61204 define nets directly as filters, instead of as filter bases
huffman
parents: 36336
diff changeset
  2992
  unfolding trivial_limit_def eventually_at_infinity
246493d61204 define nets directly as filters, instead of as filter bases
huffman
parents: 36336
diff changeset
  2993
  apply clarsimp
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2994
  apply (subgoal_tac "\<exists>x::'a. x \<noteq> 0", clarify)
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2995
   apply (rule_tac x="scaleR (b / norm x) x" in exI, simp)
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2996
  apply (cut_tac islimpt_UNIV [of "0::'a", unfolded islimpt_def])
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  2997
  apply (drule_tac x=UNIV in spec, simp)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2998
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  2999
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3000
lemma not_trivial_limit_within: "\<not> trivial_limit (at x within S) = (x \<in> closure (S - {x}))"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3001
  using islimpt_in_closure by (metis trivial_limit_within)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3002
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3003
lemma at_within_eq_bot_iff: "at c within A = bot \<longleftrightarrow> c \<notin> closure (A - {c})"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  3004
  using not_trivial_limit_within[of c A] by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61524
diff changeset
  3005
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3006
text \<open>Some property holds "sufficiently close" to the limit point.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3007
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3008
lemma trivial_limit_eventually: "trivial_limit net \<Longrightarrow> eventually P net"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  3009
  by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3010
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3011
lemma trivial_limit_eq: "trivial_limit net \<longleftrightarrow> (\<forall>P. eventually P net)"
44342
8321948340ea redefine constant 'trivial_limit' as an abbreviation
huffman
parents: 44286
diff changeset
  3012
  by (simp add: filter_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3013
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3014
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3015
subsection \<open>Limits\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3016
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3017
lemma Lim: "(f \<longlongrightarrow> l) net \<longleftrightarrow> trivial_limit net \<or> (\<forall>e>0. eventually (\<lambda>x. dist (f x) l < e) net)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3018
  by (auto simp: tendsto_iff trivial_limit_eq)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3019
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3020
text \<open>Show that they yield usual definitions in the various cases.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3021
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3022
lemma Lim_within_le: "(f \<longlongrightarrow> l)(at a within S) \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3023
    (\<forall>e>0. \<exists>d>0. \<forall>x\<in>S. 0 < dist x a \<and> dist x a \<le> d \<longrightarrow> dist (f x) l < e)"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3024
  by (auto simp add: tendsto_iff eventually_at_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3025
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3026
lemma Lim_within: "(f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3027
    (\<forall>e >0. \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a  < d \<longrightarrow> dist (f x) l < e)"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3028
  by (auto simp add: tendsto_iff eventually_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3029
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3030
corollary Lim_withinI [intro?]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3031
  assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l \<le> e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3032
  shows "(f \<longlongrightarrow> l) (at a within S)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3033
  apply (simp add: Lim_within, clarify)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3034
  apply (rule ex_forward [OF assms [OF half_gt_zero]])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3035
  apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3036
  done
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3037
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3038
lemma Lim_at: "(f \<longlongrightarrow> l) (at a) \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3039
    (\<forall>e >0. \<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d  \<longrightarrow> dist (f x) l < e)"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3040
  by (auto simp add: tendsto_iff eventually_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3041
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3042
lemma Lim_at_infinity: "(f \<longlongrightarrow> l) at_infinity \<longleftrightarrow> (\<forall>e>0. \<exists>b. \<forall>x. norm x \<ge> b \<longrightarrow> dist (f x) l < e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3043
  by (auto simp add: tendsto_iff eventually_at_infinity)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3044
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3045
corollary Lim_at_infinityI [intro?]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3046
  assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>B. \<forall>x. norm x \<ge> B \<longrightarrow> dist (f x) l \<le> e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3047
  shows "(f \<longlongrightarrow> l) at_infinity"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3048
  apply (simp add: Lim_at_infinity, clarify)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3049
  apply (rule ex_forward [OF assms [OF half_gt_zero]])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3050
   apply auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3051
  done
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  3052
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3053
lemma Lim_eventually: "eventually (\<lambda>x. f x = l) net \<Longrightarrow> (f \<longlongrightarrow> l) net"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3054
  by (rule topological_tendstoI) (auto elim: eventually_mono)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3055
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3056
lemma Lim_transform_within_set:
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3057
  fixes a :: "'a::metric_space" and l :: "'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3058
  shows "\<lbrakk>(f \<longlongrightarrow> l) (at a within S); eventually (\<lambda>x. x \<in> S \<longleftrightarrow> x \<in> T) (at a)\<rbrakk>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3059
         \<Longrightarrow> (f \<longlongrightarrow> l) (at a within T)"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3060
apply (clarsimp simp: eventually_at Lim_within)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3061
apply (drule_tac x=e in spec, clarify)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3062
apply (rename_tac k)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3063
apply (rule_tac x="min d k" in exI, simp)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3064
done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3065
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3066
lemma Lim_transform_within_set_eq:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3067
  fixes a l :: "'a::real_normed_vector"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3068
  shows "eventually (\<lambda>x. x \<in> s \<longleftrightarrow> x \<in> t) (at a)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3069
         \<Longrightarrow> ((f \<longlongrightarrow> l) (at a within s) \<longleftrightarrow> (f \<longlongrightarrow> l) (at a within t))"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3070
  by (force intro: Lim_transform_within_set elim: eventually_mono)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3071
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3072
lemma Lim_transform_within_openin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3073
  fixes a :: "'a::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3074
  assumes f: "(f \<longlongrightarrow> l) (at a within T)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3075
    and "openin (subtopology euclidean T) S" "a \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3076
    and eq: "\<And>x. \<lbrakk>x \<in> S; x \<noteq> a\<rbrakk> \<Longrightarrow> f x = g x"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3077
  shows "(g \<longlongrightarrow> l) (at a within T)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3078
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3079
  obtain \<epsilon> where "0 < \<epsilon>" and \<epsilon>: "ball a \<epsilon> \<inter> T \<subseteq> S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3080
    using assms by (force simp: openin_contains_ball)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3081
  then have "a \<in> ball a \<epsilon>"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3082
    by simp
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3083
  show ?thesis
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3084
    by (rule Lim_transform_within [OF f \<open>0 < \<epsilon>\<close> eq]) (use \<epsilon> in \<open>auto simp: dist_commute subset_iff\<close>)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3085
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3086
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3087
lemma continuous_transform_within_openin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3088
  fixes a :: "'a::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3089
  assumes "continuous (at a within T) f"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3090
    and "openin (subtopology euclidean T) S" "a \<in> S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3091
    and eq: "\<And>x. x \<in> S \<Longrightarrow> f x = g x"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3092
  shows "continuous (at a within T) g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3093
  using assms by (simp add: Lim_transform_within_openin continuous_within)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3094
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3095
text \<open>The expected monotonicity property.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3096
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3097
lemma Lim_Un:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3098
  assumes "(f \<longlongrightarrow> l) (at x within S)" "(f \<longlongrightarrow> l) (at x within T)"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3099
  shows "(f \<longlongrightarrow> l) (at x within (S \<union> T))"
53860
f2d683432580 factor out new lemma
huffman
parents: 53859
diff changeset
  3100
  using assms unfolding at_within_union by (rule filterlim_sup)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3101
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3102
lemma Lim_Un_univ:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3103
  "(f \<longlongrightarrow> l) (at x within S) \<Longrightarrow> (f \<longlongrightarrow> l) (at x within T) \<Longrightarrow>
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3104
    S \<union> T = UNIV \<Longrightarrow> (f \<longlongrightarrow> l) (at x)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3105
  by (metis Lim_Un)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3106
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3107
text \<open>Interrelations between restricted and unrestricted limits.\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3108
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3109
lemma Lim_at_imp_Lim_at_within: "(f \<longlongrightarrow> l) (at x) \<Longrightarrow> (f \<longlongrightarrow> l) (at x within S)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3110
  by (metis order_refl filterlim_mono subset_UNIV at_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3111
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3112
lemma eventually_within_interior:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3113
  assumes "x \<in> interior S"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3114
  shows "eventually P (at x within S) \<longleftrightarrow> eventually P (at x)"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3115
  (is "?lhs = ?rhs")
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3116
proof
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  3117
  from assms obtain T where T: "open T" "x \<in> T" "T \<subseteq> S" ..
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3118
  {
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3119
    assume ?lhs
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3120
    then obtain A where "open A" and "x \<in> A" and "\<forall>y\<in>A. y \<noteq> x \<longrightarrow> y \<in> S \<longrightarrow> P y"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3121
      by (auto simp: eventually_at_topological)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3122
    with T have "open (A \<inter> T)" and "x \<in> A \<inter> T" and "\<forall>y \<in> A \<inter> T. y \<noteq> x \<longrightarrow> P y"
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3123
      by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3124
    then show ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3125
      by (auto simp: eventually_at_topological)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3126
  next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3127
    assume ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3128
    then show ?lhs
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  3129
      by (auto elim: eventually_mono simp: eventually_at_filter)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3130
  }
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3131
qed
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3132
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3133
lemma at_within_interior: "x \<in> interior S \<Longrightarrow> at x within S = at x"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3134
  unfolding filter_eq_iff by (intro allI eventually_within_interior)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3135
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3136
lemma Lim_within_LIMSEQ:
53862
cb1094587ee4 generalize lemma
huffman
parents: 53861
diff changeset
  3137
  fixes a :: "'a::first_countable_topology"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  3138
  assumes "\<forall>S. (\<forall>n. S n \<noteq> a \<and> S n \<in> T) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. X (S n)) \<longlonglongrightarrow> L"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3139
  shows "(X \<longlongrightarrow> L) (at a within T)"
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  3140
  using assms unfolding tendsto_def [where l=L]
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  3141
  by (simp add: sequentially_imp_eventually_within)
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3142
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3143
lemma Lim_right_bound:
51773
9328c6681f3c spell conditional_ly_-complete lattices correct
hoelzl
parents: 51641
diff changeset
  3144
  fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder, no_top} \<Rightarrow>
9328c6681f3c spell conditional_ly_-complete lattices correct
hoelzl
parents: 51641
diff changeset
  3145
    'b::{linorder_topology, conditionally_complete_linorder}"
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3146
  assumes mono: "\<And>a b. a \<in> I \<Longrightarrow> b \<in> I \<Longrightarrow> x < a \<Longrightarrow> a \<le> b \<Longrightarrow> f a \<le> f b"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3147
    and bnd: "\<And>a. a \<in> I \<Longrightarrow> x < a \<Longrightarrow> K \<le> f a"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3148
  shows "(f \<longlongrightarrow> Inf (f ` ({x<..} \<inter> I))) (at x within ({x<..} \<inter> I))"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3149
proof (cases "{x<..} \<inter> I = {}")
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3150
  case True
53859
e6cb01686f7b replace lemma with more general simp rule
huffman
parents: 53813
diff changeset
  3151
  then show ?thesis by simp
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3152
next
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3153
  case False
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3154
  show ?thesis
51518
6a56b7088a6a separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents: 51481
diff changeset
  3155
  proof (rule order_tendstoI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3156
    fix a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3157
    assume a: "a < Inf (f ` ({x<..} \<inter> I))"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3158
    {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3159
      fix y
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3160
      assume "y \<in> {x<..} \<inter> I"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3161
      with False bnd have "Inf (f ` ({x<..} \<inter> I)) \<le> f y"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  3162
        by (auto intro!: cInf_lower bdd_belowI2)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3163
      with a have "a < f y"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3164
        by (blast intro: less_le_trans)
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3165
    }
51518
6a56b7088a6a separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents: 51481
diff changeset
  3166
    then show "eventually (\<lambda>x. a < f x) (at x within ({x<..} \<inter> I))"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3167
      by (auto simp: eventually_at_filter intro: exI[of _ 1] zero_less_one)
51518
6a56b7088a6a separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents: 51481
diff changeset
  3168
  next
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3169
    fix a
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3170
    assume "Inf (f ` ({x<..} \<inter> I)) < a"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3171
    from cInf_lessD[OF _ this] False obtain y where y: "x < y" "y \<in> I" "f y < a"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3172
      by auto
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3173
    then have "eventually (\<lambda>x. x \<in> I \<longrightarrow> f x < a) (at_right x)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3174
      unfolding eventually_at_right[OF \<open>x < y\<close>] by (metis less_imp_le le_less_trans mono)
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3175
    then show "eventually (\<lambda>x. f x < a) (at x within ({x<..} \<inter> I))"
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3176
      unfolding eventually_at_filter by eventually_elim simp
43338
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3177
  qed
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3178
qed
a150d16bf77c lemmas about right derivative and limits
hoelzl
parents: 42165
diff changeset
  3179
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  3180
text \<open>Another limit point characterization.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3181
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3182
lemma limpt_sequential_inj:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3183
  fixes x :: "'a::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3184
  shows "x islimpt S \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3185
         (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> inj f \<and> (f \<longlongrightarrow> x) sequentially)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3186
         (is "?lhs = ?rhs")
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3187
proof
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3188
  assume ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3189
  then have "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3190
    by (force simp: islimpt_approachable)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3191
  then obtain y where y: "\<And>e. e>0 \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3192
    by metis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3193
  define f where "f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse(2 ^ (Suc n))) (dist fn x)))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3194
  have [simp]: "f 0 = y 1"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3195
               "f(Suc n) = y (min (inverse(2 ^ (Suc n))) (dist (f n) x))" for n
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3196
    by (simp_all add: f_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3197
  have f: "f n \<in> S \<and> (f n \<noteq> x) \<and> dist (f n) x < inverse(2 ^ n)" for n
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3198
  proof (induction n)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3199
    case 0 show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3200
      by (simp add: y)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3201
  next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3202
    case (Suc n) then show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3203
      apply (auto simp: y)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3204
      by (metis half_gt_zero_iff inverse_positive_iff_positive less_divide_eq_numeral1(1) min_less_iff_conj y zero_less_dist_iff zero_less_numeral zero_less_power)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3205
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3206
  show ?rhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3207
  proof (rule_tac x=f in exI, intro conjI allI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3208
    show "\<And>n. f n \<in> S - {x}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3209
      using f by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3210
    have "dist (f n) x < dist (f m) x" if "m < n" for m n
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3211
    using that
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3212
    proof (induction n)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3213
      case 0 then show ?case by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3214
    next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3215
      case (Suc n)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3216
      then consider "m < n" | "m = n" using less_Suc_eq by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3217
      then show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3218
      proof cases
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3219
        assume "m < n"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3220
        have "dist (f(Suc n)) x = dist (y (min (inverse(2 ^ (Suc n))) (dist (f n) x))) x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3221
          by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3222
        also have "... < dist (f n) x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3223
          by (metis dist_pos_lt f min.strict_order_iff min_less_iff_conj y)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3224
        also have "... < dist (f m) x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3225
          using Suc.IH \<open>m < n\<close> by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3226
        finally show ?thesis .
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3227
      next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3228
        assume "m = n" then show ?case
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3229
          by simp (metis dist_pos_lt f half_gt_zero_iff inverse_positive_iff_positive min_less_iff_conj y zero_less_numeral zero_less_power)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3230
      qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3231
    qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3232
    then show "inj f"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3233
      by (metis less_irrefl linorder_injI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3234
    show "f \<longlonglongrightarrow> x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3235
      apply (rule tendstoI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3236
      apply (rule_tac c="nat (ceiling(1/e))" in eventually_sequentiallyI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3237
      apply (rule less_trans [OF f [THEN conjunct2, THEN conjunct2]])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3238
      apply (simp add: field_simps)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3239
      by (meson le_less_trans mult_less_cancel_left not_le of_nat_less_two_power)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3240
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3241
next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3242
  assume ?rhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3243
  then show ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3244
    by (fastforce simp add: islimpt_approachable lim_sequentially)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3245
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3246
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  3247
(*could prove directly from islimpt_sequential_inj, but only for metric spaces*)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3248
lemma islimpt_sequential:
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3249
  fixes x :: "'a::first_countable_topology"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3250
  shows "x islimpt S \<longleftrightarrow> (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> (f \<longlongrightarrow> x) sequentially)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3251
    (is "?lhs = ?rhs")
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3252
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3253
  assume ?lhs
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3254
  from countable_basis_at_decseq[of x] obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3255
      "\<And>i. open (A i)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3256
      "\<And>i. x \<in> A i"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3257
      "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  3258
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3259
  define f where "f n = (SOME y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y)" for n
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3260
  {
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3261
    fix n
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3262
    from \<open>?lhs\<close> have "\<exists>y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3263
      unfolding islimpt_def using A(1,2)[of n] by auto
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3264
    then have "f n \<in> S \<and> f n \<in> A n \<and> x \<noteq> f n"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3265
      unfolding f_def by (rule someI_ex)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3266
    then have "f n \<in> S" "f n \<in> A n" "x \<noteq> f n" by auto
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3267
  }
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3268
  then have "\<forall>n. f n \<in> S - {x}" by auto
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  3269
  moreover have "(\<lambda>n. f n) \<longlonglongrightarrow> x"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3270
  proof (rule topological_tendstoI)
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3271
    fix S
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3272
    assume "open S" "x \<in> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3273
    from A(3)[OF this] \<open>\<And>n. f n \<in> A n\<close>
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3274
    show "eventually (\<lambda>x. f x \<in> S) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  3275
      by (auto elim!: eventually_mono)
44584
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  3276
  qed
08ad27488983 simplify some proofs
huffman
parents: 44571
diff changeset
  3277
  ultimately show ?rhs by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3278
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3279
  assume ?rhs
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  3280
  then obtain f :: "nat \<Rightarrow> 'a" where f: "\<And>n. f n \<in> S - {x}" and lim: "f \<longlonglongrightarrow> x"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3281
    by auto
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3282
  show ?lhs
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3283
    unfolding islimpt_def
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3284
  proof safe
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3285
    fix T
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3286
    assume "open T" "x \<in> T"
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3287
    from lim[THEN topological_tendstoD, OF this] f
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3288
    show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x"
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3289
      unfolding eventually_sequentially by auto
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3290
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3291
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3292
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3293
lemma Lim_null:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3294
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3295
  shows "(f \<longlongrightarrow> l) net \<longleftrightarrow> ((\<lambda>x. f(x) - l) \<longlongrightarrow> 0) net"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3296
  by (simp add: Lim dist_norm)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3297
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3298
lemma Lim_null_comparison:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3299
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3300
  assumes "eventually (\<lambda>x. norm (f x) \<le> g x) net" "(g \<longlongrightarrow> 0) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3301
  shows "(f \<longlongrightarrow> 0) net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3302
  using assms(2)
44252
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  3303
proof (rule metric_tendsto_imp_tendsto)
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  3304
  show "eventually (\<lambda>x. dist (f x) 0 \<le> dist (g x) 0) net"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  3305
    using assms(1) by (rule eventually_mono) (simp add: dist_norm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3306
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3307
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3308
lemma Lim_transform_bound:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3309
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3310
    and g :: "'a \<Rightarrow> 'c::real_normed_vector"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3311
  assumes "eventually (\<lambda>n. norm (f n) \<le> norm (g n)) net"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3312
    and "(g \<longlongrightarrow> 0) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3313
  shows "(f \<longlongrightarrow> 0) net"
44252
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  3314
  using assms(1) tendsto_norm_zero [OF assms(2)]
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  3315
  by (rule Lim_null_comparison)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3316
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3317
lemma lim_null_mult_right_bounded:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3318
  fixes f :: "'a \<Rightarrow> 'b::real_normed_div_algebra"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3319
  assumes f: "(f \<longlongrightarrow> 0) F" and g: "eventually (\<lambda>x. norm(g x) \<le> B) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3320
    shows "((\<lambda>z. f z * g z) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3321
proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3322
  have *: "((\<lambda>x. norm (f x) * B) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3323
    by (simp add: f tendsto_mult_left_zero tendsto_norm_zero)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3324
  have "((\<lambda>x. norm (f x) * norm (g x)) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3325
    apply (rule Lim_null_comparison [OF _ *])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3326
    apply (simp add: eventually_mono [OF g] mult_left_mono)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3327
    done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3328
  then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3329
    by (subst tendsto_norm_zero_iff [symmetric]) (simp add: norm_mult)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3330
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3331
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3332
lemma lim_null_mult_left_bounded:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3333
  fixes f :: "'a \<Rightarrow> 'b::real_normed_div_algebra"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3334
  assumes g: "eventually (\<lambda>x. norm(g x) \<le> B) F" and f: "(f \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3335
    shows "((\<lambda>z. g z * f z) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3336
proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3337
  have *: "((\<lambda>x. B * norm (f x)) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3338
    by (simp add: f tendsto_mult_right_zero tendsto_norm_zero)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3339
  have "((\<lambda>x. norm (g x) * norm (f x)) \<longlongrightarrow> 0) F"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3340
    apply (rule Lim_null_comparison [OF _ *])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3341
    apply (simp add: eventually_mono [OF g] mult_right_mono)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3342
    done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3343
  then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3344
    by (subst tendsto_norm_zero_iff [symmetric]) (simp add: norm_mult)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3345
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  3346
63128
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3347
lemma lim_null_scaleR_bounded:
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3348
  assumes f: "(f \<longlongrightarrow> 0) net" and gB: "eventually (\<lambda>a. f a = 0 \<or> norm(g a) \<le> B) net"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3349
    shows "((\<lambda>n. f n *\<^sub>R g n) \<longlongrightarrow> 0) net"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3350
proof
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3351
  fix \<epsilon>::real
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3352
  assume "0 < \<epsilon>"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3353
  then have B: "0 < \<epsilon> / (abs B + 1)" by simp
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3354
  have *: "\<bar>f x\<bar> * norm (g x) < \<epsilon>" if f: "\<bar>f x\<bar> * (\<bar>B\<bar> + 1) < \<epsilon>" and g: "norm (g x) \<le> B" for x
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3355
  proof -
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3356
    have "\<bar>f x\<bar> * norm (g x) \<le> \<bar>f x\<bar> * B"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3357
      by (simp add: mult_left_mono g)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3358
    also have "... \<le> \<bar>f x\<bar> * (\<bar>B\<bar> + 1)"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3359
      by (simp add: mult_left_mono)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3360
    also have "... < \<epsilon>"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3361
      by (rule f)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3362
    finally show ?thesis .
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3363
  qed
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3364
  show "\<forall>\<^sub>F x in net. dist (f x *\<^sub>R g x) 0 < \<epsilon>"
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3365
    apply (rule eventually_mono [OF eventually_conj [OF tendstoD [OF f B] gB] ])
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3366
    apply (auto simp: \<open>0 < \<epsilon>\<close> divide_simps * split: if_split_asm)
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3367
    done
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3368
qed
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  3369
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3370
text\<open>Deducing things about the limit from the elements.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3371
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3372
lemma Lim_in_closed_set:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3373
  assumes "closed S"
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3374
    and "eventually (\<lambda>x. f(x) \<in> S) net"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3375
    and "\<not> trivial_limit net" "(f \<longlongrightarrow> l) net"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3376
  shows "l \<in> S"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3377
proof (rule ccontr)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3378
  assume "l \<notin> S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3379
  with \<open>closed S\<close> have "open (- S)" "l \<in> - S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3380
    by (simp_all add: open_Compl)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3381
  with assms(4) have "eventually (\<lambda>x. f x \<in> - S) net"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3382
    by (rule topological_tendstoD)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3383
  with assms(2) have "eventually (\<lambda>x. False) net"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3384
    by (rule eventually_elim2) simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3385
  with assms(3) show "False"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3386
    by (simp add: eventually_False)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3387
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3388
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3389
text\<open>Need to prove closed(cball(x,e)) before deducing this as a corollary.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3390
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3391
lemma Lim_dist_ubound:
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3392
  assumes "\<not>(trivial_limit net)"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3393
    and "(f \<longlongrightarrow> l) net"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3394
    and "eventually (\<lambda>x. dist a (f x) \<le> e) net"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3395
  shows "dist a l \<le> e"
56290
801a72ad52d3 tuned proofs
huffman
parents: 56189
diff changeset
  3396
  using assms by (fast intro: tendsto_le tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3397
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3398
lemma Lim_norm_ubound:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3399
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3400
  assumes "\<not>(trivial_limit net)" "(f \<longlongrightarrow> l) net" "eventually (\<lambda>x. norm(f x) \<le> e) net"
53255
addd7b9b2bff tuned proofs;
wenzelm
parents: 53015
diff changeset
  3401
  shows "norm(l) \<le> e"
56290
801a72ad52d3 tuned proofs
huffman
parents: 56189
diff changeset
  3402
  using assms by (fast intro: tendsto_le tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3403
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3404
lemma Lim_norm_lbound:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3405
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3406
  assumes "\<not> trivial_limit net"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3407
    and "(f \<longlongrightarrow> l) net"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3408
    and "eventually (\<lambda>x. e \<le> norm (f x)) net"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3409
  shows "e \<le> norm l"
56290
801a72ad52d3 tuned proofs
huffman
parents: 56189
diff changeset
  3410
  using assms by (fast intro: tendsto_le tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3411
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3412
text\<open>Limit under bilinear function\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3413
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3414
lemma Lim_bilinear:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3415
  assumes "(f \<longlongrightarrow> l) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3416
    and "(g \<longlongrightarrow> m) net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3417
    and "bounded_bilinear h"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3418
  shows "((\<lambda>x. h (f x) (g x)) \<longlongrightarrow> (h l m)) net"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3419
  using \<open>bounded_bilinear h\<close> \<open>(f \<longlongrightarrow> l) net\<close> \<open>(g \<longlongrightarrow> m) net\<close>
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3420
  by (rule bounded_bilinear.tendsto)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3421
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3422
text\<open>These are special for limits out of the same vector space.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3423
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3424
lemma Lim_within_id: "(id \<longlongrightarrow> a) (at a within s)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3425
  unfolding id_def by (rule tendsto_ident_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3426
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3427
lemma Lim_at_id: "(id \<longlongrightarrow> a) (at a)"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  3428
  unfolding id_def by (rule tendsto_ident_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3429
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3430
lemma Lim_at_zero:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3431
  fixes a :: "'a::real_normed_vector"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3432
    and l :: "'b::topological_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3433
  shows "(f \<longlongrightarrow> l) (at a) \<longleftrightarrow> ((\<lambda>x. f(a + x)) \<longlongrightarrow> l) (at 0)"
44252
10362a07eb7c Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents: 44250
diff changeset
  3434
  using LIM_offset_zero LIM_offset_zero_cancel ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3435
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3436
text\<open>It's also sometimes useful to extract the limit point from the filter.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3437
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3438
abbreviation netlimit :: "'a::t2_space filter \<Rightarrow> 'a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3439
  where "netlimit F \<equiv> Lim F (\<lambda>x. x)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3440
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3441
lemma netlimit_within: "\<not> trivial_limit (at a within S) \<Longrightarrow> netlimit (at a within S) = a"
51365
6b5250100db8 netlimit is abbreviation for Lim
hoelzl
parents: 51364
diff changeset
  3442
  by (rule tendsto_Lim) (auto intro: tendsto_intros)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3443
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3444
lemma netlimit_at:
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  3445
  fixes a :: "'a::{perfect_space,t2_space}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3446
  shows "netlimit (at a) = a"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  3447
  using netlimit_within [of a UNIV] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3448
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3449
lemma lim_within_interior:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3450
  "x \<in> interior S \<Longrightarrow> (f \<longlongrightarrow> l) (at x within S) \<longleftrightarrow> (f \<longlongrightarrow> l) (at x)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  3451
  by (metis at_within_interior)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3452
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3453
lemma netlimit_within_interior:
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3454
  fixes x :: "'a::{t2_space,perfect_space}"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3455
  assumes "x \<in> interior S"
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3456
  shows "netlimit (at x within S) = x"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3457
  using assms by (metis at_within_interior netlimit_at)
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  3458
61824
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3459
lemma netlimit_at_vector:
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3460
  fixes a :: "'a::real_normed_vector"
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3461
  shows "netlimit (at a) = a"
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3462
proof (cases "\<exists>x. x \<noteq> a")
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3463
  case True then obtain x where x: "x \<noteq> a" ..
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3464
  have "\<not> trivial_limit (at a)"
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3465
    unfolding trivial_limit_def eventually_at dist_norm
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3466
    apply clarsimp
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3467
    apply (rule_tac x="a + scaleR (d / 2) (sgn (x - a))" in exI)
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3468
    apply (simp add: norm_sgn sgn_zero_iff x)
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3469
    done
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3470
  then show ?thesis
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3471
    by (rule netlimit_within [of a UNIV])
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3472
qed simp
dcbe9f756ae0 not_leE -> not_le_imp_less and other tidying
paulson <lp15@cam.ac.uk>
parents: 61810
diff changeset
  3473
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3474
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3475
text\<open>Useful lemmas on closure and set of possible sequential limits.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3476
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3477
lemma closure_sequential:
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3478
  fixes l :: "'a::first_countable_topology"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3479
  shows "l \<in> closure S \<longleftrightarrow> (\<exists>x. (\<forall>n. x n \<in> S) \<and> (x \<longlongrightarrow> l) sequentially)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3480
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3481
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3482
  assume "?lhs"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3483
  moreover
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3484
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3485
    assume "l \<in> S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3486
    then have "?rhs" using tendsto_const[of l sequentially] by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3487
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3488
  moreover
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3489
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3490
    assume "l islimpt S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3491
    then have "?rhs" unfolding islimpt_sequential by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3492
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3493
  ultimately show "?rhs"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3494
    unfolding closure_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3495
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3496
  assume "?rhs"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3497
  then show "?lhs" unfolding closure_def islimpt_sequential by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3498
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3499
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3500
lemma closed_sequential_limits:
50883
1421884baf5b introduce first_countable_topology typeclass
hoelzl
parents: 50882
diff changeset
  3501
  fixes S :: "'a::first_countable_topology set"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3502
  shows "closed S \<longleftrightarrow> (\<forall>x l. (\<forall>n. x n \<in> S) \<and> (x \<longlongrightarrow> l) sequentially \<longrightarrow> l \<in> S)"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  3503
by (metis closure_sequential closure_subset_eq subset_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3504
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3505
lemma closure_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3506
  fixes S :: "'a::metric_space set"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3507
  shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3508
  apply (auto simp add: closure_def islimpt_approachable)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3509
  apply (metis dist_self)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3510
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3511
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3512
lemma closed_approachable:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3513
  fixes S :: "'a::metric_space set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3514
  shows "closed S \<Longrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) \<longleftrightarrow> x \<in> S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3515
  by (metis closure_closed closure_approachable)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3516
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3517
lemma closure_contains_Inf:
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3518
  fixes S :: "real set"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3519
  assumes "S \<noteq> {}" "bdd_below S"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3520
  shows "Inf S \<in> closure S"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3521
proof -
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3522
  have *: "\<forall>x\<in>S. Inf S \<le> x"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3523
    using cInf_lower[of _ S] assms by metis
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3524
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3525
    fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3526
    assume "e > 0"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3527
    then have "Inf S < Inf S + e" by simp
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3528
    with assms obtain x where "x \<in> S" "x < Inf S + e"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3529
      by (subst (asm) cInf_less_iff) auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3530
    with * have "\<exists>x\<in>S. dist x (Inf S) < e"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3531
      by (intro bexI[of _ x]) (auto simp add: dist_real_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3532
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3533
  then show ?thesis unfolding closure_approachable by auto
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3534
qed
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3535
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3536
lemma closed_contains_Inf:
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3537
  fixes S :: "real set"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3538
  shows "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> closed S \<Longrightarrow> Inf S \<in> S"
63092
a949b2a5f51d eliminated use of empty "assms";
wenzelm
parents: 63075
diff changeset
  3539
  by (metis closure_contains_Inf closure_closed)
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3540
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3541
lemma closed_subset_contains_Inf:
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3542
  fixes A C :: "real set"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3543
  shows "closed C \<Longrightarrow> A \<subseteq> C \<Longrightarrow> A \<noteq> {} \<Longrightarrow> bdd_below A \<Longrightarrow> Inf A \<in> C"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3544
  by (metis closure_contains_Inf closure_minimal subset_eq)
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3545
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3546
lemma atLeastAtMost_subset_contains_Inf:
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3547
  fixes A :: "real set" and a b :: real
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3548
  shows "A \<noteq> {} \<Longrightarrow> a \<le> b \<Longrightarrow> A \<subseteq> {a..b} \<Longrightarrow> Inf A \<in> {a..b}"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3549
  by (rule closed_subset_contains_Inf)
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3550
     (auto intro: closed_real_atLeastAtMost intro!: bdd_belowI[of A a])
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 62049
diff changeset
  3551
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3552
lemma not_trivial_limit_within_ball:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3553
  "\<not> trivial_limit (at x within S) \<longleftrightarrow> (\<forall>e>0. S \<inter> ball x e - {x} \<noteq> {})"
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3554
  (is "?lhs \<longleftrightarrow> ?rhs")
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3555
proof
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3556
  show ?rhs if ?lhs
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3557
  proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3558
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3559
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3560
      assume "e > 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3561
      then obtain y where "y \<in> S - {x}" and "dist y x < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3562
        using \<open>?lhs\<close> not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"]
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3563
        by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3564
      then have "y \<in> S \<inter> ball x e - {x}"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3565
        unfolding ball_def by (simp add: dist_commute)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3566
      then have "S \<inter> ball x e - {x} \<noteq> {}" by blast
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3567
    }
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3568
    then show ?thesis by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3569
  qed
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3570
  show ?lhs if ?rhs
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3571
  proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3572
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3573
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3574
      assume "e > 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3575
      then obtain y where "y \<in> S \<inter> ball x e - {x}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3576
        using \<open>?rhs\<close> by blast
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3577
      then have "y \<in> S - {x}" and "dist y x < e"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3578
        unfolding ball_def by (simp_all add: dist_commute)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3579
      then have "\<exists>y \<in> S - {x}. dist y x < e"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3580
        by auto
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3581
    }
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3582
    then show ?thesis
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3583
      using not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3584
      by auto
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3585
  qed
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3586
qed
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  3587
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3588
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3589
subsection \<open>Infimum Distance\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3590
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3591
definition "infdist x A = (if A = {} then 0 else INF a:A. dist x a)"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3592
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3593
lemma bdd_below_infdist[intro, simp]: "bdd_below (dist x`A)"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3594
  by (auto intro!: zero_le_dist)
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3595
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3596
lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = (INF a:A. dist x a)"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3597
  by (simp add: infdist_def)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3598
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3599
lemma infdist_nonneg: "0 \<le> infdist x A"
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3600
  by (auto simp add: infdist_def intro: cINF_greatest)
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3601
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3602
lemma infdist_le: "a \<in> A \<Longrightarrow> infdist x A \<le> dist x a"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3603
  by (auto intro: cINF_lower simp add: infdist_def)
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3604
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3605
lemma infdist_le2: "a \<in> A \<Longrightarrow> dist x a \<le> d \<Longrightarrow> infdist x A \<le> d"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3606
  by (auto intro!: cINF_lower2 simp add: infdist_def)
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3607
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3608
lemma infdist_zero[simp]: "a \<in> A \<Longrightarrow> infdist a A = 0"
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3609
  by (auto intro!: antisym infdist_nonneg infdist_le2)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3610
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3611
lemma infdist_triangle: "infdist x A \<le> infdist y A + dist x y"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3612
proof (cases "A = {}")
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3613
  case True
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3614
  then show ?thesis by (simp add: infdist_def)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3615
next
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3616
  case False
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3617
  then obtain a where "a \<in> A" by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3618
  have "infdist x A \<le> Inf {dist x y + dist y a |a. a \<in> A}"
51475
ebf9d4fd00ba introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents: 51473
diff changeset
  3619
  proof (rule cInf_greatest)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3620
    from \<open>A \<noteq> {}\<close> show "{dist x y + dist y a |a. a \<in> A} \<noteq> {}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3621
      by simp
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3622
    fix d
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3623
    assume "d \<in> {dist x y + dist y a |a. a \<in> A}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3624
    then obtain a where d: "d = dist x y + dist y a" "a \<in> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3625
      by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3626
    show "infdist x A \<le> d"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3627
      unfolding infdist_notempty[OF \<open>A \<noteq> {}\<close>]
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3628
    proof (rule cINF_lower2)
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3629
      show "a \<in> A" by fact
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3630
      show "dist x a \<le> d"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3631
        unfolding d by (rule dist_triangle)
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  3632
    qed simp
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3633
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3634
  also have "\<dots> = dist x y + infdist y A"
51475
ebf9d4fd00ba introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents: 51473
diff changeset
  3635
  proof (rule cInf_eq, safe)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3636
    fix a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3637
    assume "a \<in> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3638
    then show "dist x y + infdist y A \<le> dist x y + dist y a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3639
      by (auto intro: infdist_le)
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3640
  next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3641
    fix i
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3642
    assume inf: "\<And>d. d \<in> {dist x y + dist y a |a. a \<in> A} \<Longrightarrow> i \<le> d"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3643
    then have "i - dist x y \<le> infdist y A"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3644
      unfolding infdist_notempty[OF \<open>A \<noteq> {}\<close>] using \<open>a \<in> A\<close>
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3645
      by (intro cINF_greatest) (auto simp: field_simps)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3646
    then show "i \<le> dist x y + infdist y A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3647
      by simp
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3648
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3649
  finally show ?thesis by simp
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3650
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3651
51475
ebf9d4fd00ba introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents: 51473
diff changeset
  3652
lemma in_closure_iff_infdist_zero:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3653
  assumes "A \<noteq> {}"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3654
  shows "x \<in> closure A \<longleftrightarrow> infdist x A = 0"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3655
proof
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3656
  assume "x \<in> closure A"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3657
  show "infdist x A = 0"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3658
  proof (rule ccontr)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3659
    assume "infdist x A \<noteq> 0"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3660
    with infdist_nonneg[of x A] have "infdist x A > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3661
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3662
    then have "ball x (infdist x A) \<inter> closure A = {}"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3663
      apply auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3664
      apply (metis \<open>x \<in> closure A\<close> closure_approachable dist_commute infdist_le not_less)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3665
      done
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3666
    then have "x \<notin> closure A"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3667
      by (metis \<open>0 < infdist x A\<close> centre_in_ball disjoint_iff_not_equal)
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3668
    then show False using \<open>x \<in> closure A\<close> by simp
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3669
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3670
next
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3671
  assume x: "infdist x A = 0"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3672
  then obtain a where "a \<in> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3673
    by atomize_elim (metis all_not_in_conv assms)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3674
  show "x \<in> closure A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3675
    unfolding closure_approachable
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3676
    apply safe
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3677
  proof (rule ccontr)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3678
    fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3679
    assume "e > 0"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3680
    assume "\<not> (\<exists>y\<in>A. dist y x < e)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3681
    then have "infdist x A \<ge> e" using \<open>a \<in> A\<close>
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3682
      unfolding infdist_def
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  3683
      by (force simp: dist_commute intro: cINF_greatest)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3684
    with x \<open>e > 0\<close> show False by auto
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3685
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3686
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3687
51475
ebf9d4fd00ba introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents: 51473
diff changeset
  3688
lemma in_closed_iff_infdist_zero:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3689
  assumes "closed A" "A \<noteq> {}"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3690
  shows "x \<in> A \<longleftrightarrow> infdist x A = 0"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3691
proof -
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3692
  have "x \<in> closure A \<longleftrightarrow> infdist x A = 0"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3693
    by (rule in_closure_iff_infdist_zero) fact
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3694
  with assms show ?thesis by simp
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3695
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3696
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3697
lemma tendsto_infdist [tendsto_intros]:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3698
  assumes f: "(f \<longlongrightarrow> l) F"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3699
  shows "((\<lambda>x. infdist (f x) A) \<longlongrightarrow> infdist l A) F"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3700
proof (rule tendstoI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3701
  fix e ::real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3702
  assume "e > 0"
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3703
  from tendstoD[OF f this]
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3704
  show "eventually (\<lambda>x. dist (infdist (f x) A) (infdist l A) < e) F"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3705
  proof (eventually_elim)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3706
    fix x
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3707
    from infdist_triangle[of l A "f x"] infdist_triangle[of "f x" A l]
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3708
    have "dist (infdist (f x) A) (infdist l A) \<le> dist (f x) l"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3709
      by (simp add: dist_commute dist_real_def)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3710
    also assume "dist (f x) l < e"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3711
    finally show "dist (infdist (f x) A) (infdist l A) < e" .
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3712
  qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3713
qed
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  3714
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3715
text\<open>Some other lemmas about sequences.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3716
53597
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3717
lemma sequentially_offset: (* TODO: move to Topological_Spaces.thy *)
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  3718
  assumes "eventually (\<lambda>i. P i) sequentially"
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  3719
  shows "eventually (\<lambda>i. P (i + k)) sequentially"
53597
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3720
  using assms by (rule eventually_sequentially_seg [THEN iffD2])
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3721
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3722
lemma seq_offset_neg: (* TODO: move to Topological_Spaces.thy *)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3723
  "(f \<longlongrightarrow> l) sequentially \<Longrightarrow> ((\<lambda>i. f(i - k)) \<longlongrightarrow> l) sequentially"
53597
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3724
  apply (erule filterlim_compose)
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3725
  apply (simp add: filterlim_def le_sequentially eventually_filtermap eventually_sequentially)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3726
  apply arith
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3727
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3728
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  3729
lemma seq_harmonic: "((\<lambda>n. inverse (real n)) \<longlongrightarrow> 0) sequentially"
53597
ea99a7964174 remove duplicate lemmas
huffman
parents: 53374
diff changeset
  3730
  using LIMSEQ_inverse_real_of_nat by (rule LIMSEQ_imp_Suc) (* TODO: move to Limits.thy *)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3731
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3732
subsection \<open>More properties of closed balls\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3733
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 61076
diff changeset
  3734
lemma closed_cball [iff]: "closed (cball x e)"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  3735
proof -
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  3736
  have "closed (dist x -` {..e})"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  3737
    by (intro closed_vimage closed_atMost continuous_intros)
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  3738
  also have "dist x -` {..e} = cball x e"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  3739
    by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  3740
  finally show ?thesis .
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  3741
qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3742
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3743
lemma open_contains_cball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0.  cball x e \<subseteq> S)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3744
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3745
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3746
    fix x and e::real
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3747
    assume "x\<in>S" "e>0" "ball x e \<subseteq> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3748
    then have "\<exists>d>0. cball x d \<subseteq> S" unfolding subset_eq by (rule_tac x="e/2" in exI, auto)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3749
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3750
  moreover
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3751
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3752
    fix x and e::real
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3753
    assume "x\<in>S" "e>0" "cball x e \<subseteq> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3754
    then have "\<exists>d>0. ball x d \<subseteq> S"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3755
      unfolding subset_eq
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3756
      apply(rule_tac x="e/2" in exI)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3757
      apply auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3758
      done
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3759
  }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3760
  ultimately show ?thesis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3761
    unfolding open_contains_ball by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3762
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3763
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3764
lemma open_contains_cball_eq: "open S \<Longrightarrow> (\<forall>x. x \<in> S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S))"
44170
510ac30f44c0 make Multivariate_Analysis work with separate set type
huffman
parents: 44167
diff changeset
  3765
  by (metis open_contains_cball subset_eq order_less_imp_le centre_in_cball)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3766
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3767
lemma mem_interior_cball: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3768
  apply (simp add: interior_def, safe)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3769
  apply (force simp add: open_contains_cball)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3770
  apply (rule_tac x="ball x e" in exI)
36362
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
  3771
  apply (simp add: subset_trans [OF ball_subset_cball])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3772
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3773
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3774
lemma islimpt_ball:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3775
  fixes x y :: "'a::{real_normed_vector,perfect_space}"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  3776
  shows "y islimpt ball x e \<longleftrightarrow> 0 < e \<and> y \<in> cball x e"
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3777
  (is "?lhs \<longleftrightarrow> ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3778
proof
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3779
  show ?rhs if ?lhs
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3780
  proof
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3781
    {
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3782
      assume "e \<le> 0"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3783
      then have *: "ball x e = {}"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3784
        using ball_eq_empty[of x e] by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3785
      have False using \<open>?lhs\<close>
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3786
        unfolding * using islimpt_EMPTY[of y] by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3787
    }
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3788
    then show "e > 0" by (metis not_less)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3789
    show "y \<in> cball x e"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3790
      using closed_cball[of x e] islimpt_subset[of y "ball x e" "cball x e"]
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3791
        ball_subset_cball[of x e] \<open>?lhs\<close>
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3792
      unfolding closed_limpt by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3793
  qed
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3794
  show ?lhs if ?rhs
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3795
  proof -
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3796
    from that have "e > 0" by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3797
    {
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3798
      fix d :: real
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3799
      assume "d > 0"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3800
      have "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3801
      proof (cases "d \<le> dist x y")
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3802
        case True
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3803
        then show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d"
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3804
        proof (cases "x = y")
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3805
          case True
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3806
          then have False
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3807
            using \<open>d \<le> dist x y\<close> \<open>d>0\<close> by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3808
          then show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3809
            by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3810
        next
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3811
          case False
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3812
          have "dist x (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) =
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3813
            norm (x - y + (d / (2 * norm (y - x))) *\<^sub>R (y - x))"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3814
            unfolding mem_cball mem_ball dist_norm diff_diff_eq2 diff_add_eq[symmetric]
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3815
            by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3816
          also have "\<dots> = \<bar>- 1 + d / (2 * norm (x - y))\<bar> * norm (x - y)"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3817
            using scaleR_left_distrib[of "- 1" "d / (2 * norm (y - x))", symmetric, of "y - x"]
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3818
            unfolding scaleR_minus_left scaleR_one
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3819
            by (auto simp add: norm_minus_commute)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3820
          also have "\<dots> = \<bar>- norm (x - y) + d / 2\<bar>"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3821
            unfolding abs_mult_pos[of "norm (x - y)", OF norm_ge_zero[of "x - y"]]
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3822
            unfolding distrib_right using \<open>x\<noteq>y\<close>  by auto
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3823
          also have "\<dots> \<le> e - d/2" using \<open>d \<le> dist x y\<close> and \<open>d>0\<close> and \<open>?rhs\<close>
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3824
            by (auto simp add: dist_norm)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3825
          finally have "y - (d / (2 * dist y x)) *\<^sub>R (y - x) \<in> ball x e" using \<open>d>0\<close>
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3826
            by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3827
          moreover
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3828
          have "(d / (2*dist y x)) *\<^sub>R (y - x) \<noteq> 0"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3829
            using \<open>x\<noteq>y\<close>[unfolded dist_nz] \<open>d>0\<close> unfolding scaleR_eq_0_iff
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3830
            by (auto simp add: dist_commute)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3831
          moreover
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3832
          have "dist (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3833
            unfolding dist_norm
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3834
            apply simp
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3835
            unfolding norm_minus_cancel
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3836
            using \<open>d > 0\<close> \<open>x\<noteq>y\<close>[unfolded dist_nz] dist_commute[of x y]
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3837
            unfolding dist_norm
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3838
            apply auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3839
            done
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3840
          ultimately show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3841
            apply (rule_tac x = "y - (d / (2*dist y x)) *\<^sub>R (y - x)" in bexI)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3842
            apply auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3843
            done
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3844
        qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3845
      next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3846
        case False
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3847
        then have "d > dist x y" by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3848
        show "\<exists>x' \<in> ball x e. x' \<noteq> y \<and> dist x' y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3849
        proof (cases "x = y")
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3850
          case True
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3851
          obtain z where **: "z \<noteq> y" "dist z y < min e d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3852
            using perfect_choose_dist[of "min e d" y]
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3853
            using \<open>d > 0\<close> \<open>e>0\<close> by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3854
          show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3855
            unfolding \<open>x = y\<close>
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3856
            using \<open>z \<noteq> y\<close> **
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3857
            apply (rule_tac x=z in bexI)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3858
            apply (auto simp add: dist_commute)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3859
            done
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3860
        next
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3861
          case False
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3862
          then show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d"
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3863
            using \<open>d>0\<close> \<open>d > dist x y\<close> \<open>?rhs\<close>
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3864
            apply (rule_tac x=x in bexI)
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3865
            apply auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3866
            done
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3867
        qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3868
      qed
60462
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3869
    }
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3870
    then show ?thesis
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3871
      unfolding mem_cball islimpt_approachable mem_ball by auto
7c5e22e6b89f tuned proofs;
wenzelm
parents: 60420
diff changeset
  3872
  qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3873
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3874
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3875
lemma closure_ball_lemma:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3876
  fixes x y :: "'a::real_normed_vector"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3877
  assumes "x \<noteq> y"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3878
  shows "y islimpt ball x (dist x y)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3879
proof (rule islimptI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3880
  fix T
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3881
  assume "y \<in> T" "open T"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3882
  then obtain r where "0 < r" "\<forall>z. dist z y < r \<longrightarrow> z \<in> T"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3883
    unfolding open_dist by fast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3884
  (* choose point between x and y, within distance r of y. *)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3885
  define k where "k = min 1 (r / (2 * dist x y))"
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  3886
  define z where "z = y + scaleR k (x - y)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3887
  have z_def2: "z = x + scaleR (1 - k) (y - x)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3888
    unfolding z_def by (simp add: algebra_simps)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3889
  have "dist z y < r"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3890
    unfolding z_def k_def using \<open>0 < r\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3891
    by (simp add: dist_norm min_def)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3892
  then have "z \<in> T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3893
    using \<open>\<forall>z. dist z y < r \<longrightarrow> z \<in> T\<close> by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3894
  have "dist x z < dist x y"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3895
    unfolding z_def2 dist_norm
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3896
    apply (simp add: norm_minus_commute)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3897
    apply (simp only: dist_norm [symmetric])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3898
    apply (subgoal_tac "\<bar>1 - k\<bar> * dist x y < 1 * dist x y", simp)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3899
    apply (rule mult_strict_right_mono)
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3900
    apply (simp add: k_def \<open>0 < r\<close> \<open>x \<noteq> y\<close>)
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3901
    apply (simp add: \<open>x \<noteq> y\<close>)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3902
    done
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3903
  then have "z \<in> ball x (dist x y)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3904
    by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3905
  have "z \<noteq> y"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3906
    unfolding z_def k_def using \<open>x \<noteq> y\<close> \<open>0 < r\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3907
    by (simp add: min_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3908
  show "\<exists>z\<in>ball x (dist x y). z \<in> T \<and> z \<noteq> y"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3909
    using \<open>z \<in> ball x (dist x y)\<close> \<open>z \<in> T\<close> \<open>z \<noteq> y\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3910
    by fast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3911
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3912
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  3913
lemma closure_ball [simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3914
  fixes x :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3915
  shows "0 < e \<Longrightarrow> closure (ball x e) = cball x e"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3916
  apply (rule equalityI)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3917
  apply (rule closure_minimal)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3918
  apply (rule ball_subset_cball)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3919
  apply (rule closed_cball)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3920
  apply (rule subsetI, rename_tac y)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3921
  apply (simp add: le_less [where 'a=real])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3922
  apply (erule disjE)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3923
  apply (rule subsetD [OF closure_subset], simp)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3924
  apply (simp add: closure_def)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3925
  apply clarify
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3926
  apply (rule closure_ball_lemma)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3927
  apply (simp add: zero_less_dist_iff)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3928
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3929
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3930
(* In a trivial vector space, this fails for e = 0. *)
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  3931
lemma interior_cball [simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3932
  fixes x :: "'a::{real_normed_vector, perfect_space}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3933
  shows "interior (cball x e) = ball x e"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  3934
proof (cases "e \<ge> 0")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3935
  case False note cs = this
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3936
  from cs have null: "ball x e = {}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3937
    using ball_empty[of e x] by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3938
  moreover
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3939
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3940
    fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3941
    assume "y \<in> cball x e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3942
    then have False
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3943
      by (metis ball_eq_empty null cs dist_eq_0_iff dist_le_zero_iff empty_subsetI mem_cball subset_antisym subset_ball)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3944
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3945
  then have "cball x e = {}" by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3946
  then have "interior (cball x e) = {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3947
    using interior_empty by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3948
  ultimately show ?thesis by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3949
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3950
  case True note cs = this
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3951
  have "ball x e \<subseteq> cball x e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3952
    using ball_subset_cball by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3953
  moreover
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3954
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3955
    fix S y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3956
    assume as: "S \<subseteq> cball x e" "open S" "y\<in>S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3957
    then obtain d where "d>0" and d: "\<forall>x'. dist x' y < d \<longrightarrow> x' \<in> S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3958
      unfolding open_dist by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3959
    then obtain xa where xa_y: "xa \<noteq> y" and xa: "dist xa y < d"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3960
      using perfect_choose_dist [of d] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3961
    have "xa \<in> S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3962
      using d[THEN spec[where x = xa]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3963
      using xa by (auto simp add: dist_commute)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3964
    then have xa_cball: "xa \<in> cball x e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3965
      using as(1) by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3966
    then have "y \<in> ball x e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3967
    proof (cases "x = y")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3968
      case True
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  3969
      then have "e > 0" using cs order.order_iff_strict xa_cball xa_y by fastforce
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3970
      then show "y \<in> ball x e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3971
        using \<open>x = y \<close> by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3972
    next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3973
      case False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3974
      have "dist (y + (d / 2 / dist y x) *\<^sub>R (y - x)) y < d"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3975
        unfolding dist_norm
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3976
        using \<open>d>0\<close> norm_ge_zero[of "y - x"] \<open>x \<noteq> y\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3977
      then have *: "y + (d / 2 / dist y x) *\<^sub>R (y - x) \<in> cball x e"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3978
        using d as(1)[unfolded subset_eq] by blast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3979
      have "y - x \<noteq> 0" using \<open>x \<noteq> y\<close> by auto
56541
0e3abadbef39 made divide_pos_pos a simp rule
nipkow
parents: 56371
diff changeset
  3980
      hence **:"d / (2 * norm (y - x)) > 0"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3981
        unfolding zero_less_norm_iff[symmetric] using \<open>d>0\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3982
      have "dist (y + (d / 2 / dist y x) *\<^sub>R (y - x)) x =
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3983
        norm (y + (d / (2 * norm (y - x))) *\<^sub>R y - (d / (2 * norm (y - x))) *\<^sub>R x - x)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3984
        by (auto simp add: dist_norm algebra_simps)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3985
      also have "\<dots> = norm ((1 + d / (2 * norm (y - x))) *\<^sub>R (y - x))"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3986
        by (auto simp add: algebra_simps)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3987
      also have "\<dots> = \<bar>1 + d / (2 * norm (y - x))\<bar> * norm (y - x)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  3988
        using ** by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3989
      also have "\<dots> = (dist y x) + d/2"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3990
        using ** by (auto simp add: distrib_right dist_norm)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3991
      finally have "e \<ge> dist x y +d/2"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3992
        using *[unfolded mem_cball] by (auto simp add: dist_commute)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3993
      then show "y \<in> ball x e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  3994
        unfolding mem_ball using \<open>d>0\<close> by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3995
    qed
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3996
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3997
  then have "\<forall>S \<subseteq> cball x e. open S \<longrightarrow> S \<subseteq> ball x e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  3998
    by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  3999
  ultimately show ?thesis
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4000
    using interior_unique[of "ball x e" "cball x e"]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4001
    using open_ball[of x e]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4002
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4003
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4004
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4005
lemma interior_ball [simp]: "interior (ball x e) = ball x e"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4006
  by (simp add: interior_open)
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  4007
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4008
lemma frontier_ball [simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4009
  fixes a :: "'a::real_normed_vector"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4010
  shows "0 < e \<Longrightarrow> frontier (ball a e) = sphere a e"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4011
  by (force simp: frontier_def)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4012
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4013
lemma frontier_cball [simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4014
  fixes a :: "'a::{real_normed_vector, perfect_space}"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4015
  shows "frontier (cball a e) = sphere a e"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4016
  by (force simp: frontier_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4017
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4018
lemma cball_eq_empty [simp]: "cball x e = {} \<longleftrightarrow> e < 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
  4019
  apply (simp add: set_eq_iff not_le)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4020
  apply (metis zero_le_dist dist_self order_less_le_trans)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4021
  done
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4022
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4023
lemma cball_empty [simp]: "e < 0 \<Longrightarrow> cball x e = {}"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4024
  by (simp add: cball_eq_empty)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4025
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4026
lemma cball_eq_sing:
44072
5b970711fb39 class perfect_space inherits from topological_space;
huffman
parents: 43338
diff changeset
  4027
  fixes x :: "'a::{metric_space,perfect_space}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4028
  shows "cball x e = {x} \<longleftrightarrow> e = 0"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4029
proof (rule linorder_cases)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4030
  assume e: "0 < e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4031
  obtain a where "a \<noteq> x" "dist a x < e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4032
    using perfect_choose_dist [OF e] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4033
  then have "a \<noteq> x" "dist x a \<le> e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4034
    by (auto simp add: dist_commute)
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  4035
  with e show ?thesis by (auto simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4036
qed auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4037
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4038
lemma cball_sing:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4039
  fixes x :: "'a::metric_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4040
  shows "e = 0 \<Longrightarrow> cball x e = {x}"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  4041
  by (auto simp add: set_eq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4042
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4043
lemma ball_divide_subset: "d \<ge> 1 \<Longrightarrow> ball x (e/d) \<subseteq> ball x e"
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4044
  apply (cases "e \<le> 0")
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4045
  apply (simp add: ball_empty divide_simps)
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4046
  apply (rule subset_ball)
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4047
  apply (simp add: divide_simps)
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4048
  done
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4049
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4050
lemma ball_divide_subset_numeral: "ball x (e / numeral w) \<subseteq> ball x e"
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4051
  using ball_divide_subset one_le_numeral by blast
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4052
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4053
lemma cball_divide_subset: "d \<ge> 1 \<Longrightarrow> cball x (e/d) \<subseteq> cball x e"
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4054
  apply (cases "e < 0")
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4055
  apply (simp add: divide_simps)
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4056
  apply (rule subset_cball)
64240
eabf80376aab more standardized names
haftmann
parents: 64122
diff changeset
  4057
  apply (metis div_by_1 frac_le not_le order_refl zero_less_one)
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4058
  done
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4059
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4060
lemma cball_divide_subset_numeral: "cball x (e / numeral w) \<subseteq> cball x e"
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4061
  using cball_divide_subset one_le_numeral by blast
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
  4062
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  4063
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4064
subsection \<open>Boundedness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4065
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4066
  (* FIXME: This has to be unified with BSEQ!! *)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4067
definition (in metric_space) bounded :: "'a set \<Rightarrow> bool"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4068
  where "bounded S \<longleftrightarrow> (\<exists>x e. \<forall>y\<in>S. dist x y \<le> e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4069
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4070
lemma bounded_subset_cball: "bounded S \<longleftrightarrow> (\<exists>e x. S \<subseteq> cball x e \<and> 0 \<le> e)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4071
  unfolding bounded_def subset_eq  by auto (meson order_trans zero_le_dist)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4072
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4073
lemma bounded_any_center: "bounded S \<longleftrightarrow> (\<exists>e. \<forall>y\<in>S. dist a y \<le> e)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4074
  unfolding bounded_def
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57448
diff changeset
  4075
  by auto (metis add.commute add_le_cancel_right dist_commute dist_triangle_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4076
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4077
lemma bounded_iff: "bounded S \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. norm x \<le> a)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4078
  unfolding bounded_any_center [where a=0]
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4079
  by (simp add: dist_norm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4080
61552
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
  4081
lemma bdd_above_norm: "bdd_above (norm ` X) \<longleftrightarrow> bounded X"
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
  4082
  by (simp add: bounded_iff bdd_above_def)
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
  4083
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4084
lemma bounded_norm_comp: "bounded ((\<lambda>x. norm (f x)) ` S) = bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4085
  by (simp add: bounded_iff)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4086
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  4087
lemma boundedI:
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  4088
  assumes "\<And>x. x \<in> S \<Longrightarrow> norm x \<le> B"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  4089
  shows "bounded S"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64911
diff changeset
  4090
  using assms bounded_iff by blast
50104
de19856feb54 move theorems to be more generally useable
hoelzl
parents: 50094
diff changeset
  4091
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4092
lemma bounded_empty [simp]: "bounded {}"
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4093
  by (simp add: bounded_def)
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4094
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4095
lemma bounded_subset: "bounded T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> bounded S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4096
  by (metis bounded_def subset_eq)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4097
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4098
lemma bounded_interior[intro]: "bounded S \<Longrightarrow> bounded(interior S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4099
  by (metis bounded_subset interior_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4100
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4101
lemma bounded_closure[intro]:
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4102
  assumes "bounded S"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4103
  shows "bounded (closure S)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4104
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4105
  from assms obtain x and a where a: "\<forall>y\<in>S. dist x y \<le> a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4106
    unfolding bounded_def by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4107
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4108
    fix y
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4109
    assume "y \<in> closure S"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4110
    then obtain f where f: "\<forall>n. f n \<in> S"  "(f \<longlongrightarrow> y) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4111
      unfolding closure_sequential by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4112
    have "\<forall>n. f n \<in> S \<longrightarrow> dist x (f n) \<le> a" using a by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4113
    then have "eventually (\<lambda>n. dist x (f n) \<le> a) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  4114
      by (simp add: f(1))
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4115
    have "dist x y \<le> a"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4116
      apply (rule Lim_dist_ubound [of sequentially f])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4117
      apply (rule trivial_limit_sequentially)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4118
      apply (rule f(2))
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4119
      apply fact
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4120
      done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4121
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4122
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4123
    unfolding bounded_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4124
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4125
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4126
lemma bounded_closure_image: "bounded (f ` closure S) \<Longrightarrow> bounded (f ` S)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4127
  by (simp add: bounded_subset closure_subset image_mono)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4128
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4129
lemma bounded_cball[simp,intro]: "bounded (cball x e)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4130
  apply (simp add: bounded_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4131
  apply (rule_tac x=x in exI)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4132
  apply (rule_tac x=e in exI)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4133
  apply auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4134
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4135
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4136
lemma bounded_ball[simp,intro]: "bounded (ball x e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4137
  by (metis ball_subset_cball bounded_cball bounded_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4138
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4139
lemma bounded_Un[simp]: "bounded (S \<union> T) \<longleftrightarrow> bounded S \<and> bounded T"
63988
wenzelm
parents: 63967
diff changeset
  4140
  by (auto simp add: bounded_def) (metis Un_iff bounded_any_center le_max_iff_disj)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4141
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4142
lemma bounded_Union[intro]: "finite F \<Longrightarrow> \<forall>S\<in>F. bounded S \<Longrightarrow> bounded (\<Union>F)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4143
  by (induct rule: finite_induct[of F]) auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4144
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  4145
lemma bounded_UN [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. bounded (B x) \<Longrightarrow> bounded (\<Union>x\<in>A. B x)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4146
  by (induct set: finite) auto
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  4147
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4148
lemma bounded_insert [simp]: "bounded (insert x S) \<longleftrightarrow> bounded S"
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4149
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4150
  have "\<forall>y\<in>{x}. dist x y \<le> 0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4151
    by simp
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4152
  then have "bounded {x}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4153
    unfolding bounded_def by fast
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4154
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4155
    by (metis insert_is_Un bounded_Un)
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4156
qed
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4157
65587
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4158
lemma bounded_subset_ballI: "S \<subseteq> ball x r \<Longrightarrow> bounded S"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4159
  by (meson bounded_ball bounded_subset)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4160
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4161
lemma bounded_subset_ballD:
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4162
  assumes "bounded S" shows "\<exists>r. 0 < r \<and> S \<subseteq> ball x r"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4163
proof -
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4164
  obtain e::real and y where "S \<subseteq> cball y e"  "0 \<le> e"
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4165
    using assms by (auto simp: bounded_subset_cball)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4166
  then show ?thesis
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4167
    apply (rule_tac x="dist x y + e + 1" in exI)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4168
    apply (simp add: add.commute add_pos_nonneg)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4169
    apply (erule subset_trans)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4170
    apply (clarsimp simp add: cball_def)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4171
    by (metis add_le_cancel_right add_strict_increasing dist_commute dist_triangle_le zero_less_one)
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4172
qed
16a8991ab398 New material (and some tidying) purely in the Analysis directory
paulson <lp15@cam.ac.uk>
parents: 65585
diff changeset
  4173
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4174
lemma finite_imp_bounded [intro]: "finite S \<Longrightarrow> bounded S"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4175
  by (induct set: finite) simp_all
50948
8c742f9de9f5 generalize topology lemmas; simplify proofs
huffman
parents: 50944
diff changeset
  4176
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4177
lemma bounded_pos: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x \<le> b)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4178
  apply (simp add: bounded_iff)
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  4179
  apply (subgoal_tac "\<And>x (y::real). 0 < 1 + \<bar>y\<bar> \<and> (x \<le> y \<longrightarrow> x \<le> 1 + \<bar>y\<bar>)")
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4180
  apply metis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4181
  apply arith
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4182
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4183
60762
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  4184
lemma bounded_pos_less: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x < b)"
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  4185
  apply (simp add: bounded_pos)
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  4186
  apply (safe; rule_tac x="b+1" in exI; force)
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  4187
  done
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  4188
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4189
lemma Bseq_eq_bounded:
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4190
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4191
  shows "Bseq f \<longleftrightarrow> bounded (range f)"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  4192
  unfolding Bseq_def bounded_pos by auto
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  4193
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4194
lemma bounded_Int[intro]: "bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4195
  by (metis Int_lower1 Int_lower2 bounded_subset)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4196
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4197
lemma bounded_diff[intro]: "bounded S \<Longrightarrow> bounded (S - T)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4198
  by (metis Diff_subset bounded_subset)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4199
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  4200
lemma not_bounded_UNIV[simp]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4201
  "\<not> bounded (UNIV :: 'a::{real_normed_vector, perfect_space} set)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4202
proof (auto simp add: bounded_pos not_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4203
  obtain x :: 'a where "x \<noteq> 0"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4204
    using perfect_choose_dist [OF zero_less_one] by fast
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4205
  fix b :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4206
  assume b: "b >0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4207
  have b1: "b +1 \<ge> 0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4208
    using b by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4209
  with \<open>x \<noteq> 0\<close> have "b < norm (scaleR (b + 1) (sgn x))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4210
    by (simp add: norm_sgn)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4211
  then show "\<exists>x::'a. b < norm x" ..
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4212
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4213
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4214
corollary cobounded_imp_unbounded:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4215
    fixes S :: "'a::{real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4216
    shows "bounded (- S) \<Longrightarrow> ~ (bounded S)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4217
  using bounded_Un [of S "-S"]  by (simp add: sup_compl_top)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61424
diff changeset
  4218
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4219
lemma bounded_dist_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4220
  assumes "bounded (f ` S)" "bounded (g ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4221
  shows "bounded ((\<lambda>x. dist (f x) (g x)) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4222
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4223
  from assms obtain M1 M2 where *: "dist (f x) undefined \<le> M1" "dist undefined (g x) \<le> M2" if "x \<in> S" for x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4224
    by (auto simp: bounded_any_center[of _ undefined] dist_commute)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4225
  have "dist (f x) (g x) \<le> M1 + M2" if "x \<in> S" for x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4226
    using *[OF that]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4227
    by (rule order_trans[OF dist_triangle add_mono])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4228
  then show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4229
    by (auto intro!: boundedI)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4230
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4231
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4232
lemma bounded_linear_image:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4233
  assumes "bounded S"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4234
    and "bounded_linear f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4235
  shows "bounded (f ` S)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4236
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4237
  from assms(1) obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4238
    unfolding bounded_pos by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4239
  from assms(2) obtain B where B: "B > 0" "\<forall>x. norm (f x) \<le> B * norm x"
57514
bdc2c6b40bf2 prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents: 57512
diff changeset
  4240
    using bounded_linear.pos_bounded by (auto simp add: ac_simps)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4241
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4242
    fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4243
    assume "x \<in> S"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4244
    then have "norm x \<le> b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4245
      using b by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4246
    then have "norm (f x) \<le> B * b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4247
      using B(2)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4248
      apply (erule_tac x=x in allE)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4249
      apply (metis B(1) B(2) order_trans mult_le_cancel_left_pos)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4250
      done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4251
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4252
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4253
    unfolding bounded_pos
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4254
    apply (rule_tac x="b*B" in exI)
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57448
diff changeset
  4255
    using b B by (auto simp add: mult.commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4256
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4257
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4258
lemma bounded_scaling:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4259
  fixes S :: "'a::real_normed_vector set"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4260
  shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. c *\<^sub>R x) ` S)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4261
  apply (rule bounded_linear_image)
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4262
  apply assumption
44282
f0de18b62d63 remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents: 44252
diff changeset
  4263
  apply (rule bounded_linear_scaleR_right)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4264
  done
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4265
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4266
lemma bounded_scaleR_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4267
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4268
  assumes "bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4269
  shows "bounded ((\<lambda>x. r *\<^sub>R f x) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4270
  using bounded_scaling[of "f ` S" r] assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4271
  by (auto simp: image_image)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4272
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4273
lemma bounded_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4274
  fixes S :: "'a::real_normed_vector set"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4275
  assumes "bounded S"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4276
  shows "bounded ((\<lambda>x. a + x) ` S)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4277
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4278
  from assms obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4279
    unfolding bounded_pos by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4280
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4281
    fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4282
    assume "x \<in> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4283
    then have "norm (a + x) \<le> b + norm a"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4284
      using norm_triangle_ineq[of a x] b by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4285
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4286
  then show ?thesis
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4287
    unfolding bounded_pos
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4288
    using norm_ge_zero[of a] b(1) and add_strict_increasing[of b 0 "norm a"]
48048
87b94fb75198 remove stray reference to no-longer-existing theorem 'add'
huffman
parents: 47108
diff changeset
  4289
    by (auto intro!: exI[of _ "b + norm a"])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4290
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4291
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4292
lemma bounded_translation_minus:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4293
  fixes S :: "'a::real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4294
  shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. x - a) ` S)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4295
using bounded_translation [of S "-a"] by simp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4296
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4297
lemma bounded_uminus [simp]:
62466
87ca8b5145b8 generalized
immler
parents: 62397
diff changeset
  4298
  fixes X :: "'a::real_normed_vector set"
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4299
  shows "bounded (uminus ` X) \<longleftrightarrow> bounded X"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4300
by (auto simp: bounded_def dist_norm; rule_tac x="-x" in exI; force simp add: add.commute norm_minus_commute)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4301
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4302
lemma uminus_bounded_comp [simp]:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4303
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4304
  shows "bounded ((\<lambda>x. - f x) ` S) \<longleftrightarrow> bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4305
  using bounded_uminus[of "f ` S"]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4306
  by (auto simp: image_image)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4307
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4308
lemma bounded_plus_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4309
  fixes f g::"'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4310
  assumes "bounded (f ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4311
  assumes "bounded (g ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4312
  shows "bounded ((\<lambda>x. f x + g x) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4313
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4314
  {
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4315
    fix B C
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4316
    assume "\<And>x. x\<in>S \<Longrightarrow> norm (f x) \<le> B" "\<And>x. x\<in>S \<Longrightarrow> norm (g x) \<le> C"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4317
    then have "\<And>x. x \<in> S \<Longrightarrow> norm (f x + g x) \<le> B + C"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4318
      by (auto intro!: norm_triangle_le add_mono)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4319
  } then show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4320
    using assms by (fastforce simp: bounded_iff)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4321
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4322
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4323
lemma bounded_minus_comp:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4324
  "bounded (f ` S) \<Longrightarrow> bounded (g ` S) \<Longrightarrow> bounded ((\<lambda>x. f x - g x) ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4325
  for f g::"'a \<Rightarrow> 'b::real_normed_vector"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4326
  using bounded_plus_comp[of "f" S "\<lambda>x. - g x"]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4327
  by (auto simp: )
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
  4328
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4329
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4330
subsection\<open>Some theorems on sups and infs using the notion "bounded".\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4331
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4332
lemma bounded_real: "bounded (S::real set) \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. \<bar>x\<bar> \<le> a)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4333
  by (simp add: bounded_iff)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4334
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4335
lemma bounded_imp_bdd_above: "bounded S \<Longrightarrow> bdd_above (S :: real set)"
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4336
  by (auto simp: bounded_def bdd_above_def dist_real_def)
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4337
     (metis abs_le_D1 abs_minus_commute diff_le_eq)
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4338
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4339
lemma bounded_imp_bdd_below: "bounded S \<Longrightarrow> bdd_below (S :: real set)"
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4340
  by (auto simp: bounded_def bdd_below_def dist_real_def)
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57448
diff changeset
  4341
     (metis abs_le_D1 add.commute diff_le_eq)
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4342
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4343
lemma bounded_inner_imp_bdd_above:
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  4344
  assumes "bounded s"
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4345
    shows "bdd_above ((\<lambda>x. x \<bullet> a) ` s)"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4346
by (simp add: assms bounded_imp_bdd_above bounded_linear_image bounded_linear_inner_left)
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4347
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4348
lemma bounded_inner_imp_bdd_below:
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  4349
  assumes "bounded s"
60615
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4350
    shows "bdd_below ((\<lambda>x. x \<bullet> a) ` s)"
e5fa1d5d3952 Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents: 60585
diff changeset
  4351
by (simp add: assms bounded_imp_bdd_below bounded_linear_image bounded_linear_inner_left)
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4352
33270
paulson
parents: 33175
diff changeset
  4353
lemma bounded_has_Sup:
paulson
parents: 33175
diff changeset
  4354
  fixes S :: "real set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4355
  assumes "bounded S"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4356
    and "S \<noteq> {}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4357
  shows "\<forall>x\<in>S. x \<le> Sup S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4358
    and "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b"
33270
paulson
parents: 33175
diff changeset
  4359
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4360
  show "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4361
    using assms by (metis cSup_least)
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4362
qed (metis cSup_upper assms(1) bounded_imp_bdd_above)
33270
paulson
parents: 33175
diff changeset
  4363
paulson
parents: 33175
diff changeset
  4364
lemma Sup_insert:
paulson
parents: 33175
diff changeset
  4365
  fixes S :: "real set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4366
  shows "bounded S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))"
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4367
  by (auto simp: bounded_imp_bdd_above sup_max cSup_insert_If)
33270
paulson
parents: 33175
diff changeset
  4368
paulson
parents: 33175
diff changeset
  4369
lemma Sup_insert_finite:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4370
  fixes S :: "'a::conditionally_complete_linorder set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4371
  shows "finite S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4372
by (simp add: cSup_insert sup_max)
33270
paulson
parents: 33175
diff changeset
  4373
paulson
parents: 33175
diff changeset
  4374
lemma bounded_has_Inf:
paulson
parents: 33175
diff changeset
  4375
  fixes S :: "real set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4376
  assumes "bounded S"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4377
    and "S \<noteq> {}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4378
  shows "\<forall>x\<in>S. x \<ge> Inf S"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4379
    and "\<forall>b. (\<forall>x\<in>S. x \<ge> b) \<longrightarrow> Inf S \<ge> b"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4380
proof
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4381
  show "\<forall>b. (\<forall>x\<in>S. x \<ge> b) \<longrightarrow> Inf S \<ge> b"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4382
    using assms by (metis cInf_greatest)
54258
adfc759263ab use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents: 54230
diff changeset
  4383
qed (metis cInf_lower assms(1) bounded_imp_bdd_below)
33270
paulson
parents: 33175
diff changeset
  4384
paulson
parents: 33175
diff changeset
  4385
lemma Inf_insert:
paulson
parents: 33175
diff changeset
  4386
  fixes S :: "real set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4387
  shows "bounded S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))"
54259
71c701dc5bf9 add SUP and INF for conditionally complete lattices
hoelzl
parents: 54258
diff changeset
  4388
  by (auto simp: bounded_imp_bdd_below inf_min cInf_insert_If)
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4389
33270
paulson
parents: 33175
diff changeset
  4390
lemma Inf_insert_finite:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4391
  fixes S :: "'a::conditionally_complete_linorder set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4392
  shows "finite S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))"
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4393
by (simp add: cInf_eq_Min)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4394
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4395
lemma finite_imp_less_Inf:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4396
  fixes a :: "'a::conditionally_complete_linorder"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4397
  shows "\<lbrakk>finite X; x \<in> X; \<And>x. x\<in>X \<Longrightarrow> a < x\<rbrakk> \<Longrightarrow> a < Inf X"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4398
  by (induction X rule: finite_induct) (simp_all add: cInf_eq_Min Inf_insert_finite)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4399
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4400
lemma finite_less_Inf_iff:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4401
  fixes a :: "'a :: conditionally_complete_linorder"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4402
  shows "\<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> a < Inf X \<longleftrightarrow> (\<forall>x \<in> X. a < x)"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4403
  by (auto simp: cInf_eq_Min)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4404
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4405
lemma finite_imp_Sup_less:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4406
  fixes a :: "'a::conditionally_complete_linorder"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4407
  shows "\<lbrakk>finite X; x \<in> X; \<And>x. x\<in>X \<Longrightarrow> a > x\<rbrakk> \<Longrightarrow> a > Sup X"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4408
  by (induction X rule: finite_induct) (simp_all add: cSup_eq_Max Sup_insert_finite)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4409
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4410
lemma finite_Sup_less_iff:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4411
  fixes a :: "'a :: conditionally_complete_linorder"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4412
  shows "\<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> a > Sup X \<longleftrightarrow> (\<forall>x \<in> X. a > x)"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  4413
  by (auto simp: cSup_eq_Max)
33270
paulson
parents: 33175
diff changeset
  4414
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4415
subsection \<open>Compactness\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4416
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4417
subsubsection \<open>Bolzano-Weierstrass property\<close>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4418
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4419
lemma heine_borel_imp_bolzano_weierstrass:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4420
  assumes "compact s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4421
    and "infinite t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4422
    and "t \<subseteq> s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4423
  shows "\<exists>x \<in> s. x islimpt t"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4424
proof (rule ccontr)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4425
  assume "\<not> (\<exists>x \<in> s. x islimpt t)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4426
  then obtain f where f: "\<forall>x\<in>s. x \<in> f x \<and> open (f x) \<and> (\<forall>y\<in>t. y \<in> f x \<longrightarrow> y = x)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4427
    unfolding islimpt_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4428
    using bchoice[of s "\<lambda> x T. x \<in> T \<and> open T \<and> (\<forall>y\<in>t. y \<in> T \<longrightarrow> y = x)"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4429
    by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4430
  obtain g where g: "g \<subseteq> {t. \<exists>x. x \<in> s \<and> t = f x}" "finite g" "s \<subseteq> \<Union>g"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4431
    using assms(1)[unfolded compact_eq_heine_borel, THEN spec[where x="{t. \<exists>x. x\<in>s \<and> t = f x}"]]
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4432
    using f by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4433
  from g(1,3) have g':"\<forall>x\<in>g. \<exists>xa \<in> s. x = f xa"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4434
    by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4435
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4436
    fix x y
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4437
    assume "x \<in> t" "y \<in> t" "f x = f y"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4438
    then have "x \<in> f x"  "y \<in> f x \<longrightarrow> y = x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4439
      using f[THEN bspec[where x=x]] and \<open>t \<subseteq> s\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4440
    then have "x = y"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4441
      using \<open>f x = f y\<close> and f[THEN bspec[where x=y]] and \<open>y \<in> t\<close> and \<open>t \<subseteq> s\<close>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4442
      by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4443
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4444
  then have "inj_on f t"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4445
    unfolding inj_on_def by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4446
  then have "infinite (f ` t)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4447
    using assms(2) using finite_imageD by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4448
  moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4449
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4450
    fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4451
    assume "x \<in> t" "f x \<notin> g"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4452
    from g(3) assms(3) \<open>x \<in> t\<close> obtain h where "h \<in> g" and "x \<in> h"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4453
      by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4454
    then obtain y where "y \<in> s" "h = f y"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4455
      using g'[THEN bspec[where x=h]] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4456
    then have "y = x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4457
      using f[THEN bspec[where x=y]] and \<open>x\<in>t\<close> and \<open>x\<in>h\<close>[unfolded \<open>h = f y\<close>]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4458
      by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4459
    then have False
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4460
      using \<open>f x \<notin> g\<close> \<open>h \<in> g\<close> unfolding \<open>h = f y\<close>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4461
      by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4462
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4463
  then have "f ` t \<subseteq> g" by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4464
  ultimately show False
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4465
    using g(2) using finite_subset by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4466
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4467
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
  4468
lemma acc_point_range_imp_convergent_subsequence:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4469
  fixes l :: "'a :: first_countable_topology"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4470
  assumes l: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> range f)"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4471
  shows "\<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4472
proof -
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4473
  from countable_basis_at_decseq[of l]
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4474
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4475
      "\<And>i. open (A i)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4476
      "\<And>i. l \<in> A i"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4477
      "\<And>S. open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4478
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4479
  define s where "s n i = (SOME j. i < j \<and> f j \<in> A (Suc n))" for n i
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4480
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4481
    fix n i
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4482
    have "infinite (A (Suc n) \<inter> range f - f`{.. i})"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4483
      using l A by auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4484
    then have "\<exists>x. x \<in> A (Suc n) \<inter> range f - f`{.. i}"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4485
      unfolding ex_in_conv by (intro notI) simp
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4486
    then have "\<exists>j. f j \<in> A (Suc n) \<and> j \<notin> {.. i}"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4487
      by auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4488
    then have "\<exists>a. i < a \<and> f a \<in> A (Suc n)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4489
      by (auto simp: not_le)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4490
    then have "i < s n i" "f (s n i) \<in> A (Suc n)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4491
      unfolding s_def by (auto intro: someI2_ex)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4492
  }
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4493
  note s = this
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4494
  define r where "r = rec_nat (s 0 0) s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4495
  have "subseq r"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4496
    by (auto simp: r_def s subseq_Suc_iff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4497
  moreover
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4498
  have "(\<lambda>n. f (r n)) \<longlonglongrightarrow> l"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4499
  proof (rule topological_tendstoI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4500
    fix S
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4501
    assume "open S" "l \<in> S"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4502
    with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4503
      by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4504
    moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4505
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4506
      fix i
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4507
      assume "Suc 0 \<le> i"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4508
      then have "f (r i) \<in> A i"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4509
        by (cases i) (simp_all add: r_def s)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4510
    }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4511
    then have "eventually (\<lambda>i. f (r i) \<in> A i) sequentially"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4512
      by (auto simp: eventually_sequentially)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4513
    ultimately show "eventually (\<lambda>i. f (r i) \<in> S) sequentially"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4514
      by eventually_elim auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4515
  qed
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4516
  ultimately show "\<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4517
    by (auto simp: convergent_def comp_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4518
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4519
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4520
lemma sequence_infinite_lemma:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4521
  fixes f :: "nat \<Rightarrow> 'a::t1_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4522
  assumes "\<forall>n. f n \<noteq> l"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4523
    and "(f \<longlongrightarrow> l) sequentially"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4524
  shows "infinite (range f)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4525
proof
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4526
  assume "finite (range f)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4527
  then have "closed (range f)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4528
    by (rule finite_imp_closed)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4529
  then have "open (- range f)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4530
    by (rule open_Compl)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4531
  from assms(1) have "l \<in> - range f"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4532
    by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4533
  from assms(2) have "eventually (\<lambda>n. f n \<in> - range f) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4534
    using \<open>open (- range f)\<close> \<open>l \<in> - range f\<close>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4535
    by (rule topological_tendstoD)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4536
  then show False
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4537
    unfolding eventually_sequentially
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4538
    by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4539
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4540
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4541
lemma closure_insert:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4542
  fixes x :: "'a::t1_space"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4543
  shows "closure (insert x s) = insert x (closure s)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4544
  apply (rule closure_unique)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4545
  apply (rule insert_mono [OF closure_subset])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4546
  apply (rule closed_insert [OF closed_closure])
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4547
  apply (simp add: closure_minimal)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4548
  done
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4549
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4550
lemma islimpt_insert:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4551
  fixes x :: "'a::t1_space"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4552
  shows "x islimpt (insert a s) \<longleftrightarrow> x islimpt s"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4553
proof
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4554
  assume *: "x islimpt (insert a s)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4555
  show "x islimpt s"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4556
  proof (rule islimptI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4557
    fix t
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4558
    assume t: "x \<in> t" "open t"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4559
    show "\<exists>y\<in>s. y \<in> t \<and> y \<noteq> x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4560
    proof (cases "x = a")
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4561
      case True
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4562
      obtain y where "y \<in> insert a s" "y \<in> t" "y \<noteq> x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4563
        using * t by (rule islimptE)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4564
      with \<open>x = a\<close> show ?thesis by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4565
    next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4566
      case False
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4567
      with t have t': "x \<in> t - {a}" "open (t - {a})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4568
        by (simp_all add: open_Diff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4569
      obtain y where "y \<in> insert a s" "y \<in> t - {a}" "y \<noteq> x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4570
        using * t' by (rule islimptE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4571
      then show ?thesis by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4572
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4573
  qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4574
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4575
  assume "x islimpt s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4576
  then show "x islimpt (insert a s)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4577
    by (rule islimpt_subset) auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4578
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4579
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  4580
lemma islimpt_finite:
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  4581
  fixes x :: "'a::t1_space"
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  4582
  shows "finite s \<Longrightarrow> \<not> x islimpt s"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4583
  by (induct set: finite) (simp_all add: islimpt_insert)
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  4584
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4585
lemma islimpt_Un_finite:
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4586
  fixes x :: "'a::t1_space"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4587
  shows "finite s \<Longrightarrow> x islimpt (s \<union> t) \<longleftrightarrow> x islimpt t"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4588
  by (simp add: islimpt_Un islimpt_finite)
50897
078590669527 generalize lemma islimpt_finite to class t1_space
huffman
parents: 50884
diff changeset
  4589
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
  4590
lemma islimpt_eq_acc_point:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4591
  fixes l :: "'a :: t1_space"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4592
  shows "l islimpt S \<longleftrightarrow> (\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S))"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4593
proof (safe intro!: islimptI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4594
  fix U
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4595
  assume "l islimpt S" "l \<in> U" "open U" "finite (U \<inter> S)"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4596
  then have "l islimpt S" "l \<in> (U - (U \<inter> S - {l}))" "open (U - (U \<inter> S - {l}))"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4597
    by (auto intro: finite_imp_closed)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4598
  then show False
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4599
    by (rule islimptE) auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4600
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4601
  fix T
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4602
  assume *: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S)" "l \<in> T" "open T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4603
  then have "infinite (T \<inter> S - {l})"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4604
    by auto
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4605
  then have "\<exists>x. x \<in> (T \<inter> S - {l})"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4606
    unfolding ex_in_conv by (intro notI) simp
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4607
  then show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> l"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4608
    by auto
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4609
qed
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4610
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  4611
corollary infinite_openin:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  4612
  fixes S :: "'a :: t1_space set"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  4613
  shows "\<lbrakk>openin (subtopology euclidean U) S; x \<in> S; x islimpt U\<rbrakk> \<Longrightarrow> infinite S"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  4614
  by (clarsimp simp add: openin_open islimpt_eq_acc_point inf_commute)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  4615
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
  4616
lemma islimpt_range_imp_convergent_subsequence:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4617
  fixes l :: "'a :: {t1_space, first_countable_topology}"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4618
  assumes l: "l islimpt (range f)"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4619
  shows "\<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4620
  using l unfolding islimpt_eq_acc_point
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4621
  by (rule acc_point_range_imp_convergent_subsequence)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4622
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4623
lemma islimpt_eq_infinite_ball: "x islimpt S \<longleftrightarrow> (\<forall>e>0. infinite(S \<inter> ball x e))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4624
  apply (simp add: islimpt_eq_acc_point, safe)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4625
   apply (metis Int_commute open_ball centre_in_ball)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4626
  by (metis open_contains_ball Int_mono finite_subset inf_commute subset_refl)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4627
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4628
lemma islimpt_eq_infinite_cball: "x islimpt S \<longleftrightarrow> (\<forall>e>0. infinite(S \<inter> cball x e))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4629
  apply (simp add: islimpt_eq_infinite_ball, safe)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4630
   apply (meson Int_mono ball_subset_cball finite_subset order_refl)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4631
  by (metis open_ball centre_in_ball finite_Int inf.absorb_iff2 inf_assoc open_contains_cball_eq)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4632
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4633
lemma sequence_unique_limpt:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4634
  fixes f :: "nat \<Rightarrow> 'a::t2_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4635
  assumes "(f \<longlongrightarrow> l) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4636
    and "l' islimpt (range f)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4637
  shows "l' = l"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4638
proof (rule ccontr)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4639
  assume "l' \<noteq> l"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4640
  obtain s t where "open s" "open t" "l' \<in> s" "l \<in> t" "s \<inter> t = {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4641
    using hausdorff [OF \<open>l' \<noteq> l\<close>] by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4642
  have "eventually (\<lambda>n. f n \<in> t) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4643
    using assms(1) \<open>open t\<close> \<open>l \<in> t\<close> by (rule topological_tendstoD)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4644
  then obtain N where "\<forall>n\<ge>N. f n \<in> t"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4645
    unfolding eventually_sequentially by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4646
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4647
  have "UNIV = {..<N} \<union> {N..}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4648
    by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4649
  then have "l' islimpt (f ` ({..<N} \<union> {N..}))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4650
    using assms(2) by simp
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4651
  then have "l' islimpt (f ` {..<N} \<union> f ` {N..})"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4652
    by (simp add: image_Un)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4653
  then have "l' islimpt (f ` {N..})"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4654
    by (simp add: islimpt_Un_finite)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4655
  then obtain y where "y \<in> f ` {N..}" "y \<in> s" "y \<noteq> l'"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4656
    using \<open>l' \<in> s\<close> \<open>open s\<close> by (rule islimptE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4657
  then obtain n where "N \<le> n" "f n \<in> s" "f n \<noteq> l'"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4658
    by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4659
  with \<open>\<forall>n\<ge>N. f n \<in> t\<close> have "f n \<in> s \<inter> t"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4660
    by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4661
  with \<open>s \<inter> t = {}\<close> show False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4662
    by simp
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4663
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4664
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4665
lemma bolzano_weierstrass_imp_closed:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  4666
  fixes s :: "'a::{first_countable_topology,t2_space} set"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4667
  assumes "\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4668
  shows "closed s"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4669
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4670
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4671
    fix x l
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4672
    assume as: "\<forall>n::nat. x n \<in> s" "(x \<longlongrightarrow> l) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4673
    then have "l \<in> s"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4674
    proof (cases "\<forall>n. x n \<noteq> l")
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4675
      case False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4676
      then show "l\<in>s" using as(1) by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4677
    next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4678
      case True note cas = this
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4679
      with as(2) have "infinite (range x)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4680
        using sequence_infinite_lemma[of x l] by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4681
      then obtain l' where "l'\<in>s" "l' islimpt (range x)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4682
        using assms[THEN spec[where x="range x"]] as(1) by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4683
      then show "l\<in>s" using sequence_unique_limpt[of x l l']
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4684
        using as cas by auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4685
    qed
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4686
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4687
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4688
    unfolding closed_sequential_limits by fast
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4689
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4690
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4691
lemma compact_imp_bounded:
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4692
  assumes "compact U"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4693
  shows "bounded U"
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4694
proof -
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4695
  have "compact U" "\<forall>x\<in>U. open (ball x 1)" "U \<subseteq> (\<Union>x\<in>U. ball x 1)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4696
    using assms by auto
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4697
  then obtain D where D: "D \<subseteq> U" "finite D" "U \<subseteq> (\<Union>x\<in>D. ball x 1)"
65585
a043de9ad41e Some fixes related to compactE_image
paulson <lp15@cam.ac.uk>
parents: 65204
diff changeset
  4698
    by (metis compactE_image)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4699
  from \<open>finite D\<close> have "bounded (\<Union>x\<in>D. ball x 1)"
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  4700
    by (simp add: bounded_UN)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4701
  then show "bounded U" using \<open>U \<subseteq> (\<Union>x\<in>D. ball x 1)\<close>
50955
ada575c605e1 simplify proof of compact_imp_bounded
huffman
parents: 50949
diff changeset
  4702
    by (rule bounded_subset)
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4703
qed
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  4704
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4705
text\<open>In particular, some common special cases.\<close>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4706
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4707
lemma compact_Un [intro]:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4708
  assumes "compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  4709
    and "compact t"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4710
  shows " compact (s \<union> t)"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  4711
proof (rule compactI)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4712
  fix f
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4713
  assume *: "Ball f open" "s \<union> t \<subseteq> \<Union>f"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4714
  from * \<open>compact s\<close> obtain s' where "s' \<subseteq> f \<and> finite s' \<and> s \<subseteq> \<Union>s'"
56073
29e308b56d23 enhanced simplifier solver for preconditions of rewrite rule, can now deal with conjunctions
nipkow
parents: 55927
diff changeset
  4715
    unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f])
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4716
  moreover
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4717
  from * \<open>compact t\<close> obtain t' where "t' \<subseteq> f \<and> finite t' \<and> t \<subseteq> \<Union>t'"
56073
29e308b56d23 enhanced simplifier solver for preconditions of rewrite rule, can now deal with conjunctions
nipkow
parents: 55927
diff changeset
  4718
    unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f])
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4719
  ultimately show "\<exists>f'\<subseteq>f. finite f' \<and> s \<union> t \<subseteq> \<Union>f'"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4720
    by (auto intro!: exI[of _ "s' \<union> t'"])
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4721
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4722
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4723
lemma compact_Union [intro]: "finite S \<Longrightarrow> (\<And>T. T \<in> S \<Longrightarrow> compact T) \<Longrightarrow> compact (\<Union>S)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4724
  by (induct set: finite) auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4725
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4726
lemma compact_UN [intro]:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4727
  "finite A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> compact (B x)) \<Longrightarrow> compact (\<Union>x\<in>A. B x)"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  4728
  by (rule compact_Union) auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4729
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4730
lemma closed_Int_compact [intro]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4731
  assumes "closed s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4732
    and "compact t"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4733
  shows "compact (s \<inter> t)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4734
  using compact_Int_closed [of t s] assms
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4735
  by (simp add: Int_commute)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4736
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4737
lemma compact_Int [intro]:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  4738
  fixes s t :: "'a :: t2_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4739
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4740
    and "compact t"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4741
  shows "compact (s \<inter> t)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4742
  using assms by (intro compact_Int_closed compact_imp_closed)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4743
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4744
lemma compact_sing [simp]: "compact {a}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4745
  unfolding compact_eq_heine_borel by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4746
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4747
lemma compact_insert [simp]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4748
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4749
  shows "compact (insert x s)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4750
proof -
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4751
  have "compact ({x} \<union> s)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4752
    using compact_sing assms by (rule compact_Un)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4753
  then show ?thesis by simp
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4754
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4755
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  4756
lemma finite_imp_compact: "finite s \<Longrightarrow> compact s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4757
  by (induct set: finite) simp_all
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4758
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4759
lemma open_delete:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4760
  fixes s :: "'a::t1_space set"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4761
  shows "open s \<Longrightarrow> open (s - {x})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4762
  by (simp add: open_Diff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4763
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4764
lemma openin_delete:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4765
  fixes a :: "'a :: t1_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4766
  shows "openin (subtopology euclidean u) s
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4767
         \<Longrightarrow> openin (subtopology euclidean u) (s - {a})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4768
by (metis Int_Diff open_delete openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4769
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  4770
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4771
text\<open>Compactness expressed with filters\<close>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4772
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4773
lemma closure_iff_nhds_not_empty:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4774
  "x \<in> closure X \<longleftrightarrow> (\<forall>A. \<forall>S\<subseteq>A. open S \<longrightarrow> x \<in> S \<longrightarrow> X \<inter> A \<noteq> {})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4775
proof safe
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4776
  assume x: "x \<in> closure X"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4777
  fix S A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4778
  assume "open S" "x \<in> S" "X \<inter> A = {}" "S \<subseteq> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4779
  then have "x \<notin> closure (-S)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4780
    by (auto simp: closure_complement subset_eq[symmetric] intro: interiorI)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4781
  with x have "x \<in> closure X - closure (-S)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4782
    by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4783
  also have "\<dots> \<subseteq> closure (X \<inter> S)"
63128
24708cf4ba61 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 63114
diff changeset
  4784
    using \<open>open S\<close> open_Int_closure_subset[of S X] by (simp add: closed_Compl ac_simps)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4785
  finally have "X \<inter> S \<noteq> {}" by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4786
  then show False using \<open>X \<inter> A = {}\<close> \<open>S \<subseteq> A\<close> by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4787
next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4788
  assume "\<forall>A S. S \<subseteq> A \<longrightarrow> open S \<longrightarrow> x \<in> S \<longrightarrow> X \<inter> A \<noteq> {}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4789
  from this[THEN spec, of "- X", THEN spec, of "- closure X"]
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4790
  show "x \<in> closure X"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4791
    by (simp add: closure_subset open_Compl)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4792
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4793
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4794
lemma compact_filter:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4795
  "compact U \<longleftrightarrow> (\<forall>F. F \<noteq> bot \<longrightarrow> eventually (\<lambda>x. x \<in> U) F \<longrightarrow> (\<exists>x\<in>U. inf (nhds x) F \<noteq> bot))"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4796
proof (intro allI iffI impI compact_fip[THEN iffD2] notI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4797
  fix F
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4798
  assume "compact U"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4799
  assume F: "F \<noteq> bot" "eventually (\<lambda>x. x \<in> U) F"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4800
  then have "U \<noteq> {}"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4801
    by (auto simp: eventually_False)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4802
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4803
  define Z where "Z = closure ` {A. eventually (\<lambda>x. x \<in> A) F}"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4804
  then have "\<forall>z\<in>Z. closed z"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4805
    by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4806
  moreover
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4807
  have ev_Z: "\<And>z. z \<in> Z \<Longrightarrow> eventually (\<lambda>x. x \<in> z) F"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  4808
    unfolding Z_def by (auto elim: eventually_mono intro: set_mp[OF closure_subset])
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4809
  have "(\<forall>B \<subseteq> Z. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {})"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4810
  proof (intro allI impI)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4811
    fix B assume "finite B" "B \<subseteq> Z"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4812
    with \<open>finite B\<close> ev_Z F(2) have "eventually (\<lambda>x. x \<in> U \<inter> (\<Inter>B)) F"
60040
1fa1023b13b9 move MOST and INFM in Infinite_Set to Filter; change them to abbreviations over the cofinite filter
hoelzl
parents: 60017
diff changeset
  4813
      by (auto simp: eventually_ball_finite_distrib eventually_conj_iff)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4814
    with F show "U \<inter> \<Inter>B \<noteq> {}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4815
      by (intro notI) (simp add: eventually_False)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4816
  qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4817
  ultimately have "U \<inter> \<Inter>Z \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4818
    using \<open>compact U\<close> unfolding compact_fip by blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4819
  then obtain x where "x \<in> U" and x: "\<And>z. z \<in> Z \<Longrightarrow> x \<in> z"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4820
    by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4821
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4822
  have "\<And>P. eventually P (inf (nhds x) F) \<Longrightarrow> P \<noteq> bot"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4823
    unfolding eventually_inf eventually_nhds
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4824
  proof safe
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4825
    fix P Q R S
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4826
    assume "eventually R F" "open S" "x \<in> S"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4827
    with open_Int_closure_eq_empty[of S "{x. R x}"] x[of "closure {x. R x}"]
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4828
    have "S \<inter> {x. R x} \<noteq> {}" by (auto simp: Z_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4829
    moreover assume "Ball S Q" "\<forall>x. Q x \<and> R x \<longrightarrow> bot x"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4830
    ultimately show False by (auto simp: set_eq_iff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4831
  qed
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4832
  with \<open>x \<in> U\<close> show "\<exists>x\<in>U. inf (nhds x) F \<noteq> bot"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4833
    by (metis eventually_bot)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4834
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4835
  fix A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4836
  assume A: "\<forall>a\<in>A. closed a" "\<forall>B\<subseteq>A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}" "U \<inter> \<Inter>A = {}"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4837
  define F where "F = (INF a:insert U A. principal a)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4838
  have "F \<noteq> bot"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4839
    unfolding F_def
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4840
  proof (rule INF_filter_not_bot)
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  4841
    fix X
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  4842
    assume X: "X \<subseteq> insert U A" "finite X"
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  4843
    with A(2)[THEN spec, of "X - {U}"] have "U \<inter> \<Inter>(X - {U}) \<noteq> {}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4844
      by auto
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  4845
    with X show "(INF a:X. principal a) \<noteq> bot"
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4846
      by (auto simp add: INF_principal_finite principal_eq_bot_iff)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4847
  qed
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4848
  moreover
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4849
  have "F \<le> principal U"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4850
    unfolding F_def by auto
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4851
  then have "eventually (\<lambda>x. x \<in> U) F"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4852
    by (auto simp: le_filter_def eventually_principal)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4853
  moreover
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4854
  assume "\<forall>F. F \<noteq> bot \<longrightarrow> eventually (\<lambda>x. x \<in> U) F \<longrightarrow> (\<exists>x\<in>U. inf (nhds x) F \<noteq> bot)"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4855
  ultimately obtain x where "x \<in> U" and x: "inf (nhds x) F \<noteq> bot"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4856
    by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4857
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4858
  { fix V assume "V \<in> A"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4859
    then have "F \<le> principal V"
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4860
      unfolding F_def by (intro INF_lower2[of V]) auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4861
    then have V: "eventually (\<lambda>x. x \<in> V) F"
57276
49c51eeaa623 filters are easier to define with INF on filters.
hoelzl
parents: 57275
diff changeset
  4862
      by (auto simp: le_filter_def eventually_principal)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4863
    have "x \<in> closure V"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4864
      unfolding closure_iff_nhds_not_empty
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4865
    proof (intro impI allI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4866
      fix S A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4867
      assume "open S" "x \<in> S" "S \<subseteq> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4868
      then have "eventually (\<lambda>x. x \<in> A) (nhds x)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4869
        by (auto simp: eventually_nhds)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4870
      with V have "eventually (\<lambda>x. x \<in> V \<inter> A) (inf (nhds x) F)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4871
        by (auto simp: eventually_inf)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4872
      with x show "V \<inter> A \<noteq> {}"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4873
        by (auto simp del: Int_iff simp add: trivial_limit_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4874
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4875
    then have "x \<in> V"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4876
      using \<open>V \<in> A\<close> A(1) by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4877
  }
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4878
  with \<open>x\<in>U\<close> have "x \<in> U \<inter> \<Inter>A" by auto
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4879
  with \<open>U \<inter> \<Inter>A = {}\<close> show False by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4880
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4881
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4882
definition "countably_compact U \<longleftrightarrow>
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4883
    (\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T))"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4884
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4885
lemma countably_compactE:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4886
  assumes "countably_compact s" and "\<forall>t\<in>C. open t" and "s \<subseteq> \<Union>C" "countable C"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4887
  obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> \<Union>C'"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4888
  using assms unfolding countably_compact_def by metis
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4889
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4890
lemma countably_compactI:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4891
  assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union>C \<Longrightarrow> countable C \<Longrightarrow> (\<exists>C'\<subseteq>C. finite C' \<and> s \<subseteq> \<Union>C')"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4892
  shows "countably_compact s"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4893
  using assms unfolding countably_compact_def by metis
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4894
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4895
lemma compact_imp_countably_compact: "compact U \<Longrightarrow> countably_compact U"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4896
  by (auto simp: compact_eq_heine_borel countably_compact_def)
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4897
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4898
lemma countably_compact_imp_compact:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4899
  assumes "countably_compact U"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4900
    and ccover: "countable B" "\<forall>b\<in>B. open b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4901
    and basis: "\<And>T x. open T \<Longrightarrow> x \<in> T \<Longrightarrow> x \<in> U \<Longrightarrow> \<exists>b\<in>B. x \<in> b \<and> b \<inter> U \<subseteq> T"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4902
  shows "compact U"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4903
  using \<open>countably_compact U\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4904
  unfolding compact_eq_heine_borel countably_compact_def
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4905
proof safe
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4906
  fix A
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4907
  assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4908
  assume *: "\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  4909
  moreover define C where "C = {b\<in>B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4910
  ultimately have "countable C" "\<forall>a\<in>C. open a"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4911
    unfolding C_def using ccover by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4912
  moreover
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4913
  have "\<Union>A \<inter> U \<subseteq> \<Union>C"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4914
  proof safe
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4915
    fix x a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4916
    assume "x \<in> U" "x \<in> a" "a \<in> A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4917
    with basis[of a x] A obtain b where "b \<in> B" "x \<in> b" "b \<inter> U \<subseteq> a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4918
      by blast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4919
    with \<open>a \<in> A\<close> show "x \<in> \<Union>C"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4920
      unfolding C_def by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4921
  qed
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4922
  then have "U \<subseteq> \<Union>C" using \<open>U \<subseteq> \<Union>A\<close> by auto
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  4923
  ultimately obtain T where T: "T\<subseteq>C" "finite T" "U \<subseteq> \<Union>T"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4924
    using * by metis
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  4925
  then have "\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4926
    by (auto simp: C_def)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4927
  then obtain f where "\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4928
    unfolding bchoice_iff Bex_def ..
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  4929
  with T show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  4930
    unfolding C_def by (intro exI[of _ "f`T"]) fastforce
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4931
qed
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4932
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4933
lemma countably_compact_imp_compact_second_countable:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4934
  "countably_compact U \<Longrightarrow> compact (U :: 'a :: second_countable_topology set)"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4935
proof (rule countably_compact_imp_compact)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4936
  fix T and x :: 'a
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4937
  assume "open T" "x \<in> T"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4938
  from topological_basisE[OF is_basis this] obtain b where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4939
    "b \<in> (SOME B. countable B \<and> topological_basis B)" "x \<in> b" "b \<subseteq> T" .
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4940
  then show "\<exists>b\<in>SOME B. countable B \<and> topological_basis B. x \<in> b \<and> b \<inter> U \<subseteq> T"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  4941
    by blast
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4942
qed (insert countable_basis topological_basis_open[OF is_basis], auto)
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  4943
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
  4944
lemma countably_compact_eq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4945
  "countably_compact U \<longleftrightarrow> compact (U :: 'a :: second_countable_topology set)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  4946
  using countably_compact_imp_compact_second_countable compact_imp_countably_compact by blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4947
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4948
subsubsection\<open>Sequential compactness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4949
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4950
definition seq_compact :: "'a::topological_space set \<Rightarrow> bool"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  4951
  where "seq_compact S \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4952
    (\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially))"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  4953
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4954
lemma seq_compactI:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4955
  assumes "\<And>f. \<forall>n. f n \<in> S \<Longrightarrow> \<exists>l\<in>S. \<exists>r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4956
  shows "seq_compact S"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4957
  unfolding seq_compact_def using assms by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4958
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4959
lemma seq_compactE:
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4960
  assumes "seq_compact S" "\<forall>n. f n \<in> S"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  4961
  obtains l r where "l \<in> S" "subseq r" "((f \<circ> r) \<longlongrightarrow> l) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4962
  using assms unfolding seq_compact_def by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4963
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4964
lemma closed_sequentially: (* TODO: move upwards *)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4965
  assumes "closed s" and "\<forall>n. f n \<in> s" and "f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4966
  shows "l \<in> s"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4967
proof (rule ccontr)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4968
  assume "l \<notin> s"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4969
  with \<open>closed s\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "eventually (\<lambda>n. f n \<in> - s) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4970
    by (fast intro: topological_tendstoD)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4971
  with \<open>\<forall>n. f n \<in> s\<close> show "False"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4972
    by simp
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4973
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4974
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4975
lemma seq_compact_Int_closed:
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4976
  assumes "seq_compact s" and "closed t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4977
  shows "seq_compact (s \<inter> t)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4978
proof (rule seq_compactI)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4979
  fix f assume "\<forall>n::nat. f n \<in> s \<inter> t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4980
  hence "\<forall>n. f n \<in> s" and "\<forall>n. f n \<in> t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4981
    by simp_all
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4982
  from \<open>seq_compact s\<close> and \<open>\<forall>n. f n \<in> s\<close>
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4983
  obtain l r where "l \<in> s" and r: "subseq r" and l: "(f \<circ> r) \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4984
    by (rule seq_compactE)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4985
  from \<open>\<forall>n. f n \<in> t\<close> have "\<forall>n. (f \<circ> r) n \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4986
    by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  4987
  from \<open>closed t\<close> and this and l have "l \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4988
    by (rule closed_sequentially)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  4989
  with \<open>l \<in> s\<close> and r and l show "\<exists>l\<in>s \<inter> t. \<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4990
    by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4991
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4992
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4993
lemma seq_compact_closed_subset:
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4994
  assumes "closed s" and "s \<subseteq> t" and "seq_compact t"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4995
  shows "seq_compact s"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  4996
  using assms seq_compact_Int_closed [of t s] by (simp add: Int_absorb1)
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  4997
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4998
lemma seq_compact_imp_countably_compact:
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  4999
  fixes U :: "'a :: first_countable_topology set"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5000
  assumes "seq_compact U"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5001
  shows "countably_compact U"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5002
proof (safe intro!: countably_compactI)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5003
  fix A
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5004
  assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" "countable A"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5005
  have subseq: "\<And>X. range X \<subseteq> U \<Longrightarrow> \<exists>r x. x \<in> U \<and> subseq r \<and> (X \<circ> r) \<longlonglongrightarrow> x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5006
    using \<open>seq_compact U\<close> by (fastforce simp: seq_compact_def subset_eq)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5007
  show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5008
  proof cases
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5009
    assume "finite A"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5010
    with A show ?thesis by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5011
  next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5012
    assume "infinite A"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5013
    then have "A \<noteq> {}" by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5014
    show ?thesis
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5015
    proof (rule ccontr)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5016
      assume "\<not> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5017
      then have "\<forall>T. \<exists>x. T \<subseteq> A \<and> finite T \<longrightarrow> (x \<in> U - \<Union>T)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5018
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5019
      then obtain X' where T: "\<And>T. T \<subseteq> A \<Longrightarrow> finite T \<Longrightarrow> X' T \<in> U - \<Union>T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5020
        by metis
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5021
      define X where "X n = X' (from_nat_into A ` {.. n})" for n
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5022
      have X: "\<And>n. X n \<in> U - (\<Union>i\<le>n. from_nat_into A i)"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  5023
        using \<open>A \<noteq> {}\<close> unfolding X_def by (intro T) (auto intro: from_nat_into)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5024
      then have "range X \<subseteq> U"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5025
        by auto
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5026
      with subseq[of X] obtain r x where "x \<in> U" and r: "subseq r" "(X \<circ> r) \<longlonglongrightarrow> x"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5027
        by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5028
      from \<open>x\<in>U\<close> \<open>U \<subseteq> \<Union>A\<close> from_nat_into_surj[OF \<open>countable A\<close>]
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5029
      obtain n where "x \<in> from_nat_into A n" by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5030
      with r(2) A(1) from_nat_into[OF \<open>A \<noteq> {}\<close>, of n]
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5031
      have "eventually (\<lambda>i. X (r i) \<in> from_nat_into A n) sequentially"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5032
        unfolding tendsto_def by (auto simp: comp_def)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5033
      then obtain N where "\<And>i. N \<le> i \<Longrightarrow> X (r i) \<in> from_nat_into A n"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5034
        by (auto simp: eventually_sequentially)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5035
      moreover from X have "\<And>i. n \<le> r i \<Longrightarrow> X (r i) \<notin> from_nat_into A n"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5036
        by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5037
      moreover from \<open>subseq r\<close>[THEN seq_suble, of "max n N"] have "\<exists>i. n \<le> r i \<and> N \<le> i"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5038
        by (auto intro!: exI[of _ "max n N"])
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5039
      ultimately show False
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5040
        by auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5041
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5042
  qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5043
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5044
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5045
lemma compact_imp_seq_compact:
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5046
  fixes U :: "'a :: first_countable_topology set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5047
  assumes "compact U"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5048
  shows "seq_compact U"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5049
  unfolding seq_compact_def
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5050
proof safe
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5051
  fix X :: "nat \<Rightarrow> 'a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5052
  assume "\<forall>n. X n \<in> U"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5053
  then have "eventually (\<lambda>x. x \<in> U) (filtermap X sequentially)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5054
    by (auto simp: eventually_filtermap)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5055
  moreover
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5056
  have "filtermap X sequentially \<noteq> bot"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5057
    by (simp add: trivial_limit_def eventually_filtermap)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5058
  ultimately
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5059
  obtain x where "x \<in> U" and x: "inf (nhds x) (filtermap X sequentially) \<noteq> bot" (is "?F \<noteq> _")
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5060
    using \<open>compact U\<close> by (auto simp: compact_filter)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5061
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5062
  from countable_basis_at_decseq[of x]
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5063
  obtain A where A:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5064
      "\<And>i. open (A i)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5065
      "\<And>i. x \<in> A i"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5066
      "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5067
    by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5068
  define s where "s n i = (SOME j. i < j \<and> X j \<in> A (Suc n))" for n i
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5069
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5070
    fix n i
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5071
    have "\<exists>a. i < a \<and> X a \<in> A (Suc n)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5072
    proof (rule ccontr)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5073
      assume "\<not> (\<exists>a>i. X a \<in> A (Suc n))"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5074
      then have "\<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5075
        by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5076
      then have "eventually (\<lambda>x. x \<notin> A (Suc n)) (filtermap X sequentially)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5077
        by (auto simp: eventually_filtermap eventually_sequentially)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5078
      moreover have "eventually (\<lambda>x. x \<in> A (Suc n)) (nhds x)"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5079
        using A(1,2)[of "Suc n"] by (auto simp: eventually_nhds)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5080
      ultimately have "eventually (\<lambda>x. False) ?F"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5081
        by (auto simp add: eventually_inf)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5082
      with x show False
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5083
        by (simp add: eventually_False)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5084
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5085
    then have "i < s n i" "X (s n i) \<in> A (Suc n)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5086
      unfolding s_def by (auto intro: someI2_ex)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5087
  }
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5088
  note s = this
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5089
  define r where "r = rec_nat (s 0 0) s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5090
  have "subseq r"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5091
    by (auto simp: r_def s subseq_Suc_iff)
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5092
  moreover
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5093
  have "(\<lambda>n. X (r n)) \<longlonglongrightarrow> x"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5094
  proof (rule topological_tendstoI)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5095
    fix S
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5096
    assume "open S" "x \<in> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5097
    with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5098
      by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5099
    moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5100
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5101
      fix i
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5102
      assume "Suc 0 \<le> i"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5103
      then have "X (r i) \<in> A i"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5104
        by (cases i) (simp_all add: r_def s)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5105
    }
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5106
    then have "eventually (\<lambda>i. X (r i) \<in> A i) sequentially"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5107
      by (auto simp: eventually_sequentially)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5108
    ultimately show "eventually (\<lambda>i. X (r i) \<in> S) sequentially"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5109
      by eventually_elim auto
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5110
  qed
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5111
  ultimately show "\<exists>x \<in> U. \<exists>r. subseq r \<and> (X \<circ> r) \<longlonglongrightarrow> x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5112
    using \<open>x \<in> U\<close> by (auto simp: convergent_def comp_def)
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5113
qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5114
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
  5115
lemma countably_compact_imp_acc_point:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5116
  assumes "countably_compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5117
    and "countable t"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5118
    and "infinite t"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5119
    and "t \<subseteq> s"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5120
  shows "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5121
proof (rule ccontr)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5122
  define C where "C = (\<lambda>F. interior (F \<union> (- t))) ` {F. finite F \<and> F \<subseteq> t }"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5123
  note \<open>countably_compact s\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5124
  moreover have "\<forall>t\<in>C. open t"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5125
    by (auto simp: C_def)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5126
  moreover
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5127
  assume "\<not> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5128
  then have s: "\<And>x. x \<in> s \<Longrightarrow> \<exists>U. x\<in>U \<and> open U \<and> finite (U \<inter> t)" by metis
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5129
  have "s \<subseteq> \<Union>C"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5130
    using \<open>t \<subseteq> s\<close>
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  5131
    unfolding C_def
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5132
    apply (safe dest!: s)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5133
    apply (rule_tac a="U \<inter> t" in UN_I)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5134
    apply (auto intro!: interiorI simp add: finite_subset)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5135
    done
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5136
  moreover
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5137
  from \<open>countable t\<close> have "countable C"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5138
    unfolding C_def by (auto intro: countable_Collect_finite_subset)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5139
  ultimately
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5140
  obtain D where "D \<subseteq> C" "finite D" "s \<subseteq> \<Union>D"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5141
    by (rule countably_compactE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5142
  then obtain E where E: "E \<subseteq> {F. finite F \<and> F \<subseteq> t }" "finite E"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5143
    and s: "s \<subseteq> (\<Union>F\<in>E. interior (F \<union> (- t)))"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  5144
    by (metis (lifting) finite_subset_image C_def)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5145
  from s \<open>t \<subseteq> s\<close> have "t \<subseteq> \<Union>E"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5146
    using interior_subset by blast
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5147
  moreover have "finite (\<Union>E)"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5148
    using E by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5149
  ultimately show False using \<open>infinite t\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5150
    by (auto simp: finite_subset)
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5151
qed
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5152
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
  5153
lemma countable_acc_point_imp_seq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5154
  fixes s :: "'a::first_countable_topology set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5155
  assumes "\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s \<longrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5156
    (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5157
  shows "seq_compact s"
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5158
proof -
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5159
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5160
    fix f :: "nat \<Rightarrow> 'a"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5161
    assume f: "\<forall>n. f n \<in> s"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5162
    have "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5163
    proof (cases "finite (range f)")
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5164
      case True
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5165
      obtain l where "infinite {n. f n = f l}"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5166
        using pigeonhole_infinite[OF _ True] by auto
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5167
      then obtain r where "subseq r" and fr: "\<forall>n. f (r n) = f l"
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5168
        using infinite_enumerate by blast
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5169
      then have "subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> f l"
58729
e8ecc79aee43 add tendsto_const and tendsto_ident_at as simp and intro rules
hoelzl
parents: 58184
diff changeset
  5170
        by (simp add: fr o_def)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5171
      with f show "\<exists>l\<in>s. \<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50941
3690724028b1 add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents: 50940
diff changeset
  5172
        by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5173
    next
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5174
      case False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5175
      with f assms have "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5176
        by auto
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5177
      then obtain l where "l \<in> s" "\<forall>U. l\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)" ..
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5178
      from this(2) have "\<exists>r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5179
        using acc_point_range_imp_convergent_subsequence[of l f] by auto
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5180
      with \<open>l \<in> s\<close> show "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" ..
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5181
    qed
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5182
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5183
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5184
    unfolding seq_compact_def by auto
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5185
qed
44075
5952bd355779 generalize more lemmas about compactness
huffman
parents: 44074
diff changeset
  5186
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
  5187
lemma seq_compact_eq_countably_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5188
  fixes U :: "'a :: first_countable_topology set"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5189
  shows "seq_compact U \<longleftrightarrow> countably_compact U"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5190
  using
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5191
    countable_acc_point_imp_seq_compact
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5192
    countably_compact_imp_acc_point
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5193
    seq_compact_imp_countably_compact
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5194
  by metis
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5195
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
  5196
lemma seq_compact_eq_acc_point:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5197
  fixes s :: "'a :: first_countable_topology set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5198
  shows "seq_compact s \<longleftrightarrow>
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5199
    (\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s --> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t)))"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5200
  using
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5201
    countable_acc_point_imp_seq_compact[of s]
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5202
    countably_compact_imp_acc_point[of s]
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5203
    seq_compact_imp_countably_compact[of s]
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5204
  by metis
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5205
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
  5206
lemma seq_compact_eq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5207
  fixes U :: "'a :: second_countable_topology set"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5208
  shows "seq_compact U \<longleftrightarrow> compact U"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5209
  using seq_compact_eq_countably_compact countably_compact_eq_compact by blast
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5210
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
  5211
lemma bolzano_weierstrass_imp_seq_compact:
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5212
  fixes s :: "'a::{t1_space, first_countable_topology} set"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  5213
  shows "\<forall>t. infinite t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> seq_compact s"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5214
  by (rule countable_acc_point_imp_seq_compact) (metis islimpt_eq_acc_point)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5215
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  5216
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5217
subsubsection\<open>Totally bounded\<close>
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5218
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  5219
lemma cauchy_def: "Cauchy s \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m n. m \<ge> N \<and> n \<ge> N \<longrightarrow> dist (s m) (s n) < e)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5220
  unfolding Cauchy_def by metis
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5221
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5222
lemma seq_compact_imp_totally_bounded:
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5223
  assumes "seq_compact s"
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5224
  shows "\<forall>e>0. \<exists>k. finite k \<and> k \<subseteq> s \<and> s \<subseteq> (\<Union>x\<in>k. ball x e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5225
proof -
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5226
  { fix e::real assume "e > 0" assume *: "\<And>k. finite k \<Longrightarrow> k \<subseteq> s \<Longrightarrow> \<not> s \<subseteq> (\<Union>x\<in>k. ball x e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5227
    let ?Q = "\<lambda>x n r. r \<in> s \<and> (\<forall>m < (n::nat). \<not> (dist (x m) r < e))"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5228
    have "\<exists>x. \<forall>n::nat. ?Q x n (x n)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5229
    proof (rule dependent_wellorder_choice)
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5230
      fix n x assume "\<And>y. y < n \<Longrightarrow> ?Q x y (x y)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5231
      then have "\<not> s \<subseteq> (\<Union>x\<in>x ` {0..<n}. ball x e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5232
        using *[of "x ` {0 ..< n}"] by (auto simp: subset_eq)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5233
      then obtain z where z:"z\<in>s" "z \<notin> (\<Union>x\<in>x ` {0..<n}. ball x e)"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5234
        unfolding subset_eq by auto
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5235
      show "\<exists>r. ?Q x n r"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5236
        using z by auto
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5237
    qed simp
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5238
    then obtain x where "\<forall>n::nat. x n \<in> s" and x:"\<And>n m. m < n \<Longrightarrow> \<not> (dist (x m) (x n) < e)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5239
      by blast
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5240
    then obtain l r where "l \<in> s" and r:"subseq r" and "((x \<circ> r) \<longlongrightarrow> l) sequentially"
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5241
      using assms by (metis seq_compact_def)
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5242
    from this(3) have "Cauchy (x \<circ> r)"
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5243
      using LIMSEQ_imp_Cauchy by auto
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5244
    then obtain N::nat where "\<And>m n. N \<le> m \<Longrightarrow> N \<le> n \<Longrightarrow> dist ((x \<circ> r) m) ((x \<circ> r) n) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5245
      unfolding cauchy_def using \<open>e > 0\<close> by blast
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5246
    then have False
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5247
      using x[of "r N" "r (N+1)"] r by (auto simp: subseq_def) }
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5248
  then show ?thesis
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5249
    by metis
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5250
qed
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5251
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5252
subsubsection\<open>Heine-Borel theorem\<close>
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5253
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5254
lemma seq_compact_imp_heine_borel:
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5255
  fixes s :: "'a :: metric_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5256
  assumes "seq_compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5257
  shows "compact s"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5258
proof -
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5259
  from seq_compact_imp_totally_bounded[OF \<open>seq_compact s\<close>]
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5260
  obtain f where f: "\<forall>e>0. finite (f e) \<and> f e \<subseteq> s \<and> s \<subseteq> (\<Union>x\<in>f e. ball x e)"
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5261
    unfolding choice_iff' ..
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5262
  define K where "K = (\<lambda>(x, r). ball x r) ` ((\<Union>e \<in> \<rat> \<inter> {0 <..}. f e) \<times> \<rat>)"
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5263
  have "countably_compact s"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5264
    using \<open>seq_compact s\<close> by (rule seq_compact_imp_countably_compact)
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5265
  then show "compact s"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5266
  proof (rule countably_compact_imp_compact)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5267
    show "countable K"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5268
      unfolding K_def using f
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5269
      by (auto intro: countable_finite countable_subset countable_rat
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5270
               intro!: countable_image countable_SIGMA countable_UN)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5271
    show "\<forall>b\<in>K. open b" by (auto simp: K_def)
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5272
  next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5273
    fix T x
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5274
    assume T: "open T" "x \<in> T" and x: "x \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5275
    from openE[OF T] obtain e where "0 < e" "ball x e \<subseteq> T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5276
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5277
    then have "0 < e / 2" "ball x (e / 2) \<subseteq> T"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5278
      by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5279
    from Rats_dense_in_real[OF \<open>0 < e / 2\<close>] obtain r where "r \<in> \<rat>" "0 < r" "r < e / 2"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5280
      by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5281
    from f[rule_format, of r] \<open>0 < r\<close> \<open>x \<in> s\<close> obtain k where "k \<in> f r" "x \<in> ball k r"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  5282
      by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5283
    from \<open>r \<in> \<rat>\<close> \<open>0 < r\<close> \<open>k \<in> f r\<close> have "ball k r \<in> K"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5284
      by (auto simp: K_def)
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5285
    then show "\<exists>b\<in>K. x \<in> b \<and> b \<inter> s \<subseteq> T"
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5286
    proof (rule bexI[rotated], safe)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5287
      fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5288
      assume "y \<in> ball k r"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5289
      with \<open>r < e / 2\<close> \<open>x \<in> ball k r\<close> have "dist x y < e"
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  5290
        by (intro dist_triangle_half_r [of k _ e]) (auto simp: dist_commute)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5291
      with \<open>ball x e \<subseteq> T\<close> show "y \<in> T"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5292
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5293
    next
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5294
      show "x \<in> ball k r" by fact
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5295
    qed
50943
88a00a1c7c2c use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents: 50942
diff changeset
  5296
  qed
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5297
qed
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5298
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5299
lemma compact_eq_seq_compact_metric:
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5300
  "compact (s :: 'a::metric_space set) \<longleftrightarrow> seq_compact s"
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5301
  using compact_imp_seq_compact seq_compact_imp_heine_borel by blast
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5302
66304
cde6ceffcbc7 isabelle update_cartouches -c -t;
wenzelm
parents: 66286
diff changeset
  5303
lemma compact_def: \<comment>\<open>this is the definition of compactness in HOL Light\<close>
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5304
  "compact (S :: 'a::metric_space set) \<longleftrightarrow>
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5305
   (\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l))"
50940
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5306
  unfolding compact_eq_seq_compact_metric seq_compact_def by auto
a7c273a83d27 group compactness-eq-seq-compactness lemmas together
hoelzl
parents: 50939
diff changeset
  5307
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5308
subsubsection \<open>Complete the chain of compactness variants\<close>
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5309
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5310
lemma compact_eq_bolzano_weierstrass:
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5311
  fixes s :: "'a::metric_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5312
  shows "compact s \<longleftrightarrow> (\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5313
  (is "?lhs = ?rhs")
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5314
proof
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5315
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5316
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5317
    using heine_borel_imp_bolzano_weierstrass[of s] by auto
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5318
next
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5319
  assume ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5320
  then show ?lhs
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5321
    unfolding compact_eq_seq_compact_metric by (rule bolzano_weierstrass_imp_seq_compact)
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5322
qed
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5323
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5324
lemma bolzano_weierstrass_imp_bounded:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5325
  "\<forall>t. infinite t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> bounded s"
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5326
  using compact_imp_bounded unfolding compact_eq_bolzano_weierstrass .
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5327
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5328
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5329
subsection \<open>Metric spaces with the Heine-Borel property\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5330
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5331
text \<open>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5332
  A metric space (or topological vector space) is said to have the
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5333
  Heine-Borel property if every closed and bounded subset is compact.
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5334
\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5335
44207
ea99698c2070 locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents: 44170
diff changeset
  5336
class heine_borel = metric_space +
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5337
  assumes bounded_imp_convergent_subsequence:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5338
    "bounded (range f) \<Longrightarrow> \<exists>l r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5339
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5340
lemma bounded_closed_imp_seq_compact:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5341
  fixes s::"'a::heine_borel set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5342
  assumes "bounded s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5343
    and "closed s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5344
  shows "seq_compact s"
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  5345
proof (unfold seq_compact_def, clarify)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5346
  fix f :: "nat \<Rightarrow> 'a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5347
  assume f: "\<forall>n. f n \<in> s"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5348
  with \<open>bounded s\<close> have "bounded (range f)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5349
    by (auto intro: bounded_subset)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5350
  obtain l r where r: "subseq r" and l: "((f \<circ> r) \<longlongrightarrow> l) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5351
    using bounded_imp_convergent_subsequence [OF \<open>bounded (range f)\<close>] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5352
  from f have fr: "\<forall>n. (f \<circ> r) n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5353
    by simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5354
  have "l \<in> s" using \<open>closed s\<close> fr l
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5355
    by (rule closed_sequentially)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5356
  show "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5357
    using \<open>l \<in> s\<close> r l by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5358
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5359
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5360
lemma compact_eq_bounded_closed:
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5361
  fixes s :: "'a::heine_borel set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5362
  shows "compact s \<longleftrightarrow> bounded s \<and> closed s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  5363
  (is "?lhs = ?rhs")
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5364
proof
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5365
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5366
  then show ?rhs
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5367
    using compact_imp_closed compact_imp_bounded
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5368
    by blast
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5369
next
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5370
  assume ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5371
  then show ?lhs
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5372
    using bounded_closed_imp_seq_compact[of s]
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5373
    unfolding compact_eq_seq_compact_metric
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5374
    by auto
50944
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5375
qed
03b11adf1f33 simplified prove of compact_imp_bounded
hoelzl
parents: 50943
diff changeset
  5376
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  5377
lemma compact_closure [simp]:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  5378
  fixes S :: "'a::heine_borel set"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  5379
  shows "compact(closure S) \<longleftrightarrow> bounded S"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  5380
by (meson bounded_closure bounded_subset closed_closure closure_subset compact_eq_bounded_closed)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  5381
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  5382
lemma compact_components:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  5383
  fixes s :: "'a::heine_borel set"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  5384
  shows "\<lbrakk>compact s; c \<in> components s\<rbrakk> \<Longrightarrow> compact c"
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  5385
by (meson bounded_subset closed_components in_components_subset compact_eq_bounded_closed)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  5386
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5387
lemma not_compact_UNIV[simp]:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5388
  fixes s :: "'a::{real_normed_vector,perfect_space,heine_borel} set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5389
  shows "~ compact (UNIV::'a set)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5390
    by (simp add: compact_eq_bounded_closed)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5391
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  5392
(* TODO: is this lemma necessary? *)
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5393
lemma bounded_increasing_convergent:
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5394
  fixes s :: "nat \<Rightarrow> real"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5395
  shows "bounded {s n| n. True} \<Longrightarrow> \<forall>n. s n \<le> s (Suc n) \<Longrightarrow> \<exists>l. s \<longlonglongrightarrow> l"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5396
  using Bseq_mono_convergent[of s] incseq_Suc_iff[of s]
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5397
  by (auto simp: image_def Bseq_eq_bounded convergent_def incseq_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5398
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5399
instance real :: heine_borel
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5400
proof
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5401
  fix f :: "nat \<Rightarrow> real"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5402
  assume f: "bounded (range f)"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5403
  obtain r where r: "subseq r" "monoseq (f \<circ> r)"
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5404
    unfolding comp_def by (metis seq_monosub)
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5405
  then have "Bseq (f \<circ> r)"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5406
    unfolding Bseq_eq_bounded using f by (force intro: bounded_subset)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5407
  with r show "\<exists>l r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5408
    using Bseq_monoseq_convergent[of "f \<circ> r"] by (auto simp: convergent_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5409
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5410
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5411
lemma compact_lemma_general:
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5412
  fixes f :: "nat \<Rightarrow> 'a"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5413
  fixes proj::"'a \<Rightarrow> 'b \<Rightarrow> 'c::heine_borel" (infixl "proj" 60)
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5414
  fixes unproj:: "('b \<Rightarrow> 'c) \<Rightarrow> 'a"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5415
  assumes finite_basis: "finite basis"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5416
  assumes bounded_proj: "\<And>k. k \<in> basis \<Longrightarrow> bounded ((\<lambda>x. x proj k) ` range f)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5417
  assumes proj_unproj: "\<And>e k. k \<in> basis \<Longrightarrow> (unproj e) proj k = e k"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5418
  assumes unproj_proj: "\<And>x. unproj (\<lambda>k. x proj k) = x"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5419
  shows "\<forall>d\<subseteq>basis. \<exists>l::'a. \<exists> r.
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5420
    subseq r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) proj i) (l proj i) < e) sequentially)"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  5421
proof safe
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5422
  fix d :: "'b set"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5423
  assume d: "d \<subseteq> basis"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5424
  with finite_basis have "finite d"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5425
    by (blast intro: finite_subset)
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
  5426
  from this d show "\<exists>l::'a. \<exists>r. subseq r \<and>
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5427
    (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) proj i) (l proj i) < e) sequentially)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5428
  proof (induct d)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5429
    case empty
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5430
    then show ?case
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5431
      unfolding subseq_def by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5432
  next
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5433
    case (insert k d)
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5434
    have k[intro]: "k \<in> basis"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5435
      using insert by auto
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5436
    have s': "bounded ((\<lambda>x. x proj k) ` range f)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5437
      using k
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5438
      by (rule bounded_proj)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5439
    obtain l1::"'a" and r1 where r1: "subseq r1"
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5440
      and lr1: "\<forall>e > 0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially"
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  5441
      using insert(3) using insert(4) by auto
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5442
    have f': "\<forall>n. f (r1 n) proj k \<in> (\<lambda>x. x proj k) ` range f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5443
      by simp
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5444
    have "bounded (range (\<lambda>i. f (r1 i) proj k))"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5445
      by (metis (lifting) bounded_subset f' image_subsetI s')
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5446
    then obtain l2 r2 where r2:"subseq r2" and lr2:"((\<lambda>i. f (r1 (r2 i)) proj k) \<longlongrightarrow> l2) sequentially"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5447
      using bounded_imp_convergent_subsequence[of "\<lambda>i. f (r1 i) proj k"]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5448
      by (auto simp: o_def)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5449
    define r where "r = r1 \<circ> r2"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5450
    have r:"subseq r"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5451
      using r1 and r2 unfolding r_def o_def subseq_def by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5452
    moreover
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5453
    define l where "l = unproj (\<lambda>i. if i = k then l2 else l1 proj i)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5454
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5455
      fix e::real
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5456
      assume "e > 0"
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5457
      from lr1 \<open>e > 0\<close> have N1: "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5458
        by blast
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5459
      from lr2 \<open>e > 0\<close> have N2:"eventually (\<lambda>n. dist (f (r1 (r2 n)) proj k) l2 < e) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5460
        by (rule tendstoD)
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5461
      from r2 N1 have N1': "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 (r2 n)) proj i) (l1 proj i) < e) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5462
        by (rule eventually_subseq)
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5463
      have "eventually (\<lambda>n. \<forall>i\<in>(insert k d). dist (f (r n) proj i) (l proj i) < e) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5464
        using N1' N2
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5465
        by eventually_elim (insert insert.prems, auto simp: l_def r_def o_def proj_unproj)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5466
    }
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5467
    ultimately show ?case by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5468
  qed
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  5469
qed
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  5470
62127
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5471
lemma compact_lemma:
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5472
  fixes f :: "nat \<Rightarrow> 'a::euclidean_space"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5473
  assumes "bounded (range f)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5474
  shows "\<forall>d\<subseteq>Basis. \<exists>l::'a. \<exists> r.
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5475
    subseq r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially)"
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5476
  by (rule compact_lemma_general[where unproj="\<lambda>e. \<Sum>i\<in>Basis. e i *\<^sub>R i"])
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5477
     (auto intro!: assms bounded_linear_inner_left bounded_linear_image
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5478
       simp: euclidean_representation)
d8e7738bd2e9 generalized proofs
immler
parents: 62101
diff changeset
  5479
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  5480
instance euclidean_space \<subseteq> heine_borel
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5481
proof
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5482
  fix f :: "nat \<Rightarrow> 'a"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5483
  assume f: "bounded (range f)"
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  5484
  then obtain l::'a and r where r: "subseq r"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  5485
    and l: "\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5486
    using compact_lemma [OF f] by blast
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5487
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5488
    fix e::real
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5489
    assume "e > 0"
56541
0e3abadbef39 made divide_pos_pos a simp rule
nipkow
parents: 56371
diff changeset
  5490
    hence "e / real_of_nat DIM('a) > 0" by (simp add: DIM_positive)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  5491
    with l have "eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5492
      by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5493
    moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5494
    {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5495
      fix n
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5496
      assume n: "\<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  5497
      have "dist (f (r n)) l \<le> (\<Sum>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i))"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5498
        apply (subst euclidean_dist_l2)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5499
        using zero_le_dist
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  5500
        apply (rule setL2_le_sum)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5501
        done
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  5502
      also have "\<dots> < (\<Sum>i\<in>(Basis::'a set). e / (real_of_nat DIM('a)))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  5503
        apply (rule sum_strict_mono)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5504
        using n
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5505
        apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5506
        done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5507
      finally have "dist (f (r n)) l < e"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  5508
        by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5509
    }
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5510
    ultimately have "eventually (\<lambda>n. dist (f (r n)) l < e) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  5511
      by (rule eventually_mono)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5512
  }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5513
  then have *: "((f \<circ> r) \<longlongrightarrow> l) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5514
    unfolding o_def tendsto_iff by simp
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5515
  with r show "\<exists>l r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5516
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5517
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5518
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5519
lemma bounded_fst: "bounded s \<Longrightarrow> bounded (fst ` s)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5520
  unfolding bounded_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  5521
  by (metis (erased, hide_lams) dist_fst_le image_iff order_trans)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5522
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5523
lemma bounded_snd: "bounded s \<Longrightarrow> bounded (snd ` s)"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5524
  unfolding bounded_def
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  5525
  by (metis (no_types, hide_lams) dist_snd_le image_iff order.trans)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5526
37678
0040bafffdef "prod" and "sum" replace "*" and "+" respectively
haftmann
parents: 37649
diff changeset
  5527
instance prod :: (heine_borel, heine_borel) heine_borel
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5528
proof
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5529
  fix f :: "nat \<Rightarrow> 'a \<times> 'b"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5530
  assume f: "bounded (range f)"
56154
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  5531
  then have "bounded (fst ` range f)"
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  5532
    by (rule bounded_fst)
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  5533
  then have s1: "bounded (range (fst \<circ> f))"
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 56073
diff changeset
  5534
    by (simp add: image_comp)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5535
  obtain l1 r1 where r1: "subseq r1" and l1: "(\<lambda>n. fst (f (r1 n))) \<longlonglongrightarrow> l1"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5536
    using bounded_imp_convergent_subsequence [OF s1] unfolding o_def by fast
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5537
  from f have s2: "bounded (range (snd \<circ> f \<circ> r1))"
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5538
    by (auto simp add: image_comp intro: bounded_snd bounded_subset)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5539
  obtain l2 r2 where r2: "subseq r2" and l2: "((\<lambda>n. snd (f (r1 (r2 n)))) \<longlongrightarrow> l2) sequentially"
50998
501200635659 simplify heine_borel type class
hoelzl
parents: 50973
diff changeset
  5540
    using bounded_imp_convergent_subsequence [OF s2]
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5541
    unfolding o_def by fast
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5542
  have l1': "((\<lambda>n. fst (f (r1 (r2 n)))) \<longlongrightarrow> l1) sequentially"
50972
d2c6a0a7fcdf tuned proof
hoelzl
parents: 50971
diff changeset
  5543
    using LIMSEQ_subseq_LIMSEQ [OF l1 r2] unfolding o_def .
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5544
  have l: "((f \<circ> (r1 \<circ> r2)) \<longlongrightarrow> (l1, l2)) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5545
    using tendsto_Pair [OF l1' l2] unfolding o_def by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5546
  have r: "subseq (r1 \<circ> r2)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5547
    using r1 r2 unfolding subseq_def by simp
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5548
  show "\<exists>l r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5549
    using l r by fast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5550
qed
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
  5551
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5552
subsubsection \<open>Intersecting chains of compact sets\<close>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5553
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5554
proposition bounded_closed_chain:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5555
  fixes \<F> :: "'a::heine_borel set set"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5556
  assumes "B \<in> \<F>" "bounded B" and \<F>: "\<And>S. S \<in> \<F> \<Longrightarrow> closed S" and "{} \<notin> \<F>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5557
      and chain: "\<And>S T. S \<in> \<F> \<and> T \<in> \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5558
    shows "\<Inter>\<F> \<noteq> {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5559
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5560
  have "B \<inter> \<Inter>\<F> \<noteq> {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5561
  proof (rule compact_imp_fip)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5562
    show "compact B" "\<And>T. T \<in> \<F> \<Longrightarrow> closed T"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5563
      by (simp_all add: assms compact_eq_bounded_closed)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5564
    show "\<lbrakk>finite \<G>; \<G> \<subseteq> \<F>\<rbrakk> \<Longrightarrow> B \<inter> \<Inter>\<G> \<noteq> {}" for \<G>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5565
    proof (induction \<G> rule: finite_induct)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5566
      case empty
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5567
      with assms show ?case by force
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5568
    next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5569
      case (insert U \<G>)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5570
      then have "U \<in> \<F>" and ne: "B \<inter> \<Inter>\<G> \<noteq> {}" by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5571
      then consider "B \<subseteq> U" | "U \<subseteq> B"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5572
          using \<open>B \<in> \<F>\<close> chain by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5573
        then show ?case
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5574
        proof cases
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5575
          case 1
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5576
          then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5577
            using Int_left_commute ne by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5578
        next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5579
          case 2
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5580
          have "U \<noteq> {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5581
            using \<open>U \<in> \<F>\<close> \<open>{} \<notin> \<F>\<close> by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5582
          moreover
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5583
          have False if "\<And>x. x \<in> U \<Longrightarrow> \<exists>Y\<in>\<G>. x \<notin> Y"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5584
          proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5585
            have "\<And>x. x \<in> U \<Longrightarrow> \<exists>Y\<in>\<G>. Y \<subseteq> U"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5586
              by (metis chain contra_subsetD insert.prems insert_subset that)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5587
            then obtain Y where "Y \<in> \<G>" "Y \<subseteq> U"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5588
              by (metis all_not_in_conv \<open>U \<noteq> {}\<close>)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5589
            moreover obtain x where "x \<in> \<Inter>\<G>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5590
              by (metis Int_emptyI ne)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5591
            ultimately show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5592
              by (metis Inf_lower subset_eq that)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5593
          qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5594
          with 2 show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5595
            by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5596
        qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5597
      qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5598
  qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5599
  then show ?thesis by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5600
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5601
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5602
corollary compact_chain:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5603
  fixes \<F> :: "'a::heine_borel set set"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5604
  assumes "\<And>S. S \<in> \<F> \<Longrightarrow> compact S" "{} \<notin> \<F>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5605
          "\<And>S T. S \<in> \<F> \<and> T \<in> \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5606
    shows "\<Inter> \<F> \<noteq> {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5607
proof (cases "\<F> = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5608
  case True
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5609
  then show ?thesis by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5610
next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5611
  case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5612
  show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5613
    by (metis False all_not_in_conv assms compact_imp_bounded compact_imp_closed bounded_closed_chain)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5614
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5615
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5616
lemma compact_nest:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5617
  fixes F :: "'a::linorder \<Rightarrow> 'b::heine_borel set"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5618
  assumes F: "\<And>n. compact(F n)" "\<And>n. F n \<noteq> {}" and mono: "\<And>m n. m \<le> n \<Longrightarrow> F n \<subseteq> F m"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5619
  shows "\<Inter>range F \<noteq> {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5620
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5621
  have *: "\<And>S T. S \<in> range F \<and> T \<in> range F \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5622
    by (metis mono image_iff le_cases)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5623
  show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5624
    apply (rule compact_chain [OF _ _ *])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5625
    using F apply (blast intro: dest: *)+
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5626
    done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5627
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  5628
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5629
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5630
subsubsection \<open>Completeness\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5631
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5632
lemma (in metric_space) completeI:
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5633
  assumes "\<And>f. \<forall>n. f n \<in> s \<Longrightarrow> Cauchy f \<Longrightarrow> \<exists>l\<in>s. f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5634
  shows "complete s"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5635
  using assms unfolding complete_def by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5636
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5637
lemma (in metric_space) completeE:
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5638
  assumes "complete s" and "\<forall>n. f n \<in> s" and "Cauchy f"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5639
  obtains l where "l \<in> s" and "f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5640
  using assms unfolding complete_def by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5641
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5642
(* TODO: generalize to uniform spaces *)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5643
lemma compact_imp_complete:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  5644
  fixes s :: "'a::metric_space set"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5645
  assumes "compact s"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5646
  shows "complete s"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5647
proof -
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5648
  {
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5649
    fix f
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5650
    assume as: "(\<forall>n::nat. f n \<in> s)" "Cauchy f"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5651
    from as(1) obtain l r where lr: "l\<in>s" "subseq r" "(f \<circ> r) \<longlonglongrightarrow> l"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5652
      using assms unfolding compact_def by blast
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5653
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5654
    note lr' = seq_suble [OF lr(2)]
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5655
    {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5656
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5657
      assume "e > 0"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5658
      from as(2) obtain N where N:"\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (f m) (f n) < e/2"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5659
        unfolding cauchy_def
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5660
        using \<open>e > 0\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5661
        apply (erule_tac x="e/2" in allE)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5662
        apply auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5663
        done
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  5664
      from lr(3)[unfolded lim_sequentially, THEN spec[where x="e/2"]]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5665
      obtain M where M:"\<forall>n\<ge>M. dist ((f \<circ> r) n) l < e/2"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5666
        using \<open>e > 0\<close> by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5667
      {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5668
        fix n :: nat
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5669
        assume n: "n \<ge> max N M"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5670
        have "dist ((f \<circ> r) n) l < e/2"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5671
          using n M by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5672
        moreover have "r n \<ge> N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5673
          using lr'[of n] n by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5674
        then have "dist (f n) ((f \<circ> r) n) < e / 2"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5675
          using N and n by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5676
        ultimately have "dist (f n) l < e"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5677
          using dist_triangle_half_r[of "f (r n)" "f n" e l]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5678
          by (auto simp add: dist_commute)
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5679
      }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5680
      then have "\<exists>N. \<forall>n\<ge>N. dist (f n) l < e" by blast
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5681
    }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5682
    then have "\<exists>l\<in>s. (f \<longlongrightarrow> l) sequentially" using \<open>l\<in>s\<close>
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  5683
      unfolding lim_sequentially by auto
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5684
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5685
  then show ?thesis unfolding complete_def by auto
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5686
qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5687
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5688
lemma nat_approx_posE:
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5689
  fixes e::real
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5690
  assumes "0 < e"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5691
  obtains n :: nat where "1 / (Suc n) < e"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5692
proof atomize_elim
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  5693
  have "1 / real (Suc (nat \<lceil>1/e\<rceil>)) < 1 / \<lceil>1/e\<rceil>"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5694
    by (rule divide_strict_left_mono) (auto simp: \<open>0 < e\<close>)
61942
f02b26f7d39d prefer symbols for "floor", "ceiling";
wenzelm
parents: 61915
diff changeset
  5695
  also have "1 / \<lceil>1/e\<rceil> \<le> 1 / (1/e)"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5696
    by (rule divide_left_mono) (auto simp: \<open>0 < e\<close> ceiling_correct)
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5697
  also have "\<dots> = e" by simp
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5698
  finally show  "\<exists>n. 1 / real (Suc n) < e" ..
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5699
qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5700
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5701
lemma compact_eq_totally_bounded:
58184
db1381d811ab cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents: 57865
diff changeset
  5702
  "compact s \<longleftrightarrow> complete s \<and> (\<forall>e>0. \<exists>k. finite k \<and> s \<subseteq> (\<Union>x\<in>k. ball x e))"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5703
    (is "_ \<longleftrightarrow> ?rhs")
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5704
proof
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5705
  assume assms: "?rhs"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5706
  then obtain k where k: "\<And>e. 0 < e \<Longrightarrow> finite (k e)" "\<And>e. 0 < e \<Longrightarrow> s \<subseteq> (\<Union>x\<in>k e. ball x e)"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5707
    by (auto simp: choice_iff')
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5708
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5709
  show "compact s"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5710
  proof cases
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5711
    assume "s = {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5712
    then show "compact s" by (simp add: compact_def)
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5713
  next
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5714
    assume "s \<noteq> {}"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5715
    show ?thesis
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5716
      unfolding compact_def
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5717
    proof safe
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5718
      fix f :: "nat \<Rightarrow> 'a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5719
      assume f: "\<forall>n. f n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5720
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5721
      define e where "e n = 1 / (2 * Suc n)" for n
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5722
      then have [simp]: "\<And>n. 0 < e n" by auto
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5723
      define B where "B n U = (SOME b. infinite {n. f n \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U))" for n U
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5724
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5725
        fix n U
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5726
        assume "infinite {n. f n \<in> U}"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5727
        then have "\<exists>b\<in>k (e n). infinite {i\<in>{n. f n \<in> U}. f i \<in> ball b (e n)}"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5728
          using k f by (intro pigeonhole_infinite_rel) (auto simp: subset_eq)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5729
        then obtain a where
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5730
          "a \<in> k (e n)"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  5731
          "infinite {i \<in> {n. f n \<in> U}. f i \<in> ball a (e n)}" ..
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5732
        then have "\<exists>b. infinite {i. f i \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U)"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5733
          by (intro exI[of _ "ball a (e n) \<inter> U"] exI[of _ a]) (auto simp: ac_simps)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5734
        from someI_ex[OF this]
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5735
        have "infinite {i. f i \<in> B n U}" "\<exists>x. B n U \<subseteq> ball x (e n) \<inter> U"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5736
          unfolding B_def by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5737
      }
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5738
      note B = this
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5739
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5740
      define F where "F = rec_nat (B 0 UNIV) B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5741
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5742
        fix n
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5743
        have "infinite {i. f i \<in> F n}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5744
          by (induct n) (auto simp: F_def B)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5745
      }
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5746
      then have F: "\<And>n. \<exists>x. F (Suc n) \<subseteq> ball x (e n) \<inter> F n"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5747
        using B by (simp add: F_def)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5748
      then have F_dec: "\<And>m n. m \<le> n \<Longrightarrow> F n \<subseteq> F m"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5749
        using decseq_SucI[of F] by (auto simp: decseq_def)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5750
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5751
      obtain sel where sel: "\<And>k i. i < sel k i" "\<And>k i. f (sel k i) \<in> F k"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5752
      proof (atomize_elim, unfold all_conj_distrib[symmetric], intro choice allI)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5753
        fix k i
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5754
        have "infinite ({n. f n \<in> F k} - {.. i})"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5755
          using \<open>infinite {n. f n \<in> F k}\<close> by auto
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5756
        from infinite_imp_nonempty[OF this]
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5757
        show "\<exists>x>i. f x \<in> F k"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5758
          by (simp add: set_eq_iff not_le conj_commute)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5759
      qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5760
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  5761
      define t where "t = rec_nat (sel 0 0) (\<lambda>n i. sel (Suc n) i)"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5762
      have "subseq t"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5763
        unfolding subseq_Suc_iff by (simp add: t_def sel)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5764
      moreover have "\<forall>i. (f \<circ> t) i \<in> s"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5765
        using f by auto
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5766
      moreover
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5767
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5768
        fix n
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5769
        have "(f \<circ> t) n \<in> F n"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5770
          by (cases n) (simp_all add: t_def sel)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5771
      }
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5772
      note t = this
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5773
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5774
      have "Cauchy (f \<circ> t)"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5775
      proof (safe intro!: metric_CauchyI exI elim!: nat_approx_posE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5776
        fix r :: real and N n m
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5777
        assume "1 / Suc N < r" "Suc N \<le> n" "Suc N \<le> m"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5778
        then have "(f \<circ> t) n \<in> F (Suc N)" "(f \<circ> t) m \<in> F (Suc N)" "2 * e N < r"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  5779
          using F_dec t by (auto simp: e_def field_simps of_nat_Suc)
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5780
        with F[of N] obtain x where "dist x ((f \<circ> t) n) < e N" "dist x ((f \<circ> t) m) < e N"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5781
          by (auto simp: subset_eq)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5782
        with dist_triangle[of "(f \<circ> t) m" "(f \<circ> t) n" x] \<open>2 * e N < r\<close>
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5783
        show "dist ((f \<circ> t) m) ((f \<circ> t) n) < r"
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5784
          by (simp add: dist_commute)
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5785
      qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5786
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5787
      ultimately show "\<exists>l\<in>s. \<exists>r. subseq r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5788
        using assms unfolding complete_def by blast
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5789
    qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5790
  qed
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5791
qed (metis compact_imp_complete compact_imp_seq_compact seq_compact_imp_totally_bounded)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5792
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5793
lemma cauchy_imp_bounded:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5794
  assumes "Cauchy s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5795
  shows "bounded (range s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5796
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5797
  from assms obtain N :: nat where "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < 1"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5798
    unfolding cauchy_def
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5799
    apply (erule_tac x= 1 in allE)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5800
    apply auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5801
    done
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5802
  then have N:"\<forall>n. N \<le> n \<longrightarrow> dist (s N) (s n) < 1" by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5803
  moreover
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5804
  have "bounded (s ` {0..N})"
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5805
    using finite_imp_bounded[of "s ` {1..N}"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5806
  then obtain a where a:"\<forall>x\<in>s ` {0..N}. dist (s N) x \<le> a"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5807
    unfolding bounded_any_center [where a="s N"] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5808
  ultimately show "?thesis"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5809
    unfolding bounded_any_center [where a="s N"]
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5810
    apply (rule_tac x="max a 1" in exI)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5811
    apply auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5812
    apply (erule_tac x=y in allE)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5813
    apply (erule_tac x=y in ballE)
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5814
    apply auto
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5815
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5816
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5817
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5818
instance heine_borel < complete_space
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5819
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5820
  fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5821
  then have "bounded (range f)"
34104
22758f95e624 re-state lemmas using 'range'
huffman
parents: 33758
diff changeset
  5822
    by (rule cauchy_imp_bounded)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5823
  then have "compact (closure (range f))"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5824
    unfolding compact_eq_bounded_closed by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5825
  then have "complete (closure (range f))"
50971
5e3d3d690975 tune prove compact_eq_totally_bounded
hoelzl
parents: 50970
diff changeset
  5826
    by (rule compact_imp_complete)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5827
  moreover have "\<forall>n. f n \<in> closure (range f)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5828
    using closure_subset [of "range f"] by auto
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  5829
  ultimately have "\<exists>l\<in>closure (range f). (f \<longlongrightarrow> l) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5830
    using \<open>Cauchy f\<close> unfolding complete_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5831
  then show "convergent f"
36660
1cc4ab4b7ff7 make (X ----> L) an abbreviation for (X ---> L) sequentially
huffman
parents: 36659
diff changeset
  5832
    unfolding convergent_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5833
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5834
44632
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  5835
instance euclidean_space \<subseteq> banach ..
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  5836
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5837
lemma complete_UNIV: "complete (UNIV :: ('a::complete_space) set)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5838
proof (rule completeI)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5839
  fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5840
  then have "convergent f" by (rule Cauchy_convergent)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5841
  then show "\<exists>l\<in>UNIV. f \<longlonglongrightarrow> l" unfolding convergent_def by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5842
qed
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5843
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5844
lemma complete_imp_closed:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5845
  fixes S :: "'a::metric_space set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5846
  assumes "complete S"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5847
  shows "closed S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5848
proof (unfold closed_sequential_limits, clarify)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5849
  fix f x assume "\<forall>n. f n \<in> S" and "f \<longlonglongrightarrow> x"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5850
  from \<open>f \<longlonglongrightarrow> x\<close> have "Cauchy f"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5851
    by (rule LIMSEQ_imp_Cauchy)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5852
  with \<open>complete S\<close> and \<open>\<forall>n. f n \<in> S\<close> obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5853
    by (rule completeE)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5854
  from \<open>f \<longlonglongrightarrow> x\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "x = l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5855
    by (rule LIMSEQ_unique)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5856
  with \<open>l \<in> S\<close> show "x \<in> S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5857
    by simp
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5858
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5859
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  5860
lemma complete_Int_closed:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5861
  fixes S :: "'a::metric_space set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5862
  assumes "complete S" and "closed t"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5863
  shows "complete (S \<inter> t)"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5864
proof (rule completeI)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5865
  fix f assume "\<forall>n. f n \<in> S \<inter> t" and "Cauchy f"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5866
  then have "\<forall>n. f n \<in> S" and "\<forall>n. f n \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5867
    by simp_all
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5868
  from \<open>complete S\<close> obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5869
    using \<open>\<forall>n. f n \<in> S\<close> and \<open>Cauchy f\<close> by (rule completeE)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5870
  from \<open>closed t\<close> and \<open>\<forall>n. f n \<in> t\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "l \<in> t"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5871
    by (rule closed_sequentially)
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5872
  with \<open>l \<in> S\<close> and \<open>f \<longlonglongrightarrow> l\<close> show "\<exists>l\<in>S \<inter> t. f \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5873
    by fast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5874
qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5875
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5876
lemma complete_closed_subset:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5877
  fixes S :: "'a::metric_space set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5878
  assumes "closed S" and "S \<subseteq> t" and "complete t"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5879
  shows "complete S"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5880
  using assms complete_Int_closed [of t S] by (simp add: Int_absorb1)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5881
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5882
lemma complete_eq_closed:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5883
  fixes S :: "('a::complete_space) set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5884
  shows "complete S \<longleftrightarrow> closed S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5885
proof
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5886
  assume "closed S" then show "complete S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5887
    using subset_UNIV complete_UNIV by (rule complete_closed_subset)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5888
next
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5889
  assume "complete S" then show "closed S"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5890
    by (rule complete_imp_closed)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5891
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5892
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5893
lemma convergent_eq_Cauchy:
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5894
  fixes S :: "nat \<Rightarrow> 'a::complete_space"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5895
  shows "(\<exists>l. (S \<longlongrightarrow> l) sequentially) \<longleftrightarrow> Cauchy S"
44632
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  5896
  unfolding Cauchy_convergent_iff convergent_def ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5897
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5898
lemma convergent_imp_bounded:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5899
  fixes S :: "nat \<Rightarrow> 'a::metric_space"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5900
  shows "(S \<longlongrightarrow> l) sequentially \<Longrightarrow> bounded (range S)"
50939
ae7cd20ed118 replace convergent_imp_cauchy by LIMSEQ_imp_Cauchy
hoelzl
parents: 50938
diff changeset
  5901
  by (intro cauchy_imp_bounded LIMSEQ_imp_Cauchy)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5902
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5903
lemma compact_cball[simp]:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5904
  fixes x :: "'a::heine_borel"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5905
  shows "compact (cball x e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5906
  using compact_eq_bounded_closed bounded_cball closed_cball
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5907
  by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5908
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5909
lemma compact_frontier_bounded[intro]:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5910
  fixes S :: "'a::heine_borel set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5911
  shows "bounded S \<Longrightarrow> compact (frontier S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5912
  unfolding frontier_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5913
  using compact_eq_bounded_closed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5914
  by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5915
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5916
lemma compact_frontier[intro]:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5917
  fixes S :: "'a::heine_borel set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5918
  shows "compact S \<Longrightarrow> compact (frontier S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5919
  using compact_eq_bounded_closed compact_frontier_bounded
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5920
  by blast
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5921
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5922
corollary compact_sphere [simp]:
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5923
  fixes a :: "'a::{real_normed_vector,perfect_space,heine_borel}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5924
  shows "compact (sphere a r)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5925
using compact_frontier [of "cball a r"] by simp
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  5926
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5927
corollary bounded_sphere [simp]:
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5928
  fixes a :: "'a::{real_normed_vector,perfect_space,heine_borel}"
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5929
  shows "bounded (sphere a r)"
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5930
by (simp add: compact_imp_bounded)
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5931
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5932
corollary closed_sphere  [simp]:
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5933
  fixes a :: "'a::{real_normed_vector,perfect_space,heine_borel}"
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5934
  shows "closed (sphere a r)"
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5935
by (simp add: compact_imp_closed)
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5936
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5937
lemma frontier_subset_compact:
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5938
  fixes S :: "'a::heine_borel set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  5939
  shows "compact S \<Longrightarrow> frontier S \<subseteq> S"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5940
  using frontier_subset_closed compact_eq_bounded_closed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5941
  by blast
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  5942
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5943
subsection\<open>Relations among convergence and absolute convergence for power series.\<close>
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5944
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5945
lemma summable_imp_bounded:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5946
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5947
  shows "summable f \<Longrightarrow> bounded (range f)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5948
by (frule summable_LIMSEQ_zero) (simp add: convergent_imp_bounded)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5949
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5950
lemma summable_imp_sums_bounded:
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  5951
   "summable f \<Longrightarrow> bounded (range (\<lambda>n. sum f {..<n}))"
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5952
by (auto simp: summable_def sums_def dest: convergent_imp_bounded)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5953
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5954
lemma power_series_conv_imp_absconv_weak:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5955
  fixes a:: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}" and w :: 'a
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5956
  assumes sum: "summable (\<lambda>n. a n * z ^ n)" and no: "norm w < norm z"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5957
    shows "summable (\<lambda>n. of_real(norm(a n)) * w ^ n)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5958
proof -
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5959
  obtain M where M: "\<And>x. norm (a x * z ^ x) \<le> M"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5960
    using summable_imp_bounded [OF sum] by (force simp add: bounded_iff)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5961
  then have *: "summable (\<lambda>n. norm (a n) * norm w ^ n)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5962
    by (rule_tac M=M in Abel_lemma) (auto simp: norm_mult norm_power intro: no)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5963
  show ?thesis
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5964
    apply (rule series_comparison_complex [of "(\<lambda>n. of_real(norm(a n) * norm w ^ n))"])
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5965
    apply (simp only: summable_complex_of_real *)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5966
    apply (auto simp: norm_mult norm_power)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5967
    done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5968
qed
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  5969
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  5970
subsection \<open>Bounded closed nest property (proof does not use Heine-Borel)\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5971
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  5972
lemma bounded_closed_nest:
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5973
  fixes s :: "nat \<Rightarrow> ('a::heine_borel) set"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5974
  assumes "\<forall>n. closed (s n)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5975
    and "\<forall>n. s n \<noteq> {}"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5976
    and "\<forall>m n. m \<le> n \<longrightarrow> s n \<subseteq> s m"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5977
    and "bounded (s 0)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5978
  shows "\<exists>a. \<forall>n. a \<in> s n"
52624
8a7b59a81088 tuned proofs;
wenzelm
parents: 52141
diff changeset
  5979
proof -
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5980
  from assms(2) obtain x where x: "\<forall>n. x n \<in> s n"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5981
    using choice[of "\<lambda>n x. x \<in> s n"] by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5982
  from assms(4,1) have "seq_compact (s 0)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5983
    by (simp add: bounded_closed_imp_seq_compact)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5984
  then obtain l r where lr: "l \<in> s 0" "subseq r" "(x \<circ> r) \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5985
    using x and assms(3) unfolding seq_compact_def by blast
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5986
  have "\<forall>n. l \<in> s n"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5987
  proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  5988
    fix n :: nat
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5989
    have "closed (s n)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5990
      using assms(1) by simp
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5991
    moreover have "\<forall>i. (x \<circ> r) i \<in> s i"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5992
      using x and assms(3) and lr(2) [THEN seq_suble] by auto
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5993
    then have "\<forall>i. (x \<circ> r) (i + n) \<in> s n"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5994
      using assms(3) by (fast intro!: le_add2)
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  5995
    moreover have "(\<lambda>i. (x \<circ> r) (i + n)) \<longlonglongrightarrow> l"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5996
      using lr(3) by (rule LIMSEQ_ignore_initial_segment)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5997
    ultimately show "l \<in> s n"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5998
      by (rule closed_sequentially)
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  5999
  qed
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6000
  then show ?thesis ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6001
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6002
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6003
text \<open>Decreasing case does not even need compactness, just completeness.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6004
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6005
lemma decreasing_closed_nest:
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6006
  fixes s :: "nat \<Rightarrow> ('a::complete_space) set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6007
  assumes
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6008
    "\<forall>n. closed (s n)"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6009
    "\<forall>n. s n \<noteq> {}"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6010
    "\<forall>m n. m \<le> n \<longrightarrow> s n \<subseteq> s m"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6011
    "\<forall>e>0. \<exists>n. \<forall>x\<in>s n. \<forall>y\<in>s n. dist x y < e"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6012
  shows "\<exists>a. \<forall>n. a \<in> s n"
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6013
proof -
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6014
  have "\<forall>n. \<exists>x. x \<in> s n"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6015
    using assms(2) by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6016
  then have "\<exists>t. \<forall>n. t n \<in> s n"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6017
    using choice[of "\<lambda>n x. x \<in> s n"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6018
  then obtain t where t: "\<forall>n. t n \<in> s n" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6019
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6020
    fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6021
    assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6022
    then obtain N where N:"\<forall>x\<in>s N. \<forall>y\<in>s N. dist x y < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6023
      using assms(4) by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6024
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6025
      fix m n :: nat
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6026
      assume "N \<le> m \<and> N \<le> n"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6027
      then have "t m \<in> s N" "t n \<in> s N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6028
        using assms(3) t unfolding  subset_eq t by blast+
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6029
      then have "dist (t m) (t n) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6030
        using N by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6031
    }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6032
    then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (t m) (t n) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6033
      by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6034
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6035
  then have "Cauchy t"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6036
    unfolding cauchy_def by auto
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6037
  then obtain l where l:"(t \<longlongrightarrow> l) sequentially"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6038
    using complete_UNIV unfolding complete_def by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6039
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6040
    fix n :: nat
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6041
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6042
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6043
      assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6044
      then obtain N :: nat where N: "\<forall>n\<ge>N. dist (t n) l < e"
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  6045
        using l[unfolded lim_sequentially] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6046
      have "t (max n N) \<in> s n"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6047
        using assms(3)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6048
        unfolding subset_eq
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6049
        apply (erule_tac x=n in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6050
        apply (erule_tac x="max n N" in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6051
        using t
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6052
        apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6053
        done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6054
      then have "\<exists>y\<in>s n. dist y l < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6055
        apply (rule_tac x="t (max n N)" in bexI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6056
        using N
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6057
        apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6058
        done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6059
    }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6060
    then have "l \<in> s n"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6061
      using closed_approachable[of "s n" l] assms(1) by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6062
  }
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6063
  then show ?thesis by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6064
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6065
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6066
text \<open>Strengthen it to the intersection actually being a singleton.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6067
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6068
lemma decreasing_closed_nest_sing:
44632
076a45f65e12 simplify/generalize some proofs
huffman
parents: 44628
diff changeset
  6069
  fixes s :: "nat \<Rightarrow> 'a::complete_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6070
  assumes
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6071
    "\<forall>n. closed(s n)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6072
    "\<forall>n. s n \<noteq> {}"
54070
1a13325269c2 new topological lemmas; tuned proofs
huffman
parents: 53862
diff changeset
  6073
    "\<forall>m n. m \<le> n \<longrightarrow> s n \<subseteq> s m"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6074
    "\<forall>e>0. \<exists>n. \<forall>x \<in> (s n). \<forall> y\<in>(s n). dist x y < e"
34104
22758f95e624 re-state lemmas using 'range'
huffman
parents: 33758
diff changeset
  6075
  shows "\<exists>a. \<Inter>(range s) = {a}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6076
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6077
  obtain a where a: "\<forall>n. a \<in> s n"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6078
    using decreasing_closed_nest[of s] using assms by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6079
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6080
    fix b
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6081
    assume b: "b \<in> \<Inter>(range s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6082
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6083
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6084
      assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6085
      then have "dist a b < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6086
        using assms(4) and b and a by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6087
    }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6088
    then have "dist a b = 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6089
      by (metis dist_eq_0_iff dist_nz less_le)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6090
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6091
  with a have "\<Inter>(range s) = {a}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6092
    unfolding image_def by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6093
  then show ?thesis ..
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6094
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6095
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  6096
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6097
subsection \<open>Continuity\<close>
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6098
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6099
text\<open>Derive the epsilon-delta forms, which we often use as "definitions"\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6100
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6101
lemma continuous_within_eps_delta:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6102
  "continuous (at x within s) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'\<in> s.  dist x' x < d --> dist (f x') (f x) < e)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6103
  unfolding continuous_within and Lim_within
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6104
  apply auto
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  6105
  apply (metis dist_nz dist_self)
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  6106
  apply blast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6107
  done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6108
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6109
corollary continuous_at_eps_delta:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6110
  "continuous (at x) f \<longleftrightarrow> (\<forall>e > 0. \<exists>d > 0. \<forall>x'. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  6111
  using continuous_within_eps_delta [of x UNIV f] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6112
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  6113
lemma continuous_at_right_real_increasing:
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6114
  fixes f :: "real \<Rightarrow> real"
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6115
  assumes nondecF: "\<And>x y. x \<le> y \<Longrightarrow> f x \<le> f y"
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6116
  shows "continuous (at_right a) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f (a + d) - f a < e)"
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6117
  apply (simp add: greaterThan_def dist_real_def continuous_within Lim_within_le)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6118
  apply (intro all_cong ex_cong)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6119
  apply safe
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6120
  apply (erule_tac x="a + d" in allE)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6121
  apply simp
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6122
  apply (simp add: nondecF field_simps)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6123
  apply (drule nondecF)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6124
  apply simp
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6125
  done
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  6126
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  6127
lemma continuous_at_left_real_increasing:
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  6128
  assumes nondecF: "\<And> x y. x \<le> y \<Longrightarrow> f x \<le> ((f y) :: real)"
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  6129
  shows "(continuous (at_left (a :: real)) f) = (\<forall>e > 0. \<exists>delta > 0. f a - f (a - delta) < e)"
57448
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6130
  apply (simp add: lessThan_def dist_real_def continuous_within Lim_within_le)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6131
  apply (intro all_cong ex_cong)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6132
  apply safe
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6133
  apply (erule_tac x="a - d" in allE)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6134
  apply simp
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6135
  apply (simp add: nondecF field_simps)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6136
  apply (cut_tac x="a - d" and y="x" in nondecF)
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6137
  apply simp_all
159e45728ceb more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents: 57447
diff changeset
  6138
  done
57447
87429bdecad5 import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents: 57418
diff changeset
  6139
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6140
text\<open>Versions in terms of open balls.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6141
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6142
lemma continuous_within_ball:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6143
  "continuous (at x within s) f \<longleftrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6144
    (\<forall>e > 0. \<exists>d > 0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6145
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6146
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6147
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6148
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6149
    fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6150
    assume "e > 0"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6151
    then obtain d where d: "d>0" "\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6152
      using \<open>?lhs\<close>[unfolded continuous_within Lim_within] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6153
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6154
      fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6155
      assume "y \<in> f ` (ball x d \<inter> s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6156
      then have "y \<in> ball (f x) e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6157
        using d(2)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6158
        apply (auto simp add: dist_commute)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6159
        apply (erule_tac x=xa in ballE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6160
        apply auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6161
        using \<open>e > 0\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6162
        apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6163
        done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6164
    }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6165
    then have "\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6166
      using \<open>d > 0\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6167
      unfolding subset_eq ball_def by (auto simp add: dist_commute)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6168
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6169
  then show ?rhs by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6170
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6171
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6172
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6173
    unfolding continuous_within Lim_within ball_def subset_eq
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6174
    apply (auto simp add: dist_commute)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6175
    apply (erule_tac x=e in allE)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  6176
    apply auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6177
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6178
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6179
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6180
lemma continuous_at_ball:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6181
  "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f ` (ball x d) \<subseteq> ball (f x) e)" (is "?lhs = ?rhs")
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6182
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6183
  assume ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6184
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6185
    unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6186
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6187
    apply (erule_tac x=e in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6188
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6189
    apply (rule_tac x=d in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6190
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6191
    apply (erule_tac x=xa in allE)
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6192
    apply (auto simp add: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6193
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6194
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6195
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6196
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6197
    unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6198
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6199
    apply (erule_tac x=e in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6200
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6201
    apply (rule_tac x=d in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6202
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6203
    apply (erule_tac x="f xa" in allE)
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6204
    apply (auto simp add: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6205
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6206
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6207
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6208
text\<open>Define setwise continuity in terms of limits within the set.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6209
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  6210
lemma continuous_on_iff:
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  6211
  "continuous_on s f \<longleftrightarrow>
36440
89a70297564d simplify definition of continuous_on; generalize some lemmas
huffman
parents: 36439
diff changeset
  6212
    (\<forall>x\<in>s. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6213
  unfolding continuous_on_def Lim_within
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  6214
  by (metis dist_pos_lt dist_self)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6215
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6216
lemma continuous_within_E:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6217
  assumes "continuous (at x within s) f" "e>0"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6218
  obtains d where "d>0"  "\<And>x'. \<lbrakk>x'\<in> s; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6219
  using assms apply (simp add: continuous_within_eps_delta)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6220
  apply (drule spec [of _ e], clarify)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6221
  apply (rule_tac d="d/2" in that, auto)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6222
  done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6223
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6224
lemma continuous_onI [intro?]:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6225
  assumes "\<And>x e. \<lbrakk>e > 0; x \<in> s\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) \<le> e"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6226
  shows "continuous_on s f"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6227
apply (simp add: continuous_on_iff, clarify)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6228
apply (rule ex_forward [OF assms [OF half_gt_zero]], auto)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6229
done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 62127
diff changeset
  6230
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6231
text\<open>Some simple consequential lemmas.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6232
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6233
lemma continuous_onE:
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  6234
    assumes "continuous_on s f" "x\<in>s" "e>0"
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6235
    obtains d where "d>0"  "\<And>x'. \<lbrakk>x' \<in> s; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6236
  using assms
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6237
  apply (simp add: continuous_on_iff)
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6238
  apply (elim ballE allE)
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6239
  apply (auto intro: that [where d="d/2" for d])
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  6240
  done
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  6241
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  6242
lemma uniformly_continuous_onE:
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  6243
  assumes "uniformly_continuous_on s f" "0 < e"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  6244
  obtains d where "d>0" "\<And>x x'. \<lbrakk>x\<in>s; x'\<in>s; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  6245
using assms
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  6246
by (auto simp: uniformly_continuous_on_def)
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  6247
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6248
lemma continuous_at_imp_continuous_within:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6249
  "continuous (at x) f \<Longrightarrow> continuous (at x within s) f"
60762
bf0c76ccee8d new material for multivariate analysis, etc.
paulson
parents: 60615
diff changeset
  6250
  unfolding continuous_within continuous_at using Lim_at_imp_Lim_at_within by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6251
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6252
lemma Lim_trivial_limit: "trivial_limit net \<Longrightarrow> (f \<longlongrightarrow> l) net"
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 51475
diff changeset
  6253
  by simp
36440
89a70297564d simplify definition of continuous_on; generalize some lemmas
huffman
parents: 36439
diff changeset
  6254
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  6255
lemmas continuous_on = continuous_on_def \<comment> "legacy theorem name"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6256
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6257
lemma continuous_within_subset:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6258
  "continuous (at x within s) f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> continuous (at x within t) f"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  6259
  unfolding continuous_within by(metis tendsto_within_subset)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6260
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6261
lemma continuous_on_interior:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6262
  "continuous_on s f \<Longrightarrow> x \<in> interior s \<Longrightarrow> continuous (at x) f"
55775
1557a391a858 A bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 55522
diff changeset
  6263
  by (metis continuous_on_eq_continuous_at continuous_on_subset interiorE)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6264
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6265
lemma continuous_on_eq:
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 61076
diff changeset
  6266
  "\<lbrakk>continuous_on s f; \<And>x. x \<in> s \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> continuous_on s g"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  6267
  unfolding continuous_on_def tendsto_def eventually_at_topological
36440
89a70297564d simplify definition of continuous_on; generalize some lemmas
huffman
parents: 36439
diff changeset
  6268
  by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6269
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6270
text \<open>Characterization of various kinds of continuity in terms of sequences.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6271
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6272
lemma continuous_within_sequentially:
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6273
  fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6274
  shows "continuous (at a within s) f \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6275
    (\<forall>x. (\<forall>n::nat. x n \<in> s) \<and> (x \<longlongrightarrow> a) sequentially
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6276
         \<longrightarrow> ((f \<circ> x) \<longlongrightarrow> f a) sequentially)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6277
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6278
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6279
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6280
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6281
    fix x :: "nat \<Rightarrow> 'a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6282
    assume x: "\<forall>n. x n \<in> s" "\<forall>e>0. eventually (\<lambda>n. dist (x n) a < e) sequentially"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6283
    fix T :: "'b set"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6284
    assume "open T" and "f a \<in> T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6285
    with \<open>?lhs\<close> obtain d where "d>0" and d:"\<forall>x\<in>s. 0 < dist x a \<and> dist x a < d \<longrightarrow> f x \<in> T"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6286
      unfolding continuous_within tendsto_def eventually_at by auto
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6287
    have "eventually (\<lambda>n. dist (x n) a < d) sequentially"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6288
      using x(2) \<open>d>0\<close> by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6289
    then have "eventually (\<lambda>n. (f \<circ> x) n \<in> T) sequentially"
46887
cb891d9a23c1 use eventually_elim method
noschinl
parents: 45776
diff changeset
  6290
    proof eventually_elim
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6291
      case (elim n)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6292
      then show ?case
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6293
        using d x(1) \<open>f a \<in> T\<close> by auto
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6294
    qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6295
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6296
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6297
    unfolding tendsto_iff tendsto_def by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6298
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6299
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6300
  then show ?lhs
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6301
    unfolding continuous_within tendsto_def [where l="f a"]
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6302
    by (simp add: sequentially_imp_eventually_within)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6303
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6304
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6305
lemma continuous_at_sequentially:
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6306
  fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6307
  shows "continuous (at a) f \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6308
    (\<forall>x. (x \<longlongrightarrow> a) sequentially --> ((f \<circ> x) \<longlongrightarrow> f a) sequentially)"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  6309
  using continuous_within_sequentially[of a UNIV f] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6310
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6311
lemma continuous_on_sequentially:
44533
7abe4a59f75d generalize and simplify proof of continuous_within_sequentially
huffman
parents: 44531
diff changeset
  6312
  fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  6313
  shows "continuous_on s f \<longleftrightarrow>
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6314
    (\<forall>x. \<forall>a \<in> s. (\<forall>n. x(n) \<in> s) \<and> (x \<longlongrightarrow> a) sequentially
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6315
      --> ((f \<circ> x) \<longlongrightarrow> f a) sequentially)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6316
  (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6317
proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6318
  assume ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6319
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6320
    using continuous_within_sequentially[of _ s f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6321
    unfolding continuous_on_eq_continuous_within
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6322
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6323
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6324
  assume ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6325
  then show ?rhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6326
    unfolding continuous_on_eq_continuous_within
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6327
    using continuous_within_sequentially[of _ s f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6328
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6329
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6330
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6331
lemma uniformly_continuous_on_sequentially:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  6332
  "uniformly_continuous_on s f \<longleftrightarrow> (\<forall>x y. (\<forall>n. x n \<in> s) \<and> (\<forall>n. y n \<in> s) \<and>
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  6333
    (\<lambda>n. dist (x n) (y n)) \<longlonglongrightarrow> 0 \<longrightarrow> (\<lambda>n. dist (f(x n)) (f(y n))) \<longlonglongrightarrow> 0)" (is "?lhs = ?rhs")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6334
proof
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6335
  assume ?lhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6336
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6337
    fix x y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6338
    assume x: "\<forall>n. x n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6339
      and y: "\<forall>n. y n \<in> s"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6340
      and xy: "((\<lambda>n. dist (x n) (y n)) \<longlongrightarrow> 0) sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6341
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6342
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6343
      assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6344
      then obtain d where "d > 0" and d: "\<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6345
        using \<open>?lhs\<close>[unfolded uniformly_continuous_on_def, THEN spec[where x=e]] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6346
      obtain N where N: "\<forall>n\<ge>N. dist (x n) (y n) < d"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6347
        using xy[unfolded lim_sequentially dist_norm] and \<open>d>0\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6348
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6349
        fix n
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6350
        assume "n\<ge>N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6351
        then have "dist (f (x n)) (f (y n)) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6352
          using N[THEN spec[where x=n]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6353
          using d[THEN bspec[where x="x n"], THEN bspec[where x="y n"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6354
          using x and y
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  6355
          by (simp add: dist_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6356
      }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6357
      then have "\<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6358
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6359
    }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  6360
    then have "((\<lambda>n. dist (f(x n)) (f(y n))) \<longlongrightarrow> 0) sequentially"
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  6361
      unfolding lim_sequentially and dist_real_def by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6362
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6363
  then show ?rhs by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6364
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6365
  assume ?rhs
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6366
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6367
    assume "\<not> ?lhs"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6368
    then obtain e where "e > 0" "\<forall>d>0. \<exists>x\<in>s. \<exists>x'\<in>s. dist x' x < d \<and> \<not> dist (f x') (f x) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6369
      unfolding uniformly_continuous_on_def by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6370
    then obtain fa where fa:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6371
      "\<forall>x. 0 < x \<longrightarrow> fst (fa x) \<in> s \<and> snd (fa x) \<in> s \<and> dist (fst (fa x)) (snd (fa x)) < x \<and> \<not> dist (f (fst (fa x))) (f (snd (fa x))) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6372
      using choice[of "\<lambda>d x. d>0 \<longrightarrow> fst x \<in> s \<and> snd x \<in> s \<and> dist (snd x) (fst x) < d \<and> \<not> dist (f (snd x)) (f (fst x)) < e"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6373
      unfolding Bex_def
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6374
      by (auto simp add: dist_commute)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  6375
    define x where "x n = fst (fa (inverse (real n + 1)))" for n
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  6376
    define y where "y n = snd (fa (inverse (real n + 1)))" for n
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6377
    have xyn: "\<forall>n. x n \<in> s \<and> y n \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6378
      and xy0: "\<forall>n. dist (x n) (y n) < inverse (real n + 1)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6379
      and fxy:"\<forall>n. \<not> dist (f (x n)) (f (y n)) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6380
      unfolding x_def and y_def using fa
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6381
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6382
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6383
      fix e :: real
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6384
      assume "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6385
      then obtain N :: nat where "N \<noteq> 0" and N: "0 < inverse (real N) \<and> inverse (real N) < e"
62623
dbc62f86a1a9 rationalisation of theorem names esp about "real Archimedian" etc.
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  6386
        unfolding real_arch_inverse[of e] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6387
      {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6388
        fix n :: nat
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6389
        assume "n \<ge> N"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6390
        then have "inverse (real n + 1) < inverse (real N)"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  6391
          using of_nat_0_le_iff and \<open>N\<noteq>0\<close> by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6392
        also have "\<dots> < e" using N by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6393
        finally have "inverse (real n + 1) < e" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6394
        then have "dist (x n) (y n) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6395
          using xy0[THEN spec[where x=n]] by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6396
      }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6397
      then have "\<exists>N. \<forall>n\<ge>N. dist (x n) (y n) < e" by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6398
    }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6399
    then have "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6400
      using \<open>?rhs\<close>[THEN spec[where x=x], THEN spec[where x=y]] and xyn
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  6401
      unfolding lim_sequentially dist_real_def by auto
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6402
    then have False using fxy and \<open>e>0\<close> by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6403
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6404
  then show ?lhs
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6405
    unfolding uniformly_continuous_on_def by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6406
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6407
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6408
lemma continuous_closed_imp_Cauchy_continuous:
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6409
  fixes S :: "('a::complete_space) set"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6410
  shows "\<lbrakk>continuous_on S f; closed S; Cauchy \<sigma>; \<And>n. (\<sigma> n) \<in> S\<rbrakk> \<Longrightarrow> Cauchy(f o \<sigma>)"
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6411
  apply (simp add: complete_eq_closed [symmetric] continuous_on_sequentially)
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6412
  by (meson LIMSEQ_imp_Cauchy complete_def)
61915
e9812a95d108 theory for type of bounded linear functions; differentiation under the integral sign
immler
parents: 61907
diff changeset
  6413
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6414
text\<open>The usual transformation theorems.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6415
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6416
lemma continuous_transform_within:
36667
21404f7dec59 generalize some lemmas
huffman
parents: 36660
diff changeset
  6417
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6418
  assumes "continuous (at x within s) f"
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6419
    and "0 < d"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6420
    and "x \<in> s"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6421
    and "\<And>x'. \<lbrakk>x' \<in> s; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6422
  shows "continuous (at x within s) g"
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6423
  using assms
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6424
  unfolding continuous_within
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6425
  by (force simp add: intro: Lim_transform_within)
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  6426
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6427
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6428
subsubsection \<open>Structural rules for pointwise continuity\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6429
51361
21e5b6efb317 changed continuous_intros into a named theorems collection
hoelzl
parents: 51351
diff changeset
  6430
lemma continuous_infdist[continuous_intros]:
50087
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  6431
  assumes "continuous F f"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  6432
  shows "continuous F (\<lambda>x. infdist (f x) A)"
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  6433
  using assms unfolding continuous_def by (rule tendsto_infdist)
635d73673b5e regularity of measures, therefore:
immler
parents: 49962
diff changeset
  6434
51361
21e5b6efb317 changed continuous_intros into a named theorems collection
hoelzl
parents: 51351
diff changeset
  6435
lemma continuous_infnorm[continuous_intros]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6436
  "continuous F f \<Longrightarrow> continuous F (\<lambda>x. infnorm (f x))"
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6437
  unfolding continuous_def by (rule tendsto_infnorm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6438
51361
21e5b6efb317 changed continuous_intros into a named theorems collection
hoelzl
parents: 51351
diff changeset
  6439
lemma continuous_inner[continuous_intros]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6440
  assumes "continuous F f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6441
    and "continuous F g"
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6442
  shows "continuous F (\<lambda>x. inner (f x) (g x))"
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6443
  using assms unfolding continuous_def by (rule tendsto_inner)
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6444
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 51475
diff changeset
  6445
lemmas continuous_at_inverse = isCont_inverse
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6446
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6447
subsubsection \<open>Structural rules for setwise continuity\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6448
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6449
lemma continuous_on_infnorm[continuous_intros]:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6450
  "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. infnorm (f x))"
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6451
  unfolding continuous_on by (fast intro: tendsto_infnorm)
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44632
diff changeset
  6452
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6453
lemma continuous_on_inner[continuous_intros]:
44531
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  6454
  fixes g :: "'a::topological_space \<Rightarrow> 'b::real_inner"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6455
  assumes "continuous_on s f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6456
    and "continuous_on s g"
44531
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  6457
  shows "continuous_on s (\<lambda>x. inner (f x) (g x))"
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  6458
  using bounded_bilinear_inner assms
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  6459
  by (rule bounded_bilinear.continuous_on)
1d477a2b1572 replace some continuous_on lemmas with more general versions
huffman
parents: 44530
diff changeset
  6460
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6461
subsubsection \<open>Structural rules for uniform continuity\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6462
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6463
lemma uniformly_continuous_on_dist[continuous_intros]:
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6464
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::metric_space"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6465
  assumes "uniformly_continuous_on s f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6466
    and "uniformly_continuous_on s g"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6467
  shows "uniformly_continuous_on s (\<lambda>x. dist (f x) (g x))"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6468
proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6469
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6470
    fix a b c d :: 'b
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6471
    have "\<bar>dist a b - dist c d\<bar> \<le> dist a c + dist b d"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6472
      using dist_triangle2 [of a b c] dist_triangle2 [of b c d]
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6473
      using dist_triangle3 [of c d a] dist_triangle [of a d b]
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6474
      by arith
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6475
  } note le = this
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6476
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6477
    fix x y
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  6478
    assume f: "(\<lambda>n. dist (f (x n)) (f (y n))) \<longlonglongrightarrow> 0"
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  6479
    assume g: "(\<lambda>n. dist (g (x n)) (g (y n))) \<longlonglongrightarrow> 0"
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  6480
    have "(\<lambda>n. \<bar>dist (f (x n)) (g (x n)) - dist (f (y n)) (g (y n))\<bar>) \<longlonglongrightarrow> 0"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6481
      by (rule Lim_transform_bound [OF _ tendsto_add_zero [OF f g]],
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6482
        simp add: le)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6483
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6484
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6485
    using assms unfolding uniformly_continuous_on_sequentially
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6486
    unfolding dist_real_def by simp
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6487
qed
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6488
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6489
lemma uniformly_continuous_on_norm[continuous_intros]:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  6490
  fixes f :: "'a :: metric_space \<Rightarrow> 'b :: real_normed_vector"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6491
  assumes "uniformly_continuous_on s f"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6492
  shows "uniformly_continuous_on s (\<lambda>x. norm (f x))"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6493
  unfolding norm_conv_dist using assms
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6494
  by (intro uniformly_continuous_on_dist uniformly_continuous_on_const)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6495
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6496
lemma (in bounded_linear) uniformly_continuous_on[continuous_intros]:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  6497
  fixes g :: "_::metric_space \<Rightarrow> _"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6498
  assumes "uniformly_continuous_on s g"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6499
  shows "uniformly_continuous_on s (\<lambda>x. f (g x))"
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6500
  using assms unfolding uniformly_continuous_on_sequentially
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6501
  unfolding dist_norm tendsto_norm_zero_iff diff[symmetric]
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6502
  by (auto intro: tendsto_zero)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6503
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6504
lemma uniformly_continuous_on_cmul[continuous_intros]:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  6505
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6506
  assumes "uniformly_continuous_on s f"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6507
  shows "uniformly_continuous_on s (\<lambda>x. c *\<^sub>R f(x))"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6508
  using bounded_linear_scaleR_right assms
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6509
  by (rule bounded_linear.uniformly_continuous_on)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6510
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6511
lemma dist_minus:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6512
  fixes x y :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6513
  shows "dist (- x) (- y) = dist x y"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6514
  unfolding dist_norm minus_diff_minus norm_minus_cancel ..
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6515
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6516
lemma uniformly_continuous_on_minus[continuous_intros]:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6517
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6518
  shows "uniformly_continuous_on s f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. - f x)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6519
  unfolding uniformly_continuous_on_def dist_minus .
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6520
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6521
lemma uniformly_continuous_on_add[continuous_intros]:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  6522
  fixes f g :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6523
  assumes "uniformly_continuous_on s f"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6524
    and "uniformly_continuous_on s g"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6525
  shows "uniformly_continuous_on s (\<lambda>x. f x + g x)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6526
  using assms
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6527
  unfolding uniformly_continuous_on_sequentially
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6528
  unfolding dist_norm tendsto_norm_zero_iff add_diff_add
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6529
  by (auto intro: tendsto_add_zero)
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6530
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  6531
lemma uniformly_continuous_on_diff[continuous_intros]:
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  6532
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6533
  assumes "uniformly_continuous_on s f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6534
    and "uniformly_continuous_on s g"
44648
897f32a827f2 simplify some proofs about uniform continuity, and add some new ones;
huffman
parents: 44647
diff changeset
  6535
  shows "uniformly_continuous_on s (\<lambda>x. f x - g x)"
54230
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 54070
diff changeset
  6536
  using assms uniformly_continuous_on_add [of s f "- g"]
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 54070
diff changeset
  6537
    by (simp add: fun_Compl_def uniformly_continuous_on_minus)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6538
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 51475
diff changeset
  6539
lemmas continuous_at_compose = isCont_o
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6540
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  6541
text \<open>Continuity in terms of open preimages.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6542
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6543
lemma continuous_at_open:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6544
  "continuous (at x) f \<longleftrightarrow> (\<forall>t. open t \<and> f x \<in> t --> (\<exists>s. open s \<and> x \<in> s \<and> (\<forall>x' \<in> s. (f x') \<in> t)))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6545
  unfolding continuous_within_topological [of x UNIV f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6546
  unfolding imp_conjL
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6547
  by (intro all_cong imp_cong ex_cong conj_cong refl) auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6548
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6549
lemma continuous_imp_tendsto:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6550
  assumes "continuous (at x0) f"
61969
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  6551
    and "x \<longlonglongrightarrow> x0"
e01015e49041 more symbols;
wenzelm
parents: 61952
diff changeset
  6552
  shows "(f \<circ> x) \<longlonglongrightarrow> (f x0)"
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6553
proof (rule topological_tendstoI)
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6554
  fix S
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6555
  assume "open S" "f x0 \<in> S"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6556
  then obtain T where T_def: "open T" "x0 \<in> T" "\<forall>x\<in>T. f x \<in> S"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6557
     using assms continuous_at_open by metis
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6558
  then have "eventually (\<lambda>n. x n \<in> T) sequentially"
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6559
    using assms T_def by (auto simp: tendsto_def)
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6560
  then show "eventually (\<lambda>n. (f \<circ> x) n \<in> S) sequentially"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  6561
    using T_def by (auto elim!: eventually_mono)
51351
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6562
qed
dd1dd470690b generalized lemmas in Extended_Real_Limits
hoelzl
parents: 51350
diff changeset
  6563
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6564
lemma continuous_on_open:
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  6565
  "continuous_on s f \<longleftrightarrow>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6566
    (\<forall>t. openin (subtopology euclidean (f ` s)) t \<longrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6567
      openin (subtopology euclidean s) {x \<in> s. f x \<in> t})"
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  6568
  unfolding continuous_on_open_invariant openin_open Int_def vimage_def Int_commute
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  6569
  by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong)
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  6570
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6571
lemma continuous_on_open_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6572
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6573
  assumes "f ` S \<subseteq> T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6574
    shows "continuous_on S f \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6575
             (\<forall>U. openin (subtopology euclidean T) U
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6576
                  \<longrightarrow> openin (subtopology euclidean S) {x \<in> S. f x \<in> U})"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6577
     (is "?lhs = ?rhs")
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6578
proof
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6579
  assume ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6580
  then show ?rhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6581
    apply (auto simp: openin_euclidean_subtopology_iff continuous_on_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6582
    by (metis assms image_subset_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6583
next
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6584
  have ope: "openin (subtopology euclidean T) (ball y e \<inter> T)" for y e
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6585
    by (simp add: Int_commute openin_open_Int)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6586
  assume ?rhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6587
  then show ?lhs
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6588
    apply (clarsimp simp add: continuous_on_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6589
    apply (drule_tac x = "ball (f x) e \<inter> T" in spec)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6590
    apply (clarsimp simp add: ope openin_euclidean_subtopology_iff [of S])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6591
    by (metis (no_types, hide_lams) assms dist_commute dist_self image_subset_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6592
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6593
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6594
lemma continuous_openin_preimage:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6595
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6596
  shows
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6597
   "\<lbrakk>continuous_on S f; f ` S \<subseteq> T; openin (subtopology euclidean T) U\<rbrakk>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6598
        \<Longrightarrow> openin (subtopology euclidean S) {x \<in> S. f x \<in> U}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6599
by (simp add: continuous_on_open_gen)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6600
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6601
text \<open>Similarly in terms of closed sets.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6602
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6603
lemma continuous_on_closed:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6604
  "continuous_on s f \<longleftrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6605
    (\<forall>t. closedin (subtopology euclidean (f ` s)) t \<longrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6606
      closedin (subtopology euclidean s) {x \<in> s. f x \<in> t})"
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  6607
  unfolding continuous_on_closed_invariant closedin_closed Int_def vimage_def Int_commute
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51480
diff changeset
  6608
  by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6609
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6610
lemma continuous_on_closed_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6611
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6612
  assumes "f ` S \<subseteq> T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6613
    shows "continuous_on S f \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6614
             (\<forall>U. closedin (subtopology euclidean T) U
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6615
                  \<longrightarrow> closedin (subtopology euclidean S) {x \<in> S. f x \<in> U})"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6616
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6617
  have *: "U \<subseteq> T \<Longrightarrow> {x \<in> S. f x \<in> T \<and> f x \<notin> U} = S - {x \<in> S. f x \<in> U}" for U
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6618
    using assms by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6619
  show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6620
    apply (simp add: continuous_on_open_gen [OF assms], safe)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6621
    apply (drule_tac [!] x="T-U" in spec)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6622
    apply (force simp: closedin_def *)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6623
    apply (force simp: openin_closedin_eq *)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6624
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6625
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6626
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6627
lemma continuous_closedin_preimage_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6628
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6629
  assumes "continuous_on S f" "f ` S \<subseteq> T" "closedin (subtopology euclidean T) U"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6630
    shows "closedin (subtopology euclidean S) {x \<in> S. f x \<in> U}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6631
using assms continuous_on_closed_gen by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6632
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6633
lemma continuous_on_imp_closedin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6634
  assumes "continuous_on S f" "closedin (subtopology euclidean (f ` S)) T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6635
    shows "closedin (subtopology euclidean S) {x. x \<in> S \<and> f x \<in> T}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6636
using assms continuous_on_closed by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6637
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  6638
subsection \<open>Half-global and completely global cases.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6639
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6640
lemma continuous_openin_preimage_gen:
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6641
  assumes "continuous_on s f"  "open t"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6642
  shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6643
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6644
  have *: "\<forall>x. x \<in> s \<and> f x \<in> t \<longleftrightarrow> x \<in> s \<and> f x \<in> (t \<inter> f ` s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6645
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6646
  have "openin (subtopology euclidean (f ` s)) (t \<inter> f ` s)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6647
    using openin_open_Int[of t "f ` s", OF assms(2)] unfolding openin_open by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6648
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6649
    using assms(1)[unfolded continuous_on_open, THEN spec[where x="t \<inter> f ` s"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6650
    using * by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6651
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6652
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  6653
lemma continuous_closedin_preimage:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6654
  assumes "continuous_on s f" and "closed t"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6655
  shows "closedin (subtopology euclidean s) {x \<in> s. f x \<in> t}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6656
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6657
  have *: "\<forall>x. x \<in> s \<and> f x \<in> t \<longleftrightarrow> x \<in> s \<and> f x \<in> (t \<inter> f ` s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6658
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6659
  have "closedin (subtopology euclidean (f ` s)) (t \<inter> f ` s)"
63170
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  6660
    using closedin_closed_Int[of t "f ` s", OF assms(2)]
eae6549dbea2 tuned proofs, to allow unfold_abs_def;
wenzelm
parents: 63151
diff changeset
  6661
    by (simp add: Int_commute)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6662
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6663
    using assms(1)[unfolded continuous_on_closed, THEN spec[where x="t \<inter> f ` s"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6664
    using * by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6665
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6666
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6667
lemma continuous_openin_preimage_eq:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6668
   "continuous_on S f \<longleftrightarrow>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6669
    (\<forall>t. open t \<longrightarrow> openin (subtopology euclidean S) {x. x \<in> S \<and> f x \<in> t})"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6670
apply safe
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6671
apply (simp add: continuous_openin_preimage_gen)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6672
apply (fastforce simp add: continuous_on_open openin_open)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6673
done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6674
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6675
lemma continuous_closedin_preimage_eq:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6676
   "continuous_on S f \<longleftrightarrow>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6677
    (\<forall>t. closed t \<longrightarrow> closedin (subtopology euclidean S) {x. x \<in> S \<and> f x \<in> t})"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6678
apply safe
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6679
apply (simp add: continuous_closedin_preimage)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6680
apply (fastforce simp add: continuous_on_closed closedin_closed)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6681
done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
  6682
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6683
lemma continuous_open_preimage:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6684
  assumes "continuous_on s f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6685
    and "open s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6686
    and "open t"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6687
  shows "open {x \<in> s. f x \<in> t}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6688
proof-
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6689
  obtain T where T: "open T" "{x \<in> s. f x \<in> t} = s \<inter> T"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
  6690
    using continuous_openin_preimage_gen[OF assms(1,3)] unfolding openin_open by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6691
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6692
    using open_Int[of s T, OF assms(2)] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6693
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6694
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6695
lemma continuous_closed_preimage:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6696
  assumes "continuous_on s f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6697
    and "closed s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6698
    and "closed t"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6699
  shows "closed {x \<in> s. f x \<in> t}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6700
proof-
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6701
  obtain T where "closed T" "{x \<in> s. f x \<in> t} = s \<inter> T"
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  6702
    using continuous_closedin_preimage[OF assms(1,3)]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6703
    unfolding closedin_closed by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6704
  then show ?thesis using closed_Int[of s T, OF assms(2)] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6705
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6706
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6707
lemma continuous_open_preimage_univ:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6708
  "open s \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> open {x. f x \<in> s}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6709
  using continuous_open_preimage[of UNIV f s] open_UNIV continuous_at_imp_continuous_on by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6710
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6711
lemma continuous_closed_preimage_univ:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6712
  "closed s \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> closed {x. f x \<in> s}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6713
  using continuous_closed_preimage[of UNIV f s] closed_UNIV continuous_at_imp_continuous_on by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6714
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6715
lemma continuous_open_vimage: "open s \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> open (f -` s)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6716
  unfolding vimage_def by (rule continuous_open_preimage_univ)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6717
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6718
lemma continuous_closed_vimage: "closed s \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> closed (f -` s)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6719
  unfolding vimage_def by (rule continuous_closed_preimage_univ)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6720
36441
1d7704c29af3 generalized many lemmas about continuity
huffman
parents: 36440
diff changeset
  6721
lemma interior_image_subset:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6722
  assumes "inj f" "\<And>x. continuous (at x) f"
35172
579dd5570f96 Added integration to Multivariate-Analysis (upto FTC)
himmelma
parents: 35028
diff changeset
  6723
  shows "interior (f ` s) \<subseteq> f ` (interior s)"
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6724
proof
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6725
  fix x assume "x \<in> interior (f ` s)"
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6726
  then obtain T where as: "open T" "x \<in> T" "T \<subseteq> f ` s" ..
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6727
  then have "x \<in> f ` s" by auto
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6728
  then obtain y where y: "y \<in> s" "x = f y" by auto
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6729
  have "open (vimage f T)"
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6730
    using assms \<open>open T\<close> by (metis continuous_open_vimage)
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6731
  moreover have "y \<in> vimage f T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6732
    using \<open>x = f y\<close> \<open>x \<in> T\<close> by simp
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6733
  moreover have "vimage f T \<subseteq> s"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6734
    using \<open>T \<subseteq> image f s\<close> \<open>inj f\<close> unfolding inj_on_def subset_eq by auto
44519
ea85d78a994e simplify definition of 'interior';
huffman
parents: 44518
diff changeset
  6735
  ultimately have "y \<in> interior s" ..
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6736
  with \<open>x = f y\<close> show "x \<in> f ` interior s" ..
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6737
qed
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  6738
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  6739
subsection \<open>Equality of continuous functions on closure and related results.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6740
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  6741
lemma continuous_closedin_preimage_constant:
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  6742
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6743
  shows "continuous_on s f \<Longrightarrow> closedin (subtopology euclidean s) {x \<in> s. f x = a}"
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  6744
  using continuous_closedin_preimage[of s f "{a}"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6745
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6746
lemma continuous_closed_preimage_constant:
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  6747
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6748
  shows "continuous_on s f \<Longrightarrow> closed s \<Longrightarrow> closed {x \<in> s. f x = a}"
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  6749
  using continuous_closed_preimage[of s f "{a}"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6750
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6751
lemma continuous_constant_on_closure:
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  6752
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  6753
  assumes "continuous_on (closure S) f"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  6754
      and "\<And>x. x \<in> S \<Longrightarrow> f x = a"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  6755
      and "x \<in> closure S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  6756
  shows "f x = a"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  6757
    using continuous_closed_preimage_constant[of "closure S" f a]
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  6758
      assms closure_minimal[of S "{x \<in> closure S. f x = a}"] closure_subset
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6759
    unfolding subset_eq
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6760
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6761
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6762
lemma image_closure_subset:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6763
  assumes "continuous_on (closure s) f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6764
    and "closed t"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6765
    and "(f ` s) \<subseteq> t"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6766
  shows "f ` (closure s) \<subseteq> t"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6767
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6768
  have "s \<subseteq> {x \<in> closure s. f x \<in> t}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6769
    using assms(3) closure_subset by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6770
  moreover have "closed {x \<in> closure s. f x \<in> t}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6771
    using continuous_closed_preimage[OF assms(1)] and assms(2) by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6772
  ultimately have "closure s = {x \<in> closure s . f x \<in> t}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6773
    using closure_minimal[of s "{x \<in> closure s. f x \<in> t}"] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6774
  then show ?thesis by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6775
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6776
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6777
lemma continuous_on_closure_norm_le:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6778
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6779
  assumes "continuous_on (closure s) f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6780
    and "\<forall>y \<in> s. norm(f y) \<le> b"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6781
    and "x \<in> (closure s)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6782
  shows "norm (f x) \<le> b"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6783
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6784
  have *: "f ` s \<subseteq> cball 0 b"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  6785
    using assms(2)[unfolded mem_cball_0[symmetric]] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6786
  show ?thesis
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6787
    using image_closure_subset[OF assms(1) closed_cball[of 0 b] *] assms(3)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6788
    unfolding subset_eq
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6789
    apply (erule_tac x="f x" in ballE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6790
    apply (auto simp add: dist_norm)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  6791
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6792
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  6793
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 62083
diff changeset
  6794
lemma isCont_indicator:
61880
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6795
  fixes x :: "'a::t2_space"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6796
  shows "isCont (indicator A :: 'a \<Rightarrow> real) x = (x \<notin> frontier A)"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6797
proof auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6798
  fix x
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6799
  assume cts_at: "isCont (indicator A :: 'a \<Rightarrow> real) x" and fr: "x \<in> frontier A"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6800
  with continuous_at_open have 1: "\<forall>V::real set. open V \<and> indicator A x \<in> V \<longrightarrow>
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6801
    (\<exists>U::'a set. open U \<and> x \<in> U \<and> (\<forall>y\<in>U. indicator A y \<in> V))" by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6802
  show False
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6803
  proof (cases "x \<in> A")
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6804
    assume x: "x \<in> A"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6805
    hence "indicator A x \<in> ({0<..<2} :: real set)" by simp
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6806
    hence "\<exists>U. open U \<and> x \<in> U \<and> (\<forall>y\<in>U. indicator A y \<in> ({0<..<2} :: real set))"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6807
      using 1 open_greaterThanLessThan by blast
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6808
    then guess U .. note U = this
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6809
    hence "\<forall>y\<in>U. indicator A y > (0::real)"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6810
      unfolding greaterThanLessThan_def by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6811
    hence "U \<subseteq> A" using indicator_eq_0_iff by force
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6812
    hence "x \<in> interior A" using U interiorI by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6813
    thus ?thesis using fr unfolding frontier_def by simp
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6814
  next
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6815
    assume x: "x \<notin> A"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6816
    hence "indicator A x \<in> ({-1<..<1} :: real set)" by simp
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6817
    hence "\<exists>U. open U \<and> x \<in> U \<and> (\<forall>y\<in>U. indicator A y \<in> ({-1<..<1} :: real set))"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6818
      using 1 open_greaterThanLessThan by blast
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6819
    then guess U .. note U = this
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6820
    hence "\<forall>y\<in>U. indicator A y < (1::real)"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6821
      unfolding greaterThanLessThan_def by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6822
    hence "U \<subseteq> -A" by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6823
    hence "x \<in> interior (-A)" using U interiorI by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6824
    thus ?thesis using fr interior_complement unfolding frontier_def by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6825
  qed
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6826
next
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6827
  assume nfr: "x \<notin> frontier A"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6828
  hence "x \<in> interior A \<or> x \<in> interior (-A)"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6829
    by (auto simp: frontier_def closure_interior)
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6830
  thus "isCont ((indicator A)::'a \<Rightarrow> real) x"
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6831
  proof
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6832
    assume int: "x \<in> interior A"
63103
2394b0db133f removed smt proof
immler
parents: 63092
diff changeset
  6833
    then obtain U where U: "open U" "x \<in> U" "U \<subseteq> A" unfolding interior_def by auto
61880
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6834
    hence "\<forall>y\<in>U. indicator A y = (1::real)" unfolding indicator_def by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6835
    hence "continuous_on U (indicator A)" by (simp add: continuous_on_const indicator_eq_1_iff)
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6836
    thus ?thesis using U continuous_on_eq_continuous_at by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6837
  next
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6838
    assume ext: "x \<in> interior (-A)"
63103
2394b0db133f removed smt proof
immler
parents: 63092
diff changeset
  6839
    then obtain U where U: "open U" "x \<in> U" "U \<subseteq> -A" unfolding interior_def by auto
2394b0db133f removed smt proof
immler
parents: 63092
diff changeset
  6840
    then have "continuous_on U (indicator A)"
2394b0db133f removed smt proof
immler
parents: 63092
diff changeset
  6841
      using continuous_on_topological by (auto simp: subset_iff)
61880
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6842
    thus ?thesis using U continuous_on_eq_continuous_at by auto
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6843
  qed
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6844
qed
ff4d33058566 moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents: 61848
diff changeset
  6845
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6846
subsection\<open> Theorems relating continuity and uniform continuity to closures\<close>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6847
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6848
lemma continuous_on_closure:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6849
   "continuous_on (closure S) f \<longleftrightarrow>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6850
    (\<forall>x e. x \<in> closure S \<and> 0 < e
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6851
           \<longrightarrow> (\<exists>d. 0 < d \<and> (\<forall>y. y \<in> S \<and> dist y x < d \<longrightarrow> dist (f y) (f x) < e)))"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6852
   (is "?lhs = ?rhs")
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6853
proof
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6854
  assume ?lhs then show ?rhs
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6855
    unfolding continuous_on_iff  by (metis Un_iff closure_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6856
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6857
  assume R [rule_format]: ?rhs
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6858
  show ?lhs
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6859
  proof
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6860
    fix x and e::real
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6861
    assume "0 < e" and x: "x \<in> closure S"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6862
    obtain \<delta>::real where "\<delta> > 0"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6863
                   and \<delta>: "\<And>y. \<lbrakk>y \<in> S; dist y x < \<delta>\<rbrakk> \<Longrightarrow> dist (f y) (f x) < e/2"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6864
      using R [of x "e/2"] \<open>0 < e\<close> x by auto
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6865
    have "dist (f y) (f x) \<le> e" if y: "y \<in> closure S" and dyx: "dist y x < \<delta>/2" for y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6866
    proof -
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6867
      obtain \<delta>'::real where "\<delta>' > 0"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6868
                      and \<delta>': "\<And>z. \<lbrakk>z \<in> S; dist z y < \<delta>'\<rbrakk> \<Longrightarrow> dist (f z) (f y) < e/2"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6869
        using R [of y "e/2"] \<open>0 < e\<close> y by auto
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6870
      obtain z where "z \<in> S" and z: "dist z y < min \<delta>' \<delta> / 2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6871
        using closure_approachable y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6872
        by (metis \<open>0 < \<delta>'\<close> \<open>0 < \<delta>\<close> divide_pos_pos min_less_iff_conj zero_less_numeral)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6873
      have "dist (f z) (f y) < e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6874
        apply (rule \<delta>' [OF \<open>z \<in> S\<close>])
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6875
        using z \<open>0 < \<delta>'\<close> by linarith
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6876
      moreover have "dist (f z) (f x) < e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6877
        apply (rule \<delta> [OF \<open>z \<in> S\<close>])
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6878
        using z \<open>0 < \<delta>\<close>  dist_commute[of y z] dist_triangle_half_r [of y] dyx by auto
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6879
      ultimately show ?thesis
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6880
        by (metis dist_commute dist_triangle_half_l less_imp_le)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6881
    qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6882
    then show "\<exists>d>0. \<forall>x'\<in>closure S. dist x' x < d \<longrightarrow> dist (f x') (f x) \<le> e"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6883
      by (rule_tac x="\<delta>/2" in exI) (simp add: \<open>\<delta> > 0\<close>)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6884
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6885
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6886
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6887
lemma continuous_on_closure_sequentially:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6888
  fixes f :: "'a::metric_space \<Rightarrow> 'b :: metric_space"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6889
  shows
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6890
   "continuous_on (closure S) f \<longleftrightarrow>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6891
    (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6892
   (is "?lhs = ?rhs")
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6893
proof -
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6894
  have "continuous_on (closure S) f \<longleftrightarrow>
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6895
           (\<forall>x \<in> closure S. continuous (at x within S) f)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6896
    by (force simp: continuous_on_closure Topology_Euclidean_Space.continuous_within_eps_delta)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6897
  also have "... = ?rhs"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6898
    by (force simp: continuous_within_sequentially)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6899
  finally show ?thesis .
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6900
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6901
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6902
lemma uniformly_continuous_on_closure:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6903
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6904
  assumes ucont: "uniformly_continuous_on S f"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6905
      and cont: "continuous_on (closure S) f"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6906
    shows "uniformly_continuous_on (closure S) f"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6907
unfolding uniformly_continuous_on_def
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6908
proof (intro allI impI)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6909
  fix e::real
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6910
  assume "0 < e"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6911
  then obtain d::real
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6912
    where "d>0"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6913
      and d: "\<And>x x'. \<lbrakk>x\<in>S; x'\<in>S; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e/3"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6914
    using ucont [unfolded uniformly_continuous_on_def, rule_format, of "e/3"] by auto
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6915
  show "\<exists>d>0. \<forall>x\<in>closure S. \<forall>x'\<in>closure S. dist x' x < d \<longrightarrow> dist (f x') (f x) < e"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6916
  proof (rule exI [where x="d/3"], clarsimp simp: \<open>d > 0\<close>)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6917
    fix x y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6918
    assume x: "x \<in> closure S" and y: "y \<in> closure S" and dyx: "dist y x * 3 < d"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6919
    obtain d1::real where "d1 > 0"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6920
           and d1: "\<And>w. \<lbrakk>w \<in> closure S; dist w x < d1\<rbrakk> \<Longrightarrow> dist (f w) (f x) < e/3"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6921
      using cont [unfolded continuous_on_iff, rule_format, of "x" "e/3"] \<open>0 < e\<close> x by auto
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6922
     obtain x' where "x' \<in> S" and x': "dist x' x < min d1 (d / 3)"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6923
        using closure_approachable [of x S]
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6924
        by (metis \<open>0 < d1\<close> \<open>0 < d\<close> divide_pos_pos min_less_iff_conj x zero_less_numeral)
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6925
    obtain d2::real where "d2 > 0"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6926
           and d2: "\<forall>w \<in> closure S. dist w y < d2 \<longrightarrow> dist (f w) (f y) < e/3"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6927
      using cont [unfolded continuous_on_iff, rule_format, of "y" "e/3"] \<open>0 < e\<close> y by auto
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6928
     obtain y' where "y' \<in> S" and y': "dist y' y < min d2 (d / 3)"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6929
        using closure_approachable [of y S]
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6930
        by (metis \<open>0 < d2\<close> \<open>0 < d\<close> divide_pos_pos min_less_iff_conj y zero_less_numeral)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6931
     have "dist x' x < d/3" using x' by auto
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6932
     moreover have "dist x y < d/3"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6933
       by (metis dist_commute dyx less_divide_eq_numeral1(1))
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6934
     moreover have "dist y y' < d/3"
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6935
       by (metis (no_types) dist_commute min_less_iff_conj y')
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6936
     ultimately have "dist x' y' < d/3 + d/3 + d/3"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6937
       by (meson dist_commute_lessI dist_triangle_lt add_strict_mono)
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6938
     then have "dist x' y' < d" by simp
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  6939
     then have "dist (f x') (f y') < e/3"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6940
       by (rule d [OF \<open>y' \<in> S\<close> \<open>x' \<in> S\<close>])
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6941
     moreover have "dist (f x') (f x) < e/3" using \<open>x' \<in> S\<close> closure_subset x' d1
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6942
       by (simp add: closure_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6943
     moreover have "dist (f y') (f y) < e/3" using \<open>y' \<in> S\<close> closure_subset y' d2
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6944
       by (simp add: closure_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6945
     ultimately have "dist (f y) (f x) < e/3 + e/3 + e/3"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6946
       by (meson dist_commute_lessI dist_triangle_lt add_strict_mono)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6947
    then show "dist (f y) (f x) < e" by simp
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6948
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6949
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  6950
63105
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6951
lemma uniformly_continuous_on_extension_at_closure:
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6952
  fixes f::"'a::metric_space \<Rightarrow> 'b::complete_space"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6953
  assumes uc: "uniformly_continuous_on X f"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6954
  assumes "x \<in> closure X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6955
  obtains l where "(f \<longlongrightarrow> l) (at x within X)"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6956
proof -
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6957
  from assms obtain xs where xs: "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6958
    by (auto simp: closure_sequential)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6959
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6960
  from uniformly_continuous_on_Cauchy[OF uc LIMSEQ_imp_Cauchy, OF xs]
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6961
  obtain l where l: "(\<lambda>n. f (xs n)) \<longlonglongrightarrow> l"
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6962
    by atomize_elim (simp only: convergent_eq_Cauchy)
63105
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6963
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6964
  have "(f \<longlongrightarrow> l) (at x within X)"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6965
  proof (safe intro!: Lim_within_LIMSEQ)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6966
    fix xs'
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6967
    assume "\<forall>n. xs' n \<noteq> x \<and> xs' n \<in> X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6968
      and xs': "xs' \<longlonglongrightarrow> x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6969
    then have "xs' n \<noteq> x" "xs' n \<in> X" for n by auto
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6970
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6971
    from uniformly_continuous_on_Cauchy[OF uc LIMSEQ_imp_Cauchy, OF \<open>xs' \<longlonglongrightarrow> x\<close> \<open>xs' _ \<in> X\<close>]
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6972
    obtain l' where l': "(\<lambda>n. f (xs' n)) \<longlonglongrightarrow> l'"
64287
d85d88722745 more from moretop.ml
paulson <lp15@cam.ac.uk>
parents: 64284
diff changeset
  6973
      by atomize_elim (simp only: convergent_eq_Cauchy)
63105
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6974
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6975
    show "(\<lambda>n. f (xs' n)) \<longlonglongrightarrow> l"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6976
    proof (rule tendstoI)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6977
      fix e::real assume "e > 0"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6978
      define e' where "e' \<equiv> e / 2"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6979
      have "e' > 0" using \<open>e > 0\<close> by (simp add: e'_def)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6980
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6981
      have "\<forall>\<^sub>F n in sequentially. dist (f (xs n)) l < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6982
        by (simp add: \<open>0 < e'\<close> l tendstoD)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6983
      moreover
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6984
      from uc[unfolded uniformly_continuous_on_def, rule_format, OF \<open>e' > 0\<close>]
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6985
      obtain d where d: "d > 0" "\<And>x x'. x \<in> X \<Longrightarrow> x' \<in> X \<Longrightarrow> dist x x' < d \<Longrightarrow> dist (f x) (f x') < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6986
        by auto
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6987
      have "\<forall>\<^sub>F n in sequentially. dist (xs n) (xs' n) < d"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6988
        by (auto intro!: \<open>0 < d\<close> order_tendstoD tendsto_eq_intros xs xs')
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6989
      ultimately
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6990
      show "\<forall>\<^sub>F n in sequentially. dist (f (xs' n)) l < e"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6991
      proof eventually_elim
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6992
        case (elim n)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6993
        have "dist (f (xs' n)) l \<le> dist (f (xs n)) (f (xs' n)) + dist (f (xs n)) l"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6994
          by (metis dist_triangle dist_commute)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6995
        also have "dist (f (xs n)) (f (xs' n)) < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6996
          by (auto intro!: d xs \<open>xs' _ \<in> _\<close> elim)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6997
        also note \<open>dist (f (xs n)) l < e'\<close>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6998
        also have "e' + e' = e" by (simp add: e'_def)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  6999
        finally show ?case by simp
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7000
      qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7001
    qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7002
  qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7003
  thus ?thesis ..
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7004
qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7005
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7006
lemma uniformly_continuous_on_extension_on_closure:
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7007
  fixes f::"'a::metric_space \<Rightarrow> 'b::complete_space"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7008
  assumes uc: "uniformly_continuous_on X f"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7009
  obtains g where "uniformly_continuous_on (closure X) g" "\<And>x. x \<in> X \<Longrightarrow> f x = g x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7010
    "\<And>Y h x. X \<subseteq> Y \<Longrightarrow> Y \<subseteq> closure X \<Longrightarrow> continuous_on Y h \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> f x = h x) \<Longrightarrow> x \<in> Y \<Longrightarrow> h x = g x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7011
proof -
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7012
  from uc have cont_f: "continuous_on X f"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7013
    by (simp add: uniformly_continuous_imp_continuous)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7014
  obtain y where y: "(f \<longlongrightarrow> y x) (at x within X)" if "x \<in> closure X" for x
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7015
    apply atomize_elim
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7016
    apply (rule choice)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7017
    using uniformly_continuous_on_extension_at_closure[OF assms]
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7018
    by metis
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7019
  let ?g = "\<lambda>x. if x \<in> X then f x else y x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7020
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7021
  have "uniformly_continuous_on (closure X) ?g"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7022
    unfolding uniformly_continuous_on_def
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7023
  proof safe
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7024
    fix e::real assume "e > 0"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7025
    define e' where "e' \<equiv> e / 3"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7026
    have "e' > 0" using \<open>e > 0\<close> by (simp add: e'_def)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7027
    from uc[unfolded uniformly_continuous_on_def, rule_format, OF \<open>0 < e'\<close>]
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7028
    obtain d where "d > 0" and d: "\<And>x x'. x \<in> X \<Longrightarrow> x' \<in> X \<Longrightarrow> dist x' x < d \<Longrightarrow> dist (f x') (f x) < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7029
      by auto
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7030
    define d' where "d' = d / 3"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7031
    have "d' > 0" using \<open>d > 0\<close> by (simp add: d'_def)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7032
    show "\<exists>d>0. \<forall>x\<in>closure X. \<forall>x'\<in>closure X. dist x' x < d \<longrightarrow> dist (?g x') (?g x) < e"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7033
    proof (safe intro!: exI[where x=d'] \<open>d' > 0\<close>)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7034
      fix x x' assume x: "x \<in> closure X" and x': "x' \<in> closure X" and dist: "dist x' x < d'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7035
      then obtain xs xs' where xs: "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7036
        and xs': "xs' \<longlonglongrightarrow> x'" "\<And>n. xs' n \<in> X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7037
        by (auto simp: closure_sequential)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7038
      have "\<forall>\<^sub>F n in sequentially. dist (xs' n) x' < d'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7039
        and "\<forall>\<^sub>F n in sequentially. dist (xs n) x < d'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7040
        by (auto intro!: \<open>0 < d'\<close> order_tendstoD tendsto_eq_intros xs xs')
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7041
      moreover
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7042
      have "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> y x" if "x \<in> closure X" "x \<notin> X" "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X" for xs x
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7043
        using that not_eventuallyD
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7044
        by (force intro!: filterlim_compose[OF y[OF \<open>x \<in> closure X\<close>]] simp: filterlim_at)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7045
      then have "(\<lambda>x. f (xs' x)) \<longlonglongrightarrow> ?g x'" "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> ?g x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7046
        using x x'
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7047
        by (auto intro!: continuous_on_tendsto_compose[OF cont_f] simp: xs' xs)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7048
      then have "\<forall>\<^sub>F n in sequentially. dist (f (xs' n)) (?g x') < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7049
        "\<forall>\<^sub>F n in sequentially. dist (f (xs n)) (?g x) < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7050
        by (auto intro!: \<open>0 < e'\<close> order_tendstoD tendsto_eq_intros)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7051
      ultimately
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7052
      have "\<forall>\<^sub>F n in sequentially. dist (?g x') (?g x) < e"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7053
      proof eventually_elim
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7054
        case (elim n)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7055
        have "dist (?g x') (?g x) \<le>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7056
          dist (f (xs' n)) (?g x') + dist (f (xs' n)) (f (xs n)) + dist (f (xs n)) (?g x)"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7057
          by (metis add.commute add_le_cancel_left dist_commute dist_triangle dist_triangle_le)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7058
        also
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7059
        {
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7060
          have "dist (xs' n) (xs n) \<le> dist (xs' n) x' + dist x' x + dist (xs n) x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7061
            by (metis add.commute add_le_cancel_left  dist_triangle dist_triangle_le)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7062
          also note \<open>dist (xs' n) x' < d'\<close>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7063
          also note \<open>dist x' x < d'\<close>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7064
          also note \<open>dist (xs n) x < d'\<close>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7065
          finally have "dist (xs' n) (xs n) < d" by (simp add: d'_def)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7066
        }
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7067
        with \<open>xs _ \<in> X\<close> \<open>xs' _ \<in> X\<close> have "dist (f (xs' n)) (f (xs n)) < e'"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7068
          by (rule d)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7069
        also note \<open>dist (f (xs' n)) (?g x') < e'\<close>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7070
        also note \<open>dist (f (xs n)) (?g x) < e'\<close>
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7071
        finally show ?case by (simp add: e'_def)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7072
      qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7073
      then show "dist (?g x') (?g x) < e" by simp
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7074
    qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7075
  qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7076
  moreover have "f x = ?g x" if "x \<in> X" for x using that by simp
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7077
  moreover
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7078
  {
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7079
    fix Y h x
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7080
    assume Y: "x \<in> Y" "X \<subseteq> Y" "Y \<subseteq> closure X" and cont_h: "continuous_on Y h"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7081
      and extension: "(\<And>x. x \<in> X \<Longrightarrow> f x = h x)"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7082
    {
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7083
      assume "x \<notin> X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7084
      have "x \<in> closure X" using Y by auto
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7085
      then obtain xs where xs: "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7086
        by (auto simp: closure_sequential)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7087
      from continuous_on_tendsto_compose[OF cont_h xs(1)] xs(2) Y
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  7088
      have hx: "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> h x"
63105
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7089
        by (auto simp: set_mp extension)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7090
      then have "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> y x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7091
        using \<open>x \<notin> X\<close> not_eventuallyD xs(2)
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7092
        by (force intro!: filterlim_compose[OF y[OF \<open>x \<in> closure X\<close>]] simp: filterlim_at xs)
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63492
diff changeset
  7093
      with hx have "h x = y x" by (rule LIMSEQ_unique)
63105
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7094
    } then
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7095
    have "h x = ?g x"
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7096
      using extension by auto
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7097
  }
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7098
  ultimately show ?thesis ..
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7099
qed
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7100
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  7101
lemma bounded_uniformly_continuous_image:
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  7102
  fixes f :: "'a :: heine_borel \<Rightarrow> 'b :: heine_borel"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  7103
  assumes "uniformly_continuous_on S f" "bounded S"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  7104
  shows "bounded(image f S)"
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  7105
  by (metis (no_types, lifting) assms bounded_closure_image compact_closure compact_continuous_image compact_eq_bounded_closed image_cong uniformly_continuous_imp_continuous uniformly_continuous_on_extension_on_closure)
63105
c445b0924e3a uniformly continuous function extended continuously on closure
immler
parents: 63104
diff changeset
  7106
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7107
subsection\<open>Quotient maps\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7108
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7109
lemma quotient_map_imp_continuous_open:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7110
  assumes t: "f ` s \<subseteq> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7111
      and ope: "\<And>u. u \<subseteq> t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7112
              \<Longrightarrow> (openin (subtopology euclidean s) {x. x \<in> s \<and> f x \<in> u} \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7113
                   openin (subtopology euclidean t) u)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7114
    shows "continuous_on s f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7115
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7116
  have [simp]: "{x \<in> s. f x \<in> f ` s} = s" by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7117
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7118
    using ope [OF t]
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7119
    apply (simp add: continuous_on_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7120
    by (metis (no_types, lifting) "ope"  openin_imp_subset openin_trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7121
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7122
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7123
lemma quotient_map_imp_continuous_closed:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7124
  assumes t: "f ` s \<subseteq> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7125
      and ope: "\<And>u. u \<subseteq> t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7126
                  \<Longrightarrow> (closedin (subtopology euclidean s) {x. x \<in> s \<and> f x \<in> u} \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7127
                       closedin (subtopology euclidean t) u)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7128
    shows "continuous_on s f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7129
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7130
  have [simp]: "{x \<in> s. f x \<in> f ` s} = s" by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7131
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7132
    using ope [OF t]
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7133
    apply (simp add: continuous_on_closed)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7134
    by (metis (no_types, lifting) "ope" closedin_imp_subset closedin_subtopology_refl closedin_trans openin_subtopology_refl openin_subtopology_self)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7135
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7136
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7137
lemma open_map_imp_quotient_map:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7138
  assumes contf: "continuous_on s f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7139
      and t: "t \<subseteq> f ` s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7140
      and ope: "\<And>t. openin (subtopology euclidean s) t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7141
                   \<Longrightarrow> openin (subtopology euclidean (f ` s)) (f ` t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7142
    shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t} =
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7143
           openin (subtopology euclidean (f ` s)) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7144
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7145
  have "t = image f {x. x \<in> s \<and> f x \<in> t}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7146
    using t by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7147
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7148
    using "ope" contf continuous_on_open by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7149
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7150
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7151
lemma closed_map_imp_quotient_map:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7152
  assumes contf: "continuous_on s f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7153
      and t: "t \<subseteq> f ` s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7154
      and ope: "\<And>t. closedin (subtopology euclidean s) t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7155
              \<Longrightarrow> closedin (subtopology euclidean (f ` s)) (f ` t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7156
    shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t} \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7157
           openin (subtopology euclidean (f ` s)) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7158
          (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7159
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7160
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7161
  then have *: "closedin (subtopology euclidean s) (s - {x \<in> s. f x \<in> t})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7162
    using closedin_diff by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7163
  have [simp]: "(f ` s - f ` (s - {x \<in> s. f x \<in> t})) = t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7164
    using t by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7165
  show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7166
    using ope [OF *, unfolded closedin_def] by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7167
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7168
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7169
  with contf show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7170
    by (auto simp: continuous_on_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7171
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7172
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7173
lemma continuous_right_inverse_imp_quotient_map:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7174
  assumes contf: "continuous_on s f" and imf: "f ` s \<subseteq> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7175
      and contg: "continuous_on t g" and img: "g ` t \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7176
      and fg [simp]: "\<And>y. y \<in> t \<Longrightarrow> f(g y) = y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7177
      and u: "u \<subseteq> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7178
    shows "openin (subtopology euclidean s) {x. x \<in> s \<and> f x \<in> u} \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7179
           openin (subtopology euclidean t) u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7180
          (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7181
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7182
  have f: "\<And>z. openin (subtopology euclidean (f ` s)) z \<Longrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7183
                openin (subtopology euclidean s) {x \<in> s. f x \<in> z}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7184
  and  g: "\<And>z. openin (subtopology euclidean (g ` t)) z \<Longrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7185
                openin (subtopology euclidean t) {x \<in> t. g x \<in> z}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7186
    using contf contg by (auto simp: continuous_on_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7187
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7188
  proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7189
    have "{x \<in> t. g x \<in> g ` t \<and> g x \<in> s \<and> f (g x) \<in> u} = {x \<in> t. f (g x) \<in> u}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7190
      using imf img by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7191
    also have "... = u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7192
      using u by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7193
    finally have [simp]: "{x \<in> t. g x \<in> g ` t \<and> g x \<in> s \<and> f (g x) \<in> u} = u" .
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7194
    assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7195
    then have *: "openin (subtopology euclidean (g ` t)) (g ` t \<inter> {x \<in> s. f x \<in> u})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7196
      by (meson img openin_Int openin_subtopology_Int_subset openin_subtopology_self)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7197
    show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7198
      using g [OF *] by simp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7199
  next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7200
    assume rhs: ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7201
    show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7202
      apply (rule f)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7203
      by (metis fg image_eqI image_subset_iff imf img openin_subopen openin_subtopology_self openin_trans rhs)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7204
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7205
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7206
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7207
lemma continuous_left_inverse_imp_quotient_map:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7208
  assumes "continuous_on s f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7209
      and "continuous_on (f ` s) g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7210
      and  "\<And>x. x \<in> s \<Longrightarrow> g(f x) = x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7211
      and "u \<subseteq> f ` s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7212
    shows "openin (subtopology euclidean s) {x. x \<in> s \<and> f x \<in> u} \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7213
           openin (subtopology euclidean (f ` s)) u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7214
apply (rule continuous_right_inverse_imp_quotient_map)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7215
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7216
apply force+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7217
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7218
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7219
subsection \<open>A function constant on a set\<close>
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7220
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7221
definition constant_on  (infixl "(constant'_on)" 50)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7222
  where "f constant_on A \<equiv> \<exists>y. \<forall>x\<in>A. f x = y"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7223
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7224
lemma constant_on_subset: "\<lbrakk>f constant_on A; B \<subseteq> A\<rbrakk> \<Longrightarrow> f constant_on B"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7225
  unfolding constant_on_def by blast
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7226
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7227
lemma injective_not_constant:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7228
  fixes S :: "'a::{perfect_space} set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7229
  shows "\<lbrakk>open S; inj_on f S; f constant_on S\<rbrakk> \<Longrightarrow> S = {}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7230
unfolding constant_on_def
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7231
by (metis equals0I inj_on_contraD islimpt_UNIV islimpt_def)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7232
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7233
lemma constant_on_closureI:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7234
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7235
  assumes cof: "f constant_on S" and contf: "continuous_on (closure S) f"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7236
    shows "f constant_on (closure S)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7237
using continuous_constant_on_closure [OF contf] cof unfolding constant_on_def
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7238
by metis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7239
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7240
text \<open>Making a continuous function avoid some value in a neighbourhood.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7241
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7242
lemma continuous_within_avoid:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7243
  fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7244
  assumes "continuous (at x within s) f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7245
    and "f x \<noteq> a"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7246
  shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e --> f y \<noteq> a"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7247
proof -
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7248
  obtain U where "open U" and "f x \<in> U" and "a \<notin> U"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7249
    using t1_space [OF \<open>f x \<noteq> a\<close>] by fast
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  7250
  have "(f \<longlongrightarrow> f x) (at x within s)"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7251
    using assms(1) by (simp add: continuous_within)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7252
  then have "eventually (\<lambda>y. f y \<in> U) (at x within s)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7253
    using \<open>open U\<close> and \<open>f x \<in> U\<close>
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7254
    unfolding tendsto_def by fast
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7255
  then have "eventually (\<lambda>y. f y \<noteq> a) (at x within s)"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
  7256
    using \<open>a \<notin> U\<close> by (fast elim: eventually_mono)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7257
  then show ?thesis
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7258
    using \<open>f x \<noteq> a\<close> by (auto simp: dist_commute zero_less_dist_iff eventually_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7259
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7260
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7261
lemma continuous_at_avoid:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7262
  fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7263
  assumes "continuous (at x) f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7264
    and "f x \<noteq> a"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7265
  shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a"
45031
9583f2b56f85 add lemmas within_empty and tendsto_bot;
huffman
parents: 44909
diff changeset
  7266
  using assms continuous_within_avoid[of x UNIV f a] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7267
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7268
lemma continuous_on_avoid:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7269
  fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7270
  assumes "continuous_on s f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7271
    and "x \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7272
    and "f x \<noteq> a"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7273
  shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e \<longrightarrow> f y \<noteq> a"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7274
  using assms(1)[unfolded continuous_on_eq_continuous_within, THEN bspec[where x=x],
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7275
    OF assms(2)] continuous_within_avoid[of x s f a]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7276
  using assms(3)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7277
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7278
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7279
lemma continuous_on_open_avoid:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7280
  fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7281
  assumes "continuous_on s f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7282
    and "open s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7283
    and "x \<in> s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7284
    and "f x \<noteq> a"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7285
  shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7286
  using assms(1)[unfolded continuous_on_eq_continuous_at[OF assms(2)], THEN bspec[where x=x], OF assms(3)]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7287
  using continuous_at_avoid[of x f a] assms(4)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7288
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7289
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7290
text \<open>Proving a function is constant by proving open-ness of level set.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7291
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7292
lemma continuous_levelset_openin_cases:
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  7293
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  7294
  shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7295
        openin (subtopology euclidean s) {x \<in> s. f x = a}
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7296
        \<Longrightarrow> (\<forall>x \<in> s. f x \<noteq> a) \<or> (\<forall>x \<in> s. f x = a)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7297
  unfolding connected_clopen
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7298
  using continuous_closedin_preimage_constant by auto
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7299
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7300
lemma continuous_levelset_openin:
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  7301
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  7302
  shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7303
        openin (subtopology euclidean s) {x \<in> s. f x = a} \<Longrightarrow>
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7304
        (\<exists>x \<in> s. f x = a)  \<Longrightarrow> (\<forall>x \<in> s. f x = a)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7305
  using continuous_levelset_openin_cases[of s f ]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7306
  by meson
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7307
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7308
lemma continuous_levelset_open:
36668
941ba2da372e simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents: 36667
diff changeset
  7309
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7310
  assumes "connected s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7311
    and "continuous_on s f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7312
    and "open {x \<in> s. f x = a}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7313
    and "\<exists>x \<in> s.  f x = a"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7314
  shows "\<forall>x \<in> s. f x = a"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7315
  using continuous_levelset_openin[OF assms(1,2), of a, unfolded openin_open]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7316
  using assms (3,4)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7317
  by fast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7318
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7319
text \<open>Some arithmetical combinations (more to prove).\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7320
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7321
lemma open_scaling[intro]:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7322
  fixes s :: "'a::real_normed_vector set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7323
  assumes "c \<noteq> 0"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7324
    and "open s"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7325
  shows "open((\<lambda>x. c *\<^sub>R x) ` s)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7326
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7327
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7328
    fix x
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7329
    assume "x \<in> s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7330
    then obtain e where "e>0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7331
      and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> s" using assms(2)[unfolded open_dist, THEN bspec[where x=x]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7332
      by auto
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7333
    have "e * \<bar>c\<bar> > 0"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7334
      using assms(1)[unfolded zero_less_abs_iff[symmetric]] \<open>e>0\<close> by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7335
    moreover
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7336
    {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7337
      fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7338
      assume "dist y (c *\<^sub>R x) < e * \<bar>c\<bar>"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7339
      then have "norm ((1 / c) *\<^sub>R y - x) < e"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7340
        unfolding dist_norm
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7341
        using norm_scaleR[of c "(1 / c) *\<^sub>R y - x", unfolded scaleR_right_diff_distrib, unfolded scaleR_scaleR] assms(1)
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7342
          assms(1)[unfolded zero_less_abs_iff[symmetric]] by (simp del:zero_less_abs_iff)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7343
      then have "y \<in> op *\<^sub>R c ` s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7344
        using rev_image_eqI[of "(1 / c) *\<^sub>R y" s y "op *\<^sub>R c"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7345
        using e[THEN spec[where x="(1 / c) *\<^sub>R y"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7346
        using assms(1)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7347
        unfolding dist_norm scaleR_scaleR
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7348
        by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7349
    }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7350
    ultimately have "\<exists>e>0. \<forall>x'. dist x' (c *\<^sub>R x) < e \<longrightarrow> x' \<in> op *\<^sub>R c ` s"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7351
      apply (rule_tac x="e * \<bar>c\<bar>" in exI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7352
      apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7353
      done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7354
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7355
  then show ?thesis unfolding open_dist by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7356
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7357
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7358
lemma minus_image_eq_vimage:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7359
  fixes A :: "'a::ab_group_add set"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7360
  shows "(\<lambda>x. - x) ` A = (\<lambda>x. - x) -` A"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7361
  by (auto intro!: image_eqI [where f="\<lambda>x. - x"])
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7362
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7363
lemma open_negations:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7364
  fixes S :: "'a::real_normed_vector set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7365
  shows "open S \<Longrightarrow> open ((\<lambda>x. - x) ` S)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7366
  using open_scaling [of "- 1" S] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7367
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7368
lemma open_translation:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7369
  fixes S :: "'a::real_normed_vector set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7370
  assumes "open S"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7371
  shows "open((\<lambda>x. a + x) ` S)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7372
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7373
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7374
    fix x
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7375
    have "continuous (at x) (\<lambda>x. x - a)"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  7376
      by (intro continuous_diff continuous_ident continuous_const)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7377
  }
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7378
  moreover have "{x. x - a \<in> S} = op + a ` S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7379
    by force
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7380
  ultimately show ?thesis
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7381
    by (metis assms continuous_open_vimage vimage_def)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7382
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7383
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7384
lemma open_affinity:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7385
  fixes S :: "'a::real_normed_vector set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7386
  assumes "open S"  "c \<noteq> 0"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7387
  shows "open ((\<lambda>x. a + c *\<^sub>R x) ` S)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7388
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7389
  have *: "(\<lambda>x. a + c *\<^sub>R x) = (\<lambda>x. a + x) \<circ> (\<lambda>x. c *\<^sub>R x)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7390
    unfolding o_def ..
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7391
  have "op + a ` op *\<^sub>R c ` S = (op + a \<circ> op *\<^sub>R c) ` S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7392
    by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7393
  then show ?thesis
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7394
    using assms open_translation[of "op *\<^sub>R c ` S" a]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7395
    unfolding *
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7396
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7397
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7398
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7399
lemma interior_translation:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7400
  fixes S :: "'a::real_normed_vector set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7401
  shows "interior ((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (interior 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
  7402
proof (rule set_eqI, rule)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7403
  fix x
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7404
  assume "x \<in> interior (op + a ` S)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7405
  then obtain e where "e > 0" and e: "ball x e \<subseteq> op + a ` S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7406
    unfolding mem_interior by auto
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7407
  then have "ball (x - a) e \<subseteq> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7408
    unfolding subset_eq Ball_def mem_ball dist_norm
59815
cce82e360c2f explicit commutative additive inverse operation;
haftmann
parents: 59765
diff changeset
  7409
    by (auto simp add: diff_diff_eq)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7410
  then show "x \<in> op + a ` interior S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7411
    unfolding image_iff
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7412
    apply (rule_tac x="x - a" in bexI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7413
    unfolding mem_interior
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7414
    using \<open>e > 0\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7415
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7416
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7417
next
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7418
  fix x
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7419
  assume "x \<in> op + a ` interior S"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7420
  then obtain y e where "e > 0" and e: "ball y e \<subseteq> S" and y: "x = a + y"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7421
    unfolding image_iff Bex_def mem_interior by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7422
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7423
    fix z
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7424
    have *: "a + y - z = y + a - z" by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7425
    assume "z \<in> ball x e"
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7426
    then have "z - a \<in> S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7427
      using e[unfolded subset_eq, THEN bspec[where x="z - a"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7428
      unfolding mem_ball dist_norm y group_add_class.diff_diff_eq2 *
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7429
      by auto
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7430
    then have "z \<in> op + a ` S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7431
      unfolding image_iff by (auto intro!: bexI[where x="z - a"])
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7432
  }
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7433
  then have "ball x e \<subseteq> op + a ` S"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7434
    unfolding subset_eq by auto
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7435
  then show "x \<in> interior (op + a ` S)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7436
    unfolding mem_interior using \<open>e > 0\<close> by auto
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7437
qed
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7438
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7439
subsection \<open>Topological properties of linear functions.\<close>
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7440
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7441
lemma linear_lim_0:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7442
  assumes "bounded_linear f"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  7443
  shows "(f \<longlongrightarrow> 0) (at (0))"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7444
proof -
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7445
  interpret f: bounded_linear f by fact
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  7446
  have "(f \<longlongrightarrow> f 0) (at 0)"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7447
    using tendsto_ident_at by (rule f.tendsto)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7448
  then show ?thesis unfolding f.zero .
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7449
qed
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7450
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7451
lemma linear_continuous_at:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7452
  assumes "bounded_linear f"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7453
  shows "continuous (at a) f"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7454
  unfolding continuous_at using assms
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7455
  apply (rule bounded_linear.tendsto)
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7456
  apply (rule tendsto_ident_at)
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7457
  done
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7458
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7459
lemma linear_continuous_within:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7460
  "bounded_linear f \<Longrightarrow> continuous (at x within s) f"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7461
  using continuous_at_imp_continuous_within[of x f s] using linear_continuous_at[of f] by auto
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7462
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7463
lemma linear_continuous_on:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7464
  "bounded_linear f \<Longrightarrow> continuous_on s f"
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7465
  using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7466
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7467
subsubsection\<open>Relating linear images to open/closed/interior/closure.\<close>
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7468
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7469
proposition open_surjective_linear_image:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7470
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::euclidean_space"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7471
  assumes "open A" "linear f" "surj f"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7472
    shows "open(f ` A)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7473
unfolding open_dist
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7474
proof clarify
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7475
  fix x
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7476
  assume "x \<in> A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7477
  have "bounded (inv f ` Basis)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7478
    by (simp add: finite_imp_bounded)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7479
  with bounded_pos obtain B where "B > 0" and B: "\<And>x. x \<in> inv f ` Basis \<Longrightarrow> norm x \<le> B"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7480
    by metis
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7481
  obtain e where "e > 0" and e: "\<And>z. dist z x < e \<Longrightarrow> z \<in> A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7482
    by (metis open_dist \<open>x \<in> A\<close> \<open>open A\<close>)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7483
  define \<delta> where "\<delta> \<equiv> e / B / DIM('b)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7484
  show "\<exists>e>0. \<forall>y. dist y (f x) < e \<longrightarrow> y \<in> f ` A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7485
  proof (intro exI conjI)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7486
    show "\<delta> > 0"
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  7487
      using \<open>e > 0\<close> \<open>B > 0\<close>  by (simp add: \<delta>_def divide_simps)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7488
    have "y \<in> f ` A" if "dist y (f x) * (B * real DIM('b)) < e" for y
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7489
    proof -
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7490
      define u where "u \<equiv> y - f x"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7491
      show ?thesis
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7492
      proof (rule image_eqI)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7493
        show "y = f (x + (\<Sum>i\<in>Basis. (u \<bullet> i) *\<^sub>R inv f i))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  7494
          apply (simp add: linear_add linear_sum linear.scaleR \<open>linear f\<close> surj_f_inv_f \<open>surj f\<close>)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7495
          apply (simp add: euclidean_representation u_def)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7496
          done
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7497
        have "dist (x + (\<Sum>i\<in>Basis. (u \<bullet> i) *\<^sub>R inv f i)) x \<le> (\<Sum>i\<in>Basis. norm ((u \<bullet> i) *\<^sub>R inv f i))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  7498
          by (simp add: dist_norm sum_norm_le)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7499
        also have "... = (\<Sum>i\<in>Basis. \<bar>u \<bullet> i\<bar> * norm (inv f i))"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7500
          by (simp add: )
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7501
        also have "... \<le> (\<Sum>i\<in>Basis. \<bar>u \<bullet> i\<bar>) * B"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  7502
          by (simp add: B sum_distrib_right sum_mono mult_left_mono)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7503
        also have "... \<le> DIM('b) * dist y (f x) * B"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  7504
          apply (rule mult_right_mono [OF sum_bounded_above])
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7505
          using \<open>0 < B\<close> by (auto simp add: Basis_le_norm dist_norm u_def)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7506
        also have "... < e"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7507
          by (metis mult.commute mult.left_commute that)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7508
        finally show "x + (\<Sum>i\<in>Basis. (u \<bullet> i) *\<^sub>R inv f i) \<in> A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7509
          by (rule e)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7510
      qed
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7511
    qed
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7512
    then show "\<forall>y. dist y (f x) < \<delta> \<longrightarrow> y \<in> f ` A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7513
      using \<open>e > 0\<close> \<open>B > 0\<close>
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7514
      by (auto simp: \<delta>_def divide_simps mult_less_0_iff)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7515
  qed
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7516
qed
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7517
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7518
corollary open_bijective_linear_image_eq:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7519
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7520
  assumes "linear f" "bij f"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7521
    shows "open(f ` A) \<longleftrightarrow> open A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7522
proof
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7523
  assume "open(f ` A)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7524
  then have "open(f -` (f ` A))"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7525
    using assms by (force simp add: linear_continuous_at linear_conv_bounded_linear continuous_open_vimage)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7526
  then show "open A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7527
    by (simp add: assms bij_is_inj inj_vimage_image_eq)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7528
next
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7529
  assume "open A"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7530
  then show "open(f ` A)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7531
    by (simp add: assms bij_is_surj open_surjective_linear_image)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7532
qed
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  7533
66154
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7534
corollary interior_bijective_linear_image:
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7535
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7536
  assumes "linear f" "bij f"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7537
  shows "interior (f ` S) = f ` interior S"  (is "?lhs = ?rhs")
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7538
proof safe
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7539
  fix x
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7540
  assume x: "x \<in> ?lhs"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7541
  then obtain T where "open T" and "x \<in> T" and "T \<subseteq> f ` S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7542
    by (metis interiorE)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7543
  then show "x \<in> ?rhs"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7544
    by (metis (no_types, hide_lams) assms subsetD interior_maximal open_bijective_linear_image_eq subset_image_iff)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7545
next
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7546
  fix x
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7547
  assume x: "x \<in> interior S"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7548
  then show "f x \<in> interior (f ` S)"
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7549
    by (meson assms imageI image_mono interiorI interior_subset open_bijective_linear_image_eq open_interior)
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7550
qed
66164
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7551
  
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7552
lemma interior_injective_linear_image:
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7553
  fixes f :: "'a::euclidean_space \<Rightarrow> 'a::euclidean_space"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7554
  assumes "linear f" "inj f"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7555
   shows "interior(f ` S) = f ` (interior S)"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7556
  by (simp add: linear_injective_imp_surjective assms bijI interior_bijective_linear_image)
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7557
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7558
lemma interior_surjective_linear_image:
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7559
  fixes f :: "'a::euclidean_space \<Rightarrow> 'a::euclidean_space"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7560
  assumes "linear f" "surj f"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7561
   shows "interior(f ` S) = f ` (interior S)"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7562
  by (simp add: assms interior_injective_linear_image linear_surjective_imp_injective)
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7563
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7564
lemma interior_negations:
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7565
  fixes S :: "'a::euclidean_space set"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7566
  shows "interior(uminus ` S) = image uminus (interior S)"
2d79288b042c New theorems and much tidying up of the old ones
paulson <lp15@cam.ac.uk>
parents: 66154
diff changeset
  7567
  by (simp add: bij_uminus interior_bijective_linear_image linear_uminus)
66154
bc5e6461f759 Tidying up integration theory and some new theorems
paulson <lp15@cam.ac.uk>
parents: 66112
diff changeset
  7568
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7569
text \<open>Also bilinear functions, in composition form.\<close>
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7570
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7571
lemma bilinear_continuous_at_compose:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7572
  "continuous (at x) f \<Longrightarrow> continuous (at x) g \<Longrightarrow> bounded_bilinear h \<Longrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7573
    continuous (at x) (\<lambda>x. h (f x) (g x))"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7574
  unfolding continuous_at
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7575
  using Lim_bilinear[of f "f x" "(at x)" g "g x" h]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7576
  by auto
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7577
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7578
lemma bilinear_continuous_within_compose:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7579
  "continuous (at x within s) f \<Longrightarrow> continuous (at x within s) g \<Longrightarrow> bounded_bilinear h \<Longrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7580
    continuous (at x within s) (\<lambda>x. h (f x) (g x))"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  7581
  by (rule Limits.bounded_bilinear.continuous)
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7582
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7583
lemma bilinear_continuous_on_compose:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7584
  "continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> bounded_bilinear h \<Longrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7585
    continuous_on s (\<lambda>x. h (f x) (g x))"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  7586
  by (rule Limits.bounded_bilinear.continuous_on)
36437
e76cb1d4663c reorganize subsection headings
huffman
parents: 36431
diff changeset
  7587
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7588
text \<open>Preservation of compactness and connectedness under continuous function.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7589
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7590
lemma compact_eq_openin_cover:
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7591
  "compact S \<longleftrightarrow>
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7592
    (\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow>
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7593
      (\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D))"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7594
proof safe
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7595
  fix C
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7596
  assume "compact S" and "\<forall>c\<in>C. openin (subtopology euclidean S) c" and "S \<subseteq> \<Union>C"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7597
  then have "\<forall>c\<in>{T. open T \<and> S \<inter> T \<in> C}. open c" and "S \<subseteq> \<Union>{T. open T \<and> S \<inter> T \<in> C}"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7598
    unfolding openin_open by force+
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7599
  with \<open>compact S\<close> obtain D where "D \<subseteq> {T. open T \<and> S \<inter> T \<in> C}" and "finite D" and "S \<subseteq> \<Union>D"
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
  7600
    by (meson compactE)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7601
  then have "image (\<lambda>T. S \<inter> T) D \<subseteq> C \<and> finite (image (\<lambda>T. S \<inter> T) D) \<and> S \<subseteq> \<Union>(image (\<lambda>T. S \<inter> T) D)"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7602
    by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7603
  then show "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" ..
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7604
next
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7605
  assume 1: "\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow>
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7606
        (\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D)"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7607
  show "compact S"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7608
  proof (rule compactI)
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7609
    fix C
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7610
    let ?C = "image (\<lambda>T. S \<inter> T) C"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7611
    assume "\<forall>t\<in>C. open t" and "S \<subseteq> \<Union>C"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7612
    then have "(\<forall>c\<in>?C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>?C"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7613
      unfolding openin_open by auto
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7614
    with 1 obtain D where "D \<subseteq> ?C" and "finite D" and "S \<subseteq> \<Union>D"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7615
      by metis
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7616
    let ?D = "inv_into C (\<lambda>T. S \<inter> T) ` D"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7617
    have "?D \<subseteq> C \<and> finite ?D \<and> S \<subseteq> \<Union>?D"
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7618
    proof (intro conjI)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7619
      from \<open>D \<subseteq> ?C\<close> show "?D \<subseteq> C"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7620
        by (fast intro: inv_into_into)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7621
      from \<open>finite D\<close> show "finite ?D"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7622
        by (rule finite_imageI)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7623
      from \<open>S \<subseteq> \<Union>D\<close> show "S \<subseteq> \<Union>?D"
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7624
        apply (rule subset_trans)
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7625
        apply clarsimp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7626
        apply (frule subsetD [OF \<open>D \<subseteq> ?C\<close>, THEN f_inv_into_f])
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7627
        apply (erule rev_bexI, fast)
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7628
        done
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7629
    qed
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7630
    then show "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" ..
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7631
  qed
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7632
qed
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  7633
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7634
lemma connected_continuous_image:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7635
  assumes "continuous_on s f"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7636
    and "connected s"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7637
  shows "connected(f ` s)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7638
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7639
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7640
    fix T
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7641
    assume as:
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7642
      "T \<noteq> {}"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7643
      "T \<noteq> f ` s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7644
      "openin (subtopology euclidean (f ` s)) T"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7645
      "closedin (subtopology euclidean (f ` s)) T"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7646
    have "{x \<in> s. f x \<in> T} = {} \<or> {x \<in> s. f x \<in> T} = s"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7647
      using assms(1)[unfolded continuous_on_open, THEN spec[where x=T]]
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7648
      using assms(1)[unfolded continuous_on_closed, THEN spec[where x=T]]
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7649
      using assms(2)[unfolded connected_clopen, THEN spec[where x="{x \<in> s. f x \<in> T}"]] as(3,4) by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7650
    then have False using as(1,2)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7651
      using as(4)[unfolded closedin_def topspace_euclidean_subtopology] by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7652
  }
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7653
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7654
    unfolding connected_clopen by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7655
qed
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  7656
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  7657
lemma connected_linear_image:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  7658
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  7659
  assumes "linear f" and "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  7660
  shows "connected (f ` s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  7661
using connected_continuous_image assms linear_continuous_on linear_conv_bounded_linear by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7662
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7663
text \<open>Continuity implies uniform continuity on a compact domain.\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7664
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7665
subsection \<open>Continuity implies uniform continuity on a compact domain.\<close>
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7666
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7667
text\<open>From the proof of the Heine-Borel theorem: Lemma 2 in section 3.7, page 69 of
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7668
J. C. Burkill and H. Burkill. A Second Course in Mathematical Analysis (CUP, 2002)\<close>
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7669
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7670
lemma Heine_Borel_lemma:
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7671
  assumes "compact S" and Ssub: "S \<subseteq> \<Union>\<G>" and op: "\<And>G. G \<in> \<G> \<Longrightarrow> open G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7672
  obtains e where "0 < e" "\<And>x. x \<in> S \<Longrightarrow> \<exists>G \<in> \<G>. ball x e \<subseteq> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7673
proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7674
  have False if neg: "\<And>e. 0 < e \<Longrightarrow> \<exists>x \<in> S. \<forall>G \<in> \<G>. \<not> ball x e \<subseteq> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7675
  proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7676
    have "\<exists>x \<in> S. \<forall>G \<in> \<G>. \<not> ball x (1 / Suc n) \<subseteq> G" for n
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7677
      using neg by simp
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7678
    then obtain f where "\<And>n. f n \<in> S" and fG: "\<And>G n. G \<in> \<G> \<Longrightarrow> \<not> ball (f n) (1 / Suc n) \<subseteq> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7679
      by metis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7680
    then obtain l r where "l \<in> S" "subseq r" and to_l: "(f \<circ> r) \<longlonglongrightarrow> l"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7681
      using \<open>compact S\<close> compact_def that by metis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7682
    then obtain G where "l \<in> G" "G \<in> \<G>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7683
      using Ssub by auto
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7684
    then obtain e where "0 < e" and e: "\<And>z. dist z l < e \<Longrightarrow> z \<in> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7685
      using op open_dist by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7686
    obtain N1 where N1: "\<And>n. n \<ge> N1 \<Longrightarrow> dist (f (r n)) l < e/2"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7687
      using to_l apply (simp add: lim_sequentially)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7688
      using \<open>0 < e\<close> half_gt_zero that by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7689
    obtain N2 where N2: "of_nat N2 > 2/e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7690
      using reals_Archimedean2 by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7691
    obtain x where "x \<in> ball (f (r (max N1 N2))) (1 / real (Suc (r (max N1 N2))))" and "x \<notin> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7692
      using fG [OF \<open>G \<in> \<G>\<close>, of "r (max N1 N2)"] by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7693
    then have "dist (f (r (max N1 N2))) x < 1 / real (Suc (r (max N1 N2)))"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7694
      by simp
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7695
    also have "... \<le> 1 / real (Suc (max N1 N2))"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7696
      apply (simp add: divide_simps del: max.bounded_iff)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7697
      using \<open>subseq r\<close> seq_suble by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7698
    also have "... \<le> 1 / real (Suc N2)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7699
      by (simp add: field_simps)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7700
    also have "... < e/2"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7701
      using N2 \<open>0 < e\<close> by (simp add: field_simps)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7702
    finally have "dist (f (r (max N1 N2))) x < e / 2" .
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7703
    moreover have "dist (f (r (max N1 N2))) l < e/2"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7704
      using N1 max.cobounded1 by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7705
    ultimately have "dist x l < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7706
      using dist_triangle_half_r by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7707
    then show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7708
      using e \<open>x \<notin> G\<close> by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7709
  qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7710
  then show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7711
    by (meson that)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7712
qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7713
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7714
lemma compact_uniformly_equicontinuous:
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7715
  assumes "compact S"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7716
      and cont: "\<And>x e. \<lbrakk>x \<in> S; 0 < e\<rbrakk>
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7717
                        \<Longrightarrow> \<exists>d. 0 < d \<and>
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7718
                                (\<forall>f \<in> \<F>. \<forall>x' \<in> S. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7719
      and "0 < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7720
  obtains d where "0 < d"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7721
                  "\<And>f x x'. \<lbrakk>f \<in> \<F>; x \<in> S; x' \<in> S; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7722
proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7723
  obtain d where d_pos: "\<And>x e. \<lbrakk>x \<in> S; 0 < e\<rbrakk> \<Longrightarrow> 0 < d x e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7724
     and d_dist : "\<And>x x' e f. \<lbrakk>dist x' x < d x e; x \<in> S; x' \<in> S; 0 < e; f \<in> \<F>\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7725
    using cont by metis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7726
  let ?\<G> = "((\<lambda>x. ball x (d x (e / 2))) ` S)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7727
  have Ssub: "S \<subseteq> \<Union> ?\<G>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7728
    by clarsimp (metis d_pos \<open>0 < e\<close> dist_self half_gt_zero_iff)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7729
  then obtain k where "0 < k" and k: "\<And>x. x \<in> S \<Longrightarrow> \<exists>G \<in> ?\<G>. ball x k \<subseteq> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7730
    by (rule Heine_Borel_lemma [OF \<open>compact S\<close>]) auto
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7731
  moreover have "dist (f v) (f u) < e" if "f \<in> \<F>" "u \<in> S" "v \<in> S" "dist v u < k" for f u v
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7732
  proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7733
    obtain G where "G \<in> ?\<G>" "u \<in> G" "v \<in> G"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7734
      using k that
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7735
      by (metis \<open>dist v u < k\<close> \<open>u \<in> S\<close> \<open>0 < k\<close> centre_in_ball subsetD dist_commute mem_ball)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7736
    then obtain w where w: "dist w u < d w (e / 2)" "dist w v < d w (e / 2)" "w \<in> S"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7737
      by auto
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7738
    with that d_dist have "dist (f w) (f v) < e/2"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7739
      by (metis \<open>0 < e\<close> dist_commute half_gt_zero)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7740
    moreover
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7741
    have "dist (f w) (f u) < e/2"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7742
      using that d_dist w by (metis \<open>0 < e\<close> dist_commute divide_pos_pos zero_less_numeral)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7743
    ultimately show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7744
      using dist_triangle_half_r by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7745
  qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7746
  ultimately show ?thesis using that by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7747
qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7748
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7749
corollary compact_uniformly_continuous:
62101
26c0a70f78a3 add uniform spaces
hoelzl
parents: 62087
diff changeset
  7750
  fixes f :: "'a :: metric_space \<Rightarrow> 'b :: metric_space"
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7751
  assumes f: "continuous_on S f" and S: "compact S"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7752
  shows "uniformly_continuous_on S f"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7753
  using f
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7754
    unfolding continuous_on_iff uniformly_continuous_on_def
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
  7755
    by (force intro: compact_uniformly_equicontinuous [OF S, of "{f}"])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7756
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  7757
subsection \<open>Topological stuff about the set of Reals\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7758
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7759
lemma open_real:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7760
  fixes s :: "real set"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7761
  shows "open s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e>0. \<forall>x'. \<bar>x' - x\<bar> < e --> x' \<in> s)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7762
  unfolding open_dist dist_norm by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7763
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7764
lemma islimpt_approachable_real:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7765
  fixes s :: "real set"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7766
  shows "x islimpt s \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7767
  unfolding islimpt_approachable dist_norm by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7768
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7769
lemma closed_real:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7770
  fixes s :: "real set"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7771
  shows "closed s \<longleftrightarrow> (\<forall>x. (\<forall>e>0.  \<exists>x' \<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e) \<longrightarrow> x \<in> s)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7772
  unfolding closed_limpt islimpt_approachable dist_norm by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7773
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7774
lemma continuous_at_real_range:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7775
  fixes f :: "'a::real_normed_vector \<Rightarrow> real"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7776
  shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'. norm(x' - x) < d --> \<bar>f x' - f x\<bar> < e)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7777
  unfolding continuous_at
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7778
  unfolding Lim_at
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7779
  unfolding dist_norm
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7780
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7781
  apply (erule_tac x=e in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7782
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7783
  apply (rule_tac x=d in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7784
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7785
  apply (erule_tac x=x' in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7786
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7787
  apply (erule_tac x=e in allE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7788
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7789
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7790
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7791
lemma continuous_on_real_range:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7792
  fixes f :: "'a::real_normed_vector \<Rightarrow> real"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7793
  shows "continuous_on s f \<longleftrightarrow>
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61942
diff changeset
  7794
    (\<forall>x \<in> s. \<forall>e>0. \<exists>d>0. (\<forall>x' \<in> s. norm(x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e))"
36359
e5c785c166b2 generalize type of continuous_on
huffman
parents: 36358
diff changeset
  7795
  unfolding continuous_on_iff dist_norm by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7796
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7797
text \<open>Hence some handy theorems on distance, diameter etc. of/from a set.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7798
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7799
lemma distance_attains_sup:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7800
  assumes "compact s" "s \<noteq> {}"
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  7801
  shows "\<exists>x\<in>s. \<forall>y\<in>s. dist a y \<le> dist a x"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7802
proof (rule continuous_attains_sup [OF assms])
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7803
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7804
    fix x
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7805
    assume "x\<in>s"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  7806
    have "(dist a \<longlongrightarrow> dist a x) (at x within s)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  7807
      by (intro tendsto_dist tendsto_const tendsto_ident_at)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7808
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7809
  then show "continuous_on s (dist a)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7810
    unfolding continuous_on ..
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7811
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7812
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7813
text \<open>For \emph{minimal} distance, we only need closure, not compactness.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7814
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7815
lemma distance_attains_inf:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7816
  fixes a :: "'a::heine_borel"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7817
  assumes "closed s" and "s \<noteq> {}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7818
  obtains x where "x\<in>s" "\<And>y. y \<in> s \<Longrightarrow> dist a x \<le> dist a y"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7819
proof -
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7820
  from assms obtain b where "b \<in> s" by auto
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  7821
  let ?B = "s \<inter> cball a (dist b a)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7822
  have "?B \<noteq> {}" using \<open>b \<in> s\<close>
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7823
    by (auto simp: dist_commute)
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  7824
  moreover have "continuous_on ?B (dist a)"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  7825
    by (auto intro!: continuous_at_imp_continuous_on continuous_dist continuous_ident continuous_const)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7826
  moreover have "compact ?B"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  7827
    by (intro closed_Int_compact \<open>closed s\<close> compact_cball)
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  7828
  ultimately obtain x where "x \<in> ?B" "\<forall>y\<in>?B. dist a x \<le> dist a y"
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  7829
    by (metis continuous_attains_inf)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7830
  with that show ?thesis by fastforce
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7831
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7832
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7833
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  7834
subsection \<open>Cartesian products\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7835
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7836
lemma bounded_Times:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7837
  assumes "bounded s" "bounded t"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7838
  shows "bounded (s \<times> t)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7839
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7840
  obtain x y a b where "\<forall>z\<in>s. dist x z \<le> a" "\<forall>z\<in>t. dist y z \<le> b"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7841
    using assms [unfolded bounded_def] by auto
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52625
diff changeset
  7842
  then have "\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7843
    by (auto simp add: dist_Pair_Pair real_sqrt_le_mono add_mono power_mono)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7844
  then show ?thesis unfolding bounded_any_center [where a="(x, y)"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7845
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7846
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7847
lemma mem_Times_iff: "x \<in> A \<times> B \<longleftrightarrow> fst x \<in> A \<and> snd x \<in> B"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7848
  by (induct x) simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7849
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  7850
lemma seq_compact_Times: "seq_compact s \<Longrightarrow> seq_compact t \<Longrightarrow> seq_compact (s \<times> t)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7851
  unfolding seq_compact_def
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7852
  apply clarify
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7853
  apply (drule_tac x="fst \<circ> f" in spec)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7854
  apply (drule mp, simp add: mem_Times_iff)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7855
  apply (clarify, rename_tac l1 r1)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7856
  apply (drule_tac x="snd \<circ> f \<circ> r1" in spec)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7857
  apply (drule mp, simp add: mem_Times_iff)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7858
  apply (clarify, rename_tac l2 r2)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7859
  apply (rule_tac x="(l1, l2)" in rev_bexI, simp)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7860
  apply (rule_tac x="r1 \<circ> r2" in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7861
  apply (rule conjI, simp add: subseq_def)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7862
  apply (drule_tac f=r2 in LIMSEQ_subseq_LIMSEQ, assumption)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7863
  apply (drule (1) tendsto_Pair) back
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7864
  apply (simp add: o_def)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7865
  done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7866
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7867
lemma compact_Times:
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7868
  assumes "compact s" "compact t"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7869
  shows "compact (s \<times> t)"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7870
proof (rule compactI)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7871
  fix C
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7872
  assume C: "\<forall>t\<in>C. open t" "s \<times> t \<subseteq> \<Union>C"
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7873
  have "\<forall>x\<in>s. \<exists>a. open a \<and> x \<in> a \<and> (\<exists>d\<subseteq>C. finite d \<and> a \<times> t \<subseteq> \<Union>d)"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7874
  proof
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7875
    fix x
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7876
    assume "x \<in> s"
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7877
    have "\<forall>y\<in>t. \<exists>a b c. c \<in> C \<and> open a \<and> open b \<and> x \<in> a \<and> y \<in> b \<and> a \<times> b \<subseteq> c" (is "\<forall>y\<in>t. ?P y")
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7878
    proof
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7879
      fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7880
      assume "y \<in> t"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7881
      with \<open>x \<in> s\<close> C obtain c where "c \<in> C" "(x, y) \<in> c" "open c" by auto
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7882
      then show "?P y" by (auto elim!: open_prod_elim)
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7883
    qed
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7884
    then obtain a b c where b: "\<And>y. y \<in> t \<Longrightarrow> open (b y)"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7885
      and c: "\<And>y. y \<in> t \<Longrightarrow> c y \<in> C \<and> open (a y) \<and> open (b y) \<and> x \<in> a y \<and> y \<in> b y \<and> a y \<times> b y \<subseteq> c y"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7886
      by metis
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7887
    then have "\<forall>y\<in>t. open (b y)" "t \<subseteq> (\<Union>y\<in>t. b y)" by auto
65585
a043de9ad41e Some fixes related to compactE_image
paulson <lp15@cam.ac.uk>
parents: 65204
diff changeset
  7888
    with compactE_image[OF \<open>compact t\<close>] obtain D where D: "D \<subseteq> t" "finite D" "t \<subseteq> (\<Union>y\<in>D. b y)"
a043de9ad41e Some fixes related to compactE_image
paulson <lp15@cam.ac.uk>
parents: 65204
diff changeset
  7889
      by metis
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 53291
diff changeset
  7890
    moreover from D c have "(\<Inter>y\<in>D. a y) \<times> t \<subseteq> (\<Union>y\<in>D. c y)"
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7891
      by (fastforce simp: subset_eq)
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7892
    ultimately show "\<exists>a. open a \<and> x \<in> a \<and> (\<exists>d\<subseteq>C. finite d \<and> a \<times> t \<subseteq> \<Union>d)"
52141
eff000cab70f weaker precendence of syntax for big intersection and union on sets
haftmann
parents: 51773
diff changeset
  7893
      using c by (intro exI[of _ "c`D"] exI[of _ "\<Inter>(a`D)"] conjI) (auto intro!: open_INT)
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7894
  qed
65585
a043de9ad41e Some fixes related to compactE_image
paulson <lp15@cam.ac.uk>
parents: 65204
diff changeset
  7895
  then obtain a d where a: "\<And>x. x\<in>s \<Longrightarrow> open (a x)" "s \<subseteq> (\<Union>x\<in>s. a x)"
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7896
    and d: "\<And>x. x \<in> s \<Longrightarrow> d x \<subseteq> C \<and> finite (d x) \<and> a x \<times> t \<subseteq> \<Union>d x"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7897
    unfolding subset_eq UN_iff by metis
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7898
  moreover
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7899
  from compactE_image[OF \<open>compact s\<close> a]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7900
  obtain e where e: "e \<subseteq> s" "finite e" and s: "s \<subseteq> (\<Union>x\<in>e. a x)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7901
    by auto
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7902
  moreover
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7903
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7904
    from s have "s \<times> t \<subseteq> (\<Union>x\<in>e. a x \<times> t)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7905
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7906
    also have "\<dots> \<subseteq> (\<Union>x\<in>e. \<Union>d x)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7907
      using d \<open>e \<subseteq> s\<close> by (intro UN_mono) auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7908
    finally have "s \<times> t \<subseteq> (\<Union>x\<in>e. \<Union>d x)" .
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7909
  }
51349
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7910
  ultimately show "\<exists>C'\<subseteq>C. finite C' \<and> s \<times> t \<subseteq> \<Union>C'"
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7911
    by (intro exI[of _ "(\<Union>x\<in>e. d x)"]) (auto simp add: subset_eq)
166170c5f8a2 generalized compact_Times to topological_space
hoelzl
parents: 51348
diff changeset
  7912
qed
50884
2b21b4e2d7cb differentiate (cover) compactness and sequential compactness
hoelzl
parents: 50883
diff changeset
  7913
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7914
text\<open>Hence some useful properties follow quite easily.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7915
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7916
lemma compact_scaling:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7917
  fixes s :: "'a::real_normed_vector set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7918
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7919
  shows "compact ((\<lambda>x. c *\<^sub>R x) ` s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7920
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7921
  let ?f = "\<lambda>x. scaleR c x"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7922
  have *: "bounded_linear ?f" by (rule bounded_linear_scaleR_right)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7923
  show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7924
    using compact_continuous_image[of s ?f] continuous_at_imp_continuous_on[of s ?f]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7925
    using linear_continuous_at[OF *] assms
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7926
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7927
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7928
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7929
lemma compact_negations:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7930
  fixes s :: "'a::real_normed_vector set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7931
  assumes "compact s"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7932
  shows "compact ((\<lambda>x. - x) ` s)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7933
  using compact_scaling [OF assms, of "- 1"] by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7934
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7935
lemma compact_sums:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7936
  fixes s t :: "'a::real_normed_vector set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7937
  assumes "compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7938
    and "compact t"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7939
  shows "compact {x + y | x y. x \<in> s \<and> y \<in> t}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7940
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7941
  have *: "{x + y | x y. x \<in> s \<and> y \<in> t} = (\<lambda>z. fst z + snd z) ` (s \<times> t)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7942
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7943
    unfolding image_iff
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7944
    apply (rule_tac x="(xa, y)" in bexI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7945
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7946
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7947
  have "continuous_on (s \<times> t) (\<lambda>z. fst z + snd z)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7948
    unfolding continuous_on by (rule ballI) (intro tendsto_intros)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7949
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7950
    unfolding * using compact_continuous_image compact_Times [OF assms] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7951
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7952
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7953
lemma compact_differences:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7954
  fixes s t :: "'a::real_normed_vector set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7955
  assumes "compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7956
    and "compact t"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7957
  shows "compact {x - y | x y. x \<in> s \<and> y \<in> t}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7958
proof-
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7959
  have "{x - y | x y. x\<in>s \<and> y \<in> t} =  {x + y | x y. x \<in> s \<and> y \<in> (uminus ` t)}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7960
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7961
    apply (rule_tac x= xa in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7962
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7963
    done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7964
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7965
    using compact_sums[OF assms(1) compact_negations[OF assms(2)]] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7966
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7967
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7968
lemma compact_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7969
  fixes s :: "'a::real_normed_vector set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7970
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7971
  shows "compact ((\<lambda>x. a + x) ` s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7972
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7973
  have "{x + y |x y. x \<in> s \<and> y \<in> {a}} = (\<lambda>x. a + x) ` s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7974
    by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7975
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7976
    using compact_sums[OF assms compact_sing[of a]] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7977
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7978
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7979
lemma compact_affinity:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7980
  fixes s :: "'a::real_normed_vector set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7981
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7982
  shows "compact ((\<lambda>x. a + c *\<^sub>R x) ` s)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7983
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7984
  have "op + a ` op *\<^sub>R c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7985
    by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7986
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7987
    using compact_translation[OF compact_scaling[OF assms], of a c] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7988
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7989
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7990
text \<open>Hence we get the following.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7991
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  7992
lemma compact_sup_maxdistance:
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  7993
  fixes s :: "'a::metric_space set"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7994
  assumes "compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  7995
    and "s \<noteq> {}"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  7996
  shows "\<exists>x\<in>s. \<exists>y\<in>s. \<forall>u\<in>s. \<forall>v\<in>s. dist u v \<le> dist x y"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7997
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  7998
  have "compact (s \<times> s)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  7999
    using \<open>compact s\<close> by (intro compact_Times)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8000
  moreover have "s \<times> s \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8001
    using \<open>s \<noteq> {}\<close> by auto
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8002
  moreover have "continuous_on (s \<times> s) (\<lambda>x. dist (fst x) (snd x))"
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 51475
diff changeset
  8003
    by (intro continuous_at_imp_continuous_on ballI continuous_intros)
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8004
  ultimately show ?thesis
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8005
    using continuous_attains_sup[of "s \<times> s" "\<lambda>x. dist (fst x) (snd x)"] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8006
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8007
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8008
subsection \<open>The diameter of a set.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8009
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8010
definition diameter :: "'a::metric_space set \<Rightarrow> real" where
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8011
  "diameter S = (if S = {} then 0 else SUP (x,y):S\<times>S. dist x y)"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8012
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8013
lemma diameter_empty [simp]: "diameter{} = 0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8014
  by (auto simp: diameter_def)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8015
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8016
lemma diameter_singleton [simp]: "diameter{x} = 0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8017
  by (auto simp: diameter_def)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8018
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8019
lemma diameter_le:
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8020
  assumes "S \<noteq> {} \<or> 0 \<le> d"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8021
      and no: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> norm(x - y) \<le> d"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8022
    shows "diameter S \<le> d"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8023
using assms
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8024
  by (auto simp: dist_norm diameter_def intro: cSUP_least)
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8025
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8026
lemma diameter_bounded_bound:
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8027
  fixes s :: "'a :: metric_space set"
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8028
  assumes s: "bounded s" "x \<in> s" "y \<in> s"
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8029
  shows "dist x y \<le> diameter s"
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8030
proof -
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8031
  from s obtain z d where z: "\<And>x. x \<in> s \<Longrightarrow> dist z x \<le> d"
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8032
    unfolding bounded_def by auto
61424
c3658c18b7bc prod_case as canonical name for product type eliminator
haftmann
parents: 61306
diff changeset
  8033
  have "bdd_above (case_prod dist ` (s\<times>s))"
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8034
  proof (intro bdd_aboveI, safe)
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8035
    fix a b
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8036
    assume "a \<in> s" "b \<in> s"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8037
    with z[of a] z[of b] dist_triangle[of a b z]
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8038
    show "dist a b \<le> 2 * d"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8039
      by (simp add: dist_commute)
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8040
  qed
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8041
  moreover have "(x,y) \<in> s\<times>s" using s by auto
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8042
  ultimately have "dist x y \<le> (SUP (x,y):s\<times>s. dist x y)"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8043
    by (rule cSUP_upper2) simp
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8044
  with \<open>x \<in> s\<close> show ?thesis
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8045
    by (auto simp add: diameter_def)
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8046
qed
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8047
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8048
lemma diameter_lower_bounded:
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8049
  fixes s :: "'a :: metric_space set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8050
  assumes s: "bounded s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8051
    and d: "0 < d" "d < diameter s"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8052
  shows "\<exists>x\<in>s. \<exists>y\<in>s. d < dist x y"
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8053
proof (rule ccontr)
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8054
  assume contr: "\<not> ?thesis"
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8055
  moreover have "s \<noteq> {}"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8056
    using d by (auto simp add: diameter_def)
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8057
  ultimately have "diameter s \<le> d"
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8058
    by (auto simp: not_less diameter_def intro!: cSUP_least)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8059
  with \<open>d < diameter s\<close> show False by auto
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8060
qed
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8061
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8062
lemma diameter_bounded:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8063
  assumes "bounded s"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8064
  shows "\<forall>x\<in>s. \<forall>y\<in>s. dist x y \<le> diameter s"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8065
    and "\<forall>d>0. d < diameter s \<longrightarrow> (\<exists>x\<in>s. \<exists>y\<in>s. dist x y > d)"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8066
  using diameter_bounded_bound[of s] diameter_lower_bounded[of s] assms
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8067
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8068
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8069
lemma diameter_compact_attained:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8070
  assumes "compact s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8071
    and "s \<noteq> {}"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8072
  shows "\<exists>x\<in>s. \<exists>y\<in>s. dist x y = diameter s"
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8073
proof -
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8074
  have b: "bounded s" using assms(1)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8075
    by (rule compact_imp_bounded)
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8076
  then obtain x y where xys: "x\<in>s" "y\<in>s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8077
    and xy: "\<forall>u\<in>s. \<forall>v\<in>s. dist u v \<le> dist x y"
50973
4a2c82644889 generalized diameter from real_normed_vector to metric_space
hoelzl
parents: 50972
diff changeset
  8078
    using compact_sup_maxdistance[OF assms] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8079
  then have "diameter s \<le> dist x y"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8080
    unfolding diameter_def
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8081
    apply clarsimp
54260
6a967667fd45 use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents: 54259
diff changeset
  8082
    apply (rule cSUP_least)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8083
    apply fast+
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8084
    done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8085
  then show ?thesis
36362
06475a1547cb fix lots of looping simp calls and other warnings
huffman
parents: 36360
diff changeset
  8086
    by (metis b diameter_bounded_bound order_antisym xys)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8087
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8088
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8089
lemma diameter_ge_0:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8090
  assumes "bounded S"  shows "0 \<le> diameter S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8091
  by (metis all_not_in_conv assms diameter_bounded_bound diameter_empty dist_self order_refl)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8092
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8093
lemma diameter_subset:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8094
  assumes "S \<subseteq> T" "bounded T"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8095
  shows "diameter S \<le> diameter T"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8096
proof (cases "S = {} \<or> T = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8097
  case True
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8098
  with assms show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8099
    by (force simp: diameter_ge_0)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8100
next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8101
  case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8102
  then have "bdd_above ((\<lambda>x. case x of (x, xa) \<Rightarrow> dist x xa) ` (T \<times> T))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8103
    using \<open>bounded T\<close> diameter_bounded_bound by (force simp: bdd_above_def)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8104
  with False \<open>S \<subseteq> T\<close> show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8105
    apply (simp add: diameter_def)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8106
    apply (rule cSUP_subset_mono, auto)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8107
    done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8108
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8109
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8110
lemma diameter_closure:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8111
  assumes "bounded S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8112
  shows "diameter(closure S) = diameter S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8113
proof (rule order_antisym)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8114
  have "False" if "diameter S < diameter (closure S)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8115
  proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8116
    define d where "d = diameter(closure S) - diameter(S)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8117
    have "d > 0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8118
      using that by (simp add: d_def)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8119
    then have "diameter(closure(S)) - d / 2 < diameter(closure(S))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8120
      by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8121
    have dd: "diameter (closure S) - d / 2 = (diameter(closure(S)) + diameter(S)) / 2"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8122
      by (simp add: d_def divide_simps)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8123
     have bocl: "bounded (closure S)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8124
      using assms by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8125
    moreover have "0 \<le> diameter S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8126
      using assms diameter_ge_0 by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8127
    ultimately obtain x y where "x \<in> closure S" "y \<in> closure S" and xy: "diameter(closure(S)) - d / 2 < dist x y"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8128
      using diameter_bounded(2) [OF bocl, rule_format, of "diameter(closure(S)) - d / 2"] \<open>d > 0\<close> d_def by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8129
    then obtain x' y' where x'y': "x' \<in> S" "dist x' x < d/4" "y' \<in> S" "dist y' y < d/4"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8130
      using closure_approachable
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8131
      by (metis \<open>0 < d\<close> zero_less_divide_iff zero_less_numeral)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8132
    then have "dist x' y' \<le> diameter S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8133
      using assms diameter_bounded_bound by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8134
    with x'y' have "dist x y \<le> d / 4 + diameter S + d / 4"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8135
      by (meson add_mono_thms_linordered_semiring(1) dist_triangle dist_triangle3 less_eq_real_def order_trans)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8136
    then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8137
      using xy d_def by linarith
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8138
  qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8139
  then show "diameter (closure S) \<le> diameter S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8140
    by fastforce
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8141
  next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8142
    show "diameter S \<le> diameter (closure S)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8143
      by (simp add: assms bounded_closure closure_subset diameter_subset)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8144
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8145
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8146
lemma diameter_cball [simp]:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8147
  fixes a :: "'a::euclidean_space"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8148
  shows "diameter(cball a r) = (if r < 0 then 0 else 2*r)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8149
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8150
  have "diameter(cball a r) = 2*r" if "r \<ge> 0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8151
  proof (rule order_antisym)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8152
    show "diameter (cball a r) \<le> 2*r"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8153
    proof (rule diameter_le)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8154
      fix x y assume "x \<in> cball a r" "y \<in> cball a r"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8155
      then have "norm (x - a) \<le> r" "norm (a - y) \<le> r"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8156
        by (auto simp: dist_norm norm_minus_commute)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8157
      then have "norm (x - y) \<le> r+r"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8158
        using norm_diff_triangle_le by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8159
      then show "norm (x - y) \<le> 2*r" by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8160
    qed (simp add: that)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8161
    have "2*r = dist (a + r *\<^sub>R (SOME i. i \<in> Basis)) (a - r *\<^sub>R (SOME i. i \<in> Basis))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8162
      apply (simp add: dist_norm)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8163
      by (metis abs_of_nonneg mult.right_neutral norm_numeral norm_scaleR norm_some_Basis real_norm_def scaleR_2 that)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8164
    also have "... \<le> diameter (cball a r)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8165
      apply (rule diameter_bounded_bound)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8166
      using that by (auto simp: dist_norm)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8167
    finally show "2*r \<le> diameter (cball a r)" .
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8168
  qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8169
  then show ?thesis by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8170
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8171
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8172
lemma diameter_ball [simp]:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8173
  fixes a :: "'a::euclidean_space"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8174
  shows "diameter(ball a r) = (if r < 0 then 0 else 2*r)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8175
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8176
  have "diameter(ball a r) = 2*r" if "r > 0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8177
    by (metis bounded_ball diameter_closure closure_ball diameter_cball less_eq_real_def linorder_not_less that)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8178
  then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8179
    by (simp add: diameter_def)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8180
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8181
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8182
lemma diameter_closed_interval [simp]: "diameter {a..b} = (if b < a then 0 else b-a)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8183
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8184
  have "{a .. b} = cball ((a+b)/2) ((b-a)/2)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8185
    by (auto simp: dist_norm abs_if divide_simps split: if_split_asm)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8186
  then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8187
    by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8188
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8189
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8190
lemma diameter_open_interval [simp]: "diameter {a<..<b} = (if b < a then 0 else b-a)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8191
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8192
  have "{a <..< b} = ball ((a+b)/2) ((b-a)/2)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8193
    by (auto simp: dist_norm abs_if divide_simps split: if_split_asm)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8194
  then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8195
    by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8196
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8197
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8198
proposition Lebesgue_number_lemma:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8199
  assumes "compact S" "\<C> \<noteq> {}" "S \<subseteq> \<Union>\<C>" and ope: "\<And>B. B \<in> \<C> \<Longrightarrow> open B"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8200
  obtains \<delta> where "0 < \<delta>" "\<And>T. \<lbrakk>T \<subseteq> S; diameter T < \<delta>\<rbrakk> \<Longrightarrow> \<exists>B \<in> \<C>. T \<subseteq> B"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8201
proof (cases "S = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8202
  case True
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8203
  then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8204
    by (metis \<open>\<C> \<noteq> {}\<close> zero_less_one empty_subsetI equals0I subset_trans that)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8205
next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8206
  case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8207
  { fix x assume "x \<in> S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8208
    then obtain C where C: "x \<in> C" "C \<in> \<C>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8209
      using \<open>S \<subseteq> \<Union>\<C>\<close> by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8210
    then obtain r where r: "r>0" "ball x (2*r) \<subseteq> C"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8211
      by (metis mult.commute mult_2_right not_le ope openE real_sum_of_halves zero_le_numeral zero_less_mult_iff)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8212
    then have "\<exists>r C. r > 0 \<and> ball x (2*r) \<subseteq> C \<and> C \<in> \<C>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8213
      using C by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8214
  }
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8215
  then obtain r where r: "\<And>x. x \<in> S \<Longrightarrow> r x > 0 \<and> (\<exists>C \<in> \<C>. ball x (2*r x) \<subseteq> C)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8216
    by metis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8217
  then have "S \<subseteq> (\<Union>x \<in> S. ball x (r x))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8218
    by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8219
  then obtain \<T> where "finite \<T>" "S \<subseteq> \<Union>\<T>" and \<T>: "\<T> \<subseteq> (\<lambda>x. ball x (r x)) ` S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8220
    by (rule compactE [OF \<open>compact S\<close>]) auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8221
  then obtain S0 where "S0 \<subseteq> S" "finite S0" and S0: "\<T> = (\<lambda>x. ball x (r x)) ` S0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8222
    by (meson finite_subset_image)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8223
  then have "S0 \<noteq> {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8224
    using False \<open>S \<subseteq> \<Union>\<T>\<close> by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8225
  define \<delta> where "\<delta> = Inf (r ` S0)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8226
  have "\<delta> > 0"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8227
    using \<open>finite S0\<close> \<open>S0 \<subseteq> S\<close> \<open>S0 \<noteq> {}\<close> r by (auto simp: \<delta>_def finite_less_Inf_iff)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8228
  show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8229
  proof
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8230
    show "0 < \<delta>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8231
      by (simp add: \<open>0 < \<delta>\<close>)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8232
    show "\<exists>B \<in> \<C>. T \<subseteq> B" if "T \<subseteq> S" and dia: "diameter T < \<delta>" for T
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8233
    proof (cases "T = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8234
      case True
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8235
      then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8236
        using \<open>\<C> \<noteq> {}\<close> by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8237
    next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8238
      case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8239
      then obtain y where "y \<in> T" by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8240
      then have "y \<in> S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8241
        using \<open>T \<subseteq> S\<close> by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8242
      then obtain x where "x \<in> S0" and x: "y \<in> ball x (r x)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8243
        using \<open>S \<subseteq> \<Union>\<T>\<close> S0 that by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8244
      have "ball y \<delta> \<subseteq> ball y (r x)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8245
        by (metis \<delta>_def \<open>S0 \<noteq> {}\<close> \<open>finite S0\<close> \<open>x \<in> S0\<close> empty_is_image finite_imageI finite_less_Inf_iff imageI less_irrefl not_le subset_ball)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8246
      also have "... \<subseteq> ball x (2*r x)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8247
        by clarsimp (metis dist_commute dist_triangle_less_add mem_ball mult_2 x)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8248
      finally obtain C where "C \<in> \<C>" "ball y \<delta> \<subseteq> C"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8249
        by (meson r \<open>S0 \<subseteq> S\<close> \<open>x \<in> S0\<close> dual_order.trans subsetCE)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8250
      have "bounded T"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8251
        using \<open>compact S\<close> bounded_subset compact_imp_bounded \<open>T \<subseteq> S\<close> by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8252
      then have "T \<subseteq> ball y \<delta>"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8253
        using \<open>y \<in> T\<close> dia diameter_bounded_bound by fastforce
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8254
      then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8255
        apply (rule_tac x=C in bexI)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8256
        using \<open>ball y \<delta> \<subseteq> C\<close> \<open>C \<in> \<C>\<close> by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8257
    qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8258
  qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8259
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8260
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8261
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8262
subsection \<open>Compact sets and the closure operation.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8263
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8264
lemma closed_scaling:
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8265
  fixes S :: "'a::real_normed_vector set"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8266
  assumes "closed S"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8267
  shows "closed ((\<lambda>x. c *\<^sub>R x) ` S)"
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8268
proof (cases "c = 0")
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8269
  case True then show ?thesis
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8270
    by (auto simp add: image_constant_conv)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8271
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8272
  case False
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8273
  from assms have "closed ((\<lambda>x. inverse c *\<^sub>R x) -` S)"
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8274
    by (simp add: continuous_closed_vimage)
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8275
  also have "(\<lambda>x. inverse c *\<^sub>R x) -` S = (\<lambda>x. c *\<^sub>R x) ` S"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8276
    using \<open>c \<noteq> 0\<close> by (auto elim: image_eqI [rotated])
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8277
  finally show ?thesis .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8278
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8279
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8280
lemma closed_negations:
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8281
  fixes S :: "'a::real_normed_vector set"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8282
  assumes "closed S"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8283
  shows "closed ((\<lambda>x. -x) ` S)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8284
  using closed_scaling[OF assms, of "- 1"] by simp
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8285
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8286
lemma compact_closed_sums:
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8287
  fixes S :: "'a::real_normed_vector set"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8288
  assumes "compact S" and "closed T"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8289
  shows "closed (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8290
proof -
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8291
  let ?S = "{x + y |x y. x \<in> S \<and> y \<in> T}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8292
  {
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8293
    fix x l
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8294
    assume as: "\<forall>n. x n \<in> ?S"  "(x \<longlongrightarrow> l) sequentially"
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8295
    from as(1) obtain f where f: "\<forall>n. x n = fst (f n) + snd (f n)"  "\<forall>n. fst (f n) \<in> S"  "\<forall>n. snd (f n) \<in> T"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8296
      using choice[of "\<lambda>n y. x n = (fst y) + (snd y) \<and> fst y \<in> S \<and> snd y \<in> T"] by auto
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8297
    obtain l' r where "l'\<in>S" and r: "subseq r" and lr: "(((\<lambda>n. fst (f n)) \<circ> r) \<longlongrightarrow> l') sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8298
      using assms(1)[unfolded compact_def, THEN spec[where x="\<lambda> n. fst (f n)"]] using f(2) by auto
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8299
    have "((\<lambda>n. snd (f (r n))) \<longlongrightarrow> l - l') sequentially"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8300
      using tendsto_diff[OF LIMSEQ_subseq_LIMSEQ[OF as(2) r] lr] and f(1)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8301
      unfolding o_def
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8302
      by auto
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8303
    then have "l - l' \<in> T"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8304
      using assms(2)[unfolded closed_sequential_limits,
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8305
        THEN spec[where x="\<lambda> n. snd (f (r n))"],
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8306
        THEN spec[where x="l - l'"]]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8307
      using f(3)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8308
      by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8309
    then have "l \<in> ?S"
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8310
      using \<open>l' \<in> S\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8311
      apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8312
      apply (rule_tac x=l' in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8313
      apply (rule_tac x="l - l'" in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8314
      apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8315
      done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8316
  }
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8317
  moreover have "?S = (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8318
    by force
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8319
  ultimately show ?thesis
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8320
    unfolding closed_sequential_limits
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8321
    by (metis (no_types, lifting))
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8322
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8323
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8324
lemma closed_compact_sums:
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8325
  fixes S T :: "'a::real_normed_vector set"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8326
  assumes "closed S" "compact T"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8327
  shows "closed (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8328
proof -
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8329
  have "(\<Union>x\<in> T. \<Union>y \<in> S. {x + y}) = (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8330
    by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8331
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8332
    using compact_closed_sums[OF assms(2,1)] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8333
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8334
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8335
lemma compact_closed_differences:
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8336
  fixes S T :: "'a::real_normed_vector set"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8337
  assumes "compact S" "closed T"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8338
  shows "closed (\<Union>x\<in> S. \<Union>y \<in> T. {x - y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8339
proof -
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8340
  have "(\<Union>x\<in> S. \<Union>y \<in> uminus ` T. {x + y}) = (\<Union>x\<in> S. \<Union>y \<in> T. {x - y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8341
    by force
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8342
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8343
    using compact_closed_sums[OF assms(1) closed_negations[OF assms(2)]] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8344
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8345
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8346
lemma closed_compact_differences:
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8347
  fixes S T :: "'a::real_normed_vector set"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8348
  assumes "closed S" "compact T"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8349
  shows "closed (\<Union>x\<in> S. \<Union>y \<in> T. {x - y})"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8350
proof -
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8351
  have "(\<Union>x\<in> S. \<Union>y \<in> uminus ` T. {x + y}) = {x - y |x y. x \<in> S \<and> y \<in> T}"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8352
    by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8353
 then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8354
  using closed_compact_sums[OF assms(1) compact_negations[OF assms(2)]] by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8355
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8356
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8357
lemma closed_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8358
  fixes a :: "'a::real_normed_vector"
65038
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8359
  assumes "closed S"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8360
  shows "closed ((\<lambda>x. a + x) ` S)"
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8361
proof -
9391ea7daa17 new lemmas about segments, etc. Also recast some theorems to use Union rather than general set comprehensions
paulson <lp15@cam.ac.uk>
parents: 65037
diff changeset
  8362
  have "(\<Union>x\<in> {a}. \<Union>y \<in> S. {x + y}) = (op + a ` S)" by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8363
  then show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8364
    using compact_closed_sums[OF compact_sing[of a] assms] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8365
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8366
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  8367
lemma translation_Compl:
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  8368
  fixes a :: "'a::ab_group_add"
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  8369
  shows "(\<lambda>x. a + x) ` (- t) = - ((\<lambda>x. a + x) ` t)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8370
  apply (auto simp add: image_iff)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8371
  apply (rule_tac x="x - a" in bexI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8372
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8373
  done
34105
87cbdecaa879 replace 'UNIV - S' with '- S'
huffman
parents: 34104
diff changeset
  8374
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8375
lemma translation_UNIV:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8376
  fixes a :: "'a::ab_group_add"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8377
  shows "range (\<lambda>x. a + x) = UNIV"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8378
  apply (auto simp add: image_iff)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8379
  apply (rule_tac x="x - a" in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8380
  apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8381
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8382
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8383
lemma translation_diff:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8384
  fixes a :: "'a::ab_group_add"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8385
  shows "(\<lambda>x. a + x) ` (s - t) = ((\<lambda>x. a + x) ` s) - ((\<lambda>x. a + x) ` t)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8386
  by auto
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8387
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8388
lemma translation_Int:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8389
  fixes a :: "'a::ab_group_add"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8390
  shows "(\<lambda>x. a + x) ` (s \<inter> t) = ((\<lambda>x. a + x) ` s) \<inter> ((\<lambda>x. a + x) ` t)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8391
  by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8392
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8393
lemma closure_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8394
  fixes a :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8395
  shows "closure ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (closure s)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8396
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8397
  have *: "op + a ` (- s) = - op + a ` s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8398
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8399
    unfolding image_iff
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8400
    apply (rule_tac x="x - a" in bexI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8401
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8402
    done
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8403
  show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8404
    unfolding closure_interior translation_Compl
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8405
    using interior_translation[of a "- s"]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8406
    unfolding *
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8407
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8408
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8409
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8410
lemma frontier_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8411
  fixes a :: "'a::real_normed_vector"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8412
  shows "frontier((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (frontier s)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8413
  unfolding frontier_def translation_diff interior_translation closure_translation
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8414
  by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8415
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8416
lemma sphere_translation:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8417
  fixes a :: "'n::euclidean_space"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8418
  shows "sphere (a+c) r = op+a ` sphere c r"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8419
apply safe
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8420
apply (rule_tac x="x-a" in image_eqI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8421
apply (auto simp: dist_norm algebra_simps)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8422
done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8423
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8424
lemma cball_translation:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8425
  fixes a :: "'n::euclidean_space"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8426
  shows "cball (a+c) r = op+a ` cball c r"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8427
apply safe
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8428
apply (rule_tac x="x-a" in image_eqI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8429
apply (auto simp: dist_norm algebra_simps)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8430
done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8431
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8432
lemma ball_translation:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8433
  fixes a :: "'n::euclidean_space"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8434
  shows "ball (a+c) r = op+a ` ball c r"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8435
apply safe
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8436
apply (rule_tac x="x-a" in image_eqI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8437
apply (auto simp: dist_norm algebra_simps)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8438
done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  8439
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  8440
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8441
subsection \<open>Separation between points and sets\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8442
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8443
lemma separate_point_closed:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8444
  fixes s :: "'a::heine_borel set"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  8445
  assumes "closed s" and "a \<notin> s"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8446
  shows "\<exists>d>0. \<forall>x\<in>s. d \<le> dist a x"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8447
proof (cases "s = {}")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8448
  case True
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8449
  then show ?thesis by(auto intro!: exI[where x=1])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8450
next
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8451
  case False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8452
  from assms obtain x where "x\<in>s" "\<forall>y\<in>s. dist a x \<le> dist a y"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  8453
    using \<open>s \<noteq> {}\<close> by (blast intro: distance_attains_inf [of s a])
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8454
  with \<open>x\<in>s\<close> show ?thesis using dist_pos_lt[of a x] and\<open>a \<notin> s\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8455
    by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8456
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8457
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8458
lemma separate_compact_closed:
50949
a5689bb4ed7e generalize more topology lemmas
huffman
parents: 50948
diff changeset
  8459
  fixes s t :: "'a::heine_borel set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8460
  assumes "compact s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8461
    and t: "closed t" "s \<inter> t = {}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8462
  shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y"
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8463
proof cases
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8464
  assume "s \<noteq> {} \<and> t \<noteq> {}"
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8465
  then have "s \<noteq> {}" "t \<noteq> {}" by auto
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8466
  let ?inf = "\<lambda>x. infdist x t"
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8467
  have "continuous_on s ?inf"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  8468
    by (auto intro!: continuous_at_imp_continuous_on continuous_infdist continuous_ident)
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8469
  then obtain x where x: "x \<in> s" "\<forall>y\<in>s. ?inf x \<le> ?inf y"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8470
    using continuous_attains_inf[OF \<open>compact s\<close> \<open>s \<noteq> {}\<close>] by auto
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8471
  then have "0 < ?inf x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8472
    using t \<open>t \<noteq> {}\<close> in_closed_iff_infdist_zero by (auto simp: less_le infdist_nonneg)
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8473
  moreover have "\<forall>x'\<in>s. \<forall>y\<in>t. ?inf x \<le> dist x' y"
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8474
    using x by (auto intro: order_trans infdist_le)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8475
  ultimately show ?thesis by auto
51346
d33de22432e2 tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents: 51345
diff changeset
  8476
qed (auto intro!: exI[of _ 1])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8477
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8478
lemma separate_closed_compact:
50949
a5689bb4ed7e generalize more topology lemmas
huffman
parents: 50948
diff changeset
  8479
  fixes s t :: "'a::heine_borel set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8480
  assumes "closed s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8481
    and "compact t"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8482
    and "s \<inter> t = {}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8483
  shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8484
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8485
  have *: "t \<inter> s = {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8486
    using assms(3) by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8487
  show ?thesis
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8488
    using separate_compact_closed[OF assms(2,1) *]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8489
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8490
    apply (rule_tac x=d in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8491
    apply auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8492
    apply (erule_tac x=y in ballE)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8493
    apply (auto simp add: dist_commute)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8494
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8495
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8496
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  8497
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8498
subsection \<open>Closure of halfspaces and hyperplanes\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8499
44219
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8500
lemma isCont_open_vimage:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8501
  assumes "\<And>x. isCont f x"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8502
    and "open s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8503
  shows "open (f -` s)"
44219
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8504
proof -
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8505
  from assms(1) have "continuous_on UNIV f"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  8506
    unfolding isCont_def continuous_on_def by simp
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8507
  then have "open {x \<in> UNIV. f x \<in> s}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8508
    using open_UNIV \<open>open s\<close> by (rule continuous_open_preimage)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8509
  then show "open (f -` s)"
44219
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8510
    by (simp add: vimage_def)
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8511
qed
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8512
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8513
lemma isCont_closed_vimage:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8514
  assumes "\<And>x. isCont f x"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8515
    and "closed s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8516
  shows "closed (f -` s)"
44219
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8517
  using assms unfolding closed_def vimage_Compl [symmetric]
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8518
  by (rule isCont_open_vimage)
f738e3200e24 generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents: 44216
diff changeset
  8519
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8520
lemma continuous_on_closed_Collect_le:
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8521
  fixes f g :: "'a::t2_space \<Rightarrow> real"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8522
  assumes f: "continuous_on s f" and g: "continuous_on s g" and s: "closed s"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8523
  shows "closed {x \<in> s. f x \<le> g x}"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8524
proof -
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8525
  have "closed ((\<lambda>x. g x - f x) -` {0..} \<inter> s)"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8526
    using closed_real_atLeast continuous_on_diff [OF g f]
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8527
    by (simp add: continuous_on_closed_vimage [OF s])
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8528
  also have "((\<lambda>x. g x - f x) -` {0..} \<inter> s) = {x\<in>s. f x \<le> g x}"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8529
    by auto
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8530
  finally show ?thesis .
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8531
qed
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8532
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8533
lemma continuous_at_inner: "continuous (at x) (inner a)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8534
  unfolding continuous_at by (intro tendsto_intros)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8535
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8536
lemma closed_halfspace_le: "closed {x. inner a x \<le> b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8537
  by (simp add: closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8538
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8539
lemma closed_halfspace_ge: "closed {x. inner a x \<ge> b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8540
  by (simp add: closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8541
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8542
lemma closed_hyperplane: "closed {x. inner a x = b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8543
  by (simp add: closed_Collect_eq continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8544
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8545
lemma closed_halfspace_component_le: "closed {x::'a::euclidean_space. x\<bullet>i \<le> a}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8546
  by (simp add: closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8547
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8548
lemma closed_halfspace_component_ge: "closed {x::'a::euclidean_space. x\<bullet>i \<ge> a}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8549
  by (simp add: closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8550
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8551
lemma closed_interval_left:
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8552
  fixes b :: "'a::euclidean_space"
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8553
  shows "closed {x::'a. \<forall>i\<in>Basis. x\<bullet>i \<le> b\<bullet>i}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8554
  by (simp add: Collect_ball_eq closed_INT closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8555
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8556
lemma closed_interval_right:
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8557
  fixes a :: "'a::euclidean_space"
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8558
  shows "closed {x::'a. \<forall>i\<in>Basis. a\<bullet>i \<le> x\<bullet>i}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8559
  by (simp add: Collect_ball_eq closed_INT closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  8560
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8561
lemma continuous_le_on_closure:
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8562
  fixes a::real
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8563
  assumes f: "continuous_on (closure s) f"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8564
      and x: "x \<in> closure(s)"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8565
      and xlo: "\<And>x. x \<in> s ==> f(x) \<le> a"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8566
    shows "f(x) \<le> a"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  8567
    using image_closure_subset [OF f]
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8568
  using image_closure_subset [OF f] closed_halfspace_le [of "1::real" a] assms
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8569
  by force
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8570
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8571
lemma continuous_ge_on_closure:
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8572
  fixes a::real
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8573
  assumes f: "continuous_on (closure s) f"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8574
      and x: "x \<in> closure(s)"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8575
      and xlo: "\<And>x. x \<in> s ==> f(x) \<ge> a"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8576
    shows "f(x) \<ge> a"
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8577
  using image_closure_subset [OF f] closed_halfspace_ge [of a "1::real"] assms
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8578
  by force
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  8579
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8580
text \<open>Openness of halfspaces.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8581
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8582
lemma open_halfspace_lt: "open {x. inner a x < b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8583
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8584
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8585
lemma open_halfspace_gt: "open {x. inner a x > b}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8586
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8587
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8588
lemma open_halfspace_component_lt: "open {x::'a::euclidean_space. x\<bullet>i < a}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8589
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8590
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8591
lemma open_halfspace_component_gt: "open {x::'a::euclidean_space. x\<bullet>i > a}"
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  8592
  by (simp add: open_Collect_less continuous_on_inner continuous_on_const continuous_on_id)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8593
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8594
text \<open>This gives a simple derivation of limit component bounds.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8595
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8596
lemma Lim_component_le:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8597
  fixes f :: "'a \<Rightarrow> 'b::euclidean_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8598
  assumes "(f \<longlongrightarrow> l) net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8599
    and "\<not> (trivial_limit net)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8600
    and "eventually (\<lambda>x. f(x)\<bullet>i \<le> b) net"
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
  8601
  shows "l\<bullet>i \<le> b"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  8602
  by (rule tendsto_le[OF assms(2) tendsto_const tendsto_inner[OF assms(1) tendsto_const] assms(3)])
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  8603
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8604
lemma Lim_component_ge:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8605
  fixes f :: "'a \<Rightarrow> 'b::euclidean_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8606
  assumes "(f \<longlongrightarrow> l) net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8607
    and "\<not> (trivial_limit net)"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8608
    and "eventually (\<lambda>x. b \<le> (f x)\<bullet>i) net"
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
  8609
  shows "b \<le> l\<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
  8610
  by (rule tendsto_le[OF assms(2) tendsto_inner[OF assms(1) tendsto_const] tendsto_const assms(3)])
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  8611
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8612
lemma Lim_component_eq:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8613
  fixes f :: "'a \<Rightarrow> 'b::euclidean_space"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8614
  assumes net: "(f \<longlongrightarrow> l) net" "\<not> trivial_limit net"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8615
    and ev:"eventually (\<lambda>x. f(x)\<bullet>i = b) net"
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
  8616
  shows "l\<bullet>i = b"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  8617
  using ev[unfolded order_eq_iff eventually_conj_iff]
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8618
  using Lim_component_ge[OF net, of b i]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8619
  using Lim_component_le[OF net, of i b]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8620
  by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8621
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8622
text \<open>Limits relative to a union.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8623
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8624
lemma eventually_within_Un:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8625
  "eventually P (at x within (s \<union> t)) \<longleftrightarrow>
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8626
    eventually P (at x within s) \<and> eventually P (at x within t)"
51641
cd05e9fcc63d remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents: 51530
diff changeset
  8627
  unfolding eventually_at_filter
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8628
  by (auto elim!: eventually_rev_mp)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8629
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8630
lemma Lim_within_union:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8631
 "(f \<longlongrightarrow> l) (at x within (s \<union> t)) \<longleftrightarrow>
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8632
  (f \<longlongrightarrow> l) (at x within s) \<and> (f \<longlongrightarrow> l) (at x within t)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8633
  unfolding tendsto_def
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8634
  by (auto simp add: eventually_within_Un)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8635
36442
b96d9dc6acca generalize more continuity lemmas
huffman
parents: 36441
diff changeset
  8636
lemma Lim_topological:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  8637
  "(f \<longlongrightarrow> l) net \<longleftrightarrow>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8638
    trivial_limit net \<or> (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net)"
36442
b96d9dc6acca generalize more continuity lemmas
huffman
parents: 36441
diff changeset
  8639
  unfolding tendsto_def trivial_limit_eq by auto
b96d9dc6acca generalize more continuity lemmas
huffman
parents: 36441
diff changeset
  8640
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8641
text \<open>Continuity relative to a union.\<close>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8642
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  8643
lemma continuous_on_Un_local:
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8644
    "\<lbrakk>closedin (subtopology euclidean (s \<union> t)) s; closedin (subtopology euclidean (s \<union> t)) t;
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8645
      continuous_on s f; continuous_on t f\<rbrakk>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8646
     \<Longrightarrow> continuous_on (s \<union> t) f"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  8647
  unfolding continuous_on closedin_limpt
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8648
  by (metis Lim_trivial_limit Lim_within_union Un_iff trivial_limit_within)
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8649
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8650
lemma continuous_on_cases_local:
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8651
     "\<lbrakk>closedin (subtopology euclidean (s \<union> t)) s; closedin (subtopology euclidean (s \<union> t)) t;
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8652
       continuous_on s f; continuous_on t g;
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8653
       \<And>x. \<lbrakk>x \<in> s \<and> ~P x \<or> x \<in> t \<and> P x\<rbrakk> \<Longrightarrow> f x = g x\<rbrakk>
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8654
      \<Longrightarrow> continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  8655
  by (rule continuous_on_Un_local) (auto intro: continuous_on_eq)
61306
9dd394c866fc New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents: 61284
diff changeset
  8656
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8657
lemma continuous_on_cases_le:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8658
  fixes h :: "'a :: topological_space \<Rightarrow> real"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8659
  assumes "continuous_on {t \<in> s. h t \<le> a} f"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8660
      and "continuous_on {t \<in> s. a \<le> h t} g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8661
      and h: "continuous_on s h"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8662
      and "\<And>t. \<lbrakk>t \<in> s; h t = a\<rbrakk> \<Longrightarrow> f t = g t"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8663
    shows "continuous_on s (\<lambda>t. if h t \<le> a then f(t) else g(t))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8664
proof -
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8665
  have s: "s = {t \<in> s. h t \<in> atMost a} \<union> {t \<in> s. h t \<in> atLeast a}"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8666
    by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8667
  have 1: "closedin (subtopology euclidean s) {t \<in> s. h t \<in> atMost a}"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8668
    by (rule continuous_closedin_preimage [OF h closed_atMost])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8669
  have 2: "closedin (subtopology euclidean s) {t \<in> s. h t \<in> atLeast a}"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8670
    by (rule continuous_closedin_preimage [OF h closed_atLeast])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8671
  show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8672
    apply (rule continuous_on_subset [of s, OF _ order_refl])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8673
    apply (subst s)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8674
    apply (rule continuous_on_cases_local)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8675
    using 1 2 s assms apply auto
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8676
    done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8677
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8678
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8679
lemma continuous_on_cases_1:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8680
  fixes s :: "real set"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8681
  assumes "continuous_on {t \<in> s. t \<le> a} f"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8682
      and "continuous_on {t \<in> s. a \<le> t} g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8683
      and "a \<in> s \<Longrightarrow> f a = g a"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8684
    shows "continuous_on s (\<lambda>t. if t \<le> a then f(t) else g(t))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8685
using assms
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8686
by (auto simp: continuous_on_id intro: continuous_on_cases_le [where h = id, simplified])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
  8687
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8688
text\<open>Some more convenient intermediate-value theorem formulations.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8689
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8690
lemma connected_ivt_hyperplane:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8691
  assumes "connected s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8692
    and "x \<in> s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8693
    and "y \<in> s"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8694
    and "inner a x \<le> b"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8695
    and "b \<le> inner a y"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8696
  shows "\<exists>z \<in> s. inner a z = b"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8697
proof (rule ccontr)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8698
  assume as:"\<not> (\<exists>z\<in>s. inner a z = b)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8699
  let ?A = "{x. inner a x < b}"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8700
  let ?B = "{x. inner a x > b}"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8701
  have "open ?A" "open ?B"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8702
    using open_halfspace_lt and open_halfspace_gt by auto
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8703
  moreover
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8704
  have "?A \<inter> ?B = {}" by auto
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8705
  moreover
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8706
  have "s \<subseteq> ?A \<union> ?B" using as by auto
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8707
  ultimately
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  8708
  show False
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8709
    using assms(1)[unfolded connected_def not_ex,
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8710
      THEN spec[where x="?A"], THEN spec[where x="?B"]]
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  8711
    using assms(2-5)
52625
wenzelm
parents: 52624
diff changeset
  8712
    by auto
wenzelm
parents: 52624
diff changeset
  8713
qed
wenzelm
parents: 52624
diff changeset
  8714
wenzelm
parents: 52624
diff changeset
  8715
lemma connected_ivt_component:
wenzelm
parents: 52624
diff changeset
  8716
  fixes x::"'a::euclidean_space"
wenzelm
parents: 52624
diff changeset
  8717
  shows "connected s \<Longrightarrow>
wenzelm
parents: 52624
diff changeset
  8718
    x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow>
wenzelm
parents: 52624
diff changeset
  8719
    x\<bullet>k \<le> a \<Longrightarrow> a \<le> y\<bullet>k \<Longrightarrow> (\<exists>z\<in>s.  z\<bullet>k = a)"
wenzelm
parents: 52624
diff changeset
  8720
  using connected_ivt_hyperplane[of s x y "k::'a" a]
wenzelm
parents: 52624
diff changeset
  8721
  by (auto simp: inner_commute)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  8722
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  8723
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8724
subsection \<open>Intervals\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8725
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8726
lemma open_box[intro]: "open (box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8727
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8728
  have "open (\<Inter>i\<in>Basis. (op \<bullet> i) -` {a \<bullet> i <..< b \<bullet> i})"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
  8729
    by (auto intro!: continuous_open_vimage continuous_inner continuous_ident continuous_const)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8730
  also have "(\<Inter>i\<in>Basis. (op \<bullet> i) -` {a \<bullet> i <..< b \<bullet> i}) = box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8731
    by (auto simp add: box_def inner_commute)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8732
  finally show ?thesis .
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8733
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8734
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8735
instance euclidean_space \<subseteq> second_countable_topology
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8736
proof
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  8737
  define a where "a f = (\<Sum>i\<in>Basis. fst (f i) *\<^sub>R i)" for f :: "'a \<Rightarrow> real \<times> real"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8738
  then have a: "\<And>f. (\<Sum>i\<in>Basis. fst (f i) *\<^sub>R i) = a f"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8739
    by simp
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  8740
  define b where "b f = (\<Sum>i\<in>Basis. snd (f i) *\<^sub>R i)" for f :: "'a \<Rightarrow> real \<times> real"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8741
  then have b: "\<And>f. (\<Sum>i\<in>Basis. snd (f i) *\<^sub>R i) = b f"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8742
    by simp
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  8743
  define B where "B = (\<lambda>f. box (a f) (b f)) ` (Basis \<rightarrow>\<^sub>E (\<rat> \<times> \<rat>))"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8744
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8745
  have "Ball B open" by (simp add: B_def open_box)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8746
  moreover have "(\<forall>A. open A \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union>B' = A))"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8747
  proof safe
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8748
    fix A::"'a set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8749
    assume "open A"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8750
    show "\<exists>B'\<subseteq>B. \<Union>B' = A"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8751
      apply (rule exI[of _ "{b\<in>B. b \<subseteq> A}"])
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8752
      apply (subst (3) open_UNION_box[OF \<open>open A\<close>])
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8753
      apply (auto simp add: a b B_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8754
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8755
  qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8756
  ultimately
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8757
  have "topological_basis B"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8758
    unfolding topological_basis_def by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8759
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8760
  have "countable B"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8761
    unfolding B_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8762
    by (intro countable_image countable_PiE finite_Basis countable_SIGMA countable_rat)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8763
  ultimately show "\<exists>B::'a set set. countable B \<and> open = generate_topology B"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8764
    by (blast intro: topological_basis_imp_subbasis)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8765
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8766
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8767
instance euclidean_space \<subseteq> polish_space ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8768
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8769
lemma closed_cbox[intro]:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8770
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8771
  shows "closed (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8772
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8773
  have "closed (\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8774
    by (intro closed_INT ballI continuous_closed_vimage allI
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8775
      linear_continuous_at closed_real_atLeastAtMost finite_Basis bounded_linear_inner_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8776
  also have "(\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i}) = cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8777
    by (auto simp add: cbox_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8778
  finally show "closed (cbox a b)" .
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8779
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8780
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  8781
lemma interior_cbox [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8782
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8783
  shows "interior (cbox a b) = box a b" (is "?L = ?R")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8784
proof(rule subset_antisym)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8785
  show "?R \<subseteq> ?L"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8786
    using box_subset_cbox open_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8787
    by (rule interior_maximal)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8788
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8789
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8790
    assume "x \<in> interior (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8791
    then obtain s where s: "open s" "x \<in> s" "s \<subseteq> cbox a b" ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8792
    then obtain e where "e>0" and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8793
      unfolding open_dist and subset_eq by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8794
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8795
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8796
      assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8797
      have "dist (x - (e / 2) *\<^sub>R i) x < e"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8798
        and "dist (x + (e / 2) *\<^sub>R i) x < e"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8799
        unfolding dist_norm
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8800
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8801
        unfolding norm_minus_cancel
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8802
        using norm_Basis[OF i] \<open>e>0\<close>
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8803
        apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8804
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8805
      then have "a \<bullet> i \<le> (x - (e / 2) *\<^sub>R i) \<bullet> i" and "(x + (e / 2) *\<^sub>R i) \<bullet> i \<le> b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8806
        using e[THEN spec[where x="x - (e/2) *\<^sub>R i"]]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8807
          and e[THEN spec[where x="x + (e/2) *\<^sub>R i"]]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8808
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8809
        using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8810
        by blast+
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8811
      then have "a \<bullet> i < x \<bullet> i" and "x \<bullet> i < b \<bullet> i"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  8812
        using \<open>e>0\<close> i
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8813
        by (auto simp: inner_diff_left inner_Basis inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8814
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8815
    then have "x \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8816
      unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8817
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8818
  then show "?L \<subseteq> ?R" ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8819
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8820
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  8821
lemma bounded_cbox [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8822
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8823
  shows "bounded (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8824
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8825
  let ?b = "\<Sum>i\<in>Basis. \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8826
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8827
    fix x :: "'a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8828
    assume x: "\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8829
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8830
      fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8831
      assume "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8832
      then have "\<bar>x\<bullet>i\<bar> \<le> \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8833
        using x[THEN bspec[where x=i]] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8834
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8835
    then have "(\<Sum>i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<le> ?b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8836
      apply -
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  8837
      apply (rule sum_mono)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8838
      apply auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8839
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8840
    then have "norm x \<le> ?b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8841
      using norm_le_l1[of x] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8842
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8843
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8844
    unfolding cbox_def bounded_iff by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8845
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8846
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  8847
lemma bounded_box [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8848
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8849
  shows "bounded (box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8850
  using bounded_cbox[of a b]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8851
  using box_subset_cbox[of a b]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8852
  using bounded_subset[of "cbox a b" "box a b"]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8853
  by simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8854
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  8855
lemma not_interval_UNIV [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8856
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8857
  shows "cbox a b \<noteq> UNIV" "box a b \<noteq> UNIV"
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  8858
  using bounded_box[of a b] bounded_cbox[of a b] by force+
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  8859
63945
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  8860
lemma not_interval_UNIV2 [simp]:
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  8861
  fixes a :: "'a::euclidean_space"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  8862
  shows "UNIV \<noteq> cbox a b" "UNIV \<noteq> box a b"
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  8863
  using bounded_box[of a b] bounded_cbox[of a b] by force+
444eafb6e864 a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents: 63938
diff changeset
  8864
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  8865
lemma compact_cbox [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8866
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8867
  shows "compact (cbox a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8868
  using bounded_closed_imp_seq_compact[of "cbox a b"] using bounded_cbox[of a b]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8869
  by (auto simp: compact_eq_seq_compact_metric)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8870
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8871
proposition is_interval_compact:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8872
   "is_interval S \<and> compact S \<longleftrightarrow> (\<exists>a b. S = cbox a b)"   (is "?lhs = ?rhs")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8873
proof (cases "S = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8874
  case True
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8875
  with empty_as_interval show ?thesis by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8876
next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8877
  case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8878
  show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8879
  proof
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8880
    assume L: ?lhs
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8881
    then have "is_interval S" "compact S" by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8882
    define a where "a \<equiv> \<Sum>i\<in>Basis. (INF x:S. x \<bullet> i) *\<^sub>R i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8883
    define b where "b \<equiv> \<Sum>i\<in>Basis. (SUP x:S. x \<bullet> i) *\<^sub>R i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8884
    have 1: "\<And>x i. \<lbrakk>x \<in> S; i \<in> Basis\<rbrakk> \<Longrightarrow> (INF x:S. x \<bullet> i) \<le> x \<bullet> i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8885
      by (simp add: cInf_lower bounded_inner_imp_bdd_below compact_imp_bounded L)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8886
    have 2: "\<And>x i. \<lbrakk>x \<in> S; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> (SUP x:S. x \<bullet> i)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8887
      by (simp add: cSup_upper bounded_inner_imp_bdd_above compact_imp_bounded L)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8888
    have 3: "x \<in> S" if inf: "\<And>i. i \<in> Basis \<Longrightarrow> (INF x:S. x \<bullet> i) \<le> x \<bullet> i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8889
                   and sup: "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i \<le> (SUP x:S. x \<bullet> i)" for x
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8890
    proof (rule mem_box_componentwiseI [OF \<open>is_interval S\<close>])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8891
      fix i::'a
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8892
      assume i: "i \<in> Basis"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8893
      have cont: "continuous_on S (\<lambda>x. x \<bullet> i)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8894
        by (intro continuous_intros)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8895
      obtain a where "a \<in> S" and a: "\<And>y. y\<in>S \<Longrightarrow> a \<bullet> i \<le> y \<bullet> i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8896
        using continuous_attains_inf [OF \<open>compact S\<close> False cont] by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8897
      obtain b where "b \<in> S" and b: "\<And>y. y\<in>S \<Longrightarrow> y \<bullet> i \<le> b \<bullet> i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8898
        using continuous_attains_sup [OF \<open>compact S\<close> False cont] by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8899
      have "a \<bullet> i \<le> (INF x:S. x \<bullet> i)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8900
        by (simp add: False a cINF_greatest)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8901
      also have "\<dots> \<le> x \<bullet> i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8902
        by (simp add: i inf)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8903
      finally have ai: "a \<bullet> i \<le> x \<bullet> i" .
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8904
      have "x \<bullet> i \<le> (SUP x:S. x \<bullet> i)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8905
        by (simp add: i sup)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8906
      also have "(SUP x:S. x \<bullet> i) \<le> b \<bullet> i"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8907
        by (simp add: False b cSUP_least)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8908
      finally have bi: "x \<bullet> i \<le> b \<bullet> i" .
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8909
      show "x \<bullet> i \<in> (\<lambda>x. x \<bullet> i) ` S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8910
        apply (rule_tac x="\<Sum>j\<in>Basis. (if j = i then x \<bullet> i else a \<bullet> j) *\<^sub>R j" in image_eqI)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8911
        apply (simp add: i)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8912
        apply (rule mem_is_intervalI [OF \<open>is_interval S\<close> \<open>a \<in> S\<close> \<open>b \<in> S\<close>])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8913
        using i ai bi apply force
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8914
        done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8915
    qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8916
    have "S = cbox a b"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8917
      by (auto simp: a_def b_def mem_box intro: 1 2 3)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8918
    then show ?rhs
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8919
      by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8920
  next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8921
    assume R: ?rhs
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8922
    then show ?lhs
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8923
      using compact_cbox is_interval_cbox by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8924
  qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8925
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8926
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
  8927
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8928
lemma box_midpoint:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8929
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8930
  assumes "box a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8931
  shows "((1/2) *\<^sub>R (a + b)) \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8932
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8933
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8934
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8935
    assume "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8936
    then have "a \<bullet> i < ((1 / 2) *\<^sub>R (a + b)) \<bullet> i \<and> ((1 / 2) *\<^sub>R (a + b)) \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8937
      using assms[unfolded box_ne_empty, THEN bspec[where x=i]] by (auto simp: inner_add_left)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8938
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8939
  then show ?thesis unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8940
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8941
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8942
lemma open_cbox_convex:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8943
  fixes x :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8944
  assumes x: "x \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8945
    and y: "y \<in> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8946
    and e: "0 < e" "e \<le> 1"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8947
  shows "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<in> box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8948
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8949
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8950
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8951
    assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8952
    have "a \<bullet> i = e * (a \<bullet> i) + (1 - e) * (a \<bullet> i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8953
      unfolding left_diff_distrib by simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8954
    also have "\<dots> < e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8955
      apply (rule add_less_le_mono)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8956
      using e unfolding mult_less_cancel_left and mult_le_cancel_left
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8957
      apply simp_all
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8958
      using x unfolding mem_box using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8959
      apply simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8960
      using y unfolding mem_box using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8961
      apply simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8962
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8963
    finally have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8964
      unfolding inner_simps by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8965
    moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8966
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8967
      have "b \<bullet> i = e * (b\<bullet>i) + (1 - e) * (b\<bullet>i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8968
        unfolding left_diff_distrib by simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8969
      also have "\<dots> > e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8970
        apply (rule add_less_le_mono)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8971
        using e unfolding mult_less_cancel_left and mult_le_cancel_left
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8972
        apply simp_all
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8973
        using x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8974
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8975
        using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8976
        apply simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8977
        using y
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8978
        unfolding mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8979
        using i
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8980
        apply simp
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8981
        done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8982
      finally have "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8983
        unfolding inner_simps by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8984
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8985
    ultimately have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i \<and> (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8986
      by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8987
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8988
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8989
    unfolding mem_box by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8990
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8991
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8992
lemma closure_cbox [simp]: "closure (cbox a b) = cbox a b"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8993
  by (simp add: closed_cbox)
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8994
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  8995
lemma closure_box [simp]:
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8996
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8997
   assumes "box a b \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8998
  shows "closure (box a b) = cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  8999
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9000
  have ab: "a <e b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9001
    using assms by (simp add: eucl_less_def box_ne_empty)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9002
  let ?c = "(1 / 2) *\<^sub>R (a + b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9003
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9004
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9005
    assume as:"x \<in> cbox a b"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  9006
    define f where [abs_def]: "f n = x + (inverse (real n + 1)) *\<^sub>R (?c - x)" for n
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9007
    {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9008
      fix n
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9009
      assume fn: "f n <e b \<longrightarrow> a <e f n \<longrightarrow> f n = x" and xc: "x \<noteq> ?c"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9010
      have *: "0 < inverse (real n + 1)" "inverse (real n + 1) \<le> 1"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9011
        unfolding inverse_le_1_iff by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9012
      have "(inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b)) + (1 - inverse (real n + 1)) *\<^sub>R x =
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9013
        x + (inverse (real n + 1)) *\<^sub>R (((1 / 2) *\<^sub>R (a + b)) - x)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9014
        by (auto simp add: algebra_simps)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9015
      then have "f n <e b" and "a <e f n"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9016
        using open_cbox_convex[OF box_midpoint[OF assms] as *]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9017
        unfolding f_def by (auto simp: box_def eucl_less_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9018
      then have False
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9019
        using fn unfolding f_def using xc by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9020
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9021
    moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9022
    {
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  9023
      assume "\<not> (f \<longlongrightarrow> x) sequentially"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9024
      {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9025
        fix e :: real
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9026
        assume "e > 0"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9027
        then have "\<exists>N::nat. inverse (real (N + 1)) < e"
62623
dbc62f86a1a9 rationalisation of theorem names esp about "real Archimedian" etc.
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  9028
          using real_arch_inverse[of e]
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9029
          apply (auto simp add: Suc_pred')
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  9030
          apply (metis Suc_pred' of_nat_Suc)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9031
          done
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  9032
        then obtain N :: nat where N: "inverse (real (N + 1)) < e"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9033
          by auto
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  9034
        have "inverse (real n + 1) < e" if "N \<le> n" for n
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 61552
diff changeset
  9035
          by (auto intro!: that le_less_trans [OF _ N])
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9036
        then have "\<exists>N::nat. \<forall>n\<ge>N. inverse (real n + 1) < e" by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9037
      }
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  9038
      then have "((\<lambda>n. inverse (real n + 1)) \<longlongrightarrow> 0) sequentially"
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
  9039
        unfolding lim_sequentially by(auto simp add: dist_norm)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  9040
      then have "(f \<longlongrightarrow> x) sequentially"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9041
        unfolding f_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9042
        using tendsto_add[OF tendsto_const, of "\<lambda>n::nat. (inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b) - x)" 0 sequentially x]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9043
        using tendsto_scaleR [OF _ tendsto_const, of "\<lambda>n::nat. inverse (real n + 1)" 0 sequentially "((1 / 2) *\<^sub>R (a + b) - x)"]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9044
        by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9045
    }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9046
    ultimately have "x \<in> closure (box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9047
      using as and box_midpoint[OF assms]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9048
      unfolding closure_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9049
      unfolding islimpt_sequential
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9050
      by (cases "x=?c") (auto simp: in_box_eucl_less)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9051
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9052
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9053
    using closure_minimal[OF box_subset_cbox, of a b] by blast
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9054
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9055
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9056
lemma bounded_subset_box_symmetric:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9057
  fixes s::"('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9058
  assumes "bounded s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9059
  shows "\<exists>a. s \<subseteq> box (-a) a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9060
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9061
  obtain b where "b>0" and b: "\<forall>x\<in>s. norm x \<le> b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9062
    using assms[unfolded bounded_pos] by auto
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  9063
  define a :: 'a where "a = (\<Sum>i\<in>Basis. (b + 1) *\<^sub>R i)"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9064
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9065
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9066
    assume "x \<in> s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9067
    fix i :: 'a
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9068
    assume i: "i \<in> Basis"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9069
    then have "(-a)\<bullet>i < x\<bullet>i" and "x\<bullet>i < a\<bullet>i"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9070
      using b[THEN bspec[where x=x], OF \<open>x\<in>s\<close>]
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9071
      using Basis_le_norm[OF i, of x]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9072
      unfolding inner_simps and a_def
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9073
      by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9074
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9075
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9076
    by (auto intro: exI[where x=a] simp add: box_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9077
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9078
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9079
lemma bounded_subset_open_interval:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9080
  fixes s :: "('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9081
  shows "bounded s \<Longrightarrow> (\<exists>a b. s \<subseteq> box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9082
  by (auto dest!: bounded_subset_box_symmetric)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9083
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9084
lemma bounded_subset_cbox_symmetric:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9085
  fixes s :: "('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9086
   assumes "bounded s"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9087
  shows "\<exists>a. s \<subseteq> cbox (-a) a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9088
proof -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9089
  obtain a where "s \<subseteq> box (-a) a"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9090
    using bounded_subset_box_symmetric[OF assms] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9091
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9092
    using box_subset_cbox[of "-a" a] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9093
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9094
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9095
lemma bounded_subset_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9096
  fixes s :: "('a::euclidean_space) set"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9097
  shows "bounded s \<Longrightarrow> \<exists>a b. s \<subseteq> cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9098
  using bounded_subset_cbox_symmetric[of s] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9099
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9100
lemma frontier_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9101
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9102
  shows "frontier (cbox a b) = cbox a b - box a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9103
  unfolding frontier_def unfolding interior_cbox and closure_closed[OF closed_cbox] ..
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9104
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9105
lemma frontier_box:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9106
  fixes a b :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9107
  shows "frontier (box a b) = (if box a b = {} then {} else cbox a b - box a b)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9108
proof (cases "box a b = {}")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9109
  case True
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9110
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9111
    using frontier_empty by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9112
next
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9113
  case False
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9114
  then show ?thesis
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9115
    unfolding frontier_def and closure_box[OF False] and interior_open[OF open_box]
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9116
    by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9117
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9118
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9119
lemma inter_interval_mixed_eq_empty:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9120
  fixes a :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9121
   assumes "box c d \<noteq> {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9122
  shows "box a b \<inter> cbox c d = {} \<longleftrightarrow> box a b \<inter> box c d = {}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9123
  unfolding closure_box[OF assms, symmetric]
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  9124
  unfolding open_Int_closure_eq_empty[OF open_box] ..
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9125
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9126
lemma diameter_cbox:
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9127
  fixes a b::"'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9128
  shows "(\<forall>i \<in> Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> diameter (cbox a b) = dist a b"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62131
diff changeset
  9129
  by (force simp add: diameter_def intro!: cSup_eq_maximum setL2_mono
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9130
     simp: euclidean_dist_l2[where 'a='a] cbox_def dist_norm)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9131
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9132
lemma eucl_less_eq_halfspaces:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  9133
  fixes a :: "'a::euclidean_space"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9134
  shows "{x. x <e a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i < a \<bullet> i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9135
    "{x. a <e x} = (\<Inter>i\<in>Basis. {x. a \<bullet> i < x \<bullet> i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9136
  by (auto simp: eucl_less_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9137
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9138
lemma eucl_le_eq_halfspaces:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  9139
  fixes a :: "'a::euclidean_space"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9140
  shows "{x. \<forall>i\<in>Basis. x \<bullet> i \<le> a \<bullet> i} = (\<Inter>i\<in>Basis. {x. x \<bullet> i \<le> a \<bullet> i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9141
    "{x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i} = (\<Inter>i\<in>Basis. {x. a \<bullet> i \<le> x \<bullet> i})"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9142
  by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9143
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9144
lemma open_Collect_eucl_less[simp, intro]:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  9145
  fixes a :: "'a::euclidean_space"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9146
  shows "open {x. x <e a}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9147
    "open {x. a <e x}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9148
  by (auto simp: eucl_less_eq_halfspaces open_halfspace_component_lt open_halfspace_component_gt)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9149
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9150
lemma closed_Collect_eucl_le[simp, intro]:
61076
bdc1e2f0a86a eliminated \<Colon>;
wenzelm
parents: 60974
diff changeset
  9151
  fixes a :: "'a::euclidean_space"
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9152
  shows "closed {x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9153
    "closed {x. \<forall>i\<in>Basis. x \<bullet> i \<le> a \<bullet> i}"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9154
  unfolding eucl_le_eq_halfspaces
63332
f164526d8727 move open_Collect_eq/less to HOL
hoelzl
parents: 63305
diff changeset
  9155
  by (simp_all add: closed_INT closed_Collect_le  continuous_on_inner continuous_on_const continuous_on_id)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9156
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9157
lemma image_affinity_cbox: fixes m::real
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9158
  fixes a b c :: "'a::euclidean_space"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9159
  shows "(\<lambda>x. m *\<^sub>R x + c) ` cbox a b =
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9160
    (if cbox a b = {} then {}
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9161
     else (if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9162
     else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c)))"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9163
proof (cases "m = 0")
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9164
  case True
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9165
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9166
    fix x
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9167
    assume "\<forall>i\<in>Basis. x \<bullet> i \<le> c \<bullet> i" "\<forall>i\<in>Basis. c \<bullet> i \<le> x \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9168
    then have "x = c"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9169
      apply -
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9170
      apply (subst euclidean_eq_iff)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9171
      apply (auto intro: order_antisym)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9172
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9173
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9174
  moreover have "c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9175
    unfolding True by (auto simp add: cbox_sing)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9176
  ultimately show ?thesis using True by (auto simp: cbox_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9177
next
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9178
  case False
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9179
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9180
    fix y
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9181
    assume "\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i" "m > 0"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9182
    then have "\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i" and "\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9183
      by (auto simp: inner_distrib)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9184
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9185
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9186
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9187
    fix y
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9188
    assume "\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i" "m < 0"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9189
    then have "\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i" and "\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9190
      by (auto simp add: mult_left_mono_neg inner_distrib)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9191
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9192
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9193
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9194
    fix y
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9195
    assume "m > 0" and "\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i" and "\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9196
    then have "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9197
      unfolding image_iff Bex_def mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9198
      apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"])
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  9199
      apply (auto simp add: pos_le_divide_eq pos_divide_le_eq mult.commute inner_distrib inner_diff_left)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9200
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9201
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9202
  moreover
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9203
  {
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9204
    fix y
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9205
    assume "\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i" "m < 0"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9206
    then have "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9207
      unfolding image_iff Bex_def mem_box
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9208
      apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"])
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  9209
      apply (auto simp add: neg_le_divide_eq neg_divide_le_eq mult.commute inner_distrib inner_diff_left)
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9210
      done
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9211
  }
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9212
  ultimately show ?thesis using False by (auto simp: cbox_def)
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9213
qed
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9214
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9215
lemma image_smult_cbox:"(\<lambda>x. m *\<^sub>R (x::_::euclidean_space)) ` cbox a b =
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9216
  (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a) (m *\<^sub>R b) else cbox (m *\<^sub>R b) (m *\<^sub>R a))"
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9217
  using image_affinity_cbox[of m 0 a b] by auto
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9218
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9219
lemma islimpt_greaterThanLessThan1:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9220
  fixes a b::"'a::{linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9221
  assumes "a < b"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9222
  shows  "a islimpt {a<..<b}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9223
proof (rule islimptI)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9224
  fix T
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9225
  assume "open T" "a \<in> T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9226
  from open_right[OF this \<open>a < b\<close>]
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9227
  obtain c where c: "a < c" "{a..<c} \<subseteq> T" by auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9228
  with assms dense[of a "min c b"]
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9229
  show "\<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> a"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9230
    by (metis atLeastLessThan_iff greaterThanLessThan_iff min_less_iff_conj
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9231
      not_le order.strict_implies_order subset_eq)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9232
qed
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9233
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9234
lemma islimpt_greaterThanLessThan2:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9235
  fixes a b::"'a::{linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9236
  assumes "a < b"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9237
  shows  "b islimpt {a<..<b}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9238
proof (rule islimptI)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9239
  fix T
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9240
  assume "open T" "b \<in> T"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9241
  from open_left[OF this \<open>a < b\<close>]
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9242
  obtain c where c: "c < b" "{c<..b} \<subseteq> T" by auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9243
  with assms dense[of "max a c" b]
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9244
  show "\<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9245
    by (metis greaterThanAtMost_iff greaterThanLessThan_iff max_less_iff_conj
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9246
      not_le order.strict_implies_order subset_eq)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9247
qed
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9248
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9249
lemma closure_greaterThanLessThan[simp]:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9250
  fixes a b::"'a::{linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9251
  shows "a < b \<Longrightarrow> closure {a <..< b} = {a .. b}" (is "_ \<Longrightarrow> ?l = ?r")
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9252
proof
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9253
  have "?l \<subseteq> closure ?r"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9254
    by (rule closure_mono) auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9255
  thus "closure {a<..<b} \<subseteq> {a..b}" by simp
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9256
qed (auto simp: closure_def order.order_iff_strict islimpt_greaterThanLessThan1
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9257
  islimpt_greaterThanLessThan2)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9258
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9259
lemma closure_greaterThan[simp]:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9260
  fixes a b::"'a::{no_top, linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9261
  shows "closure {a<..} = {a..}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9262
proof -
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9263
  from gt_ex obtain b where "a < b" by auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9264
  hence "{a<..} = {a<..<b} \<union> {b..}" by auto
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  9265
  also have "closure \<dots> = {a..}" using \<open>a < b\<close> unfolding closure_Un
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9266
    by auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9267
  finally show ?thesis .
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9268
qed
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9269
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9270
lemma closure_lessThan[simp]:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9271
  fixes b::"'a::{no_bot, linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9272
  shows "closure {..<b} = {..b}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9273
proof -
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9274
  from lt_ex obtain a where "a < b" by auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9275
  hence "{..<b} = {a<..<b} \<union> {..a}" by auto
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  9276
  also have "closure \<dots> = {..b}" using \<open>a < b\<close> unfolding closure_Un
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9277
    by auto
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9278
  finally show ?thesis .
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9279
qed
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9280
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9281
lemma closure_atLeastLessThan[simp]:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9282
  fixes a b::"'a::{linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9283
  assumes "a < b"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9284
  shows "closure {a ..< b} = {a .. b}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9285
proof -
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9286
  from assms have "{a ..< b} = {a} \<union> {a <..< b}" by auto
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  9287
  also have "closure \<dots> = {a .. b}" unfolding closure_Un
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9288
    by (auto simp add: assms less_imp_le)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9289
  finally show ?thesis .
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9290
qed
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9291
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9292
lemma closure_greaterThanAtMost[simp]:
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9293
  fixes a b::"'a::{linorder_topology, dense_order}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9294
  assumes "a < b"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9295
  shows "closure {a <.. b} = {a .. b}"
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9296
proof -
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9297
  from assms have "{a <.. b} = {b} \<union> {a <..< b}" by auto
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 63988
diff changeset
  9298
  also have "closure \<dots> = {a .. b}" unfolding closure_Un
60176
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9299
    by (auto simp add: assms less_imp_le)
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9300
  finally show ?thesis .
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9301
qed
38b630409aa2 closures of intervals
immler
parents: 60150
diff changeset
  9302
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
  9303
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9304
subsection \<open>Homeomorphisms\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9305
52625
wenzelm
parents: 52624
diff changeset
  9306
definition "homeomorphism s t f g \<longleftrightarrow>
wenzelm
parents: 52624
diff changeset
  9307
  (\<forall>x\<in>s. (g(f x) = x)) \<and> (f ` s = t) \<and> continuous_on s f \<and>
wenzelm
parents: 52624
diff changeset
  9308
  (\<forall>y\<in>t. (f(g y) = y)) \<and> (g ` t = s) \<and> continuous_on t g"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9309
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9310
lemma homeomorphismI [intro?]:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9311
  assumes "continuous_on S f" "continuous_on T g"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9312
          "f ` S \<subseteq> T" "g ` T \<subseteq> S" "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "\<And>y. y \<in> T \<Longrightarrow> f(g y) = y"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9313
    shows "homeomorphism S T f g"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9314
  using assms by (force simp: homeomorphism_def)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9315
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9316
lemma homeomorphism_translation:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9317
  fixes a :: "'a :: real_normed_vector"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9318
  shows "homeomorphism (op + a ` S) S (op + (- a)) (op + a)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9319
unfolding homeomorphism_def by (auto simp: algebra_simps continuous_intros)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9320
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9321
lemma homeomorphism_ident: "homeomorphism T T (\<lambda>a. a) (\<lambda>a. a)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9322
  by (rule homeomorphismI) (auto simp: continuous_on_id)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9323
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9324
lemma homeomorphism_compose:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9325
  assumes "homeomorphism S T f g" "homeomorphism T U h k"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9326
    shows "homeomorphism S U (h o f) (g o k)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9327
  using assms
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9328
  unfolding homeomorphism_def
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9329
  by (intro conjI ballI continuous_on_compose) (auto simp: image_comp [symmetric])
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9330
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9331
lemma homeomorphism_symD: "homeomorphism S t f g \<Longrightarrow> homeomorphism t S g f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9332
  by (simp add: homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9333
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9334
lemma homeomorphism_sym: "homeomorphism S t f g = homeomorphism t S g f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9335
  by (force simp: homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9336
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9337
definition homeomorphic :: "'a::topological_space set \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9338
    (infixr "homeomorphic" 60)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9339
  where "s homeomorphic t \<equiv> (\<exists>f g. homeomorphism s t f g)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9340
63075
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  9341
lemma homeomorphic_empty [iff]:
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  9342
     "S homeomorphic {} \<longleftrightarrow> S = {}" "{} homeomorphic S \<longleftrightarrow> S = {}"
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  9343
  by (auto simp add: homeomorphic_def homeomorphism_def)
60a42a4166af lemmas about dimension, hyperplanes, span, etc.
paulson <lp15@cam.ac.uk>
parents: 63040
diff changeset
  9344
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9345
lemma homeomorphic_refl: "s homeomorphic s"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9346
  unfolding homeomorphic_def homeomorphism_def
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9347
  using continuous_on_id
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9348
  apply (rule_tac x = "(\<lambda>x. x)" in exI)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9349
  apply (rule_tac x = "(\<lambda>x. x)" in exI)
52625
wenzelm
parents: 52624
diff changeset
  9350
  apply blast
wenzelm
parents: 52624
diff changeset
  9351
  done
wenzelm
parents: 52624
diff changeset
  9352
wenzelm
parents: 52624
diff changeset
  9353
lemma homeomorphic_sym: "s homeomorphic t \<longleftrightarrow> t homeomorphic s"
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  9354
  unfolding homeomorphic_def homeomorphism_def
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9355
  by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9356
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  9357
lemma homeomorphic_trans [trans]:
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9358
  assumes "S homeomorphic T"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9359
      and "T homeomorphic U"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9360
    shows "S homeomorphic U"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9361
  using assms
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9362
  unfolding homeomorphic_def
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  9363
by (metis homeomorphism_compose)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9364
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9365
lemma homeomorphic_minimal:
52625
wenzelm
parents: 52624
diff changeset
  9366
  "s homeomorphic t \<longleftrightarrow>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9367
    (\<exists>f g. (\<forall>x\<in>s. f(x) \<in> t \<and> (g(f(x)) = x)) \<and>
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9368
           (\<forall>y\<in>t. g(y) \<in> s \<and> (f(g(y)) = y)) \<and>
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9369
           continuous_on s f \<and> continuous_on t g)"
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9370
   (is "?lhs = ?rhs")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9371
proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9372
  assume ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9373
  then show ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9374
    by (fastforce simp: homeomorphic_def homeomorphism_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9375
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9376
  assume ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9377
  then show ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9378
    apply clarify
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9379
    unfolding homeomorphic_def homeomorphism_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9380
    by (metis equalityI image_subset_iff subsetI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9381
 qed
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
  9382
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9383
lemma homeomorphicI [intro?]:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9384
   "\<lbrakk>f ` S = T; g ` T = S;
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9385
     continuous_on S f; continuous_on T g;
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9386
     \<And>x. x \<in> S \<Longrightarrow> g(f(x)) = x;
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9387
     \<And>y. y \<in> T \<Longrightarrow> f(g(y)) = y\<rbrakk> \<Longrightarrow> S homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9388
unfolding homeomorphic_def homeomorphism_def by metis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9389
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9390
lemma homeomorphism_of_subsets:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9391
   "\<lbrakk>homeomorphism S T f g; S' \<subseteq> S; T'' \<subseteq> T; f ` S' = T'\<rbrakk>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9392
    \<Longrightarrow> homeomorphism S' T' f g"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9393
apply (auto simp: homeomorphism_def elim!: continuous_on_subset)
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9394
by (metis subsetD imageI)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9395
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9396
lemma homeomorphism_apply1: "\<lbrakk>homeomorphism S T f g; x \<in> S\<rbrakk> \<Longrightarrow> g(f x) = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9397
  by (simp add: homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9398
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9399
lemma homeomorphism_apply2: "\<lbrakk>homeomorphism S T f g; x \<in> T\<rbrakk> \<Longrightarrow> f(g x) = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9400
  by (simp add: homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9401
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9402
lemma homeomorphism_image1: "homeomorphism S T f g \<Longrightarrow> f ` S = T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9403
  by (simp add: homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9404
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9405
lemma homeomorphism_image2: "homeomorphism S T f g \<Longrightarrow> g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9406
  by (simp add: homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9407
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9408
lemma homeomorphism_cont1: "homeomorphism S T f g \<Longrightarrow> continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9409
  by (simp add: homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9410
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9411
lemma homeomorphism_cont2: "homeomorphism S T f g \<Longrightarrow> continuous_on T g"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9412
  by (simp add: homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9413
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9414
lemma continuous_on_no_limpt:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9415
   "(\<And>x. \<not> x islimpt S) \<Longrightarrow> continuous_on S f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9416
  unfolding continuous_on_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9417
  by (metis UNIV_I empty_iff eventually_at_topological islimptE open_UNIV tendsto_def trivial_limit_within)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9418
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9419
lemma continuous_on_finite:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9420
  fixes S :: "'a::t1_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9421
  shows "finite S \<Longrightarrow> continuous_on S f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9422
by (metis continuous_on_no_limpt islimpt_finite)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9423
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9424
lemma homeomorphic_finite:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9425
  fixes S :: "'a::t1_space set" and T :: "'b::t1_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9426
  assumes "finite T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9427
  shows "S homeomorphic T \<longleftrightarrow> finite S \<and> finite T \<and> card S = card T" (is "?lhs = ?rhs")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9428
proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9429
  assume "S homeomorphic T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9430
  with assms show ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9431
    apply (auto simp: homeomorphic_def homeomorphism_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9432
     apply (metis finite_imageI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9433
    by (metis card_image_le finite_imageI le_antisym)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9434
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9435
  assume R: ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9436
  with finite_same_card_bij obtain h where "bij_betw h S T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9437
    by (auto simp: )
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9438
  with R show ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9439
    apply (auto simp: homeomorphic_def homeomorphism_def continuous_on_finite)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9440
    apply (rule_tac x="h" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9441
    apply (rule_tac x="inv_into S h" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9442
    apply (auto simp:  bij_betw_inv_into_left bij_betw_inv_into_right bij_betw_imp_surj_on inv_into_into bij_betwE)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9443
    apply (metis bij_betw_def bij_betw_inv_into)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9444
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9445
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63957
diff changeset
  9446
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9447
text \<open>Relatively weak hypotheses if a set is compact.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9448
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9449
lemma homeomorphism_compact:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  9450
  fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9451
  assumes "compact s" "continuous_on s f"  "f ` s = t"  "inj_on f s"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9452
  shows "\<exists>g. homeomorphism s t f g"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9453
proof -
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  9454
  define g where "g x = (SOME y. y\<in>s \<and> f y = x)" for x
52625
wenzelm
parents: 52624
diff changeset
  9455
  have g: "\<forall>x\<in>s. g (f x) = x"
wenzelm
parents: 52624
diff changeset
  9456
    using assms(3) assms(4)[unfolded inj_on_def] unfolding g_def by auto
wenzelm
parents: 52624
diff changeset
  9457
  {
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9458
    fix y
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9459
    assume "y \<in> t"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9460
    then obtain x where x:"f x = y" "x\<in>s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9461
      using assms(3) by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9462
    then have "g (f x) = x" using g by auto
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9463
    then have "f (g y) = y" unfolding x(1)[symmetric] by auto
52625
wenzelm
parents: 52624
diff changeset
  9464
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9465
  then have g':"\<forall>x\<in>t. f (g x) = x" by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9466
  moreover
52625
wenzelm
parents: 52624
diff changeset
  9467
  {
wenzelm
parents: 52624
diff changeset
  9468
    fix x
wenzelm
parents: 52624
diff changeset
  9469
    have "x\<in>s \<Longrightarrow> x \<in> g ` t"
wenzelm
parents: 52624
diff changeset
  9470
      using g[THEN bspec[where x=x]]
wenzelm
parents: 52624
diff changeset
  9471
      unfolding image_iff
wenzelm
parents: 52624
diff changeset
  9472
      using assms(3)
wenzelm
parents: 52624
diff changeset
  9473
      by (auto intro!: bexI[where x="f x"])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9474
    moreover
52625
wenzelm
parents: 52624
diff changeset
  9475
    {
wenzelm
parents: 52624
diff changeset
  9476
      assume "x\<in>g ` t"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9477
      then obtain y where y:"y\<in>t" "g y = x" by auto
52625
wenzelm
parents: 52624
diff changeset
  9478
      then obtain x' where x':"x'\<in>s" "f x' = y"
wenzelm
parents: 52624
diff changeset
  9479
        using assms(3) by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9480
      then have "x \<in> s"
52625
wenzelm
parents: 52624
diff changeset
  9481
        unfolding g_def
wenzelm
parents: 52624
diff changeset
  9482
        using someI2[of "\<lambda>b. b\<in>s \<and> f b = y" x' "\<lambda>x. x\<in>s"]
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9483
        unfolding y(2)[symmetric] and g_def
52625
wenzelm
parents: 52624
diff changeset
  9484
        by auto
wenzelm
parents: 52624
diff changeset
  9485
    }
wenzelm
parents: 52624
diff changeset
  9486
    ultimately have "x\<in>s \<longleftrightarrow> x \<in> g ` t" ..
wenzelm
parents: 52624
diff changeset
  9487
  }
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9488
  then have "g ` t = s" by auto
52625
wenzelm
parents: 52624
diff changeset
  9489
  ultimately show ?thesis
wenzelm
parents: 52624
diff changeset
  9490
    unfolding homeomorphism_def homeomorphic_def
wenzelm
parents: 52624
diff changeset
  9491
    apply (rule_tac x=g in exI)
wenzelm
parents: 52624
diff changeset
  9492
    using g and assms(3) and continuous_on_inv[OF assms(2,1), of g, unfolded assms(3)] and assms(2)
wenzelm
parents: 52624
diff changeset
  9493
    apply auto
wenzelm
parents: 52624
diff changeset
  9494
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9495
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9496
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9497
lemma homeomorphic_compact:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  9498
  fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9499
  shows "compact s \<Longrightarrow> continuous_on s f \<Longrightarrow> (f ` s = t) \<Longrightarrow> inj_on f s \<Longrightarrow> s homeomorphic t"
37486
b993fac7985b beta-eta was too much, because it transformed SOME x. P x into Eps P, which caused problems later;
blanchet
parents: 37452
diff changeset
  9500
  unfolding homeomorphic_def by (metis homeomorphism_compact)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9501
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9502
text\<open>Preservation of topological properties.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9503
52625
wenzelm
parents: 52624
diff changeset
  9504
lemma homeomorphic_compactness: "s homeomorphic t \<Longrightarrow> (compact s \<longleftrightarrow> compact t)"
wenzelm
parents: 52624
diff changeset
  9505
  unfolding homeomorphic_def homeomorphism_def
wenzelm
parents: 52624
diff changeset
  9506
  by (metis compact_continuous_image)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9507
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9508
text\<open>Results on translation, scaling etc.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9509
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9510
lemma homeomorphic_scaling:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9511
  fixes s :: "'a::real_normed_vector set"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9512
  assumes "c \<noteq> 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9513
  shows "s homeomorphic ((\<lambda>x. c *\<^sub>R x) ` s)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9514
  unfolding homeomorphic_minimal
52625
wenzelm
parents: 52624
diff changeset
  9515
  apply (rule_tac x="\<lambda>x. c *\<^sub>R x" in exI)
wenzelm
parents: 52624
diff changeset
  9516
  apply (rule_tac x="\<lambda>x. (1 / c) *\<^sub>R x" in exI)
wenzelm
parents: 52624
diff changeset
  9517
  using assms
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  9518
  apply (auto simp add: continuous_intros)
52625
wenzelm
parents: 52624
diff changeset
  9519
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9520
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9521
lemma homeomorphic_translation:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9522
  fixes s :: "'a::real_normed_vector set"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9523
  shows "s homeomorphic ((\<lambda>x. a + x) ` s)"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9524
  unfolding homeomorphic_minimal
52625
wenzelm
parents: 52624
diff changeset
  9525
  apply (rule_tac x="\<lambda>x. a + x" in exI)
wenzelm
parents: 52624
diff changeset
  9526
  apply (rule_tac x="\<lambda>x. -a + x" in exI)
54230
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 54070
diff changeset
  9527
  using continuous_on_add [OF continuous_on_const continuous_on_id, of s a]
b1d955791529 more simplification rules on unary and binary minus
haftmann
parents: 54070
diff changeset
  9528
    continuous_on_add [OF continuous_on_const continuous_on_id, of "plus a ` s" "- a"]
52625
wenzelm
parents: 52624
diff changeset
  9529
  apply auto
wenzelm
parents: 52624
diff changeset
  9530
  done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9531
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9532
lemma homeomorphic_affinity:
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9533
  fixes s :: "'a::real_normed_vector set"
52625
wenzelm
parents: 52624
diff changeset
  9534
  assumes "c \<noteq> 0"
wenzelm
parents: 52624
diff changeset
  9535
  shows "s homeomorphic ((\<lambda>x. a + c *\<^sub>R x) ` s)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9536
proof -
52625
wenzelm
parents: 52624
diff changeset
  9537
  have *: "op + a ` op *\<^sub>R c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s" by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9538
  show ?thesis
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9539
    using homeomorphic_trans
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9540
    using homeomorphic_scaling[OF assms, of s]
52625
wenzelm
parents: 52624
diff changeset
  9541
    using homeomorphic_translation[of "(\<lambda>x. c *\<^sub>R x) ` s" a]
wenzelm
parents: 52624
diff changeset
  9542
    unfolding *
wenzelm
parents: 52624
diff changeset
  9543
    by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9544
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9545
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9546
lemma homeomorphic_balls:
50898
ebd9b82537e0 generalized more topology theorems
huffman
parents: 50897
diff changeset
  9547
  fixes a b ::"'a::real_normed_vector"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9548
  assumes "0 < d"  "0 < e"
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9549
  shows "(ball a d) homeomorphic  (ball b e)" (is ?th)
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9550
    and "(cball a d) homeomorphic (cball b e)" (is ?cth)
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9551
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9552
  show ?th unfolding homeomorphic_minimal
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9553
    apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9554
    apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI)
51364
8ee377823518 tuned proofs
hoelzl
parents: 51362
diff changeset
  9555
    using assms
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  9556
    apply (auto intro!: continuous_intros
52625
wenzelm
parents: 52624
diff changeset
  9557
      simp: dist_commute dist_norm pos_divide_less_eq mult_strict_left_mono)
51364
8ee377823518 tuned proofs
hoelzl
parents: 51362
diff changeset
  9558
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9559
  show ?cth unfolding homeomorphic_minimal
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9560
    apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9561
    apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI)
51364
8ee377823518 tuned proofs
hoelzl
parents: 51362
diff changeset
  9562
    using assms
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56290
diff changeset
  9563
    apply (auto intro!: continuous_intros
52625
wenzelm
parents: 52624
diff changeset
  9564
      simp: dist_commute dist_norm pos_divide_le_eq mult_strict_left_mono)
51364
8ee377823518 tuned proofs
hoelzl
parents: 51362
diff changeset
  9565
    done
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9566
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9567
64394
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9568
lemma homeomorphic_spheres:
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9569
  fixes a b ::"'a::real_normed_vector"
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9570
  assumes "0 < d"  "0 < e"
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9571
  shows "(sphere a d) homeomorphic (sphere b e)"
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9572
unfolding homeomorphic_minimal
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9573
    apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI)
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9574
    apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI)
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9575
    using assms
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9576
    apply (auto intro!: continuous_intros
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9577
      simp: dist_commute dist_norm pos_divide_less_eq mult_strict_left_mono)
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9578
    done
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64320
diff changeset
  9579
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9580
subsection\<open>Inverse function property for open/closed maps\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9581
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9582
lemma continuous_on_inverse_open_map:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9583
  assumes contf: "continuous_on S f"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9584
    and imf: "f ` S = T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9585
    and injf: "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9586
    and oo: "\<And>U. openin (subtopology euclidean S) U \<Longrightarrow> openin (subtopology euclidean T) (f ` U)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9587
  shows "continuous_on T g"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9588
proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9589
  from imf injf have gTS: "g ` T = S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9590
    by force
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9591
  from imf injf have fU: "U \<subseteq> S \<Longrightarrow> (f ` U) = {x \<in> T. g x \<in> U}" for U
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9592
    by force
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9593
  show ?thesis
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9594
    by (simp add: continuous_on_open [of T g] gTS) (metis openin_imp_subset fU oo)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9595
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9596
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9597
lemma continuous_on_inverse_closed_map:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9598
  assumes contf: "continuous_on S f"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9599
    and imf: "f ` S = T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9600
    and injf: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9601
    and oo: "\<And>U. closedin (subtopology euclidean S) U \<Longrightarrow> closedin (subtopology euclidean T) (f ` U)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9602
  shows "continuous_on T g"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9603
proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9604
  from imf injf have gTS: "g ` T = S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9605
    by force
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9606
  from imf injf have fU: "U \<subseteq> S \<Longrightarrow> (f ` U) = {x \<in> T. g x \<in> U}" for U
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9607
    by force
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9608
  show ?thesis
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9609
    by (simp add: continuous_on_closed [of T g] gTS) (metis closedin_imp_subset fU oo)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9610
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9611
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9612
lemma homeomorphism_injective_open_map:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9613
  assumes contf: "continuous_on S f"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9614
    and imf: "f ` S = T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9615
    and injf: "inj_on f S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9616
    and oo: "\<And>U. openin (subtopology euclidean S) U \<Longrightarrow> openin (subtopology euclidean T) (f ` U)"
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9617
  obtains g where "homeomorphism S T f g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9618
proof
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9619
  have "continuous_on T (inv_into S f)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9620
    by (metis contf continuous_on_inverse_open_map imf injf inv_into_f_f oo)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9621
  with imf injf contf show "homeomorphism S T f (inv_into S f)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9622
    by (auto simp: homeomorphism_def)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9623
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9624
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9625
lemma homeomorphism_injective_closed_map:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9626
  assumes contf: "continuous_on S f"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9627
    and imf: "f ` S = T"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9628
    and injf: "inj_on f S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9629
    and oo: "\<And>U. closedin (subtopology euclidean S) U \<Longrightarrow> closedin (subtopology euclidean T) (f ` U)"
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9630
  obtains g where "homeomorphism S T f g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9631
proof
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9632
  have "continuous_on T (inv_into S f)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9633
    by (metis contf continuous_on_inverse_closed_map imf injf inv_into_f_f oo)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9634
  with imf injf contf show "homeomorphism S T f (inv_into S f)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9635
    by (auto simp: homeomorphism_def)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9636
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9637
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9638
lemma homeomorphism_imp_open_map:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9639
  assumes hom: "homeomorphism S T f g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9640
    and oo: "openin (subtopology euclidean S) U"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9641
  shows "openin (subtopology euclidean T) (f ` U)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9642
proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9643
  from hom oo have [simp]: "f ` U = {y. y \<in> T \<and> g y \<in> U}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9644
    using openin_subset by (fastforce simp: homeomorphism_def rev_image_eqI)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9645
  from hom have "continuous_on T g"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9646
    unfolding homeomorphism_def by blast
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9647
  moreover have "g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9648
    by (metis hom homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9649
  ultimately show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9650
    by (simp add: continuous_on_open oo)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9651
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9652
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9653
lemma homeomorphism_imp_closed_map:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9654
  assumes hom: "homeomorphism S T f g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9655
    and oo: "closedin (subtopology euclidean S) U"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9656
  shows "closedin (subtopology euclidean T) (f ` U)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9657
proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9658
  from hom oo have [simp]: "f ` U = {y. y \<in> T \<and> g y \<in> U}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9659
    using closedin_subset by (fastforce simp: homeomorphism_def rev_image_eqI)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9660
  from hom have "continuous_on T g"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9661
    unfolding homeomorphism_def by blast
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9662
  moreover have "g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9663
    by (metis hom homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9664
  ultimately show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9665
    by (simp add: continuous_on_closed oo)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9666
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9667
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9668
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9669
subsection \<open>"Isometry" (up to constant bounds) of injective linear map etc.\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9670
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9671
lemma cauchy_isometric:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9672
  assumes e: "e > 0"
52625
wenzelm
parents: 52624
diff changeset
  9673
    and s: "subspace s"
wenzelm
parents: 52624
diff changeset
  9674
    and f: "bounded_linear f"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9675
    and normf: "\<forall>x\<in>s. norm (f x) \<ge> e * norm x"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9676
    and xs: "\<forall>n. x n \<in> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9677
    and cf: "Cauchy (f \<circ> x)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9678
  shows "Cauchy x"
52625
wenzelm
parents: 52624
diff changeset
  9679
proof -
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9680
  interpret f: bounded_linear f by fact
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9681
  have "\<exists>N. \<forall>n\<ge>N. norm (x n - x N) < d" if "d > 0" for d :: real
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9682
  proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9683
    from that obtain N where N: "\<forall>n\<ge>N. norm (f (x n) - f (x N)) < e * d"
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  9684
      using cf[unfolded Cauchy_def o_def dist_norm, THEN spec[where x="e*d"]] e
52625
wenzelm
parents: 52624
diff changeset
  9685
      by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9686
    have "norm (x n - x N) < d" if "n \<ge> N" for n
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9687
    proof -
45270
d5b5c9259afd fix bug in cancel_factor simprocs so they will work on goals like 'x * y < x * z' where the common term is already on the left
huffman
parents: 45051
diff changeset
  9688
      have "e * norm (x n - x N) \<le> norm (f (x n - x N))"
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63105
diff changeset
  9689
        using subspace_diff[OF s, of "x n" "x N"]
52625
wenzelm
parents: 52624
diff changeset
  9690
        using xs[THEN spec[where x=N]] and xs[THEN spec[where x=n]]
wenzelm
parents: 52624
diff changeset
  9691
        using normf[THEN bspec[where x="x n - x N"]]
wenzelm
parents: 52624
diff changeset
  9692
        by auto
45270
d5b5c9259afd fix bug in cancel_factor simprocs so they will work on goals like 'x * y < x * z' where the common term is already on the left
huffman
parents: 45051
diff changeset
  9693
      also have "norm (f (x n - x N)) < e * d"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9694
        using \<open>N \<le> n\<close> N unfolding f.diff[symmetric] by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9695
      finally show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9696
        using \<open>e>0\<close> by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9697
    qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9698
    then show ?thesis by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9699
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9700
  then show ?thesis
66089
def95e0bc529 Some new material. SIMPRULE STATUS for sum/prod.delta rules!
paulson <lp15@cam.ac.uk>
parents: 65587
diff changeset
  9701
    by (simp add: Cauchy_altdef2 dist_norm)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9702
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9703
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9704
lemma complete_isometric_image:
52625
wenzelm
parents: 52624
diff changeset
  9705
  assumes "0 < e"
wenzelm
parents: 52624
diff changeset
  9706
    and s: "subspace s"
wenzelm
parents: 52624
diff changeset
  9707
    and f: "bounded_linear f"
wenzelm
parents: 52624
diff changeset
  9708
    and normf: "\<forall>x\<in>s. norm(f x) \<ge> e * norm(x)"
wenzelm
parents: 52624
diff changeset
  9709
    and cs: "complete s"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9710
  shows "complete (f ` s)"
52625
wenzelm
parents: 52624
diff changeset
  9711
proof -
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9712
  have "\<exists>l\<in>f ` s. (g \<longlongrightarrow> l) sequentially"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9713
    if as:"\<forall>n::nat. g n \<in> f ` s" and cfg:"Cauchy g" for g
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9714
  proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9715
    from that obtain x where "\<forall>n. x n \<in> s \<and> g n = f (x n)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9716
      using choice[of "\<lambda> n xa. xa \<in> s \<and> g n = f xa"] by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9717
    then have x: "\<forall>n. x n \<in> s" "\<forall>n. g n = f (x n)" by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9718
    then have "f \<circ> x = g" by (simp add: fun_eq_iff)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
  9719
    then obtain l where "l\<in>s" and l:"(x \<longlongrightarrow> l) sequentially"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9720
      using cs[unfolded complete_def, THEN spec[where x="x"]]
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9721
      using cauchy_isometric[OF \<open>0 < e\<close> s f normf] and cfg and x(1)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9722
      by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9723
    then show ?thesis
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9724
      using linear_continuous_at[OF f, unfolded continuous_at_sequentially, THEN spec[where x=x], of l]
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9725
      by (auto simp: \<open>f \<circ> x = g\<close>)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9726
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9727
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9728
    unfolding complete_def by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9729
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9730
52625
wenzelm
parents: 52624
diff changeset
  9731
lemma injective_imp_isometric:
wenzelm
parents: 52624
diff changeset
  9732
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
wenzelm
parents: 52624
diff changeset
  9733
  assumes s: "closed s" "subspace s"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9734
    and f: "bounded_linear f" "\<forall>x\<in>s. f x = 0 \<longrightarrow> x = 0"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9735
  shows "\<exists>e>0. \<forall>x\<in>s. norm (f x) \<ge> e * norm x"
52625
wenzelm
parents: 52624
diff changeset
  9736
proof (cases "s \<subseteq> {0::'a}")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9737
  case True
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9738
  have "norm x \<le> norm (f x)" if "x \<in> s" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9739
  proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9740
    from True that have "x = 0" by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9741
    then show ?thesis by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9742
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9743
  then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9744
    by (auto intro!: exI[where x=1])
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9745
next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9746
  case False
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9747
  interpret f: bounded_linear f by fact
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9748
  from False obtain a where a: "a \<noteq> 0" "a \<in> s"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9749
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9750
  from False have "s \<noteq> {}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53597
diff changeset
  9751
    by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9752
  let ?S = "{f x| x. x \<in> s \<and> norm x = norm a}"
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  9753
  let ?S' = "{x::'a. x\<in>s \<and> norm x = norm a}"
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  9754
  let ?S'' = "{x::'a. norm x = norm a}"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9755
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9756
  have "?S'' = frontier (cball 0 (norm a))"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  9757
    by (simp add: sphere_def dist_norm)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62343
diff changeset
  9758
  then have "compact ?S''" by (metis compact_cball compact_frontier)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9759
  moreover have "?S' = s \<inter> ?S''" by auto
52625
wenzelm
parents: 52624
diff changeset
  9760
  ultimately have "compact ?S'"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62623
diff changeset
  9761
    using closed_Int_compact[of s ?S''] using s(1) by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9762
  moreover have *:"f ` ?S' = ?S" by auto
52625
wenzelm
parents: 52624
diff changeset
  9763
  ultimately have "compact ?S"
wenzelm
parents: 52624
diff changeset
  9764
    using compact_continuous_image[OF linear_continuous_on[OF f(1)], of ?S'] by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9765
  then have "closed ?S"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9766
    using compact_imp_closed by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9767
  moreover from a have "?S \<noteq> {}" by auto
52625
wenzelm
parents: 52624
diff changeset
  9768
  ultimately obtain b' where "b'\<in>?S" "\<forall>y\<in>?S. norm b' \<le> norm y"
wenzelm
parents: 52624
diff changeset
  9769
    using distance_attains_inf[of ?S 0] unfolding dist_0_norm by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9770
  then obtain b where "b\<in>s"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9771
    and ba: "norm b = norm a"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9772
    and b: "\<forall>x\<in>{x \<in> s. norm x = norm a}. norm (f b) \<le> norm (f x)"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9773
    unfolding *[symmetric] unfolding image_iff by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9774
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9775
  let ?e = "norm (f b) / norm b"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9776
  have "norm b > 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9777
    using ba and a and norm_ge_zero by auto
52625
wenzelm
parents: 52624
diff changeset
  9778
  moreover have "norm (f b) > 0"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9779
    using f(2)[THEN bspec[where x=b], OF \<open>b\<in>s\<close>]
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9780
    using \<open>norm b >0\<close> by simp
56541
0e3abadbef39 made divide_pos_pos a simp rule
nipkow
parents: 56371
diff changeset
  9781
  ultimately have "0 < norm (f b) / norm b" by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9782
  moreover
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9783
  have "norm (f b) / norm b * norm x \<le> norm (f x)" if "x\<in>s" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9784
  proof (cases "x = 0")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9785
    case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9786
    then show "norm (f b) / norm b * norm x \<le> norm (f x)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9787
      by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9788
  next
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9789
    case False
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9790
    with \<open>a \<noteq> 0\<close> have *: "0 < norm a / norm x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9791
      unfolding zero_less_norm_iff[symmetric] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9792
    have "\<forall>x\<in>s. c *\<^sub>R x \<in> s" for c
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9793
      using s[unfolded subspace_def] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9794
    with \<open>x \<in> s\<close> \<open>x \<noteq> 0\<close> have "(norm a / norm x) *\<^sub>R x \<in> {x \<in> s. norm x = norm a}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9795
      by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9796
    with \<open>x \<noteq> 0\<close> \<open>a \<noteq> 0\<close> show "norm (f b) / norm b * norm x \<le> norm (f x)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9797
      using b[THEN bspec[where x="(norm a / norm x) *\<^sub>R x"]]
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9798
      unfolding f.scaleR and ba
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9799
      by (auto simp: mult.commute pos_le_divide_eq pos_divide_le_eq)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9800
  qed
52625
wenzelm
parents: 52624
diff changeset
  9801
  ultimately show ?thesis by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9802
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9803
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9804
lemma closed_injective_image_subspace:
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  9805
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9806
  assumes "subspace s" "bounded_linear f" "\<forall>x\<in>s. f x = 0 \<longrightarrow> x = 0" "closed s"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9807
  shows "closed(f ` s)"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9808
proof -
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9809
  obtain e where "e > 0" and e: "\<forall>x\<in>s. e * norm x \<le> norm (f x)"
52625
wenzelm
parents: 52624
diff changeset
  9810
    using injective_imp_isometric[OF assms(4,1,2,3)] by auto
wenzelm
parents: 52624
diff changeset
  9811
  show ?thesis
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9812
    using complete_isometric_image[OF \<open>e>0\<close> assms(1,2) e] and assms(4)
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9813
    unfolding complete_eq_closed[symmetric] by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9814
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9815
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  9816
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9817
subsection \<open>Some properties of a canonical subspace\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9818
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9819
lemma subspace_substandard: "subspace {x::'a::euclidean_space. (\<forall>i\<in>Basis. P i \<longrightarrow> x\<bullet>i = 0)}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9820
  by (auto simp: subspace_def inner_add_left)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9821
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9822
lemma closed_substandard: "closed {x::'a::euclidean_space. \<forall>i\<in>Basis. P i \<longrightarrow> x\<bullet>i = 0}"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9823
  (is "closed ?A")
52625
wenzelm
parents: 52624
diff changeset
  9824
proof -
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
  9825
  let ?D = "{i\<in>Basis. P 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
  9826
  have "closed (\<Inter>i\<in>?D. {x::'a. x\<bullet>i = 0})"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9827
    by (simp add: closed_INT closed_Collect_eq continuous_on_inner
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9828
        continuous_on_const continuous_on_id)
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
  9829
  also have "(\<Inter>i\<in>?D. {x::'a. x\<bullet>i = 0}) = ?A"
44457
d366fa5551ef declare euclidean_simps [simp] at the point they are proved;
huffman
parents: 44365
diff changeset
  9830
    by auto
d366fa5551ef declare euclidean_simps [simp] at the point they are proved;
huffman
parents: 44365
diff changeset
  9831
  finally show "closed ?A" .
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9832
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9833
52625
wenzelm
parents: 52624
diff changeset
  9834
lemma dim_substandard:
wenzelm
parents: 52624
diff changeset
  9835
  assumes d: "d \<subseteq> Basis"
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
  9836
  shows "dim {x::'a::euclidean_space. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0} = card d" (is "dim ?A = _")
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9837
proof (rule dim_unique)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9838
  from d show "d \<subseteq> ?A"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9839
    by (auto simp: inner_Basis)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9840
  from d show "independent d"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9841
    by (rule independent_mono [OF independent_Basis])
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9842
  have "x \<in> span d" if "\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9843
  proof -
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9844
    have "finite d"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9845
      by (rule finite_subset [OF d finite_Basis])
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9846
    then have "(\<Sum>i\<in>d. (x \<bullet> i) *\<^sub>R i) \<in> span d"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
  9847
      by (simp add: span_sum span_clauses)
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9848
    also have "(\<Sum>i\<in>d. (x \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. (x \<bullet> i) *\<^sub>R i)"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9849
      by (rule sum.mono_neutral_cong_left [OF finite_Basis d]) (auto simp: that)
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9850
    finally show "x \<in> span d"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9851
      by (simp only: euclidean_representation)
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9852
  qed
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9853
  then show "?A \<subseteq> span d" by auto
53813
0a62ad289c4d tuned proofs
huffman
parents: 53640
diff changeset
  9854
qed simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9855
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9856
text \<open>Hence closure and completeness of all subspaces.\<close>
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9857
lemma ex_card:
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9858
  assumes "n \<le> card A"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9859
  shows "\<exists>S\<subseteq>A. card S = n"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9860
proof (cases "finite A")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9861
  case True
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  9862
  from ex_bij_betw_nat_finite[OF this] obtain f where f: "bij_betw f {0..<card A} A" ..
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9863
  moreover from f \<open>n \<le> card A\<close> have "{..< n} \<subseteq> {..< card A}" "inj_on f {..< n}"
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
  9864
    by (auto simp: bij_betw_def intro: subset_inj_on)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9865
  ultimately have "f ` {..< n} \<subseteq> A" "card (f ` {..< n}) = n"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9866
    by (auto simp: bij_betw_def card_image)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9867
  then show ?thesis by blast
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9868
next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9869
  case False
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9870
  with \<open>n \<le> card A\<close> show ?thesis by force
52625
wenzelm
parents: 52624
diff changeset
  9871
qed
wenzelm
parents: 52624
diff changeset
  9872
wenzelm
parents: 52624
diff changeset
  9873
lemma closed_subspace:
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9874
  fixes s :: "'a::euclidean_space set"
52625
wenzelm
parents: 52624
diff changeset
  9875
  assumes "subspace s"
wenzelm
parents: 52624
diff changeset
  9876
  shows "closed s"
wenzelm
parents: 52624
diff changeset
  9877
proof -
wenzelm
parents: 52624
diff changeset
  9878
  have "dim s \<le> card (Basis :: 'a set)"
wenzelm
parents: 52624
diff changeset
  9879
    using dim_subset_UNIV by auto
wenzelm
parents: 52624
diff changeset
  9880
  with ex_card[OF this] obtain d :: "'a set" where t: "card d = dim s" and d: "d \<subseteq> Basis"
wenzelm
parents: 52624
diff changeset
  9881
    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
  9882
  let ?t = "{x::'a. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9883
  have "\<exists>f. linear f \<and> f ` {x::'a. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0} = s \<and>
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9884
      inj_on f {x::'a. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9885
    using dim_substandard[of d] t d assms
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50324
diff changeset
  9886
    by (intro subspace_isomorphism[OF subspace_substandard[of "\<lambda>i. i \<notin> d"]]) (auto simp: inner_Basis)
55522
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  9887
  then obtain f where f:
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  9888
      "linear f"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  9889
      "f ` {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0} = s"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  9890
      "inj_on f {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0}"
23d2cbac6dce tuned proofs;
wenzelm
parents: 55415
diff changeset
  9891
    by blast
52625
wenzelm
parents: 52624
diff changeset
  9892
  interpret f: bounded_linear f
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9893
    using f by (simp add: linear_conv_bounded_linear)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9894
  have "x \<in> ?t \<Longrightarrow> f x = 0 \<Longrightarrow> x = 0" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9895
    using f.zero d f(3)[THEN inj_onD, of x 0] by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9896
  moreover have "closed ?t" by (rule closed_substandard)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9897
  moreover have "subspace ?t" by (rule subspace_substandard)
52625
wenzelm
parents: 52624
diff changeset
  9898
  ultimately show ?thesis
wenzelm
parents: 52624
diff changeset
  9899
    using closed_injective_image_subspace[of ?t f]
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 37452
diff changeset
  9900
    unfolding f(2) using f(1) unfolding linear_conv_bounded_linear by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9901
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9902
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9903
lemma complete_subspace: "subspace s \<Longrightarrow> complete s"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9904
  for s :: "'a::euclidean_space set"
52625
wenzelm
parents: 52624
diff changeset
  9905
  using complete_eq_closed closed_subspace by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9906
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9907
lemma closed_span [iff]: "closed (span s)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9908
  for s :: "'a::euclidean_space set"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9909
  by (simp add: closed_subspace)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9910
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9911
lemma dim_closure [simp]: "dim (closure s) = dim s" (is "?dc = ?d")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9912
  for s :: "'a::euclidean_space set"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9913
proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9914
  have "?dc \<le> ?d"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9915
    using closure_minimal[OF span_inc, of s]
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9916
    using closed_subspace[OF subspace_span, of s]
52625
wenzelm
parents: 52624
diff changeset
  9917
    using dim_subset[of "closure s" "span s"]
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9918
    by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9919
  then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9920
    using dim_subset[OF closure_subset, of s]
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9921
    by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9922
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9923
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  9924
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
  9925
subsection \<open>Affine transformations of intervals\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9926
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9927
lemma real_affinity_le: "0 < m \<Longrightarrow> m * x + c \<le> y \<longleftrightarrow> x \<le> inverse m * y + - (c / m)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9928
  for m :: "'a::linordered_field"
57865
dcfb33c26f50 tuned proofs -- fewer warnings;
wenzelm
parents: 57514
diff changeset
  9929
  by (simp add: field_simps)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9930
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9931
lemma real_le_affinity: "0 < m \<Longrightarrow> y \<le> m * x + c \<longleftrightarrow> inverse m * y + - (c / m) \<le> x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9932
  for m :: "'a::linordered_field"
57865
dcfb33c26f50 tuned proofs -- fewer warnings;
wenzelm
parents: 57514
diff changeset
  9933
  by (simp add: field_simps)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9934
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9935
lemma real_affinity_lt: "0 < m \<Longrightarrow> m * x + c < y \<longleftrightarrow> x < inverse m * y + - (c / m)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9936
  for m :: "'a::linordered_field"
57865
dcfb33c26f50 tuned proofs -- fewer warnings;
wenzelm
parents: 57514
diff changeset
  9937
  by (simp add: field_simps)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9938
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9939
lemma real_lt_affinity: "0 < m \<Longrightarrow> y < m * x + c \<longleftrightarrow> inverse m * y + - (c / m) < x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9940
  for m :: "'a::linordered_field"
57865
dcfb33c26f50 tuned proofs -- fewer warnings;
wenzelm
parents: 57514
diff changeset
  9941
  by (simp add: field_simps)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9942
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9943
lemma real_affinity_eq: "m \<noteq> 0 \<Longrightarrow> m * x + c = y \<longleftrightarrow> x = inverse m * y + - (c / m)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9944
  for m :: "'a::linordered_field"
57865
dcfb33c26f50 tuned proofs -- fewer warnings;
wenzelm
parents: 57514
diff changeset
  9945
  by (simp add: field_simps)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9946
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9947
lemma real_eq_affinity: "m \<noteq> 0 \<Longrightarrow> y = m * x + c  \<longleftrightarrow> inverse m * y + - (c / m) = x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9948
  for m :: "'a::linordered_field"
57865
dcfb33c26f50 tuned proofs -- fewer warnings;
wenzelm
parents: 57514
diff changeset
  9949
  by (simp add: field_simps)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9950
44210
eba74571833b Topology_Euclidean_Space.thy: organize section headings
huffman
parents: 44207
diff changeset
  9951
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9952
subsection \<open>Banach fixed point theorem (not really topological ...)\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9953
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
  9954
theorem banach_fix:
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9955
  assumes s: "complete s" "s \<noteq> {}"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9956
    and c: "0 \<le> c" "c < 1"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9957
    and f: "f ` s \<subseteq> s"
53291
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9958
    and lipschitz: "\<forall>x\<in>s. \<forall>y\<in>s. dist (f x) (f y) \<le> c * dist x y"
f7fa953bd15b tuned proofs;
wenzelm
parents: 53282
diff changeset
  9959
  shows "\<exists>!x\<in>s. f x = x"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
  9960
proof -
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9961
  from c have "1 - c > 0" by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9962
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9963
  from s(2) obtain z0 where z0: "z0 \<in> s" by blast
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  9964
  define z where "z n = (f ^^ n) z0" for n
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9965
  with f z0 have z_in_s: "z n \<in> s" for n :: nat
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9966
    by (induct n) auto
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
  9967
  define d where "d = dist (z 0) (z 1)"
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
  9968
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9969
  have fzn: "f (z n) = z (Suc n)" for n
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9970
    by (simp add: z_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9971
  have cf_z: "dist (z n) (z (Suc n)) \<le> (c ^ n) * d" for n :: nat
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9972
  proof (induct n)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9973
    case 0
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9974
    then show ?case
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9975
      by (simp add: d_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9976
  next
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9977
    case (Suc m)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9978
    with \<open>0 \<le> c\<close> have "c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9979
      using mult_left_mono[of "dist (z m) (z (Suc m))" "c ^ m * d" c] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9980
    then show ?case
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9981
      using lipschitz[THEN bspec[where x="z m"], OF z_in_s, THEN bspec[where x="z (Suc m)"], OF z_in_s]
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9982
      by (simp add: fzn mult_le_cancel_left)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9983
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9984
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9985
  have cf_z2: "(1 - c) * dist (z m) (z (m + n)) \<le> (c ^ m) * d * (1 - c ^ n)" for n m :: nat
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9986
  proof (induct n)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9987
    case 0
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9988
    show ?case by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9989
  next
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9990
    case (Suc k)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9991
    from c have "(1 - c) * dist (z m) (z (m + Suc k)) \<le>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9992
        (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9993
      by (simp add: dist_triangle)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9994
    also from c cf_z[of "m + k"] have "\<dots> \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9995
      by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9996
    also from Suc have "\<dots> \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9997
      by (simp add: field_simps)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9998
    also have "\<dots> = (c ^ m) * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
  9999
      by (simp add: power_add field_simps)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10000
    also from c have "\<dots> \<le> (c ^ m) * d * (1 - c ^ Suc k)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10001
      by (simp add: field_simps)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10002
    finally show ?case by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10003
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10004
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10005
  have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e" if "e > 0" for e
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10006
  proof (cases "d = 0")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10007
    case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10008
    from \<open>1 - c > 0\<close> have "(1 - c) * x \<le> 0 \<longleftrightarrow> x \<le> 0" for x
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10009
      by (metis mult_zero_left mult.commute real_mult_le_cancel_iff1)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10010
    with c cf_z2[of 0] True have "z n = z0" for n
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10011
      by (simp add: z_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10012
    with \<open>e > 0\<close> show ?thesis by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10013
  next
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10014
    case False
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10015
    with zero_le_dist[of "z 0" "z 1"] have "d > 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10016
      by (metis d_def less_le)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10017
    with \<open>1 - c > 0\<close> \<open>e > 0\<close> have "0 < e * (1 - c) / d"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10018
      by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10019
    with c obtain N where N: "c ^ N < e * (1 - c) / d"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10020
      using real_arch_pow_inv[of "e * (1 - c) / d" c] by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10021
    have *: "dist (z m) (z n) < e" if "m > n" and as: "m \<ge> N" "n \<ge> N" for m n :: nat
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10022
    proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10023
      from c \<open>n \<ge> N\<close> have *: "c ^ n \<le> c ^ N"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10024
        using power_decreasing[OF \<open>n\<ge>N\<close>, of c] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10025
      from c \<open>m > n\<close> have "1 - c ^ (m - n) > 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10026
        using power_strict_mono[of c 1 "m - n"] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10027
      with \<open>d > 0\<close> \<open>0 < 1 - c\<close> have **: "d * (1 - c ^ (m - n)) / (1 - c) > 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10028
        by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10029
      from cf_z2[of n "m - n"] \<open>m > n\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10030
      have "dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10031
        by (simp add: pos_le_divide_eq[OF \<open>1 - c > 0\<close>] mult.commute dist_commute)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10032
      also have "\<dots> \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10033
        using mult_right_mono[OF * order_less_imp_le[OF **]]
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10034
        by (simp add: mult.assoc)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10035
      also have "\<dots> < (e * (1 - c) / d) * d * (1 - c ^ (m - n)) / (1 - c)"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10036
        using mult_strict_right_mono[OF N **] by (auto simp add: mult.assoc)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10037
      also from c \<open>d > 0\<close> \<open>1 - c > 0\<close> have "\<dots> = e * (1 - c ^ (m - n))"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10038
        by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10039
      also from c \<open>1 - c ^ (m - n) > 0\<close> \<open>e > 0\<close> have "\<dots> \<le> e"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10040
        using mult_right_le_one_le[of e "1 - c ^ (m - n)"] by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10041
      finally show ?thesis by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10042
    qed
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10043
    have "dist (z n) (z m) < e" if "N \<le> m" "N \<le> n" for m n :: nat
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10044
    proof (cases "n = m")
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10045
      case True
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10046
      with \<open>e > 0\<close> show ?thesis by simp
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10047
    next
52625
wenzelm
parents: 52624
diff changeset
 10048
      case False
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10049
      with *[of n m] *[of m n] and that show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10050
        by (auto simp add: dist_commute nat_neq_iff)
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10051
    qed
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10052
    then show ?thesis by auto
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10053
  qed
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
 10054
  then have "Cauchy z"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10055
    by (simp add: cauchy_def)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
 10056
  then obtain x where "x\<in>s" and x:"(z \<longlongrightarrow> x) sequentially"
52625
wenzelm
parents: 52624
diff changeset
 10057
    using s(1)[unfolded compact_def complete_def, THEN spec[where x=z]] and z_in_s by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10058
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63007
diff changeset
 10059
  define e where "e = dist (f x) x"
52625
wenzelm
parents: 52624
diff changeset
 10060
  have "e = 0"
wenzelm
parents: 52624
diff changeset
 10061
  proof (rule ccontr)
wenzelm
parents: 52624
diff changeset
 10062
    assume "e \<noteq> 0"
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
 10063
    then have "e > 0"
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
 10064
      unfolding e_def using zero_le_dist[of "f x" x]
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10065
      by (metis dist_eq_0_iff dist_nz e_def)
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10066
    then obtain N where N:"\<forall>n\<ge>N. dist (z n) x < e / 2"
60017
b785d6d06430 Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents: 59815
diff changeset
 10067
      using x[unfolded lim_sequentially, THEN spec[where x="e/2"]] by auto
53282
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
 10068
    then have N':"dist (z N) x < e / 2" by auto
9d6e263fa921 tuned proofs;
wenzelm
parents: 53255
diff changeset
 10069
    have *: "c * dist (z N) x \<le> dist (z N) x"
52625
wenzelm
parents: 52624
diff changeset
 10070
      unfolding mult_le_cancel_right2
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10071
      using zero_le_dist[of "z N" x] and c
36778
739a9379e29b avoid using real-specific versions of generic lemmas
huffman
parents: 36669
diff changeset
 10072
      by (metis dist_eq_0_iff dist_nz order_less_asym less_le)
52625
wenzelm
parents: 52624
diff changeset
 10073
    have "dist (f (z N)) (f x) \<le> c * dist (z N) x"
wenzelm
parents: 52624
diff changeset
 10074
      using lipschitz[THEN bspec[where x="z N"], THEN bspec[where x=x]]
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10075
      using z_in_s[of N] \<open>x\<in>s\<close>
52625
wenzelm
parents: 52624
diff changeset
 10076
      using c
wenzelm
parents: 52624
diff changeset
 10077
      by auto
wenzelm
parents: 52624
diff changeset
 10078
    also have "\<dots> < e / 2"
wenzelm
parents: 52624
diff changeset
 10079
      using N' and c using * by auto
wenzelm
parents: 52624
diff changeset
 10080
    finally show False
wenzelm
parents: 52624
diff changeset
 10081
      unfolding fzn
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10082
      using N[THEN spec[where x="Suc N"]] and dist_triangle_half_r[of "z (Suc N)" "f x" e x]
52625
wenzelm
parents: 52624
diff changeset
 10083
      unfolding e_def
wenzelm
parents: 52624
diff changeset
 10084
      by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10085
  qed
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10086
  then have "f x = x" by (auto simp: e_def)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10087
  moreover have "y = x" if "f y = y" "y \<in> s" for y
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10088
  proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10089
    from \<open>x \<in> s\<close> \<open>f x = x\<close> that have "dist x y \<le> c * dist x y"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10090
      using lipschitz[THEN bspec[where x=x], THEN bspec[where x=y]] by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10091
    with c and zero_le_dist[of x y] have "dist x y = 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10092
      by (simp add: mult_le_cancel_right1)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10093
    then show ?thesis by simp
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10094
  qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10095
  ultimately show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10096
    using \<open>x\<in>s\<close> by blast
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10097
qed
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10098
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10099
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10100
subsection \<open>Edelstein fixed point theorem\<close>
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10101
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60762
diff changeset
 10102
theorem edelstein_fix:
50970
3e5b67f85bf9 generalized theorem edelstein_fix to class metric_space
huffman
parents: 50955
diff changeset
 10103
  fixes s :: "'a::metric_space set"
52625
wenzelm
parents: 52624
diff changeset
 10104
  assumes s: "compact s" "s \<noteq> {}"
wenzelm
parents: 52624
diff changeset
 10105
    and gs: "(g ` s) \<subseteq> s"
wenzelm
parents: 52624
diff changeset
 10106
    and dist: "\<forall>x\<in>s. \<forall>y\<in>s. x \<noteq> y \<longrightarrow> dist (g x) (g y) < dist x y"
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10107
  shows "\<exists>!x\<in>s. g x = x"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10108
proof -
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10109
  let ?D = "(\<lambda>x. (x, x)) ` s"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10110
  have D: "compact ?D" "?D \<noteq> {}"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10111
    by (rule compact_continuous_image)
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
 10112
       (auto intro!: s continuous_Pair continuous_ident simp: continuous_on_eq_continuous_within)
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10113
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10114
  have "\<And>x y e. x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> 0 < e \<Longrightarrow> dist y x < e \<Longrightarrow> dist (g y) (g x) < e"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10115
    using dist by fastforce
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10116
  then have "continuous_on s g"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10117
    by (auto simp: continuous_on_iff)
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10118
  then have cont: "continuous_on ?D (\<lambda>x. dist ((g \<circ> fst) x) (snd x))"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10119
    unfolding continuous_on_eq_continuous_within
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10120
    by (intro continuous_dist ballI continuous_within_compose)
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62466
diff changeset
 10121
       (auto intro!: continuous_fst continuous_snd continuous_ident simp: image_image)
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10122
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10123
  obtain a where "a \<in> s" and le: "\<And>x. x \<in> s \<Longrightarrow> dist (g a) a \<le> dist (g x) x"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10124
    using continuous_attains_inf[OF D cont] by auto
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10125
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10126
  have "g a = a"
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10127
  proof (rule ccontr)
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10128
    assume "g a \<noteq> a"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10129
    with \<open>a \<in> s\<close> gs have "dist (g (g a)) (g a) < dist (g a) a"
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10130
      by (intro dist[rule_format]) auto
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10131
    moreover have "dist (g a) a \<le> dist (g (g a)) (g a)"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10132
      using \<open>a \<in> s\<close> gs by (intro le) auto
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10133
    ultimately show False by auto
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10134
  qed
51347
f8a00792fbc1 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents: 51346
diff changeset
 10135
  moreover have "\<And>x. x \<in> s \<Longrightarrow> g x = x \<Longrightarrow> x = a"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60176
diff changeset
 10136
    using dist[THEN bspec[where x=a]] \<open>g a = a\<close> and \<open>a\<in>s\<close> by auto
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10137
  ultimately show "\<exists>!x\<in>s. g x = x"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10138
    using \<open>a \<in> s\<close> by blast
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10139
qed
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 10140
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10141
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10142
lemma cball_subset_cball_iff:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10143
  fixes a :: "'a :: euclidean_space"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10144
  shows "cball a r \<subseteq> cball a' r' \<longleftrightarrow> dist a a' + r \<le> r' \<or> r < 0"
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10145
    (is "?lhs \<longleftrightarrow> ?rhs")
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10146
proof
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10147
  assume ?lhs
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10148
  then show ?rhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10149
  proof (cases "r < 0")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10150
    case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10151
    then show ?rhs by simp
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10152
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10153
    case False
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10154
    then have [simp]: "r \<ge> 0" by simp
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10155
    have "norm (a - a') + r \<le> r'"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10156
    proof (cases "a = a'")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10157
      case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10158
      then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10159
        using subsetD [where c = "a + r *\<^sub>R (SOME i. i \<in> Basis)", OF \<open>?lhs\<close>] subsetD [where c = "a", OF \<open>?lhs\<close>]
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10160
        by (force simp add: SOME_Basis dist_norm)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10161
    next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10162
      case False
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10163
      have "norm (a' - (a + (r / norm (a - a')) *\<^sub>R (a - a'))) = norm (a' - a - (r / norm (a - a')) *\<^sub>R (a - a'))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10164
        by (simp add: algebra_simps)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10165
      also have "... = norm ((-1 - (r / norm (a - a'))) *\<^sub>R (a - a'))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10166
        by (simp add: algebra_simps)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10167
      also from \<open>a \<noteq> a'\<close> have "... = \<bar>- norm (a - a') - r\<bar>"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10168
        by (simp add: abs_mult_pos field_simps)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10169
      finally have [simp]: "norm (a' - (a + (r / norm (a - a')) *\<^sub>R (a - a'))) = \<bar>norm (a - a') + r\<bar>"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10170
        by linarith
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10171
      from \<open>a \<noteq> a'\<close> show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10172
        using subsetD [where c = "a' + (1 + r / norm(a - a')) *\<^sub>R (a - a')", OF \<open>?lhs\<close>]
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10173
        by (simp add: dist_norm scaleR_add_left)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10174
    qed
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10175
    then show ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10176
      by (simp add: dist_norm)
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10177
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10178
next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10179
  assume ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10180
  then show ?lhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10181
    by (auto simp: ball_def dist_norm)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10182
      (metis add.commute add_le_cancel_right dist_norm dist_triangle3 order_trans)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10183
qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10184
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10185
lemma cball_subset_ball_iff: "cball a r \<subseteq> ball a' r' \<longleftrightarrow> dist a a' + r < r' \<or> r < 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10186
  (is "?lhs \<longleftrightarrow> ?rhs")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10187
  for a :: "'a::euclidean_space"
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10188
proof
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10189
  assume ?lhs
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10190
  then show ?rhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10191
  proof (cases "r < 0")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10192
    case True then
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10193
    show ?rhs by simp
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10194
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10195
    case False
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10196
    then have [simp]: "r \<ge> 0" by simp
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10197
    have "norm (a - a') + r < r'"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10198
    proof (cases "a = a'")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10199
      case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10200
      then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10201
        using subsetD [where c = "a + r *\<^sub>R (SOME i. i \<in> Basis)", OF \<open>?lhs\<close>] subsetD [where c = "a", OF \<open>?lhs\<close>]
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10202
        by (force simp add: SOME_Basis dist_norm)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10203
    next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10204
      case False
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10205
      have False if "norm (a - a') + r \<ge> r'"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10206
      proof -
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10207
        from that have "\<bar>r' - norm (a - a')\<bar> \<le> r"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10208
          by (simp split: abs_split)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10209
            (metis \<open>0 \<le> r\<close> \<open>?lhs\<close> centre_in_cball dist_commute dist_norm less_asym mem_ball subset_eq)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10210
        then show ?thesis
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10211
          using subsetD [where c = "a + (r' / norm(a - a') - 1) *\<^sub>R (a - a')", OF \<open>?lhs\<close>] \<open>a \<noteq> a'\<close>
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10212
          by (simp add: dist_norm field_simps)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10213
            (simp add: diff_divide_distrib scaleR_left_diff_distrib)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10214
      qed
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10215
      then show ?thesis by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10216
    qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10217
    then show ?rhs by (simp add: dist_norm)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10218
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10219
next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10220
  assume ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10221
  then show ?lhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10222
    by (auto simp: ball_def dist_norm)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10223
      (metis add.commute add_le_cancel_right dist_norm dist_triangle3 le_less_trans)
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10224
qed
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10225
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10226
lemma ball_subset_cball_iff: "ball a r \<subseteq> cball a' r' \<longleftrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0"
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10227
  (is "?lhs = ?rhs")
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10228
  for a :: "'a::euclidean_space"
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10229
proof (cases "r \<le> 0")
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10230
  case True
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10231
  then show ?thesis
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10232
    using dist_not_less_zero less_le_trans by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10233
next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10234
  case False
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10235
  show ?thesis
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10236
  proof
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10237
    assume ?lhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10238
    then have "(cball a r \<subseteq> cball a' r')"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10239
      by (metis False closed_cball closure_ball closure_closed closure_mono not_less)
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10240
    with False show ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10241
      by (fastforce iff: cball_subset_cball_iff)
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10242
  next
64539
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10243
    assume ?rhs
a868c83aa66e misc tuning and modernization;
wenzelm
parents: 64394
diff changeset
 10244
    with False show ?lhs
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10245
      using ball_subset_cball cball_subset_cball_iff by blast
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10246
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10247
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10248
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10249
lemma ball_subset_ball_iff:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10250
  fixes a :: "'a :: euclidean_space"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10251
  shows "ball a r \<subseteq> ball a' r' \<longleftrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10252
        (is "?lhs = ?rhs")
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10253
proof (cases "r \<le> 0")
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10254
  case True then show ?thesis
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10255
    using dist_not_less_zero less_le_trans by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10256
next
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10257
  case False show ?thesis
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10258
  proof
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10259
    assume ?lhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10260
    then have "0 < r'"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10261
      by (metis (no_types) False \<open>?lhs\<close> centre_in_ball dist_norm le_less_trans mem_ball norm_ge_zero not_less set_mp)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10262
    then have "(cball a r \<subseteq> cball a' r')"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10263
      by (metis False\<open>?lhs\<close> closure_ball closure_mono not_less)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10264
    then show ?rhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10265
      using False cball_subset_cball_iff by fastforce
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10266
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10267
  assume ?rhs then show ?lhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10268
    apply (auto simp: ball_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10269
    apply (metis add.commute add_le_cancel_right dist_commute dist_triangle_lt not_le order_trans)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10270
    using dist_not_less_zero order.strict_trans2 apply blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10271
    done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10272
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10273
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10274
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10275
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10276
lemma ball_eq_ball_iff:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10277
  fixes x :: "'a :: euclidean_space"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10278
  shows "ball x d = ball y e \<longleftrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x=y \<and> d=e"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10279
        (is "?lhs = ?rhs")
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10280
proof
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10281
  assume ?lhs
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10282
  then show ?rhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10283
  proof (cases "d \<le> 0 \<or> e \<le> 0")
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10284
    case True
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10285
      with \<open>?lhs\<close> show ?rhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10286
        by safe (simp_all only: ball_eq_empty [of y e, symmetric] ball_eq_empty [of x d, symmetric])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10287
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10288
    case False
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10289
    with \<open>?lhs\<close> show ?rhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10290
      apply (auto simp add: set_eq_subset ball_subset_ball_iff dist_norm norm_minus_commute algebra_simps)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10291
      apply (metis add_le_same_cancel1 le_add_same_cancel1 norm_ge_zero norm_pths(2) order_trans)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10292
      apply (metis add_increasing2 add_le_imp_le_right eq_iff norm_ge_zero)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10293
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10294
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10295
next
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10296
  assume ?rhs then show ?lhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10297
    by (auto simp add: set_eq_subset ball_subset_ball_iff)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10298
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10299
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10300
lemma cball_eq_cball_iff:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10301
  fixes x :: "'a :: euclidean_space"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10302
  shows "cball x d = cball y e \<longleftrightarrow> d < 0 \<and> e < 0 \<or> x=y \<and> d=e"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10303
        (is "?lhs = ?rhs")
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10304
proof
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10305
  assume ?lhs
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10306
  then show ?rhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10307
  proof (cases "d < 0 \<or> e < 0")
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10308
    case True
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10309
      with \<open>?lhs\<close> show ?rhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10310
        by safe (simp_all only: cball_eq_empty [of y e, symmetric] cball_eq_empty [of x d, symmetric])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10311
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10312
    case False
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10313
    with \<open>?lhs\<close> show ?rhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10314
      apply (auto simp add: set_eq_subset cball_subset_cball_iff dist_norm norm_minus_commute algebra_simps)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10315
      apply (metis add_le_same_cancel1 le_add_same_cancel1 norm_ge_zero norm_pths(2) order_trans)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10316
      apply (metis add_increasing2 add_le_imp_le_right eq_iff norm_ge_zero)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10317
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10318
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10319
next
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10320
  assume ?rhs then show ?lhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10321
    by (auto simp add: set_eq_subset cball_subset_cball_iff)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10322
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10323
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10324
lemma ball_eq_cball_iff:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10325
  fixes x :: "'a :: euclidean_space"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10326
  shows "ball x d = cball y e \<longleftrightarrow> d \<le> 0 \<and> e < 0" (is "?lhs = ?rhs")
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10327
proof
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
 10328
  assume ?lhs
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10329
  then show ?rhs
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10330
    apply (auto simp add: set_eq_subset ball_subset_cball_iff cball_subset_ball_iff algebra_simps)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10331
    apply (metis add_increasing2 add_le_cancel_right add_less_same_cancel1 dist_not_less_zero less_le_trans zero_le_dist)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10332
    apply (metis add_less_same_cancel1 dist_not_less_zero less_le_trans not_le)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10333
    using \<open>?lhs\<close> ball_eq_empty cball_eq_empty apply blast+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10334
    done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10335
next
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
 10336
  assume ?rhs then show ?lhs by auto
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10337
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10338
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10339
lemma cball_eq_ball_iff:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10340
  fixes x :: "'a :: euclidean_space"
61915
e9812a95d108 theory for type of bounded linear functions; differentiation under the integral sign
immler
parents: 61907
diff changeset
 10341
  shows "cball x d = ball y e \<longleftrightarrow> d < 0 \<and> e \<le> 0"
e9812a95d108 theory for type of bounded linear functions; differentiation under the integral sign
immler
parents: 61907
diff changeset
 10342
  using ball_eq_cball_iff by blast
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61609
diff changeset
 10343
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10344
lemma finite_ball_avoid:
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10345
  fixes S :: "'a :: euclidean_space set"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10346
  assumes "open S" "finite X" "p \<in> S"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10347
  shows "\<exists>e>0. \<forall>w\<in>ball p e. w\<in>S \<and> (w\<noteq>p \<longrightarrow> w\<notin>X)"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10348
proof -
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10349
  obtain e1 where "0 < e1" and e1_b:"ball p e1 \<subseteq> S"
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10350
    using open_contains_ball_eq[OF \<open>open S\<close>] assms by auto
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10351
  obtain e2 where "0 < e2" and "\<forall>x\<in>X. x \<noteq> p \<longrightarrow> e2 \<le> dist p x"
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10352
    using finite_set_avoid[OF \<open>finite X\<close>,of p] by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10353
  hence "\<forall>w\<in>ball p (min e1 e2). w\<in>S \<and> (w\<noteq>p \<longrightarrow> w\<notin>X)" using e1_b by auto
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10354
  thus "\<exists>e>0. \<forall>w\<in>ball p e. w \<in> S \<and> (w \<noteq> p \<longrightarrow> w \<notin> X)" using \<open>e2>0\<close> \<open>e1>0\<close>
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10355
    apply (rule_tac x="min e1 e2" in exI)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10356
    by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10357
qed
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10358
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10359
lemma finite_cball_avoid:
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10360
  fixes S :: "'a :: euclidean_space set"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10361
  assumes "open S" "finite X" "p \<in> S"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10362
  shows "\<exists>e>0. \<forall>w\<in>cball p e. w\<in>S \<and> (w\<noteq>p \<longrightarrow> w\<notin>X)"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10363
proof -
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10364
  obtain e1 where "e1>0" and e1: "\<forall>w\<in>ball p e1. w\<in>S \<and> (w\<noteq>p \<longrightarrow> w\<notin>X)"
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10365
    using finite_ball_avoid[OF assms] by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10366
  define e2 where "e2 \<equiv> e1/2"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10367
  have "e2>0" and "e2 < e1" unfolding e2_def using \<open>e1>0\<close> by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10368
  then have "cball p e2 \<subseteq> ball p e1" by (subst cball_subset_ball_iff,auto)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10369
  then show "\<exists>e>0. \<forall>w\<in>cball p e. w \<in> S \<and> (w \<noteq> p \<longrightarrow> w \<notin> X)" using \<open>e2>0\<close> e1 by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10370
qed
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63128
diff changeset
 10371
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10372
subsection\<open>Various separability-type properties\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10373
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10374
lemma univ_second_countable:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10375
  obtains \<B> :: "'a::euclidean_space set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10376
  where "countable \<B>" "\<And>C. C \<in> \<B> \<Longrightarrow> open C"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10377
       "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<B> \<and> S = \<Union>U"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10378
by (metis ex_countable_basis topological_basis_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10379
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10380
lemma subset_second_countable:
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10381
  obtains \<B> :: "'a:: euclidean_space set set"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10382
    where "countable \<B>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10383
          "{} \<notin> \<B>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10384
          "\<And>C. C \<in> \<B> \<Longrightarrow> openin(subtopology euclidean S) C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10385
          "\<And>T. openin(subtopology euclidean S) T \<Longrightarrow> \<exists>\<U>. \<U> \<subseteq> \<B> \<and> T = \<Union>\<U>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10386
proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10387
  obtain \<B> :: "'a set set"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10388
    where "countable \<B>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10389
      and opeB: "\<And>C. C \<in> \<B> \<Longrightarrow> openin(subtopology euclidean S) C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10390
      and \<B>:    "\<And>T. openin(subtopology euclidean S) T \<Longrightarrow> \<exists>\<U>. \<U> \<subseteq> \<B> \<and> T = \<Union>\<U>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10391
  proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10392
    obtain \<C> :: "'a set set"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10393
      where "countable \<C>" and ope: "\<And>C. C \<in> \<C> \<Longrightarrow> open C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10394
        and \<C>: "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<C> \<and> S = \<Union>U"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10395
      by (metis univ_second_countable that)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10396
    show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10397
    proof
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10398
      show "countable ((\<lambda>C. S \<inter> C) ` \<C>)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10399
        by (simp add: \<open>countable \<C>\<close>)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10400
      show "\<And>C. C \<in> op \<inter> S ` \<C> \<Longrightarrow> openin (subtopology euclidean S) C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10401
        using ope by auto
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10402
      show "\<And>T. openin (subtopology euclidean S) T \<Longrightarrow> \<exists>\<U>\<subseteq>op \<inter> S ` \<C>. T = \<Union>\<U>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10403
        by (metis \<C> image_mono inf_Sup openin_open)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10404
    qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10405
  qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10406
  show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10407
  proof
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10408
    show "countable (\<B> - {{}})"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10409
      using \<open>countable \<B>\<close> by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10410
    show "\<And>C. \<lbrakk>C \<in> \<B> - {{}}\<rbrakk> \<Longrightarrow> openin (subtopology euclidean S) C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10411
      by (simp add: \<open>\<And>C. C \<in> \<B> \<Longrightarrow> openin (subtopology euclidean S) C\<close>)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10412
    show "\<exists>\<U>\<subseteq>\<B> - {{}}. T = \<Union>\<U>" if "openin (subtopology euclidean S) T" for T
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10413
      using \<B> [OF that]
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10414
      apply clarify
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10415
      apply (rule_tac x="\<U> - {{}}" in exI, auto)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10416
        done
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10417
  qed auto
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10418
qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10419
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10420
lemma univ_second_countable_sequence:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10421
  obtains B :: "nat \<Rightarrow> 'a::euclidean_space set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10422
    where "inj B" "\<And>n. open(B n)" "\<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union>{B n |n. n \<in> k}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10423
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10424
  obtain \<B> :: "'a set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10425
  where "countable \<B>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10426
    and op: "\<And>C. C \<in> \<B> \<Longrightarrow> open C"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10427
    and Un: "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<B> \<and> S = \<Union>U"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10428
    using univ_second_countable by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10429
  have *: "infinite (range (\<lambda>n. ball (0::'a) (inverse(Suc n))))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10430
    apply (rule Infinite_Set.range_inj_infinite)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10431
    apply (simp add: inj_on_def ball_eq_ball_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10432
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10433
  have "infinite \<B>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10434
  proof
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10435
    assume "finite \<B>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10436
    then have "finite (Union ` (Pow \<B>))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10437
      by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10438
    then have "finite (range (\<lambda>n. ball (0::'a) (inverse(Suc n))))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10439
      apply (rule rev_finite_subset)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10440
      by (metis (no_types, lifting) PowI image_eqI image_subset_iff Un [OF open_ball])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10441
    with * show False by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10442
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10443
  obtain f :: "nat \<Rightarrow> 'a set" where "\<B> = range f" "inj f"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10444
    by (blast intro: countable_as_injective_image [OF \<open>countable \<B>\<close> \<open>infinite \<B>\<close>])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10445
  have *: "\<exists>k. S = \<Union>{f n |n. n \<in> k}" if "open S" for S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10446
    using Un [OF that]
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10447
    apply clarify
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10448
    apply (rule_tac x="f-`U" in exI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10449
    using \<open>inj f\<close> \<open>\<B> = range f\<close> apply force
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10450
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10451
  show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10452
    apply (rule that [OF \<open>inj f\<close> _ *])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10453
    apply (auto simp: \<open>\<B> = range f\<close> op)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10454
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10455
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10456
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10457
proposition separable:
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10458
  fixes S :: "'a:: euclidean_space set"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10459
  obtains T where "countable T" "T \<subseteq> S" "S \<subseteq> closure T"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10460
proof -
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10461
  obtain \<B> :: "'a:: euclidean_space set set"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10462
    where "countable \<B>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10463
      and "{} \<notin> \<B>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10464
      and ope: "\<And>C. C \<in> \<B> \<Longrightarrow> openin(subtopology euclidean S) C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10465
      and if_ope: "\<And>T. openin(subtopology euclidean S) T \<Longrightarrow> \<exists>\<U>. \<U> \<subseteq> \<B> \<and> T = \<Union>\<U>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10466
    by (meson subset_second_countable)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10467
  then obtain f where f: "\<And>C. C \<in> \<B> \<Longrightarrow> f C \<in> C"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10468
    by (metis equals0I)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10469
  show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10470
  proof
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10471
    show "countable (f ` \<B>)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10472
      by (simp add: \<open>countable \<B>\<close>)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10473
    show "f ` \<B> \<subseteq> S"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10474
      using ope f openin_imp_subset by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10475
    show "S \<subseteq> closure (f ` \<B>)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10476
    proof (clarsimp simp: closure_approachable)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10477
      fix x and e::real
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10478
      assume "x \<in> S" "0 < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10479
      have "openin (subtopology euclidean S) (S \<inter> ball x e)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10480
        by (simp add: openin_Int_open)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10481
      with if_ope obtain \<U> where  \<U>: "\<U> \<subseteq> \<B>" "S \<inter> ball x e = \<Union>\<U>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10482
        by meson
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10483
      show "\<exists>C \<in> \<B>. dist (f C) x < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10484
      proof (cases "\<U> = {}")
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10485
        case True
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10486
        then show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10487
          using \<open>0 < e\<close>  \<U> \<open>x \<in> S\<close> by auto
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10488
      next
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10489
        case False
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10490
        then obtain C where "C \<in> \<U>" by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10491
        show ?thesis
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10492
        proof
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10493
          show "dist (f C) x < e"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10494
            by (metis Int_iff Union_iff \<U> \<open>C \<in> \<U>\<close> dist_commute f mem_ball subsetCE)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10495
          show "C \<in> \<B>"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10496
            using \<open>\<U> \<subseteq> \<B>\<close> \<open>C \<in> \<U>\<close> by blast
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10497
        qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10498
      qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10499
    qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10500
  qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10501
qed
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 10502
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10503
proposition Lindelof:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10504
  fixes \<F> :: "'a::euclidean_space set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10505
  assumes \<F>: "\<And>S. S \<in> \<F> \<Longrightarrow> open S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10506
  obtains \<F>' where "\<F>' \<subseteq> \<F>" "countable \<F>'" "\<Union>\<F>' = \<Union>\<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10507
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10508
  obtain \<B> :: "'a set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10509
    where "countable \<B>" "\<And>C. C \<in> \<B> \<Longrightarrow> open C"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10510
      and \<B>: "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<B> \<and> S = \<Union>U"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10511
    using univ_second_countable by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10512
  define \<D> where "\<D> \<equiv> {S. S \<in> \<B> \<and> (\<exists>U. U \<in> \<F> \<and> S \<subseteq> U)}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10513
  have "countable \<D>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10514
    apply (rule countable_subset [OF _ \<open>countable \<B>\<close>])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10515
    apply (force simp: \<D>_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10516
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10517
  have "\<And>S. \<exists>U. S \<in> \<D> \<longrightarrow> U \<in> \<F> \<and> S \<subseteq> U"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10518
    by (simp add: \<D>_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10519
  then obtain G where G: "\<And>S. S \<in> \<D> \<longrightarrow> G S \<in> \<F> \<and> S \<subseteq> G S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10520
    by metis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10521
  have "\<Union>\<F> \<subseteq> \<Union>\<D>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10522
    unfolding \<D>_def by (blast dest: \<F> \<B>)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10523
  moreover have "\<Union>\<D> \<subseteq> \<Union>\<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10524
    using \<D>_def by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10525
  ultimately have eq1: "\<Union>\<F> = \<Union>\<D>" ..
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10526
  have eq2: "\<Union>\<D> = UNION \<D> G"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10527
    using G eq1 by auto
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10528
  show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10529
    apply (rule_tac \<F>' = "G ` \<D>" in that)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10530
    using G \<open>countable \<D>\<close>  apply (auto simp: eq1 eq2)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10531
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10532
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10533
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10534
lemma Lindelof_openin:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10535
  fixes \<F> :: "'a::euclidean_space set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10536
  assumes "\<And>S. S \<in> \<F> \<Longrightarrow> openin (subtopology euclidean U) S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10537
  obtains \<F>' where "\<F>' \<subseteq> \<F>" "countable \<F>'" "\<Union>\<F>' = \<Union>\<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10538
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10539
  have "\<And>S. S \<in> \<F> \<Longrightarrow> \<exists>T. open T \<and> S = U \<inter> T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10540
    using assms by (simp add: openin_open)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10541
  then obtain tf where tf: "\<And>S. S \<in> \<F> \<Longrightarrow> open (tf S) \<and> (S = U \<inter> tf S)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10542
    by metis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10543
  have [simp]: "\<And>\<F>'. \<F>' \<subseteq> \<F> \<Longrightarrow> \<Union>\<F>' = U \<inter> \<Union>(tf ` \<F>')"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10544
    using tf by fastforce
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10545
  obtain \<G> where "countable \<G> \<and> \<G> \<subseteq> tf ` \<F>" "\<Union>\<G> = UNION \<F> tf"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10546
    using tf by (force intro: Lindelof [of "tf ` \<F>"])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10547
  then obtain \<F>' where \<F>': "\<F>' \<subseteq> \<F>" "countable \<F>'" "\<Union>\<F>' = \<Union>\<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10548
    by (clarsimp simp add: countable_subset_image)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10549
  then show ?thesis ..
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10550
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10551
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10552
lemma countable_disjoint_open_subsets:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10553
  fixes \<F> :: "'a::euclidean_space set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10554
  assumes "\<And>S. S \<in> \<F> \<Longrightarrow> open S" and pw: "pairwise disjnt \<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10555
    shows "countable \<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10556
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10557
  obtain \<F>' where "\<F>' \<subseteq> \<F>" "countable \<F>'" "\<Union>\<F>' = \<Union>\<F>"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10558
    by (meson assms Lindelof)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10559
  with pw have "\<F> \<subseteq> insert {} \<F>'"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10560
    by (fastforce simp add: pairwise_def disjnt_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10561
  then show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10562
    by (simp add: \<open>countable \<F>'\<close> countable_subset)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10563
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10564
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10565
lemma closedin_compact:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10566
   "\<lbrakk>compact S; closedin (subtopology euclidean S) T\<rbrakk> \<Longrightarrow> compact T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10567
by (metis closedin_closed compact_Int_closed)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10568
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10569
lemma closedin_compact_eq:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10570
  fixes S :: "'a::t2_space set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10571
  shows
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10572
   "compact S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10573
         \<Longrightarrow> (closedin (subtopology euclidean S) T \<longleftrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10574
              compact T \<and> T \<subseteq> S)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10575
by (metis closedin_imp_subset closedin_compact closed_subset compact_imp_closed)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10576
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10577
lemma continuous_imp_closed_map:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10578
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10579
  assumes "closedin (subtopology euclidean S) U"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10580
          "continuous_on S f" "image f S = T" "compact S"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10581
    shows "closedin (subtopology euclidean T) (image f U)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10582
  by (metis assms closedin_compact_eq compact_continuous_image continuous_on_subset subset_image_iff)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10583
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10584
lemma continuous_imp_quotient_map:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10585
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10586
  assumes "continuous_on S f" "image f S = T" "compact S" "U \<subseteq> T"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10587
    shows "openin (subtopology euclidean S) {x. x \<in> S \<and> f x \<in> U} \<longleftrightarrow>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10588
           openin (subtopology euclidean T) U"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10589
  by (metis (no_types, lifting) Collect_cong assms closed_map_imp_quotient_map continuous_imp_closed_map)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10590
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10591
subsection\<open> Finite intersection property\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10592
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10593
text\<open>Also developed in HOL's toplogical spaces theory, but the Heine-Borel type class isn't available there.\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10594
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10595
lemma closed_imp_fip:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10596
  fixes S :: "'a::heine_borel set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10597
  assumes "closed S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10598
      and T: "T \<in> \<F>" "bounded T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10599
      and clof: "\<And>T. T \<in> \<F> \<Longrightarrow> closed T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10600
      and none: "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> \<Inter>\<F>' \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10601
    shows "S \<inter> \<Inter>\<F> \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10602
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10603
  have "compact (S \<inter> T)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10604
    using \<open>closed S\<close> clof compact_eq_bounded_closed T by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10605
  then have "(S \<inter> T) \<inter> \<Inter>\<F> \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10606
    apply (rule compact_imp_fip)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10607
     apply (simp add: clof)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10608
    by (metis Int_assoc complete_lattice_class.Inf_insert finite_insert insert_subset none \<open>T \<in> \<F>\<close>)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10609
  then show ?thesis by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10610
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10611
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10612
lemma closed_imp_fip_compact:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10613
  fixes S :: "'a::heine_borel set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10614
  shows
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10615
   "\<lbrakk>closed S; \<And>T. T \<in> \<F> \<Longrightarrow> compact T;
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10616
     \<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> \<Inter>\<F>' \<noteq> {}\<rbrakk>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10617
        \<Longrightarrow> S \<inter> \<Inter>\<F> \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10618
by (metis Inf_greatest closed_imp_fip compact_eq_bounded_closed empty_subsetI finite.emptyI inf.orderE)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10619
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10620
lemma closed_fip_heine_borel:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10621
  fixes \<F> :: "'a::heine_borel set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10622
  assumes "closed S" "T \<in> \<F>" "bounded T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10623
      and "\<And>T. T \<in> \<F> \<Longrightarrow> closed T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10624
      and "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> \<Inter>\<F>' \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10625
    shows "\<Inter>\<F> \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10626
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10627
  have "UNIV \<inter> \<Inter>\<F> \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10628
    using assms closed_imp_fip [OF closed_UNIV] by auto
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10629
  then show ?thesis by simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10630
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10631
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10632
lemma compact_fip_heine_borel:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10633
  fixes \<F> :: "'a::heine_borel set set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10634
  assumes clof: "\<And>T. T \<in> \<F> \<Longrightarrow> compact T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10635
      and none: "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> \<Inter>\<F>' \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10636
    shows "\<Inter>\<F> \<noteq> {}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10637
by (metis InterI all_not_in_conv clof closed_fip_heine_borel compact_eq_bounded_closed none)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10638
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10639
lemma compact_sequence_with_limit:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10640
  fixes f :: "nat \<Rightarrow> 'a::heine_borel"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10641
  shows "(f \<longlongrightarrow> l) sequentially \<Longrightarrow> compact (insert l (range f))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10642
apply (simp add: compact_eq_bounded_closed, auto)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10643
apply (simp add: convergent_imp_bounded)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10644
by (simp add: closed_limpt islimpt_insert sequence_unique_limpt)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63170
diff changeset
 10645
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10646
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10647
subsection\<open>Componentwise limits and continuity\<close>
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10648
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10649
text\<open>But is the premise really necessary? Need to generalise @{thm euclidean_dist_l2}\<close>
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10650
lemma Euclidean_dist_upper: "i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> dist x y"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10651
  by (metis (no_types) member_le_setL2 euclidean_dist_l2 finite_Basis)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10652
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10653
text\<open>But is the premise @{term \<open>i \<in> Basis\<close>} really necessary?\<close>
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10654
lemma open_preimage_inner:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10655
  assumes "open S" "i \<in> Basis"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10656
    shows "open {x. x \<bullet> i \<in> S}"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10657
proof (rule openI, simp)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10658
  fix x
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10659
  assume x: "x \<bullet> i \<in> S"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10660
  with assms obtain e where "0 < e" and e: "ball (x \<bullet> i) e \<subseteq> S"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10661
    by (auto simp: open_contains_ball_eq)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10662
  have "\<exists>e>0. ball (y \<bullet> i) e \<subseteq> S" if dxy: "dist x y < e / 2" for y
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10663
  proof (intro exI conjI)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10664
    have "dist (x \<bullet> i) (y \<bullet> i) < e / 2"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10665
      by (meson \<open>i \<in> Basis\<close> dual_order.trans Euclidean_dist_upper not_le that)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10666
    then have "dist (x \<bullet> i) z < e" if "dist (y \<bullet> i) z < e / 2" for z
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10667
      by (metis dist_commute dist_triangle_half_l that)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10668
    then have "ball (y \<bullet> i) (e / 2) \<subseteq> ball (x \<bullet> i) e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10669
      using mem_ball by blast
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10670
      with e show "ball (y \<bullet> i) (e / 2) \<subseteq> S"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10671
        by (metis order_trans)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10672
  qed (simp add: \<open>0 < e\<close>)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10673
  then show "\<exists>e>0. ball x e \<subseteq> {s. s \<bullet> i \<in> S}"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10674
    by (metis (no_types, lifting) \<open>0 < e\<close> \<open>open S\<close> half_gt_zero_iff mem_Collect_eq mem_ball open_contains_ball_eq subsetI)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10675
qed
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10676
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10677
proposition tendsto_componentwise_iff:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10678
  fixes f :: "_ \<Rightarrow> 'b::euclidean_space"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10679
  shows "(f \<longlongrightarrow> l) F \<longleftrightarrow> (\<forall>i \<in> Basis. ((\<lambda>x. (f x \<bullet> i)) \<longlongrightarrow> (l \<bullet> i)) F)"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10680
         (is "?lhs = ?rhs")
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10681
proof
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10682
  assume ?lhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10683
  then show ?rhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10684
    unfolding tendsto_def
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10685
    apply clarify
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10686
    apply (drule_tac x="{s. s \<bullet> i \<in> S}" in spec)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10687
    apply (auto simp: open_preimage_inner)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10688
    done
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10689
next
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10690
  assume R: ?rhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10691
  then have "\<And>e. e > 0 \<Longrightarrow> \<forall>i\<in>Basis. \<forall>\<^sub>F x in F. dist (f x \<bullet> i) (l \<bullet> i) < e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10692
    unfolding tendsto_iff by blast
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10693
  then have R': "\<And>e. e > 0 \<Longrightarrow> \<forall>\<^sub>F x in F. \<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10694
      by (simp add: eventually_ball_finite_distrib [symmetric])
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10695
  show ?lhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10696
  unfolding tendsto_iff
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10697
  proof clarify
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10698
    fix e::real
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10699
    assume "0 < e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10700
    have *: "setL2 (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis < e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10701
             if "\<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e / real DIM('b)" for x
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10702
    proof -
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10703
      have "setL2 (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis \<le> sum (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10704
        by (simp add: setL2_le_sum)
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10705
      also have "... < DIM('b) * (e / real DIM('b))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10706
        apply (rule sum_bounded_above_strict)
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10707
        using that by auto
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10708
      also have "... = e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10709
        by (simp add: field_simps)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10710
      finally show "setL2 (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis < e" .
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10711
    qed
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10712
    have "\<forall>\<^sub>F x in F. \<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e / DIM('b)"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10713
      apply (rule R')
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10714
      using \<open>0 < e\<close> by simp
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10715
    then show "\<forall>\<^sub>F x in F. dist (f x) l < e"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10716
      apply (rule eventually_mono)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10717
      apply (subst euclidean_dist_l2)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10718
      using * by blast
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10719
  qed
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10720
qed
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10721
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10722
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10723
corollary continuous_componentwise:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10724
   "continuous F f \<longleftrightarrow> (\<forall>i \<in> Basis. continuous F (\<lambda>x. (f x \<bullet> i)))"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10725
by (simp add: continuous_def tendsto_componentwise_iff [symmetric])
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10726
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10727
corollary continuous_on_componentwise:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10728
  fixes S :: "'a :: t2_space set"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10729
  shows "continuous_on S f \<longleftrightarrow> (\<forall>i \<in> Basis. continuous_on S (\<lambda>x. (f x \<bullet> i)))"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10730
  apply (simp add: continuous_on_eq_continuous_within)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10731
  using continuous_componentwise by blast
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10732
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10733
lemma linear_componentwise_iff:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10734
     "(linear f') \<longleftrightarrow> (\<forall>i\<in>Basis. linear (\<lambda>x. f' x \<bullet> i))"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10735
  apply (auto simp: linear_iff inner_left_distrib)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10736
   apply (metis inner_left_distrib euclidean_eq_iff)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10737
  by (metis euclidean_eqI inner_scaleR_left)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10738
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10739
lemma bounded_linear_componentwise_iff:
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10740
     "(bounded_linear f') \<longleftrightarrow> (\<forall>i\<in>Basis. bounded_linear (\<lambda>x. f' x \<bullet> i))"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10741
     (is "?lhs = ?rhs")
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10742
proof
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10743
  assume ?lhs then show ?rhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10744
    by (simp add: bounded_linear_inner_left_comp)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10745
next
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10746
  assume ?rhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10747
  then have "(\<forall>i\<in>Basis. \<exists>K. \<forall>x. \<bar>f' x \<bullet> i\<bar> \<le> norm x * K)" "linear f'"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10748
    by (auto simp: bounded_linear_def bounded_linear_axioms_def linear_componentwise_iff [symmetric] ball_conj_distrib)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10749
  then obtain F where F: "\<And>i x. i \<in> Basis \<Longrightarrow> \<bar>f' x \<bullet> i\<bar> \<le> norm x * F i"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10750
    by metis
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10751
  have "norm (f' x) \<le> norm x * sum F Basis" for x
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10752
  proof -
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10753
    have "norm (f' x) \<le> (\<Sum>i\<in>Basis. \<bar>f' x \<bullet> i\<bar>)"
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10754
      by (rule norm_le_l1)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10755
    also have "... \<le> (\<Sum>i\<in>Basis. norm x * F i)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10756
      by (metis F sum_mono)
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10757
    also have "... = norm x * sum F Basis"
b9a1486e79be setsum -> sum
nipkow
parents: 64240
diff changeset
 10758
      by (simp add: sum_distrib_left)
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10759
    finally show ?thesis .
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10760
  qed
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10761
  then show ?lhs
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10762
    by (force simp: bounded_linear_def bounded_linear_axioms_def \<open>linear f'\<close>)
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10763
qed
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 10764
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10765
subsection\<open>Pasting functions together\<close>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10766
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10767
subsubsection\<open>on open sets\<close>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10768
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10769
lemma pasting_lemma:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10770
  fixes f :: "'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::topological_space"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10771
  assumes clo: "\<And>i. i \<in> I \<Longrightarrow> openin (subtopology euclidean S) (T i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10772
      and cont: "\<And>i. i \<in> I \<Longrightarrow> continuous_on (T i) (f i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10773
      and f: "\<And>i j x. \<lbrakk>i \<in> I; j \<in> I; x \<in> S \<inter> T i \<inter> T j\<rbrakk> \<Longrightarrow> f i x = f j x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10774
      and g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>j. j \<in> I \<and> x \<in> T j \<and> g x = f j x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10775
    shows "continuous_on S g"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10776
proof (clarsimp simp: continuous_openin_preimage_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10777
  fix U :: "'b set"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10778
  assume "open U"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10779
  have S: "\<And>i. i \<in> I \<Longrightarrow> (T i) \<subseteq> S"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10780
    using clo openin_imp_subset by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10781
  have *: "{x \<in> S. g x \<in> U} = \<Union>{{x. x \<in> (T i) \<and> (f i x) \<in> U} |i. i \<in> I}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10782
    apply (auto simp: dest: S)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10783
      apply (metis (no_types, lifting) g mem_Collect_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10784
    using clo f g openin_imp_subset by fastforce
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10785
  show "openin (subtopology euclidean S) {x \<in> S. g x \<in> U}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10786
    apply (subst *)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10787
    apply (rule openin_Union, clarify)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10788
    apply (metis (full_types) \<open>open U\<close> cont clo openin_trans continuous_openin_preimage_gen)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10789
    done
64284
f3b905b2eee2 HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents: 64267
diff changeset
 10790
qed
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10791
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10792
lemma pasting_lemma_exists:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10793
  fixes f :: "'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::topological_space"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10794
  assumes S: "S \<subseteq> (\<Union>i \<in> I. T i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10795
      and clo: "\<And>i. i \<in> I \<Longrightarrow> openin (subtopology euclidean S) (T i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10796
      and cont: "\<And>i. i \<in> I \<Longrightarrow> continuous_on (T i) (f i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10797
      and f: "\<And>i j x. \<lbrakk>i \<in> I; j \<in> I; x \<in> S \<inter> T i \<inter> T j\<rbrakk> \<Longrightarrow> f i x = f j x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10798
    obtains g where "continuous_on S g" "\<And>x i. \<lbrakk>i \<in> I; x \<in> S \<inter> T i\<rbrakk> \<Longrightarrow> g x = f i x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10799
proof
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10800
  show "continuous_on S (\<lambda>x. f (SOME i. i \<in> I \<and> x \<in> T i) x)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10801
    apply (rule pasting_lemma [OF clo cont])
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10802
     apply (blast intro: f)+
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10803
    apply (metis (mono_tags, lifting) S UN_iff subsetCE someI)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10804
    done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10805
next
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10806
  fix x i
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10807
  assume "i \<in> I" "x \<in> S \<inter> T i"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10808
  then show "f (SOME i. i \<in> I \<and> x \<in> T i) x = f i x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10809
    by (metis (no_types, lifting) IntD2 IntI f someI_ex)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10810
qed
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10811
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10812
subsubsection\<open>Likewise on closed sets, with a finiteness assumption\<close>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10813
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10814
lemma pasting_lemma_closed:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10815
  fixes f :: "'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::topological_space"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10816
  assumes "finite I"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10817
      and clo: "\<And>i. i \<in> I \<Longrightarrow> closedin (subtopology euclidean S) (T i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10818
      and cont: "\<And>i. i \<in> I \<Longrightarrow> continuous_on (T i) (f i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10819
      and f: "\<And>i j x. \<lbrakk>i \<in> I; j \<in> I; x \<in> S \<inter> T i \<inter> T j\<rbrakk> \<Longrightarrow> f i x = f j x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10820
      and g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>j. j \<in> I \<and> x \<in> T j \<and> g x = f j x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10821
    shows "continuous_on S g"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10822
proof (clarsimp simp: continuous_closedin_preimage_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10823
  fix U :: "'b set"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10824
  assume "closed U"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10825
  have *: "{x \<in> S. g x \<in> U} = \<Union>{{x. x \<in> (T i) \<and> (f i x) \<in> U} |i. i \<in> I}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10826
    apply auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10827
    apply (metis (no_types, lifting) g mem_Collect_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10828
    using clo closedin_closed apply blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10829
    apply (metis Int_iff f g clo closedin_limpt inf.absorb_iff2)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10830
    done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10831
  show "closedin (subtopology euclidean S) {x \<in> S. g x \<in> U}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10832
    apply (subst *)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10833
    apply (rule closedin_Union)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10834
    using \<open>finite I\<close> apply simp
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10835
    apply (blast intro: \<open>closed U\<close> continuous_closedin_preimage cont clo closedin_trans)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10836
    done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10837
qed
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10838
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10839
lemma pasting_lemma_exists_closed:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10840
  fixes f :: "'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::topological_space"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10841
  assumes "finite I"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10842
      and S: "S \<subseteq> (\<Union>i \<in> I. T i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10843
      and clo: "\<And>i. i \<in> I \<Longrightarrow> closedin (subtopology euclidean S) (T i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10844
      and cont: "\<And>i. i \<in> I \<Longrightarrow> continuous_on (T i) (f i)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10845
      and f: "\<And>i j x. \<lbrakk>i \<in> I; j \<in> I; x \<in> S \<inter> T i \<inter> T j\<rbrakk> \<Longrightarrow> f i x = f j x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10846
    obtains g where "continuous_on S g" "\<And>x i. \<lbrakk>i \<in> I; x \<in> S \<inter> T i\<rbrakk> \<Longrightarrow> g x = f i x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10847
proof
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10848
  show "continuous_on S (\<lambda>x. f (SOME i. i \<in> I \<and> x \<in> T i) x)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10849
    apply (rule pasting_lemma_closed [OF \<open>finite I\<close> clo cont])
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10850
     apply (blast intro: f)+
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10851
    apply (metis (mono_tags, lifting) S UN_iff subsetCE someI)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10852
    done
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10853
next
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10854
  fix x i
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10855
  assume "i \<in> I" "x \<in> S \<inter> T i"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10856
  then show "f (SOME i. i \<in> I \<and> x \<in> T i) x = f i x"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10857
    by (metis (no_types, lifting) IntD2 IntI f someI_ex)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10858
qed
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63945
diff changeset
 10859
63957
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10860
lemma tube_lemma:
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10861
  assumes "compact K"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10862
  assumes "open W"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10863
  assumes "{x0} \<times> K \<subseteq> W"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10864
  shows "\<exists>X0. x0 \<in> X0 \<and> open X0 \<and> X0 \<times> K \<subseteq> W"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10865
proof -
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10866
  {
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10867
    fix y assume "y \<in> K"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10868
    then have "(x0, y) \<in> W" using assms by auto
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10869
    with \<open>open W\<close>
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10870
    have "\<exists>X0 Y. open X0 \<and> open Y \<and> x0 \<in> X0 \<and> y \<in> Y \<and> X0 \<times> Y \<subseteq> W"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10871
      by (rule open_prod_elim) blast
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10872
  }
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10873
  then obtain X0 Y where
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10874
    *: "\<forall>y \<in> K. open (X0 y) \<and> open (Y y) \<and> x0 \<in> X0 y \<and> y \<in> Y y \<and> X0 y \<times> Y y \<subseteq> W"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10875
    by metis
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10876
  from * have "\<forall>t\<in>Y ` K. open t" "K \<subseteq> \<Union>(Y ` K)" by auto
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10877
  with \<open>compact K\<close> obtain CC where CC: "CC \<subseteq> Y ` K" "finite CC" "K \<subseteq> \<Union>CC"
64758
3b33d2fc5fc0 A few new lemmas and needed adaptations
paulson <lp15@cam.ac.uk>
parents: 64539
diff changeset
 10878
    by (meson compactE)
63957
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10879
  then obtain c where c: "\<And>C. C \<in> CC \<Longrightarrow> c C \<in> K \<and> C = Y (c C)"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10880
    by (force intro!: choice)
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10881
  with * CC show ?thesis
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10882
    by (force intro!: exI[where x="\<Inter>C\<in>CC. X0 (c C)"]) (* SLOW *)
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10883
qed
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10884
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10885
lemma continuous_on_prod_compactE:
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10886
  fixes fx::"'a::topological_space \<times> 'b::topological_space \<Rightarrow> 'c::metric_space"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10887
    and e::real
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10888
  assumes cont_fx: "continuous_on (U \<times> C) fx"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10889
  assumes "compact C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10890
  assumes [intro]: "x0 \<in> U"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10891
  notes [continuous_intros] = continuous_on_compose2[OF cont_fx]
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10892
  assumes "e > 0"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10893
  obtains X0 where "x0 \<in> X0" "open X0"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10894
    "\<forall>x\<in>X0 \<inter> U. \<forall>t \<in> C. dist (fx (x, t)) (fx (x0, t)) \<le> e"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10895
proof -
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10896
  define psi where "psi = (\<lambda>(x, t). dist (fx (x, t)) (fx (x0, t)))"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10897
  define W0 where "W0 = {(x, t) \<in> U \<times> C. psi (x, t) < e}"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10898
  have W0_eq: "W0 = psi -` {..<e} \<inter> U \<times> C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10899
    by (auto simp: vimage_def W0_def)
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10900
  have "open {..<e}" by simp
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10901
  have "continuous_on (U \<times> C) psi"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10902
    by (auto intro!: continuous_intros simp: psi_def split_beta')
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10903
  from this[unfolded continuous_on_open_invariant, rule_format, OF \<open>open {..<e}\<close>]
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10904
  obtain W where W: "open W" "W \<inter> U \<times> C = W0 \<inter> U \<times> C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10905
    unfolding W0_eq by blast
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10906
  have "{x0} \<times> C \<subseteq> W \<inter> U \<times> C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10907
    unfolding W
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10908
    by (auto simp: W0_def psi_def \<open>0 < e\<close>)
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10909
  then have "{x0} \<times> C \<subseteq> W" by blast
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10910
  from tube_lemma[OF \<open>compact C\<close> \<open>open W\<close> this]
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10911
  obtain X0 where X0: "x0 \<in> X0" "open X0" "X0 \<times> C \<subseteq> W"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10912
    by blast
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10913
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10914
  have "\<forall>x\<in>X0 \<inter> U. \<forall>t \<in> C. dist (fx (x, t)) (fx (x0, t)) \<le> e"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10915
  proof safe
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10916
    fix x assume x: "x \<in> X0" "x \<in> U"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10917
    fix t assume t: "t \<in> C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10918
    have "dist (fx (x, t)) (fx (x0, t)) = psi (x, t)"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10919
      by (auto simp: psi_def)
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10920
    also
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10921
    {
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10922
      have "(x, t) \<in> X0 \<times> C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10923
        using t x
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10924
        by auto
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10925
      also note \<open>\<dots> \<subseteq> W\<close>
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10926
      finally have "(x, t) \<in> W" .
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10927
      with t x have "(x, t) \<in> W \<inter> U \<times> C"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10928
        by blast
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10929
      also note \<open>W \<inter> U \<times> C = W0 \<inter> U \<times> C\<close>
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10930
      finally  have "psi (x, t) < e"
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10931
        by (auto simp: W0_def)
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10932
    }
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10933
    finally show "dist (fx (x, t)) (fx (x0, t)) \<le> e" by simp
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10934
  qed
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10935
  from X0(1,2) this show ?thesis ..
c3da799b1b45 HOL-Analysis: move gauges and (tagged) divisions to its own theory file
hoelzl
parents: 63955
diff changeset
 10936
qed
64910
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
 10937
6108dddad9f0 more symbols via abbrevs;
wenzelm
parents: 64845
diff changeset
 10938
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10939
subsection\<open>Constancy of a function from a connected set into a finite, disconnected or discrete set\<close>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10940
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10941
text\<open>Still missing: versions for a set that is smaller than R, or countable.\<close>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10942
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10943
lemma continuous_disconnected_range_constant:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10944
  assumes s: "connected s"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10945
      and conf: "continuous_on s f"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10946
      and fim: "f ` s \<subseteq> t"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10947
      and cct: "\<And>y. y \<in> t \<Longrightarrow> connected_component_set t y = {y}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10948
    shows "\<exists>a. \<forall>x \<in> s. f x = a"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10949
proof (cases "s = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10950
  case True then show ?thesis by force
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10951
next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10952
  case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10953
  { fix x assume "x \<in> s"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10954
    then have "f ` s \<subseteq> {f x}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10955
    by (metis connected_continuous_image conf connected_component_maximal fim image_subset_iff rev_image_eqI s cct)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10956
  }
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10957
  with False show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10958
    by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10959
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10960
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10961
lemma discrete_subset_disconnected:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10962
  fixes s :: "'a::topological_space set"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10963
  fixes t :: "'b::real_normed_vector set"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10964
  assumes conf: "continuous_on s f"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10965
      and no: "\<And>x. x \<in> s \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> s \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10966
   shows "f ` s \<subseteq> {y. connected_component_set (f ` s) y = {y}}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10967
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10968
  { fix x assume x: "x \<in> s"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10969
    then obtain e where "e>0" and ele: "\<And>y. \<lbrakk>y \<in> s; f y \<noteq> f x\<rbrakk> \<Longrightarrow> e \<le> norm (f y - f x)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10970
      using conf no [OF x] by auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10971
    then have e2: "0 \<le> e / 2"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10972
      by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10973
    have "f y = f x" if "y \<in> s" and ccs: "f y \<in> connected_component_set (f ` s) (f x)" for y
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10974
      apply (rule ccontr)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10975
      using connected_closed [of "connected_component_set (f ` s) (f x)"] \<open>e>0\<close>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10976
      apply (simp add: del: ex_simps)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10977
      apply (drule spec [where x="cball (f x) (e / 2)"])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10978
      apply (drule spec [where x="- ball(f x) e"])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10979
      apply (auto simp: dist_norm open_closed [symmetric] simp del: le_divide_eq_numeral1 dest!: connected_component_in)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10980
        apply (metis diff_self e2 ele norm_minus_commute norm_zero not_less)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10981
       using centre_in_cball connected_component_refl_eq e2 x apply blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10982
      using ccs
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10983
      apply (force simp: cball_def dist_norm norm_minus_commute dest: ele [OF \<open>y \<in> s\<close>])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10984
      done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10985
    moreover have "connected_component_set (f ` s) (f x) \<subseteq> f ` s"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10986
      by (auto simp: connected_component_in)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10987
    ultimately have "connected_component_set (f ` s) (f x) = {f x}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10988
      by (auto simp: x)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10989
  }
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10990
  with assms show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10991
    by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10992
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10993
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10994
lemma finite_implies_discrete:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10995
  fixes s :: "'a::topological_space set"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10996
  assumes "finite (f ` s)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10997
  shows "(\<forall>x \<in> s. \<exists>e>0. \<forall>y. y \<in> s \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x))"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10998
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 10999
  have "\<exists>e>0. \<forall>y. y \<in> s \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)" if "x \<in> s" for x
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11000
  proof (cases "f ` s - {f x} = {}")
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11001
    case True
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11002
    with zero_less_numeral show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11003
      by (fastforce simp add: Set.image_subset_iff cong: conj_cong)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11004
  next
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11005
    case False
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11006
    then obtain z where z: "z \<in> s" "f z \<noteq> f x"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11007
      by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11008
    have finn: "finite {norm (z - f x) |z. z \<in> f ` s - {f x}}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11009
      using assms by simp
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11010
    then have *: "0 < Inf{norm(z - f x) | z. z \<in> f ` s - {f x}}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11011
      apply (rule finite_imp_less_Inf)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11012
      using z apply force+
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11013
      done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11014
    show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11015
      by (force intro!: * cInf_le_finite [OF finn])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11016
  qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11017
  with assms show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11018
    by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11019
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11020
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11021
text\<open>This proof requires the existence of two separate values of the range type.\<close>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11022
lemma finite_range_constant_imp_connected:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11023
  assumes "\<And>f::'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1.
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11024
              \<lbrakk>continuous_on s f; finite(f ` s)\<rbrakk> \<Longrightarrow> \<exists>a. \<forall>x \<in> s. f x = a"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11025
    shows "connected s"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11026
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11027
  { fix t u
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11028
    assume clt: "closedin (subtopology euclidean s) t"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11029
       and clu: "closedin (subtopology euclidean s) u"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11030
       and tue: "t \<inter> u = {}" and tus: "t \<union> u = s"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11031
    have conif: "continuous_on s (\<lambda>x. if x \<in> t then 0 else 1)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11032
      apply (subst tus [symmetric])
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11033
      apply (rule continuous_on_cases_local)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11034
      using clt clu tue
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11035
      apply (auto simp: tus continuous_on_const)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11036
      done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11037
    have fi: "finite ((\<lambda>x. if x \<in> t then 0 else 1) ` s)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11038
      by (rule finite_subset [of _ "{0,1}"]) auto
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11039
    have "t = {} \<or> u = {}"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11040
      using assms [OF conif fi] tus [symmetric]
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11041
      by (auto simp: Ball_def) (metis IntI empty_iff one_neq_zero tue)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11042
  }
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11043
  then show ?thesis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11044
    by (simp add: connected_closedin_eq)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11045
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11046
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11047
lemma continuous_disconnected_range_constant_eq:
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11048
      "(connected S \<longleftrightarrow>
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11049
           (\<forall>f::'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1.
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11050
            \<forall>t. continuous_on S f \<and> f ` S \<subseteq> t \<and> (\<forall>y \<in> t. connected_component_set t y = {y})
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11051
            \<longrightarrow> (\<exists>a::'b. \<forall>x \<in> S. f x = a)))" (is ?thesis1)
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11052
  and continuous_discrete_range_constant_eq:
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11053
      "(connected S \<longleftrightarrow>
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11054
         (\<forall>f::'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1.
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11055
          continuous_on S f \<and>
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11056
          (\<forall>x \<in> S. \<exists>e. 0 < e \<and> (\<forall>y. y \<in> S \<and> (f y \<noteq> f x) \<longrightarrow> e \<le> norm(f y - f x)))
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11057
          \<longrightarrow> (\<exists>a::'b. \<forall>x \<in> S. f x = a)))" (is ?thesis2)
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11058
  and continuous_finite_range_constant_eq:
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11059
      "(connected S \<longleftrightarrow>
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11060
         (\<forall>f::'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1.
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11061
          continuous_on S f \<and> finite (f ` S)
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11062
          \<longrightarrow> (\<exists>a::'b. \<forall>x \<in> S. f x = a)))" (is ?thesis3)
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11063
proof -
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11064
  have *: "\<And>s t u v. \<lbrakk>s \<Longrightarrow> t; t \<Longrightarrow> u; u \<Longrightarrow> v; v \<Longrightarrow> s\<rbrakk>
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11065
    \<Longrightarrow> (s \<longleftrightarrow> t) \<and> (s \<longleftrightarrow> u) \<and> (s \<longleftrightarrow> v)"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11066
    by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11067
  have "?thesis1 \<and> ?thesis2 \<and> ?thesis3"
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11068
    apply (rule *)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11069
    using continuous_disconnected_range_constant apply metis
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11070
    apply clarify
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11071
    apply (frule discrete_subset_disconnected; blast)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11072
    apply (blast dest: finite_implies_discrete)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11073
    apply (blast intro!: finite_range_constant_imp_connected)
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11074
    done
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11075
  then show ?thesis1 ?thesis2 ?thesis3
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11076
    by blast+
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11077
qed
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11078
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11079
lemma continuous_discrete_range_constant:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11080
  fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1"
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11081
  assumes S: "connected S"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11082
      and "continuous_on S f"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11083
      and "\<And>x. x \<in> S \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11084
    obtains a where "\<And>x. x \<in> S \<Longrightarrow> f x = a"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11085
  using continuous_discrete_range_constant_eq [THEN iffD1, OF S] assms
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11086
  by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11087
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11088
lemma continuous_finite_range_constant:
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11089
  fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1"
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11090
  assumes "connected S"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11091
      and "continuous_on S f"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11092
      and "finite (f ` S)"
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
 11093
    obtains a where "\<And>x. x \<in> S \<Longrightarrow> f x = a"
64773
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11094
  using assms continuous_finite_range_constant_eq
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11095
  by blast
223b2ebdda79 Many new theorems, and more tidying
paulson <lp15@cam.ac.uk>
parents: 64758
diff changeset
 11096
63938
f6ce08859d4c More mainly topological results
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
 11097
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11098
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11099
subsection \<open>Continuous Extension\<close>
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11100
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11101
definition clamp :: "'a::euclidean_space \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a" where
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11102
  "clamp a b x = (if (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11103
    then (\<Sum>i\<in>Basis. (if x\<bullet>i < a\<bullet>i then a\<bullet>i else if x\<bullet>i \<le> b\<bullet>i then x\<bullet>i else b\<bullet>i) *\<^sub>R i)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11104
    else a)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11105
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11106
lemma clamp_in_interval[simp]:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11107
  assumes "\<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> b \<bullet> i"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11108
  shows "clamp a b x \<in> cbox a b"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11109
  unfolding clamp_def
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11110
  using box_ne_empty(1)[of a b] assms by (auto simp: cbox_def)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11111
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11112
lemma clamp_cancel_cbox[simp]:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11113
  fixes x a b :: "'a::euclidean_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11114
  assumes x: "x \<in> cbox a b"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11115
  shows "clamp a b x = x"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11116
  using assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11117
  by (auto simp: clamp_def mem_box intro!: euclidean_eqI[where 'a='a])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11118
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11119
lemma clamp_empty_interval:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11120
  assumes "i \<in> Basis" "a \<bullet> i > b \<bullet> i"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11121
  shows "clamp a b = (\<lambda>_. a)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11122
  using assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11123
  by (force simp: clamp_def[abs_def] split: if_splits intro!: ext)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11124
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11125
lemma dist_clamps_le_dist_args:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11126
  fixes x :: "'a::euclidean_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11127
  shows "dist (clamp a b y) (clamp a b x) \<le> dist y x"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11128
proof cases
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11129
  assume le: "(\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11130
  then have "(\<Sum>i\<in>Basis. (dist (clamp a b y \<bullet> i) (clamp a b x \<bullet> i))\<^sup>2) \<le>
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11131
    (\<Sum>i\<in>Basis. (dist (y \<bullet> i) (x \<bullet> i))\<^sup>2)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11132
    by (auto intro!: sum_mono simp: clamp_def dist_real_def abs_le_square_iff[symmetric])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11133
  then show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11134
    by (auto intro: real_sqrt_le_mono
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11135
      simp: euclidean_dist_l2[where y=x] euclidean_dist_l2[where y="clamp a b x"] setL2_def)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11136
qed (auto simp: clamp_def)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11137
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11138
lemma clamp_continuous_at:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11139
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::metric_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11140
    and x :: 'a
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11141
  assumes f_cont: "continuous_on (cbox a b) f"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11142
  shows "continuous (at x) (\<lambda>x. f (clamp a b x))"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11143
proof cases
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11144
  assume le: "(\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11145
  show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11146
    unfolding continuous_at_eps_delta
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11147
  proof safe
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11148
    fix x :: 'a
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11149
    fix e :: real
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11150
    assume "e > 0"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11151
    moreover have "clamp a b x \<in> cbox a b"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11152
      by (simp add: clamp_in_interval le)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11153
    moreover note f_cont[simplified continuous_on_iff]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11154
    ultimately
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11155
    obtain d where d: "0 < d"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11156
      "\<And>x'. x' \<in> cbox a b \<Longrightarrow> dist x' (clamp a b x) < d \<Longrightarrow> dist (f x') (f (clamp a b x)) < e"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11157
      by force
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11158
    show "\<exists>d>0. \<forall>x'. dist x' x < d \<longrightarrow>
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11159
      dist (f (clamp a b x')) (f (clamp a b x)) < e"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11160
      using le
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11161
      by (auto intro!: d clamp_in_interval dist_clamps_le_dist_args[THEN le_less_trans])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11162
  qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11163
qed (auto simp: clamp_empty_interval)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11164
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11165
lemma clamp_continuous_on:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11166
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::metric_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11167
  assumes f_cont: "continuous_on (cbox a b) f"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11168
  shows "continuous_on S (\<lambda>x. f (clamp a b x))"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11169
  using assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11170
  by (auto intro: continuous_at_imp_continuous_on clamp_continuous_at)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11171
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11172
lemma clamp_bounded:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11173
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::metric_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11174
  assumes bounded: "bounded (f ` (cbox a b))"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11175
  shows "bounded (range (\<lambda>x. f (clamp a b x)))"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11176
proof cases
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11177
  assume le: "(\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11178
  from bounded obtain c where f_bound: "\<forall>x\<in>f ` cbox a b. dist undefined x \<le> c"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11179
    by (auto simp add: bounded_any_center[where a=undefined])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11180
  then show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11181
    by (auto intro!: exI[where x=c] clamp_in_interval[OF le[rule_format]]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11182
        simp: bounded_any_center[where a=undefined])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11183
qed (auto simp: clamp_empty_interval image_def)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11184
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11185
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11186
definition ext_cont :: "('a::euclidean_space \<Rightarrow> 'b::metric_space) \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11187
  where "ext_cont f a b = (\<lambda>x. f (clamp a b x))"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11188
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11189
lemma ext_cont_cancel_cbox[simp]:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11190
  fixes x a b :: "'a::euclidean_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11191
  assumes x: "x \<in> cbox a b"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11192
  shows "ext_cont f a b x = f x"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11193
  using assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11194
  unfolding ext_cont_def
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11195
  by (auto simp: clamp_def mem_box intro!: euclidean_eqI[where 'a='a] arg_cong[where f=f])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11196
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11197
lemma continuous_on_ext_cont[continuous_intros]:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11198
  "continuous_on (cbox a b) f \<Longrightarrow> continuous_on S (ext_cont f a b)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11199
  by (auto intro!: clamp_continuous_on simp: ext_cont_def)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65038
diff changeset
 11200
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
 11201
no_notation
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
 11202
  eucl_less (infix "<e" 50)
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 54489
diff changeset
 11203
33175
2083bde13ce1 distinguished session for multivariate analysis
himmelma
parents:
diff changeset
 11204
end