670 let ?s = "insert a3 (s - {a0})" have "ksimplex p n ?s" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) |
670 let ?s = "insert a3 (s - {a0})" have "ksimplex p n ?s" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) |
671 show "card ?s = n + 1" using ksimplexD(2-3)[OF assms(1)] |
671 show "card ?s = n + 1" using ksimplexD(2-3)[OF assms(1)] |
672 using `a3\<noteq>a0` `a3\<notin>s` `a0\<in>s` by(auto simp add:card_insert_if) |
672 using `a3\<noteq>a0` `a3\<notin>s` `a0\<in>s` by(auto simp add:card_insert_if) |
673 fix x assume x:"x \<in> insert a3 (s - {a0})" |
673 fix x assume x:"x \<in> insert a3 (s - {a0})" |
674 show "\<forall>j. x j \<le> p" proof(rule,cases "x = a3") |
674 show "\<forall>j. x j \<le> p" proof(rule,cases "x = a3") |
675 fix j case False thus "x j\<le>p" using x ksimplexD(4)[OF assms(1)] by auto next |
675 fix j case False thus "x j\<le>p" using x ksimplexD(4)[OF assms(1)] by auto next |
676 fix j case True show "x j\<le>p" unfolding True proof(cases "j=k") |
676 fix j case True show "x j\<le>p" unfolding True proof(cases "j=k") |
677 case False thus "a3 j \<le>p" unfolding True a3_def using `a1\<in>s` ksimplexD(4)[OF assms(1)] by auto next |
677 case False thus "a3 j \<le>p" unfolding True a3_def using `a1\<in>s` ksimplexD(4)[OF assms(1)] by auto next |
678 guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this |
678 guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this |
679 have "a2 k \<le> a4 k" using lem3[OF a4(1)[unfolded `a=a0`],THEN kle_imp_pointwise] by auto |
679 have "a2 k \<le> a4 k" using lem3[OF a4(1)[unfolded `a=a0`],THEN kle_imp_pointwise] by auto |
680 also have "\<dots> < p" using ksimplexD(4)[OF assms(1),rule_format,of a4 k] using a4 by auto |
680 also have "\<dots> < p" using ksimplexD(4)[OF assms(1),rule_format,of a4 k] using a4 by auto |
681 finally have *:"a0 k + 1 < p" unfolding k(2)[rule_format] by auto |
681 finally have *:"a0 k + 1 < p" unfolding k(2)[rule_format] by auto |
682 case True thus "a3 j \<le>p" unfolding a3_def unfolding a0a1(5)[rule_format] |
682 case True thus "a3 j \<le>p" unfolding a3_def unfolding a0a1(5)[rule_format] |
683 using k(1) k(2)assms(5) using * by simp qed qed |
683 using k(1) k(2)assms(5) using * by simp qed qed |
684 show "\<forall>j. j \<notin> {1..n} \<longrightarrow> x j = p" proof(rule,rule,cases "x=a3") fix j::nat assume j:"j\<notin>{1..n}" |
684 show "\<forall>j. j \<notin> {1..n} \<longrightarrow> x j = p" proof(rule,rule,cases "x=a3") fix j::nat assume j:"j\<notin>{1..n}" |
685 { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } |
685 { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } |
686 case True show "x j = p" unfolding True a3_def using j k(1) |
686 case True show "x j = p" unfolding True a3_def using j k(1) |
687 using ksimplexD(5)[OF assms(1),rule_format,OF `a1\<in>s` j] by auto qed |
687 using ksimplexD(5)[OF assms(1),rule_format,OF `a1\<in>s` j] by auto qed |
688 fix y assume y:"y\<in>insert a3 (s - {a0})" |
688 fix y assume y:"y\<in>insert a3 (s - {a0})" |
689 have lem4:"\<And>x. x\<in>s \<Longrightarrow> x\<noteq>a0 \<Longrightarrow> kle n x a3" proof- case goal1 |
689 have lem4:"\<And>x. x\<in>s \<Longrightarrow> x\<noteq>a0 \<Longrightarrow> kle n x a3" proof- case goal1 |
690 guess kk using a0a1(4)[rule_format,OF `x\<in>s`,THEN conjunct2,unfolded kle_def] |
690 guess kk using a0a1(4)[rule_format,OF `x\<in>s`,THEN conjunct2,unfolded kle_def] |
691 apply-apply(erule exE,erule conjE) . note kk=this |
691 apply-apply(erule exE,erule conjE) . note kk=this |
692 have "k\<notin>kk" proof assume "k\<in>kk" |
692 have "k\<notin>kk" proof assume "k\<in>kk" |
693 hence "a1 k = x k + 1" using kk by auto |
693 hence "a1 k = x k + 1" using kk by auto |
694 hence "a0 k = x k" unfolding a0a1(5)[rule_format] using k(1) by auto |
694 hence "a0 k = x k" unfolding a0a1(5)[rule_format] using k(1) by auto |
695 hence "a2 k = x k + 1" unfolding k(2)[rule_format] by auto moreover |
695 hence "a2 k = x k + 1" unfolding k(2)[rule_format] by auto moreover |
696 have "a2 k \<le> x k" using lem3[of x,THEN kle_imp_pointwise] goal1 by auto |
696 have "a2 k \<le> x k" using lem3[of x,THEN kle_imp_pointwise] goal1 by auto |
697 ultimately show False by auto qed |
697 ultimately show False by auto qed |
698 thus ?case unfolding kle_def apply(rule_tac x="insert k kk" in exI) using kk(1) |
698 thus ?case unfolding kle_def apply(rule_tac x="insert k kk" in exI) using kk(1) |
699 unfolding a3_def kle_def kk(2)[rule_format] using k(1) by auto qed |
699 unfolding a3_def kle_def kk(2)[rule_format] using k(1) by auto qed |
700 show "kle n x y \<or> kle n y x" proof(cases "y=a3") |
700 show "kle n x y \<or> kle n y x" proof(cases "y=a3") |
701 case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI1,rule lem4) |
701 case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI1,rule lem4) |
702 using x by auto next |
702 using x by auto next |
703 case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True |
703 case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True |
704 apply(rule disjI2,rule lem4) using y False by auto next |
704 apply(rule disjI2,rule lem4) using y False by auto next |
705 case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) |
705 case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) |
706 using x y `y\<noteq>a3` by auto qed qed qed |
706 using x y `y\<noteq>a3` by auto qed qed qed |
707 hence "insert a3 (s - {a0}) \<in> ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) |
707 hence "insert a3 (s - {a0}) \<in> ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) |
708 apply(rule_tac x="a3" in bexI) unfolding `a=a0` using `a3\<notin>s` by auto moreover |
708 apply(rule_tac x="a3" in bexI) unfolding `a=a0` using `a3\<notin>s` by auto moreover |
709 have "s \<in> ?A" using assms(1,2) by auto ultimately have "?A \<supseteq> {s, insert a3 (s - {a0})}" by auto |
709 have "s \<in> ?A" using assms(1,2) by auto ultimately have "?A \<supseteq> {s, insert a3 (s - {a0})}" by auto |
710 moreover have "?A \<subseteq> {s, insert a3 (s - {a0})}" apply(rule) unfolding mem_Collect_eq proof(erule conjE) |
710 moreover have "?A \<subseteq> {s, insert a3 (s - {a0})}" apply(rule) unfolding mem_Collect_eq proof(erule conjE) |
711 fix s' assume as:"ksimplex p n s'" and "\<exists>b\<in>s'. s' - {b} = s - {a}" |
711 fix s' assume as:"ksimplex p n s'" and "\<exists>b\<in>s'. s' - {b} = s - {a}" |
712 from this(2) guess a' .. note a'=this |
712 from this(2) guess a' .. note a'=this |
713 guess a_min a_max apply(rule ksimplex_extrema_strong[OF as assms(3)]) . note min_max=this |
713 guess a_min a_max apply(rule ksimplex_extrema_strong[OF as assms(3)]) . note min_max=this |
714 have *:"\<forall>x\<in>s' - {a'}. x k = a2 k" unfolding a' proof fix x assume x:"x\<in>s-{a}" |
714 have *:"\<forall>x\<in>s' - {a'}. x k = a2 k" unfolding a' proof fix x assume x:"x\<in>s-{a}" |
715 hence "kle n a2 x" apply-apply(rule lem3) using `a=a0` by auto |
715 hence "kle n a2 x" apply-apply(rule lem3) using `a=a0` by auto |
716 hence "a2 k \<le> x k" apply(drule_tac kle_imp_pointwise) by auto moreover |
716 hence "a2 k \<le> x k" apply(drule_tac kle_imp_pointwise) by auto moreover |
717 have "x k \<le> a2 k" unfolding k(2)[rule_format] using a0a1(4)[rule_format,of x,THEN conjunct1] |
717 have "x k \<le> a2 k" unfolding k(2)[rule_format] using a0a1(4)[rule_format,of x,THEN conjunct1] |
718 unfolding kle_def using x by auto ultimately show "x k = a2 k" by auto qed |
718 unfolding kle_def using x by auto ultimately show "x k = a2 k" by auto qed |
719 have **:"a'=a_min \<or> a'=a_max" apply(rule ksimplex_fix_plane[OF a'(1) k(1) *]) using min_max by auto |
719 have **:"a'=a_min \<or> a'=a_max" apply(rule ksimplex_fix_plane[OF a'(1) k(1) *]) using min_max by auto |
720 show "s' \<in> {s, insert a3 (s - {a0})}" proof(cases "a'=a_min") |
720 show "s' \<in> {s, insert a3 (s - {a0})}" proof(cases "a'=a_min") |
721 case True have "a_max = a1" unfolding kle_antisym[THEN sym,of a_max a1 n] apply(rule) |
721 case True have "a_max = a1" unfolding kle_antisym[THEN sym,of a_max a1 n] apply(rule) |
722 apply(rule a0a1(4)[rule_format,THEN conjunct2]) defer proof(rule min_max(4)[rule_format,THEN conjunct2]) |
722 apply(rule a0a1(4)[rule_format,THEN conjunct2]) defer proof(rule min_max(4)[rule_format,THEN conjunct2]) |
723 show "a1\<in>s'" using a' unfolding `a=a0` using a0a1 by auto |
723 show "a1\<in>s'" using a' unfolding `a=a0` using a0a1 by auto |
724 show "a_max \<in> s" proof(rule ccontr) assume "a_max\<notin>s" |
724 show "a_max \<in> s" proof(rule ccontr) assume "a_max\<notin>s" |
725 hence "a_max = a'" using a' min_max by auto |
725 hence "a_max = a'" using a' min_max by auto |
726 thus False unfolding True using min_max by auto qed qed |
726 thus False unfolding True using min_max by auto qed qed |
727 hence "\<forall>i. a_max i = a1 i" by auto |
727 hence "\<forall>i. a_max i = a1 i" by auto |
728 hence "a' = a" unfolding True `a=a0` apply-apply(subst fun_eq_iff,rule) |
728 hence "a' = a" unfolding True `a=a0` apply-apply(subst fun_eq_iff,rule) |
729 apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] |
729 apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] |
730 proof- case goal1 thus ?case apply(cases "x\<in>{1..n}") by auto qed |
730 proof- case goal1 thus ?case apply(cases "x\<in>{1..n}") by auto qed |
731 hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\<in>s` `a'\<in>s'` by auto |
731 hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\<in>s` `a'\<in>s'` by auto |
732 thus ?thesis by auto next |
732 thus ?thesis by auto next |
733 case False hence as:"a' = a_max" using ** by auto |
733 case False hence as:"a' = a_max" using ** by auto |
734 have "a_min = a2" unfolding kle_antisym[THEN sym, of _ _ n] apply rule |
734 have "a_min = a2" unfolding kle_antisym[THEN sym, of _ _ n] apply rule |
735 apply(rule min_max(4)[rule_format,THEN conjunct1]) defer proof(rule lem3) |
735 apply(rule min_max(4)[rule_format,THEN conjunct1]) defer proof(rule lem3) |
736 show "a_min \<in> s - {a0}" unfolding a'(2)[THEN sym,unfolded `a=a0`] |
736 show "a_min \<in> s - {a0}" unfolding a'(2)[THEN sym,unfolded `a=a0`] |
737 unfolding as using min_max(1-3) by auto |
737 unfolding as using min_max(1-3) by auto |
738 have "a2 \<noteq> a" unfolding `a=a0` using k(2)[rule_format,of k] by auto |
738 have "a2 \<noteq> a" unfolding `a=a0` using k(2)[rule_format,of k] by auto |
739 hence "a2 \<in> s - {a}" using a2 by auto thus "a2 \<in> s'" unfolding a'(2)[THEN sym] by auto qed |
739 hence "a2 \<in> s - {a}" using a2 by auto thus "a2 \<in> s'" unfolding a'(2)[THEN sym] by auto qed |
740 hence "\<forall>i. a_min i = a2 i" by auto |
740 hence "\<forall>i. a_min i = a2 i" by auto |
741 hence "a' = a3" unfolding as `a=a0` apply-apply(subst fun_eq_iff,rule) |
741 hence "a' = a3" unfolding as `a=a0` apply-apply(subst fun_eq_iff,rule) |
742 apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] |
742 apply(erule_tac x=x in allE) unfolding a0a1(5)[rule_format] min_max(5)[rule_format] |
743 unfolding a3_def k(2)[rule_format] unfolding a0a1(5)[rule_format] proof- case goal1 |
743 unfolding a3_def k(2)[rule_format] unfolding a0a1(5)[rule_format] proof- case goal1 |
744 show ?case unfolding goal1 apply(cases "x\<in>{1..n}") defer apply(cases "x=k") |
744 show ?case unfolding goal1 apply(cases "x\<in>{1..n}") defer apply(cases "x=k") |
745 using `k\<in>{1..n}` by auto qed |
745 using `k\<in>{1..n}` by auto qed |
746 hence "s' = insert a3 (s - {a0})" apply-apply(rule lem1) defer apply assumption |
746 hence "s' = insert a3 (s - {a0})" apply-apply(rule lem1) defer apply assumption |
747 apply(rule a'(1)) unfolding a' `a=a0` using `a3\<notin>s` by auto |
747 apply(rule a'(1)) unfolding a' `a=a0` using `a3\<notin>s` by auto |
748 thus ?thesis by auto qed qed |
748 thus ?thesis by auto qed qed |
749 ultimately have *:"?A = {s, insert a3 (s - {a0})}" by blast |
749 ultimately have *:"?A = {s, insert a3 (s - {a0})}" by blast |
750 have "s \<noteq> insert a3 (s - {a0})" using `a3\<notin>s` by auto |
750 have "s \<noteq> insert a3 (s - {a0})" using `a3\<notin>s` by auto |
751 hence ?thesis unfolding * by auto } moreover |
751 hence ?thesis unfolding * by auto } moreover |
752 { assume "a=a1" |
752 { assume "a=a1" |
753 have *:"\<And>P Q. (P \<or> Q) \<Longrightarrow> \<not> P \<Longrightarrow> Q" by auto |
753 have *:"\<And>P Q. (P \<or> Q) \<Longrightarrow> \<not> P \<Longrightarrow> Q" by auto |
778 let ?s = "insert a3 (s - {a1})" have "ksimplex p n ?s" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) |
778 let ?s = "insert a3 (s - {a1})" have "ksimplex p n ?s" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) |
779 show "card ?s = n+1" using ksimplexD(2-3)[OF assms(1)] |
779 show "card ?s = n+1" using ksimplexD(2-3)[OF assms(1)] |
780 using `a3\<noteq>a0` `a3\<notin>s` `a1\<in>s` by(auto simp add:card_insert_if) |
780 using `a3\<noteq>a0` `a3\<notin>s` `a1\<in>s` by(auto simp add:card_insert_if) |
781 fix x assume x:"x \<in> insert a3 (s - {a1})" |
781 fix x assume x:"x \<in> insert a3 (s - {a1})" |
782 show "\<forall>j. x j \<le> p" proof(rule,cases "x = a3") |
782 show "\<forall>j. x j \<le> p" proof(rule,cases "x = a3") |
783 fix j case False thus "x j\<le>p" using x ksimplexD(4)[OF assms(1)] by auto next |
783 fix j case False thus "x j\<le>p" using x ksimplexD(4)[OF assms(1)] by auto next |
784 fix j case True show "x j\<le>p" unfolding True proof(cases "j=k") |
784 fix j case True show "x j\<le>p" unfolding True proof(cases "j=k") |
785 case False thus "a3 j \<le>p" unfolding True a3_def using `a0\<in>s` ksimplexD(4)[OF assms(1)] by auto next |
785 case False thus "a3 j \<le>p" unfolding True a3_def using `a0\<in>s` ksimplexD(4)[OF assms(1)] by auto next |
786 guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this |
786 guess a4 using assms(5)[unfolded bex_simps ball_simps,rule_format,OF k(1)] .. note a4=this |
787 case True have "a3 k \<le> a0 k" unfolding lem4[rule_format] by auto |
787 case True have "a3 k \<le> a0 k" unfolding lem4[rule_format] by auto |
788 also have "\<dots> \<le> p" using ksimplexD(4)[OF assms(1),rule_format,of a0 k] a0a1 by auto |
788 also have "\<dots> \<le> p" using ksimplexD(4)[OF assms(1),rule_format,of a0 k] a0a1 by auto |
789 finally show "a3 j \<le> p" unfolding True by auto qed qed |
789 finally show "a3 j \<le> p" unfolding True by auto qed qed |
790 show "\<forall>j. j \<notin> {1..n} \<longrightarrow> x j = p" proof(rule,rule,cases "x=a3") fix j::nat assume j:"j\<notin>{1..n}" |
790 show "\<forall>j. j \<notin> {1..n} \<longrightarrow> x j = p" proof(rule,rule,cases "x=a3") fix j::nat assume j:"j\<notin>{1..n}" |
791 { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } |
791 { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } |
792 case True show "x j = p" unfolding True a3_def using j k(1) |
792 case True show "x j = p" unfolding True a3_def using j k(1) |
793 using ksimplexD(5)[OF assms(1),rule_format,OF `a0\<in>s` j] by auto qed |
793 using ksimplexD(5)[OF assms(1),rule_format,OF `a0\<in>s` j] by auto qed |
794 fix y assume y:"y\<in>insert a3 (s - {a1})" |
794 fix y assume y:"y\<in>insert a3 (s - {a1})" |
795 have lem4:"\<And>x. x\<in>s \<Longrightarrow> x\<noteq>a1 \<Longrightarrow> kle n a3 x" proof- case goal1 hence *:"x\<in>s - {a1}" by auto |
795 have lem4:"\<And>x. x\<in>s \<Longrightarrow> x\<noteq>a1 \<Longrightarrow> kle n a3 x" proof- case goal1 hence *:"x\<in>s - {a1}" by auto |
796 have "kle n a3 a2" proof- have "kle n a0 a1" using a0a1 by auto then guess kk unfolding kle_def .. |
796 have "kle n a3 a2" proof- have "kle n a0 a1" using a0a1 by auto then guess kk unfolding kle_def .. |
797 thus ?thesis unfolding kle_def apply(rule_tac x=kk in exI) unfolding lem4[rule_format] k(2)[rule_format] |
797 thus ?thesis unfolding kle_def apply(rule_tac x=kk in exI) unfolding lem4[rule_format] k(2)[rule_format] |
798 apply(rule)defer proof(rule) case goal1 thus ?case apply-apply(erule conjE) |
798 apply(rule)defer proof(rule) case goal1 thus ?case apply-apply(erule conjE) |
799 apply(erule_tac[!] x=j in allE) apply(cases "j\<in>kk") apply(case_tac[!] "j=k") by auto qed auto qed moreover |
799 apply(erule_tac[!] x=j in allE) apply(cases "j\<in>kk") apply(case_tac[!] "j=k") by auto qed auto qed moreover |
800 have "kle n a3 a0" unfolding kle_def lem4[rule_format] apply(rule_tac x="{k}" in exI) using k(1) by auto |
800 have "kle n a3 a0" unfolding kle_def lem4[rule_format] apply(rule_tac x="{k}" in exI) using k(1) by auto |
801 ultimately show ?case apply-apply(rule kle_between_l[of _ a0 _ a2]) using lem3[OF *] |
801 ultimately show ?case apply-apply(rule kle_between_l[of _ a0 _ a2]) using lem3[OF *] |
802 using a0a1(4)[rule_format,OF goal1(1)] by auto qed |
802 using a0a1(4)[rule_format,OF goal1(1)] by auto qed |
803 show "kle n x y \<or> kle n y x" proof(cases "y=a3") |
803 show "kle n x y \<or> kle n y x" proof(cases "y=a3") |
804 case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI2,rule lem4) |
804 case True show ?thesis unfolding True apply(cases "x=a3") defer apply(rule disjI2,rule lem4) |
805 using x by auto next |
805 using x by auto next |
806 case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True |
806 case False show ?thesis proof(cases "x=a3") case True show ?thesis unfolding True |
807 apply(rule disjI1,rule lem4) using y False by auto next |
807 apply(rule disjI1,rule lem4) using y False by auto next |
808 case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) |
808 case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) |
809 using x y `y\<noteq>a3` by auto qed qed qed |
809 using x y `y\<noteq>a3` by auto qed qed qed |
810 hence "insert a3 (s - {a1}) \<in> ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) |
810 hence "insert a3 (s - {a1}) \<in> ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) |
811 apply(rule_tac x="a3" in bexI) unfolding `a=a1` using `a3\<notin>s` by auto moreover |
811 apply(rule_tac x="a3" in bexI) unfolding `a=a1` using `a3\<notin>s` by auto moreover |
812 have "s \<in> ?A" using assms(1,2) by auto ultimately have "?A \<supseteq> {s, insert a3 (s - {a1})}" by auto |
812 have "s \<in> ?A" using assms(1,2) by auto ultimately have "?A \<supseteq> {s, insert a3 (s - {a1})}" by auto |
813 moreover have "?A \<subseteq> {s, insert a3 (s - {a1})}" apply(rule) unfolding mem_Collect_eq proof(erule conjE) |
813 moreover have "?A \<subseteq> {s, insert a3 (s - {a1})}" apply(rule) unfolding mem_Collect_eq proof(erule conjE) |
814 fix s' assume as:"ksimplex p n s'" and "\<exists>b\<in>s'. s' - {b} = s - {a}" |
814 fix s' assume as:"ksimplex p n s'" and "\<exists>b\<in>s'. s' - {b} = s - {a}" |
815 from this(2) guess a' .. note a'=this |
815 from this(2) guess a' .. note a'=this |
816 guess a_min a_max apply(rule ksimplex_extrema_strong[OF as assms(3)]) . note min_max=this |
816 guess a_min a_max apply(rule ksimplex_extrema_strong[OF as assms(3)]) . note min_max=this |
817 have *:"\<forall>x\<in>s' - {a'}. x k = a2 k" unfolding a' proof fix x assume x:"x\<in>s-{a}" |
817 have *:"\<forall>x\<in>s' - {a'}. x k = a2 k" unfolding a' proof fix x assume x:"x\<in>s-{a}" |
818 hence "kle n x a2" apply-apply(rule lem3) using `a=a1` by auto |
818 hence "kle n x a2" apply-apply(rule lem3) using `a=a1` by auto |
819 hence "x k \<le> a2 k" apply(drule_tac kle_imp_pointwise) by auto moreover |
819 hence "x k \<le> a2 k" apply(drule_tac kle_imp_pointwise) by auto moreover |
820 { have "a2 k \<le> a0 k" using k(2)[rule_format,of k] unfolding a0a1(5)[rule_format] using k(1) by simp |
820 { have "a2 k \<le> a0 k" using k(2)[rule_format,of k] unfolding a0a1(5)[rule_format] using k(1) by simp |
821 also have "\<dots> \<le> x k" using a0a1(4)[rule_format,of x,THEN conjunct1,THEN kle_imp_pointwise] x by auto |
821 also have "\<dots> \<le> x k" using a0a1(4)[rule_format,of x,THEN conjunct1,THEN kle_imp_pointwise] x by auto |
822 finally have "a2 k \<le> x k" . } ultimately show "x k = a2 k" by auto qed |
822 finally have "a2 k \<le> x k" . } ultimately show "x k = a2 k" by auto qed |
823 have **:"a'=a_min \<or> a'=a_max" apply(rule ksimplex_fix_plane[OF a'(1) k(1) *]) using min_max by auto |
823 have **:"a'=a_min \<or> a'=a_max" apply(rule ksimplex_fix_plane[OF a'(1) k(1) *]) using min_max by auto |
824 have "a2 \<noteq> a1" proof assume as:"a2 = a1" |
824 have "a2 \<noteq> a1" proof assume as:"a2 = a1" |
825 show False using k(2) unfolding as apply(erule_tac x=k in allE) by auto qed |
825 show False using k(2) unfolding as apply(erule_tac x=k in allE) by auto qed |
826 hence a2':"a2 \<in> s' - {a'}" unfolding a' using a2 unfolding `a=a1` by auto |
826 hence a2':"a2 \<in> s' - {a'}" unfolding a' using a2 unfolding `a=a1` by auto |
827 show "s' \<in> {s, insert a3 (s - {a1})}" proof(cases "a'=a_min") |
827 show "s' \<in> {s, insert a3 (s - {a1})}" proof(cases "a'=a_min") |
828 case True have "a_max \<in> s - {a1}" using min_max unfolding a'(2)[unfolded `a=a1`,THEN sym] True by auto |
828 case True have "a_max \<in> s - {a1}" using min_max unfolding a'(2)[unfolded `a=a1`,THEN sym] True by auto |
829 hence "a_max = a2" unfolding kle_antisym[THEN sym,of a_max a2 n] apply-apply(rule) |
829 hence "a_max = a2" unfolding kle_antisym[THEN sym,of a_max a2 n] apply-apply(rule) |
830 apply(rule lem3,assumption) apply(rule min_max(4)[rule_format,THEN conjunct2]) using a2' by auto |
830 apply(rule lem3,assumption) apply(rule min_max(4)[rule_format,THEN conjunct2]) using a2' by auto |
831 hence a_max:"\<forall>i. a_max i = a2 i" by auto |
831 hence a_max:"\<forall>i. a_max i = a2 i" by auto |
832 have *:"\<forall>j. a2 j = (if j\<in>{1..n} then a3 j + 1 else a3 j)" |
832 have *:"\<forall>j. a2 j = (if j\<in>{1..n} then a3 j + 1 else a3 j)" |
833 using k(2) unfolding lem4[rule_format] a0a1(5)[rule_format] apply-apply(rule,erule_tac x=j in allE) |
833 using k(2) unfolding lem4[rule_format] a0a1(5)[rule_format] apply-apply(rule,erule_tac x=j in allE) |
834 proof- case goal1 thus ?case apply(cases "j\<in>{1..n}",case_tac[!] "j=k") by auto qed |
834 proof- case goal1 thus ?case apply(cases "j\<in>{1..n}",case_tac[!] "j=k") by auto qed |
835 have "\<forall>i. a_min i = a3 i" using a_max apply-apply(rule,erule_tac x=i in allE) |
835 have "\<forall>i. a_min i = a3 i" using a_max apply-apply(rule,erule_tac x=i in allE) |
836 unfolding min_max(5)[rule_format] *[rule_format] proof- case goal1 |
836 unfolding min_max(5)[rule_format] *[rule_format] proof- case goal1 |
837 thus ?case apply(cases "i\<in>{1..n}") by auto qed hence "a_min = a3" unfolding fun_eq_iff . |
837 thus ?case apply(cases "i\<in>{1..n}") by auto qed hence "a_min = a3" unfolding fun_eq_iff . |
838 hence "s' = insert a3 (s - {a1})" using a' unfolding `a=a1` True by auto thus ?thesis by auto next |
838 hence "s' = insert a3 (s - {a1})" using a' unfolding `a=a1` True by auto thus ?thesis by auto next |
839 case False hence as:"a'=a_max" using ** by auto |
839 case False hence as:"a'=a_max" using ** by auto |
840 have "a_min = a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) |
840 have "a_min = a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) |
841 apply(rule min_max(4)[rule_format,THEN conjunct1]) defer apply(rule a0a1(4)[rule_format,THEN conjunct1]) proof- |
841 apply(rule min_max(4)[rule_format,THEN conjunct1]) defer apply(rule a0a1(4)[rule_format,THEN conjunct1]) proof- |
842 have "a_min \<in> s - {a1}" using min_max(1,3) unfolding a'(2)[THEN sym,unfolded `a=a1`] as by auto |
842 have "a_min \<in> s - {a1}" using min_max(1,3) unfolding a'(2)[THEN sym,unfolded `a=a1`] as by auto |
843 thus "a_min \<in> s" by auto have "a0 \<in> s - {a1}" using a0a1(1-3) by auto thus "a0 \<in> s'" |
843 thus "a_min \<in> s" by auto have "a0 \<in> s - {a1}" using a0a1(1-3) by auto thus "a0 \<in> s'" |
844 unfolding a'(2)[THEN sym,unfolded `a=a1`] by auto qed |
844 unfolding a'(2)[THEN sym,unfolded `a=a1`] by auto qed |
845 hence "\<forall>i. a_max i = a1 i" unfolding a0a1(5)[rule_format] min_max(5)[rule_format] by auto |
845 hence "\<forall>i. a_max i = a1 i" unfolding a0a1(5)[rule_format] min_max(5)[rule_format] by auto |
846 hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\<in>s` `a'\<in>s'` unfolding as `a=a1` unfolding fun_eq_iff by auto |
846 hence "s' = s" apply-apply(rule lem1[OF a'(2)]) using `a\<in>s` `a'\<in>s'` unfolding as `a=a1` unfolding fun_eq_iff by auto |
847 thus ?thesis by auto qed qed |
847 thus ?thesis by auto qed qed |
848 ultimately have *:"?A = {s, insert a3 (s - {a1})}" by blast |
848 ultimately have *:"?A = {s, insert a3 (s - {a1})}" by blast |
849 have "s \<noteq> insert a3 (s - {a1})" using `a3\<notin>s` by auto |
849 have "s \<noteq> insert a3 (s - {a1})" using `a3\<notin>s` by auto |
850 hence ?thesis unfolding * by auto } moreover |
850 hence ?thesis unfolding * by auto } moreover |
851 { assume as:"a\<noteq>a0" "a\<noteq>a1" have "\<not> (\<forall>x\<in>s. kle n a x)" proof case goal1 |
851 { assume as:"a\<noteq>a0" "a\<noteq>a1" have "\<not> (\<forall>x\<in>s. kle n a x)" proof case goal1 |
852 have "a=a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) |
852 have "a=a0" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) |
853 using goal1 a0a1 assms(2) by auto thus False using as by auto qed |
853 using goal1 a0a1 assms(2) by auto thus False using as by auto qed |
854 hence "\<exists>y\<in>s. \<exists>k\<in>{1..n}. \<forall>j. a j = (if j = k then y j + 1 else y j)" using ksimplex_predecessor[OF assms(1-2)] by blast |
854 hence "\<exists>y\<in>s. \<exists>k\<in>{1..n}. \<forall>j. a j = (if j = k then y j + 1 else y j)" using ksimplex_predecessor[OF assms(1-2)] by blast |
855 then guess u .. from this(2) guess k .. note k = this[rule_format] note u = `u\<in>s` |
855 then guess u .. from this(2) guess k .. note k = this[rule_format] note u = `u\<in>s` |
856 have "\<not> (\<forall>x\<in>s. kle n x a)" proof case goal1 |
856 have "\<not> (\<forall>x\<in>s. kle n x a)" proof case goal1 |
857 have "a=a1" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) |
857 have "a=a1" unfolding kle_antisym[THEN sym,of _ _ n] apply(rule) |
858 using goal1 a0a1 assms(2) by auto thus False using as by auto qed |
858 using goal1 a0a1 assms(2) by auto thus False using as by auto qed |
859 hence "\<exists>y\<in>s. \<exists>k\<in>{1..n}. \<forall>j. y j = (if j = k then a j + 1 else a j)" using ksimplex_successor[OF assms(1-2)] by blast |
859 hence "\<exists>y\<in>s. \<exists>k\<in>{1..n}. \<forall>j. y j = (if j = k then a j + 1 else a j)" using ksimplex_successor[OF assms(1-2)] by blast |
860 then guess v .. from this(2) guess l .. note l = this[rule_format] note v = `v\<in>s` |
860 then guess v .. from this(2) guess l .. note l = this[rule_format] note v = `v\<in>s` |
861 def a' \<equiv> "\<lambda>j. if j = l then u j + 1 else u j" |
861 def a' \<equiv> "\<lambda>j. if j = l then u j + 1 else u j" |
862 have kl:"k \<noteq> l" proof assume "k=l" have *:"\<And>P. (if P then (1::nat) else 0) \<noteq> 2" by auto |
862 have kl:"k \<noteq> l" proof assume "k=l" have *:"\<And>P. (if P then (1::nat) else 0) \<noteq> 2" by auto |
863 thus False using ksimplexD(6)[OF assms(1),rule_format,OF u v] unfolding kle_def |
863 thus False using ksimplexD(6)[OF assms(1),rule_format,OF u v] unfolding kle_def |
864 unfolding l(2) k(2) `k=l` apply-apply(erule disjE)apply(erule_tac[!] exE conjE)+ |
864 unfolding l(2) k(2) `k=l` apply-apply(erule disjE)apply(erule_tac[!] exE conjE)+ |
865 apply(erule_tac[!] x=l in allE)+ by(auto simp add: *) qed |
865 apply(erule_tac[!] x=l in allE)+ by(auto simp add: *) qed |
866 hence aa':"a'\<noteq>a" apply-apply rule unfolding fun_eq_iff unfolding a'_def k(2) |
866 hence aa':"a'\<noteq>a" apply-apply rule unfolding fun_eq_iff unfolding a'_def k(2) |
867 apply(erule_tac x=l in allE) by auto |
867 apply(erule_tac x=l in allE) by auto |
868 have "a' \<notin> s" apply(rule) apply(drule ksimplexD(6)[OF assms(1),rule_format,OF `a\<in>s`]) proof(cases "kle n a a'") |
868 have "a' \<notin> s" apply(rule) apply(drule ksimplexD(6)[OF assms(1),rule_format,OF `a\<in>s`]) proof(cases "kle n a a'") |
869 case goal2 hence "kle n a' a" by auto thus False apply(drule_tac kle_imp_pointwise) |
869 case goal2 hence "kle n a' a" by auto thus False apply(drule_tac kle_imp_pointwise) |
870 apply(erule_tac x=l in allE) unfolding a'_def k(2) using kl by auto next |
870 apply(erule_tac x=l in allE) unfolding a'_def k(2) using kl by auto next |
871 case True thus False apply(drule_tac kle_imp_pointwise) |
871 case True thus False apply(drule_tac kle_imp_pointwise) |
872 apply(erule_tac x=k in allE) unfolding a'_def k(2) using kl by auto qed |
872 apply(erule_tac x=k in allE) unfolding a'_def k(2) using kl by auto qed |
873 have kle_uv:"kle n u a" "kle n u a'" "kle n a v" "kle n a' v" unfolding kle_def apply- |
873 have kle_uv:"kle n u a" "kle n u a'" "kle n a v" "kle n a' v" unfolding kle_def apply- |
874 apply(rule_tac[1] x="{k}" in exI,rule_tac[2] x="{l}" in exI) |
874 apply(rule_tac[1] x="{k}" in exI,rule_tac[2] x="{l}" in exI) |
875 apply(rule_tac[3] x="{l}" in exI,rule_tac[4] x="{k}" in exI) |
875 apply(rule_tac[3] x="{l}" in exI,rule_tac[4] x="{k}" in exI) |
876 unfolding l(2) k(2) a'_def using l(1) k(1) by auto |
876 unfolding l(2) k(2) a'_def using l(1) k(1) by auto |
877 have uxv:"\<And>x. kle n u x \<Longrightarrow> kle n x v \<Longrightarrow> (x = u) \<or> (x = a) \<or> (x = a') \<or> (x = v)" |
877 have uxv:"\<And>x. kle n u x \<Longrightarrow> kle n x v \<Longrightarrow> (x = u) \<or> (x = a) \<or> (x = a') \<or> (x = v)" |
878 proof- case goal1 thus ?case proof(cases "x k = u k", case_tac[!] "x l = u l") |
878 proof- case goal1 thus ?case proof(cases "x k = u k", case_tac[!] "x l = u l") |
879 assume as:"x l = u l" "x k = u k" |
879 assume as:"x l = u l" "x k = u k" |
880 have "x = u" unfolding fun_eq_iff |
880 have "x = u" unfolding fun_eq_iff |
881 using goal1(2)[THEN kle_imp_pointwise,unfolded l(2)] unfolding k(2) apply- |
881 using goal1(2)[THEN kle_imp_pointwise,unfolded l(2)] unfolding k(2) apply- |
882 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
882 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
883 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next |
883 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next |
884 assume as:"x l \<noteq> u l" "x k = u k" |
884 assume as:"x l \<noteq> u l" "x k = u k" |
885 have "x = a'" unfolding fun_eq_iff unfolding a'_def |
885 have "x = a'" unfolding fun_eq_iff unfolding a'_def |
886 using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- |
886 using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- |
887 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
887 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
888 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next |
888 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next |
889 assume as:"x l = u l" "x k \<noteq> u k" |
889 assume as:"x l = u l" "x k \<noteq> u k" |
890 have "x = a" unfolding fun_eq_iff |
890 have "x = a" unfolding fun_eq_iff |
891 using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- |
891 using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- |
892 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
892 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
893 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next |
893 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as by auto qed thus ?case by auto next |
894 assume as:"x l \<noteq> u l" "x k \<noteq> u k" |
894 assume as:"x l \<noteq> u l" "x k \<noteq> u k" |
895 have "x = v" unfolding fun_eq_iff |
895 have "x = v" unfolding fun_eq_iff |
896 using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- |
896 using goal1(2)[THEN kle_imp_pointwise] unfolding l(2) k(2) apply- |
897 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
897 using goal1(1)[THEN kle_imp_pointwise] apply-apply rule apply(erule_tac x=xa in allE)+ proof- case goal1 |
898 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as `k\<noteq>l` by auto qed thus ?case by auto qed qed |
898 thus ?case apply(cases "x=l") apply(case_tac[!] "x=k") using as `k\<noteq>l` by auto qed thus ?case by auto qed qed |
899 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 |
899 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 |
900 have lem3:"\<And>x. x\<in>s \<Longrightarrow> kle n v x \<Longrightarrow> kle n a' x" apply(rule kle_between_r[of _ u _ v]) |
900 have lem3:"\<And>x. x\<in>s \<Longrightarrow> kle n v x \<Longrightarrow> kle n a' x" apply(rule kle_between_r[of _ u _ v]) |
901 prefer 3 apply(rule kle_trans[OF uv]) defer apply(rule ksimplexD(6)[OF assms(1),rule_format]) |
901 prefer 3 apply(rule kle_trans[OF uv]) defer apply(rule ksimplexD(6)[OF assms(1),rule_format]) |
902 using kle_uv `u\<in>s` by auto |
902 using kle_uv `u\<in>s` by auto |
903 have lem4:"\<And>x. x\<in>s \<Longrightarrow> kle n x u \<Longrightarrow> kle n x a'" apply(rule kle_between_l[of _ u _ v]) |
903 have lem4:"\<And>x. x\<in>s \<Longrightarrow> kle n x u \<Longrightarrow> kle n x a'" apply(rule kle_between_l[of _ u _ v]) |
904 prefer 4 apply(rule kle_trans[OF _ uv]) defer apply(rule ksimplexD(6)[OF assms(1),rule_format]) |
904 prefer 4 apply(rule kle_trans[OF _ uv]) defer apply(rule ksimplexD(6)[OF assms(1),rule_format]) |
905 using kle_uv `v\<in>s` by auto |
905 using kle_uv `v\<in>s` by auto |
906 have lem5:"\<And>x. x\<in>s \<Longrightarrow> x\<noteq>a \<Longrightarrow> kle n x a' \<or> kle n a' x" proof- case goal1 thus ?case |
906 have lem5:"\<And>x. x\<in>s \<Longrightarrow> x\<noteq>a \<Longrightarrow> kle n x a' \<or> kle n a' x" proof- case goal1 thus ?case |
907 proof(cases "kle n v x \<or> kle n x u") case True thus ?thesis using goal1 by(auto intro:lem3 lem4) next |
907 proof(cases "kle n v x \<or> kle n x u") case True thus ?thesis using goal1 by(auto intro:lem3 lem4) next |
908 case False hence *:"kle n u x" "kle n x v" using ksimplexD(6)[OF assms(1)] using goal1 `u\<in>s` `v\<in>s` by auto |
908 case False hence *:"kle n u x" "kle n x v" using ksimplexD(6)[OF assms(1)] using goal1 `u\<in>s` `v\<in>s` by auto |
909 show ?thesis using uxv[OF *] using kle_uv using goal1 by auto qed qed |
909 show ?thesis using uxv[OF *] using kle_uv using goal1 by auto qed qed |
910 have "ksimplex p n (insert a' (s - {a}))" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) |
910 have "ksimplex p n (insert a' (s - {a}))" apply(rule ksimplexI) proof(rule_tac[2-] ballI,rule_tac[4] ballI) |
911 show "card (insert a' (s - {a})) = n + 1" using ksimplexD(2-3)[OF assms(1)] |
911 show "card (insert a' (s - {a})) = n + 1" using ksimplexD(2-3)[OF assms(1)] |
912 using `a'\<noteq>a` `a'\<notin>s` `a\<in>s` by(auto simp add:card_insert_if) |
912 using `a'\<noteq>a` `a'\<notin>s` `a\<in>s` by(auto simp add:card_insert_if) |
913 fix x assume x:"x \<in> insert a' (s - {a})" |
913 fix x assume x:"x \<in> insert a' (s - {a})" |
914 show "\<forall>j. x j \<le> p" proof(rule,cases "x = a'") |
914 show "\<forall>j. x j \<le> p" proof(rule,cases "x = a'") |
915 fix j case False thus "x j\<le>p" using x ksimplexD(4)[OF assms(1)] by auto next |
915 fix j case False thus "x j\<le>p" using x ksimplexD(4)[OF assms(1)] by auto next |
916 fix j case True show "x j\<le>p" unfolding True proof(cases "j=l") |
916 fix j case True show "x j\<le>p" unfolding True proof(cases "j=l") |
917 case False thus "a' j \<le>p" unfolding True a'_def using `u\<in>s` ksimplexD(4)[OF assms(1)] by auto next |
917 case False thus "a' j \<le>p" unfolding True a'_def using `u\<in>s` ksimplexD(4)[OF assms(1)] by auto next |
918 case True have *:"a l = u l" "v l = a l + 1" using k(2)[of l] l(2)[of l] `k\<noteq>l` by auto |
918 case True have *:"a l = u l" "v l = a l + 1" using k(2)[of l] l(2)[of l] `k\<noteq>l` by auto |
919 have "u l + 1 \<le> p" unfolding *[THEN sym] using ksimplexD(4)[OF assms(1)] using `v\<in>s` by auto |
919 have "u l + 1 \<le> p" unfolding *[THEN sym] using ksimplexD(4)[OF assms(1)] using `v\<in>s` by auto |
920 thus "a' j \<le>p" unfolding a'_def True by auto qed qed |
920 thus "a' j \<le>p" unfolding a'_def True by auto qed qed |
921 show "\<forall>j. j \<notin> {1..n} \<longrightarrow> x j = p" proof(rule,rule,cases "x=a'") fix j::nat assume j:"j\<notin>{1..n}" |
921 show "\<forall>j. j \<notin> {1..n} \<longrightarrow> x j = p" proof(rule,rule,cases "x=a'") fix j::nat assume j:"j\<notin>{1..n}" |
922 { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } |
922 { case False thus "x j = p" using j x ksimplexD(5)[OF assms(1)] by auto } |
923 case True show "x j = p" unfolding True a'_def using j l(1) |
923 case True show "x j = p" unfolding True a'_def using j l(1) |
924 using ksimplexD(5)[OF assms(1),rule_format,OF `u\<in>s` j] by auto qed |
924 using ksimplexD(5)[OF assms(1),rule_format,OF `u\<in>s` j] by auto qed |
925 fix y assume y:"y\<in>insert a' (s - {a})" |
925 fix y assume y:"y\<in>insert a' (s - {a})" |
926 show "kle n x y \<or> kle n y x" proof(cases "y=a'") |
926 show "kle n x y \<or> kle n y x" proof(cases "y=a'") |
927 case True show ?thesis unfolding True apply(cases "x=a'") defer apply(rule lem5) using x by auto next |
927 case True show ?thesis unfolding True apply(cases "x=a'") defer apply(rule lem5) using x by auto next |
928 case False show ?thesis proof(cases "x=a'") case True show ?thesis unfolding True |
928 case False show ?thesis proof(cases "x=a'") case True show ?thesis unfolding True |
929 using lem5[of y] using y by auto next |
929 using lem5[of y] using y by auto next |
930 case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) |
930 case False thus ?thesis apply(rule_tac ksimplexD(6)[OF assms(1),rule_format]) |
931 using x y `y\<noteq>a'` by auto qed qed qed |
931 using x y `y\<noteq>a'` by auto qed qed qed |
932 hence "insert a' (s - {a}) \<in> ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) |
932 hence "insert a' (s - {a}) \<in> ?A" unfolding mem_Collect_eq apply-apply(rule,assumption) |
933 apply(rule_tac x="a'" in bexI) using aa' `a'\<notin>s` by auto moreover |
933 apply(rule_tac x="a'" in bexI) using aa' `a'\<notin>s` by auto moreover |
934 have "s \<in> ?A" using assms(1,2) by auto ultimately have "?A \<supseteq> {s, insert a' (s - {a})}" by auto |
934 have "s \<in> ?A" using assms(1,2) by auto ultimately have "?A \<supseteq> {s, insert a' (s - {a})}" by auto |
935 moreover have "?A \<subseteq> {s, insert a' (s - {a})}" apply(rule) unfolding mem_Collect_eq proof(erule conjE) |
935 moreover have "?A \<subseteq> {s, insert a' (s - {a})}" apply(rule) unfolding mem_Collect_eq proof(erule conjE) |
936 fix s' assume as:"ksimplex p n s'" and "\<exists>b\<in>s'. s' - {b} = s - {a}" |
936 fix s' assume as:"ksimplex p n s'" and "\<exists>b\<in>s'. s' - {b} = s - {a}" |