theorem marriage_necessary: fixes A :: "'a ==> 'b set"and I :: "'a set" assumes"finite I"and"∀ i∈I. finite (A i)" and"∃R. (∀i∈I. R i ∈ A i) ∧ inj_on R I" (is"∃R. ?R R A & ?inj R A") shows"∀J⊆I. card J ≤ card (∪(A ` J))" proof clarify fix J assume"J ⊆ I" show"card J ≤ card (∪(A ` J))" proof- from assms(3) obtain R where"?R R A"and"?inj R A"by auto have"inj_on R J"by(rule inj_on_subset[OF ‹?inj R A›‹J⊆I›]) moreoverhave"(R ` J) ⊆ (∪(A ` J))"using‹J⊆I›‹?R R A›by auto moreoverhave"finite (∪(A ` J))"using‹J⊆I› assms by (metis finite_UN_I finite_subset subsetD) ultimatelyshow ?thesis by (rule card_inj_on_le) qed qed
text‹The proof by Halmos and Vaughan:› theorem marriage_HV: fixes A :: "'a ==> 'b set"and I :: "'a set" assumes"finite I"and"∀ i∈I. finite (A i)" and"∀J⊆I. card J ≤ card (∪(A ` J))" (is"?M A I") shows"∃R. (∀i∈I. R i ∈ A i) ∧ inj_on R I"
(is"?SDR A I"is"∃R. ?R R A I & ?inj R A I") proof-
{ fix I have"finite I ==>∀i∈I. finite (A i) ==> ?M A I ==> ?SDR A I" proof(induct arbitrary: A rule: finite_psubset_induct) case (psubset I) show ?case proof (cases) assume"I={}"thenshow ?thesis by simp next assume"I ≠ {}" have"∀i∈I. A i ≠ {}" proof (rule ccontr) assume"¬ (∀i∈I. A i≠{})" thenobtain i where"i∈I""A i = {}"by blast hence"{i}⊆ I"by auto from mp[OF spec[OF psubset.prems(2)] this] ‹A i={}› show False by simp qed show ?thesis proof cases assume case1: "∀K⊂I. K≠{} ⟶ card (∪(A ` K)) ≥ card K + 1" show ?thesis proof- from‹I≠{}›obtain n where"n∈I"by auto with‹∀i∈I. A i ≠ {}›have"A n ≠ {}"by auto thenobtain x where"x ∈ A n"by auto let ?A' = "λi. A i - {x}"let ?I' = "I - {n}" from‹n∈I›have"?I' ⊂ I" by (metis DiffD2 Diff_subset insertI1 psubset_eq) have fin': "∀i∈?I'. finite (?A' i)"using psubset.prems(1) by auto have"?M ?A' ?I'" proof clarify fix J assume"J ⊆ ?I'" hence"J ⊂ I"by (metis ‹I - {n} ⊂ I› subset_psubset_trans) show"card J ≤ card (∪i∈J. A i - {x})" proof cases assume"J = {}"thus ?thesis by auto next assume"J ≠ {}" hence"card J + 1 ≤ card(∪(A ` J))"using case1 ‹J⊂I›by blast moreover have"card(∪(A ` J)) - 1 ≤ card (∪i∈J. A i - {x})" (is"?l ≤ ?r") proof- have"finite J"using‹J ⊂ I› psubset(1) by (metis psubset_imp_subset finite_subset) hence1: "finite(∪(A ` J))" using‹∀i∈I. finite(A i)›‹J⊂I›by force have"?l = card(∪(A ` J)) - card{x}"by simp alsohave"…≤ card(∪(A ` J) - {x})"using1 by (metis diff_card_le_card_Diff finite.intros) alsohave"∪(A ` J) - {x} = (∪i∈J. A i - {x})"by blast finallyshow ?thesis . qed ultimatelyshow ?thesis by arith qed qed from psubset(2)[OF ‹?I'⊂I› fin' ‹?M ?A' ?I'›] obtain R' where"?R R' ?A' ?I'""?inj R' ?A' ?I'"by auto let ?Rx = "R'(n := x)" have"?R ?Rx A I"using‹x∈A n›‹?R R' ?A' ?I'›by force have"∀i∈?I'. ?Rx i ≠ x"using‹?R R' ?A' ?I'›by auto hence"?inj ?Rx A I"using‹?inj R' ?A' ?I'› by(auto simp: inj_on_def) with‹?R ?Rx A I›show ?thesis by auto qed next assume"¬ (∀K⊂I. K≠{} ⟶ card (∪(A ` K)) ≥ card K + 1)" thenobtain K where "K⊂I""K≠{}"and c1: "¬(card (∪(A ` K)) ≥ card K + 1)"by auto with psubset.prems(2) have"card (∪(A ` K)) ≥ card K"by auto with c1 have case2: "card (∪(A ` K))= card K"by auto from‹K⊂I›‹finite I›have"finite K"by (auto intro:finite_subset) from psubset.prems ‹K⊂I› have"∀i∈K. finite (A i)""∀J⊆K. card J ≤ card(∪(A ` J))"by auto from psubset(2)[OF ‹K⊂I› this] obtain R1 where"?R R1 A K""?inj R1 A K"by auto let ?AK = "λi. A i - ∪(A ` K)"let ?IK = "I - K" from‹K≠{}›‹K⊂I›have"?IK⊂I"by auto have"∀i∈?IK. finite (?AK i)"using psubset.prems(1) by auto have"?M ?AK ?IK" proof clarify fix J assume"J ⊆ ?IK" with‹finite I›have"finite J"by(auto intro: finite_subset) show"card J ≤ card (∪ (?AK ` J))" proof- from‹J⊆?IK›have"J ∩ K = {}"by auto have"card J = card(J∪K) - card K" using‹finite J›‹finite K›‹J∩K={}› by (auto simp: card_Un_disjoint) alsohave"card(J∪K) ≤ card(∪(A ` (J∪K)))" proof - from‹J⊆?IK›‹K⊂I›have"J ∪ K ⊆ I"by auto with psubset.prems(2) show ?thesis by blast qed alsohave"… - card K = card(∪ (?AK ` J) ∪∪(A ` K)) - card K" proof- have"∪(A ` (J∪K)) = ∪ (?AK ` J) ∪∪(A ` K)" using‹J⊆?IK›by auto thus ?thesis by simp qed alsohave"… = card (∪ (?AK ` J)) + card(∪(A ` K)) - card K" proof- have"finite (∪ (?AK ` J))"using‹finite J›‹J⊆?IK› psubset(3) by(blast intro: finite_UN_I finite_Diff) moreoverhave"finite (∪(A ` K))" using‹finite K›‹∀i∈K. finite (A i)›by auto moreoverhave"∪ (?AK ` J) ∩∪(A ` K) = {}"by auto ultimatelyshow ?thesis by (simp add: card_Un_disjoint del:Un_Diff_cancel2) qed alsohave"… = card (∪ (?AK ` J))"using case2 by simp finallyshow ?thesis by simp qed qed from psubset(2)[OF ‹?IK⊂I›‹∀i∈?IK. finite (?AK i)›‹∀J⊆?IK. card J ≤ card (∪i∈J. A i - ∪ (A ` K))›] obtain R2 where"?R R2 ?AK ?IK""?inj R2 ?AK ?IK"by auto let ?R12 = "λi. if i∈K then R1 i else R2 i" have"∀i∈I. ?R12 i ∈ A i"using‹?R R1 A K›\<open>?R R2 ?AK ?IK›by auto moreoverhave"∀i∈I. ∀j∈I. i≠j⟶?R12 i ≠ ?R12 j" proof clarify fix i j assume"i∈I""j∈I""i≠j""?R12 i = ?R12 j" show False proof-
{ assume"i∈K ∧ j∈K ∨ i∉K∧j∉K" with‹?inj R1 A K›‹?inj R2 ?AK ?IK›‹?R12 i=?R12 j›‹i≠j›‹i∈I›‹j∈I› have?thesisby(fastforcesimp:inj_on_def) }moreover {assume"i\<in>K\<and>j\<notin>K\<or>i\<notin>K\<and>j\<in>K" with\<open>?RR1AK\<close>\<open>?RR2?AK?IK\<close>\<open>?R12i=?R12j\<close>\<open>j\<in>I\<close>\<open>i\<in>I\<close> have?thesisbyauto(metisDiff_iff) }ultimatelyshow?thesisbyblast qed qed ultimatelyshow?thesisunfoldinginj_on_defbyfast qed qed qed } withassms\<open>?MAI\<close>show?thesisbyauto qed
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.