# HG changeset patch # User wenzelm # Date 1300051450 -3600 # Node ID 5abc60a017e08c1c50fd88806b2e6099e8ec49c0 # Parent d488ae70366d6fd9ea3855b3bcc88a0931e25b93 eliminated hard tabs; diff -r d488ae70366d -r 5abc60a017e0 src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Sun Mar 13 21:41:44 2011 +0100 +++ b/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Sun Mar 13 22:24:10 2011 +0100 @@ -145,7 +145,7 @@ have inj:"inj_on f (s - {z})" apply(rule eq_card_imp_inj_on) unfolding as using as(1) and assms by auto show "z = a \ z = c" proof(rule ccontr) assume "\ (z = a \ z = c)" thus False using inj[unfolded inj_on_def,THEN bspec[where x=a],THEN bspec[where x=c]] - using `a\s` `c\s` `f a = f c` `a\c` by auto qed qed qed + using `a\s` `c\s` `f a = f c` `a\c` by auto qed qed qed subsection {* Combine this with the basic counting lemma. *} @@ -195,12 +195,12 @@ using as(5)[rule_format,OF a(1) insertI1] apply- proof(erule disjE) assume "\j. a j \ x j" thus ?thesis apply(rule_tac x=a in bexI) using a by auto next assume "\j. x j \ a j" thus ?thesis apply(rule_tac x=x in bexI) apply(rule,rule) using a apply - - apply(erule_tac x=xa in ballE) apply(erule_tac x=j in allE)+ by auto qed moreover + apply(erule_tac x=xa in ballE) apply(erule_tac x=j in allE)+ by auto qed moreover have "\b\insert x F. \x\insert x F. \j. x j \ b j" using as(5)[rule_format,OF b(1) insertI1] apply- proof(erule disjE) assume "\j. x j \ b j" thus ?thesis apply(rule_tac x=b in bexI) using b by auto next assume "\j. b j \ x j" thus ?thesis apply(rule_tac x=x in bexI) apply(rule,rule) using b apply - - apply(erule_tac x=xa in ballE) apply(erule_tac x=j in allE)+ by auto qed + apply(erule_tac x=xa in ballE) apply(erule_tac x=j in allE)+ by auto qed ultimately show ?thesis by auto qed qed(auto) lemma kle_imp_pointwise: "kle n x y \ (\j. x j \ y j)" unfolding kle_def by auto @@ -231,7 +231,7 @@ then guess a .. note a=this show ?thesis apply(rule_tac x=a in bexI) proof fix x assume "x\s" show "kle n a x" using assms(3)[rule_format,OF a(1) `x\s`] apply- proof(erule disjE) assume "kle n x a" hence "x = a" apply- unfolding pointwise_antisym[THEN sym] - apply(drule kle_imp_pointwise) using a(2)[rule_format,OF `x\s`] by auto + apply(drule kle_imp_pointwise) using a(2)[rule_format,OF `x\s`] by auto thus ?thesis using kle_refl by auto qed qed(insert a, auto) qed lemma kle_maximal: assumes "finite s" "s \ {}" "\x\s. \y\s. kle n x y \ kle n y x" @@ -241,7 +241,7 @@ then guess a .. note a=this show ?thesis apply(rule_tac x=a in bexI) proof fix x assume "x\s" show "kle n x a" using assms(3)[rule_format,OF a(1) `x\s`] apply- proof(erule disjE) assume "kle n a x" hence "x = a" apply- unfolding pointwise_antisym[THEN sym] - apply(drule kle_imp_pointwise) using a(2)[rule_format,OF `x\s`] by auto + apply(drule kle_imp_pointwise) using a(2)[rule_format,OF `x\s`] by auto thus ?thesis using kle_refl by auto qed qed(insert a, auto) qed lemma kle_strict_set: assumes "kle n x y" "x \ y" @@ -315,7 +315,7 @@ show ?thesis unfolding kle_def apply(rule_tac x="kk1 \ kk2" in exI) apply(rule) defer proof fix i show "c i = a i + (if i \ kk1 \ kk2 then 1 else 0)" proof(cases "i\kk1 \ kk2") case True hence "c i \ a i + (if i \ kk1 \ kk2 then 1 else 0)" - unfolding kk1[THEN conjunct2,rule_format,of i] kk2[THEN conjunct2,rule_format,of i] by auto + unfolding kk1[THEN conjunct2,rule_format,of i] kk2[THEN conjunct2,rule_format,of i] by auto moreover have "c i \ a i + (if i \ kk1 \ kk2 then 1 else 0)" using True assms(3) by auto ultimately show ?thesis by auto next case False thus ?thesis using kk1 kk2 by auto qed qed(insert kk1 kk2, auto) qed @@ -508,8 +508,8 @@ case goal1 note as = this(1,4-)[unfolded goal1 split_conv] have "xa = xb" using as(1)[THEN cong[of _ _ a]] by auto moreover have "ya = yb" proof(rule ext) fix x show "ya x = yb x" proof(cases "x = a") - case False thus ?thesis using as(1)[THEN cong[of _ _ x x]] by auto next - case True thus ?thesis using as(5,7) using as0(2) by auto qed qed + case False thus ?thesis using as(1)[THEN cong[of _ _ x x]] by auto next + case True thus ?thesis using as(5,7) using as0(2) by auto qed qed ultimately show ?case unfolding goal1 by auto qed have "finite s0" using `finite s` unfolding as0 by simp show ?case unfolding as0 * card_image[OF inj] using assms @@ -549,19 +549,19 @@ assume ?ls then guess s .. then guess a apply-apply(erule exE,(erule conjE)+) . note sa=this show ?rs unfolding ksimplex_def sa(3) apply(rule) defer apply rule defer apply(rule,rule,rule,rule) defer apply(rule,rule) proof- fix x y assume as:"x \s - {a}" "y \s - {a}" have xyp:"x (n + 1) = y (n + 1)" - using as(1)[unfolded sa(3)[THEN sym], THEN assms(2)[rule_format]] - using as(2)[unfolded sa(3)[THEN sym], THEN assms(2)[rule_format]] by auto + using as(1)[unfolded sa(3)[THEN sym], THEN assms(2)[rule_format]] + using as(2)[unfolded sa(3)[THEN sym], THEN assms(2)[rule_format]] by auto show "kle n x y \ kle n y x" proof(cases "kle (n + 1) x y") case True then guess k unfolding kle_def .. note k=this hence *:"n+1 \ k" using xyp by auto have "\ (\x\k. x\{1..n})" apply(rule ccontr) unfolding not_not apply(erule bexE) proof- - fix x assume as:"x \ k" "x \ {1..n}" have "x \ n+1" using as and * by auto - thus False using as and k[THEN conjunct1,unfolded subset_eq] by auto qed + fix x assume as:"x \ k" "x \ {1..n}" have "x \ n+1" using as and * by auto + thus False using as and k[THEN conjunct1,unfolded subset_eq] by auto qed thus ?thesis apply-apply(rule disjI1) unfolding kle_def using k apply(rule_tac x=k in exI) by auto next case False hence "kle (n + 1) y x" using ksimplexD(6)[OF sa(1),rule_format, of x y] using as by auto then guess k unfolding kle_def .. note k=this hence *:"n+1 \ k" using xyp by auto hence "\ (\x\k. x\{1..n})" apply-apply(rule ccontr) unfolding not_not apply(erule bexE) proof- - fix x assume as:"x \ k" "x \ {1..n}" have "x \ n+1" using as and * by auto - thus False using as and k[THEN conjunct1,unfolded subset_eq] by auto qed + fix x assume as:"x \ k" "x \ {1..n}" have "x \ n+1" using as and * by auto + thus False using as and k[THEN conjunct1,unfolded subset_eq] by auto qed thus ?thesis apply-apply(rule disjI2) unfolding kle_def using k apply(rule_tac x=k in exI) by auto qed next fix x j assume as:"x\s - {a}" "j\{1..n}" thus "x j = p" using as(1)[unfolded sa(3)[THEN sym], THEN assms(2)[rule_format]] @@ -577,10 +577,10 @@ qed(insert x rs(4), auto simp add:c_def) show "j \ {1..n + 1} \ x j = p" apply(cases "x=c") using x ab(1) rs(5) unfolding c_def by auto { fix z assume z:"z \ insert c f" hence "kle (n + 1) c z" apply(cases "z = c") (*defer apply(rule kle_Suc)*) proof- - case False hence "z\f" using z by auto - then guess k apply(drule_tac ab(3)[THEN bspec[where x=z], THEN conjunct1]) unfolding kle_def apply(erule exE) . - thus "kle (n + 1) c z" unfolding kle_def apply(rule_tac x="insert (n + 1) k" in exI) unfolding c_def - using ab using rs(5)[rule_format,OF ab(1),of "n + 1"] assms(1) by auto qed auto } note * = this + case False hence "z\f" using z by auto + then guess k apply(drule_tac ab(3)[THEN bspec[where x=z], THEN conjunct1]) unfolding kle_def apply(erule exE) . + thus "kle (n + 1) c z" unfolding kle_def apply(rule_tac x="insert (n + 1) k" in exI) unfolding c_def + using ab using rs(5)[rule_format,OF ab(1),of "n + 1"] assms(1) by auto qed auto } note * = this fix y assume y:"y \ insert c f" show "kle (n + 1) x y \ kle (n + 1) y x" proof(cases "x = c \ y = c") case False hence **:"x\f" "y\f" using x y by auto show ?thesis using rs(6)[rule_format,OF **] by(auto dest: kle_Suc) qed(insert * x y, auto) @@ -635,7 +635,7 @@ have a':"a' = b0" apply(rule ksimplex_fix_plane_p[OF goal1(1-2) assms(4), of _ b1]) unfolding goal1 extb using extb(1,2) assms(5) by auto moreover have *:"b1 = a1" unfolding kle_antisym[THEN sym, of b1 a1 n] using exta extb using goal1(3) unfolding a a' by blast moreover have "a0 = b0" apply(rule ext) proof- case goal1 show "a0 x = b0 x" - using *[THEN cong, of x x] unfolding exta extb apply-apply(cases "x\{1..n}") by auto qed + using *[THEN cong, of x x] unfolding exta extb apply-apply(cases "x\{1..n}") by auto qed ultimately show "s' = s" apply-apply(rule lem[OF goal1(3) _ goal1(2) assms(2)]) by auto qed show ?thesis unfolding card_1_exists apply(rule ex1I[of _ s]) unfolding mem_Collect_eq apply(rule,rule assms(1)) apply(rule_tac x=a in bexI) prefer 3 apply(erule conjE bexE)+ apply(rule_tac a'=b in lem) using assms(1-2) by auto qed @@ -672,38 +672,38 @@ using `a3\a0` `a3\s` `a0\s` by(auto simp add:card_insert_if) fix x assume x:"x \ insert a3 (s - {a0})" show "\j. x j \ p" proof(rule,cases "x = a3") - fix j case False thus "x j\p" using x ksimplexD(4)[OF assms(1)] by auto next - fix j case True show "x j\p" unfolding True proof(cases "j=k") - case False thus "a3 j \p" unfolding True a3_def using `a1\s` ksimplexD(4)[OF assms(1)] by auto next - guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this - have "a2 k \ a4 k" using lem3[OF a4(1)[unfolded `a=a0`],THEN kle_imp_pointwise] by auto - also have "\ < p" using ksimplexD(4)[OF assms(1),rule_format,of a4 k] using a4 by auto - finally have *:"a0 k + 1 < p" unfolding k(2)[rule_format] by auto - case True thus "a3 j \p" unfolding a3_def unfolding a0a1(5)[rule_format] - using k(1) k(2)assms(5) using * by simp qed qed + fix j case False thus "x j\p" using x ksimplexD(4)[OF assms(1)] by auto next + fix j case True show "x j\p" unfolding True proof(cases "j=k") + case False thus "a3 j \p" unfolding True a3_def using `a1\s` ksimplexD(4)[OF assms(1)] by auto next + guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this + have "a2 k \ a4 k" using lem3[OF a4(1)[unfolded `a=a0`],THEN kle_imp_pointwise] by auto + also have "\ < p" using ksimplexD(4)[OF assms(1),rule_format,of a4 k] using a4 by auto + finally have *:"a0 k + 1 < p" unfolding k(2)[rule_format] by auto + case True thus "a3 j \p" unfolding a3_def unfolding a0a1(5)[rule_format] + using k(1) k(2)assms(5) using * by simp qed qed show "\j. j \ {1..n} \ x j = p" proof(rule,rule,cases "x=a3") fix j::nat assume j:"j\{1..n}" - { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } - case True show "x j = p" unfolding True a3_def using j k(1) - using ksimplexD(5)[OF assms(1),rule_format,OF `a1\s` j] by auto qed + { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } + case True show "x j = p" unfolding True a3_def using j k(1) + using ksimplexD(5)[OF assms(1),rule_format,OF `a1\s` j] by auto qed fix y assume y:"y\insert a3 (s - {a0})" have lem4:"\x. x\s \ x\a0 \ kle n x a3" proof- case goal1 - guess kk using a0a1(4)[rule_format,OF `x\s`,THEN conjunct2,unfolded kle_def] + guess kk using a0a1(4)[rule_format,OF `x\s`,THEN conjunct2,unfolded kle_def] apply-apply(erule exE,erule conjE) . note kk=this - have "k\kk" proof assume "k\kk" - hence "a1 k = x k + 1" using kk by auto - hence "a0 k = x k" unfolding a0a1(5)[rule_format] using k(1) by auto - hence "a2 k = x k + 1" unfolding k(2)[rule_format] by auto moreover - have "a2 k \ x k" using lem3[of x,THEN kle_imp_pointwise] goal1 by auto - ultimately show False by auto qed - thus ?case unfolding kle_def apply(rule_tac x="insert k kk" in exI) using kk(1) - unfolding a3_def kle_def kk(2)[rule_format] using k(1) by auto qed + have "k\kk" proof assume "k\kk" + hence "a1 k = x k + 1" using kk by auto + hence "a0 k = x k" unfolding a0a1(5)[rule_format] using k(1) by auto + hence "a2 k = x k + 1" unfolding k(2)[rule_format] by auto moreover + have "a2 k \ x k" using lem3[of x,THEN kle_imp_pointwise] goal1 by auto + ultimately show False by auto qed + thus ?case unfolding kle_def apply(rule_tac x="insert k kk" in exI) using kk(1) + unfolding a3_def kle_def kk(2)[rule_format] using k(1) by auto qed show "kle n x y \ kle n y x" proof(cases "y=a3") - case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI1,rule lem4) - using x by auto next - case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True - apply(rule disjI2,rule lem4) using y False by auto next - case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) - using x y `y\a3` by auto qed qed qed + case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI1,rule lem4) + using x by auto next + case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True + apply(rule disjI2,rule lem4) using y False by auto next + case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) + using x y `y\a3` by auto qed qed qed hence "insert a3 (s - {a0}) \ ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) apply(rule_tac x="a3" in bexI) unfolding `a=a0` using `a3\s` by auto moreover have "s \ ?A" using assms(1,2) by auto ultimately have "?A \ {s, insert a3 (s - {a0})}" by auto @@ -712,40 +712,40 @@ from this(2) guess a' .. note a'=this guess a_min a_max apply(rule ksimplex_extrema_strong[OF as assms(3)]) . note min_max=this have *:"\x\s' - {a'}. x k = a2 k" unfolding a' proof fix x assume x:"x\s-{a}" - hence "kle n a2 x" apply-apply(rule lem3) using `a=a0` by auto - hence "a2 k \ x k" apply(drule_tac kle_imp_pointwise) by auto moreover - have "x k \ a2 k" unfolding k(2)[rule_format] using a0a1(4)[rule_format,of x,THEN conjunct1] - unfolding kle_def using x by auto ultimately show "x k = a2 k" by auto qed + hence "kle n a2 x" apply-apply(rule lem3) using `a=a0` by auto + hence "a2 k \ x k" apply(drule_tac kle_imp_pointwise) by auto moreover + have "x k \ a2 k" unfolding k(2)[rule_format] using a0a1(4)[rule_format,of x,THEN conjunct1] + unfolding kle_def using x by auto ultimately show "x k = a2 k" by auto qed have **:"a'=a_min \ a'=a_max" apply(rule ksimplex_fix_plane[OF a'(1) k(1) *]) using min_max by auto show "s' \ {s, insert a3 (s - {a0})}" proof(cases "a'=a_min") - case True have "a_max = a1" unfolding kle_antisym[THEN sym,of a_max a1 n] apply(rule) - apply(rule a0a1(4)[rule_format,THEN conjunct2]) defer proof(rule min_max(4)[rule_format,THEN conjunct2]) - show "a1\s'" using a' unfolding `a=a0` using a0a1 by auto - show "a_max \ s" proof(rule ccontr) assume "a_max\s" - hence "a_max = a'" using a' min_max by auto - thus False unfolding True using min_max by auto qed qed - hence "\i. a_max i = a1 i" by auto - hence "a' = a" unfolding True `a=a0` apply-apply(subst fun_eq_iff,rule) - apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] - proof- case goal1 thus ?case apply(cases "x\{1..n}") by auto qed - hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\s` `a'\s'` by auto - thus ?thesis by auto next - case False hence as:"a' = a_max" using ** by auto - have "a_min = a2" unfolding kle_antisym[THEN sym, of _ _ n] apply rule - apply(rule min_max(4)[rule_format,THEN conjunct1]) defer proof(rule lem3) - show "a_min \ s - {a0}" unfolding a'(2)[THEN sym,unfolded `a=a0`] - unfolding as using min_max(1-3) by auto - have "a2 \ a" unfolding `a=a0` using k(2)[rule_format,of k] by auto - hence "a2 \ s - {a}" using a2 by auto thus "a2 \ s'" unfolding a'(2)[THEN sym] by auto qed - hence "\i. a_min i = a2 i" by auto - hence "a' = a3" unfolding as `a=a0` apply-apply(subst fun_eq_iff,rule) - apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] - unfolding a3_def k(2)[rule_format] unfolding a0a1(5)[rule_format] proof- case goal1 - show ?case unfolding goal1 apply(cases "x\{1..n}") defer apply(cases "x=k") - using `k\{1..n}` by auto qed - hence "s' = insert a3 (s - {a0})" apply-apply(rule lem1) defer apply assumption - apply(rule a'(1)) unfolding a' `a=a0` using `a3\s` by auto - thus ?thesis by auto qed qed + case True have "a_max = a1" unfolding kle_antisym[THEN sym,of a_max a1 n] apply(rule) + apply(rule a0a1(4)[rule_format,THEN conjunct2]) defer proof(rule min_max(4)[rule_format,THEN conjunct2]) + show "a1\s'" using a' unfolding `a=a0` using a0a1 by auto + show "a_max \ s" proof(rule ccontr) assume "a_max\s" + hence "a_max = a'" using a' min_max by auto + thus False unfolding True using min_max by auto qed qed + hence "\i. a_max i = a1 i" by auto + hence "a' = a" unfolding True `a=a0` apply-apply(subst fun_eq_iff,rule) + apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] + proof- case goal1 thus ?case apply(cases "x\{1..n}") by auto qed + hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\s` `a'\s'` by auto + thus ?thesis by auto next + case False hence as:"a' = a_max" using ** by auto + have "a_min = a2" unfolding kle_antisym[THEN sym, of _ _ n] apply rule + apply(rule min_max(4)[rule_format,THEN conjunct1]) defer proof(rule lem3) + show "a_min \ s - {a0}" unfolding a'(2)[THEN sym,unfolded `a=a0`] + unfolding as using min_max(1-3) by auto + have "a2 \ a" unfolding `a=a0` using k(2)[rule_format,of k] by auto + hence "a2 \ s - {a}" using a2 by auto thus "a2 \ s'" unfolding a'(2)[THEN sym] by auto qed + hence "\i. a_min i = a2 i" by auto + hence "a' = a3" unfolding as `a=a0` apply-apply(subst fun_eq_iff,rule) + apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] + unfolding a3_def k(2)[rule_format] unfolding a0a1(5)[rule_format] proof- case goal1 + show ?case unfolding goal1 apply(cases "x\{1..n}") defer apply(cases "x=k") + using `k\{1..n}` by auto qed + hence "s' = insert a3 (s - {a0})" apply-apply(rule lem1) defer apply assumption + apply(rule a'(1)) unfolding a' `a=a0` using `a3\s` by auto + thus ?thesis by auto qed qed ultimately have *:"?A = {s, insert a3 (s - {a0})}" by blast have "s \ insert a3 (s - {a0})" using `a3\s` by auto hence ?thesis unfolding * by auto } moreover @@ -780,17 +780,17 @@ using `a3\a0` `a3\s` `a1\s` by(auto simp add:card_insert_if) fix x assume x:"x \ insert a3 (s - {a1})" show "\j. x j \ p" proof(rule,cases "x = a3") - fix j case False thus "x j\p" using x ksimplexD(4)[OF assms(1)] by auto next - fix j case True show "x j\p" unfolding True proof(cases "j=k") - case False thus "a3 j \p" unfolding True a3_def using `a0\s` ksimplexD(4)[OF assms(1)] by auto next - guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this + fix j case False thus "x j\p" using x ksimplexD(4)[OF assms(1)] by auto next + fix j case True show "x j\p" unfolding True proof(cases "j=k") + case False thus "a3 j \p" unfolding True a3_def using `a0\s` ksimplexD(4)[OF assms(1)] by auto next + guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this case True have "a3 k \ a0 k" unfolding lem4[rule_format] by auto also have "\ \ p" using ksimplexD(4)[OF assms(1),rule_format,of a0 k] a0a1 by auto finally show "a3 j \ p" unfolding True by auto qed qed show "\j. j \ {1..n} \ x j = p" proof(rule,rule,cases "x=a3") fix j::nat assume j:"j\{1..n}" - { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } - case True show "x j = p" unfolding True a3_def using j k(1) - using ksimplexD(5)[OF assms(1),rule_format,OF `a0\s` j] by auto qed + { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } + case True show "x j = p" unfolding True a3_def using j k(1) + using ksimplexD(5)[OF assms(1),rule_format,OF `a0\s` j] by auto qed fix y assume y:"y\insert a3 (s - {a1})" have lem4:"\x. x\s \ x\a1 \ kle n a3 x" proof- case goal1 hence *:"x\s - {a1}" by auto have "kle n a3 a2" proof- have "kle n a0 a1" using a0a1 by auto then guess kk unfolding kle_def .. @@ -801,12 +801,12 @@ ultimately show ?case apply-apply(rule kle_between_l[of _ a0 _ a2]) using lem3[OF *] using a0a1(4)[rule_format,OF goal1(1)] by auto qed show "kle n x y \ kle n y x" proof(cases "y=a3") - case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI2,rule lem4) - using x by auto next - case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True - apply(rule disjI1,rule lem4) using y False by auto next - case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) - using x y `y\a3` by auto qed qed qed + case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI2,rule lem4) + using x by auto next + case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True + apply(rule disjI1,rule lem4) using y False by auto next + case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) + using x y `y\a3` by auto qed qed qed hence "insert a3 (s - {a1}) \ ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) apply(rule_tac x="a3" in bexI) unfolding `a=a1` using `a3\s` by auto moreover have "s \ ?A" using assms(1,2) by auto ultimately have "?A \ {s, insert a3 (s - {a1})}" by auto @@ -815,61 +815,61 @@ from this(2) guess a' .. note a'=this guess a_min a_max apply(rule ksimplex_extrema_strong[OF as assms(3)]) . note min_max=this have *:"\x\s' - {a'}. x k = a2 k" unfolding a' proof fix x assume x:"x\s-{a}" - hence "kle n x a2" apply-apply(rule lem3) using `a=a1` by auto - hence "x k \ a2 k" apply(drule_tac kle_imp_pointwise) by auto moreover - { have "a2 k \ a0 k" using k(2)[rule_format,of k] unfolding a0a1(5)[rule_format] using k(1) by simp - also have "\ \ x k" using a0a1(4)[rule_format,of x,THEN conjunct1,THEN kle_imp_pointwise] x by auto - finally have "a2 k \ x k" . } ultimately show "x k = a2 k" by auto qed + hence "kle n x a2" apply-apply(rule lem3) using `a=a1` by auto + hence "x k \ a2 k" apply(drule_tac kle_imp_pointwise) by auto moreover + { have "a2 k \ a0 k" using k(2)[rule_format,of k] unfolding a0a1(5)[rule_format] using k(1) by simp + also have "\ \ x k" using a0a1(4)[rule_format,of x,THEN conjunct1,THEN kle_imp_pointwise] x by auto + finally have "a2 k \ x k" . } ultimately show "x k = a2 k" by auto qed have **:"a'=a_min \ a'=a_max" apply(rule ksimplex_fix_plane[OF a'(1) k(1) *]) using min_max by auto have "a2 \ a1" proof assume as:"a2 = a1" - show False using k(2) unfolding as apply(erule_tac x=k in allE) by auto qed + show False using k(2) unfolding as apply(erule_tac x=k in allE) by auto qed hence a2':"a2 \ s' - {a'}" unfolding a' using a2 unfolding `a=a1` by auto show "s' \ {s, insert a3 (s - {a1})}" proof(cases "a'=a_min") - case True have "a_max \ s - {a1}" using min_max unfolding a'(2)[unfolded `a=a1`,THEN sym] True by auto - hence "a_max = a2" unfolding kle_antisym[THEN sym,of a_max a2 n] apply-apply(rule) - apply(rule lem3,assumption) apply(rule min_max(4)[rule_format,THEN conjunct2]) using a2' by auto - hence a_max:"\i. a_max i = a2 i" by auto - have *:"\j. a2 j = (if j\{1..n} then a3 j + 1 else a3 j)" - using k(2) unfolding lem4[rule_format] a0a1(5)[rule_format] apply-apply(rule,erule_tac x=j in allE) - proof- case goal1 thus ?case apply(cases "j\{1..n}",case_tac[!] "j=k") by auto qed - have "\i. a_min i = a3 i" using a_max apply-apply(rule,erule_tac x=i in allE) - unfolding min_max(5)[rule_format] *[rule_format] proof- case goal1 - thus ?case apply(cases "i\{1..n}") by auto qed hence "a_min = a3" unfolding fun_eq_iff . - hence "s' = insert a3 (s - {a1})" using a' unfolding `a=a1` True by auto thus ?thesis by auto next - case False hence as:"a'=a_max" using ** by auto - have "a_min = a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) - apply(rule min_max(4)[rule_format,THEN conjunct1]) defer apply(rule a0a1(4)[rule_format,THEN conjunct1]) proof- - have "a_min \ s - {a1}" using min_max(1,3) unfolding a'(2)[THEN sym,unfolded `a=a1`] as by auto - thus "a_min \ s" by auto have "a0 \ s - {a1}" using a0a1(1-3) by auto thus "a0 \ s'" - unfolding a'(2)[THEN sym,unfolded `a=a1`] by auto qed - hence "\i. a_max i = a1 i" unfolding a0a1(5)[rule_format] min_max(5)[rule_format] by auto - hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\s` `a'\s'` unfolding as `a=a1` unfolding fun_eq_iff by auto - thus ?thesis by auto qed qed + case True have "a_max \ s - {a1}" using min_max unfolding a'(2)[unfolded `a=a1`,THEN sym] True by auto + hence "a_max = a2" unfolding kle_antisym[THEN sym,of a_max a2 n] apply-apply(rule) + apply(rule lem3,assumption) apply(rule min_max(4)[rule_format,THEN conjunct2]) using a2' by auto + hence a_max:"\i. a_max i = a2 i" by auto + have *:"\j. a2 j = (if j\{1..n} then a3 j + 1 else a3 j)" + using k(2) unfolding lem4[rule_format] a0a1(5)[rule_format] apply-apply(rule,erule_tac x=j in allE) + proof- case goal1 thus ?case apply(cases "j\{1..n}",case_tac[!] "j=k") by auto qed + have "\i. a_min i = a3 i" using a_max apply-apply(rule,erule_tac x=i in allE) + unfolding min_max(5)[rule_format] *[rule_format] proof- case goal1 + thus ?case apply(cases "i\{1..n}") by auto qed hence "a_min = a3" unfolding fun_eq_iff . + hence "s' = insert a3 (s - {a1})" using a' unfolding `a=a1` True by auto thus ?thesis by auto next + case False hence as:"a'=a_max" using ** by auto + have "a_min = a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) + apply(rule min_max(4)[rule_format,THEN conjunct1]) defer apply(rule a0a1(4)[rule_format,THEN conjunct1]) proof- + have "a_min \ s - {a1}" using min_max(1,3) unfolding a'(2)[THEN sym,unfolded `a=a1`] as by auto + thus "a_min \ s" by auto have "a0 \ s - {a1}" using a0a1(1-3) by auto thus "a0 \ s'" + unfolding a'(2)[THEN sym,unfolded `a=a1`] by auto qed + hence "\i. a_max i = a1 i" unfolding a0a1(5)[rule_format] min_max(5)[rule_format] by auto + hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\s` `a'\s'` unfolding as `a=a1` unfolding fun_eq_iff by auto + thus ?thesis by auto qed qed ultimately have *:"?A = {s, insert a3 (s - {a1})}" by blast have "s \ insert a3 (s - {a1})" using `a3\s` by auto hence ?thesis unfolding * by auto } moreover { assume as:"a\a0" "a\a1" have "\ (\x\s. kle n a x)" proof case goal1 have "a=a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) - using goal1 a0a1 assms(2) by auto thus False using as by auto qed + using goal1 a0a1 assms(2) by auto thus False using as by auto qed hence "\y\s. \k\{1..n}. \j. a j = (if j = k then y j + 1 else y j)" using ksimplex_predecessor[OF assms(1-2)] by blast then guess u .. from this(2) guess k .. note k = this[rule_format] note u = `u\s` have "\ (\x\s. kle n x a)" proof case goal1 have "a=a1" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) - using goal1 a0a1 assms(2) by auto thus False using as by auto qed + using goal1 a0a1 assms(2) by auto thus False using as by auto qed hence "\y\s. \k\{1..n}. \j. y j = (if j = k then a j + 1 else a j)" using ksimplex_successor[OF assms(1-2)] by blast then guess v .. from this(2) guess l .. note l = this[rule_format] note v = `v\s` def a' \ "\j. if j = l then u j + 1 else u j" have kl:"k \ l" proof assume "k=l" have *:"\P. (if P then (1::nat) else 0) \ 2" by auto thus False using ksimplexD(6)[OF assms(1),rule_format,OF u v] unfolding kle_def - unfolding l(2) k(2) `k=l` apply-apply(erule disjE)apply(erule_tac[!] exE conjE)+ - apply(erule_tac[!] x=l in allE)+ by(auto simp add: *) qed + unfolding l(2) k(2) `k=l` apply-apply(erule disjE)apply(erule_tac[!] exE conjE)+ + apply(erule_tac[!] x=l in allE)+ by(auto simp add: *) qed hence aa':"a'\a" apply-apply rule unfolding fun_eq_iff unfolding a'_def k(2) apply(erule_tac x=l in allE) by auto have "a' \ s" apply(rule) apply(drule ksimplexD(6)[OF assms(1),rule_format,OF `a\s`]) proof(cases "kle n a a'") case goal2 hence "kle n a' a" by auto thus False apply(drule_tac kle_imp_pointwise) - apply(erule_tac x=l in allE) unfolding a'_def k(2) using kl by auto next + apply(erule_tac x=l in allE) unfolding a'_def k(2) using kl by auto next case True thus False apply(drule_tac kle_imp_pointwise) - apply(erule_tac x=k in allE) unfolding a'_def k(2) using kl by auto qed + apply(erule_tac x=k in allE) unfolding a'_def k(2) using kl by auto qed have kle_uv:"kle n u a" "kle n u a'" "kle n a v" "kle n a' v" unfolding kle_def apply- apply(rule_tac[1] x="{k}" in exI,rule_tac[2] x="{l}" in exI) apply(rule_tac[3] x="{l}" in exI,rule_tac[4] x="{k}" in exI) @@ -878,24 +878,24 @@ proof- case goal1 thus ?case proof(cases "x k = u k", case_tac[!] "x l = u l") assume as:"x l = u l" "x k = u k" have "x = u" unfolding fun_eq_iff - using goal1(2)[THEN kle_imp_pointwise,unfolded l(2)] unfolding k(2) apply- - using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 - thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next + using goal1(2)[THEN kle_imp_pointwise,unfolded l(2)] unfolding k(2) apply- + using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 + thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next assume as:"x l \ u l" "x k = u k" have "x = a'" unfolding fun_eq_iff unfolding a'_def - using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- - using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 - thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next + using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- + using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 + thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next assume as:"x l = u l" "x k \ u k" have "x = a" unfolding fun_eq_iff - using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- - using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 - thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next + using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- + using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 + thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next assume as:"x l \ u l" "x k \ u k" have "x = v" unfolding fun_eq_iff - using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- - using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 - thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as `k\l` by auto qed thus ?case by auto qed qed + using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- + using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 + thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as `k\l` by auto qed thus ?case by auto qed qed have uv:"kle n u v" apply(rule kle_trans[OF kle_uv(1,3)]) using ksimplexD(6)[OF assms(1)] using u v by auto have lem3:"\x. x\s \ kle n v x \ kle n a' x" apply(rule kle_between_r[of _ u _ v]) prefer 3 apply(rule kle_trans[OF uv]) defer apply(rule ksimplexD(6)[OF assms(1),rule_format]) @@ -905,30 +905,30 @@ using kle_uv `v\s` by auto have lem5:"\x. x\s \ x\a \ kle n x a' \ kle n a' x" proof- case goal1 thus ?case proof(cases "kle n v x \ kle n x u") case True thus ?thesis using goal1 by(auto intro:lem3 lem4) next - case False hence *:"kle n u x" "kle n x v" using ksimplexD(6)[OF assms(1)] using goal1 `u\s` `v\s` by auto - show ?thesis using uxv[OF *] using kle_uv using goal1 by auto qed qed + case False hence *:"kle n u x" "kle n x v" using ksimplexD(6)[OF assms(1)] using goal1 `u\s` `v\s` by auto + show ?thesis using uxv[OF *] using kle_uv using goal1 by auto qed qed have "ksimplex p n (insert a' (s - {a}))" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) show "card (insert a' (s - {a})) = n + 1" using ksimplexD(2-3)[OF assms(1)] using `a'\a` `a'\s` `a\s` by(auto simp add:card_insert_if) fix x assume x:"x \ insert a' (s - {a})" show "\j. x j \ p" proof(rule,cases "x = a'") - fix j case False thus "x j\p" using x ksimplexD(4)[OF assms(1)] by auto next - fix j case True show "x j\p" unfolding True proof(cases "j=l") - case False thus "a' j \p" unfolding True a'_def using `u\s` ksimplexD(4)[OF assms(1)] by auto next - case True have *:"a l = u l" "v l = a l + 1" using k(2)[of l] l(2)[of l] `k\l` by auto - have "u l + 1 \ p" unfolding *[THEN sym] using ksimplexD(4)[OF assms(1)] using `v\s` by auto - thus "a' j \p" unfolding a'_def True by auto qed qed + fix j case False thus "x j\p" using x ksimplexD(4)[OF assms(1)] by auto next + fix j case True show "x j\p" unfolding True proof(cases "j=l") + case False thus "a' j \p" unfolding True a'_def using `u\s` ksimplexD(4)[OF assms(1)] by auto next + case True have *:"a l = u l" "v l = a l + 1" using k(2)[of l] l(2)[of l] `k\l` by auto + have "u l + 1 \ p" unfolding *[THEN sym] using ksimplexD(4)[OF assms(1)] using `v\s` by auto + thus "a' j \p" unfolding a'_def True by auto qed qed show "\j. j \ {1..n} \ x j = p" proof(rule,rule,cases "x=a'") fix j::nat assume j:"j\{1..n}" - { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } - case True show "x j = p" unfolding True a'_def using j l(1) - using ksimplexD(5)[OF assms(1),rule_format,OF `u\s` j] by auto qed + { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } + case True show "x j = p" unfolding True a'_def using j l(1) + using ksimplexD(5)[OF assms(1),rule_format,OF `u\s` j] by auto qed fix y assume y:"y\insert a' (s - {a})" show "kle n x y \ kle n y x" proof(cases "y=a'") - case True show ?thesis unfolding True apply(cases "x=a'") defer apply(rule lem5) using x by auto next - case False show ?thesis proof(cases "x=a'") case True show ?thesis unfolding True - using lem5[of y] using y by auto next - case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) - using x y `y\a'` by auto qed qed qed + case True show ?thesis unfolding True apply(cases "x=a'") defer apply(rule lem5) using x by auto next + case False show ?thesis proof(cases "x=a'") case True show ?thesis unfolding True + using lem5[of y] using y by auto next + case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) + using x y `y\a'` by auto qed qed qed hence "insert a' (s - {a}) \ ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) apply(rule_tac x="a'" in bexI) using aa' `a'\s` by auto moreover have "s \ ?A" using assms(1,2) by auto ultimately have "?A \ {s, insert a' (s - {a})}" by auto @@ -940,27 +940,27 @@ have "u\a" "v\a" unfolding fun_eq_iff k(2) l(2) by auto hence uvs':"u\s'" "v\s'" using `u\s` `v\s` using a'' by auto have lem6:"a \ s' \ a' \ s'" proof(cases "\x\s'. kle n x u \ kle n v x") - case False then guess w unfolding ball_simps .. note w=this - hence "kle n u w" "kle n w v" using ksimplexD(6)[OF as] uvs' by auto - hence "w = a' \ w = a" using uxv[of w] uvs' w by auto thus ?thesis using w by auto next - case True have "\ (\x\s'. kle n x u)" unfolding ball_simps apply(rule_tac x=v in bexI) - using uv `u\v` unfolding kle_antisym[of n u v,THEN sym] using `v\s'` by auto - hence "\y\s'. \k\{1..n}. \j. y j = (if j = k then u j + 1 else u j)" using ksimplex_successor[OF as `u\s'`] by blast - then guess w .. note w=this from this(2) guess kk .. note kk=this[rule_format] - have "\ kle n w u" apply-apply(rule,drule kle_imp_pointwise) - apply(erule_tac x=kk in allE) unfolding kk by auto - hence *:"kle n v w" using True[rule_format,OF w(1)] by auto - hence False proof(cases "kk\l") case True thus False using *[THEN kle_imp_pointwise, unfolded l(2) kk k(2)] - apply(erule_tac x=l in allE) using `k\l` by auto next - case False hence "kk\k" using `k\l` by auto thus False using *[THEN kle_imp_pointwise, unfolded l(2) kk k(2)] - apply(erule_tac x=k in allE) using `k\l` by auto qed - thus ?thesis by auto qed + case False then guess w unfolding ball_simps .. note w=this + hence "kle n u w" "kle n w v" using ksimplexD(6)[OF as] uvs' by auto + hence "w = a' \ w = a" using uxv[of w] uvs' w by auto thus ?thesis using w by auto next + case True have "\ (\x\s'. kle n x u)" unfolding ball_simps apply(rule_tac x=v in bexI) + using uv `u\v` unfolding kle_antisym[of n u v,THEN sym] using `v\s'` by auto + hence "\y\s'. \k\{1..n}. \j. y j = (if j = k then u j + 1 else u j)" using ksimplex_successor[OF as `u\s'`] by blast + then guess w .. note w=this from this(2) guess kk .. note kk=this[rule_format] + have "\ kle n w u" apply-apply(rule,drule kle_imp_pointwise) + apply(erule_tac x=kk in allE) unfolding kk by auto + hence *:"kle n v w" using True[rule_format,OF w(1)] by auto + hence False proof(cases "kk\l") case True thus False using *[THEN kle_imp_pointwise, unfolded l(2) kk k(2)] + apply(erule_tac x=l in allE) using `k\l` by auto next + case False hence "kk\k" using `k\l` by auto thus False using *[THEN kle_imp_pointwise, unfolded l(2) kk k(2)] + apply(erule_tac x=k in allE) using `k\l` by auto qed + thus ?thesis by auto qed thus "s' \ {s, insert a' (s - {a})}" proof(cases "a\s'") - case True hence "s' = s" apply-apply(rule lem1[OF a''(2)]) using a'' `a\s` by auto - thus ?thesis by auto next case False hence "a'\s'" using lem6 by auto - hence "s' = insert a' (s - {a})" apply-apply(rule lem1[of _ a'' _ a']) - unfolding a''(2)[THEN sym] using a'' using `a'\s` by auto - thus ?thesis by auto qed qed + case True hence "s' = s" apply-apply(rule lem1[OF a''(2)]) using a'' `a\s` by auto + thus ?thesis by auto next case False hence "a'\s'" using lem6 by auto + hence "s' = insert a' (s - {a})" apply-apply(rule lem1[of _ a'' _ a']) + unfolding a''(2)[THEN sym] using a'' using `a'\s` by auto + thus ?thesis by auto qed qed ultimately have *:"?A = {s, insert a' (s - {a})}" by blast have "s \ insert a' (s - {a})" using `a'\s` by auto hence ?thesis unfolding * by auto } @@ -986,9 +986,9 @@ let ?S = "{s. ksimplex p (n + 1) s \ (\a\s. f = s - {a})}" have S:"?S = {s'. ksimplex p (n + 1) s' \ (\b\s'. s' - {b} = s - {a})}" unfolding as by blast { fix j assume j:"j \ {1..n + 1}" "\x\f. x j = 0" thus "card {s. ksimplex p (n + 1) s \ (\a\s. f = s - {a})} = 1" unfolding S - apply-apply(rule ksimplex_replace_0) apply(rule as)+ unfolding as by auto } + apply-apply(rule ksimplex_replace_0) apply(rule as)+ unfolding as by auto } { fix j assume j:"j \ {1..n + 1}" "\x\f. x j = p" thus "card {s. ksimplex p (n + 1) s \ (\a\s. f = s - {a})} = 1" unfolding S - apply-apply(rule ksimplex_replace_1) apply(rule as)+ unfolding as by auto } + apply-apply(rule ksimplex_replace_1) apply(rule as)+ unfolding as by auto } show "\ ((\j\{1..n+1}. \x\f. x j = 0) \ (\j\{1..n+1}. \x\f. x j = p)) \ card ?S = 2" unfolding S apply(rule ksimplex_replace_2) apply(rule as)+ unfolding as by auto qed auto qed @@ -1058,7 +1058,7 @@ using assms(2-3) using as(1)[unfolded ksimplex_def] by auto have allp:"\x\f. x (n + 1) = p" using assms(2) using as(1)[unfolded ksimplex_def] by auto { fix x assume "x\f" hence "reduced lab (n + 1) x < n + 1" apply-apply(rule reduced_labelling_1) - defer using assms(3) using as(1)[unfolded ksimplex_def] by auto + defer using assms(3) using as(1)[unfolded ksimplex_def] by auto hence "reduced lab (n + 1) x = reduced lab n x" apply-apply(rule reduced_labelling_Suc) using reduced_labelling(1) by auto } hence "reduced lab (n + 1) ` f = {0..n}" unfolding as(2)[THEN sym] apply- apply(rule set_eqI) unfolding image_iff by auto moreover guess s using as(1)[unfolded simplex_top_face[OF assms(1) allp,THEN sym]] .. then guess a .. @@ -1071,21 +1071,21 @@ { fix x assume "x\f" hence "reduced lab (n + 1) x \ reduced lab (n + 1) ` f" by auto hence "reduced lab (n + 1) x < n + 1" using sa(4) by auto hence "reduced lab (n + 1) x = reduced lab n x" apply-apply(rule reduced_labelling_Suc) - using reduced_labelling(1) by auto } + using reduced_labelling(1) by auto } thus part1:"reduced lab n ` f = {0..n}" unfolding sa(4)[THEN sym] apply-apply(rule set_eqI) unfolding image_iff by auto have *:"\x\f. x (n + 1) = p" proof(cases "\j\{1..n + 1}. \x\f. x j = 0") case True then guess j .. hence "\x. x\f \ reduced lab (n + 1) x \ j - 1" apply-apply(rule reduced_labelling_0) apply assumption - apply(rule assms(2)[rule_format]) using sa(1)[unfolded ksimplex_def] unfolding sa by auto moreover + apply(rule assms(2)[rule_format]) using sa(1)[unfolded ksimplex_def] unfolding sa by auto moreover have "j - 1 \ {0..n}" using `j\{1..n+1}` by auto ultimately have False unfolding sa(4)[THEN sym] unfolding image_iff by fastsimp thus ?thesis by auto next case False hence "\j\{1..n + 1}. \x\f. x j = p" using sa(5) by fastsimp then guess j .. note j=this thus ?thesis proof(cases "j = n+1") - case False hence *:"j\{1..n}" using j by auto - hence "\x. x\f \ reduced lab n x < j" apply(rule reduced_labelling_1) proof- fix x assume "x\f" - hence "lab x j = 1" apply-apply(rule assms(3)[rule_format,OF j(1)]) - using sa(1)[unfolded ksimplex_def] using j unfolding sa by auto thus "lab x j \ 0" by auto qed - moreover have "j\{0..n}" using * by auto - ultimately have False unfolding part1[THEN sym] using * unfolding image_iff by auto thus ?thesis by auto qed auto qed + case False hence *:"j\{1..n}" using j by auto + hence "\x. x\f \ reduced lab n x < j" apply(rule reduced_labelling_1) proof- fix x assume "x\f" + hence "lab x j = 1" apply-apply(rule assms(3)[rule_format,OF j(1)]) + using sa(1)[unfolded ksimplex_def] using j unfolding sa by auto thus "lab x j \ 0" by auto qed + moreover have "j\{0..n}" using * by auto + ultimately have False unfolding part1[THEN sym] using * unfolding image_iff by auto thus ?thesis by auto qed auto qed thus "ksimplex p n f" using as unfolding simplex_top_face[OF assms(1) *,THEN sym] by auto qed qed lemma kuhn_induction_Suc: diff -r d488ae70366d -r 5abc60a017e0 src/HOL/Multivariate_Analysis/Derivative.thy --- a/src/HOL/Multivariate_Analysis/Derivative.thy Sun Mar 13 21:41:44 2011 +0100 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy Sun Mar 13 22:24:10 2011 +0100 @@ -374,9 +374,9 @@ show "norm (f y - f x - f' (y - x)) \ e * norm (y - x)" proof(cases "y=x") case True thus ?thesis using `bounded_linear f'` by(auto simp add: zero) next case False hence "norm (f y - (f x + f' (y - x))) < e * norm (y - x)" using as(4)[rule_format, OF `y\s`] - unfolding dist_norm diff_0_right using as(3) - using pos_divide_less_eq[OF False[unfolded dist_nz], unfolded dist_norm] - by (auto simp add: linear_0 linear_sub) + unfolding dist_norm diff_0_right using as(3) + using pos_divide_less_eq[OF False[unfolded dist_nz], unfolded dist_norm] + by (auto simp add: linear_0 linear_sub) thus ?thesis by(auto simp add:algebra_simps) qed qed next assume ?rhs thus ?lhs unfolding has_derivative_within Lim_within apply-apply(erule conjE,rule,assumption) apply(rule,erule_tac x="e/2" in allE,rule,erule impE) defer apply(erule exE,rule_tac x=d in exI) @@ -678,7 +678,7 @@ guess c using continuous_attains_inf[OF compact_interval * assms(3)] .. note c=this show ?thesis proof(cases "d\{a<.. c\{a<.. "(a + b) /2" + apply(rule_tac[3] x=c in bexI) using d c by auto next def e \ "(a + b) /2" case False hence "f d = f c" using d c assms(2) by auto hence "\x. x\{a..b} \ f x = f d" using c d apply- apply(erule_tac x=x in ballE)+ by auto thus ?thesis apply(rule_tac x=e in bexI) unfolding e_def using assms(1) by auto qed qed @@ -813,11 +813,11 @@ fix z assume as:"norm (z - y) < d" hence "z\t" using d2 d unfolding dist_norm by auto have "norm (g z - g y - g' (z - y)) \ norm (g' (f (g z) - y - f' (g z - g y)))" unfolding g'.diff f'.diff unfolding assms(3)[unfolded o_def id_def, THEN fun_cong] - unfolding assms(7)[rule_format,OF `z\t`] apply(subst norm_minus_cancel[THEN sym]) by auto + unfolding assms(7)[rule_format,OF `z\t`] apply(subst norm_minus_cancel[THEN sym]) by auto also have "\ \ norm(f (g z) - y - f' (g z - g y)) * C" by(rule C[THEN conjunct2,rule_format]) also have "\ \ (e / C) * norm (g z - g y) * C" apply(rule mult_right_mono) - apply(rule d0[THEN conjunct2,rule_format,unfolded assms(7)[rule_format,OF `y\t`]]) apply(cases "z=y") defer - apply(rule d1[THEN conjunct2, unfolded dist_norm,rule_format]) using as d C d0 by auto + apply(rule d0[THEN conjunct2,rule_format,unfolded assms(7)[rule_format,OF `y\t`]]) apply(cases "z=y") defer + apply(rule d1[THEN conjunct2, unfolded dist_norm,rule_format]) using as d C d0 by auto also have "\ \ e * norm (g z - g y)" using C by(auto simp add:field_simps) finally show "norm (g z - g y - g' (z - y)) \ e * norm (g z - g y)" by simp qed auto qed have *:"(0::real) < 1 / 2" by auto guess d using lem1[rule_format,OF *] .. note d=this def B\"C*2" @@ -834,7 +834,7 @@ show ?case apply(rule_tac x=k in exI,rule) defer proof(rule,rule) fix z assume as:"norm(z - y) < k" hence "norm (g z - g y - g' (z - y)) \ e / B * norm(g z - g y)" using d' k by auto also have "\ \ e * norm(z - y)" unfolding times_divide_eq_left pos_divide_le_eq[OF `B>0`] - using lem2[THEN spec[where x=z]] using k as using `e>0` by(auto simp add:field_simps) + using lem2[THEN spec[where x=z]] using k as using `e>0` by(auto simp add:field_simps) finally show "norm (g z - g y - g' (z - y)) \ e * norm (z - y)" by simp qed(insert k, auto) qed qed subsection {* Simply rewrite that based on the domain point x. *} @@ -976,7 +976,7 @@ show "\d>0. \y. 0 < dist y (f x) \ dist y (f x) < d \ dist (g y) (g (f x)) < e" apply(rule_tac x=d in exI) apply(rule,rule d[THEN conjunct1]) proof(rule,rule) case goal1 hence "g y \ g ` f ` (ball x e \ s)" using d[THEN conjunct2,unfolded subset_eq,THEN bspec[where x=y]] - by(auto simp add:dist_commute) + by(auto simp add:dist_commute) hence "g y \ ball x e \ s" using assms(4) by auto thus "dist (g y) (g (f x)) < e" using assms(4)[rule_format,OF `x\s`] by(auto simp add:dist_commute) qed qed moreover have "f x \ interior (f ` s)" apply(rule sussmann_open_mapping) @@ -1031,27 +1031,27 @@ show "\x\ball a d. \x'\ball a d. f x' = f x \ x' = x" proof(intro strip) fix x y assume as:"x\ball a d" "y\ball a d" "f x = f y" def ph \ "\w. w - g'(f w - f x)" have ph':"ph = g' \ (\w. f' a w - (f w - f x))" - unfolding ph_def o_def unfolding diff using f'g' by(auto simp add:algebra_simps) + unfolding ph_def o_def unfolding diff using f'g' by(auto simp add:algebra_simps) have "norm (ph x - ph y) \ (1/2) * norm (x - y)" - apply(rule differentiable_bound[OF convex_ball _ _ as(1-2), where f'="\x v. v - g'(f' x v)"]) - apply(rule_tac[!] ballI) proof- fix u assume u:"u \ ball a d" hence "u\s" using d d2 by auto - have *:"(\v. v - g' (f' u v)) = g' \ (\w. f' a w - f' u w)" unfolding o_def and diff using f'g' by auto - show "(ph has_derivative (\v. v - g' (f' u v))) (at u within ball a d)" - unfolding ph' * apply(rule diff_chain_within) defer apply(rule bounded_linear.has_derivative[OF assms(3)]) - apply(rule has_derivative_intros) defer apply(rule has_derivative_sub[where g'="\x.0",unfolded diff_0_right]) - apply(rule has_derivative_at_within) using assms(5) and `u\s` `a\s` + apply(rule differentiable_bound[OF convex_ball _ _ as(1-2), where f'="\x v. v - g'(f' x v)"]) + apply(rule_tac[!] ballI) proof- fix u assume u:"u \ ball a d" hence "u\s" using d d2 by auto + have *:"(\v. v - g' (f' u v)) = g' \ (\w. f' a w - f' u w)" unfolding o_def and diff using f'g' by auto + show "(ph has_derivative (\v. v - g' (f' u v))) (at u within ball a d)" + unfolding ph' * apply(rule diff_chain_within) defer apply(rule bounded_linear.has_derivative[OF assms(3)]) + apply(rule has_derivative_intros) defer apply(rule has_derivative_sub[where g'="\x.0",unfolded diff_0_right]) + apply(rule has_derivative_at_within) using assms(5) and `u\s` `a\s` by(auto intro!: has_derivative_intros derivative_linear) - have **:"bounded_linear (\x. f' u x - f' a x)" "bounded_linear (\x. f' a x - f' u x)" apply(rule_tac[!] bounded_linear_sub) - apply(rule_tac[!] derivative_linear) using assms(5) `u\s` `a\s` by auto - have "onorm (\v. v - g' (f' u v)) \ onorm g' * onorm (\w. f' a w - f' u w)" unfolding * apply(rule onorm_compose) - unfolding linear_conv_bounded_linear by(rule assms(3) **)+ - also have "\ \ onorm g' * k" apply(rule mult_left_mono) - using d1[THEN conjunct2,rule_format,of u] using onorm_neg[OF **(1)[unfolded linear_linear]] - using d and u and onorm_pos_le[OF assms(3)[unfolded linear_linear]] by(auto simp add:algebra_simps) - also have "\ \ 1/2" unfolding k_def by auto - finally show "onorm (\v. v - g' (f' u v)) \ 1 / 2" by assumption qed + have **:"bounded_linear (\x. f' u x - f' a x)" "bounded_linear (\x. f' a x - f' u x)" apply(rule_tac[!] bounded_linear_sub) + apply(rule_tac[!] derivative_linear) using assms(5) `u\s` `a\s` by auto + have "onorm (\v. v - g' (f' u v)) \ onorm g' * onorm (\w. f' a w - f' u w)" unfolding * apply(rule onorm_compose) + unfolding linear_conv_bounded_linear by(rule assms(3) **)+ + also have "\ \ onorm g' * k" apply(rule mult_left_mono) + using d1[THEN conjunct2,rule_format,of u] using onorm_neg[OF **(1)[unfolded linear_linear]] + using d and u and onorm_pos_le[OF assms(3)[unfolded linear_linear]] by(auto simp add:algebra_simps) + also have "\ \ 1/2" unfolding k_def by auto + finally show "onorm (\v. v - g' (f' u v)) \ 1 / 2" by assumption qed moreover have "norm (ph y - ph x) = norm (y - x)" apply(rule arg_cong[where f=norm]) - unfolding ph_def using diff unfolding as by auto + unfolding ph_def using diff unfolding as by auto ultimately show "x = y" unfolding norm_minus_commute by auto qed qed auto qed subsection {* Uniformly convergent sequence of derivatives. *} @@ -1066,9 +1066,9 @@ fix x assume "x\s" show "((\a. f m a - f n a) has_derivative (\h. f' m x h - f' n x h)) (at x within s)" by(rule has_derivative_intros assms(2)[rule_format] `x\s`)+ { fix h have "norm (f' m x h - f' n x h) \ norm (f' m x h - g' x h) + norm (f' n x h - g' x h)" - using norm_triangle_ineq[of "f' m x h - g' x h" "- f' n x h + g' x h"] unfolding norm_minus_commute by(auto simp add:algebra_simps) + using norm_triangle_ineq[of "f' m x h - g' x h" "- f' n x h + g' x h"] unfolding norm_minus_commute by(auto simp add:algebra_simps) also have "\ \ e * norm h+ e * norm h" using assms(3)[rule_format,OF `N\m` `x\s`, of h] assms(3)[rule_format,OF `N\n` `x\s`, of h] - by(auto simp add:field_simps) + by(auto simp add:field_simps) finally have "norm (f' m x h - f' n x h) \ 2 * e * norm h" by auto } thus "onorm (\h. f' m x h - f' n x h) \ 2 * e" apply-apply(rule onorm(2)) apply(rule linear_compose_sub) unfolding linear_conv_bounded_linear using assms(2)[rule_format,OF `x\s`, THEN derivative_linear] by auto qed qed @@ -1092,66 +1092,66 @@ fix x assume "x\s" show "Cauchy (\n. f n x)" proof(cases "x=x0") case True thus ?thesis using convergent_imp_cauchy[OF assms(5)] by auto next case False show ?thesis unfolding Cauchy_def proof(rule,rule) - fix e::real assume "e>0" hence *:"e/2>0" "e/2/norm(x-x0)>0" using False by(auto intro!:divide_pos_pos) - guess M using convergent_imp_cauchy[OF assms(5), unfolded Cauchy_def, rule_format,OF *(1)] .. note M=this - guess N using lem1[rule_format,OF *(2)] .. note N = this - show " \M. \m\M. \n\M. dist (f m x) (f n x) < e" apply(rule_tac x="max M N" in exI) proof(default+) - fix m n assume as:"max M N \m" "max M N\n" - have "dist (f m x) (f n x) \ norm (f m x0 - f n x0) + norm (f m x - f n x - (f m x0 - f n x0))" - unfolding dist_norm by(rule norm_triangle_sub) - also have "\ \ norm (f m x0 - f n x0) + e / 2" using N[rule_format,OF _ _ `x\s` `x0\s`, of m n] and as and False by auto - also have "\ < e / 2 + e / 2" apply(rule add_strict_right_mono) using as and M[rule_format] unfolding dist_norm by auto - finally show "dist (f m x) (f n x) < e" by auto qed qed qed qed + fix e::real assume "e>0" hence *:"e/2>0" "e/2/norm(x-x0)>0" using False by(auto intro!:divide_pos_pos) + guess M using convergent_imp_cauchy[OF assms(5), unfolded Cauchy_def, rule_format,OF *(1)] .. note M=this + guess N using lem1[rule_format,OF *(2)] .. note N = this + show " \M. \m\M. \n\M. dist (f m x) (f n x) < e" apply(rule_tac x="max M N" in exI) proof(default+) + fix m n assume as:"max M N \m" "max M N\n" + have "dist (f m x) (f n x) \ norm (f m x0 - f n x0) + norm (f m x - f n x - (f m x0 - f n x0))" + unfolding dist_norm by(rule norm_triangle_sub) + also have "\ \ norm (f m x0 - f n x0) + e / 2" using N[rule_format,OF _ _ `x\s` `x0\s`, of m n] and as and False by auto + also have "\ < e / 2 + e / 2" apply(rule add_strict_right_mono) using as and M[rule_format] unfolding dist_norm by auto + finally show "dist (f m x) (f n x) < e" by auto qed qed qed qed then guess g .. note g = this have lem2:"\e>0. \N. \n\N. \x\s. \y\s. norm((f n x - f n y) - (g x - g y)) \ e * norm(x - y)" proof(rule,rule) fix e::real assume *:"e>0" guess N using lem1[rule_format,OF *] .. note N=this show "\N. \n\N. \x\s. \y\s. norm (f n x - f n y - (g x - g y)) \ e * norm (x - y)" apply(rule_tac x=N in exI) proof(default+) fix n x y assume as:"N \ n" "x \ s" "y \ s" have "eventually (\xa. norm (f n x - f n y - (f xa x - f xa y)) \ e * norm (x - y)) sequentially" - unfolding eventually_sequentially apply(rule_tac x=N in exI) proof(rule,rule) - fix m assume "N\m" thus "norm (f n x - f n y - (f m x - f m y)) \ e * norm (x - y)" - using N[rule_format, of n m x y] and as by(auto simp add:algebra_simps) qed + unfolding eventually_sequentially apply(rule_tac x=N in exI) proof(rule,rule) + fix m assume "N\m" thus "norm (f n x - f n y - (f m x - f m y)) \ e * norm (x - y)" + using N[rule_format, of n m x y] and as by(auto simp add:algebra_simps) qed thus "norm (f n x - f n y - (g x - g y)) \ e * norm (x - y)" apply- - apply(rule Lim_norm_ubound[OF trivial_limit_sequentially, where f="\m. (f n x - f n y) - (f m x - f m y)"]) - apply(rule Lim_sub Lim_const g[rule_format] as)+ by assumption qed qed + apply(rule Lim_norm_ubound[OF trivial_limit_sequentially, where f="\m. (f n x - f n y) - (f m x - f m y)"]) + apply(rule Lim_sub Lim_const g[rule_format] as)+ by assumption qed qed show ?thesis unfolding has_derivative_within_alt apply(rule_tac x=g in exI) apply(rule,rule,rule g[rule_format],assumption) proof fix x assume "x\s" have lem3:"\u. ((\n. f' n x u) ---> g' x u) sequentially" unfolding Lim_sequentially proof(rule,rule,rule) fix u and e::real assume "e>0" show "\N. \n\N. dist (f' n x u) (g' x u) < e" proof(cases "u=0") - case True guess N using assms(3)[rule_format,OF `e>0`] .. note N=this - show ?thesis apply(rule_tac x=N in exI) unfolding True - using N[rule_format,OF _ `x\s`,of _ 0] and `e>0` by auto next - case False hence *:"e / 2 / norm u > 0" using `e>0` by(auto intro!: divide_pos_pos) - guess N using assms(3)[rule_format,OF *] .. note N=this - show ?thesis apply(rule_tac x=N in exI) proof(rule,rule) case goal1 - show ?case unfolding dist_norm using N[rule_format,OF goal1 `x\s`, of u] False `e>0` - by (auto simp add:field_simps) qed qed qed + case True guess N using assms(3)[rule_format,OF `e>0`] .. note N=this + show ?thesis apply(rule_tac x=N in exI) unfolding True + using N[rule_format,OF _ `x\s`,of _ 0] and `e>0` by auto next + case False hence *:"e / 2 / norm u > 0" using `e>0` by(auto intro!: divide_pos_pos) + guess N using assms(3)[rule_format,OF *] .. note N=this + show ?thesis apply(rule_tac x=N in exI) proof(rule,rule) case goal1 + show ?case unfolding dist_norm using N[rule_format,OF goal1 `x\s`, of u] False `e>0` + by (auto simp add:field_simps) qed qed qed show "bounded_linear (g' x)" unfolding linear_linear linear_def apply(rule,rule,rule) defer proof(rule,rule) fix x' y z::"'m" and c::real note lin = assms(2)[rule_format,OF `x\s`,THEN derivative_linear] show "g' x (c *\<^sub>R x') = c *\<^sub>R g' x x'" apply(rule Lim_unique[OF trivial_limit_sequentially]) - apply(rule lem3[rule_format]) + apply(rule lem3[rule_format]) unfolding lin[unfolded bounded_linear_def bounded_linear_axioms_def,THEN conjunct2,THEN conjunct1,rule_format] - apply(rule Lim_cmul) by(rule lem3[rule_format]) + apply(rule Lim_cmul) by(rule lem3[rule_format]) show "g' x (y + z) = g' x y + g' x z" apply(rule Lim_unique[OF trivial_limit_sequentially]) - apply(rule lem3[rule_format]) unfolding lin[unfolded bounded_linear_def additive_def,THEN conjunct1,rule_format] + apply(rule lem3[rule_format]) unfolding lin[unfolded bounded_linear_def additive_def,THEN conjunct1,rule_format] apply(rule Lim_add) by(rule lem3[rule_format])+ qed show "\e>0. \d>0. \y\s. norm (y - x) < d \ norm (g y - g x - g' x (y - x)) \ e * norm (y - x)" proof(rule,rule) case goal1 have *:"e/3>0" using goal1 by auto guess N1 using assms(3)[rule_format,OF *] .. note N1=this guess N2 using lem2[rule_format,OF *] .. note N2=this guess d1 using assms(2)[unfolded has_derivative_within_alt, rule_format,OF `x\s`, of "max N1 N2",THEN conjunct2,rule_format,OF *] .. note d1=this show ?case apply(rule_tac x=d1 in exI) apply(rule,rule d1[THEN conjunct1]) proof(rule,rule) - fix y assume as:"y \ s" "norm (y - x) < d1" let ?N ="max N1 N2" - have "norm (g y - g x - (f ?N y - f ?N x)) \ e /3 * norm (y - x)" apply(subst norm_minus_cancel[THEN sym]) - using N2[rule_format, OF _ `y\s` `x\s`, of ?N] by auto moreover - have "norm (f ?N y - f ?N x - f' ?N x (y - x)) \ e / 3 * norm (y - x)" using d1 and as by auto ultimately - have "norm (g y - g x - f' ?N x (y - x)) \ 2 * e / 3 * norm (y - x)" - using norm_triangle_le[of "g y - g x - (f ?N y - f ?N x)" "f ?N y - f ?N x - f' ?N x (y - x)" "2 * e / 3 * norm (y - x)"] - by (auto simp add:algebra_simps) moreover - have " norm (f' ?N x (y - x) - g' x (y - x)) \ e / 3 * norm (y - x)" using N1 `x\s` by auto - ultimately show "norm (g y - g x - g' x (y - x)) \ e * norm (y - x)" - using norm_triangle_le[of "g y - g x - f' (max N1 N2) x (y - x)" "f' (max N1 N2) x (y - x) - g' x (y - x)"] by(auto simp add:algebra_simps) - qed qed qed qed + fix y assume as:"y \ s" "norm (y - x) < d1" let ?N ="max N1 N2" + have "norm (g y - g x - (f ?N y - f ?N x)) \ e /3 * norm (y - x)" apply(subst norm_minus_cancel[THEN sym]) + using N2[rule_format, OF _ `y\s` `x\s`, of ?N] by auto moreover + have "norm (f ?N y - f ?N x - f' ?N x (y - x)) \ e / 3 * norm (y - x)" using d1 and as by auto ultimately + have "norm (g y - g x - f' ?N x (y - x)) \ 2 * e / 3 * norm (y - x)" + using norm_triangle_le[of "g y - g x - (f ?N y - f ?N x)" "f ?N y - f ?N x - f' ?N x (y - x)" "2 * e / 3 * norm (y - x)"] + by (auto simp add:algebra_simps) moreover + have " norm (f' ?N x (y - x) - g' x (y - x)) \ e / 3 * norm (y - x)" using N1 `x\s` by auto + ultimately show "norm (g y - g x - g' x (y - x)) \ e * norm (y - x)" + using norm_triangle_le[of "g y - g x - f' (max N1 N2) x (y - x)" "f' (max N1 N2) x (y - x) - g' x (y - x)"] by(auto simp add:algebra_simps) + qed qed qed qed subsection {* Can choose to line up antiderivatives if we want. *} @@ -1174,9 +1174,9 @@ fix e::real assume "00`] .. note N=this show "\N. \n\N. \x\s. \h. norm (f' n x h - g' x h) \ e * norm h" apply(rule_tac x=N in exI) proof(default+) case goal1 have *:"inverse (real (Suc n)) \ e" apply(rule order_trans[OF _ N[THEN less_imp_le]]) - using goal1(1) by(auto simp add:field_simps) + using goal1(1) by(auto simp add:field_simps) show ?case using f[rule_format,THEN conjunct2,OF goal1(2), of n, THEN spec[where x=h]] - apply(rule order_trans) using N * apply(cases "h=0") by auto qed qed(insert f,auto) qed + apply(rule order_trans) using N * apply(cases "h=0") by auto qed qed(insert f,auto) qed subsection {* Differentiation of a series. *} @@ -1220,12 +1220,12 @@ fix y assume as:"y \ s" "0 < dist y x" "dist y x < e / (B * C * D)" have "norm (h (f' (y - x)) (g' (y - x))) \ norm (f' (y - x)) * norm (g' (y - x)) * B" using B by auto also have "\ \ (norm (y - x) * C) * (D * norm (y - x)) * B" apply(rule mult_right_mono) - apply(rule mult_mono) using B C D by (auto simp add: field_simps intro!:mult_nonneg_nonneg) + apply(rule mult_mono) using B C D by (auto simp add: field_simps intro!:mult_nonneg_nonneg) also have "\ = (B * C * D * norm (y - x)) * norm (y - x)" by(auto simp add:field_simps) also have "\ < e * norm (y - x)" apply(rule mult_strict_right_mono) - using as(3)[unfolded dist_norm] and as(2) unfolding pos_less_divide_eq[OF bcd] by (auto simp add:field_simps) + using as(3)[unfolded dist_norm] and as(2) unfolding pos_less_divide_eq[OF bcd] by (auto simp add:field_simps) finally show "dist ((1 / norm (y - x)) *\<^sub>R h (f' (y - x)) (g' (y - x))) 0 < e" - unfolding dist_norm apply-apply(cases "y = x") by(auto simp add:field_simps) qed qed + unfolding dist_norm apply-apply(cases "y = x") by(auto simp add:field_simps) qed qed have "bounded_linear (\d. h (f x) (g' d) + h (f' d) (g x))" apply (rule bounded_linear_add) apply (rule bounded_linear_compose [OF h.bounded_linear_right `bounded_linear g'`]) diff -r d488ae70366d -r 5abc60a017e0 src/HOL/Multivariate_Analysis/Fashoda.thy --- a/src/HOL/Multivariate_Analysis/Fashoda.thy Sun Mar 13 21:41:44 2011 +0100 +++ b/src/HOL/Multivariate_Analysis/Fashoda.thy Sun Mar 13 22:24:10 2011 +0100 @@ -48,8 +48,8 @@ apply(rule continuous_at_infnorm) unfolding infnorm_eq_0 defer apply(rule continuous_on_id) apply(rule linear_continuous_on) proof- show "bounded_linear negatex" apply(rule bounded_linearI') unfolding Cart_eq proof(rule_tac[!] allI) fix i::2 and x y::"real^2" and c::real show "negatex (x + y) $ i = (negatex x + negatex y) $ i" "negatex (c *\<^sub>R x) $ i = (c *\<^sub>R negatex x) $ i" - apply-apply(case_tac[!] "i\1") prefer 3 apply(drule_tac[1-2] 21) - unfolding negatex_def by(auto simp add:vector_2 ) qed qed(insert x0, auto) + apply-apply(case_tac[!] "i\1") prefer 3 apply(drule_tac[1-2] 21) + unfolding negatex_def by(auto simp add:vector_2 ) qed qed(insert x0, auto) have 3:"(negatex \ sqprojection \ ?F) ` {- 1..1} \ {- 1..1}" unfolding subset_eq apply rule proof- case goal1 then guess y unfolding image_iff .. note y=this have "?F y \ 0" apply(rule x0) using y(1) by auto hence *:"infnorm (sqprojection (?F y)) = 1" unfolding y o_def apply- by(rule lem2[rule_format]) diff -r d488ae70366d -r 5abc60a017e0 src/HOL/Multivariate_Analysis/Integration.thy --- a/src/HOL/Multivariate_Analysis/Integration.thy Sun Mar 13 21:41:44 2011 +0100 +++ b/src/HOL/Multivariate_Analysis/Integration.thy Sun Mar 13 22:24:10 2011 +0100 @@ -136,33 +136,33 @@ case True show ?thesis proof(cases "x\{a<.. a$$k \ x$$k \ b$$k" and k:"k x$$k = b$$k" using True unfolding ab and mem_interval apply(erule_tac x=k in allE) by auto hence "\x. ball x (e/2) \ s \ (\f)" proof(erule_tac disjE) let ?z = "x - (e/2) *\<^sub>R basis k" assume as:"x$$k = a$$k" have "ball ?z (e / 2) \ i = {}" apply(rule ccontr) unfolding ex_in_conv[THEN sym] proof(erule exE) - fix y assume "y \ ball ?z (e / 2) \ i" hence "dist ?z y < e/2" and yi:"y\i" by auto - hence "\(?z - y) $$ k\ < e/2" using component_le_norm[of "?z - y" k] unfolding dist_norm by auto - hence "y$$k < a$$k" using e[THEN conjunct1] k by(auto simp add:field_simps basis_component as) - hence "y \ i" unfolding ab mem_interval not_all apply(rule_tac x=k in exI) using k by auto thus False using yi by auto qed + fix y assume "y \ ball ?z (e / 2) \ i" hence "dist ?z y < e/2" and yi:"y\i" by auto + hence "\(?z - y) $$ k\ < e/2" using component_le_norm[of "?z - y" k] unfolding dist_norm by auto + hence "y$$k < a$$k" using e[THEN conjunct1] k by(auto simp add:field_simps basis_component as) + hence "y \ i" unfolding ab mem_interval not_all apply(rule_tac x=k in exI) using k by auto thus False using yi by auto qed moreover have "ball ?z (e/2) \ s \ (\insert i f)" apply(rule order_trans[OF _ e[THEN conjunct2, unfolded lem1]]) proof - fix y assume as:"y\ ball ?z (e/2)" have "norm (x - y) \ \e\ / 2 + norm (x - y - (e / 2) *\<^sub>R basis k)" - apply-apply(rule order_trans,rule norm_triangle_sub[of "x - y" "(e/2) *\<^sub>R basis k"]) - unfolding norm_scaleR norm_basis by auto - also have "\ < \e\ / 2 + \e\ / 2" apply(rule add_strict_left_mono) using as unfolding mem_ball dist_norm using e by(auto simp add:field_simps) - finally show "y\ball x e" unfolding mem_ball dist_norm using e by(auto simp add:field_simps) qed + fix y assume as:"y\ ball ?z (e/2)" have "norm (x - y) \ \e\ / 2 + norm (x - y - (e / 2) *\<^sub>R basis k)" + apply-apply(rule order_trans,rule norm_triangle_sub[of "x - y" "(e/2) *\<^sub>R basis k"]) + unfolding norm_scaleR norm_basis by auto + also have "\ < \e\ / 2 + \e\ / 2" apply(rule add_strict_left_mono) using as unfolding mem_ball dist_norm using e by(auto simp add:field_simps) + finally show "y\ball x e" unfolding mem_ball dist_norm using e by(auto simp add:field_simps) qed ultimately show ?thesis apply(rule_tac x="?z" in exI) unfolding Union_insert by auto next let ?z = "x + (e/2) *\<^sub>R basis k" assume as:"x$$k = b$$k" have "ball ?z (e / 2) \ i = {}" apply(rule ccontr) unfolding ex_in_conv[THEN sym] proof(erule exE) - fix y assume "y \ ball ?z (e / 2) \ i" hence "dist ?z y < e/2" and yi:"y\i" by auto - hence "\(?z - y) $$ k\ < e/2" using component_le_norm[of "?z - y" k] unfolding dist_norm by auto - hence "y$$k > b$$k" using e[THEN conjunct1] k by(auto simp add:field_simps as) - hence "y \ i" unfolding ab mem_interval not_all using k by(rule_tac x=k in exI,auto) thus False using yi by auto qed + fix y assume "y \ ball ?z (e / 2) \ i" hence "dist ?z y < e/2" and yi:"y\i" by auto + hence "\(?z - y) $$ k\ < e/2" using component_le_norm[of "?z - y" k] unfolding dist_norm by auto + hence "y$$k > b$$k" using e[THEN conjunct1] k by(auto simp add:field_simps as) + hence "y \ i" unfolding ab mem_interval not_all using k by(rule_tac x=k in exI,auto) thus False using yi by auto qed moreover have "ball ?z (e/2) \ s \ (\insert i f)" apply(rule order_trans[OF _ e[THEN conjunct2, unfolded lem1]]) proof - fix y assume as:"y\ ball ?z (e/2)" have "norm (x - y) \ \e\ / 2 + norm (x - y + (e / 2) *\<^sub>R basis k)" - apply-apply(rule order_trans,rule norm_triangle_sub[of "x - y" "- (e/2) *\<^sub>R basis k"]) - unfolding norm_scaleR by auto - also have "\ < \e\ / 2 + \e\ / 2" apply(rule add_strict_left_mono) using as unfolding mem_ball dist_norm using e by(auto simp add:field_simps) - finally show "y\ball x e" unfolding mem_ball dist_norm using e by(auto simp add:field_simps) qed + fix y assume as:"y\ ball ?z (e/2)" have "norm (x - y) \ \e\ / 2 + norm (x - y + (e / 2) *\<^sub>R basis k)" + apply-apply(rule order_trans,rule norm_triangle_sub[of "x - y" "- (e/2) *\<^sub>R basis k"]) + unfolding norm_scaleR by auto + also have "\ < \e\ / 2 + \e\ / 2" apply(rule add_strict_left_mono) using as unfolding mem_ball dist_norm using e by(auto simp add:field_simps) + finally show "y\ball x e" unfolding mem_ball dist_norm using e by(auto simp add:field_simps) qed ultimately show ?thesis apply(rule_tac x="?z" in exI) unfolding Union_insert by auto qed then guess x .. hence "x \ s \ interior (\f)" unfolding lem1[where U="\f",THEN sym] using centre_in_ball e[THEN conjunct1] by auto thus ?thesis apply-apply(rule lem2,rule insert(3)) using insert(4) by auto qed qed qed qed note * = this @@ -576,11 +576,11 @@ apply(rule inter_interior_unions_intervals) apply(rule p open_interior ballI)+ proof(assumption,rule) fix k assume k:"k\p" have *:"\u t s. u \ s \ s \ t = {} \ u \ t = {}" by auto show "interior (\(\i. \(q i - {i})) ` p) \ interior k = {}" apply(rule *[of _ "interior (\(q k - {k}))"]) - defer apply(subst Int_commute) apply(rule inter_interior_unions_intervals) proof- note qk=division_ofD[OF q(1)[OF k]] - show "finite (q k - {k})" "open (interior k)" "\t\q k - {k}. \a b. t = {a..b}" using qk by auto - show "\t\q k - {k}. interior k \ interior t = {}" using qk(5) using q(2)[OF k] by auto - have *:"\x s. x \ s \ \s \ x" by auto show "interior (\(\i. \(q i - {i})) ` p) \ interior (\(q k - {k}))" - apply(rule subset_interior *)+ using k by auto qed qed qed auto qed + defer apply(subst Int_commute) apply(rule inter_interior_unions_intervals) proof- note qk=division_ofD[OF q(1)[OF k]] + show "finite (q k - {k})" "open (interior k)" "\t\q k - {k}. \a b. t = {a..b}" using qk by auto + show "\t\q k - {k}. interior k \ interior t = {}" using qk(5) using q(2)[OF k] by auto + have *:"\x s. x \ s \ \s \ x" by auto show "interior (\(\i. \(q i - {i})) ` p) \ interior (\(q k - {k}))" + apply(rule subset_interior *)+ using k by auto qed qed qed auto qed lemma elementary_bounded[dest]: "p division_of s \ bounded (s::('a::ordered_euclidean_space) set)" unfolding division_of_def by(metis bounded_Union bounded_interval)