author himmelma Thu, 28 May 2009 16:19:34 +0200 changeset 31281 b4d4dbc5b04f parent 31280 8ef7ba78bf26 child 31282 b98cbfabe824
Corrected definition of is_interval
```--- a/src/HOL/Library/Convex_Euclidean_Space.thy	Thu May 28 15:54:20 2009 +0200
+++ b/src/HOL/Library/Convex_Euclidean_Space.thy	Thu May 28 16:19:34 2009 +0200
@@ -35,15 +35,6 @@
"a \<le> b \<longleftrightarrow> dest_vec1 a \<le> dest_vec1 b" "dest_vec1 (1::real^1) = 1"

-definition
-  "is_interval_new (s::((real^'n::finite) set)) \<longleftrightarrow>
-  (\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i. ((a\$i \<le> x\$i \<and> x\$i \<le> b\$i) \<or> (b\$i \<le> x\$i \<and> x\$i \<le> a\$i)))  \<longrightarrow> x \<in> s)"
-
-lemma is_interval_interval_new: "is_interval_new {a .. b}" (is ?th1) "is_interval_new {a<..<b}" (is ?th2) proof -
-  have *:"\<And>x y z::real. x < y \<Longrightarrow> y < z \<Longrightarrow> x < z" by auto
-  show ?th1 ?th2  unfolding is_interval_new_def mem_interval Ball_def atLeastAtMost_iff
-    by(meson real_le_trans le_less_trans less_le_trans *)+ qed
-
lemma nequals0I:"x\<in>A \<Longrightarrow> A \<noteq> {}" by auto

lemma norm_not_0:"(x::real^'n::finite)\<noteq>0 \<Longrightarrow> norm x \<noteq> 0" by auto
@@ -2175,7 +2166,7 @@

subsection {* Convexity of general and special intervals. *}

-lemma is_interval_convex: assumes "is_interval_new s" shows "convex s"
+lemma is_interval_convex: assumes "is_interval s" shows "convex s"
unfolding convex_def apply(rule,rule,rule,rule,rule,rule,rule) proof-
fix x y u v assume as:"x \<in> s" "y \<in> s" "0 \<le> u" "0 \<le> v" "u + v = (1::real)"
hence *:"u = 1 - v" "1 - v \<ge> 0" and **:"v = 1 - u" "1 - u \<ge> 0" by auto
@@ -2188,22 +2179,22 @@
hence "v * b > (1 - u) * a" unfolding not_le using as(4) by(auto simp add: field_simps)
hence "a < b" unfolding * using as(4) apply(rule_tac mult_left_less_imp_less) by(auto simp add: ring_simps)
hence "u * a + v * b \<le> b" unfolding ** using **(2) as(3) by(auto simp add: field_simps intro!:mult_right_mono) }
-  ultimately show "u *s x + v *s y \<in> s" apply- apply(rule assms[unfolded is_interval_new_def, rule_format, OF as(1,2)])
+  ultimately show "u *s x + v *s y \<in> s" apply- apply(rule assms[unfolded is_interval_def, rule_format, OF as(1,2)])
using as(3-) dimindex_ge_1 apply- by(auto simp add: vector_component) qed

-lemma is_interval_connected: "is_interval_new s \<Longrightarrow> connected s"
+lemma is_interval_connected: "is_interval s \<Longrightarrow> connected s"
using is_interval_convex convex_connected by auto

lemma convex_interval: "convex {a .. b}" "convex {a<..<b::real^'n::finite}"
-  apply(rule_tac[!] is_interval_convex) using is_interval_interval_new by auto
+  apply(rule_tac[!] is_interval_convex) using is_interval_interval by auto

subsection {* On real^1, is_interval, convex and connected are all equivalent. *}

lemma is_interval_1:
-  "is_interval_new s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. \<forall> x. dest_vec1 a \<le> dest_vec1 x \<and> dest_vec1 x \<le> dest_vec1 b \<longrightarrow> x \<in> s)"
-  unfolding is_interval_new_def dest_vec1_def forall_1 by auto
-
-lemma is_interval_connected_1: "is_interval_new s \<longleftrightarrow> connected (s::(real^1) set)"
+  "is_interval s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. \<forall> x. dest_vec1 a \<le> dest_vec1 x \<and> dest_vec1 x \<le> dest_vec1 b \<longrightarrow> x \<in> s)"
+  unfolding is_interval_def dest_vec1_def forall_1 by auto
+
+lemma is_interval_connected_1: "is_interval s \<longleftrightarrow> connected (s::(real^1) set)"
apply(rule, rule is_interval_connected, assumption) unfolding is_interval_1
apply(rule,rule,rule,rule,erule conjE,rule ccontr) proof-
fix a b x assume as:"connected s" "a \<in> s" "b \<in> s" "dest_vec1 a \<le> dest_vec1 x" "dest_vec1 x \<le> dest_vec1 b" "x\<notin>s"
@@ -2219,7 +2210,7 @@
by(auto simp add: basis_component field_simps) qed

lemma is_interval_convex_1:
-  "is_interval_new s \<longleftrightarrow> convex (s::(real^1) set)"
+  "is_interval s \<longleftrightarrow> convex (s::(real^1) set)"
using is_interval_convex convex_connected is_interval_connected_1 by auto

lemma convex_connected_1:```
```--- a/src/HOL/Library/Topology_Euclidean_Space.thy	Thu May 28 15:54:20 2009 +0200
+++ b/src/HOL/Library/Topology_Euclidean_Space.thy	Thu May 28 16:19:34 2009 +0200
@@ -4751,16 +4751,12 @@

subsection{* Intervals in general, including infinite and mixtures of open and closed. *}

-definition "is_interval s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> s)"
-
-lemma is_interval_interval: fixes a::"real^'n::finite" shows
-  "is_interval {a<..<b}" "is_interval {a .. b}"
-  unfolding is_interval_def apply(auto simp add: vector_less_def vector_less_eq_def)
-  apply(erule_tac x=i in allE)+ apply simp
-  apply(erule_tac x=i in allE)+ apply simp
-  apply(erule_tac x=i in allE)+ apply simp
-  apply(erule_tac x=i in allE)+ apply simp
-  done
+definition "is_interval s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i. ((a\$i \<le> x\$i \<and> x\$i \<le> b\$i) \<or> (b\$i \<le> x\$i \<and> x\$i \<le> a\$i)))  \<longrightarrow> x \<in> s)"
+
+lemma is_interval_interval: "is_interval {a .. b::real^'n::finite}" (is ?th1) "is_interval {a<..<b}" (is ?th2) proof -
+  have *:"\<And>x y z::real. x < y \<Longrightarrow> y < z \<Longrightarrow> x < z" by auto
+  show ?th1 ?th2  unfolding is_interval_def mem_interval Ball_def atLeastAtMost_iff
+    by(meson real_le_trans le_less_trans less_le_trans *)+ qed

lemma is_interval_empty:
"is_interval {}"```