\documentclass{article}
\usepackage{simplewick}
\usepackage{amsmath,mathtools,amssymb}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{verbatim}
\usepackage{cancel}
\usepackage{mathrsfs}
\usepackage{bbm}
\usepackage{braket}
\usepackage{xcolor}
\definecolor{orange}{RGB}{255,127,0}
\definecolor{green}{RGB}{34,139,34}
\definecolor{purple}{RGB}{153,50,204}
\definecolor{blue}{RGB}{70,130,180}
\usepackage{verbatim}
\usepackage[margin=1.0in]{geometry}
\newcommand{\ol}{\overline}
\newcommand{\ctr}{\bcontraction}
\newcommand{\tl}{\tilde}
\newcommand{\h}{\circ}
\newcommand{\p}{\bullet}
\newcommand{\fctr}{\contraction}
\newcommand{\ve}{\varepsilon}
\newcommand{\kphi}{\ensuremath{\ket{\Phi}} }
\newcommand{\ap}{\ensuremath{a_p} }
\newcommand{\dg}{\ensuremath{^\dagger} }
\newcommand{\cd}{\ensuremath{\cdots} }
\newcommand{\apd}{\ensuremath{a_p^\dagger} }
\def\*#1{\mathbf{#1}}
\def\cb#1{{\color{blue}#1}}
\def\co#1{{\color{orange}#1}}
\def\cre#1{{\color{red}#1}}
\def\cg#1{{\color{green}#1}}
\def\cp#1{{\color{purple}#1}}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\title{Lecture 3.7:  Kutznelnigg--Mukherjee Notation}
\date{March 4$^{\text{th}}$, 2020}
\begin{document}
\maketitle
\section{Our current notation falls short}
Under our current notation, we would write a Wick expansion of the two-electron operator as:
\begin{align*}
a_p\dg a_q\dg a_s a_r  &= N[a_p\dg a_q\dg a_s a_r  ] \\
&+ N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg a_q\dg a_s a_r  ] + N[ \fctr{}{x}{{}_1a_q\dg  a_s }{x} a_p\dg a_q\dg a_s a_r  ]
+ N[ \fctr{a_p\dg }{x}{{}_2}{x} a_p\dg a_q\dg a_s a_r  ] +  N[ \fctr{a_p\dg }{x}{{}_2 a_s }{x} a_p\dg a_q\dg a_s a_r  ] \\
&+ N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x}      a_p\dg a_q\dg a_s a_r  ]
+ N[ \fctr{}{x}{{}_1a_q\dg }{x}  \fctr[2ex]{a_p\dg }{x}{{}_2 a_s }{x} a_p\dg a_q\dg a_s a_r  ]
\end{align*}
If we were to evaluate the matrix element:
\[\braket{\Phi | a_p\dg a_q\dg a_s a_r  | \Phi} \]
we would only have to consider the last two fully contracted terms in the Wick expansion.
This is tedious, but doable.
However, there are some matrix elements that would take literally hours or days to solve with the current notation.
\\ \\
For example,
\[\braket{\Phi | N[a_k\dg a_l\dg a_d a_c] N[a_p\dg a_q\dg a_s a_r] N[a_a\dg a_b\dg a_j a_i] | \Phi} \]
has 80 fully contracted terms we would have to evaluate!
This is far from ideal.
\\ \\
We will now learn two methods that will simplify the way we write these terms and make their evaluation doable.
\section{Reduced index antisymmetrizers}
First, we will address how we can group certain contractions together and express them generally.
In the Wick expansion of $a_p\dg a_q\dg a_s a_r $ above, we thought about the possible contractions by keeping the order of terms fixed and moving the contraction lines.
The overall sign came from the number of permutations it took to form a neighboring contraction and move the contraction out of the $\Phi$-Normal product.  \\ \\
For example, the terms with single contractions can be evaluated in the following manner:
\begin{align*}
&N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg a_q\dg a_s a_r  ] + N[ \fctr{}{x}{{}_1a_q\dg  a_s }{x} a_p\dg a_q\dg a_s a_r  ]
+ N[ \fctr{a_p\dg }{x}{{}_2}{x} a_p\dg a_q\dg a_s a_r  ] +  N[ \fctr{a_p\dg }{x}{{}_2 a_s }{x} a_p\dg a_q\dg a_s a_r  ] \\
= - & N[ \fctr{}{x}{{}_1 }{x} a_p\dg  a_s a_q\dg a_r  ] + N[ \fctr{}{x}{{}_1 }{x} a_p\dg a_r a_q\dg a_s   ]
+ N[ \fctr{a_p\dg }{x}{{}_2}{x} a_p\dg a_q\dg a_s a_r  ] - N[ \fctr{a_p\dg }{x}{{}_2 }{x} a_p\dg a_q\dg  a_r  a_s ] \\
= - & \fctr{}{x}{{}_1 }{x} a_p\dg  a_s N[  a_q\dg a_r  ] + \fctr{}{x}{{}_1 }{x} a_p\dg a_r N[  a_q\dg a_s   ]
+ \fctr{ }{x}{{}_2}{x} a_q\dg a_s N[  a_p\dg  a_r  ] -\fctr{ }{x}{{}_2 }{x}a_q\dg  a_r N[  a_p\dg   a_s ] \\
=  - & \gamma_{ps} N[  a_q\dg a_r  ] + \gamma_{pr} N[  a_q\dg a_s   ]
+ \gamma_{qs}  N[  a_p\dg  a_r  ] -\gamma_{qr}  N[  a_p\dg   a_s ] \\
\end{align*}
We can equivalently keep the contraction lines fixed and permute the operators instead.
For the terms with single contractions, instead of moving the contraction lines, we can keep them at positions 1 and 3, and permute the operators to get the equivalent contractions:
\begin{align*}
&N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg a_q\dg a_s a_r  ] + N[ \fctr{}{x}{{}_1a_q\dg  a_s }{x} a_p\dg a_q\dg a_s a_r  ]
+ N[ \fctr{a_p\dg }{x}{{}_2}{x} a_p\dg a_q\dg a_s a_r  ] +  N[ \fctr{a_p\dg }{x}{{}_2 a_s }{x} a_p\dg a_q\dg a_s a_r  ] \\
= & N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg a_q\dg a_s a_r  ] - N[ \fctr{}{x}{{}_1a_q\dg  }{x} a_p\dg a_q\dg a_r  a_s  ]
- N[ \fctr{ }{x}{{}_q\dg a_p\dg }{x} a_q\dg  a_p\dg a_s a_r  ] +  N[ \fctr{ }{x}{{}_q\dg a_p\dg }{x} a_q\dg a_p\dg  a_r a_s   ] \\
\end{align*}
We see that the second term can obtained by permuting indices $s$ and $r$, the third term is obtained by permuting indices $p$ and $q$, and the fourth term is obtained
by permuting both $p$ and $q$,  and $s$ and $r$. The sign change of a permutation is accounted for.
\\ \\
How can we compactly represent permutation on indices?
\\ \\
Recall that we previous introduced the index antisymmetrizer operator $\hat{A}$ when we defined a Slater Determinant $\Phi$:
 \[ \ket{\Phi_{p_1 \cdots p_N}} =  \sqrt{N!} \hat{A} \ket{\phi_{p_1}\phi_{p_2} \cdots \phi_{p_N}} \]
The antisymmetrizer $\hat{A}$ gave us a linear combination of all possible permutations of indices $p_1 \cd p_N$.
Here, we want a similar type of operator, one that gives us a linear combination of index permutations.
Instead of $\hat{A}$, which gave us \textit{all} possible permutations for a set of indices, we want an operator that only acts on a subset of these indices. \\ \\
We can define a \textit{reduced index antisymmetrizer} $\hat{P}_{(r_1 / \cd / r_m)}$, which gives all possible permutations between indices $r_1 \cd  r_m$, where
$r_1 \cd  r_m$ is a subset of some larger set of indices $p_1 \cd p_N$.
We note the $/$ defines the subgroups of indices.
We only consider permutations \textit{between} the subgroups.
Let's go through some examples.
\subsection{$\hat{P}_{(p/q)}$}
$\hat{P}_{(p/q)}$ gives us the linear combinations of all permutations of $p$ and $q$.
We can express it as:
\[\hat{P}_{(p/q)} = 1 - (pq) \]
$(pq)$ represents a transposition between indices $p$ and $q$, and has a negative sign to account for the permutation.
We can see the result of acting $\hat{P}$ on a product of operators:
\[\hat{P}_{(p/q)} a_p a_q = [1 - (pq) ] a_p a_q = a_p a_q - a_q a_p \]
\[\hat{P}_{(p/q)} a_p a_r a_q = [1 - (pq) ] a_p a_r a_q = a_p a_r a_q - a_q a_r a_p \]
%(Side note: If $r_1 \cd  r_m$ is exactly equal to $p_1 \cd p_N$, then $\hat{P}$ is equal to $\hat{A}$.
\\ \\
The total number of terms in the linear combination is obtained by:
\[\frac{2!}{1! 1!} = 2 \]
where the numerator is the factorial of the total number of indices involved ($p$, $q$)
and the denominator is the factorial of the total number of indices in \textit{each subgroup} divided by $/$.
\subsection{$\hat{P}_{(p/q/r)}$}
$\hat{P}_{(p/q)}$ gives us the linear combinations of all permutations between $p$, $q$, and $r$:
 \[\hat{P}_{(p/q/r)} = 1 - (pq) - (pr) - (qr) + (qr)(pr) + (pq)(qr) \]
 To see the how to obtain the transpositions above, we can write down all possible ways to order $p$, $q$, and $r$ and the associated permutations:
 \begin{align*}
pqr \quad& (1)  \\
 prq \quad& (qr) \\
rqp \quad& (pr)  \\
rpq \quad& (qr)(pr) \\
qpr \quad& (pq) \\
qrp  \quad& (qr)(pr)
 \end{align*}
 Without writing all the permutations explicitly, we can obtain the total number terms in the linear combination with:
 \[\frac{3!}{1! 1! 1!} = 6 \]
\subsection{$\hat{P}_{(p/qr)}$}
Remember that we consider permutations between subgroups divided by $/$.
Thus, for the operator $\hat{P}_{(p/qr)}$, we consider permutations between $p$ and $q$, and $p$ and $r$, but NOT $q$ and $r$:
 \[\hat{P}_{(p/qr)} = 1 - (pq) - (qr)  \]
 The total number of terms in the linear combination is:
 \[\frac{3!}{1! 2!} = 3 \]
 You can prove to yourself that we can recover all permutations between $p$, $q$, and $r$ by multiplying  $\hat{P}_{(p/qr)}$ by the permutations we didn't consider $ \left( \hat{P}_{(q/r)}\right)$:
 \[ \hat{P}_{(p/q/r)} = \hat{P}_{(p/qr)}\hat{P}_{(q/r)}\]
 \subsection{Using the reduced index antisymmetrizer for contractions}
 We see that the permutations associated with the single contractions that we wrote before:
 \begin{align*}
 & N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg  a_q\dg a_s a_r  ] - N[ \fctr{}{x}{{}_1a_q\dg  }{x} a_p\dg a_q\dg a_r  a_s  ]
- N[ \fctr{ }{x}{{}_q\dg a_p\dg }{x} a_q\dg  a_p\dg a_s a_r  ] +  N[ \fctr{ }{x}{{}_q\dg a_p\dg }{x} a_q\dg a_p\dg  a_r a_s   ] \\
& \quad \quad (1)  \quad \quad  \quad \quad \quad (rs) \quad \quad  \quad \quad \quad (pq) \quad \quad  \quad \quad (pq)(rs)
\end{align*}
is simply a product of 2 independent permutations $\hat{P}_{(p/q)}$ and $\hat{P}_{(s/r)}$:
\[ \hat{P}_{(p/q)}\hat{P}_{(s/r)} = 1 - (pq) - (sr) + (pq)(sr) \]
We can thus represent the four single contractions with just the index antisymmetrizer acting on one term:
\[ \hat{P}_{(p/q)}\hat{P}_{(s/r)} N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg  a_q\dg a_s a_r  ]  = N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg  a_q\dg a_s a_r  ] - N[ \fctr{}{x}{{}_1a_q\dg  }{x} a_p\dg a_q\dg a_r  a_s  ]
- N[ \fctr{ }{x}{{}_q\dg a_p\dg }{x} a_q\dg  a_p\dg a_s a_r  ] +  N[ \fctr{ }{x}{{}_q\dg a_p\dg }{x} a_q\dg a_p\dg  a_r a_s   ]  \]
We can represent the double contractions in a similar manner:
\[ \hat{P}_{(s/r)}  N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x}      a_p\dg a_q\dg a_s a_r  ]  =  N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x}      a_p\dg a_q\dg a_s a_r  ]
 - N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x}      a_p\dg a_q\dg a_r a_s  ] = N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x}      a_p\dg a_q\dg a_s a_r  ]
+ N[ \fctr{}{x}{{}_1a_q\dg }{x}  \fctr[2ex]{a_p\dg }{x}{{}_2 a_s }{x} a_p\dg a_q\dg a_s a_r  ] \]
Note that instead of permuting $s$ and $r$, we can alternatively permute $p$ and $q$ for the same result.
\\ \\
Thus, using index antisymmetrizers, we can represent the full Wick expansion of $a_p\dg  a_q\dg a_s a_r $ as:
\[a_p\dg  a_q\dg a_s a_r = N[a_p\dg  a_q\dg a_s a_r] + \hat{P}_{(p/q)}\hat{P}_{(s/r)} N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg  a_q\dg a_s a_r  ]  + \hat{P}_{(s/r)}  N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x}      a_p\dg a_q\dg a_s a_r  ]   \]
This is already a huge improvement for simplifying our notation.
\section{Kutzelnigg--Mukherjee Notation}
We can further simplify our notation by changing how we write creation and annihilation operators.
Under the Kutzelnigg--Mukherjee notation, we write creation operators as:
\[a_p\dg = a^p\]
Thus, a product $a_p a_q\dg$ can be written as $a_p a^q$.
\\ \\
A vacuum normal ordered string of operators,
\[a^{p_1} \cd a^{p_m} a_{q_m} \cd a_{q_1} \]
can be further compactly represented by combining the upper and lower indices:
\[a^{p_1} \cd a^{p_m} a_{q_m} \cd a_{q_1} = a^{p_1 \cd p_m}_{q_1 \cd q_m} \]
For example,
\[a^p a_q = a^p_q\]
\[a^{pq}_{rs} = a^pa^qa_sa_r\]
\\
$\Phi$-Normal ordered operators \textit{in which the string inside is in vacuum normal ordering }can be written as:
\[ \tilde{a}^{p_1 \cd p_m}_{q_1 \cd q_m}  = N[ a^{p_1} \cd a^{p_m} a_{q_m} \cd a_{q_1}  ] \]
For example, product of 2 operators $a^pa_q$ in $\Phi$-normal ordering is:
\[\tilde{a}^p_q = N[a^pa_q]\]
Note that if the order of the operators were switched, and we had $a^pa_q$, we cannot simplify $N[a_p a^q]$ any further because the more compact notation only applies to terms in which
the dagger is on the left.\footnote{Technically, you could write, $N[a_p a^q] = - N[ a^q a_p] = - \tilde{a}^p_q$. But be very careful.
This kind of free permutation is only allowed when there are no contractions involved.
Remember that you \textit{cannot} freely permute the order of \textit{contracted} operators. }
\\ \\
How would we simplify $N[a^p a_q a^s a_r ] $? In this case, there are two groups of operators that are in $vacuum$ normal ordering.
We can write $a_q^p = a^p a_q$ and $a_r^s = a^s a_r$.
Our final simplification is:
\[N[a^p a_q a^s a_r ] = N[ a_q^p a_r^s ] \]
%\[ N[ a_p\dg a_q a_\]

\subsection{1 and 2-electron integrals}
The one and two-electron integrals can also be represented by using upper and lower indices.
The indices in the $bra$ will be written as lower indices.
The indices in the $ket$ will be written as upper indices.
\\ \\
We thus have:
\[\braket{p | \hat{h}| q} = h_{pq} = h_p^q \]
\[\braket{p | \hat{h}| q} + \sum_i \braket{pi || qi} = f_{pq} = f_p^q \]
We using $g$ for the two-electron integrals:
\[\braket{pq| \hat{\nu} | rs} = \braket{pq| rs} =g_{pq}^{rs} \]
The antisymmetrized two-electron integral can be represented with $\bar{g}$:
\[\braket{pq| rs}  - \braket{pq| sr} = \braket{pq|| rs} =\bar{g}_{pq}^{rs} \]
We can thus express our Hamiltonian as:
\[ H = \sum_{pq} h_{pq} \apd a_q + \frac{1}{2} \sum_{pqrs} \braket{pq|rs} \apd a_q\dg a_s a_r  = \sum_{pq} h_{p}^{q} a_q^p + \frac{1}{2} \sum_{pqrs} g_{pq}^{rs} a^{pq}_{rs}  \]
We can take advantage of the Einstein summation notation, which says that if an index appears once as an upper index and once as a lower index, it is \textit{implicitly} summed over.
Since $p$, $q$, $r$, and $s$ appear both as a upper and lower index, we can leave out the implicit summation:
\[ H  =  h_{p}^{q} a_q^p +  \frac{1}{2} g_{pq}^{rs} a^{pq}_{rs} \]
The antisymmetrized Hamiltonian can be written as:
\[ H  = h_{pq} a_q^p +  \frac{1}{4} \bar{g}_{pq}^{rs} a^{pq}_{rs} \]
The correlation component of the Hamiltonian can be written as:
\[ H_c  = \sum_{pq}f_{pq} N[\apd a_q  ] +  \frac{1}{4}\sum_{pqrs}  \braket{pq||rs}  N[\apd a_q\dg a_s a_r] =   f_{p}^{q} \tilde{a}_q^p +  \frac{1}{4} \bar{g}_{pq}^{rs} \tilde{a}^{pq}_{rs} \]
Note the use of $\tilde{a}$ in $H_c$.
\subsection{Contractions}
In the particle-hole formalism, we had 2 types of contractions:
\[\fctr{ }{a}{{}_p\dg}{a} a_p\dg a_q = \gamma_{pq} \quad \quad \fctr{ }{a}{{}_p}{a} a_p a_q\dg = \eta_{pq} \]
\[\fctr{ }{a}{{}^p}{a} a^p a_q = \gamma_{pq} \quad \quad \fctr{ }{a}{{}_p}{a} a_p a^q = \eta_{pq} \]
$\fctr{ }{a}{{}^p}{a} a^p a_q$ were contractions that only existed when we switched to the hole framework.
Thus, we call these types of contractions \textit{hole contractions}.
We call $\fctr{ }{a}{{}_p}{a} a_p a^q $ \textit{particle contractions} since they existed in the original particle framework.  \\ \\
We represent hole contractions with open circles:
\[ \fctr{ }{a}{{}^p}{a}a^p a_q  = a^{p^\circ} a_{q^\circ} = a^{p^\circ}_{q^\circ} = \gamma_{pq} \]
We see that since the creation operator is on the left, we can use the more compact notation for hole contractions.
We represent particle contractions with closed circles:
\[ \fctr{ }{a}{{}_p}{a} a_p a^q  = a_{p^\bullet} a^{q^\bullet}  =  \eta_{pq} \]

\subsection{Example 1}
We can now write our Wick expansion of 4 operators using KM notation, going from
\[a_p\dg  a_q\dg a_s a_r = N[a_p\dg  a_q\dg a_s a_r] + \hat{P}_{(p/q)}\hat{P}_{(s/r)} N[ \fctr{}{x}{{}_1a_q\dg }{x} a_p\dg  a_q\dg a_s a_r  ]  + \hat{P}_{(s/r)}  N[ \fctr{a_p\dg }{x}{{}_2}{x} \fctr[2ex]{}{x}{{}_1a_q\dg  a_s }{x} a_p\dg a_q\dg a_s a_r  ]   \]
to
\[a_{rs}^{pq} = \tl{a}_{rs}^{pq} +  \hat{P}^{(p/q)}_{(s/r)}  \tl{a}_{r s^\h}^{p^\h q}  + \hat{P}_{(s/r)}  \tl{a}_{r^{\h} s^{\h\h}}^{p^\h q^{\h\h}} \]
Notice that to distinguish between different contraction pairs, I chose to use a different number of open circles.
\subsection{Example 2 }
Let's see an example of an instance where particle contractions come up:
\[ \braket{\Phi_j^b | H_c | \Phi_i^a} =  f_p^q \braket{\Phi | \tl{a}_b^j \tl{a}_q^p \tl{a}_i^a | \Phi} + \frac{1}{2}g_{pq}^{rs} \braket{\Phi | \tl{a}_b^j \tl{a}^{pq}_{rs} \tl{a}_i^a | \Phi}   \]
For the one-electron term, we see that we can form 2 fully contracted terms:
\[ f_p^q \braket{\Phi | \tl{a}_b^j \tl{a}_q^p \tl{a}_i^a | \Phi}  = f_p^q \braket{\Phi | \tl{a}_{b^\p}^{j^{\h\h}} \tl{a}_{q^{\h\h}}^{p^\h} \tl{a}_{i^\h}^{a^\p} | \Phi}  + f_p^q \braket{\Phi | \tl{a}_{b^\p}^{j^\h} \tl{a}_{q^{\p\p}}^{p^\p} \tl{a}_{i^\h}^{a^{\p\p}} | \Phi} \]
For the two-electron term, we see that all possible fully contracted terms involves permutations between $p$ and $q$, and $r$ and $s$, so we can just use a reduced index antisymmetrizer:
\[ \frac{1}{2}g_{pq}^{rs} \braket{\Phi | \tl{a}_b^j \tl{a}^{pq}_{rs} \tl{a}_i^a | \Phi} = \frac{1}{2}g_{pq}^{rs}  \hat{P}^{(p/q)}_{(r/s)}  \braket{\Phi | \tl{a}_{b^\p}^{j^{\h\h}} \tl{a}^{{p^\h}{q^\p}}_{{r^{\p\p}}{s^{\h\h}}} \tl{a}_{i^\h}^{a^{\p\p}} | \Phi}  \]
To actually evaluate the term, in my opinion, it is not easy to see the overall sign that the contractions give until you translate back to writing contraction lines.
\subsection{Last thoughts}
Some last observations:
\begin{itemize}
\item Contractions are always between upper and lower indices. This is because the nonzero contractions are always between creation (upper indices) and annihilation operators (lower indices).
\item Within a group that can be compacted written with one $a$, for example, $\tl{a}^{p_1 \cd p_m}_{q_1 \cd q_m} $, only hole contractions are possible, since by definition all the dagger on the left.
 \item We can use reduced index antisymmetrizers only between indices that are part of the $same$ $\Phi$-normal ordered group, since you can only freely permute with a sign change within a $\Phi$-normal ordered group.
\end{itemize}
\end{document}


\section{Proof Techniques for Disjunctive Systems} \label{gua:sec:proofs-disj}

\subsection{\LTLmX\ Properties without Fairness: Existing Constructions}
\label{gua:sec:ideas-disj-nofair}

We revisit the main techniques
of the original proof of Theorem~\ref{thm:disj-cutoff-pairs}~\cite{Emerson00}.

\begin{lemma}[Monotonicity: Disj, \LTLmX, Unfair] \label{disj:le:NonFairDisjunctiveMono}
    For disjunctive systems:
    \begin{align*}
    &\forall n \geq 1:\\
    &(A,B)^{(1,n)} \models \pexists h(A,B_1)
    \ \Impl \
    (A,B)^{(1,n+1)} \models \pexists h(A,B_1).
    \end{align*}
\end{lemma}
\begin{proof}
Given a run $x$ of $(A,B)^{(1,n)}$,
we construct a run $y$ of $(A,B)^{(1,n+1)}$:
copy $x$ into $y$ and keep the additional process in the initial state.
\end{proof}

As for the bounding lemma, we construct an infinite run $y$ of $\cutoffsys$
with $y \models h(A,B^{(1)})$,
based on an infinite run $x$ of $\largesys$ with $n>c$ and $x \models h(A,B^{(1)})$.
The idea is to copy local runs $x(A)$ and $x(B_1)$ into $y$,
and construct runs of other processes in a way
that enables all transitions along $x(A)$ and $x(B_1)$.
The latter is achieved with the flooding construction.

\myparagraph{Flooding construction \cite{Emerson00}}
Given a run $x = (s_1,e_1,p_1), (s_2,e_2,p_2) \ldots$ of $\largesys$, let
$\visited_\mB(x)$ be the set of all local states visited by $B$-processes in $x$,
i.e., $\visited_\mB(x) = \{ q \in Q_B \| \exists m \exists i.\ s_m(B_i) = q \}$.

For every $q \in \visited_\mB(x)$ there is a local run of \largesys, say $x(B_i)$,
that visits $q$ first, say at moment $m_q$. Then, saying that process
$B_{i_q}$ of \cutoffsys \emph{floods $q$} means:
$$y(B_{i_q}) = x(B_i)\slice{1}{m_q}(q)^\omega.$$
In words: the run $y(B_{i_q})$ is the same as $x(B_i)$ until moment $\time_q$,
and after that the process never moves.

The construction achieves the following.
If we copy local runs of $A$ and $B_1$ from $x$ to $y$,
and in $y$ for every $q \in \visited_\mB(x)$ introduce one process that floods $q$,
then:
if in $x$ at some moment $\time$ there is a process in state $q'$,
then in $y$ at moment $\time$ there will also be a process (different from
$A$ and $B_1$) in state $q'$. Thus, every transition of $A$
 and $B_1$, which is enabled at moment $\time$ in $x$, will also be enabled in $y$.

\begin{lemma}[Bounding: Disj, \LTLmX, Unfair] \label{disj:le:NonFairDisjunctiveBounding}
    For disjunctive systems:
    \begin{align*}
    \forall n \geq |B|+2:\
    (A,B)^{(1,|B|+2)} \models \pexists h(A,B_1)
    \ \ \Implied \ \
    \largesys \models \pexists h(A,B_1).
    \end{align*}
\end{lemma}

The proof of the lemma is from \cite[Lemma 4.1.2]{Emerson00}.
We recapitulate it to introduce the notions of ``a process floods a state'',
\destutter, \interleave, and ``process mimics another process'',
which are used in our proofs later.

\begin{proof}[Proof idea]
The lemma is proved by copying local runs $x(A)$ and $x(B_1)$,
and flooding all states in $\visited_\mB(x)$.
To ensure that at least one process moves infinitely often
in $y$, we copy one additional (infinite) local run from $x$. Finally, it may
happen that the resulting collection of local runs violates the interleaving
semantics requirement. To resolve this, we add stuttering steps into local
runs whenever two or more processes move at the same time, and we
remove global stuttering steps in $y$. Since the only difference between
$x(A,B_1)$ and $y(A,B_1)$ are stuttering steps, $y$ and $x$ satisfy the same $
\LTLmX$-properties $h(A,B^{(1)})$.
Since $\card{\visited_\mB(x)} \leq
\card{B}$, we need at most $1+\card{B}+1$ copies of $B$ in \cutoffsys.
\end{proof}

\begin{proof}
Let $c = |B|+2$ and $n \geq c$. Let $x=(s_1,e_1,p_1), (s_2,e_2,p_2) \ldots$ be a run of $\largesys$ that satisfies $\pexists h(A,B_1)$. We construct a run $y$ of the cutoff system $\cutoffsys$ with $y(A, B_1) \simeq x(A, B_1)$.

Let $\visited(x)$ be the set of all visited states by B-processes in run $x$: $\visited(x) = \{ q \| \exists m \exists i: s_m(B_i) = q \}$.

Construct the run $y$ of \cutoffsys as follows.
\li
  \-[a.] We copy runs of $A$ and $B_1$ from $x$ to $y$:
         $y(A)=x(A)$, $y(B_1)=x(B_1)$;

  \-[b.] Since $x$ is infinite, it has at least one infinitely moving process, denoted $B_\infty$. Devote one unique process $B_\infty$ in \cutoffsys that copies the behaviour of $B_\infty$ of \largesys: $y(B_\infty)=x(B_\infty)$.

  \-[c.] For every $q \in \visited$, there is a process of \largesys, denoted $B_i$, that visits $q$ first, at moment denoted $m_q$. Then devote one unique process in \cutoffsys, denoted $B_{i_q}$, that \emph{floods $q$}: set $y(B_{i_q}) = x(B_i)\slice{1}{m_q}(q)^\omega$. In words: the run $y(B_{i_q})$ repeats exactly that of $x(B_i)$ till moment $m_q$, after which the process is never scheduled.

  \-[d.] Let any other process $B_i$ of \cutoffsys not used in the previous steps (if any) \emph{mimic} the behavior of $B_1$ of \cutoffsys: $y(B_i) = y(B_1)$.
\il
The figure illustrates the construction.\ak{\init should be flooded}
On the left is $\largesys$ and on the right is $(A,B)^{(1,|B|+2)}$
(i.e., $(A,B)^{(1,5)}$, since $|B|=3$ in the figure).

\begin{figure}[hp]
\centering
\scalebox{0.7}{
\input{guarded-systems/img/disj_flooding_construction}
}
\end{figure}

The correctness follows from the observation that any transition of any process at any moment $m$ of $y$ was done by some process in $x$ at moment $m$, and hence is enabled at $m$. Also note that, if $\geq 2$ processes transit simultaneously in $y$, then the guards of their transitions will be enabled even if both of them are removed from the state space\ak{vague}. Note that it is possible that in $y$:
\li
  \- more than one process transits at the same moment. Then, \emph{\interleave} the transitions of such processes, namely arbitrarily sequentialize them. \ak{why are enabled}
  \- at some moment no processes move. Then remove elements of the run $y$ -- the resulting run is denoted $\destutter(y)$.
\il
This construction uses $|\visited| + 2 \leq |B|+2$ copies of B (ignoring case (d)).
\end{proof}

\begin{tightness}[Disj, \LTLmX, Unfair] \label{obs:disj:tight_prop}
    The cutoff in Lemma~\ref{disj:le:NonFairDisjunctiveBounding} is tight.
    I.e., for any $k$ there exist process templates $(A,B)$ with $|B| = k$
    and $\LTLmX$ formula $h(A,B_1)$ such that:
    $$
    (A,B)^{(1,|B|+2)} \models \pexists h(A,B_1) ~~and~~
    (A,B)^{(1,|B|+1)} \not\models \pexists h(A,B_1).
    $$
\end{tightness}
\begin{proof}
The idea of the proof relies on the subtleties of the definition of a run: it is infinite (thus not globally deadlocked), and in each step of a run exactly one process moves.

Consider the templates from Figure~\ref{fig:obs:disj:tight_prop} and let $\pexists h(A,B_1) = \pexists (\eventually 3_{B_1} \land \eventually\always (2_{B_1} \land {end}_A))$. In words: there exists a run in a system where process $B_1$ visits $3_B$ and process $B_1$ with $A$ eventually always stay in $2_B$ and ${end}_A$.
\begin{figure}[tb]
\centering
\begin{subfigure}[b]{0.35\textwidth}\center
\scalebox{0.66}{\input{guarded-systems/img/disj_tight_propAB_tmplA}}
\caption*{Template A}
\end{subfigure}
\begin{subfigure}[b]{0.62\textwidth}\center
\scalebox{0.66}{\input{guarded-systems/img/disj_tight_propAB_tmplB}}
\caption*{Template B}
\end{subfigure}
\caption{Templates for proving Tightness~\ref{obs:disj:tight_prop}}
\label{fig:obs:disj:tight_prop}
\end{figure}

We need one process in every state of $B$ to enable the transitions of $A$ to ${all}_A$. Only when $A$ in ${all}_A$, $B_1$ can move $3_B \to 1_B$, and then at some point to $2_B$. After $B_1$ moves $3_B \to 1_B$, $A$ moves ${all}_A \to {end}_A$, which requires process $B_{i \neq 1}$ in $3_B$. Finally, to make the run infinite, there should be at least two processes in the state $k_B$.
Hence, every infinite run satisfying the formula needs at least $|B|+2$ $B$-processes.
\sj{other cases are covered in general lemma below}
%
\end{proof}

\subsection{\LTLmX\ Properties with Fairness: New Constructions} \label{gua:sec:ideas-disj-fair}

As for the case without fairness, proving the monotonicity lemma is simple.

\begin{lemma}[Monotonicity: Disj, \LTLmX, Fair] \label{disj:le:FairDisjunctiveMonotonicity}
For disjunctive systems:
\begin{align*}
& \forall n \geq 1: \\
&(A,B)^{(1, n)} \models \pexists_{uncond} h(A,B_1)
\implies
(A,B)^{(1,n+1)} \models \pexists_{uncond} h(A,B_1),\\
\end{align*}
\end{lemma}
\begin{proof}
In run $x$ of $(A,B)^{(1,n)}$ with $n \geq 1$ all processes move infinitely often.
Hence let the run $y$ of $(A,B)^{(1,n+1)}$ copy $x$,
and let the new process mimic an infinitely moving B process of $(A,B)^{(1,n)}$.
\end{proof}

To prove the bounding lemma, we introduce two new constructions.
We need new constructions, because the flooding construction does not preserve fairness,
and also cannot be used to construct deadlocked runs,
since it does not preserve disabledness of transitions of processes $A$ or $B_1$.

Consider the proof task of the bounding lemma for disjunctive systems with fairness:
given an unconditionally fair run $x$ of
\largesys with
$x \models h(A,B^{(1)})$, we want to construct an unconditionally fair run $y$
of \cutoffsys with $y \models h(A,B^{(1)})$. In contrast to unfair systems, we
need to ensure that all processes move infinitely often in $y$.
The insight is
that after a finite time all processes will start looping
around some set $\visited^\inf$ of states. We construct a run $y$ that
mimics this. To this end, we introduce two constructions. \emph{Flooding with
evacuation} is similar to flooding, but instead of keeping
processes in their flooding states forever it evacuates the processes into
$\visited^\inf$. \emph{Fair extension} lets all processes move infinitely
often without leaving $\visited^\inf$.

\myparagraph{Flooding with evacuation}
Given a subset $\mF \subseteq \mB$
%\footnote{In this section we will use only $\mP_1 = \{B_1\}$,
%          but for the case of deadlocks we will need a set.
%          $\mP_1$ is a set of processes whose local runs we will copy
%          from $x$ to $y$ later in the proof.}
and an infinite run $x=(s_1,e_1,p_1)\ldots$ of \largesys,
define
\begin{align}
& \visInf{\mF}{x} = \{ q \|\! \exists \text{ infinitely many } ~~~~ m\!:
s_m(B_i) = q
\text{ for some } B_i \in \mF \} \label{disj:def_vinf_wrt} \\
& \visFin{\mF}{x} = \{ q \|\! \exists \text{ only finitely many } m\!:
s_m(B_i) = q
\text{ for some } B_i\in \mF \} \label{disj:def_vfin_wrt}
\end{align}
%
Let $q \in \visFin{\mF}{x}$.
In run $x$ there is a moment $f_q$ when $q$
is reached for the first time by some process from $\mF$, denoted $B_{\first_q}$.
Also, in run $x$ there is a moment $l_q$ such that:
$s_{l_q}(B_{\last_q})=q$ for some process $B_{\last_q} \in \mF$,
and $s_t(B_i)\neq q$ for all $B_i \in \mF$,
$t > l_q$%
---i.e., when some process from $\mF$ is in state $q$ for the last time in $x$.
Then, saying that process $B_{i_q}$ of \cutoffsys\
{\em floods $q \in \visFin{\mF}{x}$ and then evacuates into $\visInf{\mF}{x}$}
means:
$$
y(B_{i_q}) = x(B_{\first_q})\slice{1}{f_q} \ \cdot\ (q)^{(l_q - f_q + 1)} \cdot \
x(B_{\last_q})\slice{l_q}{m} \ \cdot \ (q')^\omega,
$$
where $q'$ is the state in $\visInf{\mF}{x}$ that $x(B_{\last_q})$ reaches first,
at some moment $\time \geq l_q$.
In words, process $B_{i_q}$ mimics process $B_{\first_q}$ until it reaches $q$,
then does nothing until process $B_{\last_q}$ starts leaving $q$,
then it mimics $B_{\last_q}$ until it reaches $\visInf{\mF}{x}$.

The construction ensures:
if we copy local runs of all processes not in $\mF$ from $x$ to $y$,
then all transitions of $y$ are enabled.
This is because, for any process $p$ of $\cutoffsys$ that takes a transition in $y$ at any moment,
the set of states visible to process $p$ is a superset of the set of states
visible to the original process in \largesys whose transitions process $p$ copies.

\myparagraph{Fair extension}
\ak{explain intuition about those three sets}
\ak{adapt to dead}
Here, we consider a path $x$ that is the postfix of an unconditionally fair run $x'$ of $\largesys$,
starting from the moment where no local states from $\visFin{\mB}{x'}$ are visited anymore.
We construct a corresponding unconditionally-fair path $y$ of $\cutoffsys$,
where no local states from $\visFin{\mB}{x'}$ are visited.

Formally, let $n \geq 2|B|$, and $x$ an unconditionally-fair path of $\largesys$ such that
$\visFin{\mB}{x}=\emptyset$.
Let $c \geq 2|B|$, and $s_1'$ a state of \cutoffsys
with
\li
\- $s_1'(A_1)=s_1(A_1)$, $s_1'(B_1)=s_1(B_1)$;

\- for every $q \in \visInf{B_2..B_n}{x} \smi \visInf{B_1}{x}$,
   there are two processes $B_{i_q}, B_{i_q'}$ of \cutoffsys
   that start in $q$, i.e., $s_1'(B_{i_q})=s_1'(B_{i_q'})=q$;

\- for every $q \in \visInf{B_2..B_n}{x} \cap \visInf{B_1}{x}$,
   there is one process $B_{i_q}$ of \cutoffsys
   that starts in $q$;

\- for some $\qstar \in \visInf{B_2..B_n}{x} \cap \visInf{B_1}{x}$,
   there is one additional process of \cutoffsys,
   different from any in the above,
   called $B_{i_\qstar'}$,
   that starts in $\qstar$;
   and

\- any other process $B_i$ of \cutoffsys
   starts in some state of $\visInf{B_2..B_n}{x}$.
\il
Note that, if $\visInf{B_2..B_n}{x}\cap \visInf{B_1}{x} = \emptyset$,
then the third and fourth pre-requisite are trivially satisfied.

The fair extension extends state $s_1'$ of \cutoffsys
to an unconditionally-fair path $y=(s'_1,e'_1,p'_1)\ldots$
with $y(A_1,B_1) = x(A_1,B_1)$ as follows.
\li
\-[(a)] $y(A_1)=x(A_1)$, $y(B_1)=x(B_1)$.

\-[(b)] For every $q \in \visInf{B_2..B_n}{x} \smi \visInf{B_1}{x}$:
       in run $x$ there is $B_i \in \{B_2..B_n\}$
       that starts in $q$ and visits it infinitely often.
       Let $B_{i_q}$ and $B_{i'_q}$ of \cutoffsys mimic $B_i$ in turns:
       first $B_{i_q}$ mimics $B_i$ until it reaches $q$,
       then $B_{i'_q}$ mimics $B_i$ until it reaches $q$, and so on.

\-[(c)] Arrange the states of $\visInf{B_2..B_n}{x}\cap \visInf{B_1}{x}$
       in some order $(\qstar, q_1, \ldots, q_l)$.
       The processes $B_{i_\qstar'}, B_{i_\qstar}, B_{i_{q_1}}, \ldots, B_{i_{q_l}}$
       behave as follows.
       Start with $B_{i_\qstar'}$:
       when $B_1$ enters $\qstar$ in $y$, it carries%
       \footnote{``Process $B_1$ starting at moment $m$ carries process $B_i$
                 from $q$ to $q'$'' means: process $B_i$ mimics
                 the transitions of $B_1$ starting at moment $m$ at $q$
                 until $B_1$ first reaches $q'$.}
       $B_{i_\qstar'}$             from $\qstar$ to $q_1$,
       then carries $B_{i_{q_1}}$ from $q_1$ to $q_2$, \ldots,
       then carries $B_{i_{q_l}}$ from $q_l$ to $\qstar$,
       then carries $B_{i_\qstar}$ from $\qstar$ to $q_1$,
       then carries $B_{i_\qstar'}$ from $q_1$ to $q_2$,
       then carries $B_{i_{q_1}}$ from $q_2$ to $q_3$,
       and so on.

%\-[c2.] otherwise, $\visited_{\inf\cap B_1}{x} = \{ q^\star \}$. Then $B_1$ only ever makes transitions $q^\star \to q^\star$, thus let process $B_{i_{q^\star}}$ mimic this.

\-[(d)] Any other $B_i$ of \cutoffsys,
       starting in $q \in \visInf{B_2..B_n}{x}$,
       mimics $B_{i_q}$.
\il
Note that parts (b) and (c) of the construction ensure that there is always at
       least one process in every state from $\visInf{B_2..B_n}{x}$. This
       ensures that the guards of all transitions of the construction are satisfied.
Excluding processes in (d), the fair extension uses up to $2|B|$ copies of $B$.%
\footnote{A careful reader may notice that,
          if
          $|\visInf{B_1}{x}|=1$ and $|\visInf{B_2..B_n}{x}|=|B|$,
          then the construction uses $2|B|+1$ copies of $B$.
          But one can slightly modify the construction for this special case,
          and remove process $B_{i_\qstar'}$ from the pre-requisites.}
%\li
%\- if $\visInf{B_2..B_n}{x} \cap \visInf{B_1}{x} = \emptyset$, then
%     $$\leq 1+2|\visInf{B_2..B_n}{x}| \leq 1+2(|B|-1) = 2|B|-1$$
%   (note that $\visInf{B_1}{x}$ contains at least one state)
%
%\- otherwise:\\
%   let $smi = \visInf{B_2..B_n}{x} \smi \visInf{B_1}{x}$, \\
%   let $inter = \visInf{B_2..B_n}{x} \cap \visInf{B_1}{x}$, \\
%   then
%   $$\leq 1+2|smi| + |inter| + 1 \leq 1+2(|B|-1) + 1 + 1 = 2|B|+1$$
%   $$\leq 1+2|smi| + |inter| + 1 \leq 1+2(|B|-2) + 2 + 1 = 2|B|+1$$
%\il
%
%
%%%%%%%%%%%%% OLD FAIR EXTENSION %%%%%%%%%%%%%%%%%%%%%%
%Let $x=(s_1,e_1,p_1)\ldots$ be an unconditionally-fair path $x$ of $\largesys$, let $\visited_\fin{x}$ and $\visited_\inf{x}$ be defined wrt. no processes, let $n\geq 2|\visited_\inf{x}|$, and let $x$ satisfy:
%\li
%  \- every $B_i\neq B_1$ visits $s_1(B_i)$ infinitely often
%  \- $\visited_\fin{x} = \emptyset$,
%\il
%and let $s_1'$ be a state of \cutoffsys with $c \geq 2|\visited_\inf{x}|$ that satisfies:
%\li
%  \- $s_1'(A)=s_1(A)$, $s_1'(B_1)=s_1(B_1)$
%  \- for every $q \in \visited_\inf{x}$ there are two processes of \cutoffsys called $B_{i_q}$, $B_{i'_q}$ with $s_1'(B_{i_q}) = s_1'(B_{i'_q}) = q$
%  \- for all other processes $B_i$ of \cutoffsys (if any): $s_1'(B_i) \in \visited_\inf{x}$.
%\il
%The fair extension extends state $s_1'$ of \cutoffsys to an unconditionally-fair path $y=(s'_1,e'_1,p'_1)\ldots$ with $x(A,B_1) = y(A,B_1)$ as follows. Let $\visited_{\inf\cap B_1}{x}$ be the set of states visited infinitely often by process $B_1$, and $q^\star=s_1(B_1)$:
%\li
%\-[a.] $y(A)=x(A)$, $y(B_1)=x(B_1)$
%\-[b.] for every $q \in \visited_\inf{x} \smi \visited_{\inf\cap B_1}{x}$: in run $x$ there is $B_i$ that starts in $q$ and visits it infinitely often. Let $B_{i_q}$ and $B_{i'_q}$ of \cutoffsys mimic $B_i$ in turns: first $B_{i_q}$ mimics $B_i$ until it reaches $q$, then $B_{i'_q}$ mimics $B_i$ until it reaches $q$,\dots
%\-[c1.] if $\visited_{\inf\cap B_1}\smi \{ q^\star \} \neq \emptyset$:
%\li
%  \- order arbitrarily $\visited_{\inf\cap B_1}\smi \{ q^\star \} = (q_1, q_2, \ldots, q_k)$
%  \- the processes $\{ B_{i_{q^\star}}, B_{i_{q_1}}, B_{i'_{q_1}}, B_{i_{q_2}}, B_{i'_{q_2}}, \ldots, B_{i_{q_k}}, B_{i'_{q_k}} \}$ behave as follows:
%  \- start with $B_{i_{q_1}}$: when $B_1$ enters $q_1$, it carries $B_{i_{q_1}}$ from $q_1$ to $q_2$, then carries $B_{i_{q_2}}$ from $q_2$ to $q_3$, \ldots, then carries $B_{i_{q_k}}$ from $q_k$ to $q^\star$, then carries $B_{i_{q^\star}}$ from $q^\star$ to $q_1$, then carries $B_{i'_{q_1}}$ from $q_1$ to $q_2$, and so on.
%\il
%\-[c2.] otherwise, $\visited_{\inf\cap B_1} \!=\! \{ q^\star \}$: $B_1$ only transits $q^\star \!\to\! q^\star$; let $B_{i_{q^\star}}$ mimic $B_1$
%
%\-[d.] let other processes $B_i$ of \cutoffsys with $s_1'(B_i)=q$ (if any) mimic $B_{i_q}$.
%\il
%%%%%%%%%%%%% END OF OLD FAIR EXTENSION %%%%%%%%%%%%%%%%%%%%%%

%\begin{proof}[Proof idea of the bounding lemma]

Now we are ready to prove the bounding lemma.

\begin{lemma}[Bounding: Disj, \LTLmX, Fair] \label{disj:le:FairDisjunctiveBounding}
For disjunctive systems:
\begin{align*}
&\forall n>2|B|: \\
&(A,B)^{(1,2|B|)} \models \pexists_{uncond} h(A,B_1) &
&\impliedby& &
(A,B)^{(1,n)} \models \pexists_{uncond} h(A,B_1),\\
\end{align*}
%
\end{lemma}
\begin{proof}
\sj{for weak or strong fairness, the same construction can be used; evacuation is not necessary, but also doesn't increase the cutoff if we use it; difficulty: show that cutoff is still tight
}
Let $c=2\card{B}$.
Given an unconditionally-fair run $x$ of $\largesys$,
we construct an unconditionally-fair run $y$ of the cutoff system $\cutoffsys$
such that $y(A,B_1)$ is stuttering equivalent to $x(A,B_1)$.

Note that in $x$ there is a moment $m$ such that all local states that are visited after $m$ are in $\visInf{\mB}{x}$.

The construction has two phases. In the first phase, we apply flooding for states in $\visInf{\mB}{x}$, and flooding with evacuation for states in $\visFin{\mB}{x}$:
\li
\-[(a)] $y(A)=x(A)$, $y(B_1)=x(B_1)$;

\-[(b)] for every $q \in \visInf{B_2..B_n}{x} \smi \visInf{B_1}{x}$,
       devote two processes of $\cutoffsys$ that flood $q$;

\-[(c)] for some $\qstar \in \visInf{B_2..B_n}{x} \cap \visInf{B_1}{x}$,
       devote one process of \cutoffsys that floods $\qstar$;

\-[(d)] for every $q \in \visFin{B_2..B_n}{x}$,
       devote one process of $\cutoffsys$ that
       floods $q$ and evacuates into $\visInf{B_2..B_n}{x}$;
       and

\-[(e)] let other processes (if any) mimic process $B_1$.
\il
The phase ensures that at moment $m$ in $y$,
there are no processes in $\visFin{\mB}{x}$,
and all the pre-requisites of the fair extension are satisfied.

The second phase applies the fair extension,
and then establishes the interleaving semantics
as in the bounding lemma in the non-fair case.
The overall construction uses up to $2|B|$ copies of $B$.
% Indeed:
% fin&smi=0, fin&cap=0,
% smi = InfB2..Bn - cap
% InfB2..Bn <= B - fin
% Then:
% 1+2smi+1cap+1+fin <= 1+2(InfB2..Bn-cap)+cap+1+fin =
%                      2+2InfB2..Bn-cap-fin <=
%                      2+2B-cap-fin
% now split case:
% everywhere fin>0 (otherwise 2|B| follows from the analysis of the fair extension)
% note: if cap=0, then we actually have (recall fair pre)
%       1+2smi+fin =< 1+2(B-InfB1-fin)+fin = 1+2B-2InfB1-2fin =< 2B-3
% thus cap>0,fin>0
% then 2+2B-cap-fin =< 2B
\end{proof}

\begin{tightness}[Disj, \LTLmX, Fair] \label{obs:disj:fair_tight_prop}
The cutoff in Lemma~\ref{disj:le:FairDisjunctiveBounding} is tight.
I.e.,
for any $k$ there exist process templates $(A,B)$ with $|B| = k$
and $\LTLmX$ formula $h(A,B_1)$ such that:
$$
(A,B)^{(1,2|B|)} \models \pexists h(A,B_1) ~~and~~
(A,B)^{(1,2|B|-1)} \not\models \pexists h(A,B_1).
$$
\ak{what happens if we bound $T_A$?}
\end{tightness}
\begin{proof}
Consider process templates $A,B$ from Figure~\ref{fig:obs:disj:fair_tight_prop}
and the property $\pexists \true$.
%
\begin{figure}[tb]
\centering
\begin{subfigure}[b]{0.35\textwidth}\center
\scalebox{0.75}{\input{guarded-systems/img/disj_fair_tight_propAB_tmplA}}
\caption*{Template A}
\end{subfigure}
\hspace{1cm}
\begin{subfigure}[b]{0.55\textwidth}\center
\scalebox{0.75}{\input{guarded-systems/img/disj_fair_tight_propAB_tmplB}}
\caption*{Template B}
\end{subfigure}
\caption{Templates for proving Tightness~\ref{obs:disj:fair_tight_prop}}
\label{fig:obs:disj:fair_tight_prop}
\end{figure}
%
\end{proof}

\subsection{Deadlocks without Fairness: Updated Constructions} \label{gua:sec:proofs-disj-deadlock-unfair}

%The lemma for deadlock detection, for fair and unfair cases,
%is proven for $n \geq |B|+1$.
%In the case of local deadlocks,
%process $B_{n+1}$ mimics a process that moves infinitely often in $x$.
%In the case of global deadlocks,
%by pigeon hole principle,
%in the global deadlock state there is a state $q$ with at least two processes in it---let process $B_{n+1}$ mimic a process that deadlocks in $q$.

\begin{lemma}[Monotonicity: Disj, Deadlocks, Unfair]
\label{mono_lem_disj_deadlocks_unfair}
    For disjunctive systems:
    $$\forall n\geq |B|+1: (A,B)^{(1,n)} \textit{ has a deadlock} \
    \Impl\
    (A,B)^{(1,n+1)} \textit{ has a deadlock.}$$
\end{lemma}
\begin{proof}
Given a deadlocked run $x$ of $(A,B)^{(1,n)}$,
we build a deadlocked run of $(A,B)^{(1,n+1)}$.
If the run $x$ is locally deadlocked,
then it has at least one infinitely moving process,
thus let the additional process mimic that process.
If the run $x$ is globally deadlocked run,
then due to $n>|B|$ in some state there are at least two processes deadlocked.
Thus, let the new process mimic a process deadlocked in that state---%
the run constructed will also be globally deadlocked.
\end{proof}

\begin{lemma}[Bounding: Disj, Deadlocks, Unfair] \label{lem_disj_deadlocks_unfair}
For disjunctive systems:
\li
  \- with $c=|B|+2$ and any $n>c$:
  $$(A,B)^{(1,c)} \textit{ has a local deadlock} \ \Implied\ (A,B)^{(1,n)} \textit{ has a local deadlock;}$$

  \- with $c=2|B| - 1$ and any $n>c$
  $$(A,B)^{(1,c)} \textit{ has a global deadlock} \ \Implied\ (A,B)^{(1,n)} \textit{ has a global deadlock;} $$

  \- with $c=2|B|-1$ and any $n>c$:
  $$(A,B)^{(1,c)} \textit{ has a deadlock} \ \Implied\ (A,B)^{(1,n)} \textit{ has a deadlock.}$$
\il
\ak{seems not tight}
\end{lemma}
\begin{proof}[Proof idea]
First, consider the case of global deadlocks.
The insight is to divide deadlocked local states into two disjoint sets,
$\dead_1$ and $\dead_2$, as follows.
Given a globally deadlocked run $x$ of \largesys,
for every $q \in \dead_1$,
there is a process of \largesys deadlocked in $q$ with input $i$,
that has an outgoing transition guarded ``$\exists q$''%
---hence, adding one more process into $q$ would unlock the process.
%\sj{do we always consider inputs correctly? what if $q \in \dead_1$ for some $e$, but $q \in \dead_2$ for $e'$?}\ak{thanks, modified, now it is impossible}
In contrast, $q \in \dead_2$ if any process deadlocked in $q$
stays deadlocked after adding more processes into $q$.
Let us denote the set of $B$-processes deadlocked in $\dead_1$ by $\mD_1$.
Finally, abuse the definition in Eq.~\ref{disj:def_vfin_wrt}
and denote by $\visFin{\mB\smi\mD_1}{x}$ the set of states
that are visited by $B$-processes not in $\mD_1$ before reaching a deadlocked state.

Given a globally deadlocked run $x$ of \largesys with $n\geq 2|B|-1$,
we construct a globally deadlocked run $y$ of \cutoffsys with $c = 2|B|-1$ as follows.
\li
\- We copy from $x$ into $y$ the local runs of processes in $\mD_1 \cup \{A\}$;
\- flood every state of $\dead_2$;
   and
\- for every $q \in \visFin{\mB\smi\mD_1}{x}$,
   flood $q$ and evacuate into $\dead_2$.
\il
The construction ensures:
(1) for any moment and any process in $y$,
    the set of local states that are visible to the process includes all the states that were visible
    to the corresponding process in \largesys whose transitions we copy;
(2) in $y$, there is a moment when all processes deadlock in $\dead_1 \cup \dead_2$.

For the case of local deadlocks,
the construction is slightly more involved,
since we also need to copy the behaviour of an infinitely moving process.
\end{proof}

\begin{proof}
Given a (globally or locally) deadlocked run of $\largesys$,
we construct (globally or locally) deadlocked run of $\cutoffsys$,
where $c$ depends on the nature of the given run.
We do this using the construction template.

Let $\mB=\{B_1,...,B_n\}$.
The template depends on the set $\mC \subseteq \{B_1,...,B_c\}$
and is as follows.
\li
  \-[a.] Set $y(A)=x(A)$;
  \-[b.] for every $B_i \in \mC$, set $y(B_i)=x(B_i)$;
  \-[c.] for every $q \in \visInf{\mB\smi\mC}{x}$,
         devote one process of \cutoffsys that floods $q$;
  \-[d.] for every $q \in \visFin{\mB\smi\mC}{x}$,
         devote one process of \cutoffsys that floods $q$
         and then evacuates into $\visInf{\mB\smi\mC}{x}$;
         and
  \-[e.] let other processes (if any) mimic some process from (c).
\il

\myparagraph{1) Local deadlock}
We distinguish three cases:
\li
  \-[1a)] $A$ deadlocks, $B_1$ moves infinitely often;
  \-[1b)] $A$ moves infinitely often, $B_1$ deadlocks; and
  \-[1c)] $A$ neither deadlocks nor moves infinitely often,
          $B_1$ deadlocks, $B_2$ moves infinitely often.
\il

\myparagraphraw{1a:} ``$A$ deadlocks, $B_1$ moves infinitely often''.

Let $c=|B|+1$, and $\mC=\{B_1\}$.
Note that $\visInf{B_2..B_n}{x} \neq \emptyset$.
The resulting construction uses
$|\visFin{B_2..B_n}{x}| + |\visInf{B_2..B_n}{x}| + 1
 \leq
 |B| + 1$
copies of B.
\ak{seems tight}\ak{correctness}

\myparagraphraw{1b:} ``$A$ moves infinitely often, $B_1$ deadlocks''.

Let $c=|B|+1$, and $\mC=\{B_1\}$.
Let $q_\bot$ be the state in which $B_1$ deadlocks.
Instantiate the construction template.

Process $B_1$ of \cutoffsys is deadlocked in $y$ starting from some moment $d$,
because any state it sees (in $\visInf{A,B_2..B_n}{x}$)
was also seen by $B_1$ in \largesys in $x$ at some moment $d' \geq d$
(note that $d'$ may be not the same moment as $d$).
%\footnote{Note about open systems: here we use the fact from the definitions
%          that inputs to $B_1$ do not change.
%          This ensures that the set of states that $B_1$ should not see in order
%          to stay deadlocked does not change over time.}

\myparagraphraw{1c:} ``$A$ neither deadlocks nor moves infinitely often,
                       $B_1$ deadlocks, $B_2$ moves infinitely often''.

Instantiate the construction template with $c=|B|+2$ and $\mC = \{B_1,B_2\}$.
\ak{seems not tight}\ak{correctness}

\smallskip
Finally, $|B|+2$ is a (possibly not tight) cutoff for local deadlock detection problem.

\myparagraph{2) Global deadlock}
Let $x=(s_1,e_1,p_1)...(s_d,e_d,\bot)$ be a globally deadlocked run of $\largesys$
with $n\geq c$.

Let us abuse the definition of $\visInf{\mF}{x}$ and $\visFin{\mF}{x}$,
in Eq.~\ref{disj:def_vinf_wrt} and \ref{disj:def_vfin_wrt} resp.,
and adapt it to the case of finite runs.
To this end, given a finite run $x=(s_1,e_1,p_1)...(s_d,e_d,\bot)$,
extend it to the infinite sequence $(s_1,e_1,p_1)...(s_d,e_d,\bot)^\omega$,
and apply the definition of $\visInf{\mF}{x}$ and $\visFin{\mF}{x}$ to the sequence.

Let $\mD_1$ be the set of processes deadlocked in unique states:
$\forall p\in \mD_1 \nexists p' \neq p: s_d(p')=s_d(p)$.
Instantiate the construction template with $\mC = \mD_1$ and $c=2|B|-1$.
\footnote{$2|B|-1$ copies is enough, because:
          $\visFin{\mB\smi\mC}{x} \cap \visInf{\mB\smi\mC}{x} = \emptyset$,
          $\visInf{\mB\smi\mC}{x} \cap \visInf{\mC}{x} = \emptyset$,
          and if $\visFin{\mB\smi\mC}{x} \neq \emptyset$,
          then $\visInf{\mB\smi\mC}{x} \neq \emptyset$.}
\ak{seems not tight}

%The construction uses $|dead1| + |dead2| + |\visited_{\fin-P_\bot^1}(x)| \leq 2|B|-1$ copies of B.\ak{seems not tight}\ak{CHECK}\ak{correctness}

\myparagraph{3) Deadlocks}
As the cutoff for the deadlock detection problem we take the largest cutoff in (1)--(2), namely, $2|B|-1$,
but it may be not tight%
---finding the tight cutoffs for local deadlock and for deadlock detection problems is an open problem.

\ak{tried to refine but could not -- the trial is commented out}
% AK: try to utilize the existence of the order?
% Now let us refine the estimate:
% \li
% \- `unique finite state' is any state in $\visited_{\fin+P_1_\bot}$ that either is not in $ \visited_{\fin-P_1_\bot} $, or the state that appears not in $]f_q,l_q[_{-P_1_\bot}$
%
% \- intuitively, state is unique finite if we cannot make it `visible' by using the flooding and evacuating construction wrt. $ \visited_{\fin-P_1_\bot} $, $\visited_{\inf-P_1_\bot}$. Otherwise, if state is not unique finite then  we can flood the state and then evacuate into $ \visited_{\inf-P_1_\bot} $
%
% \- let $U^c \subseteq P_1_\bot$ be the set of processes that have unique finite states on its run to $q_\bot \in \visited_\bot^1$. Let $U^f = P_1_\bot\smi U^c$.
%
% \- note that for any $p \in U^f$ any its finite state can be flooded and then evacuated into $ \visited_{\inf-P_1_\bot} $ using local runs of $\mathcal{B}\smi P_1_\bot$ processes. Intuitively, this means that $U^f$ processes' finite states are not needed.
%
% \- let us divide $\visited_\bot^1$ into two disjiont sets: $\visited_\bot^c$ (and corr. processes are $U^c$) is the set of states whose deadlocked paths do have a unique finite state, and $\visited_\bot^f$ (and corr. processes are $U^f$) is the set of states whose deadlocked paths do not have a unique finite state.
% \il
%
% Define $ \visited_{\fin-U^c} $ and $ \visited_{\inf-U^c} $ wrt. $U^c$.
% Then the construction is:
% \li
%   \-[a.] $y(A)=x(A)$
%   \-[b.] copy the runs of $U^c$ processes (that end in $\visited_\bot^c$)
%   \-[c.] flood states in $ \visited_{\inf-U^c} $
%   \-[d.] for any $ q \in \visited_{\fin-U^c} $ devote one process that floods it and then evacuates into $ \visited_{\inf-U^c} \smi \visited_\bot^f$. Note that we can evacuate a state from $ \visited_{\fin-U^c} $ into $ \visited_{\inf-U^c} \smi \visited_\bot^f $, because processes $U^f$ do not contribute to the evacuation by definition.\ak{vague}
%   \-[e.] let other processes (if any) mimic a process from (c)
% \il
% The construction uses $|\visited_\bot^c| + | \visited_{\inf-U^c} | + | \visited_{\fin-U^c} |$. Note that:
% \li
%   \- $\visited_\bot^c$, $ \visited_{\inf-U^c} $ are disjoint
%   \- $\visited_{\inf-U^c}$, $\visited_{\fin-U^c}$ are disjoint
%   \- possibly $\visited_\bot^c \cap \visited_{\fin-U^c} \neq \emptyset$
% \il
% If some $p \in U^c$, then it has at least one unique finite state $q$: possibly $q \in  \visited_{\inf-U^c} $ or $q \in \visited_{\fin-U^c}$, but $q \not\in \visited_\bot^c$. \ak{stuck here -- it is possible that all $U^c$ processes share a single unique finite state}
\end{proof}

\begin{tightness}[Disj, Deadlocks, Unfair] \label{obs:disj:tight_deadlock}
The cutoff $c=2|B|-1$ for deadlock detection in disjunctive systems is \emph{asymptotically optimal but possibly not tight}.
I.e., for any $k$ there are templates $(A,B)$ with $|B|=k$ such that:
$$
(A,B)^{(1,|B|-1)} \textit{ does not have a deadlock, but } (A,B)^{(1,|B|)} \textit { does}.
$$
\end{tightness}
\begin{proof}
Figure~\ref{fig:obs:disj:tight_deadlock} illustrates templates $(A,B)$ to prove the asymptotic optimality of cutoff $2|B|-1$ for deadlock detection problem. Template $A$ is any that never deadlocks. The system has a local deadlock only when there are at least $|B|$ copies of $B$, which is a constant factor of $2|B|-1$.
\begin{figure}[tb] \centering
\makebox[0.4\textwidth][c]{
\scalebox{0.75}{\input{guarded-systems/img/disj_tight_deadlock_tmpl}}
}
\caption{Templates for proving Tightness~\ref{obs:disj:tight_deadlock}}
\label{fig:obs:disj:tight_deadlock}
\end{figure}
\end{proof}

%--- global deadlocks: fair and unfair:
%C: processes that dead1
%F: processes that dead2
%We copy local runs of dead1.
%We flood deadlocked states of dead2, and flood and evacuate non-deadlocked states of dead2.
%
%--- local deadlocks: unfair:
%I: processes that move infinitely often
%D: processes that dead
%copy local run of one process from I,
%copy one local run of process from C,
%flood and evacuate finitely visited states by processes except copied
%
%--- local deadlocks: fair:
%I: processes that move infinitely often
%C: processes that dead1
%F: processes that dead2
%Copy local runs of C,
%flood and evacuate finitely visited states of F\\C,
%flood dead or infinitely often visited states of F\\C.

\subsection{Deadlocks with Fairness: New Constructions} \label{gua:sec:proofs-disj-deadlock-fair}

\begin{lemma}[Monotonicity: Disj, Deadlocks, Fair] \label{mono_lem_disj_deadlocks_fair}
For disjunctive systems, on strong-fair or finite runs:
$$
\forall n\geq |B|+1: (A,B)^{(1,n)} \textit{ has a deadlock}
\ \Impl\
(A,B)^{(1,n+1)} \textit{ has a deadlock.}
$$
\end{lemma}
\begin{proof}
See proof of Lemma~\ref{mono_lem_disj_deadlocks_unfair}.
\end{proof}

\begin{lemma}[Bounding: Disj, Deadlocks, Fair] \label{le:disj:fair_tight_deadlock}
For disjunctive systems, on strong-fair or finite runs:
\li
  \- with $c=2|B|-1$ and any $n>c$:
  $$(A,B)^{(1,c)} \textit{ has a local deadlock} \ \Implied\ (A,B)^{(1,n)} \textit{ has a local deadlock;}$$

  \- with $c=2|B| - 1$ and any $n>c$
  $$(A,B)^{(1,c)} \textit{ has a global deadlock} \ \Implied\ (A,B)^{(1,n)} \textit{ has a global deadlock;} $$

  \- with $c=2|B|-1$ and any $n>c$:
  $$(A,B)^{(1,c)} \textit{ has a deadlock} \ \Implied\ (A,B)^{(1,n)} \textit{ has a deadlock.}$$
\il
\end{lemma}
The proofs are similar to that of Lemma~\ref{lem_disj_deadlocks_unfair} (the case without fairness):
the case of global deadlocks is exactly the same,
the case of local deadlocks differ---we additionally use the fair extension to ensure the resulting run is fair.
\begin{proof}

\providecommand{\deadOne}[1]{\dead_{<2}(#1)}
\providecommand{\deadTwo}[1]{\dead_2(#1)}

If $\largesys$ has a global deadlock,
then the fairness does not influence the cutoff,
and the proof from Lemma~\ref{lem_disj_deadlocks_unfair},
case ``Global Deadlocks'', applies and gives the cutoff $2|B|-1$.
Hence below consider only the case of local deadlocks.

Given a strong-fair deadlocked run $x$ of $\largesys$,
we first construct a strong-fair deadlocked run $y$ of $\cutoffsys$
with $c=2|B|$ and then argue that $c$ can be reduced to $2|B|-1$.
The construction is similar to that in Lemma~\ref{lem_disj_deadlocks_unfair}
-- the differences originate from the need to infinitely move
non deadlocked processes.

Let $\deadOne{x}$ be the set of deadlocked states in the run $x$
that are only deadlocked if there is no other process in the same state,
and let $\mD_1$ be the set of processes deadlocked
in the run $x$ in $\deadOne{x}$.
Let $\deadTwo{x}$ be the set of states that are deadlocked
in the run $x$ even if there is another process in the same state.

We note the following:
\li
\- $|\mD_1| = |\deadOne{x}| \leq |B|$;

\- $\deadOne{x} \cap \deadTwo{x} = \emptyset$;

\- $\visFin{\mB\smi \mD_1}{x} \cap \deadOne{x} \neq \emptyset$
   is possible, because a state from $\visFin{\mB\smi \mD_1}{x}$
   can first be visited by a process in $\mB \smi \mD_1$,
   and later be deadlocked because of the process in $\mD_1$;

\- $\deadTwo{x} \subseteq \visInf{\mB\smi \mD^1}{x}$,
   and hence $\visFin{\mB \smi \mD_1}{x} \cap \deadTwo{x} = \emptyset$.
\il

The construction has two phases.
The first phase is as follows.
\li
\-[a.] For every $p \in \{A\} \cup \mD_1$, set $y(p)=x(p)$;

\-[b.] for every $q \in \deadTwo{x}$,
       devote one process of $\cutoffsys$ that floods it;

\-[c.] for every $q \in \visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x}$,
       devote two processes of $\cutoffsys$ that flood it;

\-[d.] for every $q \in \visFin{\mB \smi \mD_1}{x}$,
       devote one process of $\cutoffsys$ that floods it
       and then evacuates into $\visInf{\mB \smi \mD_1}{x}$;
       and

\-[e.] let other processes (if any) mimic some process from (c).
\il
After this phase all $B$ processes will be in
$\visInf{\mB \smi \mD_1}{x} \cup \deadOne{x}$.

The second phase applies to processes in
$\visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x}$ the fair extension%
\footnote{The fair extension requires the run $x$ to be unconditionally-fair,
          but here we have a run in which all processes that are not deadlocked
          move infinitely often.
          To adapt the construction to this case:
          copy local runs of processes $\{A\} \cup \mD_1$,
          and do not extend local runs of processes that are in a
          state in $\dead_2$.}.

% The resulting configuration sequence is a run of $\cutoffsys$ by correctness of the flooding, evacuation, fair extension, interleaving and destuttering constructions\ak{prove}. Furthermore, for every $q \in \deadOne$ we have exactly one process in $\cutoffsys$ that eventually stays in $q$, and for every $q \in \deadTwo$ -- at least one such process; they are eventually deadlocked in $q$ because the states that appear infinitely often in the run $x$ of $\cutoffsys$ are the same as in the resulting run of $\largesys$.

How many processes does the construction use?
Note that the sets
$\deadOne{x} \cup \visFin{\mB \smi \mD_1}{x}$,
$\deadTwo{x}$,
$\visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x}$
are disjoint, thus:
\begin{align}
& | \visFin{\mB \smi \mD_1}{x} | + |\deadOne{x}| + |\deadTwo{x}| + 2| \visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x} | \leq \label{disj:eq:1} \\
%
& 2|\visFin{\mB \smi \mD_1}{x} \cup \deadOne{x}| + |\deadTwo{x}| + 2| \visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x} | \leq \label{disj:eq:2} \\
%
& |B| + |\visFin{\mB \smi \mD_1}{x} \cup \deadOne{x}| + | \visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x} | \leq 2|B|  \nonumber
\end{align}
Let us reduce the estimate to $\leq 2|B|-1$:
\li
  \- assume that $\deadTwo{x} = \emptyset$
     (otherwise, Eq.\ref{disj:eq:1} and the sets disjointness give $2|B|-1$);
     and

  \- assume that $ \visFin{\mB \smi \mD_1}{x} \neq \emptyset$
     (the other case together with eq.\ref{disj:eq:2},
      the sets disjointness, and the first item gives $2|B|-1$);

  \- hence, the construction in step (d) evacuates the process in
     $q \in \visFin{\mB \smi \mD_1}{x}$
     into
     $ \visInf{\mB \smi \mD_1}{x} \smi \deadTwo{x}$.
     Hence modify step (c) of the construction
     and for $q$ devote a single process of $\cutoffsys$ that floods it.
     This will give $\leq 2|B|-1$.
\il
This concludes the proof.

\end{proof}

\begin{tightness}[Disj, Deadlocks, Fair]
\label{obs:disj:fair_tight_deadlock}
The cutoff $c=2|B|-1$ for deadlock detection in disjunctive systems on strong-fair or finite runs is tight.
I.e., for any $k$ there are templates $(A,B)$ with $|B|=k$ such that:
$$
(A,B)^{(1,2|B|-2)} \textit{ does not have a deadlock, but } (A,B)^{(1,2|B|-1)} \textit { does}.
$$
\end{tightness}
\begin{proof}
Figure~\ref{gua:fig:tight_disj_dead_fair}
shows process templates $(A,B)$ such that any system $\largesys$ with $n\leq 2|B|-2$ does not deadlock on strong-fair runs, but larger systems do.
%
\begin{figure}[htpb]
\centering
\begin{subfigure}[b]{0.45\textwidth}\center
\scalebox{0.75}{\input{guarded-systems/img/disj_tight_fair_deadlock_tmplA}}
\label{fig:disj:tight_fair_deadlock_tmplA}
\caption*{Template A}
\end{subfigure}
\begin{subfigure}[b]{0.45\textwidth}\center
\scalebox{0.75}{\input{guarded-systems/img/disj_tight_fair_deadlock_tmplB}}
\caption*{Template B}
\end{subfigure}
\caption{Templates $(A,B)$ used in Tightness~\ref{obs:disj:fair_tight_deadlock}.}
\label{gua:fig:tight_disj_dead_fair}
\end{figure}
%
\end{proof}


\documentclass{article}
\usepackage{tikz, amsmath, amssymb, pgfplots, enumerate}
\usetikzlibrary{shapes,arrows,calc}
\usepgfplotslibrary{fillbetween}
\usepackage[margin=1in]{geometry}

\title{Consumer Theory Concepts}
\author{Ryan Safner}
\date{ECON 306}

\begin{document}

\maketitle

\section*{Consumer's Constrained Optimization}

\begin{itemize}
	\item \textbf{Constrained optimization} (in general) always involves the following three elements:
	\begin{enumerate}
		\item \textbf{Choose:} \textcolor{blue}{$<$some alternative$>$}
		\item \textbf{In order to maximize:} \textcolor{green}{$<$some objective$>$}
		\item \textbf{Subject to}: \textcolor{red}{$<$some constraints$>$}
	\end{enumerate}
	\item The \textbf{Consumer's (constrained optimization) problem} is:
	\begin{enumerate}
		\item \textbf{Choose:} \textcolor{blue}{$<$bundle of goods$>$}
		\item \textbf{In order to maximize:} \textcolor{green}{$<$utility$>$}
		\item \textbf{Subject to}: \textcolor{red}{$<$income and market prices$>$}
	\end{enumerate}

\end{itemize}

\subsection*{Choices}
\begin{itemize}
	\item Consumers choose bundles of goods:
	\begin{equation*}
	(x,y)
	\end{equation*}
	where $x$ = amount of good $x$, and $y$ = amount of good $y$
\end{itemize}

\subsection*{Constraints: The Budget Constraint}

\begin{itemize}
	\item \textbf{Budget set}: the set of all bundles of goods that are \emph{affordable}:
	\begin{equation*}
	p_x x+p_y y \leq m
	\end{equation*}
	\begin{itemize}
		\item Consumers can buy bundles that do not spend all income (income leftover)
	\end{itemize}
	\item \textbf{Budget constraint}: the set of all bundles of goods that \emph{spend all income}
	\begin{equation*}
	p_x x+p_y y = m
	\end{equation*}
	\begin{itemize}
		\item To graph, solve for $y$:
		\begin{equation*}
			y=\frac{m}{p_y}-\frac{p_x}{p_y}x
		\end{equation*}
		\clearpage
		\begin{itemize}
		\item Vertical intercept: $\displaystyle \frac{m}{p_y}$
		\item Horizontal intercept: $\displaystyle \frac{m}{p_x}$
		\item Slope: $\displaystyle -\frac{p_x}{p_y}$
		\end{itemize}
	\end{itemize}
	\begin{figure}[h!]
		\centering
			\begin{tikzpicture}[scale=.4]
			\draw[fill=green!50](0,0)--(0,5)--(10,0)--node[above]{\textcolor{black}{Budget Set}}(0,0);
			\draw[->] (0,0) -- (11,0) coordinate (x axis) node[right]{$x$};
 			\draw[->] (0,0) -- (0,11) coordinate (y axis) node[above]{$y$};
 			\draw[black, fill=black] (0,5)circle(0.125cm)node[left]{$\frac{m}{p_y}$};
 			\draw[black, fill=black] (10,0)circle(0.125cm)node[below]{$\frac{m}{p_x}$};
			\draw[ultra thick, blue] (0,5)--node[above=.25cm]{\textcolor{black}{$y=\frac{m}{p_y}-\frac{p_x}{p_y}x$}}(10,0);
 		\end{tikzpicture}
	\caption{The Budget Constraint (blue) and Budget Set (green)}
	\end{figure}
	\item All points on the line spend all income
	\begin{itemize}
		\item All points beneath line are \emph{affordable} (in budget set) but do not spend all income
		\item All points above the line are \emph{not} affordable at current income and prices
	\end{itemize}

	\item Budget constraint determined by three parameters: $p_x, p_y, m$
	\begin{itemize}
		\item Change in income: shifts budget constraint in parallel
		\begin{itemize}
			\item New $m'$ in intercepts
			\item No change in slope
		\end{itemize}
		\item Change in a market price: rotates budget constraint
		\begin{itemize}
			\item New intercept for good that changed in price
			\item New slope
		\end{itemize}
	\end{itemize}
	\item Slope of budget constraint measures the \emph{market} exchange rate between $x$ and $y$ (their relative prices)
\end{itemize}

\begin{table}[h!]
		\centering
		\begin{tabular}{ccc}
$\Delta m$ ($\uparrow$ in green, $\downarrow$ in red) & $\Delta p_x$ ($\uparrow$ in red, $\downarrow$ in green) & $\Delta p_y$ ($\uparrow$ in red, $\downarrow$ in green)\\
			\begin{tikzpicture}[scale=0.7]\small
			\draw[->] (0,0) -- (6,0) coordinate (x axis) node[right]{$x$};
 			\draw[->] (0,0) -- (0,6) coordinate (y axis) node[above]{$y$};
	\draw[very thick, blue] (0,3)node[left]{$\frac{m}{p_y}$}--(3,0)node[below]{$\frac{m}{p_x}$};
	\draw[very thick, green, dashed] (0,5)node[left]{$\frac{m'}{p_y}$}--(5,0)node[below]{$\frac{m'}{p_x}$};
	\draw[very thick, red, dashed] (0,1)node[left]{$\frac{m''}{p_y}$}--(1,0)node[below]{$\frac{m''}{p_x}$};
\end{tikzpicture}
&
	\begin{tikzpicture}[scale=0.7]\small
			\draw[->] (0,0) -- (6,0) coordinate (x axis) node[right]{$x$};
 			\draw[->] (0,0) -- (0,6) coordinate (y axis) node[above]{$y$};
	\draw[very thick, blue] (0,3)node[left]{$\frac{m}{p_y}$}--(3,0)node[below]{$\frac{m}{p_x}$};
	\draw[very thick, red, dashed] (0,3)--(1,0)node[below]{$\frac{m}{p_x'}$};
	\draw[very thick, green, dashed] (0,3)--(5,0)node[below]{$\frac{m}{p_x''}$};
\end{tikzpicture}
&
	\begin{tikzpicture}[scale=0.7]\small
			\draw[->] (0,0) -- (6,0) coordinate (x axis) node[right]{$x$};
 			\draw[->] (0,0) -- (0,6) coordinate (y axis) node[above]{$y$};
	\draw[very thick, blue] (0,3)node[left]{$\frac{m}{p_y}$}--(3,0)node[below]{$\frac{m}{p_x}$};
	\draw[very thick, red, dashed] (0,1)node[left]{$\frac{m}{p_y'}$}--(3,0);
	\draw[very thick, green, dashed] (0,5)node[left]{$\frac{m}{p_y''}$}--(3,0);
\end{tikzpicture}\\
\end{tabular}
\caption{How the budget constraint changes with income and market prices}
\end{table}

\clearpage

\subsection*{Objective: Utility and Preferences}
\begin{itemize}
	\item \textbf{Preferences} express rankings between bundles of goods
	\begin{itemize}
		\item For any two bundles of goods $a$ and $b$:
		\begin{itemize}
			\item $a \succ b$: $a$ is preferred to $b$
			\item $a \prec b$: $b$ is preferred to $a$
			\item $a \sim b$: indifferent between $a$ and $b$
	\end{itemize}
	\item Assumptions about ``well-behaved'' preferences:
	\begin{enumerate}
		\item Reflexivity: $a \succeq a$
		\item Completeness: for all $a$ and $b$: $a \succ b$, $a \prec b$, or $a \sim b$
		\item Transitivity: if $a \succ b$ and $b \succ c \implies a \succ c$
		\end{enumerate}
	\end{itemize}
	\item \textbf{Indifference curves} link all bundles which the consumer is indifferent between
							\begin{figure}[h!]
							\centering
	\begin{tikzpicture}\small
	\begin{axis}[
		scale=1.25,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
		every axis y label/.style={at={(axis description cs:-0.1,0.5)},anchor=east},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	xtick={1, 2,...,10},
	ytick={0,1,2,...,10},
	grid=major,
	ymin=0,
	xmin=0,
	xmax=10,
	ymax=10,
]
	\addplot[name path=ic, domain=0:10, samples=20, ultra thick, color=blue!50]{16/(x)};
	\draw[black, fill=black] (axis cs:2,8)circle(0.05cm)node[right]{A};
	\draw[black, fill=black] (axis cs:8,2)circle(0.05cm)node[above]{C};
	\draw[black, fill=black] (axis cs:4,4)circle(0.05cm)node[above]{B};
	\addplot[domain=0.1:10, samples=20, ultra thick, color=red!50]{9/(x)};
	\draw[black, fill=black] (axis cs:3,3)circle(0.05cm)node[above]{D};
	\addplot[domain=0:10, samples=20, ultra thick, color=green!50]{25/(x)};
	\draw[black, fill=black] (axis cs:5,5)circle(0.05cm)node[above]{E};
	\draw[thick, black, dashed, <->] (axis cs:2,2)node[below]{Less preferred}--(axis cs:6,6)node[above]{More preferred};
\end{axis}
\end{tikzpicture}
\caption{Indifference curves: $E \succ A \sim B \sim C \succ D$}
\end{figure}
	\begin{itemize}
		\item Assumptions of ``well-behaved'' indifference curves:
		\begin{enumerate}
			\item We can always draw indifference curves
			\item Monotonicity: ``more is preferred to less''
			\item Convexity: ``averages are preferred to extremes''
			\item Transitivity: indifference curves can never cross
		\end{enumerate}
		\clearpage
		\item In general, even non-monotonic indifference curves (i.e. when there is 1 or more \textbf{bads}) follow a pattern. Figure 3 shows four types of indifference curves, broken down into four quadrants. Black arrows show the direction of \emph{better} bundles in each of the four cases:
		\begin{enumerate}[I.]
			\item $x$ is a good, $y$ is a bad
			\item $x$ and $y$ are both bads
			\item $x$ and $y$ are both goods
			\item $x$ is a bad, $y$ is a good
		\end{enumerate}
	\begin{figure}[h!]
		\centering
			\begin{tikzpicture}\small
	\begin{axis}[
		scale=1.5,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.1,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	ticks=none,
	grid=none,
	ymin=0,
	xmin=0,
	xmax=5,
	ymax=5,
]
	\addplot[opacity=0]{x};
	\draw[thick, blue!50] (axis cs: 2.5,2.5) circle[radius=100];
	\draw[thick, blue!75] (axis cs: 2.5,2.5) circle[radius=150];
	\draw[thick, blue] (axis cs: 2.5,2.5) circle[radius=200];
	\draw[ultra thick, dashed, red](axis cs:0,2.5)--(axis cs:5,2.5);
	\draw[ultra thick, dashed, red](axis cs:2.5,0)--(axis cs:2.5,5);
	\draw[thick, dashed, ->] (axis cs:1.25,1)--(axis cs: 2,2);
	\draw[thick, dashed, ->] (axis cs:1.25,4)--(axis cs: 2,3);
	\draw[thick, dashed, ->] (axis cs:3.75,1)--(axis cs: 3,2);
	\draw[thick, dashed, ->] (axis cs:3.75,4)--(axis cs: 3,3);
	\draw[red] (axis cs:1,4)node[above]{I};
	\draw[red] (axis cs:4,4)node[above]{II};
	\draw[red] (axis cs:1,1)node[below]{III};
	\draw[red] (axis cs:4,1)node[below]{IV};
\end{axis}
\end{tikzpicture}
\caption{Possible indifference curves with goods and bads. Arrows show direction of higher utility for each quadrant.}
	\end{figure}

	\item \textbf{Marginal rate of substitution (MRS)}: an individual's exchange rate between good $x$ and $y$
		\begin{itemize}
		\item $MRS=$ the slope of the indifference curve
		\item Literally: the amount of $y$ given up to obtain 1 more $x$ and remain indifferent
		\end{itemize}
	\end{itemize}
	\item \textbf{Utility function}: represents preferences in functional form
	\begin{equation*}
	u(x,y)
	\end{equation*}
	\begin{itemize}
		\item We can assign utility levels to any bundles such that for any bundles $a$ and $b$:
		\begin{equation*}
		a \succ b \iff u(a) > u(b)
		\end{equation*}
 		\item Utility is \textbf{ordinal} not \textbf{cardinal}!
 		\begin{itemize}
 			\item The actual utility numbers for bundle $a$ and $b$ mean nothing literally!
 			\item All that matters is if $u(a) > u(b)$, the consumer prefers $a$ over $b$ (we can't say \emph{how much})
 			\item Implies that multiple utility functions can represent the same preferences
		\end{itemize}
		\item All points on the same indifference curve yield the same utility
		\item \textbf{Marginal utility}: the change in utility from a 1-unit increase in consumption of a good
		\begin{align*}
		MU_x&=\frac{\Delta u(x,y)}{\Delta x}\\
		MU_y&=\frac{\Delta u(x,y)}{\Delta y}\\
		\end{align*}
 		\begin{itemize}
 			\item Marginal utilities are related to the MRS:
 			\begin{equation*}
 			MRS=\frac{MU_x}{MU_y}
 			\end{equation*}
 										\begin{figure}[h!]
							\centering
	\begin{tikzpicture}\small
	\begin{axis}[
		scale=1.25,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
		every axis y label/.style={at={(axis description cs:-0.1,0.5)},anchor=east},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	xtick={1, 2,...,10},
	ytick={0,1,2,...,10},
	grid=major,
	ymin=0,
	xmin=0,
	xmax=10,
	ymax=10,
]
	\addplot[name path=ic, domain=0:10, samples=20, ultra thick, color=blue!50]{16/(x)};
	\draw[blue](axis cs:9,1)node[above]{$u=16$};
	\addplot[name path=ic, domain=0:10, samples=20, ultra thick, color=green!50]{25/(x)};
	\draw[green](axis cs:9,3)node[above]{$u=25$};
	\draw[very thick, dashed, red] (axis cs:3,5.4)--(axis cs:3,4)node[left]{$MRS=\frac{MU_x}{MU_y}$}--(axis cs:4,4);
\end{axis}
\end{tikzpicture}
\caption{Indifference curves for $u(x,y)=xy$}
\end{figure}
	\end{itemize}

	\clearpage

	\item Shape \& slopes (MRS) of indifference curves:
	\begin{itemize}
		\item Steep vs. flat $\implies$ relative intensity of preference for $x$ vs. $y$
	\begin{table}[h!]
		\centering
		\begin{tabular}{cc}
			Vertical $\implies$ $y$ is a neutral (more$\sim$less $y$) & Horizontal $\implies$ $x$ is a neutral (more$\sim$less $x$)\\
			\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	xtick={1, 2,...,5},
	ytick={0,1,...,5},
	grid=major,
	ymin=0,
	xmin=0,
]
	\addplot[opacity=0]{x};
	\draw[very thick, blue!50](axis cs: 3,0)--(axis cs:3,5);
	\draw[fill=black](axis cs:3,1)circle(0.05cm)node[right]{A};
	\draw[fill=black](axis cs:3,4)circle(0.05cm)node[right]{B};
\end{axis}
\end{tikzpicture}
&
	\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	xtick={1, 2,...,5},
	ytick={0,1,...,5},
	grid=major,
	ymin=0,
	xmin=0,
]
	\addplot[opacity=0]{x};
	\draw[very thick, blue!50](axis cs: 0,3)--(axis cs:5,3);
	\draw[fill=black](axis cs:1,3)circle(0.05cm)node[above]{C};
	\draw[fill=black](axis cs:4,3)circle(0.05cm)node[above]{D};
\end{axis}
\end{tikzpicture}\\
& \\
Steeper $\implies$ willing to give up more $y$ for $x$ & Flatter $\implies$ willing to give up less $y$ for $x$  \\
 \begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	xtick={1, 2,...,5},
	ytick={0,1,...,5},
	grid=major,
	ymin=0,
	xmin=0,
	ymax=5,
	xmax=5
]
	\addplot[very thick, blue!50, domain=0:3, samples=20]{4/(x)};
	\draw[thick, red, dashed] (axis cs:1,4)--node[left]{$\Delta y$}(axis cs:1,2)--node[below]{$\Delta x$}(axis cs:2,2);
\end{axis}
\end{tikzpicture}
&
			\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	xtick={1, 2,...,5},
	ytick={0,1,...,5},
	grid=major,
	ymin=0,
	xmin=0,
	ymax=5,
	xmax=5
]
	\addplot[very thick, blue!50, domain=1:5, samples=20]{2/x+1};
	\draw[thick, red, dashed] (axis cs:1,3)--node[left]{$\Delta y$}(axis cs:1,2)--node[below]{$\Delta x$}(axis cs:2,2);
\end{axis}
\end{tikzpicture}\\
		\end{tabular}
	\end{table}
	\item Bent vs. straight $\implies$ complementarity vs. substitutability between $x$ and $y$
		\begin{table}[h!]
		\centering
		\begin{tabular}{cc}
			Right-angle $\implies$ perfect complements & Straight line $\implies$ perfect substitutes\\
			\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	xtick={1, 2,...,5},
	ytick={0,1,...,5},
	grid=major,
	ymin=0,
	xmin=0,
]
	\addplot[opacity=0]{x};
	\draw[very thick, blue!50] (axis cs:1,5)--(axis cs:1,1)--(axis cs:5,1);
\end{axis}
\end{tikzpicture}
&
	\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	xtick={1, 2,...,5},
	ytick={0,1,...,5},
	grid=major,
	ymin=0,
	xmin=0,
]
	\addplot[opacity=0]{x};
	\draw[very thick, blue!50] (axis cs:0,3)--(axis cs:3,0);
\end{axis}
\end{tikzpicture}\\
Always consume at same rate of combination & Always substitute at same rate\\
\end{tabular}
\end{table}
	\end{itemize}
\end{itemize}
	\clearpage

\subsection*{Solving the Consumer's Problem}

\begin{itemize}
	\item Consumer chooses bundle of $x$ and $y$ to maximize utility subject to their income and market prices
	\begin{itemize}
		\item Expressed mathematically:
	\begin{equation*}
		\max_{\textcolor{blue}{x,y}} \textcolor{green}{u(x,y)	}
		\end{equation*}
		\begin{equation*}
		\text{ s. t. }\textcolor{red}{p_xx+p_yy=m}
	\end{equation*}
		\item Graphically: optimum is the point of tangency between the highest indifference curve and the budget constraint
				\begin{figure}[h!]
		\centering
			\begin{tikzpicture}\small
	\begin{axis}[
		scale=1,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	legend style={at={(0.5,-0.25)},anchor=north},
	ylabel=$y$,
	xlabel=$x$,
	xtick={2,4,...,20},
	ytick={0,2,...,20},
	grid=major,
	ymin=0,
	xmin=0,
	ymax=20,
	xmax=20
]
	\addplot[thick, color=blue!50, domain=0:20, samples=20, forget plot]{50/x};
	\draw[thick, red](axis cs:0,10)--(axis cs:20,0);
	\addlegendimage{thick, red};
	\addlegendimage{thick, blue!50};
	\draw[fill=black](axis cs:10,5)circle(0.05cm)node[above]{A};
\end{axis}
\end{tikzpicture}
\caption{The consumer's optimum at point $A$: indifference curve is tangent to budget constraint}
		\end{figure}
		\item At the tangency point ($A$), all of the following are true:
		\begin{align*}
		|\text{Slope of I.C.}|	&=|\text{Slope of B.C.}| & & \text{Slopes are equal}\\
		MRS&=\frac{p_x}{p_y} & & \text{Definition of each slope}\\
		\frac{MU_x}{MU_y}&=\frac{p_x}{p_y} & & \text{Individual exchange rate same as market exchange rate}\\
		\frac{MU_x}{p_x}&=\frac{MU_y}{p_y} & & \text{Marginal utility per \$1 is the same between $x$ and $y$}\\
		\end{align*}
		\end{itemize}
	\item \textbf{Equimarginal principle}: utility is optimized when individual can get no more utility by spending \$1 more on either $x$ or $y$
	\begin{itemize}
		\item Consumer is indifferent between buying more $x$ or buying more $y$: has no reason to change consumption decisions!
		\item If marginal utility per dollar were greater for (e.g.) $x$ than for $y$, could buy more $x$ and get more utility!
	\end{itemize}
	\end{itemize}
\end{itemize}

\clearpage
\section*{Deriving Demand}

\begin{itemize}
	\item An individual's \textbf{Demand (for good $x$)} is the optimal quantity that the individual would consume given current market prices and income:
	\begin{equation*}
	q=D(p_x,p_y,m)
	\end{equation*}
	We explore how a person's demand changes as one of the parameters to the demand function changes:
	\item Income effects $\bigg(\displaystyle \frac{\Delta q}{\Delta m} \bigg)$: how demand changes with income
				\begin{table}[h!]
		\centering
		\begin{tabular}{cc}
			Normal goods & Inferior good ($x$)\\
			\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	ticks=none,
	grid=none,
	ymin=0,
	xmin=0,
	xmax=20,
	ymax=20,
]
	\addplot[opacity=0]{x};
	\addplot[very thick, color=blue!50, domain=0:20, samples=20, forget plot]{12.5/x};
	\addplot[very thick, color=blue!75, domain=0:20, samples=20, forget plot]{50/x};
	\draw[very thick, red](axis cs:0,5)--(axis cs:10,0);
	\draw[very thick, red, dashed](axis cs:0,10)--(axis cs:20,0);
	\draw[fill=black](axis cs:10,5)circle(0.05cm)node[above]{B};
	\draw[fill=black](axis cs:5,2.5)circle(0.05cm)node[above]{A};
\end{axis}
\end{tikzpicture}
&
	\begin{tikzpicture}\small
	\begin{axis}[
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.2,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	ticks=none,
	grid=none,
	ymin=0,
	xmin=0,
	xmax=80,
	ymax=80,
]
	\addplot[domain=10:40, samples=25, very thick, color=blue!50]{200/(x)};
	\addplot[domain=5:40, samples=25, very thick, color=blue!75]{50/(x)+30};
	\draw[very thick, red] (axis cs:0,20)--(axis cs:40,0);
	\draw[very thick, dashed, red] (axis cs:0,40)--(axis cs:80,0);
	\draw[fill=black] (axis cs:20,10)circle(0.05cm)node[above]{A};
	\draw[fill=black] (axis cs:10,35)circle(0.05cm)node[above]{B};
\end{axis}
\end{tikzpicture}\\
Consume more $x$ and $y$ with $\uparrow$ m & Consume less $x$, more $y$ with $\uparrow$ m\\
\end{tabular}
\end{table}
	\begin{itemize}
		\item \textbf{Income Elasticity of Demand}: how responsive consumption is to changes in income
		\begin{equation*}
		\epsilon_{q,m}=\frac{\% \Delta q}{\% \Delta m}=\cfrac{\bigg(\frac{(q_2-q_1)}{q_1}\bigg)}{\bigg(\frac{(m_2-m_1)}{m_1}\bigg)}
		\end{equation*}
		\begin{itemize}
			\item Measures the \% change in quantity consumed for a 1\% change in income
			\begin{itemize}
				\item i.e. ``if income changes by 1\%, quantity consumed changes by \emph{$\epsilon_{q,m}$}\%''
			\end{itemize}
			\item If $\epsilon>0$: \textbf{normal good}: consume more with higher income (and vice versa)
			\begin{itemize}
				\item If $0 < \epsilon <1$: \textbf{necessity}: increase consumption by proportionately less than income increase
				\item If $\epsilon >1$: \textbf{luxury}: increase consumption by proportionately more than income increase
			\end{itemize}
			\item If $\epsilon<0$: \textbf{inferior good}: consume less with higher income (and vice versa)
		\end{itemize}
	\end{itemize}
	\item Price effects $\bigg(\displaystyle \frac{\Delta q}{\Delta p} \bigg)$: how demand changes with price
	\begin{itemize}
		\item \textbf{Substitution effect}: change in consumption due to change in relative prices
		\begin{itemize}
			\item Buy more of the relatively cheaper good, less of the relatively more expensive good
			\item Always the same direction, the primary reason for the law of demand (as $p \downarrow, q \uparrow$)
			\item Graphically: new bundle of $x$ and $y$ at \emph{new} exchange rate that yields \emph{same} utility as before
			\begin{itemize}
				\item Shift \emph{new} budget constraint inwards parallel until tangent to original indifference curve
				\item Movement from $A \rightarrow B$
			\end{itemize}
		\end{itemize}
		\item \textbf{Real Income effect}: change in consumption due to change in purchasing power
		\begin{itemize}
			\item A cheaper good frees up ability to buy more (less) goods overall (and vice versa), despite no change in \emph{nominal} income
			\item Positive for normal goods, negative for inferior goods!
			\item Often smaller than the substitution effect
			\item Larger for goods that are a large portion of budget (e.g. housing, cars, etc)
			\item Graphically: new bundle of $x$ and $y$ at new exchange rate that yields \emph{more} utility than before
			\begin{itemize}
				\item Movement from $B \rightarrow C$
			\end{itemize}
		\end{itemize}
		\item \textbf{Total price effect} $=$ substitution effect $+$ real income effect
		\begin{itemize}
			\item Graphically: overall movement from $A \rightarrow C$
			\item \textbf{Law of demand}: $\downarrow p, \uparrow q$
		\end{itemize}
		\begin{table}[h!]
		\centering
		\begin{tabular}{ccc}
$x$ is a Normal Good & $x$ is an Inferior Good & $x$ is a Giffen Good\\
		\begin{tikzpicture}\scriptsize
	\begin{axis}[clip=false,
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.1,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	ticks=none,
	grid=none,
	ymin=0,
	xmin=0,
	ymax=80,
	xmax=80,
]
	\addplot[domain=0:80, samples=25, very thick, color=blue!50]{150/(x)};
	\addplot[domain=10:80, samples=25, very thick, color=blue]{600/(x)};
	\draw[very thick, red] (axis cs:0,30)--(axis cs:20,0);
	\draw[very thick, dashed, red] (axis cs:0,30)--(axis cs:80,0);
	\draw[very thick, dotted, red] (axis cs:0,15)--(axis cs:40,0);
	\draw[fill=black] (axis cs:10,15)circle(0.05cm)node[right]{A};
	\draw[fill=black] (axis cs:20,7.5)circle(0.05cm)node[above]{B};
	\draw[fill=black] (axis cs:40,15)circle(0.05cm)node[above]{C};
	\draw[->, ultra thick, magenta] (axis cs:10,-15)node[left]{S.E.}--(axis cs:20,-15);
	\draw[->, ultra thick, teal] (axis cs:20,-25)--(axis cs:40,-25)node[right]{R.I.E.};
	\draw[->,ultra thick, olive] (axis cs:10,-35)--(axis cs:40,-35)node[right]{P.E.};
	\draw[thick, dotted] (axis cs:10,15)--(axis cs:10,-35);
	\draw[thick, dotted] (axis cs:20,7.5)--(axis cs:20,-35);
	\draw[thick, dotted] (axis cs:40,15)--(axis cs:40,-35);
\end{axis}
\end{tikzpicture}
&
		\begin{tikzpicture}\scriptsize
	\begin{axis}[clip=false,
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.1,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	ticks=none,
	grid=none,
	ymin=0,
	xmin=0,
	ymax=80,
	xmax=80,
]
	\addplot[domain=0:80, samples=25, very thick, color=blue!50]{150/(x)};
	\addplot[domain=0:80, samples=25, very thick, color=blue]{150/(x)+16};
	\draw[very thick, red] (axis cs:0,30)--(axis cs:20,0);
	\draw[very thick, dashed, red] (axis cs:0,30)--(axis cs:80,0);
	\draw[very thick, dotted, red] (axis cs:0,15)--(axis cs:40,0);
	\draw[fill=black] (axis cs:10,15)circle(0.05cm)node[right]{A};
	\draw[fill=black] (axis cs:20,7.5)circle(0.05cm)node[above]{B};
	\draw[fill=black] (axis cs:15,25)circle(0.05cm)node[above]{C};
	\draw[->, ultra thick, magenta](axis cs:10,-15)node[left]{S.E.}--(axis cs:20,-15);
	\draw[->, ultra thick, teal] (axis cs:20,-25)node[right]{R.I.E.}--(axis cs:15,-25);
	\draw[->, ultra thick, olive] (axis cs:10,-35)node[left]{P.E.}--(axis cs:15,-35);
	\draw[thick, dotted] (axis cs:10,15)--(axis cs:10,-35);
	\draw[thick, dotted] (axis cs:20,7.5)--(axis cs:20,-35);
	\draw[thick, dotted] (axis cs:15,25)--(axis cs:15,-35);
\end{axis}
\end{tikzpicture}
&
		\begin{tikzpicture}\scriptsize
	\begin{axis}[clip=false,
		scale=0.75,
		axis lines=middle,
		enlarge x limits={rel=0.1, upper},
		enlarge y limits={rel=0.1, upper},
		every axis y label/.style={at={(axis description cs:-0.1,0.5)},rotate=90,anchor=north},
		every axis x label/.style={at={(axis description cs:0.5,-0.1)},anchor=north},
	%legend pos=outer north east,
	xlabel=$x$,
	ylabel=$y$,
	shader=flat,
	ticks=none,
	grid=none,
	ymin=0,
	xmin=0,
	ymax=80,
	xmax=80,
]
	\addplot[domain=5:40, samples=25, very thick, color=blue]{50/(x)+30};
	\addplot[domain=13:40, samples=25, very thick, color=blue!50]{50/(x-8)+18};
	\draw[very thick, red] (axis cs:0,40)--(axis cs:40,0);
	\draw[very thick, dashed, red] (axis cs:0,40)--(axis cs:80,0);
	\draw[very thick, dotted, red] (axis cs:0,32)--(axis cs:64,0);
	\draw[fill=black] (axis cs:15,25)circle(0.05cm)node[above]{A};
	\draw[fill=black] (axis cs:10,35)circle(0.05cm)node[above]{C};
	\draw[fill=black] (axis cs:20,22)circle(0.05cm)node[above]{B};
		\draw[->, ultra thick, magenta](axis cs:15,-15)node[left]{S.E.}--(axis cs:20,-15);
	\draw[->, ultra thick, teal] (axis cs:20,-25)node[right]{R.I.E.}--(axis cs:10,-25);
	\draw[->, ultra thick, olive] (axis cs:15,-35)node[right]{P.E.}--(axis cs:10,-35);
	\draw[thick, dotted] (axis cs:15,25)--(axis cs:15,-35);
	\draw[thick, dotted] (axis cs:20,22)--(axis cs:20,-35);
	\draw[thick, dotted] (axis cs:10,35)--(axis cs:10,-35);
\end{axis}
\end{tikzpicture}\\
\end{tabular}
\caption{\textcolor{magenta}{Substitution effects ($A \rightarrow B$)}, \textcolor{teal}{Real income effects ($B \rightarrow C$)}, and \textcolor{olive}{Price effects ($A \rightarrow C$)} for a decrease in the price of $x$}
\end{table}
\item \textbf{Giffen good}: theoretical good that violates law of demand ($\downarrow p, \downarrow q$), requires:
		\begin{itemize}
			\item Negative real income effect (an inferior good)
			\item Real income effect $>$ substitution effect (good is a very very large portion of budget)
		\end{itemize}
	\end{itemize}
	\item Cross-price effects $\bigg(\displaystyle \frac{\Delta q_x}{\Delta p_y} \bigg)$: how demand changes with price of \emph{other} goods
	\begin{itemize}
		\item \textbf{Cross-Price Elasticity of Demand}: how responsive consumption is to changes in price of \emph{another} good
		\begin{equation*}
		\epsilon_{qx,py}=\frac{\% \Delta q_x}{\% \Delta p_y}=\cfrac{\bigg(\frac{(qx_2-q_1)}{qx_1}\bigg)}{\bigg(\frac{(py_2-py_1)}{py_1}\bigg)}
		\end{equation*}
		\begin{itemize}
			\item Measures the \% change in quantity consumed for a 1\% change in price of another good
			\begin{itemize}
				\item i.e. ``if price of $y$ changes by 1\%, quantity of $x$ consumed changes by \emph{$\epsilon_{qx,py}$}\%''
			\end{itemize}
			\item If $\epsilon>0$: $x$ and $y$ are \textbf{substitutes}: $\downarrow p_y, \downarrow q_x; \uparrow p_y, \uparrow q_x$
			\begin{itemize}
				\item e.g. Pepsi becoming cheaper reduces demand for Coke (switch to cheaper substitute)
			\end{itemize}
			\item If $\epsilon<0$: $x$ and $y$ are \textbf{complements}: $\downarrow p_y, \uparrow q_x; \uparrow p_y, \downarrow q_x$
						\begin{itemize}
				\item e.g. Milk becoming cheaper boosts demand for Cereal (the combination is now cheaper)
			\end{itemize}
		\end{itemize}
	\end{itemize}
\end{itemize}

\end{document}