src/HOL/Analysis/Fashoda_Theorem.thy
author immler
Thu, 17 Jan 2019 16:28:07 -0500
changeset 69681 689997a8a582
parent 69680 96a43caa4902
child 69683 8b3458ca0762
permissions -rw-r--r--
redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
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
69517
dc20f278e8f3 tuned style and headers
nipkow
parents: 69173
diff changeset
     5
section%important \<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
69173
38beaaebe736 tagged 8 theories for the Analysis manual.
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents: 68310
diff changeset
    11
subsection%important \<open>Bijections between intervals\<close>
56273
def3bbe6f2a5 cleanup auxiliary proofs for Brouwer fixpoint theorem (removes ~2400 lines)
hoelzl
parents: 56189
diff changeset
    12
69173
38beaaebe736 tagged 8 theories for the Analysis manual.
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents: 68310
diff changeset
    13
definition%important interval_bij :: "'a \<times> 'a \<Rightarrow> 'a \<times> 'a \<Rightarrow> 'a \<Rightarrow> 'a::euclidean_space"
56273
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
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
    33
lemma in_interval_interval_bij:
56273
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
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
    40
proof -
56273
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
69173
38beaaebe736 tagged 8 theories for the Analysis manual.
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents: 68310
diff changeset
    73
subsection%important \<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
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
    92
proposition fashoda_unit:
53572
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"
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   102
proof (rule ccontr)
53572
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"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   112
    unfolding sqprojection_def infnorm_mul[unfolded scalar_mult_eq_scaleR]
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   113
    by (simp add: real_abs_infnorm infnorm_eq_0)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   114
  let ?F = "\<lambda>w::real^2. (f \<circ> (\<lambda>x. x$1)) w - (g \<circ> (\<lambda>x. x$2)) w"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   115
  have *: "\<And>i. (\<lambda>x::real^2. x $ i) ` cbox (- 1) 1 = {-1..1}"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   116
  proof 
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   117
    show "(\<lambda>x::real^2. x $ i) ` cbox (- 1) 1 \<subseteq> {-1..1}" for i
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   118
      by (auto simp: mem_box_cart)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   119
    show "{-1..1} \<subseteq> (\<lambda>x::real^2. x $ i) ` cbox (- 1) 1" for i
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   120
      by (clarsimp simp: image_iff mem_box_cart Bex_def) (metis (no_types, hide_lams) vec_component)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   121
  qed
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   122
  {
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   123
    fix x
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   124
    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
   125
    then obtain w :: "real^2" where w:
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   126
        "w \<in> cbox (- 1) 1"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   127
        "x = (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   128
      unfolding image_iff ..
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   129
    then have "x \<noteq> 0"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   130
      using as[of "w$1" "w$2"]
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   131
      unfolding mem_box_cart atLeastAtMost_iff
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   132
      by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   133
  } note x0 = this
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 53628
diff changeset
   134
  have 1: "box (- 1) (1::real^2) \<noteq> {}"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   135
    unfolding interval_eq_empty_cart by auto
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   136
  have "negatex (x + y) $ i = (negatex x + negatex y) $ i \<and> negatex (c *\<^sub>R x) $ i = (c *\<^sub>R negatex x) $ i"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   137
    for i x y c
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   138
    using exhaust_2 [of i] by (auto simp: negatex_def)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   139
  then have "bounded_linear negatex"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   140
    by (simp add: bounded_linearI' vec_eq_iff)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   141
  then 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
   142
    apply (intro continuous_intros continuous_on_component)
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   143
    unfolding * sqprojection_def
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   144
    apply (intro assms continuous_intros)+
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   145
     apply (simp_all add: infnorm_eq_0 x0 linear_continuous_on)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   146
    done
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   147
  have 3: "(negatex \<circ> sqprojection \<circ> ?F) ` cbox (-1) 1 \<subseteq> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   148
    unfolding subset_eq
61166
5976fe402824 renamed method "goals" to "goal_cases" to emphasize its meaning;
wenzelm
parents: 61165
diff changeset
   149
  proof (rule, goal_cases)
61165
8020249565fb tuned proofs;
wenzelm
parents: 60420
diff changeset
   150
    case (1 x)
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   151
    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
   152
        "y \<in> cbox (- 1) 1"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   153
        "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
   154
      unfolding image_iff ..
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   155
    have "?F y \<noteq> 0"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   156
      by (rule x0) (use y in auto)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   157
    then have *: "infnorm (sqprojection (?F y)) = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   158
      unfolding y o_def
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   159
      by - (rule lem2[rule_format])
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   160
    have inf1: "infnorm x = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   161
      unfolding *[symmetric] y o_def
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   162
      by (rule lem1[rule_format])
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   163
    show "x \<in> cbox (-1) 1"
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   164
      unfolding mem_box_cart interval_cbox_cart infnorm_2
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   165
    proof 
61165
8020249565fb tuned proofs;
wenzelm
parents: 60420
diff changeset
   166
      fix i
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   167
      show "(- 1) $ i \<le> x $ i \<and> x $ i \<le> 1 $ i"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   168
        using exhaust_2 [of i] inf1 by (auto simp: infnorm_2)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   169
    qed
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   170
  qed
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   171
  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
   172
      "x \<in> cbox (- 1) 1"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   173
      "(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
   174
    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
   175
    apply (rule compact_cbox convex_box)+
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   176
    unfolding interior_cbox
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   177
    apply (rule 1 2 3)+
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   178
    apply blast
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   179
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   180
  have "?F x \<noteq> 0"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   181
    by (rule x0) (use x in auto)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   182
  then have *: "infnorm (sqprojection (?F x)) = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   183
    unfolding o_def
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   184
    by (rule lem2[rule_format])
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   185
  have nx: "infnorm x = 1"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   186
    apply (subst x(2)[symmetric])
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   187
    unfolding *[symmetric] o_def
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   188
    apply (rule lem1[rule_format])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   189
    done
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   190
  have iff: "0 < sqprojection x$i \<longleftrightarrow> 0 < x$i" "sqprojection x$i < 0 \<longleftrightarrow> x$i < 0" if "x \<noteq> 0" for x i
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   191
  proof -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   192
    have "inverse (infnorm x) > 0"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   193
      by (simp add: infnorm_pos_lt that)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   194
    then show "(0 < sqprojection x $ i) = (0 < x $ i)"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   195
      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
   196
      unfolding sqprojection_def vector_component_simps vector_scaleR_component real_scaleR_def
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   197
      unfolding zero_less_mult_iff mult_less_0_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   198
      by (auto simp add: field_simps)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   199
  qed
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   200
  have x1: "x $ 1 \<in> {- 1..1::real}" "x $ 2 \<in> {- 1..1::real}"
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   201
    using x(1) unfolding mem_box_cart by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   202
  then have nz: "f (x $ 1) - g (x $ 2) \<noteq> 0"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   203
    using as by auto
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   204
  consider "x $ 1 = -1" | "x $ 1 = 1" | "x $ 2 = -1" | "x $ 2 = 1"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   205
    using nx unfolding infnorm_eq_1_2 by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   206
  then show False
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   207
  proof cases
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   208
    case 1
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   209
    then have *: "f (x $ 1) $ 1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   210
      using assms(5) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   211
    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
   212
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   213
      by (auto simp: negatex_def 1)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   214
    moreover
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   215
    from x1 have "g (x $ 2) \<in> cbox (-1) 1"
67982
7643b005b29a various new results on measures, integrals, etc., and some simplified proofs
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
   216
      using assms(2) by blast
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   217
    ultimately show False
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   218
      unfolding iff[OF nz] vector_component_simps * mem_box_cart
67982
7643b005b29a various new results on measures, integrals, etc., and some simplified proofs
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
   219
      using not_le by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   220
  next
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   221
    case 2
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   222
    then have *: "f (x $ 1) $ 1 = 1"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   223
      using assms(6) by auto
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   224
    have "sqprojection (f (x$1) - g (x$2)) $ 1 < 0"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   225
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]] 2
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   226
      by (auto simp: negatex_def)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   227
    moreover have "g (x $ 2) \<in> cbox (-1) 1"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   228
      using assms(2) x1 by blast
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   229
    ultimately show False
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   230
      unfolding iff[OF nz] vector_component_simps * mem_box_cart
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   231
      using not_le by auto
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   232
  next
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   233
    case 3
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   234
    then have *: "g (x $ 2) $ 2 = - 1"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   235
      using assms(7) by auto
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   236
    have "sqprojection (f (x$1) - g (x$2)) $ 2 < 0"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   237
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]] 3 by (auto simp: negatex_def)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   238
    moreover
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   239
    from x1 have "f (x $ 1) \<in> cbox (-1) 1"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   240
      using assms(1) by blast
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   241
    ultimately show False
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   242
      unfolding iff[OF nz] vector_component_simps * mem_box_cart
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   243
      by (erule_tac x=2 in allE) auto
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   244
  next
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   245
    case 4
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   246
    then have *: "g (x $ 2) $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   247
      using assms(8) by auto
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   248
    have "sqprojection (f (x$1) - g (x$2)) $ 2 > 0"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   249
      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]] 4 by (auto simp: negatex_def)
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   250
    moreover
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   251
    from x1 have "f (x $ 1) \<in> cbox (-1) 1"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   252
      using assms(1) by blast
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   253
    ultimately show False
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   254
      unfolding iff[OF nz] vector_component_simps * mem_box_cart
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   255
      by (erule_tac x=2 in allE) auto
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   256
  qed 
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   257
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   258
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   259
proposition fashoda_unit_path:
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   260
  fixes f g :: "real \<Rightarrow> real^2"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   261
  assumes "path f"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   262
    and "path g"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   263
    and "path_image f \<subseteq> cbox (-1) 1"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   264
    and "path_image g \<subseteq> cbox (-1) 1"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   265
    and "(pathstart f)$1 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   266
    and "(pathfinish f)$1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   267
    and "(pathstart g)$2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   268
    and "(pathfinish g)$2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   269
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   270
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   271
  note assms=assms[unfolded path_def pathstart_def pathfinish_def path_image_def]
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62397
diff changeset
   272
  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
   273
  have isc: "iscale ` {- 1..1} \<subseteq> {0..1}"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   274
    unfolding iscale_def by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   275
  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
   276
  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
   277
    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
   278
      using isc and assms(3-4) by (auto simp add: image_comp [symmetric])
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   279
    have *: "continuous_on {- 1..1} iscale"
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56273
diff changeset
   280
      unfolding iscale_def by (rule continuous_intros)+
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   281
    show "continuous_on {- 1..1} (f \<circ> iscale)" "continuous_on {- 1..1} (g \<circ> iscale)"
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   282
      apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   283
      apply (rule_tac[!] continuous_on_compose[OF *])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   284
      apply (rule_tac[!] continuous_on_subset[OF _ isc])
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   285
      apply (rule assms)+
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   286
      done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   287
    have *: "(1 / 2) *\<^sub>R (1 + (1::real^1)) = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   288
      unfolding vec_eq_iff by auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   289
    show "(f \<circ> iscale) (- 1) $ 1 = - 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   290
      and "(f \<circ> iscale) 1 $ 1 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   291
      and "(g \<circ> iscale) (- 1) $ 2 = -1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   292
      and "(g \<circ> iscale) 1 $ 2 = 1"
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   293
      unfolding o_def iscale_def
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   294
      using assms
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   295
      by (auto simp add: *)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   296
  qed
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   297
  then obtain s t where st:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   298
      "s \<in> {- 1..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   299
      "t \<in> {- 1..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   300
      "(f \<circ> iscale) s = (g \<circ> iscale) t"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   301
    by auto
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   302
  show thesis
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   303
    apply (rule_tac z = "f (iscale s)" in that)
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   304
    using st
53572
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   305
    unfolding o_def path_image_def image_iff
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   306
    apply -
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   307
    apply (rule_tac x="iscale s" in bexI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   308
    prefer 3
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   309
    apply (rule_tac x="iscale t" in bexI)
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   310
    using isc[unfolded subset_eq, rule_format]
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   311
    apply auto
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   312
    done
e7b77b217491 tuned proofs;
wenzelm
parents: 51475
diff changeset
   313
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   314
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   315
theorem fashoda:
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   316
  fixes b :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   317
  assumes "path f"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   318
    and "path g"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   319
    and "path_image f \<subseteq> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   320
    and "path_image g \<subseteq> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   321
    and "(pathstart f)$1 = a$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   322
    and "(pathfinish f)$1 = b$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   323
    and "(pathstart g)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   324
    and "(pathfinish g)$2 = b$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   325
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   326
proof -
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   327
  fix P Q S
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   328
  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
   329
  then show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   330
    by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   331
next
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   332
  have "cbox a b \<noteq> {}"
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 53628
diff changeset
   333
    using assms(3) using path_image_nonempty[of f] by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   334
  then have "a \<le> b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   335
    unfolding interval_eq_empty_cart less_eq_vec_def by (auto simp add: not_less)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   336
  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
   337
    unfolding less_eq_vec_def forall_2 by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   338
next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   339
  assume as: "a$1 = b$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   340
  have "\<exists>z\<in>path_image g. z$2 = (pathstart f)$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   341
    apply (rule connected_ivt_component_cart)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   342
    apply (rule connected_path_image assms)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   343
    apply (rule pathstart_in_path_image)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   344
    apply (rule pathfinish_in_path_image)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   345
    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
   346
    unfolding pathstart_def
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   347
    apply (auto simp add: less_eq_vec_def mem_box_cart)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   348
    done
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   349
  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
   350
  have "z \<in> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   351
    using z(1) assms(4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   352
    unfolding path_image_def
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   353
    by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   354
  then have "z = f 0"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   355
    unfolding vec_eq_iff forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   356
    unfolding z(2) pathstart_def
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   357
    using assms(3)[unfolded path_image_def subset_eq mem_box_cart,rule_format,of "f 0" 1]
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   358
    unfolding mem_box_cart
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   359
    apply (erule_tac x=1 in allE)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   360
    using as
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   361
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   362
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   363
  then show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   364
    apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   365
    apply (rule that[OF _ z(1)])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   366
    unfolding path_image_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   367
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   368
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   369
next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   370
  assume as: "a$2 = b$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   371
  have "\<exists>z\<in>path_image f. z$1 = (pathstart g)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   372
    apply (rule connected_ivt_component_cart)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   373
    apply (rule connected_path_image assms)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   374
    apply (rule pathstart_in_path_image)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   375
    apply (rule pathfinish_in_path_image)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   376
    unfolding assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   377
    using assms(4)[unfolded path_image_def subset_eq,rule_format,of "g 0"]
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   378
    unfolding pathstart_def
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   379
    apply (auto simp add: less_eq_vec_def mem_box_cart)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   380
    done
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   381
  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
   382
  have "z \<in> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   383
    using z(1) assms(3)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   384
    unfolding path_image_def
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   385
    by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   386
  then have "z = g 0"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   387
    unfolding vec_eq_iff forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   388
    unfolding z(2) pathstart_def
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   389
    using assms(4)[unfolded path_image_def subset_eq mem_box_cart,rule_format,of "g 0" 2]
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   390
    unfolding mem_box_cart
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   391
    apply (erule_tac x=2 in allE)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   392
    using as
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   393
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   394
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   395
  then show thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   396
    apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   397
    apply (rule that[OF z(1)])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   398
    unfolding path_image_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   399
    apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   400
    done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   401
next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   402
  assume as: "a $ 1 < b $ 1 \<and> a $ 2 < b $ 2"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   403
  have int_nem: "cbox (-1) (1::real^2) \<noteq> {}"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   404
    unfolding interval_eq_empty_cart by auto
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   405
  obtain z :: "real^2" where z:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   406
      "z \<in> (interval_bij (a, b) (- 1, 1) \<circ> f) ` {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   407
      "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
   408
    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
   409
    unfolding path_def path_image_def pathstart_def pathfinish_def
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   410
    apply (rule_tac[1-2] continuous_on_compose)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   411
    apply (rule assms[unfolded path_def] continuous_on_interval_bij)+
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   412
    unfolding subset_eq
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   413
    apply(rule_tac[1-2] ballI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   414
  proof -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   415
    fix x
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   416
    assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> f) ` {0..1}"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   417
    then obtain y where y:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   418
        "y \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   419
        "x = (interval_bij (a, b) (- 1, 1) \<circ> f) y"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   420
      unfolding image_iff ..
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   421
    show "x \<in> cbox (- 1) 1"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   422
      unfolding y o_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   423
      apply (rule in_interval_interval_bij)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   424
      using y(1)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   425
      using assms(3)[unfolded path_image_def subset_eq] int_nem
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   426
      apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   427
      done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   428
  next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   429
    fix x
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   430
    assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> g) ` {0..1}"
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   431
    then obtain y where y:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   432
        "y \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   433
        "x = (interval_bij (a, b) (- 1, 1) \<circ> g) y"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   434
      unfolding image_iff ..
58410
6d46ad54a2ab explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents: 57418
diff changeset
   435
    show "x \<in> cbox (- 1) 1"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   436
      unfolding y o_def
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   437
      apply (rule in_interval_interval_bij)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   438
      using y(1)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   439
      using assms(4)[unfolded path_image_def subset_eq] int_nem
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   440
      apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   441
      done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   442
  next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   443
    show "(interval_bij (a, b) (- 1, 1) \<circ> f) 0 $ 1 = -1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   444
      and "(interval_bij (a, b) (- 1, 1) \<circ> f) 1 $ 1 = 1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   445
      and "(interval_bij (a, b) (- 1, 1) \<circ> g) 0 $ 2 = -1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   446
      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
   447
      using assms as
67982
7643b005b29a various new results on measures, integrals, etc., and some simplified proofs
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
   448
      by (simp_all add: cart_eq_inner_axis pathstart_def pathfinish_def interval_bij_def)
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
   449
         (simp_all add: inner_axis)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   450
  qed
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   451
  from z(1) obtain zf where zf:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   452
      "zf \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   453
      "z = (interval_bij (a, b) (- 1, 1) \<circ> f) zf"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   454
    unfolding image_iff ..
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   455
  from z(2) obtain zg where zg:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   456
      "zg \<in> {0..1}"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   457
      "z = (interval_bij (a, b) (- 1, 1) \<circ> g) zg"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   458
    unfolding image_iff ..
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   459
  have *: "\<forall>i. (- 1) $ i < (1::real^2) $ i \<and> a $ i < b $ i"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   460
    unfolding forall_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   461
    using as
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   462
    by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   463
  show thesis
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   464
  proof (rule_tac z="interval_bij (- 1,1) (a,b) z" in that)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   465
    show "interval_bij (- 1, 1) (a, b) z \<in> path_image f"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   466
      using zf by (simp add: interval_bij_bij_cart[OF *] path_image_def)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   467
    show "interval_bij (- 1, 1) (a, b) z \<in> path_image g"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   468
      using zg by (simp add: interval_bij_bij_cart[OF *] path_image_def)
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   469
  qed
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   470
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   471
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   472
69173
38beaaebe736 tagged 8 theories for the Analysis manual.
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents: 68310
diff changeset
   473
subsection%unimportant \<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
   474
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   475
lemma segment_vertical:
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   476
  fixes a :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   477
  assumes "a$1 = b$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   478
  shows "x \<in> closed_segment a b \<longleftrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   479
    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
   480
  (is "_ = ?R")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   481
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   482
  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
   483
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   484
    presume "?L \<Longrightarrow> ?R" and "?R \<Longrightarrow> ?L"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   485
    then show ?thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   486
      unfolding closed_segment_def mem_Collect_eq
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   487
      unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[symmetric] vector_component_simps
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   488
      by blast
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   489
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   490
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   491
    assume ?L
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   492
    then obtain u where u:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   493
        "x $ 1 = (1 - u) * a $ 1 + u * b $ 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   494
        "x $ 2 = (1 - u) * a $ 2 + u * b $ 2"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   495
        "0 \<le> u"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   496
        "u \<le> 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   497
      by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   498
    { fix b a
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   499
      assume "b + u * a > a + u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   500
      then have "(1 - u) * b > (1 - u) * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   501
        by (auto simp add:field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   502
      then have "b \<ge> a"
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   503
        apply (drule_tac mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   504
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   505
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   506
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   507
      then have "u * a \<le> u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   508
        apply -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   509
        apply (rule mult_left_mono[OF _ u(3)])
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   510
        using u(3-4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   511
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   512
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   513
    } note * = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   514
    {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   515
      fix a b
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   516
      assume "u * b > u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   517
      then have "(1 - u) * a \<le> (1 - u) * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   518
        apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   519
        apply (rule mult_left_mono)
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   520
        apply (drule mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   521
        using u
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
      then have "a + u * b \<le> b + u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   525
        by (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   526
    } note ** = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   527
    then show ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   528
      unfolding u assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   529
      using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   530
      by (auto simp add:field_simps not_le intro: * **)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   531
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   532
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   533
    assume ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   534
    then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   535
    proof (cases "x$2 = b$2")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   536
      case True
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   537
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   538
        apply (rule_tac x="(x$2 - a$2) / (b$2 - a$2)" in exI)
68310
d0a7ddf5450e more general tidying
paulson <lp15@cam.ac.uk>
parents: 68054
diff changeset
   539
        unfolding assms True using \<open>?R\<close> apply (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   540
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   541
    next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   542
      case False
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   543
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   544
        apply (rule_tac x="1 - (x$2 - b$2) / (a$2 - b$2)" in exI)
68310
d0a7ddf5450e more general tidying
paulson <lp15@cam.ac.uk>
parents: 68054
diff changeset
   545
        unfolding assms using \<open>?R\<close> apply (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   546
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   547
    qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   548
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   549
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   550
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   551
lemma segment_horizontal:
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   552
  fixes a :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   553
  assumes "a$2 = b$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   554
  shows "x \<in> closed_segment a b \<longleftrightarrow>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   555
    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
   556
  (is "_ = ?R")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   557
proof -
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   558
  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
   559
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   560
    presume "?L \<Longrightarrow> ?R" and "?R \<Longrightarrow> ?L"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   561
    then show ?thesis
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   562
      unfolding closed_segment_def mem_Collect_eq
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   563
      unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[symmetric] vector_component_simps
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   564
      by blast
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   565
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   566
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   567
    assume ?L
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   568
    then obtain u where u:
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   569
        "x $ 1 = (1 - u) * a $ 1 + u * b $ 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   570
        "x $ 2 = (1 - u) * a $ 2 + u * b $ 2"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   571
        "0 \<le> u"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   572
        "u \<le> 1"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   573
      by blast
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   574
    {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   575
      fix b a
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   576
      assume "b + u * a > a + u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   577
      then have "(1 - u) * b > (1 - u) * a"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   578
        by (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   579
      then have "b \<ge> a"
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   580
        apply (drule_tac mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   581
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   582
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   583
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   584
      then have "u * a \<le> u * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   585
        apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   586
        apply (rule mult_left_mono[OF _ u(3)])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   587
        using u(3-4)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   588
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   589
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   590
    } note * = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   591
    {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   592
      fix a b
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   593
      assume "u * b > u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   594
      then have "(1 - u) * a \<le> (1 - u) * b"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   595
        apply -
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   596
        apply (rule mult_left_mono)
59555
05573e5504a9 eliminated fact duplicates
haftmann
parents: 58877
diff changeset
   597
        apply (drule mult_left_less_imp_less)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   598
        using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   599
        apply auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   600
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   601
      then have "a + u * b \<le> b + u * a"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   602
        by (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   603
    } note ** = this
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   604
    then show ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   605
      unfolding u assms
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   606
      using u
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   607
      by (auto simp add: field_simps not_le intro: * **)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   608
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   609
  {
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   610
    assume ?R
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   611
    then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   612
    proof (cases "x$1 = b$1")
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   613
      case True
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   614
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   615
        apply (rule_tac x="(x$1 - a$1) / (b$1 - a$1)" in exI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   616
        unfolding assms True
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   617
        using \<open>?R\<close>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   618
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   619
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   620
    next
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   621
      case False
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   622
      then show ?L
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   623
        apply (rule_tac x="1 - (x$1 - b$1) / (a$1 - b$1)" in exI)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   624
        unfolding assms
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59555
diff changeset
   625
        using \<open>?R\<close>
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   626
        apply (auto simp add: field_simps)
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   627
        done
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   628
    qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   629
  }
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   630
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   631
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   632
69173
38beaaebe736 tagged 8 theories for the Analysis manual.
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents: 68310
diff changeset
   633
subsection%important \<open>Useful Fashoda corollary pointed out to me by Tom Hales\<close>(*FIXME change title? *)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   634
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   635
corollary fashoda_interlace:
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   636
  fixes a :: "real^2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   637
  assumes "path f"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   638
    and "path g"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   639
    and paf: "path_image f \<subseteq> cbox a b"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   640
    and pag: "path_image g \<subseteq> cbox a b"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   641
    and "(pathstart f)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   642
    and "(pathfinish f)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   643
    and "(pathstart g)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   644
    and "(pathfinish g)$2 = a$2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   645
    and "(pathstart f)$1 < (pathstart g)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   646
    and "(pathstart g)$1 < (pathfinish f)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   647
    and "(pathfinish f)$1 < (pathfinish g)$1"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   648
  obtains z where "z \<in> path_image f" and "z \<in> path_image g"
69681
689997a8a582 redo tagging-related changes from a06b204527e6, 0f4d4a13dc16, and a8faf6f15da7
immler
parents: 69680
diff changeset
   649
proof -
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   650
  have "cbox a b \<noteq> {}"
54775
2d3df8633dad prefer box over greaterThanLessThan on euclidean_space
immler
parents: 53628
diff changeset
   651
    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
   652
  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
   653
  have "pathstart f \<in> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   654
    and "pathfinish f \<in> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   655
    and "pathstart g \<in> cbox a b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   656
    and "pathfinish g \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   657
    using pathstart_in_path_image pathfinish_in_path_image
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   658
    using assms(3-4)
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   659
    by auto
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   660
  note startfin = this[unfolded mem_box_cart forall_2]
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   661
  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
   662
     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
   663
     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
   664
     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
   665
  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
   666
     linepath(pathfinish g)(vector[(pathfinish g)$1,a$2 - 1]) +++
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   667
     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
   668
     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
   669
  let ?a = "vector[a$1 - 2, a$2 - 3]"
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   670
  let ?b = "vector[b$1 + 2, b$2 + 3]"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   671
  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
   672
      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
   673
      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
   674
      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
   675
    "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
   676
      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
   677
      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
   678
      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
   679
      by(auto simp add: path_image_join path_linepath)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   680
  have abab: "cbox a b \<subseteq> cbox ?a ?b"
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   681
    unfolding interval_cbox_cart[symmetric]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   682
    by (auto simp add:less_eq_vec_def forall_2 vector_2)
55675
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   683
  obtain z where
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   684
    "z \<in> path_image
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   685
          (linepath (vector [a $ 1 - 2, a $ 2 - 2]) (vector [pathstart f $ 1, a $ 2 - 2]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   686
           linepath (vector [pathstart f $ 1, a $ 2 - 2]) (pathstart f) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   687
           f +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   688
           linepath (pathfinish f) (vector [pathfinish f $ 1, a $ 2 - 2]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   689
           linepath (vector [pathfinish f $ 1, a $ 2 - 2]) (vector [b $ 1 + 2, a $ 2 - 2]))"
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   690
    "z \<in> path_image
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   691
          (linepath (vector [pathstart g $ 1, pathstart g $ 2 - 3]) (pathstart g) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   692
           g +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   693
           linepath (pathfinish g) (vector [pathfinish g $ 1, a $ 2 - 1]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   694
           linepath (vector [pathfinish g $ 1, a $ 2 - 1]) (vector [b $ 1 + 1, a $ 2 - 1]) +++
ccbf1722ae32 tuned proofs;
wenzelm
parents: 54775
diff changeset
   695
           linepath (vector [b $ 1 + 1, a $ 2 - 1]) (vector [b $ 1 + 1, b $ 2 + 3]))"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   696
    apply (rule fashoda[of ?P1 ?P2 ?a ?b])
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   697
    unfolding pathstart_join pathfinish_join pathstart_linepath pathfinish_linepath vector_2
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   698
  proof -
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   699
    show "path ?P1" and "path ?P2"
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   700
      using assms by auto
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   701
    show "path_image ?P1 \<subseteq> cbox ?a ?b" "path_image ?P2 \<subseteq> cbox ?a ?b"
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   702
      unfolding P1P2 path_image_linepath using startfin paf pag
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   703
      by (auto simp: mem_box_cart segment_horizontal segment_vertical forall_2)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   704
    show "a $ 1 - 2 = a $ 1 - 2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   705
      and "b $ 1 + 2 = b $ 1 + 2"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   706
      and "pathstart g $ 2 - 3 = a $ 2 - 3"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   707
      and "b $ 2 + 3 = b $ 2 + 3"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   708
      by (auto simp add: assms)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   709
  qed
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   710
  note z=this[unfolded P1P2 path_image_linepath]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   711
  show thesis
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   712
  proof (rule that[of z])
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   713
    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
   714
      z \<in> closed_segment (vector [pathstart f $ 1, a $ 2 - 2]) (pathstart f)) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   715
      z \<in> closed_segment (pathfinish f) (vector [pathfinish f $ 1, a $ 2 - 2]) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   716
      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
   717
    (((z \<in> closed_segment (vector [pathstart g $ 1, pathstart g $ 2 - 3]) (pathstart g)) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   718
      z \<in> closed_segment (pathfinish g) (vector [pathfinish g $ 1, a $ 2 - 1])) \<or>
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   719
      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
   720
      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
   721
    proof (simp only: segment_vertical segment_horizontal vector_2, goal_cases)
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   722
      case prems: 1
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   723
      have "pathfinish f \<in> cbox a b"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   724
        using assms(3) pathfinish_in_path_image[of f] by auto
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   725
      then have "1 + b $ 1 \<le> pathfinish f $ 1 \<Longrightarrow> False"
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   726
        unfolding mem_box_cart forall_2 by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   727
      then have "z$1 \<noteq> pathfinish f$1"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   728
        using prems(2)
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   729
        using assms ab
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   730
        by (auto simp add: field_simps)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   731
      moreover have "pathstart f \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   732
        using assms(3) pathstart_in_path_image[of f]
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   733
        by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   734
      then have "1 + b $ 1 \<le> pathstart f $ 1 \<Longrightarrow> False"
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   735
        unfolding mem_box_cart forall_2
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   736
        by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   737
      then have "z$1 \<noteq> pathstart f$1"
61167
34f782641caa tuned proofs;
wenzelm
parents: 61166
diff changeset
   738
        using prems(2) using assms ab
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   739
        by (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   740
      ultimately have *: "z$2 = a$2 - 2"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   741
        using prems(1) by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   742
      have "z$1 \<noteq> pathfinish g$1"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   743
        using prems(2) assms ab
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   744
        by (auto simp add: field_simps *)
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   745
      moreover have "pathstart g \<in> cbox a b"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   746
        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
   747
        by auto
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   748
      note this[unfolded mem_box_cart forall_2]
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   749
      then have "z$1 \<noteq> pathstart g$1"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   750
        using prems(1) assms ab
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   751
        by (auto simp add: field_simps *)
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   752
      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"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   753
        using prems(2)  unfolding * assms by (auto simp add: field_simps)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   754
      then show False
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   755
        unfolding * using ab by auto
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   756
    qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   757
    then have "z \<in> path_image f \<or> z \<in> path_image g"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   758
      using z unfolding Un_iff by blast
56188
0268784f60da use cbox to relax class constraints
immler
parents: 56154
diff changeset
   759
    then have z': "z \<in> cbox a b"
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   760
      using assms(3-4) by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   761
    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
   762
      z = pathstart f \<or> z = pathfinish f"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   763
      unfolding vec_eq_iff forall_2 assms
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   764
      by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   765
    with z' show "z \<in> path_image f"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   766
      using z(1)
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   767
      unfolding Un_iff mem_box_cart forall_2
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   768
      by (simp only: segment_vertical segment_horizontal vector_2) (auto simp: assms)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   769
    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
   770
      z = pathstart g \<or> z = pathfinish g"
53628
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   771
      unfolding vec_eq_iff forall_2 assms
15405540288e tuned proofs;
wenzelm
parents: 53627
diff changeset
   772
      by auto
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   773
    with z' show "z \<in> path_image g"
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   774
      using z(2)
67673
c8caefb20564 lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   775
      unfolding Un_iff mem_box_cart forall_2
68054
ebd179b82e20 getting rid of more "defer", etc.
paulson <lp15@cam.ac.uk>
parents: 68004
diff changeset
   776
      by (simp only: segment_vertical segment_horizontal vector_2) (auto simp: assms)
53627
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   777
  qed
f3fd9168911c tuned proofs;
wenzelm
parents: 53572
diff changeset
   778
qed
36432
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   779
1ad1cfeaec2d move proof of Fashoda meet theorem into separate file
huffman
parents:
diff changeset
   780
end