% Students question collection
%# Author Alejandro Gonzalez Recuenco and SKR students
%# e-mail <alejandrogonzalezrecuenco@gmail.com>

\documentclass{exam}
%SET-UP:
\usepackage{amsmath, physics, tikz, tcolorbox, graphicx}

%! TexExamRandomizer = {"seed": 314159}
%! TexExamRandomizer = {"randominfo": {"randomnumber":100000000, "switchnumber":["even", "odd", "stop"]}}
%! TexExamRandomizer = {"table":"TestClass.csv"}
%! TexExamRandomizer = {"extrainfo":{"Class":"class", "Roll Number":"rollnumber","Nickname":"nickname"}}

%! TexExamRandomizer = {"layercmd":["section", "question", "(choice|CorrectChoice)"],"layernames":["document", "questions", "choices"]}
%! TexExamRandomizer = {"reordersections":[true, true, false]}
%! TexExamRandomizer = {"reorderitems":[false, true, true]}

\newcommand{\randomnumber}{3}
\newcommand{\switchnumber}{hi}
\newcommand{\class}{class}
\newcommand{\rollnumber}{rollnumber}
\newcommand{\nickname}{nickname}
\newcommand\myversion{0}
\newcommand\rseed{seed}

% DOCUMENT STARTS HERE
\begin{document}

\author{Everyone version \myversion}
\title{\textsc{Exam collection} --- mini-exam for \nickname\ of class \class}

\maketitle

\section{Word problems}

The two sections of questions are these ones

\subsection{Subsection 1}\begin{questions}

	\question What is a tangent line to a curve at a point $x = a$?

	\begin{choices}
		\choice A line that crosses a  curve once.
		\choice None of the other choices are correct.
		\choice A line that crosses a curve in two points.
		\CorrectChoice A line that has the same slope as the curve at the point $x = a$.
	\end{choices}
	\question What type of graph is the derivative of $f(x)= 5x^3+6x^2+5x-1$ graph?

	\begin{choices}
		\choice Line.
		\choice Circle.
		\choice Hyperbola.
		\CorrectChoice Parabola.
	\end{choices}

\end{questions}

\subsection{Subsection 2}
\begin{questions}

	\question test --- What is a tangent line to a curve at a point $x = a$?

	\begin{choices}
		\choice A line that crosses a  curve once.
		\choice None of the other choices are correct.
		\choice A line that crosses a curve in two points.
		\CorrectChoice A line that has the same slope as the curve at the point $x = a$.
	\end{choices}
	\question test --- What type of graph is the derivative of $f(x)= 5x^3+6x^2+5x-1$ graph?

	\begin{choices}
		\choice Line.
		\choice Circle.
		\choice Hyperbola.
		\CorrectChoice Parabola.
	\end{choices}

\end{questions}

\section{Easy}
The two sections of questions are these ones

\subsection{Subsection 1}\begin{questions}

	\question If $y=\cos5x$ find $\dv{y}{x}$.

	\begin{choices}
		\choice $\dv{y}{x} = 5\cos5x$.
		\choice $\dv{y}{x} = -2\sin5x$.
		\choice $\dv{y}{x} = 5\cos2x$.
		\CorrectChoice $\dv{y}{x} = -5\sin5x$.
	\end{choices}
	\question Given $y=2x^2-3x+5$, What is $\dv[2]{y}{x}$

	\begin{choices}
		\choice $\dv[2]{y}{x}=4x-3$
		\choice $\dv[2]{y}{x}=16x-12$
		\choice $\dv[2]{y}{x}=0$
		\CorrectChoice $\dv[2]{y}{x}=4$
	\end{choices}

\end{questions}

\subsection{Subsection 2}

\begin{questions}

	\question test --- If $y=\cos5x$ find $\dv{y}{x}$.

	\begin{choices}
		\choice $\dv{y}{x} = 5\cos5x$.
		\choice $\dv{y}{x} = -2\sin5x$.
		\choice $\dv{y}{x} = 5\cos2x$.
		\CorrectChoice $\dv{y}{x} = -5\sin5x$.
	\end{choices}
	second part of question
	\begin{choices}
		\choice test ---   $\dv{y}{x} = 5\cos5x$.
		\choice test ---   $\dv{y}{x} = -2\sin5x$.
		\choice test ---   $\dv{y}{x} = 5\cos2x$.
		\CorrectChoice test ---   $\dv{y}{x} = -5\sin5x$.
	\end{choices}
	\question test ---  Given $y=2x^2-3x+5$, What is $\dv[2]{y}{x}$

	\begin{choices}
		\choice $\dv[2]{y}{x}=4x-3$
		\choice $\dv[2]{y}{x}=16x-12$
		\choice $\dv[2]{y}{x}=0$
		\CorrectChoice $\dv[2]{y}{x}=4$
	\end{choices}

\end{questions}

\section{Medium}

\begin{questions}

	\question What is the derivative of f(x)=$(1-6x^2)^4$
	\begin{choices}
		\choice $4(1-6x^2)^3$
		\choice $4x(1-6x^2)^3$
		\choice $48x(1-6x^2)^3$
		\CorrectChoice $-48x(1-6x^2)^3 y$
	\end{choices}

	\question Find the derivative of $f(x) = \frac{x-1}{x+1}$

	\begin{choices}
		\choice $f'(x) = \frac{-2}{(x+1)^2}$
		\choice $f'(x) = \frac{2}{(x-1)^2}$
		\choice $f'(x) = \frac{-2}{(x-1)^2}$
		\CorrectChoice $f'(x) = \frac{2}{(x+1)^2}$
	\end{choices}

\end{questions}

\section{Hard}

\begin{questions}

	\question What is value of the $\displaystyle \lim_{h \to 0} \frac{f(x+h) -f(x)}{h}$ tells about the function?

	\begin{choices}
		\choice\label{choice:der1} The Slope of the graph.
		\choice\label{choice:der2} The critical point of the function , when the value of the limit is 0.
		\CorrectChoice Both options, \ref{choice:der1} and \ref{choice:der2}, are correct.
		\choice None of the above.
	\end{choices}

	\question What is the derivative of $f(x) = \arctan(2x)$ ?

	\begin{choices}
		\choice $\frac{2}{1 + x^{2}}$
		\choice $\frac{2}{2 + x^{2}}$
		\choice $\frac{2}{2 + 4x^{2}}$
		\CorrectChoice $\frac{2}{1 + 4x^{2}}$
	\end{choices}

\end{questions}

\section{Graphic problems}

\begin{questions}
	\question
	From the following graph find $\lim_{x \to -2 } f(x)$
	\par\nopagebreak

	\begin{choices}
		\choice $0$.
		\choice $5$.
		\choice $4$.
		\CorrectChoice undefined.
	\end{choices}

\end{questions}

\section{Bonus, integration}

\begin{questions}
	\question Find the area of the graph between f(x) = $x^4$ and f(x) = $(x-6)^4$

	\begin{choices}
		\choice $\frac{243}{5}$
		\choice $\frac{243}{10}$
		\choice $\frac{486}{10}$
		\CorrectChoice $\frac{486}{5}$
	\end{choices}
	\question Find the integral of $ 4x^3+3x^2 $

	\begin{choices}
		\choice $12x^2 + 6x$
		\choice $4x^2 + 3x$
		\choice $4x^4 + 3x^3 + c$
		\CorrectChoice $x^4 + x^3 +c$
	\end{choices}

\end{questions}

\end{document}


%\documentclass[12pt]{article}
\documentclass[12pt,landscape]{article}

\include{preamble}

\newcommand{\instr}{\small Your answer will consist of a lowercase string (e.g. \texttt{aebgd}) where the order of the letters does not matter. \normalsize}

\title{Math 368 / 650 Fall \the\year{} \\ Midterm Examination Two}
\author{Professor Adam Kapelner}

\date{Thursday, November 11, \the\year{}}

\begin{document}
\maketitle

%\noindent Full Name \line(1,0){410}

\thispagestyle{empty}

\section*{Code of Academic Integrity}

\footnotesize
Since the college is an academic community, its fundamental purpose is the pursuit of knowledge. Essential to the success of this educational mission is a commitment to the principles of academic integrity. Every member of the college community is responsible for upholding the highest standards of honesty at all times. Students, as members of the community, are also responsible for adhering to the principles and spirit of the following Code of Academic Integrity.

Activities that have the effect or intention of interfering with education, pursuit of knowledge, or fair evaluation of a student's performance are prohibited. Examples of such activities include but are not limited to the following definitions:

\paragraph{Cheating} Using or attempting to use unauthorized assistance, material, or study aids in examinations or other academic work or preventing, or attempting to prevent, another from using authorized assistance, material, or study aids. Example: using an unauthorized cheat sheet in a quiz or exam, altering a graded exam and resubmitting it for a better grade, etc.
\\

\noindent By taking this exam, you acknowledge and agree to uphold this Code of Academic Integrity. \\

%\begin{center}
%\line(1,0){250} ~~~ \line(1,0){100}\\
%~~~~~~~~~~~~~~~~~~~~~signature~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date
%\end{center}

\normalsize

\section*{Instructions}
This exam is 70 minutes (variable time per question) and closed-book. You are allowed \textbf{one} page (front and back) of a \qu{cheat sheet}, blank scrap paper and a graphing calculator. Please read the questions carefully. Within each problem, I recommend considering the questions that are easy first and then circling back to evaluate the harder ones. No food is allowed, only drinks. %If the question reads \qu{compute,} this means the solution will be a number otherwise you can leave the answer in \textit{any} widely accepted mathematical notation which could be resolved to an exact or approximate number with the use of a computer. I advise you to skip problems marked \qu{[Extra Credit]} until you have finished the other questions on the exam, then loop back and plug in all the holes. I also advise you to use pencil. The exam is 100 points total plus extra credit. Partial credit will be granted for incomplete answers on most of the questions. \fbox{Box} in your final answers. Good luck!

\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{12} Let $X_1 \sim \exponential{\lambda_1}$ independent of $X_2 \sim \exponential{\lambda_2}$ where $\lambda_1 \neq \lambda_2$ but are both valid values in the parameter space of the exponential rv. Let $T = X_1 + X_2$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{17}

\begin{enumerate}[(a)]
\item $X_1$ does not have a PMF
\item $X_1$ does not have a CDF
\item $\prob{T \leq x} = \prob{X_1 \leq x, X_2 \leq x}$
\item $\prob{X_1 > x, X_2 > x} = e^{-(\lambda_1 + \lambda_2)x}$
\item $\support{T} = (0, \infty)$
\item $T$ is Erlang-distributed
\item $T$ is Gamma-distributed
\item $T \sim \int_{\support{X_1}} f_{X_1}(x) f_{X_2}(x)dx$
\item $T \sim \int_{\support{X_1}} f_{X_1}(x) f_{X_2}(t-x)dx$
\item $T \sim \int_{\support{X_1}} f_{X_1}^{old}(x) f_{X_2}^{old}(t-x) \indic{t-x \in \support{X_1}} dx$
\item $T \sim \int_{0}^\infty \lambda_1 e^{-\lambda_1 x} \lambda_2 e^{-\lambda_2 (t-x)} \indic{x-t \in (-\infty, 0)} dx$
\item $T \sim \lambda_1 \lambda_2 \int_{0}^t e^{-\lambda_1 x} e^{-\lambda_2 (t-x)} dx$
\item $T \sim \lambda_1 \lambda_2 e^{-\lambda_2 t} \indic{t > 0} \int_{0}^t e^{(\lambda_2 - \lambda_1)x} dx$
\item $T \sim \frac{\lambda_1 \lambda_2}{\lambda_2 - \lambda_1} e^{-\lambda_2 t} \indic{t > 0} \bracks{e^{(\lambda_2 - \lambda_1)x}}_0^t$
\item $T \sim \frac{\lambda_1 \lambda_2}{\lambda_2 - \lambda_1} e^{-\lambda_2 t} e^{(\lambda_2 - \lambda_1)t} \indic{t > 0}$
\item $T \sim \frac{\lambda_1 \lambda_2}{\lambda_2 - \lambda_1} \parens{e^{-\lambda_1 t} - e^{-\lambda_2 t}} \indic{t > 0}$
\item If (p) were to be true, then the density of $T$ would have a kernel given by $k(t) = e^{-\lambda_1 t} - e^{-\lambda_2 t}$
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{9} Let $X_1, X_2 \iid \text{Lomax}\parens{\alpha, \lambda} :=\overbrace{\alpha\lambda^\alpha \tothepow{x + \alpha}{-(\alpha + 1)}}^{f^{old}(x)} \indic{x > 0}$ with parameter space $\alpha, \lambda > 0$. Let $T = X_1 + X_2$, $R = X_1 / X_2$ and $N = X_1 / (X_1 +  X_2)$

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{10}

\begin{enumerate}[(a)]
\item If the density of $X_i$ were to be decomposed into $c \times  k(x)$ then $c = \alpha\lambda^\alpha$
\item $f_T(t) = \indic{t>0} \int_0^t f^{old}(x) f^{old}(t-x) dx$
\item $f_T(t) \propto \indic{t>0} \int_0^t f^{old}(x) f^{old}(t-x) dx$
\item $f_T(t) \propto \indic{t>0} \int_0^t \tothepow{(x + \alpha)(t - x + \alpha)}{-(\alpha + 1)} dx$

\item $f_R(r)  \propto \indic{r>0}\displaystyle \int_0^t \displaystyle\frac{f^{old}(x)}{f^{old}(r)} dx$
\item $f_R(r) = \indic{r>0} \int_0^\infty x f^{old}(rx) f^{old}(x)  dx$
\item $f_R(r) \propto \indic{r>0} \int_0^\infty x \tothepow{(rx + \alpha)(x + \alpha)}{-(\alpha + 1)}  dx$

\item $f_N(n)  \propto \indic{n>0}\displaystyle \int_0^t \displaystyle\frac{f^{old}(x)}{f^{old}(x) + f^{old}(n)} dx$
\item $f_N(n) = \indic{n>0} \int_0^\infty x f^{old}(nx) f^{old}(x - nx)  dx$
\item $f^{old}_N(n) \propto  \int_0^\infty x \tothepow{(nx + \alpha)(x - nx + \alpha)}{-(\alpha + 1)}  dx$
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{8} Let $X_1, X_2 \iid \gammanot{\alpha}{\beta}$. Let $T = X_1 + X_2$, $R = X_1 / X_2$ and $N = X_1 / (X_1 +  X_2)$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{11}

\begin{enumerate}[(a)]
\item $F_X(x) = P(\alpha, \beta x)$
\item $F_X(x) \propto \gamma(\alpha, \beta x)$
\item $T \sim \gammanot{2\alpha}{\beta}$
\item $T \sim \erlang{2\alpha}{\beta}$ if $2\alpha \in \naturals$
\item $R \sim \text{BetaPrime}(\alpha, \alpha)$
\item $N \sim \text{Beta}(\alpha, \alpha)$
\item $N \sim \text{Beta}(\beta, \alpha)$ \\

Assume (f) is true for the remainder of this problem
\item $N \sim \uniform{0}{1}$ if $\alpha = 1$
\item $F_N(n) = \int_0^n (u(1-u))^{\alpha - 1} du$
\item $F_N(n) = B(n, \alpha, \alpha) / B(\alpha, \alpha)$
\item $F_N(n) = I_n (\alpha, \alpha)$
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{13} Let $X_1, X_2 \iid \gammanot{\alpha}{\beta}$. Let  $M = X_1 X_2$, \\ $\bv{g} : \reals^2 \rightarrow \reals^2$, $\bv{h} : \reals^2 \rightarrow \reals^2$ which denotes the inverse of $\bv{g}$, $\bv{X} := \twovec{X_1}{X_2}$, $\bv{x} := \twovec{x_1}{x_2}$, $\bv{Y} := \twovec{Y_1}{Y_2}$ and $\bv{y} := \twovec{y_1}{y_2}$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{14}

\begin{enumerate}[(a)]
\item $\support{M} = (0, \infty)$
\item The function $\bv{g}(x_1, x_2) = \twovec{x_1 x_2}{x_1 x_2}$ is invertible.
\item The function $\bv{g}(x_1, x_2) = \twovec{x_1 x_2}{x_2}$ is invertible.
\item If $\bv{h}(y_1, y_2) = \twovec{y_1 / y_2}{y_2}$, then the Jacobian determinant is $\twobytwomat{1/y_2}{-y_1 / y_2^2}{0}{1}$.
\item If $\bv{h}(y_1, y_2) = \twovec{y_1 / y_2}{y_2}$, then the Jacobian determinant is $1/y_2$.
\item If $\x = \bv{h}(y_1, y_2) = \twovec{y_1 / y_2}{y_2}$ then $f_{\Y}(\y) = f_{\X}(y_1 / y_2, y_2) / \abss{y_2}$

\item $f_M(m) = f_{\X}(m, m)$
\item $f_M(m) = f_{X_1}(m) f_{X_2}(m)$
\item $f_M(m) = \int_\reals f_{X_1}(um) f_{X_2}(m) du$
\item $f_M(m) = \int_\reals f_{X_1}(m/u) f_{X_2}(u) / u ~du$
\item $f_M(m) = \int_\reals f_{X_1}(m/u) f_{X_2}(u) / |u| ~du$
\item $f_M(m) = \int_\reals f_{\X}(m/u, u) / |u| ~du$

\item $f_M(m) = \displaystyle\frac{\beta^{2\alpha}}{\Gamma(\alpha)^2} \indic{m > 0} \int_0^\infty \oneover{u} \tothepow{\displaystyle \frac{m}{u}}{\alpha - 1} e^{-\beta m / u} u^{\alpha - 1} e^{-\beta u}~du$

\item $f_M(m) = \displaystyle\frac{\beta^{2\alpha}}{\Gamma(\alpha)^2} m^{\alpha - 1} \indic{m > 0} \int_0^\infty \frac{e^{-\beta (m / u + u)}}{u} ~du$

\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{9} Consider a sequence of rv's $\Xoneton \iid \logistic{0}{1} := \displaystyle \frac{e^{-x}}{\squared{1 + e^{-x}}}$ \\ whose expectation is zero and let $X_{(1)}, \ldots, X_{(n)}$ denote this sequence's order statistics and $R := X_{(n)} - X_{(1)}$.

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{18}

\begin{enumerate}[(a)]
\item For all $i$, $X_i$ is an \qu{error distribution}
\item There exist nonzero constants $a, b$ such that for all $i$, $a X_i + b$ is an \qu{error distribution}

\item $F_{X_{(n)}} = F(x)^n$
\item If $\Xoneton$ were not independent, the formula in (c) could be different

\item $X_{(1)}, \ldots, X_{(n)} \iid \logistic{0}{1}$
\item $X_{(1)}, \ldots, X_{(n)}$ are all independent
\item $X_{(1)}$ has most of its mass near zero
\item $X_{(n)}$ has most of its mass near zero

\item $\support{X_{(k)}} = \reals$ for all $k$ and all $n$

\item $\expe{R} = 0$

\item $\prob{R \in [-a, +a]}$ for $a \in \reals$ increases as $n$ gets larger

\item $F_{X_{(1)}}(x) = 1 - \tothepow{\displaystyle \frac{e^{-x}}{1 + e^{-x}}}{n}$
\item $F_{X_{(1)}}(x) = 1 - n\tothepow{\displaystyle \frac{e^{-x}}{1 + e^{-x}}}{n}$
\item $F_{X_{(1)}}(x) = 1 - \tothepow{\displaystyle \frac{e^{-x}}{(1 + e^{-x})^2}}{n}$

\item $f_{X_{(1)}}(x) = n \displaystyle\tothepow{\displaystyle \frac{e^{-x}}{1 + e^{-x}}}{n}$
\item $f_{X_{(k)}}(x) = n \displaystyle \frac{e^{-x(n-k+1)}}{(1 + e^{-x})^{n+1}} $
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{8} Let $X \sim \exponential{\lambda}$ and $Y\,|\,X = x \sim \uniform{0}{x}$

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{10}

\begin{enumerate}[(a)]
\item The support of the joint density of $X$ and $Y$ is in the first quadrant of the cartesian plane, below the line $y=x$ and above the $x$-axis.
\item $\support{Y} = [0,1]$
\item $\prob{Y > 1/2} = 1/2$ for all $\lambda$ in the parameter space of the exponential rv
\item For positive $y$, $f_Y(y)$ is monotonically decreasing
\item $f_X(x) = \lambda e^{-\lambda x}$
\item $f_Y(y) = \lambda e^{-\lambda y}$

\item $f_Y(y) = \indic{y > 0} \displaystyle\int_y^\infty \displaystyle \frac{e^{-\lambda x}}{x} dx$

\item $\support{X\,|\,Y=y} = [y, \infty)$
\item $X\,|\,Y=y$ is a uniform rv

\item $\displaystyle\int_\reals \displaystyle\int_\reals \displaystyle\oneover{x} \indic{y \in [0, x]} ~\lambda e^{-\lambda x} \indic{x > 0} ~dx dy = 1$
\end{enumerate}
\eenum\instr\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\problem\timedsection{11} Let $X \sim \exponential{\lambda}$ and $Y\,|\,X  = x \sim \exponential{x}$

\vspace{-0.2cm}\benum\truefalsesubquestionwithpoints{12}

\begin{enumerate}[(a)]
\item $f_X(x) = \lambda e^{-\lambda x}$
\item $f_{Y\,|\,X}(y,x) = xe^{-xy} \indic{y > 0}$
\item $\lambda  \displaystyle \int_0^\infty \displaystyle\int_0^\infty xe^{-xy} ~e^{-\lambda x}   ~dx dy = 1$
\item The rv $Y$ is considered a \qu{compound distribution}

\item $\support{Y} = \reals$
\item $Y$ is not a valid rv
\item $f_Y(y) = \int_\reals f_{Y\,|\,X}(y,x) f_X(x) dx$

\item $f_Y(y) = e^{-\lambda y} / y \indic{y>0}$
\item $f_Y(y) = \lambda e^{-\lambda y} / (y + \lambda) \indic{y>0}$
\item $f_Y(y) = \lambda y / (y + \lambda) \indic{y>0}$
\item $f_Y(y) = \lambda / (y + \lambda)^2 \indic{y>0}$
\item $f_Y(y) = \lambda e^{-\lambda y} / y \indic{y>0}$
\end{enumerate}
\eenum\instr \\

\noindent Some of these antiderivatives (from Wolfram Alpha) may help you with the above problem:

\beqn
\int x^3 e^{-a x} dx &=& -\displaystyle\frac{e^{-a x} (a^3 x^3 + 3 a^2 x^2 + 6 a x + 6)}{a^4} + C \\
\int x^2 e^{-a x} dx &=&  -\displaystyle\frac{e^{-a x} (a^2 x^2 + 2 a x + 2)}{a^3} + C \\
\int x e^{-a x} dx &=& -\displaystyle\frac{e^{-a x} (a x + 1)}{a^2} + C
\eeqn
\pagebreak

%%%%% mixture

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\subsection{Combining instance models}
\label{subsec:transformation_framework:instance_models_and_instance_graphs:combining_instance_models}

The structure of \cref{fig:transformation_framework:instance_models_and_instance_graphs:structure_instance_models_graphs} shows that the instance models $Im_A$ and $Im_B$ are combined into one instance model $Im_{AB}$. This section provides the definition of this combination and its corresponding theorems. Please note that the definitions presented here are as generic as possible, and do not actively take into account that $Im_{A}$ and $Im_{B}$ are mostly distinct. This bit of information is added later as part of a theorem and proof.

\begin{defin}[Combination function on type models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine}
$\mathrm{combine}$ is a binary function on two instance models which combines two instance models into one instance model. Assume $Im_A$ is an instance model typed by type model $Tm_A$ and $Im_B$ is an instance model typed by type model $Tm_B$, then $\mathrm{combine}(Im_A, Im_B)$ is typed by $\mathrm{combine}(Tm_A, Tm_B)$ and is defined as follows:
\begin{align*}
\mathrm{combine}(Im_A, Im_B) = \langle&
Object = Object_{Im_A} \cup Object_{Im_B} \\&
\mathrm{ObjectClass} = \mathrm{objectclass\_\!combine}(Im_A, Im_B) \\&
\mathrm{ObjectId} = \mathrm{objectid\_\!combine}(Im_A, Im_B) \\&
\mathrm{FieldValue} = \mathrm{fieldvalue\_\!combine}(Im_A, Im_B) \\&
\mathrm{DefaultValue} = \mathrm{defaultvalue\_\!combine}(Im_A, Im_B)\rangle
\end{align*}

In which $\mathrm{objectclass\_\!combine}$ is given as part of \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:objectclass_combine}, $\mathrm{objectid\_\!combine}$ as part of \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:objectid_combine}, $\mathrm{fieldvalue\_\!combine}$ as part of \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:fieldvalue_combine} and $\mathrm{defaultvalue\_\!combine}$ as part of \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:defaultvalue_combine}.
\isabellelref{imod_combine}{Ecore.Instance_Model_Combination}
\end{defin}

The combination of two instance models knows a surprisingly simple definition. This is mostly caused by the fact that an instance model only contains of a set of objects, which has some properties. The properties of each object are specified by the different functions, which will be introduced in the following definitions.

First, the function for the combination of object classes is discussed.

\begin{defin}[Combination function for object classes]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:objectclass_combine}
$\mathrm{objectclass\_\!combine}$ is a partial function on two instance models which returns a new function \\$Object_{Im_{AB}} \Rightarrow Class_{Tm_{AB}}$. It is defined as follows:
\begin{multline*}
    \mathrm{objectclass\_\!combine}(Im_{A}, Im_{B}, o) = \\
        \begin{cases}
        \mathrm{ObjectClass}_{Im_A}(o) & \mathrm{if }\ o \in Object_{Im_A} \cap Object_{Im_B} \land \mathrm{ObjectClass}_{Im_A}(o) = \mathrm{ObjectClass}_{Im_B}(o) \\
        \mathrm{ObjectClass}_{Im_A}(o) & \mathrm{if }\ o \in Object_{Im_A} \setminus Object_{Im_B} \\
        \mathrm{ObjectClass}_{Im_B}(o) & \mathrm{if }\ o \in Object_{Im_B} \setminus Object_{Im_A}
    \end{cases}
\end{multline*}
\isabellelref{imod_combine_object_class}{Ecore.Instance_Model_Combination}
\end{defin}

The combination of two instance models knows a surprisingly simple definition. Because an instance model is essentially a set of objects with properties, no complex definition is needed. The properties of each object are specified by the different functions, which will be introduced in the following definitions.

First, the function of the combination of object classes is discussed.

\begin{defin}[Combination function for object identifiers]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:objectid_combine}
$\mathrm{objectid\_\!combine}$ is a partial function on two instance models which returns a new function \\$Object_{Im_{AB}} \Rightarrow Name$. It is defined as follows:
\begin{multline*}
    \mathrm{objectid\_\!combine}(Im_{A}, Im_{B}, o) = \\
        \begin{cases}
        \mathrm{ObjectId}_{Im_A}(o) & \mathrm{if }\ o \in Object_{Im_A} \cap Object_{Im_B} \land \mathrm{ObjectId}_{Im_A}(o) = \mathrm{ObjectId}_{Im_B}(o) \\
        \mathrm{ObjectId}_{Im_A}(o) & \mathrm{if }\ o \in Object_{Im_A} \setminus Object_{Im_B} \\
        \mathrm{ObjectId}_{Im_B}(o) & \mathrm{if }\ o \in Object_{Im_B} \setminus Object_{Im_A}
    \end{cases}
\end{multline*}
\isabellelref{imod_combine_object_id}{Ecore.Instance_Model_Combination}
\end{defin}

As mentioned before, the definition of the combination function of object identifiers is very similar to the definition of the combination function of object classes. If an object only occurs in one of the instance models, its identifier is copied over. If an object appears in both instance models, they must have the same identifier already in order to have an identifier in the final model.

A careful reader might notice that the behaviour of the function is strange. Theoretically, it might give rise to double identities, which is undesired. As will be shown later, the combination function and theorems assume that the identities of the models are already distinct. This assumption is fair, as it is possible to redefine two instance models to have distinct identities, without loss of significance.

The following definition describes the combination of field values.

\begin{defin}[Combination function for field values]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:fieldvalue_combine}
$\mathrm{fieldvalue\_\!combine}$ is a partial function on two instance models which returns a new function \\$(Object_{Im_{AB}} \times Field_{Tm_{AB}}) \Rightarrow Value_{Im_{AB}}$. It is defined as follows:
\begin{multline*}
    \mathrm{fieldvalue\_\!combine}(Im_A, Im_B, ( o, f )) = \\
    \begin{cases}
        \mathrm{FieldValue}_{Im_A}(( o, f )) & \mathrm{if}\ o \in Object_{Im_A} \cap Object_{Im_B}\ \land\\&\quad f \in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))\ \land\\&\quad f \in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))\ \land\\&\quad \mathrm{FieldValue}_{Im_A}(( o, f )) = \mathrm{FieldValue}_{Im_B}(( o, f )) \\
        \mathrm{FieldValue}_{Im_A}(( o, f )) & \mathrm{if}\ o \in Object_{Im_A} \land f \in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))\ \land\\&\quad (o \not\in Object_{Im_B} \lor f \not\in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))) \\
        \mathrm{FieldValue}_{Im_B}(( o, f )) & \mathrm{if}\ o \in Object_{Im_B} \land f \in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))\ \land\\&\quad (o \not\in Object_{Im_A} \lor f \not\in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o)))
    \end{cases}
\end{multline*}
\isabellelref{imod_combine_field_value}{Ecore.Instance_Model_Combination}
\end{defin}

The definition of the combination function of field values is a lot more complicated than the previous ones. The function domain causes this complexity. Not every combination of an object and a field has a value. An object only has values for those fields that are defined for its class or superclasses.

When a value is set on one of the instance models, but not the other, the value is copied. Furthermore, if a combination of object and field is set for both instance models and the value is the same, it is also copied. Please note that equality is used here, instead of equivalence. This property is to support some mathematical properties later on. Since the transformation framework will not allow for shared fields anyhow, this will not impose problems later.

The last function that needs to be defined is the combination function for default values. It is given in the following definition.

\begin{defin}[Combination function for default values]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:defaultvalue_combine}
$\mathrm{defaultvalue\_\!combine}$ is a partial function on two instance models which returns a new function \\$Constant_{Tm_{AB}} \Rightarrow Value_{Im_{AB}}$. It is defined as follows:
\begin{multline*}
    \mathrm{defaultvalue\_\!combine}(Im_{A}, Im_{B}, c) = \\
    \begin{cases}
        \mathrm{DefaultValue}_{Im_A}(c) & \mathrm{if }\ c \in Constant_{Tm_A} \cap Constant_{Tm_B}\ \land\\&\quad \mathrm{DefaultValue}_{Im_A}(c) = \mathrm{DefaultValue}_{Im_B}(c) \\
        \mathrm{DefaultValue}_{Im_A}(c) & \mathrm{if }\ c \in Constant_{Tm_A} \setminus Constant_{Tm_B} \\
        \mathrm{DefaultValue}_{Im_B}(c) & \mathrm{if }\ c \in Constant_{Tm_B} \setminus Constant_{Tm_A}
    \end{cases}
\end{multline*}
\isabellelref{imod_combine_default_value}{Ecore.Instance_Model_Combination}
\end{defin}

The definition of the combination function of default values is very similar to the combination function of constant types of type models (see \cref{defin:transformation_framework:type_models_and_type_graphs:combining_type_models:consttype_combine}). This function gives values to constants defined on the type model level. When a constant only appears in the type model of one of the instance models, the value can be copied from that instance model. This behaviour is logical since the other instance model cannot have a value set for that constant. If a constant is set for both of the corresponding type models, the value set on the instance models must be the same. If this is the case, the value can be copied over. This behaviour is desired, as the value for a constant should not change after the combination of two instance models.

Like the last definition, equality is used here to compare the values, instead of equivalence. Once more, this has been done to support some mathematical properties later on. Since the transformation framework will not allow for shared constants anyhow, this will not impose problems later.

With all definitions in place, it is possible to provide an example. Let us return to the multi-protocol chat application example introduced in \cref{fig:transformation_framework:type_models_and_type_graphs:combining_type_models:combine_example} of \cref{subsec:transformation_framework:type_models_and_type_graphs:combining_type_models}. An instance model for $Tm_{Chat}$ (\cref{fig:transformation_framework:type_models_and_type_graphs:combining_type_models:combine_example_tmod1}) could have an instance of a $\type{Thread}$ with some $\type{Message}$s. Formally, the instance model could look as follows:

\begin{align*}
Im_{Chat} =\ &\langle&
Object =\ &\{ 1, 2, 3 \} \\&&
\mathrm{ObjectClass} =\ &\{
( 1, \type{.Thread} ),
( 2, \type{.Message} ),
( 3, \type{.Message} )
\} \\&&
\mathrm{ObjectId} =\ &\{
( 1, \text{Thread42} ),
( 2, \text{Message4084} ),
( 3, \text{Message4093} )
\} \\&&
\mathrm{FieldValue} =\ &\Big\{
\Big( \big( 1, ( \type{.Thread}, \type{id} ) \big), \big[ \type{string}, \text{``BLUB-E\_Thread\_01''} \big] \Big),\\&&&
\Big( \big( 1, ( \type{.Thread}, \type{proto} ) \big), \big[ \type{enum}, ( \type{.Protocol}, \type{BLUB\!-\!E} ) \big] \Big),\\&&&
\Big( \big( 1, ( \type{.Thread}, \type{messages} ) \big), \big[ \type{seqof}, \big\langle [ \type{obj}, 2 ], [ \type{obj}, 3 ] \big\rangle \big] \Big),\\&&&
\Big( \big( 2, ( \type{.Message}, \type{text} ) \big), \big[ \type{string}, \text{``This is a test''} \big] \Big),\\&&&
\Big( \big( 3, ( \type{.Message}, \type{text} ) \big), \big[ \type{string}, \text{``Did you receive it?''} \big] \Big)
\Big\} \\&&
\mathrm{DefaultValue} =\ &\{\}
\\&\rangle
\end{align*}

A visual representation of this instance model is included in \cref{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example_imod1}. Now, assume that there also exists some instance model that is typed by the extension represented by $Tm_{Extension}$. This instance model introduces a $\type{Contact}$ instance for the $\type{Thread}$ instance in $Im_{Chat}$. Formally, this instance model could be defined as follows:

\begin{align*}
Im_{Extension} =\ &\langle&
Object =\ &\{ 1, 4 \} \\&&
\mathrm{ObjectClass} =\ &\{
( 1, \type{.Thread} ),
( 4, \type{.Contact} )
\} \\&&
\mathrm{ObjectId} =\ &\{
( 1, \text{Thread42} ),
( 4, \text{Broodkast} )
\} \\&&
\mathrm{FieldValue} =\ &\Big\{
\Big( \big( 1, ( \type{.Thread}, \type{contact} ) \big), \big[ \type{obj}, 4 \big] \Big),\\&&&
\Big( \big( 4, ( \type{.Contact}, \type{id} ) \big), \big[ \type{data}, \text{``BLUB-E\_PubKey\_a8138''} \big] \Big),\\&&&
\Big( \big( 4, ( \type{.Contact}, \type{name} ) \big), \big[ \type{string}, \text{``Lukas''} \big] \Big)
\Big\} \\&&
\mathrm{DefaultValue} =\ &\{\}
\\&\rangle
\end{align*}

The visual representation of $Im_{Extension}$ is included in \cref{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example_imod2}. With these instance models formally defined, it is possible to combine them using \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine}. This will yield the following model:

\begin{align*}
Im_{ChatExt} =\ &\langle&
Object =\ &\{ 1, 2, 3, 4 \} \\&&
\mathrm{ObjectClass} =\ &\{
( 1, \type{.Thread} ),
( 2, \type{.Message} ),
( 3, \type{.Message} ),
( 4, \type{.Contact} )
\} \\&&
\mathrm{ObjectId} =\ &\{
( 1, \text{Thread42} ),
( 2, \text{Message4084} ),
( 3, \text{Message4093} ),
( 4, \text{Broodkast} )
\} \\&&
\mathrm{FieldValue} =\ &\Big\{
\Big( \big( 1, ( \type{.Thread}, \type{id} ) \big), \big[ \type{string}, \text{``BLUB-E\_Thread\_01''} \big] \Big),\\&&&
\Big( \big( 1, ( \type{.Thread}, \type{proto} ) \big), \big[ \type{enum}, ( \type{.Protocol}, \type{BLUB\!-\!E} ) \big] \Big),\\&&&
\Big( \big( 1, ( \type{.Thread}, \type{messages} ) \big), \big[ \type{seqof}, \big\langle [ \type{obj}, 2 ], [ \type{obj}, 3 ] \big\rangle \big] \Big),\\&&&
\Big( \big( 1, ( \type{.Thread}, \type{contact} ) \big), \big[ \type{obj}, 4 \big] \Big),\\&&&
\Big( \big( 2, ( \type{.Message}, \type{text} ) \big), \big[ \type{string}, \text{``This is a test''} \big] \Big),\\&&&
\Big( \big( 3, ( \type{.Message}, \type{text} ) \big), \big[ \type{string}, \text{``Did you receive it?''} \big] \Big),\\&&&
\Big( \big( 4, ( \type{.Contact}, \type{id} ) \big), \big[ \type{data}, \text{``BLUB-E\_PubKey\_a8138''} \big] \Big),\\&&&
\Big( \big( 4, ( \type{.Contact}, \type{name} ) \big), \big[ \type{string}, \text{``Lukas''} \big] \Big)
\Big\} \\&&
\mathrm{DefaultValue} =\ &\{\}
\\&\rangle
\end{align*}

A visual representation of this combined model is included as \cref{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example_imod12}. Like the example for the combination of type models, this example shows that the definition of the combination of instance models is useful. It allows to build larger models out of smaller building blocks. Furthermore, the example shows that the combination of the two instance models is typed by the combination of its corresponding type models.

\begin{figure}
    \centering
    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics{images/04_transformation_framework/instance_models_combination/chat_instance_partial1.pdf}
        \caption{The chat application instance model $Im_{Chat}$}
        \label{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example_imod1}
    \end{subfigure}
    \par\medskip
    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics{images/04_transformation_framework/instance_models_combination/chat_instance_partial2.pdf}
        \caption{The contact extension instance model $Im_{Extension}$}
        \label{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example_imod2}
    \end{subfigure}
    \par\medskip
    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics{images/04_transformation_framework/instance_models_combination/chat_instance_combined.pdf}
        \caption{The extended chat application instance model $Im_{ChatExt}$}
        \label{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example_imod12}
    \end{subfigure}
    \caption{Example of the combination of type models}
    \label{fig:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine_example}
\end{figure}

Although the definitions of the combination of instance models are given, no mathematical properties or theorems are defined yet. Some mathematical properties hold for the combination of instance models, that will be presented in the following theorems.

\begin{thm}[Commutativity of the combination of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_commute}
Assume that $Im_A$ and $Im_B$ are instance models, then the $\mathrm{combine}$ function is commutative:
\begin{equation*}
    \mathrm{combine}(Im_A, Im_B) = \mathrm{combine}(Im_B, Im_A)
\end{equation*}
\isabellelref{imod_combine_commute}{Ecore.Instance_Model_Combination}
\end{thm}

\begin{thm}[Associativity of the combination of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_assoc}
Assume that $Im_A$, $Im_B$ and $Im_C$ are instance models, then the $\mathrm{combine}$ function is associative:
\begin{equation*}
    \mathrm{combine}(\mathrm{combine}(Im_A, Im_B), Im_C) = \mathrm{combine}(Im_A, \mathrm{combine}(Im_B, Im_C))
\end{equation*}
\isabellelref{imod_combine_assoc}{Ecore.Instance_Model_Combination}
\end{thm}

\begin{thm}[Idempotence of the combination of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_idemp}
Assume that $Im_A$ is an instance model and that it is valid in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}. Then the following property holds:
\begin{equation*}
    \mathrm{combine}(Im_A, Im_A) = Im_A
\end{equation*}
\isabellelref{imod_combine_idemp_alt}{Ecore.Instance_Model_Combination}
\end{thm}

These properties follow directly from \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:combine}, but the corresponding proofs will not be included here. It should be noted that these properties are indeed proven correct as part of this thesis, and the corresponding proofs are validated within Isabelle.

Besides these properties, the combination of instance models also has an identity element. The empty instance model represents this identity element, but it needs to be defined first:

\begin{defin}[Empty instance model]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:empty_instance_model}
Let $Im_{\epsilon}$ be the empty instance model. It is typed by the empty type model $Tm_{\epsilon}$. $Im_{\epsilon}$ is defined as:
\begin{align*}
Im_{\epsilon} = \langle&
Object = \{\} \\&
\mathrm{ObjectClass} = undefined \\&
\mathrm{ObjectId} = undefined \\&
\mathrm{FieldValue} = undefined \\&
\mathrm{DefaultValue} = undefined\rangle
\end{align*}
\end{defin}

\begin{thm}[Correctness of the empty type model]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_empty_correct}
The empty instance model, $Im_{\epsilon}$, is valid with respect to
\cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}.
\isabellelref{imod_empty_correct}{Ecore.Instance_Model}
\end{thm}

The proof for the correctness of the empty instance model is trivial. Still, a validated version of this proof can be found within the Isabelle theories of this thesis.

As mentioned earlier, the empty instance model acts as an identity element when combining two instance models. The following theorem specifies this behaviour.

\begin{thm}[Identity of the combination of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_identity}
Assume that $Im_A$ is an instance model and that it is valid in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}. Then $Im_{\epsilon}$ acts as an identity element in the combination function:
\begin{equation*}
    \mathrm{combine}(Im_{\epsilon}, Im_A) = Im_A
\end{equation*}
\isabellelref{imod_combine_identity_alt}{Ecore.Instance_Model_Combination}
\end{thm}

Once more, the proof of this theorem follows directly from the definition. Therefore, the corresponding proof will not be included here, but a validated version can be found within the Isabelle theories of this thesis.

A final desired property for the combination of instance models is a correctness property. \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_correct} defines the theorem under which the combination of instance models is a valid instance model. Please note that this theorem is a generic theorem, which does not take into account that the instance models are mostly distinct.

\begin{thm}[Validity of the combination of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_correct}
Assume that $Im_A$ and $Im_B$ are valid instance models in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}. Assume that $Im_A$ is typed by type model $Tm_A$. Furthermore, assume that $Im_B$ is typed by type model $Tm_B$. $Tm_A$ and $Tm_B$ are consistent by definition. Also assume that $Tm_{AB} = \mathrm{combine}(Tm_A, Tm_B)$ is consistent in the sense of \cref{defin:formalisations:ecore_formalisation:type_models:type_model_consistency}. Finally, assume the following properties:
\begin{itemize}
    \item For all shared objects, the object class must be the same in both instance models: $\forall o \in Object_{Im_A} \cap Object_{Im_B}\!: \mathrm{ObjectClass}_{Im_A}(o) = \mathrm{ObjectClass}_{Im_B}(o)$.
    \item For all shared objects, the object id must be the same in both instance models: $\forall o \in Object_{Im_A} \cap Object_{Im_B}\!: \mathrm{ObjectId}_{Im_A}(o) = \mathrm{ObjectId}_{Im_B}(o)$.
    \item For all shared constants within the corresponding type graphs, the default value must be the same in both instance models: $\forall c \in Constant_{Tm_A} \cap Constant_{Tm_B}\!:$\\$\mathrm{DefaultValue}_{Im_A}(c) = \mathrm{DefaultValue}_{Im_B}(c)$.
    \item The identifiers must be unique across both instance models: $\forall o_1 \in Object_{Im_A} \setminus Object_{Im_B} \land o_2 \in Object_{Im_B} \setminus Object_{Im_A}\!: \mathrm{ObjectId}_{Im_A}(o_1) = \mathrm{ObjectId}_{Im_B}(o_2) \implies o_1 = o_2$.
    \item If a field value is set for a combination of an object and field in both instance models, that field value must be the same in both instance models: $\forall o \in Object_{Im_A} \cap Object_{Im_B}\ \land$\\$f \in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o)) \cap \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))\!:$\\$\mathrm{FieldValue}_{Im_A}(( o, f )) = \mathrm{FieldValue}_{Im_B}(( o, f ))$.
    \item If an object needs a field value in the combination of $Im_A$ and $Im_B$, but this field value is not set in $Im_A$, then it must be set in $Im_B$:
    $\forall o \in Object_{Im_A} \land f \not\in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))\!:
    f \in \mathrm{fields}_{Tm_{AB}}(\mathrm{ObjectClass}_{\mathrm{combine}(Im_A, Im_B)}(o)) \implies$\\$
    o \in Object_{Im_B} \land f \in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))$.
    \item If an object needs a field value in the combination of $Im_A$ and $Im_B$, but this field value is not set in $Im_B$, then it must be set in $Im_A$:
    $\forall o \in Object_{Im_B} \land f \not\in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))\!:
    f \in \mathrm{fields}_{Tm_{AB}}(\mathrm{ObjectClass}_{\mathrm{combine}(Im_A, Im_B)}(o)) \implies$\\$
    o \in Object_{Im_A} \land f \in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))$.
    \item For field values copied from $Im_A$ that are in $ContainerValue_{Im_A}$, the combined multiplicity must be correct: $\forall o \in Object_{Im_A}\ \land f \in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))\ \land$\\$f \in Field_{Tm_B}\!: \mathrm{FieldValue}_{Im_A}(( o, f )) \in ContainerValue_{Im_A} \implies$\\$\mathrm{lower}_{Tm_{AB}}(\mathrm{FieldSig}_{Tm_{AB}}(f)) \leq |\mathrm{FieldValue}_{Im_A}(( o, f ))|\ \land$\\$|\mathrm{FieldValue}_{Im_A}(( o, f ))| \leq \mathrm{upper}_{Tm_{AB}}(\mathrm{FieldSig}_{Tm_{AB}}(f))$.
    \item For field values copied from $Im_B$ that are in $ContainerValue_{Im_B}$, the combined multiplicity must be correct: $\forall o \in Object_{Im_B}\ \land f \in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))\ \land$\\$f \in Field_{Tm_A}\!: \mathrm{FieldValue}_{Im_B}(( o, f )) \in ContainerValue_{Im_B} \implies$\\$\mathrm{lower}_{Tm_{AB}}(\mathrm{FieldSig}_{Tm_{AB}}(f)) \leq |\mathrm{FieldValue}_{Im_B}(( o, f ))|\ \land$\\$|\mathrm{FieldValue}_{Im_B}(( o, f ))| \leq \mathrm{upper}_{Tm_{AB}}(\mathrm{FieldSig}_{Tm_{AB}}(f))$.
    \item If there exists a containment property in $Tm_{AB}$, the satisfaction formula for containment properties must be satisfied: $\forall o \in Object_{Im_A} \cup Object_{Im_B}\!:$\\$\big|\big\{ \big( ( f\!o, f\!\!f ), f\!v \big) \mid \big( ( f\!o, f\!\!f ), fv \big) \in \mathrm{FieldValue}_{\mathrm{combine}(Im_A, Im_B)} \land [ \type{obj}, o ] = f\!v \land f\!\!f \in CR_{Tm_{AB}} \big\}\big| \leq 1$
    \item There may be no cycles in the containment edges of the combined instance model: $\big\{ (f\!o, f\!v) \mid \big( ( f\!o, f\!\!f ), f\!v \big) \in \mathrm{FieldValue}_{\mathrm{combine}(Im_A, Im_B)} \land f\!\!f \in CR_{Tm_{AB}} \big\}$ is acyclic.
    \item The identity properties must remain satisfied when combining objects from different instance models: $\forall [ \type{identity}, c, A ] \in Prop_{Tm_{A}} \land [ \type{identity}, c, A ] \in Prop_{Tm_{B}} \land o_1 \in Object_{Im_A} \setminus Object_{Im_B} \land o_2 \in Object_{Im_B} \setminus Object_{Im_A} \land \mathrm{ObjectClass}_{Im_A}(o_1) = c \land \mathrm{ObjectClass}_{Im_B}(o_2) = c \land a \in A\!: \mathrm{FieldValue}_{Im_A}(( o_1, a )) \equiv_{\mathrm{combine}(Im_A, Im_B)} \mathrm{FieldValue}_{Im_B}(( o_2, a )) \implies o_1 = o_2$.
    \item The opposite properties must remain satisfied when combining objects from different instance models: $\forall [ \type{opposite}, r_1, r_2 ] \in Prop_{Tm_{A}} \land [ \type{opposite}, r_1, r_2 ] \in Prop_{Tm_{B}}\ \land$\\$o_1 \in Object_{Im_A} \land (o_1 \not\in Object_{Im_B} \lor r_1 \not\in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o_1)))\ \land$\\$o_2 \in Object_{Im_B} \land (o_2 \not\in Object_{Im_A} \lor r_2 \not\in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o_2))) \implies$\\$ \mathrm{edgeCount}_{Im_A}(o_1, r_1, o_2) = \mathrm{edgeCount}_{Im_B}(o_2, r_2, o_1)$.
\end{itemize}

Then $\mathrm{combine}(Im_A, Im_B)$ is a valid instance model in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}
\isabellelref{imod_combine_correct}{Ecore.Instance_Model_Combination}
\end{thm}

\begin{proof}
To proof that $\mathrm{combine}(Im_A, Im_B)$ is a valid instance model, it needs to be shown that\\ $\mathrm{combine}(Im_A, Im_B)$ gives rise to a valid structure for an instance model and that \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity} holds. For readability, define $Im_{AB}$ to be $\mathrm{combine}(Im_A, Im_B)$.

\emph{Structural properties}
\begin{itemize}
    \item For each object $o$, $\mathrm{ObjectClass}_{Im_{AB}}(o)$ must be an element of $Class_{Tm_{AB}}$.

    If $o \in Object_{Im_A} \setminus Object_{Im_B}$, then $\mathrm{ObjectClass}_{Im_{AB}}(o) \in Class_{Tm_{AB}}$.

    Similarly, if $o \in Object_{Im_B} \setminus Object_{Im_A}$, then $\mathrm{ObjectClass}_{Im_{AB}}(o) \in Class_{Tm_{AB}}$.

    If $o \in Object_{Im_A} \cap Object_{Im_B}$, then $\mathrm{ObjectClass}_{Im_{A}}(o) = \mathrm{ObjectClass}_{Im_{B}}(o)$ by assumption. Therefore $\mathrm{ObjectClass}_{Im_{AB}}(o) \in Class_{Tm_{AB}}$.

    \item For each object $o$, $\mathrm{ObjectId}_{Im_{AB}}(o)$ must be an element of $Name$.

    If $o \in Object_{Im_A} \setminus Object_{Im_B}$, then $\mathrm{ObjectId}_{Im_{AB}}(o) \in Name$.

    Similarly, if $o \in Object_{Im_B} \setminus Object_{Im_A}$, then $\mathrm{ObjectId}_{Im_{AB}}(o) \in Name$.

    If $o \in Object_{Im_A} \cap Object_{Im_B}$, then $\mathrm{ObjectId}_{Im_{A}}(o) = \mathrm{ObjectId}_{Im_{B}}(o)$ by assumption. Therefore $\mathrm{ObjectId}_{Im_{AB}}(o) \in Name$.

    \item For each object $o$, and $f \in \mathrm{fields}_{Tm_{AB}}(\mathrm{ObjectClass}_{Im_{AB}}(o))$, $\mathrm{FieldValue}_{Im_{AB}}(( o, f ))$ must be an element of $Value_{Im_{AB}}$.

    First, note that $Value_{Im_A} \cup Value_{Im_B} \subseteq Value_{Im_{AB}}$\\(see \isabelleref{imod_combine_value}{Ecore.Instance_Model_Combination}).

    If $o \in Object_{Im_A} \setminus Object_{Im_B}$, then $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$ and, therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) \in Value_{Im_{AB}}$.

        \item If $f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then by assumption, $f \in Object_{Im_B}$. However, $f \not\in Object_{Im_B}$, so this case is invalid.
    \end{itemize}

    If $o \in Object_{Im_B} \setminus Object_{Im_A}$, then $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{B}}(( o, f ))$ and, therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) \in Value_{Im_{AB}}$.

        \item If $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then by assumption, $f \in Object_{Im_A}$. However, $f \not\in Object_{Im_A}$, so this case is invalid.
    \end{itemize}

    If $o \in Object_{Im_A} \cap Object_{Im_B}$, then \\$f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o)) \cap \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$ or $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o)) \cap \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then \\$\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$ and, therefore, \\$\mathrm{FieldValue}_{Im_{AB}}(( o, f )) \in Value_{Im_{AB}}$.

        \item If $f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then by assumption, $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$. Therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{B}}(( o, f ))$ which means that \\$\mathrm{FieldValue}_{Im_{AB}}(( o, f )) \in Value_{Im_{AB}}$.

        \item If $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then by assumption, $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$. Therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$ which means that \\$\mathrm{FieldValue}_{Im_{AB}}(( o, f )) \in Value_{Im_{AB}}$.
    \end{itemize}

    \item For each constant $c$ in $Constant_{Tm_{AB}}$, $\mathrm{DefaultValue}_{Im_{AB}}(c)$ must be an element of $Value_{Im_{AB}}$.

    First, note that $Value_{Im_A} \cup Value_{Im_B} \subseteq Value_{Im_{AB}}$\\(see \isabelleref{imod_combine_value}{Ecore.Instance_Model_Combination}).

    If $c \in Constant_{Tm_A} \setminus Constant_{Tm_B}$, then $\mathrm{DefaultValue}_{Im_{AB}}(c) \in Value_{Im_{AB}}$.

    Similarly, if $c \in Constant_{Tm_B} \setminus Constant_{Tm_A}$, then $\mathrm{DefaultValue}_{Im_{AB}}(c) \in Value_{Im_{AB}}$.

    If $c \in Constant_{Tm_A} \cap Constant_{Tm_B}$, then $\mathrm{DefaultValue}_{Im_{A}}(c) = \mathrm{DefaultValue}_{Im_{B}}(c)$ by assumption. Therefore $\mathrm{DefaultValue}_{Im_{AB}}(c) \in Value_{Im_{AB}}$.
\end{itemize}

\emph{Validity properties}
\begin{itemize}
    \item $\forall (( o, f ), v ) \in \mathrm{FieldValue}_{Im_{AB}}\!: v:_{Im} \mathrm{type}_{Tm_{AB}}(f)$

    If $o \in Object_{Im_A} \setminus Object_{Im_B}$, then $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$. In this case $\mathrm{type}_{Tm_{AB}}(f) = \mathrm{type}_{Tm_{A}}(f)$ because types are preserved by $Tm_{AB}$. Therefore, $v:_{Im} \mathrm{type}_{Tm_{AB}}(f)$.

        \item If $f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then by assumption, $f \in Object_{Im_B}$. However, $f \not\in Object_{Im_B}$, so this case is invalid.
    \end{itemize}

    If $o \in Object_{Im_B} \setminus Object_{Im_A}$, then $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{B}}(( o, f ))$. In this case $\mathrm{type}_{Tm_{AB}}(f) = \mathrm{type}_{Tm_{B}}(f)$ because types are preserved by $Tm_{AB}$. Therefore, $v:_{Im} \mathrm{type}_{Tm_{AB}}(f)$.

        \item If $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then by assumption, $f \in Object_{Im_A}$. However, $f \not\in Object_{Im_A}$, so this case is invalid.
    \end{itemize}

    If $o \in Object_{Im_A} \cap Object_{Im_B}$, then \\$f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o)) \cap \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$ or $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o)) \cap \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then \\$\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$. In this case $\mathrm{type}_{Tm_{AB}}(f) = \mathrm{type}_{Tm_{A}}(f)$ because types are preserved by $Tm_{AB}$. Therefore, $v:_{Im} \mathrm{type}_{Tm_{AB}}(f)$.

        \item If $f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then by assumption, $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$. Therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{B}}(( o, f ))$. Furthermore, $\mathrm{type}_{Tm_{AB}}(f) = \mathrm{type}_{Tm_{A}}(f)$ because types are preserved by $Tm_{AB}$. Therefore, $v:_{Im} \mathrm{type}_{Tm_{AB}}(f)$.

        \item If $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then by assumption, $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$. Therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$. Furthermore, $\mathrm{type}_{Tm_{AB}}(f) = \mathrm{type}_{Tm_{A}}(f)$ because types are preserved by $Tm_{AB}$. Therefore, $v:_{Im} \mathrm{type}_{Tm_{AB}}(f)$.
    \end{itemize}

    \item $\forall (( o, f ), v ) \in \mathrm{FieldValue}_{Im_{AB}}\!: \mathrm{validMul}_{Im_{AB}}(v)$.

    If $o \in Object_{Im_A} \setminus Object_{Im_B}$, then $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$. Because $Im_{A}$ is valid, $\mathrm{validMul}_{Im_{A}}(v)$ holds. If the multiplicity is preserved because $f \not\in Field_{Tm_B}$, then $\mathrm{validMul}_{Im_{AB}}(v)$. If the multiplicity is changed because $f \in Field_{Tm_B}$, then $\mathrm{validMul}_{Im_{AB}}(v)$ is proven by assumption.

        \item If $f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then by assumption, $f \in Object_{Im_B}$. However, $f \not\in Object_{Im_B}$, so this case is invalid.
    \end{itemize}

    If $o \in Object_{Im_B} \setminus Object_{Im_A}$, then $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{B}}(( o, f ))$. Because $Im_{B}$ is valid, $\mathrm{validMul}_{Im_{B}}(v)$ holds. If the multiplicity is preserved because $f \not\in Field_{Tm_A}$, then $\mathrm{validMul}_{Im_{AB}}(v)$. If the multiplicity is changed because $f \in Field_{Tm_A}$, then $\mathrm{validMul}_{Im_{AB}}(v)$ is proven by assumption.

        \item If $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then by assumption, $f \in Object_{Im_A}$. However, $f \not\in Object_{Im_A}$, so this case is invalid.
    \end{itemize}

    If $o \in Object_{Im_A} \cap Object_{Im_B}$, then \\$f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o)) \cap \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$ or \\$f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$ or $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$.

    \begin{itemize}
        \item If $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o)) \cap \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then \\$\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$. In this case $\mathrm{validMul}_{Im_{AB}}(v)$ is proven by assumption since the multiplicity of $f$ has been combined into a new multiplicity.

        \item If $f \not\in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$, then by assumption, $f \in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$. Therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{B}}(( o, f ))$. Furthermore, because $Im_{B}$ is valid, $\mathrm{validMul}_{Im_{B}}(v)$ holds. If the multiplicity is preserved because $f \not\in Field_{Tm_A}$, then $\mathrm{validMul}_{Im_{AB}}(v)$. If the multiplicity is changed because $f \in Field_{Tm_A}$, then $\mathrm{validMul}_{Im_{AB}}(v)$ is proven by assumption.

        \item If $f \not\in \mathrm{fields}_{Tm_{B}}(\mathrm{ObjectClass}_{Im_{B}}(o))$, then by assumption, $f \in \mathrm{fields}_{Tm_{A}}(\mathrm{ObjectClass}_{Im_{A}}(o))$. Therefore, $\mathrm{FieldValue}_{Im_{AB}}(( o, f )) = \mathrm{FieldValue}_{Im_{A}}(( o, f ))$. Furthermore, because $Im_{A}$ is valid, $\mathrm{validMul}_{Im_{A}}(v)$ holds. If the multiplicity is preserved because $f \not\in Field_{Tm_B}$, then $\mathrm{validMul}_{Im_{AB}}(v)$. If the multiplicity is changed because $f \in Field_{Tm_B}$, then $\mathrm{validMul}_{Im_{AB}}(v)$ is proven by assumption.
    \end{itemize}

    \item $\forall p \in Prop_{Tm_{AB}}\!: Im \models p$

    Make a case distinction for the different possible properties.
    \begin{itemize}
        \item For $[ \type{abstract}, c ] \in Prop_{Tm_{AB}}$, use the fact that $Tm_{AB}$ is consistent to establish that abstract properties are only copied iff there are no instances of it in the combined instance graph (see \cref{defin:transformation_framework:type_models_and_type_graphs:combining_type_models:prop_combine} for details). Therefore, $Im \models [ \type{abstract}, c ]$.

        \item For $[ \type{containment}, r ] \in Prop_{Tm_{AB}}$, use the assumptions to prove that $Im \models [ \type{containment}, r ]$.

        \item For $[ \type{defaultValue}, f, v ] \in Prop_{Tm_{AB}}$, there is no specific satisfaction formula, therefore $Im \models [ \type{defaultValue}, f, v ]$.

        \item For $[ \type{identity}, c, A ] \in Prop_{Tm_{AB}}$, if the property was copied over from only one of the type models, then $Im \models [ \type{identity}, c, A ]$. This is the case because $c$ could not have been part of the other type model and therefore not occur in its instance models.

        If $[ \type{identity}, c, A ] \in Prop_{Tm_{AB}}$ was present in both type models, then the identity satisfaction formula will be correct for each pair of instances from $Im_{A}$ and each pair of instances from $Im_{B}$. To ensure that it is correct for mixed instance pairs, use the assumption specified. Then establish that $Im \models [ \type{identity}, c, A ]$.

        \item For $[ \type{keyset}, r, A ] \in Prop_{Tm_{AB}}$, it is clear that each value of $r$ in the combined instance graph is either the copied field value from $Im_{A}$ or the copied field value from $Im_{B}$. Since values are preserved, there can be no new objects added to an existing relation. Therefore, $Im \models [ \type{keyset}, r, A ]$.

        \item For $[ \type{opposite}, r, r' ] \in Prop_{Tm_{AB}}$, if the property was copied over from only one of the type models, then $Im \models [ \type{opposite}, r, r' ]$. This is the case because $r$ and $r'$ could not have been part of the other type model and therefore not occur in its instance models.

        If $[ \type{opposite}, r, r' ] \in Prop_{Tm_{AB}}$ was present in both type models, then the opposite satisfaction formula will be correct for each pair of instances from $Im_{A}$ and each pair of instances from $Im_{B}$. To ensure that it is correct for mixed instance pairs, use the assumption specified. Then establish that $Im \models [ \type{opposite}, r, r' ]$.

        \item For $[ \type{readonly}, f ] \in Prop_{Tm_{AB}}$, there is no specific satisfaction formula, therefore $Im \models [ \type{readonly}, f ]$.
    \end{itemize}

    \item $\forall c \in Constant_{Tm_{AB}}\!: \mathrm{DefaultValue}_{Im_{AB}}(c):_{Im_{AB}} \mathrm{ConstType}_{Tm_{AB}}(c)$.

    If $c \in Constant_{Tm_A} \setminus Constant_{Tm_B}$, then $\mathrm{DefaultValue}_{Im_{AB}}(c) = \mathrm{DefaultValue}_{Im_{A}}(c)$. Furthermore, $\mathrm{ConstType}_{Tm_{AB}}(c) = \mathrm{ConstType}_{Tm_{A}}(c)$. Therefore, \\$\mathrm{DefaultValue}_{Im_{AB}}(c):_{Im_{AB}} \mathrm{ConstType}_{Tm_{AB}}(c)$.

    Similarly, if $c \in Constant_{Tm_B} \setminus Constant_{Tm_A}$, then $\mathrm{DefaultValue}_{Im_{AB}}(c) = \mathrm{DefaultValue}_{Im_{B}}(c)$. Furthermore, $\mathrm{ConstType}_{Tm_{AB}}(c) = \mathrm{ConstType}_{Tm_{B}}(c)$. Therefore, \\$\mathrm{DefaultValue}_{Im_{AB}}(c):_{Im_{AB}} \mathrm{ConstType}_{Tm_{AB}}(c)$.

    If $c \in Constant_{Tm_A} \cap Constant_{Tm_B}$, then $\mathrm{DefaultValue}_{Im_{A}}(c) = \mathrm{DefaultValue}_{Im_{B}}(c)$ by assumption. Furthermore, $\mathrm{ConstType}_{Tm_{A}}(c) = \mathrm{ConstType}_{Tm_{B}}(c)$, since $Tm_{AB}$ is consistent. Therefore, $\mathrm{DefaultValue}_{Im_{AB}}(c):_{Im_{AB}} \mathrm{ConstType}_{Tm_{AB}}(c)$.

    \item $Tm_{AB}$ is consistent, as defined in \cref{defin:formalisations:ecore_formalisation:type_models:type_model_consistency}.

    This is specified to be true by assumption.
\end{itemize}

The proofs of all these individual properties complete the entire proof.
\end{proof}

As explained before, \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_correct} does not take into account that the instance models are supposed to be distinct except for a set of objects. Furthermore, it does not take into account that the corresponding type models are supposed to be distinct except for a set of types. The following lemma is an alternation of the previous theorem, which takes these properties into account.

\begin{lem}[Consistency of the combination (mostly) distinct of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_merge_correct}
Assume that $Im_A$ and $Im_B$ are valid instance models in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}. Assume that $Im_A$ is typed by type model $Tm_A$. Furthermore, assume that $Im_B$ is typed by type model $Tm_B$. $Tm_A$ and $Tm_B$ are consistent by definition. Also assume that $Tm_{AB} = \mathrm{combine}(Tm_A, Tm_B)$ is consistent in the sense of \cref{defin:formalisations:ecore_formalisation:type_models:type_model_consistency}. Moreover, assume that $Tm_{A}$ and $Tm_{B}$ are entirely distinct except for a set of types $T$. Also assume that $Im_{A}$ and $Im_{B}$ are entirely distinct except for a set of objects $O$. Finally, assume the following properties:
\begin{itemize}
    \item For all shared objects, the object class must be the same in both instance models: $\forall o \in Object_{Im_A} \cap Object_{Im_B}\!: \mathrm{ObjectClass}_{Im_A}(o) = \mathrm{ObjectClass}_{Im_B}(o)$.
    \item For all shared objects, the object id must be the same in both instance models: $\forall o \in Object_{Im_A} \cap Object_{Im_B}\!: \mathrm{ObjectId}_{Im_A}(o) = \mathrm{ObjectId}_{Im_B}(o)$.
    \item For all shared constants within the corresponding type graphs, the default value must be the same in both instance models: $\forall c \in Constant_{Tm_A} \cap Constant_{Tm_B}\!:$\\$\mathrm{DefaultValue}_{Im_A}(c) = \mathrm{DefaultValue}_{Im_B}(c)$.
    \item The identifiers must be unique across both instance models: $\forall o_1 \in Object_{Im_A} \setminus Object_{Im_B} \land o_2 \in Object_{Im_B} \setminus Object_{Im_A}\!: \mathrm{ObjectId}_{Im_A}(o_1) = \mathrm{ObjectId}_{Im_B}(o_2) \implies o_1 = o_2$.
    \item If an object needs a field value in the combination of $Im_A$ and $Im_B$, but this field value is not set in $Im_A$, then it must be set in $Im_B$:
    $\forall o \in Object_{Im_A} \land f \not\in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))\!:
    f \in \mathrm{fields}_{Tm_{AB}}(\mathrm{ObjectClass}_{\mathrm{combine}(Im_A, Im_B)}(o)) \implies$\\$
    o \in Object_{Im_B} \land f \in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))$.
    \item If an object needs a field value in the combination of $Im_A$ and $Im_B$, but this field value is not set in $Im_B$, then it must be set in $Im_A$:
    $\forall o \in Object_{Im_B} \land f \not\in \mathrm{fields}_{Tm_B}(\mathrm{ObjectClass}_{Im_B}(o))\!:
    f \in \mathrm{fields}_{Tm_{AB}}(\mathrm{ObjectClass}_{\mathrm{combine}(Im_A, Im_B)}(o)) \implies$\\$
    o \in Object_{Im_A} \land f \in \mathrm{fields}_{Tm_A}(\mathrm{ObjectClass}_{Im_A}(o))$.
    \item If there exists a containment property in $Tm_{AB}$, the satisfaction formula for containment properties must be satisfied: $\forall o \in Object_{Im_A} \cup Object_{Im_B}\!:$\\$\big|\big\{ \big( ( f\!o, f\!\!f ), f\!v \big) \mid \big( ( f\!o, f\!\!f ), fv \big) \in \mathrm{FieldValue}_{\mathrm{combine}(Im_A, Im_B)} \land [ \type{obj}, o ] = f\!v \land f\!\!f \in CR_{Tm_{AB}} \big\}\big| \leq 1$
    \item There may be no cycles in the containment edges of the combined instance model: $\big\{ (f\!o, f\!v) \mid \big( ( f\!o, f\!\!f ), f\!v \big) \in \mathrm{FieldValue}_{\mathrm{combine}(Im_A, Im_B)} \land f\!\!f \in CR_{Tm_{AB}} \big\}$ is acyclic.
\end{itemize}

Then $\mathrm{combine}(Im_A, Im_B)$ is a valid instance model in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}.
\isabellelref{imod_combine_merge_correct}{Ecore.Instance_Model_Combination}
\end{lem}

\begin{proof}
Use \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_correct} to show that $\mathrm{combine}(Im_A, Im_B)$ is a consistent type model. Use the assumptions given. Some assumptions of \cref{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:imod_combine_correct} become irrelevant because $Im_A$ and $Im_B$ are mostly distinct.
\end{proof}

Finally, the concept of compatibility between two instance models is defined.

\begin{defin}[Compatibility of instance models]
\label{defin:transformation_framework:instance_models_and_instance_graphs:combining_instance_models:compatibility}
Assume instance models $Im_A$ and $Im_B$. We say that $Im_A$ is compatible with $Im_B$ if  $\mathrm{combine}(Im_A, Im_B)$ is a valid instance model in the sense of \cref{defin:formalisations:ecore_formalisation:instance_models:model_validity}.
\end{defin}

The notion of compatibility will be used later as a way to denote instance models that can be combined with other instance models without loss of validity.


% !TEX root = ../summary_jonah.tex
% !TEX program = xelatex
% !TEX encoding = utf8
% !TEX spellcheck = en_UK

\section{Introduction to the Standard Model}\label{sm-basics}
The Standard Model (SM) of particle physics presents one of the key achievements of modern day particle physics and provides a variety of phenomenological predictions that are experimentally verifiable to high accuracy.
%%% MORE MORE MORE %%%
The SM gauge group is given by
\begin{align}\label{gsm}
  \gsm&=\su(3)_C\times\su(2)_T\times\un(1)_Y,
\end{align}
where each group factor corresponds to a specific kind of interaction in the model.
The field content of the SM is given by the scalar doublet $\phi$, the gauge vectors $B^\mu$, $W_k^\mu$, $\mathcal{A}_a^\mu$, and three generations of left-handed\footnote{Right-handed fermions can be acommodated for by making use of charge conjugation.} Weyl fermions $\psi_f$~\cite{arthur, pdg}.

\noindent All these fields transform in their respective $\gsm$-representations as can be seen in tab.\,\ref{sm-fields}.
\begin{table}[H]\centering
\caption{Field content of the standard model. For the sake of simplicity generational indices are supressed.\label{sm-fields}}
\begin{tabular}{ccc}
field& spin& representation\\
$\phi$&$0$&$\rep{1}{2}{\frac12}$\\
$q_L$&$\sfrac12$&$\rep{3}{2}{\frac16}$\\
$u_R^c$&$\sfrac12$&$\rep{3}{1}{-\frac23}$\\
$d_R^c$&$\sfrac12$&$\rep{3}{1}{\frac13}$\\
$\ell_L$&$\sfrac12$&$\rep{1}{2}{-\frac12}$\\
$e_R^c$&$\sfrac12$&$\rep{1}{1}{1}$\\
$B^\mu$&$1$&$\rep{1}{1}{0}$\\
$W_k^\mu$&$1$&$\rep{1}{3}{0}$\\
$\mathcal{A}_a^\mu$&$1$&$\rep{8}{1}{0}$
\end{tabular}
\end{table}
The $\su(2)$-doublets can be identified with the familiar fields as:
\begin{align}
\phi=\vect{\phi_+\\\phi_0},\quad\quad q_L=\vect{u_L\\d_L},\quad\quad\ell_L=\vect{\nu_L\\e_L}.
\end{align}
After electroweak symmetry breaking, the electric charge is
\begin{align}
Q&=Y+T_3,
\end{align}
so that the well-known particle spectrum of the SM is recovered~\cite{arthur, pdg}.

\noindent From a theoretical perspective the gauge group in eq.\ \eqref{gsm} is rather unattractive because of its cumbersome structure and the appearance of several distinct and seemingly unrelated representations from which the fields emerge. Theories with simpler gauge groups and fields transforming in fewer representations, would be more appealing if their phenomenology could be broken down to the SM in some suitable low-energy limit. In the literature many such models are discussed, with the \textsc{Georgi-Glashow} model being pivotal in understanding how the SM-representations may originate. Here, $\gsm$ is embedded in the simple group $\su(5)$ and the SM-fields fit neatly into the representations:
\begin{align}
  \mathbf{5}&=\rep{3}{1}{-\frac13}\oplus\rep{1}{2}{\frac12}\\
  \mathbf{10}&=\rep{3}{2}{\frac16}\oplus\crep{3}{1}{-\frac23}\oplus\rep{1}{1}{1}\\
  \mathbf{24}&=\rep{8}{1}{0}\oplus\rep{1}{3}{0}\oplus\rep{1}{1}{0}\oplus\rep{3}{2}{-\frac53}\oplus\crep{3}{2}{\frac53}.
\end{align}
Nevertheless, there are some impediments damping this rather promising result, most strikingly the existance of other fields transforming in the residual representations, which could lead to proton decay and other unwanted processes~\cite{su5}.
From there, one can go higher and embed $\gsm$, using the $\su(5)$-unification scheme, in higher-dimensional symmetry groups. This could lead to a breaking chain \mbox{$E_8\!\to\!E_7\!\to\!E_6\!\to\!\operatorname{SO}(10)\!\to\!\su(5)\!\to\!\gsm$} motivated by symmetries in current candidates for a Theory of Everything like String Theory~\cite{arthur, pdg, ramond}.

\noindent As expected from gauge theories, the dynamical terms in the SM are constructed out of the field strength tensors, which in turn are obtained from the commutator of their covariant derivatives \mbox{$F^{(i)}_{\mu\nu}\propto[D^{(i)}_\mu, D^{(i)}_\nu]$}:
\begin{align}
  \lsm&\supset\frac1{2g_i^2}\tr\left[F^{(i)}_{\mu\nu}F^{(i)\mu\nu}\right].
\end{align}
Here, the trace is performed over gauge indices and normalised to $\sfrac12$ in the $\un(1)$-case. The gauge sector thus is determined by the gauge couplings $g_i$.\footnote{Usually, the couplings $g_1$, $g_2$, $g_3$ are called $g'$, $g$, and $g_\mathrm{s}$.}
 Furthermore, for $\su(3)$ there exist nontrivial gauge transformations related to the fundamental group structure which can not be removed by suitable redefinitions of the fields. These terms are quantified by a parameter $\theta_\mathrm{QCD}$ and contribute a term:
\begin{align}
\lsm&\supset\frac{g_\mathrm{s}^2\theta_\mathrm{QCD}}{16\pi^2}\epsilon^{\mu\nu\rho\sigma}\tr\left[F^{(3)}_{\mu\nu}F^{(3)}_{\rho\sigma}\right].
\end{align}
Generally, this term will lead to CP-violation in the strong sector, thus making it favourable to set $\theta_\mathrm{QCD}=0$. The effect of a nonzero $\theta_\mathrm{QCD}$ could be measured as an electric dipole moment for the neutron which is heavily supressed by observation constituting the \textit{strong CP-problem}~\cite{arthur, pdg}. Many solutions to this problem are proposed in the literature, a famous example being the \textsc{Peccei-Quinn} proposal promoting $\theta_\mathrm{QCD}$ to a dynamical field~\cite{pq, pq-2}.

\noindent The fermionic fields receive their usual kinetic terms constructed with the covariant derivative in the relevant representation.
\begin{align}
  \lsm&\supset\bar{\psi}_i\imag\slashed{D}\psi_i\\
  D_\mu&=\partial_\mu-\imag qA^k_\mu\mathcal{R}(T_k).
\end{align}
For reasons of notational brevity the internal index structure of the fields will be supressed in the following, with exception of the cases where certain caveats must be considered~\cite{arthur, pdg}.

\noindent The terms in the Higgs sector are given in the form of a scalar kinetic term, the quartic potential, and the Yukawa couplings to the fermions:
\begin{align}
  \lsm\supset-\left(D^\mu\phi\right)^\dagger\left(D_\mu\phi\right)+\mu\phi^\dagger\phi-\lambda\left(\phi^\dagger\phi\right)^2-\left(\lambda^\psi\left[\bar{\psi}\phi\psi\right]_\numb{1}+\hc\right).
\end{align}
The square brackets denote that the contractions of the gauge indices are performed in a gauge invariant way. This will imply that the left-handed fermionic weak isospin doublets are contracted with the Higgs doublet while potentially remaining colour indices are contracted with the right-handed fermion field such, that the whole term couples left- and right-handed fields together, leading to the behaviour expected from a mass term.
For our three types of massive fermions (up/down-type quarks and charged leptons) the singlets constructible with $\phi$ look like
\begin{align}
\lsm&\supset-\lambda^u\left[\bar{q}_L\tilde{\phi}u_R\right]_\numb{1}-\lambda^d\left[\bar{q}_L\phi d_R\right]_\numb{1}-\lambda^e\left[\bar{\ell}_L\phi e_R\right]_\numb{1}+\hc
\end{align}
Here, the conjugated field $\tilde{\phi}^\alpha=\epsilon^{\alpha\beta}\phi^*_\beta$ was used to generate masses for the up-type quarks. This will be one of the reasons why an additional Higgs doublet is needed in the MSSM \cite{arthur, pdg, peskin, higgs}.

\noindent In its potential the Higgs field acquires a vacuum ecpectation value (VEV) of
\begin{align}
\left\langle\phi_0\right\rangle&=v\equiv\sqrt{\frac\mu{2\lambda}}.
\end{align}
Perturbing with a real scalar $h$ around this VEV will lead to the emergence of a mass for the gauge bosons \mbox{$W^\pm_\mu\propto W^1_\mu\mp\imag W^2_\mu$} and $Z^0_\mu$ as well as a massless photon $A_\mu$ from the mixing of $B_\mu$ and $W^3_\mu$ via the process known as \textit{electroweak symmetry breaking}.
The masses generated are directly related to the respective couplings and the VEV:
\begin{align}
m_h&=2\sqrt{\lambda}v\\
m_f&=v\lambda^f\\
m_W&=\frac{gv}{\sqrt{2}}\\
m_Z&=\sqrt{\frac{g^2+{g'}^2}2}v.
\end{align}
To make matters more complicated, in the SM three families of fermions are present and the Yukawa couplings $\lambda^f$ are promoted to general complex \mbox{$3\!\times\!3$}- matrices $\lambda^f_{ij}$ which can be diagonalised with bi-unitary flavour transformations
\begin{align}
\lambda^f\to V_f^\dagger\lambda^fU_f&=v^{-1}\operatorname{diag}\left(m^{(1)}_f, m^{(2)}_f, m^{(3)}_f\right).
\end{align}
Two of these matrices, $V_u$ and $V_d$, will meet again in the gauge interaction part of the Dirac terms and form the \textsc{Cabibbo-Kobayashi-Maskawa} (CKM) matrix in the quark sector.
On the leptonic side the absence of neutrino masses allows to compensate for these unitary transformations completely~\cite{arthur, pdg}. If right-handed neutrinos would be included, the \textsc{Pontecorvo-Maki-Nakagawa-Sakata} (PMNS) matrix would describe similar effects, although it is – as of today – unknown how neutrinos gain their masses and if they are Dirac or Majorana fermions~\cite{pdg}.

\noindent Given in the form described above, the Standard Model possesses 60 parameters:
Three gauge couplings $g'$, $g$, $g_\mathrm{s}$, and the vacuum angle $\theta_\mathrm{QCD}$ in the pure gauge sector. The Higgs potential contributes the two parameters $\lambda$ and $v$ as well as 54 parameters from the three Yukawa matrices $\lambda^u$, $\lambda^d$, and $\lambda^e$.\\
Not all these parameters are physical and as already emphasised, flavour rotations can be used to remove redundant parameters. This would allow a $\un(3)$-transformation for each fermion field-type \mbox{$\psi\in\{q_L, u_R^c, d_R^c, \ell_L, e_R^c\}$}, but the accidental symmetries related to conservation of baryon number $B$ and the lepton numbers $L_e$, $L_\mu$, and $L_\tau$ can not be used to eliminate parameters.\footnote{At this point it should be noted, that the SM would possess a $\un(3)^5$ flavour symmetry in the absence of mass or Yukawa terms, but their existence breaks this symmetry. Because of this, the symmetry-breaking parameters, e.\ g.\ the Yukawa matrices, can be reduced by the flavour rotations comprising the now broken symmetry. Therefore, unbroken accidental symmetries, like baryon and lepton number phase rotations, can not be used to change parameters in the model.} Thus, only the symmetry $\un(3)^5/\un(1)^4$ remains to remove 41 parameters. Henceforth, the Standard Model without neutrino masses depends on 19 free parameters. Out of these, 14 correspond to real values like couplings and masses, while three describe mixing angles and two give CP-violating phases~\cite{arthur, pdg}.
If neutrino masses were included, together with the PMNS matrix the three neutrino masses would lead to four additional mixing angles and a CP-violating phase. Depending on them being Dirac or Majorana particles, two additional CP-violating phases in the latter case could be present and the SM with massive neutrinos would have 26 or 28 physical parameters~\cite{pdg}.

\section{The Minimal Supersymmetric Standard Model}\label{mssm-basics}
To obtain a minimal supersymmetric extension of the SM, all previous fields are embedded in corresponding chiral (real) superfields $\hat{\Phi}_i$ ($\hat{V}_i$).
Furthermore, it must be taken into account that the Higgsino accompanying the Higgs boson from before – now denoted $H_d$ – introduces a gauge anomaly in the model. To correct for this, a second Higgs doublet, called $H_u$, with opposite charge(s) is needed. In addition, it can be seen that the need for a holomorphic superpotential would forbid the Yukawa term giving masses to the up-type quarks and a new independent field $H_u$ must be included, which takes the position of the previously complex conjugated field $\tilde{\phi}$.
Implementing these considerations leads to the field content of the MSSM depicted in tab.\,\ref{mssm-fields}.
\begin{table}[H]\centering
\caption{Table of MSSM-superfields and their components, from~\cite{pdg}.\label{mssm-fields}}
\bgroup
\def\arraystretch{1.4}
\begin{tabular}{cccl}
  super field& bosonic field& fermionic field& representation\\\hline
  $\hat{V}_8$& $g$& $\tilde{g}$& $\quad\quad\rep{8}{1}{0}$\\
  $\hat{V}$& $W^0$, $W^\pm$& $\tilde{W}^0$, $\tilde{W}^\pm$& $\quad\quad\rep{1}{3}{0}$\\
  $\hat{V}'$& $B$& $\tilde{B}$& $\quad\quad\rep{1}{1}{0}$\\
  $\hat{L}$& $(\tilde{\nu}_L, \tilde{e}_L)$& $(\nu_L, e_L)$& $\quad\quad\rep{1}{2}{-\frac12}$\\
  $\hat{E}^c$& $\tilde{e}_R^c$& $e_R^c$& $\quad\quad\rep{1}{1}{1}$\\
  $\hat{Q}$& $(\tilde{u}_L, \tilde{d}_L)$& $(u_L, d_L)$& $\quad\quad\rep{3}{1}{\frac16}$\\
  $\hat{U}^c$& $\tilde{u}_R^c$& $u_R^c$& $\quad\quad\rep{3}{1}{-\frac23}$\\
  $\hat{D}^c$& $\tilde{d}_R^c$& $d_R^c$& $\quad\quad\rep{3}{1}{\frac13}$\\
  $\hat{H}_u$& $\left(H_u^+, H_u^0\right)$& $\left(\tilde{H}_u^+, \tilde{H}_u^0\right)$& $\quad\quad\rep{1}{2}{\frac12}$\\
  $\hat{H}_d$& $(H_d^0, H_d^-)$& $(\tilde{H}^0_d, \tilde{H}_d^-)$& $\quad\quad\rep{1}{2}{-\frac12}$
\end{tabular}
\egroup
\end{table}
\noindent The Lagrangian of the MSSM is constructed out of SUSY conserving terms and SUSY breaking terms where the latter introduce most of the new parameters~\cite{abc, primer, pdg, arthur, haber}.

\noindent The gauge terms are built straightforwardly, using the appropriately\footnote{For the abelian gauge field the definition could be simplified further to \mbox{$\mathcal{W}_\alpha=-\sfrac14\bar{D}^2D_\alpha\hat{V}$}.} defined field strength super fields
\begin{align}
\mathcal{W}_{i, \alpha}&\equiv-\frac14\bar{D}^2e^{-\hat{V}_i}D_\alpha e^{\hat{V}_i},
\end{align}
in an appropriate gauge.
The internal gauge dynamics are then given by
\begin{align}
  \lmssm\supset&\frac1{2g_i^2}\tr\left[\int\dd^2\theta\mathcal{W}_i^\alpha\mathcal{W}_{i, \alpha}+\hc\right].
\end{align}
The $\theta$-parameter can be included by complexifying\footnote{The key idea would be to go from a real coupling $\sfrac1{2g_i^2}$ to complex \mbox{$\tau\equiv\sfrac{1}{2g_\mathrm{s}^2}-\sfrac{\imag g_\mathrm{s}^2\theta_\mathrm{QCD}}{16\pi^2}$} and respecting $\tau$ in the hermitian conjugates.} the gauge coupling~\cite{lykken, primer, abc}.
The kinetic Kähler terms just become
\begin{align}
  \lmssm\supset&\int\dd^2\theta\dd^2\bar{\theta}\left[\hat{\Phi}^\dagger_ie^{2\hat{V}_i}\hat{\Phi}_i\right]_\numb{1}\\
  \hat{V}_i\equiv&\hat{V}_8^a\mathcal{R}_i(T_a)+\hat{V}^k\mathcal{R}_i(T_k)+Y_i\hat{V}'.
\end{align}
The $D$-terms in the Higgs sector of this potential will lead to the emergence of a quartic term in the effective Higgs potential for the two doublets. This has rather suprising consequences – at least at tree level – for the mass of the lightest Higgs field, but more on this in section~\ref{mssm-details}.
In the MSSM, a quartic coupling of Higgs fields can not be included in the superpotential interaction terms since it would be non-renormalisable~\cite{higgs, haber, pdg}.

\noindent When considering the contributions
\begin{align}
  \lmssm\supset&\int\dd^2\theta W(\hat{\Phi}_i)+\hc
\end{align}
from the superpotential $W$, naïvely all quadratic and cubic terms consisting of holomorphic gauge singlets are allowed leading to
\begin{align}\nonumber
  W=&\lambda_d\left[\hat{H}_d\hat{Q}\hat{D}\right]_\numb{1}+\lambda_e\left[\hat{H}_d\hat{L}\hat{E}\right]_\numb{1}-\lambda_u\left[\hat{H}_u\hat{Q}\hat{U}\right]_\numb{1}+\mu \left[\hat{H}_u\hat{H}_d\right]_\numb{1}\\
  &+a\left[\hat{L}\hat{H}_u\right]_\numb{1}+b\left[\hat{Q}\hat{L}\hat{D}\right]_\numb{1}+c\left[\hat{U}\hat{U}\hat{D}\right]_\numb{1}+d\left[\hat{L}\hat{L}\hat{E}\right]_\numb{1}.
\end{align}
The upper line contains the Yukawa couplings as well as the $\mu$-parameter, which will be the only parameter leading to masses for the Higgsinos.
Unfortunately the terms in the lower line introduce processes, violating baryon and lepton number conservation, and can not be excluded by renormalisability arguments as in the SM. As often, it would be attractive to rely on a suitable symmetry not obeyed by the unwanted terms. A promising candidate for such a symmetry would be the $\un(1)_R$ R-symmetry, transforming component fields differently, but using it continuously would also forbid the $\mu$-term and lead to massless Higgsinos and therefore striking contradiction with experiment. Breaking $\un(1)_R$ down to R-parity $\mathcal{Z}_2$ circumvents this problem and implies the assignment
\begin{align}
R=(-1)^{3(B-L)+2s},
\end{align}
for each component field.\footnote{An equivalent assignment makes use of matter parity \mbox{$P_m=(-1)^{3(B-L)}$}, defined on superfields, which can be seen more easily.}
Restricting to R-parity conservation has the importand consequence that superpartners of the ordinary SM particles can only be produced and annihilated in pairs, implying the existance of a lightest supersymmetric particle (LSP). Being weakly interacting (most probably) massive particles (`WIMPs'), such LSPs are rather attractive aspirants for dark matter particles~\cite{pdg, arthur, primer, abc}.

\noindent In the MSSM, SUSY is broken explicitly and the origin of the breaking terms is not considered. They could originate in a hidden sector, e.\ g.\ via gauge- or gravity-mediation, but in the end both will lead to the inclusion of \textit{soft}\footnote{Soft in this context meaning that the corresponding operators are relevant and therefore have mass dimension strictly below four.} SUSY breaking terms of the form:
\begin{align}\nonumber
  -\mathcal{L}^\mathrm{MSSM}_\mathrm{soft}\supset&\frac12M_i\tilde{\bar{\lambda}}_i\tilde{\lambda}_i+M^2_{\tilde{F}}\tilde{f}^\dagger\tilde{f}\\
  &+m_1^2H_d^\dagger H_d+m_2^2H_u^\dagger H_u+m_{12}^2\left(H_u\cdot H_d+\hc\right)\\\nonumber
  &+T_UH_u\tilde{Q}\tilde{U}+T_DH_d\tilde{Q}\tilde{D}+T_EH_d\tilde{L}\tilde{E}+\hc
\end{align}
The terms in the first line lead to masses and mass differences for the gauginos and sfermions, while the second line contributes to the Higgs potential. Lastly, the third line introduces additional trilinear couplings between the sfermion scalars and the Higgs fields.
Often a parametrisation\footnote{Here, it should be noted that one has to be careful regarding matrix indices, since it is not clear – at least ad hoc – , how the indices of $A_F$, $\lambda_f$, and $T_F$ are related to each other and there are different conventions. Nevertheless, many models simplify the trilinear couplings to be diagonal in the flavour eigenbasis with only scalar $A$-parameters remaining.} $m_{12}^2=\mu B$ (and $T_F=\lambda_f A_F$) is chosen. Therefore, the corresponding terms are called $A$ and $B$-terms~\cite{pdg, arthur, chung, peskin}.

\noindent Having introduced all parameters, the same counting procedure as in the SM can be repeated for the MSSM. The gauge sector contributes four real parameters with $g$, $g'$, $g_\mathrm{s}$, and $\theta_\mathrm{QCD}$, while the superpotential contains the three Yukawa matrices $\lambda_u$, $\lambda_d$, and $\lambda_e$ (each contributing 18 parameters). Two parameters come from the modulus and phase of $\mu$.
Most of the parameters are introduced by the SUSY breaking terms: Three generally complex gaugino masses give rise to six parameters, while the five different hermitian scalar mass matrices introduce nine parameters per matrix, and the Higgs-sector adds $v$, $\beta$, and three trilinear scalar coupling matrices $T_F$ with 18 parameters each.
Using the flavour transformations $\un(3)^5/\un(1)^2$, 43 parameters can be removed. Here, the fixation on lepton number conservation per generation can not be sustained anymore, since many of the additional terms in the MSSM can and will lead to flavour changing processes that were previously supressed strongly in the SM.
Actually, this is not all, since there exist two additional $\un(1)$ transformations that can be exploited to further remove phases from the MSSM: The before-mentioned R-transformations as well as a so called Peccei-Quinn symmetry $\un(1)_\mathrm{PQ}$, which can be used to make the gaugino mass $M_3$ and $\mu$ real~\cite{haber}.
In the end, 45 parameters can be removed from the 169 parameters introduced in the Lagrangian.
Finally, the full MSSM is given by 124 parameters and this full description is called the MSSM-124. Of these 124 parameters, of which 105 originate in the SUSY breaking terms, 39 will be real values like masses and couplings, 39 will be mixing angles, and 45 will correspond to CP-violating phases~\cite{haber, pdg}.

\section{Phenomenological implications of the MSSM}\label{mssm-details}
One striking implication of the MSSM is the structure of the Higgs sector:
The contributions to $V_\mathrm{Higgs}$ come from the $D$-terms in the Kähler potential as well as the soft SUSY breaking terms and lead to a full potential
\begin{align}\nonumber
  V_\mathrm{Higgs}=&\left(m_1^2+|\mu|^2\right)H_d^\dagger H_d+\left(m_2^2+|\mu|^2\right)H_u^\dagger H_u+m_{12}^2\left(H_u\cdot H_d+\hc\right)\\
  &+\frac{g^2+{g'}^2}8\left(H_d^\dagger H_d-H_u^\dagger H_u\right)+\frac12g^2\left|H_d^\dagger H_u\right|^2.
\end{align}
After minimising $V_\mathrm{Higgs}$, both doublets acquire VEVs
\begin{align}
\left\langle H_f^0\right\rangle&=v_f,
\end{align}
which can be related to the previous $v$ via
\begin{align}
v^2=v_u^2+v_d^2.
\end{align}
By convention, an angle $\beta$ is defined between the $v_f$ as
\begin{align}
  \tan\beta&=\frac{v_u}{v_d}.
\end{align}
Since the quartic coupling is given as function of the weak coupling constant, this implies an \textit{upper bound} on the mass of the lightest Higgs boson – at least on tree level – of
\begin{align}
  m^2_h&\le m^2_Z\cos^22\beta.
\end{align}
This bound relaxes at higher loop order where suitable corrections lift this bound as high as $\SI{135}{\GeV}$, removing the contradiction present before~\cite{pdg, higgs, peskin, primer, haber}.

\noindent The most interesting aspects can be found in the particle spectrum:
With its superfields the MSSM gives rise to a luscious landscape of new particles to observe, but the additional fields include many new possibilities for mixing, modifying the expectable spectrum of new particles.
On the SM side of the MSSM, the particle content remains relatively unchanged with exception of the Higgs boson, which is now replaced by additional Higgs bosons coming from the second doublet. The real perturbations of the $H^0_f$ around $v_f$ will mix to form two CP-even scalars denoted by $h^0$ and $H^0$ (capital letter corresponding to larger mass), while their imaginary counterparts form a CP-odd scalar $A^0$ and a neutral Goldstone boson $G^0$, which is later eaten as part of the Higgs mechanism's inner mechanics, giving rise to longitudinal modes and therefore masses for the $W$ and $Z$ bosons. Similarly, the charged components, $H^+_u$ and $H^-_d$, will mix forming two charged Higgs bosons $H^\pm$ and two Goldstone bosons $G^\pm$. In total, the contribution from the additional doublet leads to four new Higgs bosons $H^0$, $H^\pm$, and $A^0$~\cite{higgs, peskin, primer}.
The Higgsinos will mix with the other weakly charged gauginos present.
The neutral Higgsinos $\tilde{H}^0_u$ and $\tilde{H}^0_d$ are now accompanied by the bino $\tilde{B}^0$ and the neutral wino $\tilde{W}^0_3$ so that mixing will be described by a complex \mbox{$4\!\times\!4$}-matrix and result in four neutral physical mass eigenstates, called \textit{neutralinos} and denoted $\tilde{\chi}^0_i$, their index incrementing with increasing mass. Accordingly, the charged winos $\tilde{W}^\pm$ will mix with the charged Higgsinos $\tilde{H}^\pm$ and form two (actually four) chargino states, denoted $\tilde{\chi}^\pm_i$.
Considering the sfermions, the scalar superpartners of the SM-fermions, it must be noted that there are two superpartners per (charged) fermion $f$ (with exception of the neutrinos): One scalar partner for the left-handed component $\tilde{f}_L$, one for the right-handed component $\tilde{f}_R$. Generally, mixing can and will occur between these different fields if they carry the same charges, thus leading to \mbox{$6\!\times\!6$}-mixing for the up/down-type squarks ($\tilde{q}_L$, $\tilde{q}_R$) and the charged sleptons ($\tilde{\ell}_L$, $\tilde{\ell}_R$). For the sneutrinos only \mbox{$3\!\times\!3$}-mixing is present. In the end, only mass eigenstates $\tilde{u}_i$, $\tilde{d}_i$, $\tilde{\ell}_i$, and $\tilde{\nu}_i$ will remain, whose identification with flavour eigenstates will be highly dependent on the parameters at play.
\begin{table}[H]\centering
\caption{Examples for parameter configurations leading to nearly pure gaugino states. Adapted from~\cite{pdg}.\label{gaugino}}
\begin{tabular}{cc}
parameter conditions&$\tilde{\chi}^{0, \pm}_1$\\\hline
$\left|M_1\right|, \left|M_2\right|\lesssim\left|\mu\right|, m_Z$&$\tilde{\gamma}$\\
$\left|M_1\right|, m_Z\lesssim\left|M_2\right|, \left|\mu\right|$&$\tilde{B}$\\
$\left|M_2\right|, m_Z\lesssim\left|M_1\right|, \left|\mu\right|$&$\tilde{W}^{0, \pm}$\\
$\left|\mu\right|, m_Z\lesssim\left|M_1\right|, \left|M_2\right|$&$\tilde{H}^{0, \pm}$
\end{tabular}
\end{table}
\noindent By this it becomes apparent that only very specific configurations in parameter space will lead to a `double-SM'-structure of the MSSM, and the phenomenology depends delicatly on the parameters~\cite{pdg, peskin}. Some examples for such configurations can be found in tab.\,\ref{gaugino}.


%
% @author   Shmish  "shmish90@gmail.com"
% @legal    MIT     "(c) Christopher Schmitt"
%

\documentclass{article}

%
% Document Imports
%

\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{tikz}

%
% Document Configuation
%

\newcommand{\hwAuthor}{Christopher Schmitt}
\newcommand{\hwSubject}{Math 218}
\newcommand{\hwSection}{Section 81}
\newcommand{\hwSemester}{Summer 2019}
\newcommand{\hwAssignment}{Assignment 8}

%
% Document Enviornments
%

\setlength{\headheight}{65pt}
\pagestyle{fancy}
\lhead{\hwAuthor}
\rhead{
  \hwSubject \\
  \hwSection \\
  \hwSemester \\
  \hwAssignment
}

\newenvironment{problem}[1]{
  \nobreak\section*{Problem #1}
}{}

%
% Document Start
%

\begin{document}
  \begin{problem}{1}
    Solve each of the following counting problems, writing your answer as an integer in the standard decimal notation.\par
    In how many ways can a student club that consists of 20 students select 3 students to attend a conference?
    $$\binom{20}{3} = 1140$$

    How many strings of 0s and 1s have length 11 and have exactly eight ones?
    $$\binom{11}{8} = 165$$

    How many strings of 0s and 1s have length 11 and have at most three ones?
    $$2^{11} - 2^{7} = 1920$$

    A donut shop has donuts in six different flavors: chocolate frosted, chocolate creme, glazed, jelly, plain, and Boston creme. The donut shop has an unlimited supply of each flavor. In how many different ways can the donut shop create a box of 18 donuts? Note that the box can include multiple donuts of the same flavor, and that donuts of the same flavor are considered indistinguishable.
    $$\binom{n + r - 1}{r} = \binom{6 + 18 - 1}{18} = \binom{23}{18} = 33649$$

    The donut shop now wants to create a box of 18 donuts, including at least four glazed ones. In how many ways can this be done?
    $$\binom{n + r - 1}{r} = \binom{6 + 14 - 1}{14} = \binom{19}{14} = 11628$$

    The donut shop now wants to create a box of 18 donuts, including at most four glazed ones. In how many ways can this be done?
    $$\binom{6 + 18 - 1}{18} - \binom{6 + 13 - 1}{13}= \binom{23}{18} - \binom{18}{13} = 33649 - 8568 = 25018$$

    The donut shop now wants to create a box of 18 donuts, including exactly four glazed ones. In how many ways can this be done?
    $$1 * \binom{5 + 14 - 1}{14} = \binom{18}{14} = 3060$$

    I want to buy one donut every day from Monday through Friday at the donut shop. In how many ways can this be done?
    $$\binom{n + r - 1}{r} = \binom{6 + 5 - 1}{5} = 252$$

    How many “words” can be formed by rearranging the letters of the word MATHEMATICALLY? The “words” do not have to be actual English words.
    $$\frac{14!}{2! * 3! * 2! * 2!} = 1816214400$$

    Find the coefficient of $x^8y^4$ in the expansion of the binomial $(x + 2y)^{12}$
    $$\binom{12}{4} = 495$$
    $$495(x^8)(2y^4) = 990x^8y^4$$
  \end{problem}

  \begin{problem}{2}
    $$(x + y)^{2k} = \sum_{i=0}^{2k} x^i y^{2k - 1} \binom{2k}{i}$$
    $$(x + y)^{2J + 1} = \sum_{i=0}^{2J + 1} x^i y^{2J} \binom{2J + 1}{i}$$
    Theorem: $$\sum_{0 \le i \le n, n\ odd} \binom{n}{i} = \sum_{0 \le i \le n, n\ even} \binom{n}{i}$$
    $$\sum \binom{2k+1}{i} = \sum \binom{2j}{i}$$
    $$?$$
  \end{problem}
\end{document}