Theory COP
theory COP
imports
Contracts
begin
section‹ \<^citet>‹"HatfieldKojima:2010"›: Substitutes and stability for matching with contracts \label{sec:cop} ›
text‹
\<^citet>‹"HatfieldKojima:2010"› set about weakening @{const "substitutes"}
and therefore making the @{emph ‹cumulative offer processes›} (COPs,
\S\ref{sec:contracts-cop}) applicable to more matching problems. In
doing so they lose the lattice structure of the stable matches, which
necessitates redeveloping the results of \S\ref{sec:contracts}.
In contrast to the COP of \S\ref{sec:contracts-cop},
\<^citet>‹"HatfieldKojima:2010"› develop and analyze a @{emph
‹single-offer›} variant, where only one doctor (who has
no held contract) proposes per round. The order of doctors making
offers is not specified. We persist with the simultaneous-offer COP as
it is deterministic. See \<^citet>‹"HirataKasuya:2014"› for equivalence
arguments.
We begin with some observations due to
\citeauthor{AygunSonmez:2012-WP}. Firstly, as for the
matching-with-contracts setting of \S\ref{sec:contracts},
\<^citet>‹"AygunSonmez:2012-WP"› demonstrate that these results depend on
hospital preferences satisfying @{const "irc"}. We do not formalize
their examples. Secondly, an alternative to hospitals having choice
functions (as we have up to now) is for the hospitals to have
preference orders over sets, which is suggested by both
\<^citet>‹"HatfieldMilgrom:2005"› (weakly) and \<^citet>‹"HatfieldKojima:2010"›.
\<^citet>‹‹\S2› in "AygunSonmez:2012-WP"› argue that this approach is
under-specified and propose to define ‹Ch› as choosing
amongst maximal elements of some non-strict preference order (i.e.,
including indifference). They then claim that this is equivalent to
taking ‹Ch› as primitive, and so we continue down that
path.
›
subsection‹ Theorem~1: the COP yields a stable match under @{emph ‹bilateral substitutes›} ›
text‹
The weakest replacement condition suggested by
\<^citet>‹‹\S1› in "HatfieldKojima:2010"› for the @{const "substitutes"}
condition on hospital choice functions is termed @{emph ‹bilateral
substitutes›}:
\begin{quote}
Contracts are @{emph ‹bilateral substitutes›} for a hospital if there are
no two contracts ‹x› and ‹z› and a set of
contracts ‹Y› with other doctors than those associated
with ‹x› and ‹z› such that the hospital that
regards ‹Y› as available wants to sign ‹z›
if and only if ‹x› becomes available. In other words,
contracts are bilateral substitutes when any hospital, presented with
an offer from a doctor he does not currently employ, never wishes to
also hire another doctor he does not currently employ at a contract he
previously rejected.
\end{quote}
Note that this constraint is specific to this matching-with-contracts
setting, unlike those of \S\ref{sec:cf}.
›
context Contracts
begin
definition bilateral_substitutes_on :: "'x set ⇒ 'x cfun ⇒ bool" where
"bilateral_substitutes_on A f
⟷ ¬(∃B⊆A. ∃a b. {a, b} ⊆ A ∧ Xd a ∉ Xd ` B ∧ Xd b ∉ Xd ` B
∧ b ∉ f (B ∪ {b}) ∧ b ∈ f (B ∪ {a, b}))"
abbreviation bilateral_substitutes :: "'x cfun ⇒ bool" where
"bilateral_substitutes ≡ bilateral_substitutes_on UNIV"
lemma bilateral_substitutes_on_def2:
"bilateral_substitutes_on A f
⟷ (∀B⊆A. ∀a∈A. ∀b∈A. Xd a ∉ Xd ` B ∧ Xd b ∉ Xd ` B ∧ b ∉ f (B ∪ {b}) ⟶ b ∉ f (B ∪ {a, b}))"
(is "?lhs ⟷ ?rhs")
proof %invisible (rule iffI, clarsimp)
fix B a b
assume lhs: ?lhs and XXX: "B ⊆ A" "a ∈ A" "b ∈ A" "Xd a ∉ Xd ` B" "Xd b ∉ Xd ` B" "b ∉ f (insert b B)" "b ∈ f (insert a (insert b B))"
show False
proof(cases "a ∈ B")
case True with XXX show ?thesis by (simp add: insert_absorb)
next
case False with lhs XXX show ?thesis
unfolding bilateral_substitutes_on_def
by (cases "b ∈ B") (auto simp: insert_commute insert_absorb)
qed
qed (fastforce simp: bilateral_substitutes_on_def)
lemmas bilateral_substitutes_onI = iffD2[OF bilateral_substitutes_on_def2, rule_format]
lemmas bilateral_substitutes_onD = iffD1[OF bilateral_substitutes_on_def2, rule_format, simplified, unfolded conj_imp_eq_imp_imp]
lemmas bilateral_substitutes_def = bilateral_substitutes_on_def2[where A=UNIV, simplified]
lemmas bilateral_substitutesI = iffD2[OF bilateral_substitutes_def, rule_format]
lemmas bilateral_substitutesD = iffD1[OF bilateral_substitutes_def, rule_format, simplified, unfolded conj_imp_eq_imp_imp]
text‹›
lemma substitutes_on_bilateral_substitutes_on:
assumes "substitutes_on A f"
shows "bilateral_substitutes_on A f"
using %invisible assms by (auto intro!: bilateral_substitutes_onI dest: substitutes_onD[rotated -1])
text‹
\<^citet>‹‹\S4, Definition~5› in "AygunSonmez:2012-WP"› give the following
equivalent definition:
›
lemma bilateral_substitutes_on_def3:
"bilateral_substitutes_on A f
⟷ (∀B⊆A. ∀a∈A. ∀b∈A. b ∉ f (B ∪ {b}) ∧ b ∈ f (B ∪ {a, b}) ⟶ Xd a ∈ Xd ` B ∨ Xd b ∈ Xd ` B)"
unfolding %invisible bilateral_substitutes_on_def2 by blast
end
text‹
As before, we define a series of locales that capture the relevant
hypotheses about hospital choice functions.
›
locale ContractsWithBilateralSubstitutes = Contracts +
assumes Ch_bilateral_substitutes: "∀h. bilateral_substitutes (Ch h)"
sublocale ContractsWithSubstitutes < ContractsWithBilateralSubstitutes
using %invisible Ch_substitutes by unfold_locales (blast intro: substitutes_on_bilateral_substitutes_on)
locale ContractsWithBilateralSubstitutesAndIRC =
ContractsWithBilateralSubstitutes + ContractsWithIRC
sublocale ContractsWithSubstitutesAndIRC < ContractsWithBilateralSubstitutesAndIRC
by %invisible unfold_locales
context ContractsWithBilateralSubstitutesAndIRC
begin
text‹
The key difficulty in showing the stability of the result of the COP
under this condition \<^citep>‹‹Theorem~1› in "HatfieldKojima:2010"› is in
proving that it ensures we get an @{const "allocation"}; the remainder
of the proof of \S\ref{sec:contracts-cop} (for a single hospital,
where this property is trivial) goes through unchanged. We avail
ourselves of \<^citet>‹‹Lemma› in "HirataKasuya:2014"›, which they say is a
restatement of the proof of
\<^citet>‹‹Theorem~1› in "HatfieldKojima:2010"›. See also
\<^citet>‹‹Appendix~A› in "AygunSonmez:2012-WP"›.
›
lemma bilateral_substitutes_lemma:
assumes "Xd x ∉ Xd ` Ch h X"
assumes "d ∉ Xd ` Ch h X"
assumes "d ≠ Xd x"
shows "d ∉ Xd ` Ch h (insert x X)"
proof(rule notI)
assume "d ∈ Xd ` Ch h (insert x X)"
then obtain x' where x': "x' ∈ Ch h (insert x X)" "Xd x' = d" by blast
with Ch_irc ‹d ∉ Xd ` Ch h X›
have "x ∈ Ch h (insert x X)" unfolding irc_def by blast
let ?X' = "{y ∈ X. Xd y ∉ {Xd x, d}}"
from Ch_range ‹Xd x ∉ Xd ` Ch h X› ‹d ∉ Xd ` Ch h X› ‹d ≠ Xd x› x'
have "Ch h (insert x' ?X') = Ch h X"
using consistencyD[OF Ch_consistency[where h=h], where B="X" and C="insert x' ?X'"]
by (fastforce iff: image_iff)
moreover from Ch_range Ch_singular ‹d ∉ Xd ` Ch h X› x' ‹x ∈ Ch h (insert x X)›
have "Ch h (insert x (insert x' ?X')) = Ch h (insert x X)"
using consistencyD[OF Ch_consistency[where h=h], where B="insert x X" and C="insert x (insert x' ?X')"]
by (clarsimp simp: insert_commute) (blast dest: inj_onD)
moreover note ‹d ∉ Xd ` Ch h X› x'
ultimately show False
using bilateral_substitutesD[OF spec[OF Ch_bilateral_substitutes, of h], where a=x and b=x' and B="?X'"] by fastforce
qed
text ‹
Our proof essentially adds the inductive details these earlier efforts
skipped over. It is somewhat complicated by our use of the
simultaneous-offer COP.
›
lemma bilateral_substitutes_lemma_union:
assumes "Xd ` Ch h X ∩ Xd ` Y = {}"
assumes "d ∉ Xd ` Ch h X"
assumes "d ∉ Xd ` Y"
assumes "allocation Y"
shows "d ∉ Xd ` Ch h (X ∪ Y)"
using %invisible finite[of Y] assms by (induct arbitrary: d) (simp_all add: bilateral_substitutes_lemma)
lemma cop_F_CH_CD_on_disjoint:
assumes "cop_F_closed_inv ds fp"
assumes "cop_F_range_inv ds fp"
shows "Xd ` CH fp ∩ Xd ` (CD_on ds (- RH fp) - fp) = {}"
using %invisible assms CH_range unfolding cop_F_range_inv_def cop_F_closed_inv_def above_def
by (fastforce simp: set_eq_iff mem_CD_on_Cd Cd_greatest greatest_def)
text‹
Our key lemma shows that we effectively have @{const "substitutes"}
for rejected contracts, provided the relevant doctor does not have a
contract held with the relevant hospital. Note the similarity to
Theorem~4 (\S\ref{sec:cop-theorem-4}).
›
lemma cop_F_RH_mono:
assumes "cop_F_closed_inv ds fp"
assumes "cop_F_range_inv ds fp"
assumes "Xd x ∉ Xd ` Ch (Xh x) fp"
assumes "x ∈ RH fp"
shows "x ∈ RH (cop_F ds fp)"
proof(safe)
from ‹x ∈ RH fp› show "x ∈ cop_F ds fp" using cop_F_increasing by blast
next
assume "x ∈ CH (cop_F ds fp)"
from Ch_singular ‹x ∈ CH (cop_F ds fp)› ‹x ∈ RH fp›
have "Ch (Xh x) (cop_F ds fp) = Ch (Xh x) (fp ∪ (CD_on ds (-RH fp) - fp - {z. Xd z = Xd x}))"
unfolding cop_F_def
by - (rule consistencyD[OF Ch_consistency], auto simp: mem_CH_Ch dest: Ch_range' inj_onD)
with cop_F_CH_CD_on_disjoint[OF ‹cop_F_closed_inv ds fp› ‹cop_F_range_inv ds fp›]
have "Xd x ∉ Xd ` Ch (Xh x) (cop_F ds fp)"
by simp (rule bilateral_substitutes_lemma_union[OF _ ‹Xd x ∉ Xd ` Ch (Xh x) fp›],
auto simp: CH_def CD_on_inj_on_Xd inj_on_diff)
with ‹x ∈ CH (cop_F ds fp)› show False by (simp add: mem_CH_Ch)
qed
lemma cop_F_allocation_inv:
"valid ds (λds fp. cop_F_range_inv ds fp ∧ cop_F_closed_inv ds fp) (λds fp. allocation (CH fp))"
proof(induct rule: validI)
case base show ?case by (simp add: CH_simps)
next
case (step fp)
then have "allocation (CH fp)"
and "cop_F_closed_inv ds fp"
and "cop_F_range_inv ds fp" by blast+
note cop_F_CH_CD_on_disjoint = cop_F_CH_CD_on_disjoint[OF ‹cop_F_closed_inv ds fp› ‹cop_F_range_inv ds fp›]
note cop_F_RH_mono = cop_F_RH_mono[OF ‹cop_F_closed_inv ds fp› ‹cop_F_range_inv ds fp›]
show ?case
proof(rule inj_onI)
fix x y
assume "x ∈ CH (cop_F ds fp)" and "y ∈ CH (cop_F ds fp)" and "Xd x = Xd y"
show "x = y"
proof(cases "Xh y = Xh x")
case True with Ch_singular ‹x ∈ CH (cop_F ds fp)› ‹y ∈ CH (cop_F ds fp)› ‹Xd x = Xd y›
show ?thesis by (fastforce simp: mem_CH_Ch dest: inj_onD)
next
case False note ‹Xh y ≠ Xh x›
from ‹x ∈ CH (cop_F ds fp)› show ?thesis
proof(cases x rule: CH_cop_F_cases)
case CH note ‹x ∈ CH fp›
from ‹y ∈ CH (cop_F ds fp)› show ?thesis
proof(cases y rule: CH_cop_F_cases)
case CH note ‹y ∈ CH fp›
with ‹allocation (CH fp)› ‹Xd x = Xd y› ‹x ∈ CH fp›
show ?thesis by (blast dest: inj_onD)
next
case RH_fp note ‹y ∈ RH fp›
from ‹allocation (CH fp)› ‹Xd x = Xd y› ‹Xh y ≠ Xh x› ‹x ∈ CH fp› have "Xd y ∉ Xd ` Ch (Xh y) fp"
by clarsimp (metis Ch_CH_irc_idem Ch_range' inj_on_contraD)
with ‹y ∈ CH (cop_F ds fp)› ‹y ∈ RH fp› cop_F_RH_mono show ?thesis by blast
next
case CD_on note y' = ‹y ∈ CD_on ds (- RH fp) - fp›
with cop_F_CH_CD_on_disjoint ‹Xd x = Xd y› ‹x ∈ CH fp› show ?thesis by blast
qed
next
case RH_fp note ‹x ∈ RH fp›
from ‹y ∈ CH (cop_F ds fp)› show ?thesis
proof(cases y rule: CH_cop_F_cases)
case CH note ‹y ∈ CH fp›
from ‹allocation (CH fp)› ‹Xd x = Xd y› ‹Xh y ≠ Xh x› ‹y ∈ CH fp› have "Xd x ∉ Xd ` Ch (Xh x) fp"
by clarsimp (metis Ch_CH_irc_idem Ch_range' inj_on_contraD)
with ‹x ∈ CH (cop_F ds fp)› ‹x ∈ RH fp› cop_F_RH_mono show ?thesis by blast
next
case RH_fp note ‹y ∈ RH fp›
show ?thesis
proof(cases "Xd x ∈ Xd ` Ch (Xh x) fp")
case True
with ‹allocation (CH fp)› ‹Xd x = Xd y› ‹Xh y ≠ Xh x› have "Xd y ∉ Xd ` Ch (Xh y) fp"
by clarsimp (metis Ch_range' inj_onD mem_CH_Ch)
with ‹y ∈ CH (cop_F ds fp)› ‹y ∈ RH fp› cop_F_RH_mono show ?thesis by blast
next
case False note ‹Xd x ∉ Xd ` Ch (Xh x) fp›
with ‹x ∈ CH (cop_F ds fp)› ‹x ∈ RH fp› cop_F_RH_mono show ?thesis by blast
qed
next
case CD_on note ‹y ∈ CD_on ds (- RH fp) - fp›
from cop_F_CH_CD_on_disjoint ‹Xd x = Xd y› ‹y ∈ CD_on ds (- RH fp) - fp›
have "Xd x ∉ Xd ` Ch (Xh x) fp" by (auto simp: CH_def dest: Ch_range')
with ‹x ∈ CH (cop_F ds fp)› ‹x ∈ RH fp› cop_F_RH_mono show ?thesis by blast
qed
next
case CD_on note ‹x ∈ CD_on ds (- RH fp) - fp›
from ‹y ∈ CH (cop_F ds fp)› show ?thesis
proof(cases y rule: CH_cop_F_cases)
case CH note ‹y ∈ CH fp›
with cop_F_CH_CD_on_disjoint ‹Xd x = Xd y› ‹x ∈ CD_on ds (- RH fp) - fp› show ?thesis by blast
next
case RH_fp note ‹y ∈ RH fp›
from cop_F_CH_CD_on_disjoint ‹Xd x = Xd y› ‹x ∈ CD_on ds (- RH fp) - fp›
have "Xd y ∉ Xd ` Ch (Xh y) fp" unfolding CH_def by clarsimp (blast dest: Ch_range')
with ‹y ∈ CH (cop_F ds fp)› ‹y ∈ RH fp› cop_F_RH_mono show ?thesis by blast
next
case CD_on note ‹y ∈ CD_on ds (- RH fp) - fp›
with ‹Xd x = Xd y› ‹x ∈ CD_on ds (- RH fp) - fp› show ?thesis
by (meson CD_on_inj_on_Xd DiffD1 inj_on_eq_iff)
qed
qed
qed
qed
qed
lemma fp_cop_F_allocation:
shows "allocation (cop ds)"
proof %invisible -
have "invariant ds (λds fp. cop_F_range_inv ds fp ∧ cop_F_closed_inv ds fp ∧ allocation (CH fp))"
using cop_F_range_inv cop_F_closed_inv cop_F_allocation_inv
by - (rule valid_conj | blast | rule valid_pre)+
then show ?thesis by (blast dest: invariantD)
qed
theorem Theorem_1:
shows "stable_on ds (cop ds)"
proof %invisible (rule stable_onI)
show "individually_rational_on ds (cop ds)"
proof(rule individually_rational_onI)
from fp_cop_F_allocation show "CD_on ds (cop ds) = cop ds"
by (rule CD_on_closed) (blast dest: fp_cop_F_range_inv' CH_range')
show "CH (cop ds) = cop ds" by (simp add: CH_irc_idem)
qed
show "stable_no_blocking_on ds (cop ds)" by (rule cop_stable_no_blocking_on)
qed
end
text (in ContractsWithBilateralSubstitutesAndIRC) ‹
\<^citet>‹‹\S3.1› in "HatfieldKojima:2010"› provide an example that shows that
the traditional optimality and strategic results do not hold under
@{const "bilateral_substitutes"}, which motivates looking for a
stronger condition that remains weaker than @{const "substitutes"}.
Their example involves two doctors, two hospitals, and five contracts.
›