src/HOL/Multivariate_Analysis/Fashoda.thy
author wenzelm
Wed, 11 Sep 2013 20:34:45 +0200
changeset 53572 e7b77b217491
parent 51475 ebf9d4fd00ba
child 53627 f3fd9168911c
permissions -rw-r--r--
tuned proofs;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
     1
(*  Author:     John Harrison
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
     2
    Author:     Robert Himmelmann, TU Muenchen (translation from HOL light)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
     3
*)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
     4
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
     5
header {* Fashoda meet theorem *}
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
     6
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
     7
theory Fashoda
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
     8
imports Brouwer_Fixpoint Path_Connected Cartesian_Euclidean_Space
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
     9
begin
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    10
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    11
(* move *)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    12
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    13
lemma cart_eq_inner_axis: "a $ i = a \<bullet> axis i 1"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    14
  by (simp add: inner_axis)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    15
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    16
lemma axis_in_Basis: "a \<in> Basis \<Longrightarrow> axis i a \<in> Basis"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    17
  by (auto simp add: Basis_vec_def axis_eq_axis)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
    18
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    19
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    20
subsection {* Fashoda meet theorem *}
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    21
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    22
lemma infnorm_2:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    23
  fixes x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    24
  shows "infnorm x = max (abs (x$1)) (abs (x$2))"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    25
  unfolding infnorm_cart UNIV_2 by (rule cSup_eq) auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    26
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    27
lemma infnorm_eq_1_2:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    28
  fixes x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    29
  shows "infnorm x = 1 \<longleftrightarrow>
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    30
    abs (x$1) \<le> 1 \<and> abs (x$2) \<le> 1 \<and> (x$1 = -1 \<or> x$1 = 1 \<or> x$2 = -1 \<or> x$2 = 1)"
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    31
  unfolding infnorm_2 by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    32
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    33
lemma infnorm_eq_1_imp:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    34
  fixes x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    35
  assumes "infnorm x = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    36
  shows "abs (x$1) \<le> 1" and "abs (x$2) \<le> 1"
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    37
  using assms unfolding infnorm_eq_1_2 by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    38
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    39
lemma fashoda_unit:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    40
  fixes f g :: "real \<Rightarrow> real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    41
  assumes "f ` {- 1..1} \<subseteq> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    42
    and "g ` {- 1..1} \<subseteq> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    43
    and "continuous_on {- 1..1} f"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    44
    and "continuous_on {- 1..1} g"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    45
    and "f (- 1)$1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    46
    and "f 1$1 = 1" "g (- 1) $2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    47
    and "g 1 $2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    48
  shows "\<exists>s\<in>{- 1..1}. \<exists>t\<in>{- 1..1}. f s = g t"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    49
proof (rule ccontr)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    50
  assume "\<not> ?thesis"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    51
  note as = this[unfolded bex_simps,rule_format]
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    52
  def sqprojection \<equiv> "\<lambda>z::real^2. (inverse (infnorm z)) *\<^sub>R z" 
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    53
  def negatex \<equiv> "\<lambda>x::real^2. (vector [-(x$1), x$2])::real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    54
  have lem1: "\<forall>z::real^2. infnorm (negatex z) = infnorm z"
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    55
    unfolding negatex_def infnorm_2 vector_2 by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    56
  have lem2: "\<forall>z. z \<noteq> 0 \<longrightarrow> infnorm (sqprojection z) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    57
    unfolding sqprojection_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    58
    unfolding infnorm_mul[unfolded scalar_mult_eq_scaleR]
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    59
    unfolding abs_inverse real_abs_infnorm
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    60
    apply (subst infnorm_eq_0[THEN sym])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    61
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    62
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    63
  let ?F = "\<lambda>w::real^2. (f \<circ> (\<lambda>x. x$1)) w - (g \<circ> (\<lambda>x. x$2)) w"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    64
  have *: "\<And>i. (\<lambda>x::real^2. x $ i) ` {- 1..1} = {- 1..1::real}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    65
    apply (rule set_eqI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    66
    unfolding image_iff Bex_def mem_interval_cart
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    67
    apply rule
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    68
    defer
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    69
    apply (rule_tac x="vec x" in exI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    70
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    71
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    72
  {
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    73
    fix x
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    74
    assume "x \<in> (\<lambda>w. (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w) ` {- 1..1::real^2}"
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    75
    then guess w unfolding image_iff .. note w = this
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    76
    then have "x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    77
      using as[of "w$1" "w$2"]
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    78
      unfolding mem_interval_cart
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    79
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    80
  } note x0 = this
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    81
  have 21: "\<And>i::2. i \<noteq> 1 \<Longrightarrow> i = 2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    82
    using UNIV_2 by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    83
  have 1: "{- 1<..<1::real^2} \<noteq> {}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    84
    unfolding interval_eq_empty_cart by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    85
  have 2: "continuous_on {- 1..1} (negatex \<circ> sqprojection \<circ> ?F)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    86
    apply (intro continuous_on_intros continuous_on_component)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    87
    unfolding *
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    88
    apply (rule assms)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    89
    apply (subst sqprojection_def)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    90
    apply (intro continuous_on_intros)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    91
    apply (simp add: infnorm_eq_0 x0)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    92
    apply (rule linear_continuous_on)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    93
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    94
    show "bounded_linear negatex"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    95
      apply (rule bounded_linearI')
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    96
      unfolding vec_eq_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    97
    proof (rule_tac[!] allI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    98
      fix i :: 2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    99
      fix x y :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   100
      fix c :: real
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   101
      show "negatex (x + y) $ i =
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   102
        (negatex x + negatex y) $ i" "negatex (c *\<^sub>R x) $ i = (c *\<^sub>R negatex x) $ i"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   103
        apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   104
        apply (case_tac[!] "i\<noteq>1")
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   105
        prefer 3
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   106
        apply (drule_tac[1-2] 21) 
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   107
        unfolding negatex_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   108
        apply (auto simp add:vector_2)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   109
        done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   110
    qed
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44531
diff changeset
   111
  qed
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   112
  have 3: "(negatex \<circ> sqprojection \<circ> ?F) ` {- 1..1} \<subseteq> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   113
    unfolding subset_eq
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   114
    apply rule
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   115
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   116
    case goal1
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   117
    then guess y unfolding image_iff .. note y=this
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   118
    have "?F y \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   119
      apply (rule x0)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   120
      using y(1)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   121
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   122
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   123
    then have *: "infnorm (sqprojection (?F y)) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   124
      unfolding y o_def by - (rule lem2[rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   125
    have "infnorm x = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   126
      unfolding *[THEN sym] y o_def by (rule lem1[rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   127
    then show "x \<in> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   128
      unfolding mem_interval_cart infnorm_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   129
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   130
      apply rule
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   131
    proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   132
      case goal1
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   133
      then show ?case
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   134
        apply (cases "i = 1")
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   135
        defer
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   136
        apply (drule 21)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   137
        apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   138
        done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   139
    qed
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   140
  qed
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   141
  guess x
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   142
    apply (rule brouwer_weak[of "{- 1..1::real^2}" "negatex \<circ> sqprojection \<circ> ?F"])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   143
    apply (rule compact_interval convex_interval)+ unfolding interior_closed_interval
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   144
    apply (rule 1 2 3)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   145
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   146
  note x=this
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   147
  have "?F x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   148
    apply (rule x0)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   149
    using x(1)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   150
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   151
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   152
  then have *: "infnorm (sqprojection (?F x)) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   153
    unfolding o_def by (rule lem2[rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   154
  have nx: "infnorm x = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   155
    apply (subst x(2)[THEN sym])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   156
    unfolding *[THEN sym] o_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   157
    apply (rule lem1[rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   158
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   159
  have "\<forall>x i. x \<noteq> 0 \<longrightarrow> (0 < (sqprojection x)$i \<longleftrightarrow> 0 < x$i)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   160
    and "\<forall>x i. x \<noteq> 0 \<longrightarrow> ((sqprojection x)$i < 0 \<longleftrightarrow> x$i < 0)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   161
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   162
    apply (rule_tac[!] allI impI)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   163
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   164
    fix x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   165
    fix i :: 2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   166
    assume x: "x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   167
    have "inverse (infnorm x) > 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   168
      using x[unfolded infnorm_pos_lt[THEN sym]] by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   169
    then show "(0 < sqprojection x $ i) = (0 < x $ i)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   170
      and "(sqprojection x $ i < 0) = (x $ i < 0)"
44282
f0de18b62d63 remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents: 44136
diff changeset
   171
      unfolding sqprojection_def vector_component_simps vector_scaleR_component real_scaleR_def
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   172
      unfolding zero_less_mult_iff mult_less_0_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   173
      by (auto simp add: field_simps)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   174
  qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   175
  note lem3 = this[rule_format]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   176
  have x1: "x $ 1 \<in> {- 1..1::real}" "x $ 2 \<in> {- 1..1::real}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   177
    using x(1) unfolding mem_interval_cart by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   178
  then have nz: "f (x $ 1) - g (x $ 2) \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   179
    unfolding right_minus_eq
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   180
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   181
    apply (rule as)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   182
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   183
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   184
  have "x $ 1 = -1 \<or> x $ 1 = 1 \<or> x $ 2 = -1 \<or> x $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   185
    using nx unfolding infnorm_eq_1_2 by auto 
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   186
  then show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   187
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   188
    fix P Q R S 
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   189
    presume "P \<or> Q \<or> R \<or> S"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   190
      and "P \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   191
      and "Q \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   192
      and "R \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   193
      and "S \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   194
    then show False by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   195
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   196
    assume as: "x$1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   197
    then have *: "f (x $ 1) $ 1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   198
      using assms(6) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   199
    have "sqprojection (f (x$1) - g (x$2)) $ 1 < 0"
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   200
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   201
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   202
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   203
    moreover
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   204
    from x1 have "g (x $ 2) \<in> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   205
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   206
      apply (rule assms(2)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   207
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   208
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   209
    ultimately show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   210
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart 
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   211
      apply (erule_tac x=1 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   212
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   213
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   214
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   215
    assume as: "x$1 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   216
    then have *: "f (x $ 1) $ 1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   217
      using assms(5) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   218
    have "sqprojection (f (x$1) - g (x$2)) $ 1 > 0"
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   219
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   220
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   221
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   222
    moreover
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   223
    from x1 have "g (x $ 2) \<in> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   224
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   225
      apply (rule assms(2)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   226
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   227
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   228
    ultimately show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   229
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart 
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   230
      apply (erule_tac x=1 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   231
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   232
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   233
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   234
    assume as: "x$2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   235
    then have *: "g (x $ 2) $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   236
      using assms(8) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   237
    have "sqprojection (f (x$1) - g (x$2)) $ 2 > 0"
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   238
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   239
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   240
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   241
    moreover
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   242
    from x1 have "f (x $ 1) \<in> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   243
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   244
      apply (rule assms(1)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   245
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   246
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   247
    ultimately show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   248
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   249
      apply (erule_tac x=2 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   250
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   251
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   252
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   253
    assume as: "x$2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   254
    then have *: "g (x $ 2) $ 2 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   255
      using assms(7) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   256
    have "sqprojection (f (x$1) - g (x$2)) $ 2 < 0"
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   257
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   258
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   259
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   260
    moreover
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   261
    from x1 have "f (x $ 1) \<in> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   262
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   263
      apply (rule assms(1)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   264
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   265
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   266
    ultimately show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   267
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   268
      apply (erule_tac x=2 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   269
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   270
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   271
  qed auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   272
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   273
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   274
lemma fashoda_unit_path:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   275
  fixes f g :: "real \<Rightarrow> real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   276
  assumes "path f"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   277
    and "path g"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   278
    and "path_image f \<subseteq> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   279
    and "path_image g \<subseteq> {- 1..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   280
    and "(pathstart f)$1 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   281
    and "(pathfinish f)$1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   282
    and "(pathstart g)$2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   283
    and "(pathfinish g)$2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   284
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   285
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   286
  note assms=assms[unfolded path_def pathstart_def pathfinish_def path_image_def]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   287
  def iscale \<equiv> "\<lambda>z::real. inverse 2 *\<^sub>R (z + 1)"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   288
  have isc: "iscale ` {- 1..1} \<subseteq> {0..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   289
    unfolding iscale_def by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   290
  have "\<exists>s\<in>{- 1..1}. \<exists>t\<in>{- 1..1}. (f \<circ> iscale) s = (g \<circ> iscale) t"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   291
  proof (rule fashoda_unit)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   292
    show "(f \<circ> iscale) ` {- 1..1} \<subseteq> {- 1..1}" "(g \<circ> iscale) ` {- 1..1} \<subseteq> {- 1..1}"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   293
      using isc and assms(3-4) unfolding image_compose by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   294
    have *: "continuous_on {- 1..1} iscale"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   295
      unfolding iscale_def by (rule continuous_on_intros)+
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   296
    show "continuous_on {- 1..1} (f \<circ> iscale)" "continuous_on {- 1..1} (g \<circ> iscale)"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   297
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   298
      apply (rule_tac[!] continuous_on_compose[OF *])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   299
      apply (rule_tac[!] continuous_on_subset[OF _ isc])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   300
      apply (rule assms)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   301
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   302
    have *: "(1 / 2) *\<^sub>R (1 + (1::real^1)) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   303
      unfolding vec_eq_iff by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   304
    show "(f \<circ> iscale) (- 1) $ 1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   305
      and "(f \<circ> iscale) 1 $ 1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   306
      and "(g \<circ> iscale) (- 1) $ 2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   307
      and "(g \<circ> iscale) 1 $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   308
      unfolding o_def iscale_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   309
      using assms
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   310
      by (auto simp add: *)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   311
  qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   312
  then guess s .. from this(2) guess t .. note st=this
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   313
  show thesis
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   314
    apply (rule_tac z="f (iscale s)" in that)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   315
    using st `s\<in>{- 1..1}`
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   316
    unfolding o_def path_image_def image_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   317
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   318
    apply (rule_tac x="iscale s" in bexI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   319
    prefer 3
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   320
    apply (rule_tac x="iscale t" in bexI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   321
    using isc[unfolded subset_eq, rule_format]
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   322
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   323
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   324
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   325
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   326
lemma fashoda: fixes b::"real^2"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   327
  assumes "path f" "path g" "path_image f \<subseteq> {a..b}" "path_image g \<subseteq> {a..b}"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   328
  "(pathstart f)$1 = a$1" "(pathfinish f)$1 = b$1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   329
  "(pathstart g)$2 = a$2" "(pathfinish g)$2 = b$2"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   330
  obtains z where "z \<in> path_image f" "z \<in> path_image g" proof-
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   331
  fix P Q S presume "P \<or> Q \<or> S" "P \<Longrightarrow> thesis" "Q \<Longrightarrow> thesis" "S \<Longrightarrow> thesis" thus thesis by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   332
next have "{a..b} \<noteq> {}" using assms(3) using path_image_nonempty by auto
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   333
  hence "a \<le> b" unfolding interval_eq_empty_cart less_eq_vec_def by(auto simp add: not_less)
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   334
  thus "a$1 = b$1 \<or> a$2 = b$2 \<or> (a$1 < b$1 \<and> a$2 < b$2)" unfolding less_eq_vec_def forall_2 by auto
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   335
next assume as:"a$1 = b$1" have "\<exists>z\<in>path_image g. z$2 = (pathstart f)$2" apply(rule connected_ivt_component_cart)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   336
    apply(rule connected_path_image assms)+apply(rule pathstart_in_path_image,rule pathfinish_in_path_image)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   337
    unfolding assms using assms(3)[unfolded path_image_def subset_eq,rule_format,of "f 0"]
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   338
    unfolding pathstart_def by(auto simp add: less_eq_vec_def) then guess z .. note z=this
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   339
  have "z \<in> {a..b}" using z(1) assms(4) unfolding path_image_def by blast 
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   340
  hence "z = f 0" unfolding vec_eq_iff forall_2 unfolding z(2) pathstart_def
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   341
    using assms(3)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "f 0" 1]
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   342
    unfolding mem_interval_cart apply(erule_tac x=1 in allE) using as by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   343
  thus thesis apply-apply(rule that[OF _ z(1)]) unfolding path_image_def by auto
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   344
next assume as:"a$2 = b$2" have "\<exists>z\<in>path_image f. z$1 = (pathstart g)$1" apply(rule connected_ivt_component_cart)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   345
    apply(rule connected_path_image assms)+apply(rule pathstart_in_path_image,rule pathfinish_in_path_image)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   346
    unfolding assms using assms(4)[unfolded path_image_def subset_eq,rule_format,of "g 0"]
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   347
    unfolding pathstart_def by(auto simp add: less_eq_vec_def) then guess z .. note z=this
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   348
  have "z \<in> {a..b}" using z(1) assms(3) unfolding path_image_def by blast 
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   349
  hence "z = g 0" unfolding vec_eq_iff forall_2 unfolding z(2) pathstart_def
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   350
    using assms(4)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "g 0" 2]
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   351
    unfolding mem_interval_cart apply(erule_tac x=2 in allE) using as by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   352
  thus thesis apply-apply(rule that[OF z(1)]) unfolding path_image_def by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   353
next assume as:"a $ 1 < b $ 1 \<and> a $ 2 < b $ 2"
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   354
  have int_nem:"{- 1..1::real^2} \<noteq> {}" unfolding interval_eq_empty_cart by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   355
  guess z apply(rule fashoda_unit_path[of "interval_bij (a,b) (- 1,1) \<circ> f" "interval_bij (a,b) (- 1,1) \<circ> g"]) 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   356
    unfolding path_def path_image_def pathstart_def pathfinish_def
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   357
    apply(rule_tac[1-2] continuous_on_compose) apply(rule assms[unfolded path_def] continuous_on_interval_bij)+
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   358
    unfolding subset_eq apply(rule_tac[1-2] ballI)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   359
  proof- fix x assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> f) ` {0..1}"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   360
    then guess y unfolding image_iff .. note y=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   361
    show "x \<in> {- 1..1}" unfolding y o_def apply(rule in_interval_interval_bij)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   362
      using y(1) using assms(3)[unfolded path_image_def subset_eq] int_nem by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   363
  next fix x assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> g) ` {0..1}"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   364
    then guess y unfolding image_iff .. note y=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   365
    show "x \<in> {- 1..1}" unfolding y o_def apply(rule in_interval_interval_bij)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   366
      using y(1) using assms(4)[unfolded path_image_def subset_eq] int_nem by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   367
  next show "(interval_bij (a, b) (- 1, 1) \<circ> f) 0 $ 1 = -1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   368
      "(interval_bij (a, b) (- 1, 1) \<circ> f) 1 $ 1 = 1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   369
      "(interval_bij (a, b) (- 1, 1) \<circ> g) 0 $ 2 = -1"
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   370
      "(interval_bij (a, b) (- 1, 1) \<circ> g) 1 $ 2 = 1"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
   371
      using assms as 
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
   372
      by (simp_all add: axis_in_Basis cart_eq_inner_axis pathstart_def pathfinish_def interval_bij_def)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
   373
         (simp_all add: inner_axis)
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
   374
  qed note z=this
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   375
  from z(1) guess zf unfolding image_iff .. note zf=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   376
  from z(2) guess zg unfolding image_iff .. note zg=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   377
  have *:"\<forall>i. (- 1) $ i < (1::real^2) $ i \<and> a $ i < b $ i" unfolding forall_2 using as by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   378
  show thesis apply(rule_tac z="interval_bij (- 1,1) (a,b) z" in that)
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   379
    apply(subst zf) defer apply(subst zg) unfolding o_def interval_bij_bij_cart[OF *] path_image_def
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   380
    using zf(1) zg(1) by auto qed
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   381
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   382
subsection {*Some slightly ad hoc lemmas I use below*}
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   383
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   384
lemma segment_vertical: fixes a::"real^2" assumes "a$1 = b$1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   385
  shows "x \<in> closed_segment a b \<longleftrightarrow> (x$1 = a$1 \<and> x$1 = b$1 \<and>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   386
           (a$2 \<le> x$2 \<and> x$2 \<le> b$2 \<or> b$2 \<le> x$2 \<and> x$2 \<le> a$2))" (is "_ = ?R")
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   387
proof- 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   388
  let ?L = "\<exists>u. (x $ 1 = (1 - u) * a $ 1 + u * b $ 1 \<and> x $ 2 = (1 - u) * a $ 2 + u * b $ 2) \<and> 0 \<le> u \<and> u \<le> 1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   389
  { presume "?L \<Longrightarrow> ?R" "?R \<Longrightarrow> ?L" thus ?thesis unfolding closed_segment_def mem_Collect_eq
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
   390
      unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[THEN sym] vector_component_simps by blast }
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   391
  { assume ?L then guess u apply-apply(erule exE)apply(erule conjE)+ . note u=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   392
    { fix b a assume "b + u * a > a + u * b"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   393
      hence "(1 - u) * b > (1 - u) * a" by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   394
      hence "b \<ge> a" apply(drule_tac mult_less_imp_less_left) using u by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   395
      hence "u * a \<le> u * b" apply-apply(rule mult_left_mono[OF _ u(3)]) 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   396
        using u(3-4) by(auto simp add:field_simps) } note * = this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   397
    { fix a b assume "u * b > u * a" hence "(1 - u) * a \<le> (1 - u) * b" apply-apply(rule mult_left_mono)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   398
        apply(drule mult_less_imp_less_left) using u by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   399
      hence "a + u * b \<le> b + u * a" by(auto simp add:field_simps) } note ** = this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   400
    thus ?R unfolding u assms using u by(auto simp add:field_simps not_le intro:* **) }
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   401
  { assume ?R thus ?L proof(cases "x$2 = b$2")
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   402
      case True thus ?L apply(rule_tac x="(x$2 - a$2) / (b$2 - a$2)" in exI) unfolding assms True
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   403
        using `?R` by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   404
    next case False thus ?L apply(rule_tac x="1 - (x$2 - b$2) / (a$2 - b$2)" in exI) unfolding assms using `?R`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   405
        by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   406
    qed } qed
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   407
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   408
lemma segment_horizontal: fixes a::"real^2" assumes "a$2 = b$2"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   409
  shows "x \<in> closed_segment a b \<longleftrightarrow> (x$2 = a$2 \<and> x$2 = b$2 \<and>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   410
           (a$1 \<le> x$1 \<and> x$1 \<le> b$1 \<or> b$1 \<le> x$1 \<and> x$1 \<le> a$1))" (is "_ = ?R")
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   411
proof- 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   412
  let ?L = "\<exists>u. (x $ 1 = (1 - u) * a $ 1 + u * b $ 1 \<and> x $ 2 = (1 - u) * a $ 2 + u * b $ 2) \<and> 0 \<le> u \<and> u \<le> 1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   413
  { presume "?L \<Longrightarrow> ?R" "?R \<Longrightarrow> ?L" thus ?thesis unfolding closed_segment_def mem_Collect_eq
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 44647
diff changeset
   414
      unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[THEN sym] vector_component_simps by blast }
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   415
  { assume ?L then guess u apply-apply(erule exE)apply(erule conjE)+ . note u=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   416
    { fix b a assume "b + u * a > a + u * b"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   417
      hence "(1 - u) * b > (1 - u) * a" by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   418
      hence "b \<ge> a" apply(drule_tac mult_less_imp_less_left) using u by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   419
      hence "u * a \<le> u * b" apply-apply(rule mult_left_mono[OF _ u(3)]) 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   420
        using u(3-4) by(auto simp add:field_simps) } note * = this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   421
    { fix a b assume "u * b > u * a" hence "(1 - u) * a \<le> (1 - u) * b" apply-apply(rule mult_left_mono)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   422
        apply(drule mult_less_imp_less_left) using u by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   423
      hence "a + u * b \<le> b + u * a" by(auto simp add:field_simps) } note ** = this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   424
    thus ?R unfolding u assms using u by(auto simp add:field_simps not_le intro:* **) }
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   425
  { assume ?R thus ?L proof(cases "x$1 = b$1")
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   426
      case True thus ?L apply(rule_tac x="(x$1 - a$1) / (b$1 - a$1)" in exI) unfolding assms True
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   427
        using `?R` by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   428
    next case False thus ?L apply(rule_tac x="1 - (x$1 - b$1) / (a$1 - b$1)" in exI) unfolding assms using `?R`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   429
        by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   430
    qed } qed
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   431
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   432
subsection {*useful Fashoda corollary pointed out to me by Tom Hales. *}
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   433
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   434
lemma fashoda_interlace: fixes a::"real^2"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   435
  assumes "path f" "path g"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   436
  "path_image f \<subseteq> {a..b}" "path_image g \<subseteq> {a..b}"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   437
  "(pathstart f)$2 = a$2" "(pathfinish f)$2 = a$2"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   438
  "(pathstart g)$2 = a$2" "(pathfinish g)$2 = a$2"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   439
  "(pathstart f)$1 < (pathstart g)$1" "(pathstart g)$1 < (pathfinish f)$1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   440
  "(pathfinish f)$1 < (pathfinish g)$1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   441
  obtains z where "z \<in> path_image f" "z \<in> path_image g"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   442
proof-
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   443
  have "{a..b} \<noteq> {}" using path_image_nonempty using assms(3) by auto
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   444
  note ab=this[unfolded interval_eq_empty_cart not_ex forall_2 not_less]
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   445
  have "pathstart f \<in> {a..b}" "pathfinish f \<in> {a..b}" "pathstart g \<in> {a..b}" "pathfinish g \<in> {a..b}"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   446
    using pathstart_in_path_image pathfinish_in_path_image using assms(3-4) by auto
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   447
  note startfin = this[unfolded mem_interval_cart forall_2]
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   448
  let ?P1 = "linepath (vector[a$1 - 2, a$2 - 2]) (vector[(pathstart f)$1,a$2 - 2]) +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   449
     linepath(vector[(pathstart f)$1,a$2 - 2])(pathstart f) +++ f +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   450
     linepath(pathfinish f)(vector[(pathfinish f)$1,a$2 - 2]) +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   451
     linepath(vector[(pathfinish f)$1,a$2 - 2])(vector[b$1 + 2,a$2 - 2])" 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   452
  let ?P2 = "linepath(vector[(pathstart g)$1, (pathstart g)$2 - 3])(pathstart g) +++ g +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   453
     linepath(pathfinish g)(vector[(pathfinish g)$1,a$2 - 1]) +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   454
     linepath(vector[(pathfinish g)$1,a$2 - 1])(vector[b$1 + 1,a$2 - 1]) +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   455
     linepath(vector[b$1 + 1,a$2 - 1])(vector[b$1 + 1,b$2 + 3])"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   456
  let ?a = "vector[a$1 - 2, a$2 - 3]"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   457
  let ?b = "vector[b$1 + 2, b$2 + 3]"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   458
  have P1P2:"path_image ?P1 = path_image (linepath (vector[a$1 - 2, a$2 - 2]) (vector[(pathstart f)$1,a$2 - 2])) \<union>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   459
      path_image (linepath(vector[(pathstart f)$1,a$2 - 2])(pathstart f)) \<union> path_image f \<union>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   460
      path_image (linepath(pathfinish f)(vector[(pathfinish f)$1,a$2 - 2])) \<union>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   461
      path_image (linepath(vector[(pathfinish f)$1,a$2 - 2])(vector[b$1 + 2,a$2 - 2]))"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   462
    "path_image ?P2 = path_image(linepath(vector[(pathstart g)$1, (pathstart g)$2 - 3])(pathstart g)) \<union> path_image g \<union>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   463
      path_image(linepath(pathfinish g)(vector[(pathfinish g)$1,a$2 - 1])) \<union>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   464
      path_image(linepath(vector[(pathfinish g)$1,a$2 - 1])(vector[b$1 + 1,a$2 - 1])) \<union>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   465
      path_image(linepath(vector[b$1 + 1,a$2 - 1])(vector[b$1 + 1,b$2 + 3]))" using assms(1-2)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   466
      by(auto simp add: path_image_join path_linepath)
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   467
  have abab: "{a..b} \<subseteq> {?a..?b}" by(auto simp add:less_eq_vec_def forall_2 vector_2)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   468
  guess z apply(rule fashoda[of ?P1 ?P2 ?a ?b])
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   469
    unfolding pathstart_join pathfinish_join pathstart_linepath pathfinish_linepath vector_2 proof-
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   470
    show "path ?P1" "path ?P2" using assms by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   471
    have "path_image ?P1 \<subseteq> {?a .. ?b}" unfolding P1P2 path_image_linepath apply(rule Un_least)+ defer 3
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   472
      apply(rule_tac[1-4] convex_interval(1)[unfolded convex_contains_segment,rule_format])
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   473
      unfolding mem_interval_cart forall_2 vector_2 using ab startfin abab assms(3)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   474
      using assms(9-) unfolding assms by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   475
    thus "path_image ?P1  \<subseteq> {?a .. ?b}" .
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   476
    have "path_image ?P2 \<subseteq> {?a .. ?b}" unfolding P1P2 path_image_linepath apply(rule Un_least)+ defer 2
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   477
      apply(rule_tac[1-4] convex_interval(1)[unfolded convex_contains_segment,rule_format])
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   478
      unfolding mem_interval_cart forall_2 vector_2 using ab startfin abab assms(4)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   479
      using assms(9-) unfolding assms  by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   480
    thus "path_image ?P2  \<subseteq> {?a .. ?b}" . 
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   481
    show "a $ 1 - 2 = a $ 1 - 2"  "b $ 1 + 2 = b $ 1 + 2" "pathstart g $ 2 - 3 = a $ 2 - 3"  "b $ 2 + 3 = b $ 2 + 3"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   482
      by(auto simp add: assms)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   483
  qed note z=this[unfolded P1P2 path_image_linepath]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   484
  show thesis apply(rule that[of z]) proof-
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   485
    have "(z \<in> closed_segment (vector [a $ 1 - 2, a $ 2 - 2]) (vector [pathstart f $ 1, a $ 2 - 2]) \<or>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   486
     z \<in> closed_segment (vector [pathstart f $ 1, a $ 2 - 2]) (pathstart f)) \<or>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   487
   z \<in> closed_segment (pathfinish f) (vector [pathfinish f $ 1, a $ 2 - 2]) \<or>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   488
  z \<in> closed_segment (vector [pathfinish f $ 1, a $ 2 - 2]) (vector [b $ 1 + 2, a $ 2 - 2]) \<Longrightarrow>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   489
  (((z \<in> closed_segment (vector [pathstart g $ 1, pathstart g $ 2 - 3]) (pathstart g)) \<or>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   490
    z \<in> closed_segment (pathfinish g) (vector [pathfinish g $ 1, a $ 2 - 1])) \<or>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   491
   z \<in> closed_segment (vector [pathfinish g $ 1, a $ 2 - 1]) (vector [b $ 1 + 1, a $ 2 - 1])) \<or>
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   492
  z \<in> closed_segment (vector [b $ 1 + 1, a $ 2 - 1]) (vector [b $ 1 + 1, b $ 2 + 3]) \<Longrightarrow> False"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   493
      apply(simp only: segment_vertical segment_horizontal vector_2) proof- case goal1 note as=this
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   494
      have "pathfinish f \<in> {a..b}" using assms(3) pathfinish_in_path_image[of f] by auto 
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   495
      hence "1 + b $ 1 \<le> pathfinish f $ 1 \<Longrightarrow> False" unfolding mem_interval_cart forall_2 by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   496
      hence "z$1 \<noteq> pathfinish f$1" using as(2) using assms ab by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   497
      moreover have "pathstart f \<in> {a..b}" using assms(3) pathstart_in_path_image[of f] by auto 
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   498
      hence "1 + b $ 1 \<le> pathstart f $ 1 \<Longrightarrow> False" unfolding mem_interval_cart forall_2 by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   499
      hence "z$1 \<noteq> pathstart f$1" using as(2) using assms ab by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   500
      ultimately have *:"z$2 = a$2 - 2" using goal1(1) by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   501
      have "z$1 \<noteq> pathfinish g$1" using as(2) using assms ab by(auto simp add:field_simps *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   502
      moreover have "pathstart g \<in> {a..b}" using assms(4) pathstart_in_path_image[of g] by auto 
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   503
      note this[unfolded mem_interval_cart forall_2]
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   504
      hence "z$1 \<noteq> pathstart g$1" using as(1) using assms ab by(auto simp add:field_simps *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   505
      ultimately have "a $ 2 - 1 \<le> z $ 2 \<and> z $ 2 \<le> b $ 2 + 3 \<or> b $ 2 + 3 \<le> z $ 2 \<and> z $ 2 \<le> a $ 2 - 1"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   506
        using as(2) unfolding * assms by(auto simp add:field_simps)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   507
      thus False unfolding * using ab by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   508
    qed hence "z \<in> path_image f \<or> z \<in> path_image g" using z unfolding Un_iff by blast
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   509
    hence z':"z\<in>{a..b}" using assms(3-4) by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   510
    have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart f $ 1 \<or> z $ 1 = pathfinish f $ 1) \<Longrightarrow> (z = pathstart f \<or> z = pathfinish f)"
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   511
      unfolding vec_eq_iff forall_2 assms by auto
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   512
    with z' show "z\<in>path_image f" using z(1) unfolding Un_iff mem_interval_cart forall_2 apply-
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   513
      apply(simp only: segment_vertical segment_horizontal vector_2) unfolding assms by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   514
    have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart g $ 1 \<or> z $ 1 = pathfinish g $ 1) \<Longrightarrow> (z = pathstart g \<or> z = pathfinish g)"
44136
e63ad7d5158d more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents: 41958
diff changeset
   515
      unfolding vec_eq_iff forall_2 assms by auto
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   516
    with z' show "z\<in>path_image g" using z(2) unfolding Un_iff mem_interval_cart forall_2 apply-
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   517
      apply(simp only: segment_vertical segment_horizontal vector_2) unfolding assms by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   518
  qed qed
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   519
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   520
(** The Following still needs to be translated. Maybe I will do that later.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   521
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   522
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   523
(* Complement in dimension N >= 2 of set homeomorphic to any interval in     *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   524
(* any dimension is (path-)connected. This naively generalizes the argument  *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   525
(* in Ryuji Maehara's paper "The Jordan curve theorem via the Brouwer        *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   526
(* fixed point theorem", American Mathematical Monthly 1984.                 *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   527
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   528
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   529
let RETRACTION_INJECTIVE_IMAGE_INTERVAL = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   530
 (`!p:real^M->real^N a b.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   531
        ~(interval[a,b] = {}) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   532
        p continuous_on interval[a,b] /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   533
        (!x y. x IN interval[a,b] /\ y IN interval[a,b] /\ p x = p y ==> x = y)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   534
        ==> ?f. f continuous_on (:real^N) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   535
                IMAGE f (:real^N) SUBSET (IMAGE p (interval[a,b])) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   536
                (!x. x IN (IMAGE p (interval[a,b])) ==> f x = x)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   537
  REPEAT STRIP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   538
  FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [INJECTIVE_ON_LEFT_INVERSE]) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   539
  DISCH_THEN(X_CHOOSE_TAC `q:real^N->real^M`) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   540
  SUBGOAL_THEN `(q:real^N->real^M) continuous_on
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   541
                (IMAGE p (interval[a:real^M,b]))`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   542
  ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   543
   [MATCH_MP_TAC CONTINUOUS_ON_INVERSE THEN ASM_REWRITE_TAC[COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   544
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   545
  MP_TAC(ISPECL [`q:real^N->real^M`;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   546
                 `IMAGE (p:real^M->real^N)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   547
                 (interval[a,b])`;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   548
                 `a:real^M`; `b:real^M`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   549
        TIETZE_CLOSED_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   550
  ASM_SIMP_TAC[COMPACT_INTERVAL; COMPACT_CONTINUOUS_IMAGE;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   551
               COMPACT_IMP_CLOSED] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   552
  ANTS_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   553
  DISCH_THEN(X_CHOOSE_THEN `r:real^N->real^M` STRIP_ASSUME_TAC) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   554
  EXISTS_TAC `(p:real^M->real^N) o (r:real^N->real^M)` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   555
  REWRITE_TAC[SUBSET; FORALL_IN_IMAGE; o_THM; IN_UNIV] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   556
  CONJ_TAC THENL [ALL_TAC; ASM SET_TAC[]] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   557
  MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN ASM_REWRITE_TAC[] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   558
  FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP(REWRITE_RULE[IMP_CONJ]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   559
        CONTINUOUS_ON_SUBSET)) THEN ASM SET_TAC[]);;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   560
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   561
let UNBOUNDED_PATH_COMPONENTS_COMPLEMENT_HOMEOMORPHIC_INTERVAL = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   562
 (`!s:real^N->bool a b:real^M.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   563
        s homeomorphic (interval[a,b])
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   564
        ==> !x. ~(x IN s) ==> ~bounded(path_component((:real^N) DIFF s) x)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   565
  REPEAT GEN_TAC THEN REWRITE_TAC[homeomorphic; homeomorphism] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   566
  REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   567
  MAP_EVERY X_GEN_TAC [`p':real^N->real^M`; `p:real^M->real^N`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   568
  DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   569
  SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   570
   `!x y. x IN interval[a,b] /\ y IN interval[a,b] /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   571
          (p:real^M->real^N) x = p y ==> x = y`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   572
  ASSUME_TAC THENL [ASM_MESON_TAC[]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   573
  FIRST_X_ASSUM(MP_TAC o funpow 4 CONJUNCT2) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   574
  DISCH_THEN(CONJUNCTS_THEN2 (SUBST1_TAC o SYM) ASSUME_TAC) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   575
  ASM_CASES_TAC `interval[a:real^M,b] = {}` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   576
  ASM_REWRITE_TAC[IMAGE_CLAUSES; DIFF_EMPTY; PATH_COMPONENT_UNIV;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   577
                  NOT_BOUNDED_UNIV] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   578
  ABBREV_TAC `s = (:real^N) DIFF (IMAGE p (interval[a:real^M,b]))` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   579
  X_GEN_TAC `c:real^N` THEN REPEAT STRIP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   580
  SUBGOAL_THEN `(c:real^N) IN s` ASSUME_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   581
  SUBGOAL_THEN `bounded((path_component s c) UNION
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   582
                        (IMAGE (p:real^M->real^N) (interval[a,b])))`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   583
  MP_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   584
   [ASM_SIMP_TAC[BOUNDED_UNION; COMPACT_IMP_BOUNDED; COMPACT_IMP_BOUNDED;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   585
                 COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   586
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   587
  DISCH_THEN(MP_TAC o SPEC `c:real^N` o MATCH_MP BOUNDED_SUBSET_BALL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   588
  REWRITE_TAC[UNION_SUBSET] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   589
  DISCH_THEN(X_CHOOSE_THEN `B:real` STRIP_ASSUME_TAC) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   590
  MP_TAC(ISPECL [`p:real^M->real^N`; `a:real^M`; `b:real^M`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   591
    RETRACTION_INJECTIVE_IMAGE_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   592
  ASM_REWRITE_TAC[SUBSET; IN_UNIV] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   593
  DISCH_THEN(X_CHOOSE_THEN `r:real^N->real^N` MP_TAC) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   594
  DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   595
   (CONJUNCTS_THEN2 MP_TAC ASSUME_TAC)) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   596
  REWRITE_TAC[FORALL_IN_IMAGE; IN_UNIV] THEN DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   597
  ABBREV_TAC `q = \z:real^N. if z IN path_component s c then r(z) else z` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   598
  SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   599
    `(q:real^N->real^N) continuous_on
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   600
     (closure(path_component s c) UNION ((:real^N) DIFF (path_component s c)))`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   601
  MP_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   602
   [EXPAND_TAC "q" THEN MATCH_MP_TAC CONTINUOUS_ON_CASES THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   603
    REWRITE_TAC[CLOSED_CLOSURE; CONTINUOUS_ON_ID; GSYM OPEN_CLOSED] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   604
    REPEAT CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   605
     [MATCH_MP_TAC OPEN_PATH_COMPONENT THEN EXPAND_TAC "s" THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   606
      ASM_SIMP_TAC[GSYM CLOSED_OPEN; COMPACT_IMP_CLOSED;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   607
                   COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   608
      ASM_MESON_TAC[CONTINUOUS_ON_SUBSET; SUBSET_UNIV];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   609
      ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   610
    X_GEN_TAC `z:real^N` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   611
    REWRITE_TAC[SET_RULE `~(z IN (s DIFF t) /\ z IN t)`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   612
    STRIP_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   613
    MP_TAC(ISPECL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   614
     [`path_component s (z:real^N)`; `path_component s (c:real^N)`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   615
     OPEN_INTER_CLOSURE_EQ_EMPTY) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   616
    ASM_REWRITE_TAC[GSYM DISJOINT; PATH_COMPONENT_DISJOINT] THEN ANTS_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   617
     [MATCH_MP_TAC OPEN_PATH_COMPONENT THEN EXPAND_TAC "s" THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   618
      ASM_SIMP_TAC[GSYM CLOSED_OPEN; COMPACT_IMP_CLOSED;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   619
                   COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   620
      REWRITE_TAC[DISJOINT; EXTENSION; IN_INTER; NOT_IN_EMPTY] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   621
      DISCH_THEN(MP_TAC o SPEC `z:real^N`) THEN ASM_REWRITE_TAC[] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   622
      GEN_REWRITE_TAC (LAND_CONV o ONCE_DEPTH_CONV) [IN] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   623
      REWRITE_TAC[PATH_COMPONENT_REFL_EQ] THEN ASM SET_TAC[]];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   624
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   625
  SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   626
   `closure(path_component s c) UNION ((:real^N) DIFF (path_component s c)) =
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   627
    (:real^N)`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   628
  SUBST1_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   629
   [MATCH_MP_TAC(SET_RULE `s SUBSET t ==> t UNION (UNIV DIFF s) = UNIV`) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   630
    REWRITE_TAC[CLOSURE_SUBSET];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   631
    DISCH_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   632
  MP_TAC(ISPECL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   633
   [`(\x. &2 % c - x) o
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   634
     (\x. c + B / norm(x - c) % (x - c)) o (q:real^N->real^N)`;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   635
    `cball(c:real^N,B)`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   636
    BROUWER) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   637
  REWRITE_TAC[NOT_IMP; GSYM CONJ_ASSOC; COMPACT_CBALL; CONVEX_CBALL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   638
  ASM_SIMP_TAC[CBALL_EQ_EMPTY; REAL_LT_IMP_LE; REAL_NOT_LT] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   639
  SUBGOAL_THEN `!x. ~((q:real^N->real^N) x = c)` ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   640
   [X_GEN_TAC `x:real^N` THEN EXPAND_TAC "q" THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   641
    REWRITE_TAC[NORM_EQ_0; VECTOR_SUB_EQ] THEN COND_CASES_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   642
    ASM SET_TAC[PATH_COMPONENT_REFL_EQ];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   643
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   644
  REPEAT CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   645
   [MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   646
    SIMP_TAC[CONTINUOUS_ON_SUB; CONTINUOUS_ON_ID; CONTINUOUS_ON_CONST] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   647
    MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   648
     [ASM_MESON_TAC[CONTINUOUS_ON_SUBSET; SUBSET_UNIV]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   649
    MATCH_MP_TAC CONTINUOUS_ON_ADD THEN REWRITE_TAC[CONTINUOUS_ON_CONST] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   650
    MATCH_MP_TAC CONTINUOUS_ON_MUL THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   651
    SIMP_TAC[CONTINUOUS_ON_SUB; CONTINUOUS_ON_ID; CONTINUOUS_ON_CONST] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   652
    REWRITE_TAC[o_DEF; real_div; LIFT_CMUL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   653
    MATCH_MP_TAC CONTINUOUS_ON_CMUL THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   654
    MATCH_MP_TAC(REWRITE_RULE[o_DEF] CONTINUOUS_ON_INV) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   655
    ASM_REWRITE_TAC[FORALL_IN_IMAGE; NORM_EQ_0; VECTOR_SUB_EQ] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   656
    SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   657
     `(\x:real^N. lift(norm(x - c))) = (lift o norm) o (\x. x - c)`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   658
    SUBST1_TAC THENL [REWRITE_TAC[o_DEF]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   659
    MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   660
    ASM_SIMP_TAC[CONTINUOUS_ON_SUB; CONTINUOUS_ON_ID; CONTINUOUS_ON_CONST;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   661
                 CONTINUOUS_ON_LIFT_NORM];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   662
    REWRITE_TAC[SUBSET; FORALL_IN_IMAGE; IN_CBALL; o_THM; dist] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   663
    X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   664
    REWRITE_TAC[VECTOR_ARITH `c - (&2 % c - (c + x)) = x`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   665
    REWRITE_TAC[NORM_MUL; REAL_ABS_DIV; REAL_ABS_NORM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   666
    ASM_SIMP_TAC[REAL_DIV_RMUL; NORM_EQ_0; VECTOR_SUB_EQ] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   667
    ASM_REAL_ARITH_TAC;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   668
    REWRITE_TAC[NOT_EXISTS_THM; TAUT `~(c /\ b) <=> c ==> ~b`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   669
    REWRITE_TAC[IN_CBALL; o_THM; dist] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   670
    X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   671
    REWRITE_TAC[VECTOR_ARITH `&2 % c - (c + x') = x <=> --x' = x - c`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   672
    ASM_CASES_TAC `(x:real^N) IN path_component s c` THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   673
     [MATCH_MP_TAC(NORM_ARITH `norm(y) < B /\ norm(x) = B ==> ~(--x = y)`) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   674
      REWRITE_TAC[NORM_MUL; REAL_ABS_DIV; REAL_ABS_NORM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   675
      ASM_SIMP_TAC[REAL_DIV_RMUL; NORM_EQ_0; VECTOR_SUB_EQ] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   676
      ASM_SIMP_TAC[REAL_ARITH `&0 < B ==> abs B = B`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   677
      UNDISCH_TAC `path_component s c SUBSET ball(c:real^N,B)` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   678
      REWRITE_TAC[SUBSET; IN_BALL] THEN ASM_MESON_TAC[dist; NORM_SUB];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   679
      EXPAND_TAC "q" THEN REWRITE_TAC[] THEN ASM_REWRITE_TAC[] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   680
      REWRITE_TAC[VECTOR_ARITH `--(c % x) = x <=> (&1 + c) % x = vec 0`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   681
      ASM_REWRITE_TAC[DE_MORGAN_THM; VECTOR_SUB_EQ; VECTOR_MUL_EQ_0] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   682
      SUBGOAL_THEN `~(x:real^N = c)` ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   683
       [ASM_MESON_TAC[PATH_COMPONENT_REFL; IN]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   684
      ASM_REWRITE_TAC[] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   685
      MATCH_MP_TAC(REAL_ARITH `&0 < x ==> ~(&1 + x = &0)`) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   686
      ASM_SIMP_TAC[REAL_LT_DIV; NORM_POS_LT; VECTOR_SUB_EQ]]]);;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   687
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   688
let PATH_CONNECTED_COMPLEMENT_HOMEOMORPHIC_INTERVAL = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   689
 (`!s:real^N->bool a b:real^M.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   690
        2 <= dimindex(:N) /\ s homeomorphic interval[a,b]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   691
        ==> path_connected((:real^N) DIFF s)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   692
  REPEAT STRIP_TAC THEN REWRITE_TAC[PATH_CONNECTED_IFF_PATH_COMPONENT] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   693
  FIRST_ASSUM(MP_TAC o MATCH_MP
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   694
    UNBOUNDED_PATH_COMPONENTS_COMPLEMENT_HOMEOMORPHIC_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   695
  ASM_REWRITE_TAC[SET_RULE `~(x IN s) <=> x IN (UNIV DIFF s)`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   696
  ABBREV_TAC `t = (:real^N) DIFF s` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   697
  DISCH_TAC THEN MAP_EVERY X_GEN_TAC [`x:real^N`; `y:real^N`] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   698
  STRIP_TAC THEN FIRST_ASSUM(MP_TAC o MATCH_MP HOMEOMORPHIC_COMPACTNESS) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   699
  REWRITE_TAC[COMPACT_INTERVAL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   700
  DISCH_THEN(MP_TAC o MATCH_MP COMPACT_IMP_BOUNDED) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   701
  REWRITE_TAC[BOUNDED_POS; LEFT_IMP_EXISTS_THM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   702
  X_GEN_TAC `B:real` THEN STRIP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   703
  SUBGOAL_THEN `(?u:real^N. u IN path_component t x /\ B < norm(u)) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   704
                (?v:real^N. v IN path_component t y /\ B < norm(v))`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   705
  STRIP_ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   706
   [ASM_MESON_TAC[BOUNDED_POS; REAL_NOT_LE]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   707
  MATCH_MP_TAC PATH_COMPONENT_TRANS THEN EXISTS_TAC `u:real^N` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   708
  CONJ_TAC THENL [ASM_MESON_TAC[IN]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   709
  MATCH_MP_TAC PATH_COMPONENT_SYM THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   710
  MATCH_MP_TAC PATH_COMPONENT_TRANS THEN EXISTS_TAC `v:real^N` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   711
  CONJ_TAC THENL [ASM_MESON_TAC[IN]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   712
  MATCH_MP_TAC PATH_COMPONENT_OF_SUBSET THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   713
  EXISTS_TAC `(:real^N) DIFF cball(vec 0,B)` THEN CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   714
   [EXPAND_TAC "t" THEN MATCH_MP_TAC(SET_RULE
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   715
     `s SUBSET t ==> (u DIFF t) SUBSET (u DIFF s)`) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   716
    ASM_REWRITE_TAC[SUBSET; IN_CBALL_0];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   717
    MP_TAC(ISPEC `cball(vec 0:real^N,B)`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   718
       PATH_CONNECTED_COMPLEMENT_BOUNDED_CONVEX) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   719
    ASM_REWRITE_TAC[BOUNDED_CBALL; CONVEX_CBALL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   720
    REWRITE_TAC[PATH_CONNECTED_IFF_PATH_COMPONENT] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   721
    DISCH_THEN MATCH_MP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   722
    ASM_REWRITE_TAC[IN_DIFF; IN_UNIV; IN_CBALL_0; REAL_NOT_LE]]);;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   723
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   724
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   725
(* In particular, apply all these to the special case of an arc.             *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   726
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   727
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   728
let RETRACTION_ARC = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   729
 (`!p. arc p
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   730
       ==> ?f. f continuous_on (:real^N) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   731
               IMAGE f (:real^N) SUBSET path_image p /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   732
               (!x. x IN path_image p ==> f x = x)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   733
  REWRITE_TAC[arc; path; path_image] THEN REPEAT STRIP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   734
  MATCH_MP_TAC RETRACTION_INJECTIVE_IMAGE_INTERVAL THEN
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36593
diff changeset
   735
  ASM_REWRITE_TAC[INTERVAL_EQ_EMPTY_CART_1; DROP_VEC; REAL_NOT_LT; REAL_POS]);;
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   736
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   737
let PATH_CONNECTED_ARC_COMPLEMENT = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   738
 (`!p. 2 <= dimindex(:N) /\ arc p
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   739
       ==> path_connected((:real^N) DIFF path_image p)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   740
  REWRITE_TAC[arc; path] THEN REPEAT STRIP_TAC THEN SIMP_TAC[path_image] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   741
  MP_TAC(ISPECL [`path_image p:real^N->bool`; `vec 0:real^1`; `vec 1:real^1`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   742
    PATH_CONNECTED_COMPLEMENT_HOMEOMORPHIC_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   743
  ASM_REWRITE_TAC[path_image] THEN DISCH_THEN MATCH_MP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   744
  ONCE_REWRITE_TAC[HOMEOMORPHIC_SYM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   745
  MATCH_MP_TAC HOMEOMORPHIC_COMPACT THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   746
  EXISTS_TAC `p:real^1->real^N` THEN ASM_REWRITE_TAC[COMPACT_INTERVAL]);;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   747
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   748
let CONNECTED_ARC_COMPLEMENT = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   749
 (`!p. 2 <= dimindex(:N) /\ arc p
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   750
       ==> connected((:real^N) DIFF path_image p)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   751
  SIMP_TAC[PATH_CONNECTED_ARC_COMPLEMENT; PATH_CONNECTED_IMP_CONNECTED]);; *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   752
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   753
end