src/HOL/Analysis/Fashoda_Theorem.thy
author nipkow
Mon, 17 Oct 2016 11:46:22 +0200
changeset 64267 b9a1486e79be
parent 63627 6ddb43c6b711
child 67673 c8caefb20564
permissions -rw-r--r--
setsum -> sum
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
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
     5
section \<open>Fashoda meet theorem\<close>
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
     6
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
     7
theory Fashoda_Theorem
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
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
    11
subsection \<open>Bijections between intervals.\<close>
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    12
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    13
definition interval_bij :: "'a \<times> 'a \<Rightarrow> 'a \<times> 'a \<Rightarrow> 'a \<Rightarrow> 'a::euclidean_space"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    14
  where "interval_bij =
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    15
    (\<lambda>(a, b) (u, v) x. (\<Sum>i\<in>Basis. (u\<bullet>i + (x\<bullet>i - a\<bullet>i) / (b\<bullet>i - a\<bullet>i) * (v\<bullet>i - u\<bullet>i)) *\<^sub>R i))"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    16
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    17
lemma interval_bij_affine:
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    18
  "interval_bij (a,b) (u,v) = (\<lambda>x. (\<Sum>i\<in>Basis. ((v\<bullet>i - u\<bullet>i) / (b\<bullet>i - a\<bullet>i) * (x\<bullet>i)) *\<^sub>R i) +
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    19
    (\<Sum>i\<in>Basis. (u\<bullet>i - (v\<bullet>i - u\<bullet>i) / (b\<bullet>i - a\<bullet>i) * (a\<bullet>i)) *\<^sub>R i))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63627
diff changeset
    20
  by (auto simp: sum.distrib[symmetric] scaleR_add_left[symmetric] interval_bij_def fun_eq_iff
b9a1486e79be setsum -> sum
nipkow
parents: 63627
diff changeset
    21
    field_simps inner_simps add_divide_distrib[symmetric] intro!: sum.cong)
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    22
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    23
lemma continuous_interval_bij:
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    24
  fixes a b :: "'a::euclidean_space"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    25
  shows "continuous (at x) (interval_bij (a, b) (u, v))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63627
diff changeset
    26
  by (auto simp add: divide_inverse interval_bij_def intro!: continuous_sum continuous_intros)
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    27
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    28
lemma continuous_on_interval_bij: "continuous_on s (interval_bij (a, b) (u, v))"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    29
  apply(rule continuous_at_imp_continuous_on)
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    30
  apply (rule, rule continuous_interval_bij)
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    31
  done
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    32
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    33
lemma in_interval_interval_bij:
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    34
  fixes a b u v x :: "'a::euclidean_space"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    35
  assumes "x \<in> cbox a b"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    36
    and "cbox u v \<noteq> {}"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    37
  shows "interval_bij (a, b) (u, v) x \<in> cbox u v"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63627
diff changeset
    38
  apply (simp only: interval_bij_def split_conv mem_box inner_sum_left_Basis cong: ball_cong)
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    39
  apply safe
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    40
proof -
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    41
  fix i :: 'a
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    42
  assume i: "i \<in> Basis"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    43
  have "cbox a b \<noteq> {}"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    44
    using assms by auto
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    45
  with i have *: "a\<bullet>i \<le> b\<bullet>i" "u\<bullet>i \<le> v\<bullet>i"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    46
    using assms(2) by (auto simp add: box_eq_empty)
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    47
  have x: "a\<bullet>i\<le>x\<bullet>i" "x\<bullet>i\<le>b\<bullet>i"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    48
    using assms(1)[unfolded mem_box] using i by auto
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    49
  have "0 \<le> (x \<bullet> i - a \<bullet> i) / (b \<bullet> i - a \<bullet> i) * (v \<bullet> i - u \<bullet> i)"
56571
f4635657d66f added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents: 56371
diff changeset
    50
    using * x by auto
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    51
  then show "u \<bullet> i \<le> u \<bullet> i + (x \<bullet> i - a \<bullet> i) / (b \<bullet> i - a \<bullet> i) * (v \<bullet> i - u \<bullet> i)"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    52
    using * by auto
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    53
  have "((x \<bullet> i - a \<bullet> i) / (b \<bullet> i - a \<bullet> i)) * (v \<bullet> i - u \<bullet> i) \<le> 1 * (v \<bullet> i - u \<bullet> i)"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    54
    apply (rule mult_right_mono)
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    55
    unfolding divide_le_eq_1
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    56
    using * x
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    57
    apply auto
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    58
    done
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    59
  then show "u \<bullet> i + (x \<bullet> i - a \<bullet> i) / (b \<bullet> i - a \<bullet> i) * (v \<bullet> i - u \<bullet> i) \<le> v \<bullet> i"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    60
    using * by auto
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    61
qed
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    62
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    63
lemma interval_bij_bij:
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    64
  "\<forall>(i::'a::euclidean_space)\<in>Basis. a\<bullet>i < b\<bullet>i \<and> u\<bullet>i < v\<bullet>i \<Longrightarrow>
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    65
    interval_bij (a, b) (u, v) (interval_bij (u, v) (a, b) x) = x"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    66
  by (auto simp: interval_bij_def euclidean_eq_iff[where 'a='a])
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    67
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
    68
lemma interval_bij_bij_cart: fixes x::"real^'n" assumes "\<forall>i. a$i < b$i \<and> u$i < v$i"
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    69
  shows "interval_bij (a,b) (u,v) (interval_bij (u,v) (a,b) x) = x"
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    70
  using assms by (intro interval_bij_bij) (auto simp: Basis_vec_def inner_axis)
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    71
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    72
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
    73
subsection \<open>Fashoda meet theorem\<close>
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    74
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    75
lemma infnorm_2:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    76
  fixes x :: "real^2"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61167
diff changeset
    77
  shows "infnorm x = max \<bar>x$1\<bar> \<bar>x$2\<bar>"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    78
  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
    79
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    80
lemma infnorm_eq_1_2:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    81
  fixes x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    82
  shows "infnorm x = 1 \<longleftrightarrow>
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61167
diff changeset
    83
    \<bar>x$1\<bar> \<le> 1 \<and> \<bar>x$2\<bar> \<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
    84
  unfolding infnorm_2 by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    85
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    86
lemma infnorm_eq_1_imp:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    87
  fixes x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    88
  assumes "infnorm x = 1"
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61167
diff changeset
    89
  shows "\<bar>x$1\<bar> \<le> 1" and "\<bar>x$2\<bar> \<le> 1"
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    90
  using assms unfolding infnorm_eq_1_2 by auto
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
    91
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    92
lemma fashoda_unit:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    93
  fixes f g :: "real \<Rightarrow> real^2"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
    94
  assumes "f ` {-1 .. 1} \<subseteq> cbox (-1) 1"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
    95
    and "g ` {-1 .. 1} \<subseteq> cbox (-1) 1"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
    96
    and "continuous_on {-1 .. 1} f"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
    97
    and "continuous_on {-1 .. 1} g"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    98
    and "f (- 1)$1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
    99
    and "f 1$1 = 1" "g (- 1) $2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   100
    and "g 1 $2 = 1"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   101
  shows "\<exists>s\<in>{-1 .. 1}. \<exists>t\<in>{-1 .. 1}. f s = g t"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   102
proof (rule ccontr)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   103
  assume "\<not> ?thesis"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   104
  note as = this[unfolded bex_simps,rule_format]
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62397
diff changeset
   105
  define sqprojection
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62397
diff changeset
   106
    where [abs_def]: "sqprojection z = (inverse (infnorm z)) *\<^sub>R z" for z :: "real^2"
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62397
diff changeset
   107
  define negatex :: "real^2 \<Rightarrow> real^2"
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62397
diff changeset
   108
    where "negatex x = (vector [-(x$1), x$2])" for x
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   109
  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
   110
    unfolding negatex_def infnorm_2 vector_2 by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   111
  have lem2: "\<forall>z. z \<noteq> 0 \<longrightarrow> infnorm (sqprojection z) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   112
    unfolding sqprojection_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   113
    unfolding infnorm_mul[unfolded scalar_mult_eq_scaleR]
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   114
    unfolding abs_inverse real_abs_infnorm
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   115
    apply (subst infnorm_eq_0[symmetric])
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   116
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   117
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   118
  let ?F = "\<lambda>w::real^2. (f \<circ> (\<lambda>x. x$1)) w - (g \<circ> (\<lambda>x. x$2)) w"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   119
  have *: "\<And>i. (\<lambda>x::real^2. x $ i) ` cbox (- 1) 1 = {-1 .. 1}"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   120
    apply (rule set_eqI)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   121
    unfolding image_iff Bex_def mem_interval_cart interval_cbox_cart
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   122
    apply rule
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   123
    defer
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   124
    apply (rule_tac x="vec x" in exI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   125
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   126
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   127
  {
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   128
    fix x
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   129
    assume "x \<in> (\<lambda>w. (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w) ` (cbox (- 1) (1::real^2))"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   130
    then obtain w :: "real^2" where w:
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   131
        "w \<in> cbox (- 1) 1"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   132
        "x = (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   133
      unfolding image_iff ..
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   134
    then have "x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   135
      using as[of "w$1" "w$2"]
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   136
      unfolding mem_interval_cart atLeastAtMost_iff
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   137
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   138
  } note x0 = this
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   139
  have 21: "\<And>i::2. i \<noteq> 1 \<Longrightarrow> i = 2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   140
    using UNIV_2 by auto
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 53628
diff changeset
   141
  have 1: "box (- 1) (1::real^2) \<noteq> {}"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   142
    unfolding interval_eq_empty_cart by auto
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   143
  have 2: "continuous_on (cbox (- 1) 1) (negatex \<circ> sqprojection \<circ> ?F)"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56273
diff changeset
   144
    apply (intro continuous_intros continuous_on_component)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   145
    unfolding *
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   146
    apply (rule assms)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   147
    apply (subst sqprojection_def)
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56273
diff changeset
   148
    apply (intro continuous_intros)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   149
    apply (simp add: infnorm_eq_0 x0)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   150
    apply (rule linear_continuous_on)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   151
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   152
    show "bounded_linear negatex"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   153
      apply (rule bounded_linearI')
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   154
      unfolding vec_eq_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   155
    proof (rule_tac[!] allI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   156
      fix i :: 2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   157
      fix x y :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   158
      fix c :: real
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   159
      show "negatex (x + y) $ i =
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   160
        (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
   161
        apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   162
        apply (case_tac[!] "i\<noteq>1")
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   163
        prefer 3
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   164
        apply (drule_tac[1-2] 21)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   165
        unfolding negatex_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   166
        apply (auto simp add:vector_2)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   167
        done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   168
    qed
44647
e4de7750cdeb modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents: 44531
diff changeset
   169
  qed
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   170
  have 3: "(negatex \<circ> sqprojection \<circ> ?F) ` cbox (-1) 1 \<subseteq> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   171
    unfolding subset_eq
61166
5976fe402824 renamed method "goals" to "goal_cases" to emphasize its meaning;
wenzelm
parents: 61165
diff changeset
   172
  proof (rule, goal_cases)
61165
8020249565fb tuned proofs;
wenzelm
parents: 60420
diff changeset
   173
    case (1 x)
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   174
    then obtain y :: "real^2" where y:
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   175
        "y \<in> cbox (- 1) 1"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   176
        "x = (negatex \<circ> sqprojection \<circ> (\<lambda>w. (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w)) y"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   177
      unfolding image_iff ..
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   178
    have "?F y \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   179
      apply (rule x0)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   180
      using y(1)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   181
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   182
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   183
    then have *: "infnorm (sqprojection (?F y)) = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   184
      unfolding y o_def
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   185
      by - (rule lem2[rule_format])
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   186
    have "infnorm x = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   187
      unfolding *[symmetric] y o_def
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   188
      by (rule lem1[rule_format])
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   189
    then show "x \<in> cbox (-1) 1"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   190
      unfolding mem_interval_cart interval_cbox_cart infnorm_2
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   191
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   192
      apply rule
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   193
    proof -
61165
8020249565fb tuned proofs;
wenzelm
parents: 60420
diff changeset
   194
      fix i
8020249565fb tuned proofs;
wenzelm
parents: 60420
diff changeset
   195
      assume "max \<bar>x $ 1\<bar> \<bar>x $ 2\<bar> = 1"
8020249565fb tuned proofs;
wenzelm
parents: 60420
diff changeset
   196
      then show "(- 1) $ i \<le> x $ i \<and> x $ i \<le> 1 $ i"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   197
        apply (cases "i = 1")
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   198
        defer
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   199
        apply (drule 21)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   200
        apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   201
        done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   202
    qed
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   203
  qed
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   204
  obtain x :: "real^2" where x:
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   205
      "x \<in> cbox (- 1) 1"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   206
      "(negatex \<circ> sqprojection \<circ> (\<lambda>w. (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w)) x = x"
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   207
    apply (rule brouwer_weak[of "cbox (- 1) (1::real^2)" "negatex \<circ> sqprojection \<circ> ?F"])
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   208
    apply (rule compact_cbox convex_box)+
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   209
    unfolding interior_cbox
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   210
    apply (rule 1 2 3)+
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   211
    apply blast
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   212
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   213
  have "?F x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   214
    apply (rule x0)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   215
    using x(1)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   216
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   217
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   218
  then have *: "infnorm (sqprojection (?F x)) = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   219
    unfolding o_def
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   220
    by (rule lem2[rule_format])
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   221
  have nx: "infnorm x = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   222
    apply (subst x(2)[symmetric])
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   223
    unfolding *[symmetric] o_def
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   224
    apply (rule lem1[rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   225
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   226
  have "\<forall>x i. x \<noteq> 0 \<longrightarrow> (0 < (sqprojection x)$i \<longleftrightarrow> 0 < x$i)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   227
    and "\<forall>x i. x \<noteq> 0 \<longrightarrow> ((sqprojection x)$i < 0 \<longleftrightarrow> x$i < 0)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   228
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   229
    apply (rule_tac[!] allI impI)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   230
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   231
    fix x :: "real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   232
    fix i :: 2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   233
    assume x: "x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   234
    have "inverse (infnorm x) > 0"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   235
      using x[unfolded infnorm_pos_lt[symmetric]] by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   236
    then show "(0 < sqprojection x $ i) = (0 < x $ i)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   237
      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
   238
      unfolding sqprojection_def vector_component_simps vector_scaleR_component real_scaleR_def
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   239
      unfolding zero_less_mult_iff mult_less_0_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   240
      by (auto simp add: field_simps)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   241
  qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   242
  note lem3 = this[rule_format]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   243
  have x1: "x $ 1 \<in> {- 1..1::real}" "x $ 2 \<in> {- 1..1::real}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   244
    using x(1) unfolding mem_interval_cart by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   245
  then have nz: "f (x $ 1) - g (x $ 2) \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   246
    unfolding right_minus_eq
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   247
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   248
    apply (rule as)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   249
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   250
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   251
  have "x $ 1 = -1 \<or> x $ 1 = 1 \<or> x $ 2 = -1 \<or> x $ 2 = 1"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   252
    using nx unfolding infnorm_eq_1_2 by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   253
  then show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   254
  proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   255
    fix P Q R S
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   256
    presume "P \<or> Q \<or> R \<or> S"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   257
      and "P \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   258
      and "Q \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   259
      and "R \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   260
      and "S \<Longrightarrow> False"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   261
    then show False by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   262
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   263
    assume as: "x$1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   264
    then have *: "f (x $ 1) $ 1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   265
      using assms(6) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   266
    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
   267
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   268
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   269
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   270
    moreover
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   271
    from x1 have "g (x $ 2) \<in> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   272
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   273
      apply (rule assms(2)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   274
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   275
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   276
    ultimately show False
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   277
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   278
      apply (erule_tac x=1 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   279
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   280
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   281
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   282
    assume as: "x$1 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   283
    then have *: "f (x $ 1) $ 1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   284
      using assms(5) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   285
    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
   286
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   287
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   288
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   289
    moreover
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   290
    from x1 have "g (x $ 2) \<in> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   291
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   292
      apply (rule assms(2)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   293
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   294
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   295
    ultimately show False
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   296
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   297
      apply (erule_tac x=1 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   298
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   299
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   300
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   301
    assume as: "x$2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   302
    then have *: "g (x $ 2) $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   303
      using assms(8) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   304
    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
   305
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   306
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   307
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   308
    moreover
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   309
    from x1 have "f (x $ 1) \<in> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   310
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   311
      apply (rule assms(1)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   312
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   313
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   314
    ultimately show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   315
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   316
      apply (erule_tac x=2 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   317
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   318
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   319
  next
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   320
    assume as: "x$2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   321
    then have *: "g (x $ 2) $ 2 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   322
      using assms(7) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   323
    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
   324
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]]
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   325
      unfolding as negatex_def vector_2
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   326
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   327
    moreover
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   328
    from x1 have "f (x $ 1) \<in> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   329
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   330
      apply (rule assms(1)[unfolded subset_eq,rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   331
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   332
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   333
    ultimately show False
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   334
      unfolding lem3[OF nz] vector_component_simps * mem_interval_cart
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   335
      apply (erule_tac x=2 in allE)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   336
      apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   337
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   338
  qed auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   339
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   340
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   341
lemma fashoda_unit_path:
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   342
  fixes f g :: "real \<Rightarrow> real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   343
  assumes "path f"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   344
    and "path g"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   345
    and "path_image f \<subseteq> cbox (-1) 1"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   346
    and "path_image g \<subseteq> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   347
    and "(pathstart f)$1 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   348
    and "(pathfinish f)$1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   349
    and "(pathstart g)$2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   350
    and "(pathfinish g)$2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   351
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   352
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   353
  note assms=assms[unfolded path_def pathstart_def pathfinish_def path_image_def]
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62397
diff changeset
   354
  define iscale where [abs_def]: "iscale z = inverse 2 *\<^sub>R (z + 1)" for z :: real
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   355
  have isc: "iscale ` {- 1..1} \<subseteq> {0..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   356
    unfolding iscale_def by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   357
  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
   358
  proof (rule fashoda_unit)
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   359
    show "(f \<circ> iscale) ` {- 1..1} \<subseteq> cbox (- 1) 1" "(g \<circ> iscale) ` {- 1..1} \<subseteq> cbox (- 1) 1"
56154
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 55675
diff changeset
   360
      using isc and assms(3-4) by (auto simp add: image_comp [symmetric])
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   361
    have *: "continuous_on {- 1..1} iscale"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56273
diff changeset
   362
      unfolding iscale_def by (rule continuous_intros)+
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   363
    show "continuous_on {- 1..1} (f \<circ> iscale)" "continuous_on {- 1..1} (g \<circ> iscale)"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   364
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   365
      apply (rule_tac[!] continuous_on_compose[OF *])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   366
      apply (rule_tac[!] continuous_on_subset[OF _ isc])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   367
      apply (rule assms)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   368
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   369
    have *: "(1 / 2) *\<^sub>R (1 + (1::real^1)) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   370
      unfolding vec_eq_iff by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   371
    show "(f \<circ> iscale) (- 1) $ 1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   372
      and "(f \<circ> iscale) 1 $ 1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   373
      and "(g \<circ> iscale) (- 1) $ 2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   374
      and "(g \<circ> iscale) 1 $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   375
      unfolding o_def iscale_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   376
      using assms
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   377
      by (auto simp add: *)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   378
  qed
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   379
  then obtain s t where st:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   380
      "s \<in> {- 1..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   381
      "t \<in> {- 1..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   382
      "(f \<circ> iscale) s = (g \<circ> iscale) t"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   383
    by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   384
  show thesis
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   385
    apply (rule_tac z = "f (iscale s)" in that)
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   386
    using st
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   387
    unfolding o_def path_image_def image_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   388
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   389
    apply (rule_tac x="iscale s" in bexI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   390
    prefer 3
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   391
    apply (rule_tac x="iscale t" in bexI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   392
    using isc[unfolded subset_eq, rule_format]
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   393
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   394
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   395
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   396
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   397
lemma fashoda:
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   398
  fixes b :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   399
  assumes "path f"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   400
    and "path g"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   401
    and "path_image f \<subseteq> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   402
    and "path_image g \<subseteq> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   403
    and "(pathstart f)$1 = a$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   404
    and "(pathfinish f)$1 = b$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   405
    and "(pathstart g)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   406
    and "(pathfinish g)$2 = b$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   407
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   408
proof -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   409
  fix P Q S
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   410
  presume "P \<or> Q \<or> S" "P \<Longrightarrow> thesis" and "Q \<Longrightarrow> thesis" and "S \<Longrightarrow> thesis"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   411
  then show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   412
    by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   413
next
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   414
  have "cbox a b \<noteq> {}"
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 53628
diff changeset
   415
    using assms(3) using path_image_nonempty[of f] by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   416
  then have "a \<le> b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   417
    unfolding interval_eq_empty_cart less_eq_vec_def by (auto simp add: not_less)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   418
  then show "a$1 = b$1 \<or> a$2 = b$2 \<or> (a$1 < b$1 \<and> a$2 < b$2)"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   419
    unfolding less_eq_vec_def forall_2 by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   420
next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   421
  assume as: "a$1 = b$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   422
  have "\<exists>z\<in>path_image g. z$2 = (pathstart f)$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   423
    apply (rule connected_ivt_component_cart)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   424
    apply (rule connected_path_image assms)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   425
    apply (rule pathstart_in_path_image)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   426
    apply (rule pathfinish_in_path_image)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   427
    unfolding assms using assms(3)[unfolded path_image_def subset_eq,rule_format,of "f 0"]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   428
    unfolding pathstart_def
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   429
    apply (auto simp add: less_eq_vec_def mem_interval_cart)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   430
    done
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   431
  then obtain z :: "real^2" where z: "z \<in> path_image g" "z $ 2 = pathstart f $ 2" ..
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   432
  have "z \<in> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   433
    using z(1) assms(4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   434
    unfolding path_image_def
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   435
    by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   436
  then have "z = f 0"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   437
    unfolding vec_eq_iff forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   438
    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
   439
    using assms(3)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "f 0" 1]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   440
    unfolding mem_interval_cart
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   441
    apply (erule_tac x=1 in allE)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   442
    using as
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   443
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   444
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   445
  then show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   446
    apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   447
    apply (rule that[OF _ z(1)])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   448
    unfolding path_image_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   449
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   450
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   451
next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   452
  assume as: "a$2 = b$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   453
  have "\<exists>z\<in>path_image f. z$1 = (pathstart g)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   454
    apply (rule connected_ivt_component_cart)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   455
    apply (rule connected_path_image assms)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   456
    apply (rule pathstart_in_path_image)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   457
    apply (rule pathfinish_in_path_image)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   458
    unfolding assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   459
    using assms(4)[unfolded path_image_def subset_eq,rule_format,of "g 0"]
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   460
    unfolding pathstart_def
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   461
    apply (auto simp add: less_eq_vec_def mem_interval_cart)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   462
    done
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   463
  then obtain z where z: "z \<in> path_image f" "z $ 1 = pathstart g $ 1" ..
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   464
  have "z \<in> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   465
    using z(1) assms(3)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   466
    unfolding path_image_def
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   467
    by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   468
  then have "z = g 0"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   469
    unfolding vec_eq_iff forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   470
    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
   471
    using assms(4)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "g 0" 2]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   472
    unfolding mem_interval_cart
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   473
    apply (erule_tac x=2 in allE)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   474
    using as
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   475
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   476
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   477
  then show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   478
    apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   479
    apply (rule that[OF z(1)])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   480
    unfolding path_image_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   481
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   482
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   483
next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   484
  assume as: "a $ 1 < b $ 1 \<and> a $ 2 < b $ 2"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   485
  have int_nem: "cbox (-1) (1::real^2) \<noteq> {}"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   486
    unfolding interval_eq_empty_cart by auto
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   487
  obtain z :: "real^2" where z:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   488
      "z \<in> (interval_bij (a, b) (- 1, 1) \<circ> f) ` {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   489
      "z \<in> (interval_bij (a, b) (- 1, 1) \<circ> g) ` {0..1}"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   490
    apply (rule fashoda_unit_path[of "interval_bij (a,b) (- 1,1) \<circ> f" "interval_bij (a,b) (- 1,1) \<circ> g"])
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   491
    unfolding path_def path_image_def pathstart_def pathfinish_def
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   492
    apply (rule_tac[1-2] continuous_on_compose)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   493
    apply (rule assms[unfolded path_def] continuous_on_interval_bij)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   494
    unfolding subset_eq
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   495
    apply(rule_tac[1-2] ballI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   496
  proof -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   497
    fix x
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   498
    assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> f) ` {0..1}"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   499
    then obtain y where y:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   500
        "y \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   501
        "x = (interval_bij (a, b) (- 1, 1) \<circ> f) y"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   502
      unfolding image_iff ..
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   503
    show "x \<in> cbox (- 1) 1"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   504
      unfolding y o_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   505
      apply (rule in_interval_interval_bij)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   506
      using y(1)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   507
      using assms(3)[unfolded path_image_def subset_eq] int_nem
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   508
      apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   509
      done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   510
  next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   511
    fix x
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   512
    assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> g) ` {0..1}"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   513
    then obtain y where y:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   514
        "y \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   515
        "x = (interval_bij (a, b) (- 1, 1) \<circ> g) y"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   516
      unfolding image_iff ..
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   517
    show "x \<in> cbox (- 1) 1"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   518
      unfolding y o_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   519
      apply (rule in_interval_interval_bij)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   520
      using y(1)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   521
      using assms(4)[unfolded path_image_def subset_eq] int_nem
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   522
      apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   523
      done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   524
  next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   525
    show "(interval_bij (a, b) (- 1, 1) \<circ> f) 0 $ 1 = -1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   526
      and "(interval_bij (a, b) (- 1, 1) \<circ> f) 1 $ 1 = 1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   527
      and "(interval_bij (a, b) (- 1, 1) \<circ> g) 0 $ 2 = -1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   528
      and "(interval_bij (a, b) (- 1, 1) \<circ> g) 1 $ 2 = 1"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   529
      using assms as
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
   530
      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
   531
         (simp_all add: inner_axis)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   532
  qed
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   533
  from z(1) obtain zf where zf:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   534
      "zf \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   535
      "z = (interval_bij (a, b) (- 1, 1) \<circ> f) zf"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   536
    unfolding image_iff ..
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   537
  from z(2) obtain zg where zg:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   538
      "zg \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   539
      "z = (interval_bij (a, b) (- 1, 1) \<circ> g) zg"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   540
    unfolding image_iff ..
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   541
  have *: "\<forall>i. (- 1) $ i < (1::real^2) $ i \<and> a $ i < b $ i"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   542
    unfolding forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   543
    using as
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   544
    by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   545
  show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   546
    apply (rule_tac z="interval_bij (- 1,1) (a,b) z" in that)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   547
    apply (subst zf)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   548
    defer
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   549
    apply (subst zg)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   550
    unfolding o_def interval_bij_bij_cart[OF *] path_image_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   551
    using zf(1) zg(1)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   552
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   553
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   554
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   555
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   556
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   557
subsection \<open>Some slightly ad hoc lemmas I use below\<close>
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   558
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   559
lemma segment_vertical:
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   560
  fixes a :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   561
  assumes "a$1 = b$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   562
  shows "x \<in> closed_segment a b \<longleftrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   563
    x$1 = a$1 \<and> x$1 = b$1 \<and> (a$2 \<le> x$2 \<and> x$2 \<le> b$2 \<or> b$2 \<le> x$2 \<and> x$2 \<le> a$2)"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   564
  (is "_ = ?R")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   565
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   566
  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"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   567
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   568
    presume "?L \<Longrightarrow> ?R" and "?R \<Longrightarrow> ?L"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   569
    then show ?thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   570
      unfolding closed_segment_def mem_Collect_eq
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   571
      unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[symmetric] vector_component_simps
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   572
      by blast
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   573
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   574
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   575
    assume ?L
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   576
    then obtain u where u:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   577
        "x $ 1 = (1 - u) * a $ 1 + u * b $ 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   578
        "x $ 2 = (1 - u) * a $ 2 + u * b $ 2"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   579
        "0 \<le> u"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   580
        "u \<le> 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   581
      by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   582
    { fix b a
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   583
      assume "b + u * a > a + u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   584
      then have "(1 - u) * b > (1 - u) * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   585
        by (auto simp add:field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   586
      then have "b \<ge> a"
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   587
        apply (drule_tac mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   588
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   589
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   590
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   591
      then have "u * a \<le> u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   592
        apply -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   593
        apply (rule mult_left_mono[OF _ u(3)])
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   594
        using u(3-4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   595
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   596
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   597
    } note * = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   598
    {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   599
      fix a b
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   600
      assume "u * b > u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   601
      then have "(1 - u) * a \<le> (1 - u) * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   602
        apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   603
        apply (rule mult_left_mono)
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   604
        apply (drule mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   605
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   606
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   607
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   608
      then have "a + u * b \<le> b + u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   609
        by (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   610
    } note ** = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   611
    then show ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   612
      unfolding u assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   613
      using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   614
      by (auto simp add:field_simps not_le intro: * **)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   615
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   616
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   617
    assume ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   618
    then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   619
    proof (cases "x$2 = b$2")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   620
      case True
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   621
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   622
        apply (rule_tac x="(x$2 - a$2) / (b$2 - a$2)" in exI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   623
        unfolding assms True
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   624
        using \<open>?R\<close>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   625
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   626
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   627
    next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   628
      case False
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   629
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   630
        apply (rule_tac x="1 - (x$2 - b$2) / (a$2 - b$2)" in exI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   631
        unfolding assms
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   632
        using \<open>?R\<close>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   633
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   634
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   635
    qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   636
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   637
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   638
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   639
lemma segment_horizontal:
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   640
  fixes a :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   641
  assumes "a$2 = b$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   642
  shows "x \<in> closed_segment a b \<longleftrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   643
    x$2 = a$2 \<and> x$2 = b$2 \<and> (a$1 \<le> x$1 \<and> x$1 \<le> b$1 \<or> b$1 \<le> x$1 \<and> x$1 \<le> a$1)"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   644
  (is "_ = ?R")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   645
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   646
  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"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   647
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   648
    presume "?L \<Longrightarrow> ?R" and "?R \<Longrightarrow> ?L"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   649
    then show ?thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   650
      unfolding closed_segment_def mem_Collect_eq
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   651
      unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[symmetric] vector_component_simps
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   652
      by blast
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   653
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   654
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   655
    assume ?L
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   656
    then obtain u where u:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   657
        "x $ 1 = (1 - u) * a $ 1 + u * b $ 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   658
        "x $ 2 = (1 - u) * a $ 2 + u * b $ 2"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   659
        "0 \<le> u"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   660
        "u \<le> 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   661
      by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   662
    {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   663
      fix b a
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   664
      assume "b + u * a > a + u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   665
      then have "(1 - u) * b > (1 - u) * a"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   666
        by (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   667
      then have "b \<ge> a"
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   668
        apply (drule_tac mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   669
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   670
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   671
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   672
      then have "u * a \<le> u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   673
        apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   674
        apply (rule mult_left_mono[OF _ u(3)])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   675
        using u(3-4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   676
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   677
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   678
    } note * = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   679
    {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   680
      fix a b
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   681
      assume "u * b > u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   682
      then have "(1 - u) * a \<le> (1 - u) * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   683
        apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   684
        apply (rule mult_left_mono)
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   685
        apply (drule mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   686
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   687
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   688
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   689
      then have "a + u * b \<le> b + u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   690
        by (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   691
    } note ** = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   692
    then show ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   693
      unfolding u assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   694
      using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   695
      by (auto simp add: field_simps not_le intro: * **)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   696
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   697
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   698
    assume ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   699
    then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   700
    proof (cases "x$1 = b$1")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   701
      case True
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   702
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   703
        apply (rule_tac x="(x$1 - a$1) / (b$1 - a$1)" in exI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   704
        unfolding assms True
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   705
        using \<open>?R\<close>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   706
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   707
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   708
    next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   709
      case False
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   710
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   711
        apply (rule_tac x="1 - (x$1 - b$1) / (a$1 - b$1)" in exI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   712
        unfolding assms
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   713
        using \<open>?R\<close>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   714
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   715
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   716
    qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   717
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   718
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   719
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   720
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   721
subsection \<open>Useful Fashoda corollary pointed out to me by Tom Hales\<close>
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   722
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   723
lemma fashoda_interlace:
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   724
  fixes a :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   725
  assumes "path f"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   726
    and "path g"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   727
    and "path_image f \<subseteq> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   728
    and "path_image g \<subseteq> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   729
    and "(pathstart f)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   730
    and "(pathfinish f)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   731
    and "(pathstart g)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   732
    and "(pathfinish g)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   733
    and "(pathstart f)$1 < (pathstart g)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   734
    and "(pathstart g)$1 < (pathfinish f)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   735
    and "(pathfinish f)$1 < (pathfinish g)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   736
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   737
proof -
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   738
  have "cbox a b \<noteq> {}"
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 53628
diff changeset
   739
    using path_image_nonempty[of f] 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
   740
  note ab=this[unfolded interval_eq_empty_cart not_ex forall_2 not_less]
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   741
  have "pathstart f \<in> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   742
    and "pathfinish f \<in> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   743
    and "pathstart g \<in> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   744
    and "pathfinish g \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   745
    using pathstart_in_path_image pathfinish_in_path_image
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   746
    using assms(3-4)
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   747
    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
   748
  note startfin = this[unfolded mem_interval_cart forall_2]
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   749
  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
   750
     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
   751
     linepath(pathfinish f)(vector[(pathfinish f)$1,a$2 - 2]) +++
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   752
     linepath(vector[(pathfinish f)$1,a$2 - 2])(vector[b$1 + 2,a$2 - 2])"
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   753
  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
   754
     linepath(pathfinish g)(vector[(pathfinish g)$1,a$2 - 1]) +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   755
     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
   756
     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
   757
  let ?a = "vector[a$1 - 2, a$2 - 3]"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   758
  let ?b = "vector[b$1 + 2, b$2 + 3]"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   759
  have P1P2: "path_image ?P1 = path_image (linepath (vector[a$1 - 2, a$2 - 2]) (vector[(pathstart f)$1,a$2 - 2])) \<union>
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   760
      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
   761
      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
   762
      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
   763
    "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
   764
      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
   765
      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
   766
      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
   767
      by(auto simp add: path_image_join path_linepath)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   768
  have abab: "cbox a b \<subseteq> cbox ?a ?b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   769
    unfolding interval_cbox_cart[symmetric]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   770
    by (auto simp add:less_eq_vec_def forall_2 vector_2)
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   771
  obtain z where
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   772
    "z \<in> path_image
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   773
          (linepath (vector [a $ 1 - 2, a $ 2 - 2]) (vector [pathstart f $ 1, a $ 2 - 2]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   774
           linepath (vector [pathstart f $ 1, a $ 2 - 2]) (pathstart f) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   775
           f +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   776
           linepath (pathfinish f) (vector [pathfinish f $ 1, a $ 2 - 2]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   777
           linepath (vector [pathfinish f $ 1, a $ 2 - 2]) (vector [b $ 1 + 2, a $ 2 - 2]))"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   778
    "z \<in> path_image
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   779
          (linepath (vector [pathstart g $ 1, pathstart g $ 2 - 3]) (pathstart g) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   780
           g +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   781
           linepath (pathfinish g) (vector [pathfinish g $ 1, a $ 2 - 1]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   782
           linepath (vector [pathfinish g $ 1, a $ 2 - 1]) (vector [b $ 1 + 1, a $ 2 - 1]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   783
           linepath (vector [b $ 1 + 1, a $ 2 - 1]) (vector [b $ 1 + 1, b $ 2 + 3]))"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   784
    apply (rule fashoda[of ?P1 ?P2 ?a ?b])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   785
    unfolding pathstart_join pathfinish_join pathstart_linepath pathfinish_linepath vector_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   786
  proof -
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   787
    show "path ?P1" and "path ?P2"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   788
      using assms by auto
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   789
    have "path_image ?P1 \<subseteq> cbox ?a ?b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   790
      unfolding P1P2 path_image_linepath
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   791
      apply (rule Un_least)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   792
      defer 3
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   793
      apply (rule_tac[1-4] convex_box(1)[unfolded convex_contains_segment,rule_format])
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   794
      unfolding mem_interval_cart forall_2 vector_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   795
      using ab startfin abab assms(3)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   796
      using assms(9-)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   797
      unfolding assms
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
   798
      apply (auto simp add: field_simps box_def)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   799
      done
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   800
    then show "path_image ?P1 \<subseteq> cbox ?a ?b" .
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   801
    have "path_image ?P2 \<subseteq> cbox ?a ?b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   802
      unfolding P1P2 path_image_linepath
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   803
      apply (rule Un_least)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   804
      defer 2
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   805
      apply (rule_tac[1-4] convex_box(1)[unfolded convex_contains_segment,rule_format])
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   806
      unfolding mem_interval_cart forall_2 vector_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   807
      using ab startfin abab assms(4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   808
      using assms(9-)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   809
      unfolding assms
56189
c4daa97ac57a removed dependencies on theory Ordered_Euclidean_Space
immler
parents: 56188
diff changeset
   810
      apply (auto simp add: field_simps box_def)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   811
      done
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   812
    then show "path_image ?P2 \<subseteq> cbox ?a ?b" .
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   813
    show "a $ 1 - 2 = a $ 1 - 2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   814
      and "b $ 1 + 2 = b $ 1 + 2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   815
      and "pathstart g $ 2 - 3 = a $ 2 - 3"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   816
      and "b $ 2 + 3 = b $ 2 + 3"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   817
      by (auto simp add: assms)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   818
  qed
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   819
  note z=this[unfolded P1P2 path_image_linepath]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   820
  show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   821
    apply (rule that[of z])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   822
  proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   823
    have "(z \<in> closed_segment (vector [a $ 1 - 2, a $ 2 - 2]) (vector [pathstart f $ 1, a $ 2 - 2]) \<or>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   824
      z \<in> closed_segment (vector [pathstart f $ 1, a $ 2 - 2]) (pathstart f)) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   825
      z \<in> closed_segment (pathfinish f) (vector [pathfinish f $ 1, a $ 2 - 2]) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   826
      z \<in> closed_segment (vector [pathfinish f $ 1, a $ 2 - 2]) (vector [b $ 1 + 2, a $ 2 - 2]) \<Longrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   827
    (((z \<in> closed_segment (vector [pathstart g $ 1, pathstart g $ 2 - 3]) (pathstart g)) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   828
      z \<in> closed_segment (pathfinish g) (vector [pathfinish g $ 1, a $ 2 - 1])) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   829
      z \<in> closed_segment (vector [pathfinish g $ 1, a $ 2 - 1]) (vector [b $ 1 + 1, a $ 2 - 1])) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   830
      z \<in> closed_segment (vector [b $ 1 + 1, a $ 2 - 1]) (vector [b $ 1 + 1, b $ 2 + 3]) \<Longrightarrow> False"
61166
5976fe402824 renamed method "goals" to "goal_cases" to emphasize its meaning;
wenzelm
parents: 61165
diff changeset
   831
    proof (simp only: segment_vertical segment_horizontal vector_2, goal_cases)
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   832
      case prems: 1
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   833
      have "pathfinish f \<in> cbox a b"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   834
        using assms(3) pathfinish_in_path_image[of f] by auto
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   835
      then have "1 + b $ 1 \<le> pathfinish f $ 1 \<Longrightarrow> False"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   836
        unfolding mem_interval_cart forall_2 by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   837
      then have "z$1 \<noteq> pathfinish f$1"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   838
        using prems(2)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   839
        using assms ab
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   840
        by (auto simp add: field_simps)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   841
      moreover have "pathstart f \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   842
        using assms(3) pathstart_in_path_image[of f]
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   843
        by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   844
      then have "1 + b $ 1 \<le> pathstart f $ 1 \<Longrightarrow> False"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   845
        unfolding mem_interval_cart forall_2
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   846
        by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   847
      then have "z$1 \<noteq> pathstart f$1"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   848
        using prems(2) using assms ab
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   849
        by (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   850
      ultimately have *: "z$2 = a$2 - 2"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   851
        using prems(1)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   852
        by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   853
      have "z$1 \<noteq> pathfinish g$1"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   854
        using prems(2)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   855
        using assms ab
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   856
        by (auto simp add: field_simps *)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   857
      moreover have "pathstart g \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   858
        using assms(4) pathstart_in_path_image[of g]
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   859
        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
   860
      note this[unfolded mem_interval_cart forall_2]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   861
      then have "z$1 \<noteq> pathstart g$1"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   862
        using prems(1)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   863
        using assms ab
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   864
        by (auto simp add: field_simps *)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   865
      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"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   866
        using prems(2)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   867
        unfolding * assms
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   868
        by (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   869
      then show False
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   870
        unfolding * using ab by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   871
    qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   872
    then have "z \<in> path_image f \<or> z \<in> path_image g"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   873
      using z unfolding Un_iff by blast
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   874
    then have z': "z \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   875
      using assms(3-4)
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   876
      by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   877
    have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart f $ 1 \<or> z $ 1 = pathfinish f $ 1) \<Longrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   878
      z = pathstart f \<or> z = pathfinish f"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   879
      unfolding vec_eq_iff forall_2 assms
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   880
      by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   881
    with z' show "z \<in> path_image f"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   882
      using z(1)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   883
      unfolding Un_iff mem_interval_cart forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   884
      apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   885
      apply (simp only: segment_vertical segment_horizontal vector_2)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   886
      unfolding assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   887
      apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   888
      done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   889
    have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart g $ 1 \<or> z $ 1 = pathfinish g $ 1) \<Longrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   890
      z = pathstart g \<or> z = pathfinish g"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   891
      unfolding vec_eq_iff forall_2 assms
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   892
      by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   893
    with z' show "z \<in> path_image g"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   894
      using z(2)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   895
      unfolding Un_iff mem_interval_cart forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   896
      apply (simp only: segment_vertical segment_horizontal vector_2)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   897
      unfolding assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   898
      apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   899
      done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   900
  qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   901
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   902
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   903
(** 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
   904
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   905
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   906
(* 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
   907
(* any dimension is (path-)connected. This naively generalizes the argument  *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   908
(* 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
   909
(* fixed point theorem", American Mathematical Monthly 1984.                 *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   910
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   911
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   912
let RETRACTION_INJECTIVE_IMAGE_INTERVAL = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   913
 (`!p:real^M->real^N a b.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   914
        ~(interval[a,b] = {}) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   915
        p continuous_on interval[a,b] /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   916
        (!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
   917
        ==> ?f. f continuous_on (:real^N) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   918
                IMAGE f (:real^N) SUBSET (IMAGE p (interval[a,b])) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   919
                (!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
   920
  REPEAT STRIP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   921
  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
   922
  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
   923
  SUBGOAL_THEN `(q:real^N->real^M) continuous_on
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   924
                (IMAGE p (interval[a:real^M,b]))`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   925
  ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   926
   [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
   927
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   928
  MP_TAC(ISPECL [`q:real^N->real^M`;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   929
                 `IMAGE (p:real^M->real^N)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   930
                 (interval[a,b])`;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   931
                 `a:real^M`; `b:real^M`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   932
        TIETZE_CLOSED_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   933
  ASM_SIMP_TAC[COMPACT_INTERVAL; COMPACT_CONTINUOUS_IMAGE;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   934
               COMPACT_IMP_CLOSED] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   935
  ANTS_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   936
  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
   937
  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
   938
  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
   939
  CONJ_TAC THENL [ALL_TAC; ASM SET_TAC[]] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   940
  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
   941
  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
   942
        CONTINUOUS_ON_SUBSET)) THEN ASM SET_TAC[]);;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   943
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   944
let UNBOUNDED_PATH_COMPONENTS_COMPLEMENT_HOMEOMORPHIC_INTERVAL = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   945
 (`!s:real^N->bool a b:real^M.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   946
        s homeomorphic (interval[a,b])
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   947
        ==> !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
   948
  REPEAT GEN_TAC THEN REWRITE_TAC[homeomorphic; homeomorphism] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   949
  REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   950
  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
   951
  DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   952
  SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   953
   `!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
   954
          (p:real^M->real^N) x = p y ==> x = y`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   955
  ASSUME_TAC THENL [ASM_MESON_TAC[]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   956
  FIRST_X_ASSUM(MP_TAC o funpow 4 CONJUNCT2) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   957
  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
   958
  ASM_CASES_TAC `interval[a:real^M,b] = {}` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   959
  ASM_REWRITE_TAC[IMAGE_CLAUSES; DIFF_EMPTY; PATH_COMPONENT_UNIV;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   960
                  NOT_BOUNDED_UNIV] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   961
  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
   962
  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
   963
  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
   964
  SUBGOAL_THEN `bounded((path_component s c) UNION
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   965
                        (IMAGE (p:real^M->real^N) (interval[a,b])))`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   966
  MP_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   967
   [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
   968
                 COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   969
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   970
  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
   971
  REWRITE_TAC[UNION_SUBSET] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   972
  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
   973
  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
   974
    RETRACTION_INJECTIVE_IMAGE_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   975
  ASM_REWRITE_TAC[SUBSET; IN_UNIV] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   976
  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
   977
  DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   978
   (CONJUNCTS_THEN2 MP_TAC ASSUME_TAC)) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   979
  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
   980
  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
   981
  SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   982
    `(q:real^N->real^N) continuous_on
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   983
     (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
   984
  MP_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   985
   [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
   986
    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
   987
    REPEAT CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   988
     [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
   989
      ASM_SIMP_TAC[GSYM CLOSED_OPEN; COMPACT_IMP_CLOSED;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   990
                   COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   991
      ASM_MESON_TAC[CONTINUOUS_ON_SUBSET; SUBSET_UNIV];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   992
      ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   993
    X_GEN_TAC `z:real^N` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   994
    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
   995
    STRIP_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   996
    MP_TAC(ISPECL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   997
     [`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
   998
     OPEN_INTER_CLOSURE_EQ_EMPTY) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   999
    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
  1000
     [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
  1001
      ASM_SIMP_TAC[GSYM CLOSED_OPEN; COMPACT_IMP_CLOSED;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1002
                   COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1003
      REWRITE_TAC[DISJOINT; EXTENSION; IN_INTER; NOT_IN_EMPTY] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1004
      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
  1005
      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
  1006
      REWRITE_TAC[PATH_COMPONENT_REFL_EQ] THEN ASM SET_TAC[]];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1007
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1008
  SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1009
   `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
  1010
    (:real^N)`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1011
  SUBST1_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1012
   [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
  1013
    REWRITE_TAC[CLOSURE_SUBSET];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1014
    DISCH_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1015
  MP_TAC(ISPECL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1016
   [`(\x. &2 % c - x) o
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1017
     (\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
  1018
    `cball(c:real^N,B)`]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1019
    BROUWER) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1020
  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
  1021
  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
  1022
  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
  1023
   [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
  1024
    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
  1025
    ASM SET_TAC[PATH_COMPONENT_REFL_EQ];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1026
    ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1027
  REPEAT CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1028
   [MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1029
    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
  1030
    MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN CONJ_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1031
     [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
  1032
    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
  1033
    MATCH_MP_TAC CONTINUOUS_ON_MUL THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1034
    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
  1035
    REWRITE_TAC[o_DEF; real_div; LIFT_CMUL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1036
    MATCH_MP_TAC CONTINUOUS_ON_CMUL THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1037
    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
  1038
    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
  1039
    SUBGOAL_THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1040
     `(\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
  1041
    SUBST1_TAC THENL [REWRITE_TAC[o_DEF]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1042
    MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1043
    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
  1044
                 CONTINUOUS_ON_LIFT_NORM];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1045
    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
  1046
    X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1047
    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
  1048
    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
  1049
    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
  1050
    ASM_REAL_ARITH_TAC;
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1051
    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
  1052
    REWRITE_TAC[IN_CBALL; o_THM; dist] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1053
    X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1054
    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
  1055
    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
  1056
     [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
  1057
      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
  1058
      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
  1059
      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
  1060
      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
  1061
      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
  1062
      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
  1063
      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
  1064
      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
  1065
      SUBGOAL_THEN `~(x:real^N = c)` ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1066
       [ASM_MESON_TAC[PATH_COMPONENT_REFL; IN]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1067
      ASM_REWRITE_TAC[] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1068
      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
  1069
      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
  1070
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1071
let PATH_CONNECTED_COMPLEMENT_HOMEOMORPHIC_INTERVAL = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1072
 (`!s:real^N->bool a b:real^M.
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1073
        2 <= dimindex(:N) /\ s homeomorphic interval[a,b]
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1074
        ==> path_connected((:real^N) DIFF s)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1075
  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
  1076
  FIRST_ASSUM(MP_TAC o MATCH_MP
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1077
    UNBOUNDED_PATH_COMPONENTS_COMPLEMENT_HOMEOMORPHIC_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1078
  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
  1079
  ABBREV_TAC `t = (:real^N) DIFF s` THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1080
  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
  1081
  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
  1082
  REWRITE_TAC[COMPACT_INTERVAL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1083
  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
  1084
  REWRITE_TAC[BOUNDED_POS; LEFT_IMP_EXISTS_THM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1085
  X_GEN_TAC `B:real` THEN STRIP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1086
  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
  1087
                (?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
  1088
  STRIP_ASSUME_TAC THENL
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1089
   [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
  1090
  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
  1091
  CONJ_TAC THENL [ASM_MESON_TAC[IN]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1092
  MATCH_MP_TAC PATH_COMPONENT_SYM THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1093
  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
  1094
  CONJ_TAC THENL [ASM_MESON_TAC[IN]; ALL_TAC] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1095
  MATCH_MP_TAC PATH_COMPONENT_OF_SUBSET THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1096
  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
  1097
   [EXPAND_TAC "t" THEN MATCH_MP_TAC(SET_RULE
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1098
     `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
  1099
    ASM_REWRITE_TAC[SUBSET; IN_CBALL_0];
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1100
    MP_TAC(ISPEC `cball(vec 0:real^N,B)`
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1101
       PATH_CONNECTED_COMPLEMENT_BOUNDED_CONVEX) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1102
    ASM_REWRITE_TAC[BOUNDED_CBALL; CONVEX_CBALL] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1103
    REWRITE_TAC[PATH_CONNECTED_IFF_PATH_COMPONENT] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1104
    DISCH_THEN MATCH_MP_TAC THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1105
    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
  1106
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1107
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1108
(* 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
  1109
(* ------------------------------------------------------------------------- *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1110
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1111
let RETRACTION_ARC = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1112
 (`!p. arc p
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1113
       ==> ?f. f continuous_on (:real^N) /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1114
               IMAGE f (:real^N) SUBSET path_image p /\
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1115
               (!x. x IN path_image p ==> f x = x)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1116
  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
  1117
  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
  1118
  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
  1119
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1120
let PATH_CONNECTED_ARC_COMPLEMENT = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1121
 (`!p. 2 <= dimindex(:N) /\ arc p
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1122
       ==> path_connected((:real^N) DIFF path_image p)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1123
  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
  1124
  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
  1125
    PATH_CONNECTED_COMPLEMENT_HOMEOMORPHIC_INTERVAL) THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1126
  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
  1127
  ONCE_REWRITE_TAC[HOMEOMORPHIC_SYM] THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1128
  MATCH_MP_TAC HOMEOMORPHIC_COMPACT THEN
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1129
  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
  1130
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1131
let CONNECTED_ARC_COMPLEMENT = prove
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1132
 (`!p. 2 <= dimindex(:N) /\ arc p
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1133
       ==> connected((:real^N) DIFF path_image p)`,
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1134
  SIMP_TAC[PATH_CONNECTED_ARC_COMPLEMENT; PATH_CONNECTED_IMP_CONNECTED]);; *)
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1135
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
  1136
end