# HG changeset patch # User wenzelm # Date 1347650761 -7200 # Node ID b08c6312782b2b6282f261d5e4f8f76909cfcc4b # Parent ab677b04cbf4f14d200984efc8b79f3a7f9472e4 tuned proofs; diff -r ab677b04cbf4 -r b08c6312782b src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Fri Sep 14 21:23:06 2012 +0200 +++ b/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Fri Sep 14 21:26:01 2012 +0200 @@ -24,12 +24,16 @@ lemma brouwer_compactness_lemma: assumes "compact s" "continuous_on s f" "\ (\x\s. (f x = (0::_::euclidean_space)))" - obtains d where "0 < d" "\x\s. d \ norm(f x)" proof(cases "s={}") case False - have "continuous_on s (norm \ f)" by(rule continuous_on_intros continuous_on_norm assms(2))+ - then obtain x where x:"x\s" "\y\s. (norm \ f) x \ (norm \ f) y" - using continuous_attains_inf[OF assms(1), of "norm \ f"] and False unfolding o_def by auto + obtains d where "0 < d" "\x\s. d \ norm(f x)" +proof (cases "s={}") + case False + have "continuous_on s (norm \ f)" + by(rule continuous_on_intros continuous_on_norm assms(2))+ + with False obtain x where x: "x\s" "\y\s. (norm \ f) x \ (norm \ f) y" + using continuous_attains_inf[OF assms(1), of "norm \ f"] unfolding o_def by auto have "(norm \ f) x > 0" using assms(3) and x(1) by auto - thus ?thesis apply(rule that) using x(2) unfolding o_def by auto qed(rule that[of 1], auto) + then show ?thesis by (rule that) (insert x(2), auto simp: o_def) +qed (rule that [of 1], auto) lemma kuhn_labelling_lemma: fixes type::"'a::euclidean_space" assumes "(\x::'a. P x \ P (f x))" "\x. P x \ (\i 0 \ x$$i \ x$$i \ 1)" @@ -37,19 +41,41 @@ (\x.\ i Q i \ (x$$i = 0) \ (l x i = 0)) \ (\x.\ i Q i \ (x$$i = 1) \ (l x i = 1)) \ (\x.\ i Q i \ (l x i = 0) \ x$$i \ f(x)$$i) \ - (\x.\ i Q i \ (l x i = 1) \ f(x)$$i \ x$$i)" proof- - have and_forall_thm:"\P Q. (\x. P x) \ (\x. Q x) \ (\x. P x \ Q x)" by auto - have *:"\x y::real. 0 \ x \ x \ 1 \ 0 \ y \ y \ 1 \ (x \ 1 \ x \ y \ x \ 0 \ y \ x)" by auto - show ?thesis unfolding and_forall_thm apply(subst choice_iff[THEN sym])+ proof(rule,rule) case goal1 + (\x.\ i Q i \ (l x i = 1) \ f(x)$$i \ x$$i)" +proof - + have and_forall_thm:"\P Q. (\x. P x) \ (\x. Q x) \ (\x. P x \ Q x)" + by auto + have *:"\x y::real. 0 \ x \ x \ 1 \ 0 \ y \ y \ 1 \ (x \ 1 \ x \ y \ x \ 0 \ y \ x)" + by auto + show ?thesis + unfolding and_forall_thm + apply(subst choice_iff[THEN sym])+ + apply rule + apply rule + proof - + case goal1 let ?R = "\y. (P x \ Q xa \ x $$ xa = 0 \ y = (0::nat)) \ - (P x \ Q xa \ x $$ xa = 1 \ y = 1) \ (P x \ Q xa \ y = 0 \ x $$ xa \ f x $$ xa) \ (P x \ Q xa \ y = 1 \ f x $$ xa \ x $$ xa)" - { assume "P x" "Q xa" "xa f x $$ xa \ f x $$ xa \ 1" using assms(2)[rule_format,of "f x" xa] - apply(drule_tac assms(1)[rule_format]) by auto } - hence "xa ?R 0 \ ?R 1" by auto thus ?case by auto qed qed + (P x \ Q xa \ x $$ xa = 1 \ y = 1) \ + (P x \ Q xa \ y = 0 \ x $$ xa \ f x $$ xa) \ + (P x \ Q xa \ y = 1 \ f x $$ xa \ x $$ xa)" + { + assume "P x" "Q xa" "xa f x $$ xa \ f x $$ xa \ 1" + using assms(2)[rule_format,of "f x" xa] + apply (drule_tac assms(1)[rule_format]) + apply auto + done + } + then have "xa ?R 0 \ ?R 1" by auto + then show ?case by auto + qed +qed + subsection {* The key "counting" observation, somewhat abstracted. *} -lemma setsum_Un_disjoint':assumes "finite A" "finite B" "A \ B = {}" "A \ B = C" +lemma setsum_Un_disjoint': + assumes "finite A" "finite B" "A \ B = {}" "A \ B = C" shows "setsum g C = setsum g A + setsum g B" using setsum_Un_disjoint[OF assms(1-3)] and assms(4) by auto @@ -60,19 +86,29 @@ "\s\simplices. \ compo s \ (card {f \ faces. face f s \ compo' f} = 0) \ (card {f \ faces. face f s \ compo' f} = 2)" "odd(card {f \ faces. compo' f \ bnd f})" - shows "odd(card {s \ simplices. compo s})" proof- - have "\x. {f\faces. compo' f \ bnd f \ face f x} \ {f\faces. compo' f \ \bnd f \ face f x} = {f\faces. compo' f \ face f x}" - "\x. {f \ faces. compo' f \ bnd f \ face f x} \ {f \ faces. compo' f \ \ bnd f \ face f x} = {}" by auto + shows "odd(card {s \ simplices. compo s})" +proof - + have "\x. {f\faces. compo' f \ bnd f \ face f x} \ {f\faces. compo' f \ \bnd f \ face f x} = + {f\faces. compo' f \ face f x}" + "\x. {f \ faces. compo' f \ bnd f \ face f x} \ {f \ faces. compo' f \ \ bnd f \ face f x} = {}" + by auto hence lem1:"setsum (\s. (card {f \ faces. face f s \ compo' f})) simplices = - setsum (\s. card {f \ {f \ faces. compo' f \ bnd f}. face f s}) simplices + - setsum (\s. card {f \ {f \ faces. compo' f \ \ (bnd f)}. face f s}) simplices" - unfolding setsum_addf[THEN sym] apply- apply(rule setsum_cong2) - using assms(1) by(auto simp add: card_Un_Int, auto simp add:conj_commute) + setsum (\s. card {f \ {f \ faces. compo' f \ bnd f}. face f s}) simplices + + setsum (\s. card {f \ {f \ faces. compo' f \ \ (bnd f)}. face f s}) simplices" + unfolding setsum_addf[THEN sym] + apply - + apply(rule setsum_cong2) + using assms(1) + apply (auto simp add: card_Un_Int, auto simp add:conj_commute) + done have lem2:"setsum (\j. card {f \ {f \ faces. compo' f \ bnd f}. face f j}) simplices = 1 * card {f \ faces. compo' f \ bnd f}" "setsum (\j. card {f \ {f \ faces. compo' f \ \ bnd f}. face f j}) simplices = 2 * card {f \ faces. compo' f \ \ bnd f}" - apply(rule_tac[!] setsum_multicount) using assms by auto + apply(rule_tac[!] setsum_multicount) + using assms + apply auto + done have lem3:"setsum (\s. card {f \ faces. face f s \ compo' f}) simplices = setsum (\s. card {f \ faces. face f s \ compo' f}) {s \ simplices. compo s}+ setsum (\s. card {f \ faces. face f s \ compo' f}) {s \ simplices. \ compo s}" @@ -90,27 +126,54 @@ int (card {f \ faces. compo' f \ bnd f} + 2 * card {f \ faces. compo' f \ \ bnd f}) - int (card {s \ simplices. \ compo s \ card {f \ faces. face f s \ compo' f} = 2} * 2)" using lem1[unfolded lem3 lem2 lem5] by auto - have even_minus_odd:"\x y. even x \ odd (y::int) \ odd (x - y)" using assms by auto - have odd_minus_even:"\x y. odd x \ even (y::int) \ odd (x - y)" using assms by auto - show ?thesis unfolding even_nat_def unfolding card_eq_setsum and lem4[THEN sym] and *[unfolded card_eq_setsum] - unfolding card_eq_setsum[THEN sym] apply (rule odd_minus_even) unfolding of_nat_add apply(rule odd_plus_even) - apply(rule assms(7)[unfolded even_nat_def]) unfolding int_mult by auto qed + have even_minus_odd:"\x y. even x \ odd (y::int) \ odd (x - y)" + using assms by auto + have odd_minus_even:"\x y. odd x \ even (y::int) \ odd (x - y)" + using assms by auto + show ?thesis + unfolding even_nat_def card_eq_setsum and lem4[THEN sym] and *[unfolded card_eq_setsum] + unfolding card_eq_setsum[THEN sym] + apply (rule odd_minus_even) + unfolding of_nat_add + apply(rule odd_plus_even) + apply(rule assms(7)[unfolded even_nat_def]) + unfolding int_mult + apply auto + done +qed + subsection {* The odd/even result for faces of complete vertices, generalized. *} -lemma card_1_exists: "card s = 1 \ (\!x. x \ s)" unfolding One_nat_def - apply rule apply(drule card_eq_SucD) defer apply(erule ex1E) proof- +lemma card_1_exists: "card s = 1 \ (\!x. x \ s)" + unfolding One_nat_def + apply rule + apply (drule card_eq_SucD) + defer + apply(erule ex1E) +proof - fix x assume as:"x \ s" "\y. y \ s \ y = x" - have *:"s = insert x {}" apply- apply(rule set_eqI,rule) unfolding singleton_iff - apply(rule as(2)[rule_format]) using as(1) by auto - show "card s = Suc 0" unfolding * using card_insert by auto qed auto + have *: "s = insert x {}" + apply - + apply (rule set_eqI,rule) unfolding singleton_iff + apply (rule as(2)[rule_format]) using as(1) + apply auto + done + show "card s = Suc 0" unfolding * using card_insert by auto +qed auto -lemma card_2_exists: "card s = 2 \ (\x\s. \y\s. x \ y \ (\z\s. (z = x) \ (z = y)))" proof - assume "card s = 2" then obtain x y where obt:"s = {x, y}" "x\y" unfolding numeral_2_eq_2 apply - apply(erule exE conjE|drule card_eq_SucD)+ by auto +lemma card_2_exists: "card s = 2 \ (\x\s. \y\s. x \ y \ (\z\s. (z = x) \ (z = y)))" +proof + assume "card s = 2" + then obtain x y where obt:"s = {x, y}" "x\y" unfolding numeral_2_eq_2 + apply - apply(erule exE conjE|drule card_eq_SucD)+ apply auto done show "\x\s. \y\s. x \ y \ (\z\s. z = x \ z = y)" using obt by auto next - assume "\x\s. \y\s. x \ y \ (\z\s. z = x \ z = y)" then guess x .. from this(2) guess y .. - with `x\s` have *:"s = {x, y}" "x\y" by auto - from this(2) show "card s = 2" unfolding * by auto qed + assume "\x\s. \y\s. x \ y \ (\z\s. z = x \ z = y)" + then guess x .. + from this(2) guess y .. + with `x\s` have *: "s = {x, y}" "x\y" by auto + from this(2) show "card s = 2" unfolding * by auto +qed lemma image_lemma_0: assumes "card {a\s. f ` (s - {a}) = t - {b}} = n" shows "card {s'. \a\s. (s' = s - {a}) \ (f ` s' = t - {b})} = n" proof-