% This file contains the content for a main section
\newpage
\regularsectionformat
%% Modify below this line %%
\chapter{Derivation of CIE chromaticity coordinates}
\label{chap:dervation}

The CIE xy chromaticity coordinates of the ACES white point are specified in SMPTE ST 2065-1:2012 as $x=0.32168$ $y=0.33767$ \cite{SMPTE20651}. The ACES white point chromaticity coordinates are derived using the following procedure:

\begin{enumerate}
    \item Calculate the CIE Daylight spectral power distribution for a Correlated Color Temperature (CCT) of \SI[mode=text]{6000}{\kelvin} over the wavelength intervals \SI[mode=text]{300}{\nm} to \SI[mode=text]{830}{\nm} in \SI[mode=text]{1}{\nm} increments as specified in CIE 15:2004 Section 3.1 \cite{CIE152004}
    \item Calculate the CIE 1931 XYZ tristimulus values of the spectral power distribution as specified in CIE 15:2004 Section 7.1 \cite{CIE152004}
    \item Convert the CIE XYZ values to CIE xy chromaticity coordinates as specified in CIE 15:2004 Section 7.3 \cite{CIE152004}
    \item Round the CIE xy chromaticity coordinates to 5 decimal places
\end{enumerate}

An implementation of the procedure described above can be found at: \\ \url{https://github.com/ampas/aces-dev/tree/master/documents/python/TB-2018-001/aces_wp.py}


\section{Introduction}
\label{sec:Introduction}
In this section, the developer of an ExternalModel plugin in RAVEN ( \cite{RAVEN} and \cite{RAVENtheoryMan}) should
report a brief description of what the plugin is intended to do.

\subsection{Example Plugin: SumOfExponential}
 In order to show how to develop a plugin, a simple Model that performs a summation
 of exponential (over time (or any monotonic variable)) has been developed:
 \newline
 \begin{math}
        Xi(t)=\sum_{i=1}^{n} coef_i*e^{var_i*t}
  \end{math}
  \newline
 where:
 \begin{itemize}
    \item $var_i$ is the $i-th$ variable (sampled by RAVEN). It is used as exponent of the
            $exp$ function
   \item $coef_i$ is the $i-th$  coefficient for the exponential having as exponent the
            variable $var_i$
   \item $t$ is the independent variable (monotonic variable).
 \end{itemize}


\documentclass[../main.tex]{subfiles}

\begin{document}
\subsection{Optimisation Example: Kruskal's Algorithm}
\begin{exmp}
Suppose you are from a country called Xzghtyta which contains $n$ cities that are currently all isolated from each other.  As the new minister for transport it is your idea to correct this transport issue and to lay a railroad which should connect all the cities of your country. However, you have a budget. Each railway line will cost a certain predefined amount to lay (with no difficulties or unforeseen costs). How will you decide which city-links are the optimal ones to lay rail-tracks on?\\
\indent We will soon see that this can be done  by finding a minimal spanning tree. Which can be found through a greedy algorithm process. A suitable example of this kind of algorithm which should solve our problem is Kruskal's Algorithm\cite{kruskal}, which is detailed below.
\end{exmp}

\begin{algorithm}[H]
\caption{Kruskal's algorithm}\label{kruskal}
Let $G$ be a connected graph with vertex set $V = \{1,...,n\}$ and $\omega:E \longrightarrow \mathbb{R^+}$ a weight function. The edges of $G$ are ordered according to their weight, that is, $E = \{e_1,...,e_m\}$ and $\omega(e_1) \leq ... \leq \omega(e_m).$
\begin{algorithmic}[1]
\Procedure{KRUSKAL}{$G,\omega,T$}
\State $T\gets \emptyset$
\For{$k=1$ to $m$}
	\If{ACYCLIC($T \cup \{e_k\}$)}
	 	\State append $e_k$ to $T$
	\EndIf
\EndFor
\EndProcedure
\end{algorithmic}
\end{algorithm}

This process is very similar to our prior description of the generic greedy algorithm. Although this time, we sort the elements of our edge set from lightest to heaviest. And then we iterate through. At each iteration, we check if the created set created by $T \cup \{e_k\}$ at each iteration remains independent and if so we add $e_k$ to the generated set and if not we ignore that element and move to the next in the list $E.$

For graphs, the process above is equivalent to the following semi-pseudocode. That we make a forest containing just the vertices's of $G;$ and then we iteratively add the desired edges to that forest as long as no cycles are induced in the resulting subgraph of $G.$
\begin{algorithm}
$1)$ Create a graph $F$ containing just the vertices's of $G.$\\
$2)$ Create a set $S = E(G)$; the edge set of $G.$ \\
$3)$ While $S$ is non-empty and $F$ is not yet spanning\\
\hspace{5mm} $3(a)$ Remove an edge with minimum weight from S.\\
\hspace{5mm} $3(b)$ If the removed edge introduces no cycles to $F$\\
\hspace{5mm} then add the edge to $F$\\
\end{algorithm}

In the next sub-section we will prove the correctness of algorithms such as this. It is also notable to mention that Kruskal's algorithm will terminate after exactly $n-1$ iterations, where $n$ is the number of vertices in a graph. This corresponds to \textit{lemma 3.7} which says a spanning tree has exactly $n-1$ edges. Any more edges added at that point will induce a cycle and so kruskal's algorithm terminates.
\end{document}


\section{Decentralized pension}
The decentralized pension is essentially based on the pay-as-you-go system and the
performance principle. The longer a contributor pays into the pension system,
the longer benefits are paid out in old age and the higher the contributions,
the higher the pension payments in old age.

\paragraph{Generic currency unit.} The design of the pension system is not tied to a specific currency unit such as ETH or BTC; instead, it uses the generic currency unit "\textbf{unit}". The unit must be replaced by a specific currency for the concrete implementation.

\paragraph{Periods.} The pension system is divided into periods, which are defined as $P$. Each action within the pension system takes place in a period $P_{p}$. The duration of a period ($P\_Duration$) is freely selectable. Within the following calculations we consider $P\_Duration = 1 month$.

\paragraph{Users.} All users of the pension system are defined as $U$ and individual users are defined as $U_{u}$. Each user has a state $U\_State_{u}$ which can be either \textbf{UC} (Contributor),
\textbf{UP} (Pensioner), or \textbf{UD} (Done).
The initial state of all users is $U\_State_{u} = UC$

\paragraph{Accounts.} The decentralized pension has two accounts: Savings ($W_{savings}$) and Laggards  ($W_{laggarts}$). Contributions and pension payments will be charged using these. The savings account contains the total amount of the managed contributions and is used for the monthly processing of deposits and withdrawals. The laggards account manages a reserve, which is paid to the last generation of the pension system.

\subsection{Payment of contributions}

Contributors can contribute in a period $P_{p}$. The total amount per period and user is defined as $U\_Units_{u,p}$. The total number of periods in which a contributor has paid is defined as $U\_Contrib_{u}$.

\begin{equation}
U\_Contrib_{u} = \sum_{p=0}^{|P|} \begin{cases}
1 & _{if U\_Units_{u,p} > 0} \\
0 & _{otherwise}
\end{cases}
\end{equation}

All contributions of a period $P_{p}$ are credited to the savings account $W_{savings}$.
Entries from contributors who do not have any pension entitlement periods ($U\_Pensionperiods_{u} = 0$) will also be credited to the $W_{laggarts}$ account. Therefore, the sum of $W_{savings}-W_{laggarts}$ will be payed out in each period $P_{p}$ and only parts of $W_{laggarts}$ are used.

\begin{equation}
W_{savings} = W_{savings} + \sum_{u=0}^{|U|} U\_Units_{u,p}
\end{equation}

\begin{dmath}
W_{laggarts} = W_{laggarts} + \sum_{u=0}^{|U|} \begin{cases}
U\_Units_{u,p} & _{if U\_Pensionperiods_{u} = 0} \\
0 & _{otherwise}
\end{cases}
\end{dmath}

\subsubsection{Pension entitlement periods}
The pension entitlement periods ($U\_Pensionperiods_{u}$) determines the number of periods, in which a pension payment is made. The higher the number of contribution periods
$U\_Contrib_{u}$, the higher the number of pension entitlement periods.

To incentivize a large number of contribution periods, a target value ($P\_Target$) is used
for the number of contribution periods.

\begin{equation}
	P\_Target = 40 years \cdot 12 months
\end{equation}

If the number of contribution periods corresponds to the target value, the number of pension entitlement periods should correspond exactly to the target value. If the number of contribution periods below or above the target value, the number of pension entitlement periods are correspondingly disproportionately smaller or larger.

The number of pension entitlement periods is defined as follows:

\begin{equation}
U\_Pensionperiods_{u} = \frac{U\_Contrib_{u}^2}{P\_Target}
\end{equation}

\subsubsection{Decentralized pension points}

For the contributions paid for a period ($U\_Units_{u,p}$), a contributor receives decentralized pension points in the form of decentralized pension tokens ($DPT$). The total number of \gls{dpt} of a contributor at retirement age is used to calculate the amount of the pension payable.

\begin{equation}
U\_Dpt_{u,p} = DPT(u, p)
\end{equation}

\begin{equation}
DPT(u, p) = DPT\_Base(u, p) \cdot DPT\_Bonus(p)
\end{equation}

\paragraph*{Purchasing Power Index:}

The purchasing power index ($PPI$) is calculated at the beginning of each period $P_{p}$ and is defined as $P\_Ppi_{p}$. The $PPI$ is the reference value for a $DPT$ of the corresponding period.

To calculate the $PPI$ of the $P_{p}$ period, the $PPI$ of the previous period $P_{p-1}$ is used.
If the difference between $PPI$ and the average contribution for the period $P_{p-1}$ is greater than 10\%, the $PPI$ of the period $P[n]$ is increased or decreased by 10\% accordingly.
If the average contribution fluctuates sharply, the $PPI$ slowly feeds on the new average and large jumps are avoided.

\begin{equation}
P\_Units_{p} = avg(\sum_{u=0}^{|U|} U\_Units_{u,p})
\end{equation}

\begin{equation}
P\_Ppi_{p} = \begin{cases}
P\_Ppi_{p} \cdot 1.1 & _{if P\_Units_{p} \cdot 1.1 > P\_Ppi_{p-1}} \\
P\_Ppi_{p} \cdot 0.9 & _{if P\_Units_{p} \cdot 0.9 < P\_Ppi_{p-1}} \\
P\_Ppi_{p} & _{otherwise}
\end{cases}
\end{equation}

\paragraph*{Decentralized pension points basis:}
The pension points is the ERC20 tokenization of purchasing power in blockchain systems and is an abstraction to purchasing power where the $PPI$ value represents the reference as to how the willingness to pay was present in past periods. For a deposit equal to $PPI$, 1.0 DPT points are credited to the sender. Anything above the $PPI$ value will be credited with a maximum of 2.0 DPT, it is possible to pay more than twice the $PPI$ value. If the $PPI$ value is lower than the $PPI$ value, less DPT will be credited proportionally to the $min$ value.

\begin{dmath}
DPT\_Base(u, p) = \begin{cases}
min(\frac{U\_Units_{u,p}} {P\_Ppi_{p}}, 2)
  & _{if U\_Units_{u,p} > P\_Ppi_{p}} \\
\frac{U\_Units_{u,p} - min} {P\_Ppi_{p} - min}
  & _{if U\_Units_{u,p} < P\_Ppi_{p}} \\
1.0 & _{otherwise}
\end{cases}
\end{dmath}

\paragraph*{Decentralized pension points bonus:}
Up to the period $P\_Bonus = 480$ additional bonus DPT ($DPT\_Bonus$) will be issued to contributors. Bonus DPT are intended to create an incentive for the first users of the pension system and thus reward the users who believed in and invested in the system at an early stage. The concept of Bonus DPT is based on the reduction of mining rewards known from the Bitcoin protocol.

\begin{equation}
DPT\_Bonus(p) = \begin{cases}
1 + \frac{(P\_Bonus - P_{p} + 1)^2}
      {2 \cdot P\_Bonus^2} & _{if P_{p} < P\_Bonus} \\
1 & _{otherwise}
\end{cases}
\end{equation}


%!TEX root=../mythesis.tex
% Chapter Template

\chapter{Multi-similarity Loss} % Main chapter title
\chaptermark{Multi-similarity Loss}  % replace the chapter name with its abbreviated form
\label{ch:multi_similarity}

\section{Method}
\label{sec:multi_similarity_method}

%
In this chapter, we introduce our novel multi-similarity loss for the DPR retriever model.
%
Recall that~\citet{karpukhin2020dense} proposed a negative log-likelihood (NLL) objective function that aimed to maximize the similarity between relevant question-passage pairs while minimizing the similarity of the irrelevant ones, as formulated in Definition~\ref{def:nll}
%
\begin{equation}
\label{eq:nll}
L(q_i, p^{+}_i, p^{-}_{i, 1}, p^{-}_{i, 2}, \ldots, p^{-}_{i, n}) = - \log \frac{e^{\text{sim}(q_i, p^{+}_i)}}{e^{\text{sim}(q_i, p^{+}_i)} + \sum_{j = 1}^{n} e^{\text{sim}(q_i, p^{-}_{i, j})}}
\end{equation}
%
On top of that,~\citet{karpukhin2020dense} proposed the in-batch negative mechanism to take advantage of the computation used in extracting features from other passages within the same batch.
%
Under the in-batch negative settings where we have a batch of $B$ samples, in which each question $q_i$ is associated with one positive passage $p^{+}_i$ and one hard negative passage $p^{-}_i$.
%
We rewrite the question-passage loss function in~\eqref{eq:nll}  with respect to a single sample at index $i$ as
%
\begin{equation}
\label{eq:nll_rewritten}
L^{qp}_i = - \log \frac{e^{\text{sim}(q_i, p^{+}_i)}}{
	\underbrace{
		\vphantom{\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(q_i, p^{+}_j)}}
		e^{\text{sim}(q_i, p^{+}_i)}
	}_{\text{positive}} +
	\underbrace{
		\vphantom{\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(q_i, p^{+}_j)}}
		e^{\text{sim}(q_i, p^{-}_i)}
	}_{\text{hard negative}} +
	\underbrace{
		\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(q_i, p^{+}_j)} +
		\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(q_i, p^{-}_j)}
	}_{\text{in-batch negatives}}
}
\end{equation}
%
We take this direction one step further and propose to reuse the feature extraction computation of both the passages~\emph{and the questions} within the same batch.

%
More specifically, similar to question-passage similarity scores defined in Definition~\ref{def:sim}, we define the question-question similarity and passage-passage similarity scores as
%
\begin{equation}
\text{sim}(q_i, q_j) = \mathbf{v}^{(q_i)\intercal}_{\texttt{[CLS]}} \mathbf{v}^{(q_j)}_{\texttt{[CLS]}} \in \mathbb{R}
\end{equation}
%
and
%
\begin{equation}
\text{sim}(p_i, p_j) = \mathbf{v}^{(p_i)\intercal}_{\texttt{[CLS]}} \mathbf{v}^{(p_j)}_{\texttt{[CLS]}} \in \mathbb{R}
\end{equation}
%
Next, similar to the question-passage NLL function in~\eqref{eq:nll_rewritten}, we define question-question and passage-passage objective functions as
%
\begin{equation}
L^{qq}_i = - \log \frac{e^{\text{sim}(q_i, q_i)}}{
	\underbrace{
		\vphantom{\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(q_i, q_j)}}
		e^{\text{sim}(q_i, q_i)}
	}_{\text{in-batch positive}} +
	\underbrace{
		\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(q_i, q_j)}
	}_{\text{in-batch negatives}}
}
\end{equation}
%
\begin{equation}
%
L^{pp}_i = - \log \frac{e^{\text{sim}(p_i, p_i)}}{
	\underbrace{
		\vphantom{\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(p_i, p_j)}}
		e^{\text{sim}(p_i, p_i)}
	}_{\text{in-batch positive}} +
	\underbrace{
		\sum_{\substack{j = 1 \\ j \neq i}}^{B} e^{\text{sim}(p_i, p_j)}
	}_{\text{in-batch negatives}}
}
\end{equation}
%
where we introduce the notion of~\emph{in-batch positive} as the comparison between a question or passage against itself, which is analogous to the term~\emph{in-batch negative}~\cite{karpukhin2020dense}.
%
Finally, we take the sum of all the question-passage, question-question and passage-passage objective components (hence the name \emph{multi-similarity}) within the same batch as the final loss
%
\begin{equation}
%
L_{\text{multi\_similarity}} = \sum_{i = 1}^{B} L^{qp}_i + \lambda_{qq} \sum_{i = 1}^{B} L^{qq}_i + \lambda_{pp} \sum_{i = 1}^{B} L^{pp}_i
\end{equation}
%
where $\lambda_{qq}$ and $\lambda_{pp}$ are the coefficients of the question-question and passage-passage NLL objective functions, respectively.
%
Not only does this objective function design efficiently reuse computation of both passages and questions, but it also effectively captures all similarity aspects within the same batch while incurring negligible computational overhead.

\section{Experimental Results}
\label{sec:multi_similarity_results}

\begin{table*}[t!]
	\setlength\tabcolsep{5pt}
	\centering
	\small
	\begin{tabular}{llll|cccc}
		\toprule
		\textbf{Architecture} & \textbf{Loss function} & \textbf{$\lambda_{qq}$} & \textbf{$\lambda_{pp}$}
		& Top-1 & Top-5 & Top-20 & Top-100 \\
		\midrule
		\multirow{4}{*}{\shortstack{DPR \\(shared encoders)}} & DPR loss & &
		& \textbf{53.88} & 72.49 & 82.38 & 87.62 \\
		& Multi-similarity loss & 0.1 & 0.1
		& 53.46 & 72.49 & 82.41 & \textbf{87.87} \\
		& Multi-similarity loss & 0.5 & 0.5
		& 53.21 & 72.47 & \textbf{82.44} & 87.76 \\
		& Multi-similarity loss & 0.7 & 0.7
		& 52.96 & \textbf{72.74} & 82.60 & 87.78 \\
		\bottomrule
	\end{tabular}
	\caption[Top-$\{1, 5, 20, 100\}$ retrieval accuracy on the Natural Questions test set of the DPR retriever (shared encoders) with and without multi-similarity loss.]{
		%
		Top-$\{1, 5, 20, 100\}$ retrieval accuracy on the Natural Questions test set of the DPR retriever (shared encoders) with and without multi-similarity loss, calculated as the percentage of top-$k$ retrieved passages that contain the answer.
		%
		The proposed multi-similarity loss mariginally improves over the DPR baseline across different loss coefficients  $\lambda_{qq}$ and $\lambda_{pp}$.
	}

	\label{tab:multi_similarity_results}
\end{table*}

%
We conduct an experiment on NQ following the experimental settings described in~\sref{sec:exp_setup} with a batch size of 24 and different sets of multi-similarity coefficients $\lambda_{qq}$ and $\lambda_{pp}$.
%
The baseline model is taken as the DPR retriever with parameter sharing introduced in~\cref{ch:shared_encoders}.
%
\tref{tab:multi_similarity_results} presents the retrieval recall on the NQ test set.

%
As seen from~\tref{tab:multi_similarity_results}, the multi-similarity objective function produces a marginal improvement to the baseline DPR model with up to 0.27 points gain in performance.
%
Interestingly, we observe that the proposed approach achieves a performance boost with top-$\{5, 20, 100\}$ while slightly degrading top-1 retrieval accuracy.
%
We hypothesize that the multi-similarity loss has a regularization effect~\cite{ioffe2015batch} that enforces the model to be consistent about the similarity between all pairs of texts in the corpus, with the top-1 degradation as a side product.
%
This is evidently shown by the fact that the top-1 retrieval accuracy is decreased as we increase the values of the coefficients of the question-question and passage-passage similarities.
%
Nevertheless, we note that the top-100 retrieval accuracy is the only metric of interest for retriever models as $k=100$ is the actual number of passages to be retrieved during inference.
%
Therefore we conclude that our multi-similarity objective function has a marignal, positive effect on retriever model training.


\section{Evaluation}
\label{sec:Evaluation}
This section contains the evaluation and the graphical representation of the measurements.

\subsection{Slit Apertures}
\label{subsec:Slit}
The angle $\varphi$ was measured indirectly by measuring the distance from the slit aperture to the projection surface and the position of the maxima. All measured values are listed in appendix \ref{sec:Measurements} and the MATLAB code which calculates the angle using equation \ref{eq:angle} is listed in appendix \ref{sec:MATLAB_Angle_Calculation}.
\begin{figure}[H]
	\centering
	\includegraphics[scale=1]{slit}
	\caption{Slit Apertures}
	\label{fig:Slit}
\end{figure}
Figure \ref{fig:Slit} shows the indirectly measured angles $\varphi$ (see table \ref{tab:Slit_Measurements}) at several different orders $m$ and the according linear fit. The black dots were measured with the 40 $\mu$m slit aperture and the red squares were measured with the 100 $\mu$m slit aperture. To create the linear fit, equation \ref{eq:slit_maxima} was used for both slit apertures. The wavelength $\lambda$ was set to its according value (633 nm) and marked as constant.

The parameters of the linear fitted curve are listed in the following table:
\begin{table}[H]
	\centering
	\renewcommand{\arraystretch}{1.3}
	\begin{tabular}{r|c c}
		& \textbf{Slit 40 $\mu$m} & \textbf{Slit 100 $\mu$m} \\
		\hline\hline
		\textbf{Width} $w$ & $(39.41\pm0.10)$ $\mu$m & $(101.26\pm0.14)$ $\mu$m \\
		\textbf{Wavelength} $\lambda$ & \multicolumn{2}{c}{633 nm (constant)}
	\end{tabular}
	\caption{Fit Parameters (Slit Apertures)}
	\label{tab:Slit}
\end{table}
\newpage
\subsection{Anti-Slit Apertures}
\label{subsec:Anti-Slit}
Once again the angle $\varphi$ was measured indirectly by measuring the distance from the anti-slit aperture to the projection surface and the position of the maxima. The measured values are listed in appendix \ref{sec:Measurements} and the MATLAB code used to calculate the angle is again listed in appendix \ref{sec:MATLAB_Angle_Calculation}.
\begin{figure}[H]
	\centering
	\includegraphics[scale=1]{anti-slit}
	\caption{Anti-Slit Apertures}
	\label{fig:Anti-Slit}
\end{figure}
Figure \ref{fig:Anti-Slit} shows the indirectly measured angles $\varphi$ (see table \ref{tab:Anti-Slit_Measurements}) at several different orders $m$ and the according linear fit. The black dots were measured with the 230 $\mu$m anti-slit aperture and the red squares were measured with the 124 $\mu$m anti-slit aperture. To create the linear fit, equation \ref{eq:slit_maxima} was used for both anti-slit apertures. The wavelength $\lambda$ was set to its according value (633 nm) and marked as constant.

The parameters of the linear fitted curve are listed in the following table:
\begin{table}[H]
	\centering
	\renewcommand{\arraystretch}{1.3}
	\begin{tabular}{r|c c}
		& \textbf{Anti-Slit 230 $\mu$m} & \textbf{Anti-Slit 124 $\mu$m} \\
		\hline\hline
		\textbf{Width} $w$ & $(239.10\pm0.34)$ $\mu$m & $(123.39\pm0.08)$ $\mu$m \\
		\textbf{Wavelength} $\lambda$ & \multicolumn{2}{c}{633 nm (constant)}
	\end{tabular}
	\caption{Fit Parameters (Anti-Slit Apertures)}
	\label{tab:Anti-Slit}
\end{table}
\newpage
\subsection{Circular Apertures}
\label{subsec:Circular_Apertures}
The angle $\varphi$ was again measured indirectly by measuring the distance from the circular aperture to the projection surface. However, this time the positions of the minima were measured instead of the maxima. This is due to the lack of an easy equation to relate the maxima created by a circular aperture. The measured values are listed in appendix \ref{sec:Measurements} and the MATLAB code used to calculate the angle is listed in appendix \ref{sec:MATLAB_Angle_Calculation}.
\begin{figure}[H]
	\centering
	\includegraphics[scale=1]{circular_aperture}
	\caption{Circular Apertures}
	\label{fig:Circular_Apertures}
\end{figure}
Figure \ref{fig:Circular_Apertures} shows the indirectly measured angles $\varphi$ of the minima (see table \ref{tab:Circular_Apertures_Measurements}) at the first five Bessel coefficients $c_k$ (see equation \ref{eq:coeffs}) and the according linear fit. The black dots were measured with the 150 $\mu$m circular aperture and the red squares were measured with the 100 $\mu$m circular aperture. To create the linear fit, equation \ref{eq:circular_aperture} was used for both circular apertures. The wavelength $\lambda$ was set to its according value (633 nm) and marked as constant.

The parameters of the linear fitted curve are listed in the following table:
\begin{table}[H]
	\centering
	\renewcommand{\arraystretch}{1.3}
	\begin{tabular}{r|c c}
		& \textbf{Diameter 150 $\mu$m} & \textbf{Diameter 100 $\mu$m} \\
		\hline\hline
		\textbf{Diameter} $d$ & $(151.39\pm0.83)$ $\mu$m & $(101.62\pm0.55)$ $\mu$m \\
		\textbf{Wavelength} $\lambda$ & \multicolumn{2}{c}{633 nm (constant)}
	\end{tabular}
	\caption{Fit Parameters (Circular Apertures)}
	\label{tab:Circular_Apertures}
\end{table}
\newpage
\subsection{Cross-Grid Apertures}
\label{subsec:Cross-Grid}
The angle $\varphi$ was measured indirectly by measuring the distance from the cross-grid aperture to the projection surface and the position of the maxima. All measured values are listed in appendix \ref{sec:Measurements} and the MATLAB code which calculates the angle using equation \ref{eq:angle} is listed in appendix \ref{sec:MATLAB_Angle_Calculation}.
\begin{figure}[H]
	\centering
	\includegraphics[scale=1]{cross-grid}
	\caption{Cross-Grid Apertures}
	\label{fig:Cross-Grid}
\end{figure}
Figure \ref{fig:Cross-Grid} shows the indirectly measured angles $\varphi$ (see table \ref{tab:Cross-Grid_Measurements}) at several orders $m$ and the according linear fit. The black dots were measured with a cross-grid that has a grid constant of 28 $\mu$m and the red squares were measured with a cross-grid that has a grid constant of 50 $\mu$m. To create the linear fit, equation \ref{eq:cross-grid} was used for both cross-grid apertures. The wavelength $\lambda$ was set to its according value (633 nm) and marked as constant.

The parameters of the linear fitted curve are listed in the following table:
\begin{table}[H]
	\centering
	\renewcommand{\arraystretch}{1.3}
	\begin{tabular}{r|c c}
		& \textbf{Cross-Grid 28 $\mu$m} & \textbf{Cross-Grid 50 $\mu$m} \\
		\hline\hline
		\textbf{Grid Constant} $g$ & $(28.53\pm0.44)$ $\mu$m & $(50.22\pm0.06)$ $\mu$m \\
		\textbf{Wavelength} $\lambda$ & \multicolumn{2}{c}{633 nm (constant)}
	\end{tabular}
	\caption{Fit Parameters (Cross-Grid Apertures)}
	\label{tab:Cross-Grid}
\end{table}


%auto-ignore
\providecommand{\MainFolder}{..}
\documentclass[\MainFolder/Text.tex]{subfiles}

\begin{document}

\section{Chern-Simons Maurer-Cartan element} \label{Section:Proof2}
%Proof of Proposition~\ref{Proposition:MCSphere} -

We first recall ribbon graphs and their labelings based on~\cite{Cieliebak2015}.

\begin{Definition}[Ribbon graph]\label{Def:Ribbon}
A \emph{graph} $\Gamma$ is a quadruple $(V,H,\mathcal{V},\mathcal{E})$, where~$V$ is a finite set of vertices, $H$ a finite set of half-edges, $\mathcal{V}: H \rightarrow V$ the ``vertex map'' and $\mathcal{E}: H \rightarrow H$ with $\mathcal{E} \circ \mathcal{E} = \Id$ and without fixed points the ``edge map''. The preimage $\mathcal{E}^{-1}(h_1) = \{h_1, h_2\}$ for some $h_1$, $h_2\in H$ is called an \emph{edge}; the set of edges is denoted by $E$. We assume that the graphs are \emph{connected}, i.e., that for any $\Vert_1$, $\Vert_2 \in V$ there exists a path in $E$ connecting $\Vert_1$ to $\Vert_2$.

A \emph{ribbon graph} is a graph $\Gamma$ together with a free transitive action $\Z_{d(\Vert)}\ \rotatebox[origin=c]{-90}{$\circlearrowright$}\  \mathcal{V}^{-1}(\Vert)$ for every $\Vert\in V$, where $$d(\Vert) \coloneqq \Abs{\mathcal{V}^{-1}(\Vert)} $$
is the \emph{valency of $\Vert$}. We denote by $\Succ: H \rightarrow H$ the bijection induced by $1\in \Z_{d(\Vert)}$ for every $\Vert\in V$.

For a ribbon graph $\Gamma$, consider the set of sequences $(h_n)_{n\in \Z} \subset H$ such that the following conditions holds:
$$ \forall n\in \Z: \quad  h_{n+1}= \begin{cases}
\mathcal{E}(h_n) & n\text{ even,}\\
\Succ(h_n) & n\text{ odd.}
\end{cases}$$
Two such sequences $(h_n)_{n\in \Z}$ and $(h'_n)_{n\in \Z}$ are equivalent if and only if there exist $n_0$, $n'_0 \in \Z$ both even or both odd such that $h_{n_0} = h'_{n_0'}$. An equivalence class $[(h_n)_{n\in \Z}]$ is called a \emph{boundary (or a boundary component) of $\Gamma$.} The set of boundaries of $\Gamma$ is denoted by $\Bdd \Gamma$.

An \emph{IE ribbon graph} is a ribbon graph $\Gamma$ together with the decomposition $V = V_{\mathrm{int}} \sqcup V_{\mathrm{ext}}$ into \emph{internal} and \emph{external vertices} $V_{\mathrm{int}}$ and $V_{\mathrm{ext}}$, respectively, such that $d(\Vert) = 1$ for all $\Vert\in V_{\mathrm{ext}}$. This decomposition induces the decomposition $E = E_{\mathrm{int}} \sqcup E_{\mathrm{ext}}$, where an edge $\Edge$ is internal if it connects two internal vertices and is external otherwise. We allow only graphs with \emph{at least one internal vertex}. We often identify an external vertex with its unique adjacent half-edge or the unique adjacent external edge; we call either of these an \emph{external leg}. For any $\Boundary \in \Bdd \Gamma$, we define the \emph{valency of $\Boundary$} by
$$ s(\Boundary) \coloneqq \Abs{\mathcal{V}(\Boundary) \cap V_{\mathrm{ext}}}, $$
where $\mathcal{V}(\Boundary) = \{\mathcal{V}(h_n) \mid n\in \Z\}$. We also have the free transitive $\Z_{s(\Boundary)}$-action on $\mathcal{V}(\Boundary)\cap V_{\mathrm{ext}}$ mapping $\Vert\in \mathcal{V}(\Boundary) \cap V_{\mathrm{ext}}$ to the next external vertex in the sequence $(\mathcal{V}(h_n))_{n\in\Z}$. We will denote this action by $\mathcal{N}$ again.

We say that an IE ribbon graph $\Gamma$ is \emph{reduced} if $s(\Boundary) \ge 1$ for all $\Boundary\in \Bdd \Gamma$.

The following letters will be used to denote the numerical invariants of a graph:
$$\begin{aligned}
k &\;\,\dots && \text{the number of internal vertices}, \\
s &\;\,\dots && \makebox[\widthof{the number of}]{---\ditto---} \text{ external vertices.}\\
l &\;\,\dots && \makebox[\widthof{the number of}]{---\ditto---}\text{ boundary components,} \\
e &\;\,\dots && \makebox[\widthof{the number of}]{---\ditto---} \text{ internal edges.}
\end{aligned}$$
Moreover, we define the \emph{genus $g\in \N_0$} so that the following \emph{Euler formula} holds:
\begin{equation} \label{Eq:EulerFormula}
 k - e + l = 2 - 2g.
\end{equation}\par
We denote by $\RG_{klg}$ the set of isomorphism classes of connected IE ribbon graphs with fixed $k$, $l$, $g$. We let $\RRG_{klg} \subset \RG_{klg}$ be the subset of reduced graphs. For $m\in \N_0$, we denote by $\RG_{klg}^{(m)} \subset \RG_{klg}$ the set of isomorphism classes of connected IE ribbon graphs with all internal vertices \emph{m-valent}, i.e., with
$$ d(\Vert) = m\quad\text{for all }\Vert\in V_{\mathrm{int}}. $$
The notation $\Gamma \in \RG_{klg}$ means that $\Gamma$ is a representative of an equivalence class $[\Gamma]\in \RG_{klg}$.
\end{Definition}

\begin{Remark}[On ribbon graphs]\phantomsection
\begin{RemarkList}
\item An $m$-valent ribbon graph with $m\ge 2$ has a unique decomposition $V = V_{\mathrm{int}}\sqcup V_{\mathrm{ext}}$, and hence we can omit writing IE.
\item In this text, we will use only reduced ribbon graphs. Non-reduced ribbon graphs may play a role in the extension of the theory of $\dIBL^\PMC(\CycC(\Harm))$ to non-reduced cyclic cochains  or in the weak $\IBLInfty$-theory (see Remarks \ref{Rem:BVForm} and~\ref{Rem:NWG}).\qedhere
\end{RemarkList}
\end{Remark}

\begin{Def}[Labeling] \label{Def:Labeling}
A \emph{labeling} of an IE ribbon graph $\Gamma$ is the triple $L = (L_1,L_2,L_3)$, where $L_i$ have the following meanings:
\begin{itemize}
 \item The symbol $L_1$ represents an ordering of internal vertices ($\eqqcolon L_1^v$), and of boundary components ($\eqqcolon L_1^b$). Given $L_1$, we write $V_{\mathrm{ext}} = \{\Vert_1, \dotsc, \Vert_k\}$, $\Bdd \Gamma = \{\Boundary_1, \dotsc, \Boundary_l\}$ and denote
$$ d_i \coloneqq d(\Vert_i)\quad\text{and}\quad s_j\coloneqq s(\Boundary_j). $$
 \item The symbol $L_2$ represents an ordering and orientation of internal edges. Given $L_2$, we write $E_{\mathrm{int}} = \{\Edge_1, \dotsc, \Edge_e\}$ and $\Edge_i =\{h_{i,1}, h_{i,2}\}$ for $h_{i,1}$, $h_{i,2}\in H$.
 \item The symbol $L_3$ represents an ordering of half-edges at every internal vertex ($\eqqcolon L_3^v$) and of external vertices at every boundary component ($\eqqcolon L_3^b$), both compatible with the \emph{ribbon structure} ($\coloneqq$\,the $\Z_m$-actions). Given $L_3$, we write $\mathcal{V}^{-1}(\Vert) = \{h_{\Vert,1}, \dotsc,h_{\Vert,d(\Vert)} \}$ and $\mathcal{V}(\Boundary) \cap V_{\mathrm{ext}}= \{\Vert_{\Boundary,1},\dotsc,\Vert_{\Boundary,s(\Boundary)}\}$ with $\Succ(h_{\Vert,i}) = h_{\Vert,i+1}$ and $\Succ(\Vert_{\Boundary,j}) = \Vert_{\Boundary,j+1}$ for all $i$, $j$, respectively.
\end{itemize}
We sometimes call $L_i$ \emph{partial labelings} and $L$ a \emph{full labeling}. A ribbon graph $\Gamma$ together with a labeling $L$ is called a \emph{labeled ribbon graph}.
\end{Def}

Given a ribbon graph $\Gamma$, one can construct an oriented surface with boundary~$\Sigma_\Gamma$ --- the thickening of $\Gamma$ --- in the obvious way and a closed oriented surface~$\hat{\Sigma}_\Gamma$ by gluing oriented disks to the oriented boundaries of $\Sigma_\Gamma$. If partial labelings~$L_1$ and~$L_2$ are given, we obtain the following chain complex with oriented chain groups (vector spaces over $\R$):
\begin{equation} \label{Eq:OrientationComplex}
\begin{tikzcd}
C_2\coloneqq \langle \Boundary_1,\dotsc,\Boundary_l \rangle \arrow{r}{\Bdd_2} & C_1\coloneqq \langle \Edge_1,\dotsc, \Edge_e \rangle \arrow{r}{\Bdd_1} &  C_0\coloneqq \langle \Vert_k,\dotsc, \Vert_1 \rangle.
\end{tikzcd}
\end{equation}
Here $\Boundary_i$ stands for the oriented disc glued to the $i$-th boundary component of~$\Sigma_\Gamma$ and now being mapped into $\hat{\Sigma}_\Gamma$, $\Edge_i$ stands for the $1$-simplex in $\hat{\Sigma}_\Gamma$ corresponding to the $i$-th internal edge, $\Vert_i$ stands for the $0$-simplex in $\hat{\Sigma}_\Gamma$ corresponding to the $i$-th internal vertex, and the boundary map $\Bdd$ is the ``geometric'' boundary operator. The homology of this chain complex is isomorphic to the singular homology $\H(\hat{\Sigma})\coloneqq\H(\hat{\Sigma}_\Gamma;\R)$.

The orientation of $C_i$ ($\coloneqq$\,the order of generators in \eqref{Eq:OrientationComplex}) induces naturally an orientation of $\H(\hat{\Sigma}_\Gamma)$. The construction from \cite[Appendix A]{Cieliebak2015} is as follows. We pick complements $H_i$ of $\Im(\Bdd_{i+1})$ in $\Ker(\Bdd_{i})$ and complements $V_i$ of $\Ker(\Bdd_i)$ in $C_i$ and write
$$\begin{tikzcd}
C_2 = V_2 \oplus H_2 \arrow{r}{\Bdd_2} & C_1 = V_1 \oplus H_1 \oplus \Im(\Bdd_2) \arrow{r}{\Bdd_1} & C_0 = \Im(\Bdd_1) \oplus H_0.
\end{tikzcd}$$
We orient $V_i$ arbitrarily and transfer the orientation to $\Im(\Bdd_{i})$ via  $\Bdd_{i} : V_i \overset{\simeq}{\rightarrow} \Im(\Bdd_{i})$. Then, assuming the direct sum orientation, orienting $H_i$ is equivalent to orienting $C_i$, and we obtain the orientation of $\H_i(\hat{\Sigma}_\Gamma)$ via the canonical projection $\pi: H_i \overset{\simeq}{\rightarrow} \H_i(\hat{\Sigma}_\Gamma) = \Ker(\Bdd_i)/\Im(\Bdd_{i+1})$. This construction does not depend on the choices of complements and orientations of $V_i$.

\begin{Definition}[Compatibility of $L_1$ and $L_2$]\label{Def:CompatLabeling}
Given a ribbon graph $\Gamma$ with partial labelings $L_1$ and $L_2$, we say that \emph{$L_2$ is compatible with $L_1$} if the orientation on $\H(\widehat{\Sigma}_\Gamma)$ induced by \eqref{Eq:OrientationComplex} agrees with the canonical orientation $$\H(\widehat{\Sigma}_\Gamma) =  \langle \Vert_1 + \dotsb + \Vert_k \rangle  \oplus \H_1(\widehat{\Sigma}_\Gamma) \oplus \langle \Boundary_1 + \dotsb + \Boundary_l\rangle, $$
where $\H_1(\widehat{\Sigma}_\Gamma)$ is oriented using the canonical symplectic intersection form.
\end{Definition}

Given a labeled IE ribbon graph $\Gamma$, the set of half-edges adjacent to internal vertices $\mathcal{V}^{-1}(V_{\mathrm{int}})$ can be ordered in two ways corresponding to writing
$$ 2e + (s_1+ \dotsb +s_l) = d_1+ \dotsb +d_k. $$
This leads to the following definition.
\begin{Definition}[Edge order and vertex order]\label{Def:EdgeVertex}
For a labeled IE ribbon graph~$\Gamma$, we define the following two orders on the set of half-edges $H$:
\begin{itemize}
\item \emph{Edge order:} The first $2e$ half-edges $h_{i,j}^{\mathrm{e}}$ are the ones from internal edges; they are ordered according to $L_2$. They are followed by blocks of $s_1$,~$\dotsc$, $s_l$ half-edges $h_{i,j}^{\Boundary}$ which come from the boundary components $i=1$,~$\dotsc$, $l$, respectively, and which are ordered according to $L_3^b$ inside the blocks. Schematically, we have
$$ (h_{1,1}^{\Edge} h_{1,2}^{\Edge})\dots(h_{e,1}^{\Edge} h_{e,2}^{\Edge})(h^{\Boundary}_{1,1}\dots h^{\Boundary}_{1,s_1})\dots(h^{\Boundary}_{l,1}\dots h^{\Boundary}_{l,s_l}). $$
\item \emph{Vertex order:} It consists of blocks of $d_1$,~$\dotsc$, $d_k$ half-edges $h_{i,j}^{\Vert}$ which come from internal vertices $1$,~$\dotsc$, $k$, and which are ordered according to $L_3^v$ inside the blocks. Schematically, we have
$$ (h_{1,1}^{\Vert}\dots h_{1,d_1}^{\Vert})\dots (h_{k,1}^{\Vert}\dots h_{k,d_k}^{\Vert}). $$
\end{itemize}

	We denote by $\sigma_L \in \Perm_{\Abs{H}}$ the \emph{permutation from the edge to the vertex order} which is constructed such that the $i$-th half-edge in the edge order is the same as the $\sigma_L(i)$-th half-edge in the vertex order.
\end{Definition}

From now on, we will consider only reduced trivalent ribbon graphs $\TRRG_{klg}$ with $k$, $l \ge 1$, $g\ge 0$. We will often use the equation
\begin{equation} \label{Eq:TrivalentFormula}
2e + s = 3k.
\end{equation}

\begin{Def}[Chern-Simons Maurer-Cartan element]
%\marginnote{Make reasoning why the integrals are well defined, i.e. why the product of $L^1$ Hodge propagators is again $L^1$?}
\label{Def:PushforwardMCdeRham}
Let $M$ be an oriented closed Riemannian manifold, and let $\Prpg \in \DR^{n-1}(\Bl_\Diag(M\times M))$ be an admissible Hodge propagator from Definition~\ref{Def:GreenKernel}. The \emph{Chern-Simons Maurer-Cartan element $\PMC$}, or \emph{formal pushforward Maurer-Cartan element}, is the collection of
$$ \PMC_{lg}\in \hat{\Ext}_l \CycC(\Harm(M))\quad\text{for all }l\ge 1, g\ge 0 $$
defined on generating words $\omega_i = \alpha_{i1} \dots \alpha_{is_i}\in \BCyc \Harm(M)$, where $\alpha_{ij} = \SuspU \eta_{ij}$ with $\eta_{ij}\in \Harm(M)$ for $s_i\ge 1$ and $i=1, \ldots, l$,
%with homogenous $\alpha_{ij} = \Susp \eta_{ij} \in \Harm(M)[1]$
by the formula
\begin{equation}
\label{Eq:PushforwardMCdeRham}
\begin{aligned}
& \PMC_{lg}(\Susp^{l} \omega_1 \otimes \dotsb \otimes \omega_l) \\
& \qquad \coloneqq \frac{1}{l!}\sum_{[\Gamma]\in \TRRG_{klg}} \frac{1}{\Abs{\Aut(\Gamma)}} (-1)^{s(k,l) + P(\omega)} \sum_{L_1,\,L_3^b} (-1)^{\sigma_L} I(\sigma_L),
\end{aligned}
\end{equation}
which we explain as follows:
\begin{itemize}
\item %The first sum is over all isomorphism classes of trivalent ribbon graphs $[\Gamma]$.
The second sum is over all partial labelings $L_1$ and $L_3^b$ of a representative~$\Gamma$ of~$[\Gamma]$. In every summand, we complete $L_1$ and $L_3^b$  to a full labeling $L = (L_1, L_2, L_3)$ by picking an arbitrary $L_3^v$ and an arbitrary $L_2$ compatible with $L_1$.

\item Suppose that $\Gamma$ and $L_1$ are \emph{admissible} with respect to the input $\omega_1$, $\dotsc$, $\omega_l$; this means that $\Gamma$ has $l$ boundary components and that the $i$-th boundary component has valency $s_i$ for every $i=1$, $\dotsc$, $l$. In this case, denoting $\sigma = \sigma_L$, we define
\begin{equation} \label{Eq:ISigma}
I(\sigma_L) \coloneqq \begin{multlined}[t]\int_{x_1,\dotsc,x_k} \Prpg(x_{\xi(\sigma_1)},x_{\xi(\sigma_2)}) \dotsm \Prpg(x_{\xi(\sigma_{2e-1})},x_{\xi(\sigma_{2e})}) \\ \eta_{11}(x_{\xi(\sigma_{2e+1})}) \dotsm \eta_{ls_{l}}(x_{\xi(\sigma_{2e+s})}),\end{multlined}
\end{equation}
where $\xi: \{1,\dotsc, 3k\} \rightarrow \{1,\dotsc,k\}$ is the function defined by
$$ \xi(3j-2) = \xi(3j-1) = \xi(3j) \coloneqq j $$ for all $j=1, \dotsc, k$, $s = s_1 + \dotsb + s_l$, $\eta_{}(x_i)$ denotes the pullback of $\eta$ along the canonical projection $\pi_i: M^{\times k} \rightarrow M$ to the $i$-th component $M_i$, $\Prpg(x_i, x_j)$ denotes the pullback of $\Prpg$ along $\pi_{i} \times \pi_j : M^{\times k} \rightarrow M_i \times M_j$, and $\int_{x_1,\dotsc,x_k}$ denotes the integral of an $nk$-form over $k$ copies of $M$.

If $\Gamma$ and $L_1$ are not admissible, then we set $I(\sigma_L)\coloneqq 0$.
\item $s(k,l) \coloneqq k + kl(n-1) + \frac{1}{2} k(k-1) n \mod 2$.
\item $P(\omega) \coloneqq  \sum_{i=1}^l \sum_{j=1}^{s_i} (s - s_1 - \dotsb - s_{i-1} - j) \eta_{ij} \mod 2$.
\end{itemize}
\end{Def}
\noindent %The sum is finite using~\eqref{Eq:TrivalentFormula}. The summands are independent of a representant of $[\Gamma]$ and of the choice of $L_3^v$ and an $L_2$ compatible with $L_1$ and the symmetry properties hold.
%Well-definedness is checked in Appendix~\ref{Section:Appendix} for the case when $\Prpg$ is decomposable and can be checked also in the de Rham case.
In order to show that $\PMC_{lg}$ is well-defined and that the collection $(\PMC_{lg})$ satisfies Definition~\ref{Def:MaurerCartan} for $\dIBL(\CycC(\Harm(M)))$, there are several things to check:
\begin{PlainList}
 \item The integral $I(\sigma_L)$ converges.
 \item The sums are finite.
 \item The product $(-1)^{\sigma_L} I(\sigma_L)$ is independent of the choice of $L_3^v$ and $L_2$ compatible with $L_1$.
 \item The sum over labelings is independent of the chosen representative $\Gamma$ in an isomorphism class from $\TRRG_{klg}$.
  \item The map $\PMC_{lg}: \BCyc\Harm(M)[3-n]^{\otimes l} \rightarrow \R$ is graded symmetric on permutations of its inputs $\Susp\omega_i$.
 \item The map $\PMC_{lg}$ is graded symmetric on cyclic permutations of the components $\alpha_{ij}$ of each $\omega_{i}$.
 \item The degree condition 1) from Definition \ref{Def:MaurerCartan} holds with $d = n-3$.
 \item The filtration-degree condition 2) from Definition \ref{Def:MaurerCartan} holds with $\gamma = 2$.
 \item The Maurer-Cartan equation \eqref{Eq:MaurerCartanEquation} holds.
\end{PlainList}

Condition 9) will be proven in~\cite{Cieliebak2018} using the theory of iterated blow-ups.

Condition 1) follows from the property (P1) of a Hodge propagator~ $\Prpg$.
The idea is to associate one integration variable to each internal half-edge, obtaining the space $\{x_i^{(1)},x_i^{(2)},x_i^{(3)}\mid i=1, \dotsc, k\}$, and blowing-up pairs of variables connected by internal edges.
By (P1), the integrand of \eqref{Eq:ISigma} lifts to a smooth form on such a space.
The integral $\int_{x_1 \dotsc x_k}$ is then realized as an integral over the closure of a lift of the subspace $\{x_i^{(1)} = x_i^{(2)} = x_i^{(3)}\}$.
By compactness, the integral converges.
A detailed proof is under preparation in~\cite{Cieliebak2018}.

In this text, \underline{we will take 1) and 9) for granted.}

\begin{Lemma} \label{Lem:MCCond}
Conditions 2) -- 8) hold.
\end{Lemma}
\begin{proof}

As for 2), the fixed input $\omega_1$, $\dotsc$, $\omega_l$ fixes the number $s$ of external vertices of $\Gamma$ by admissibility. Expressing $e$ from~\eqref{Eq:EulerFormula} and plugging it  in~\eqref{Eq:TrivalentFormula} gives
\begin{equation} \label{Eq:MCk}
k = s + 2 l + 4g - 4.
\end{equation}
We see that all parameters are fixed. Now, there is only finitely many elements with fixed $s$ in $\TRRG_{klg}$, and each of them has only finitely many labelings. Therefore, the sums are finite.

As for 3), we have to consider the orientation of the complex~\eqref{Eq:OrientationComplex}. Clearly, if two $L_2$'s are compatible with $L_1$, then they differ by an even number of the following operations: a~transposition of two internal edges or a change of the orientation of an internal edge. The former operation introduces no sign in $(-1)^{\sigma_L}$ but generates the sign $(-1)^{n-1}$ in $I(\sigma_L)$ from swapping the corresponding~$\Prpg$'s. The latter operation induces the sign $-1$ in $(-1)^{\sigma_L}$ and the sign $(-1)^n$ in $I(\sigma_L)$ from the symmetry $\Prpg(x,y) = (-1)^n \Prpg(y,x)$. Because the overall signs in $(-1)^{\sigma_L} I(\sigma_L)$ are the same, an even number of these operations preserves $(-1)^{\sigma_L} I(\sigma_L)$. This implies the independence of an $L_2$ compatible with~$L_1$. A~change in $L_3^v$ produces no sign in $(-1)^{\sigma_L}$ because every internal vertex is trivalent and a cyclic permutation of an odd number of elements is even. The integral $I(\sigma_L)$ remains unchanged because the change in $\sigma_L$ is compensated by the composition with $\xi$. Independence of the choice of $L_3^v$ follows.

As for 4), every isomorphism of ribbon graphs $\Gamma \rightarrow \Gamma'$ induces the bijection $L\mapsto L'$ of compatible labelings such that $\sigma_L = \sigma_{L'}$ ($L'$ is the ``pushforward'' labeling). The independence of the choice of a representative of $[\Gamma]$ follows.

As for 5), let $\mu\in \Perm_l$ be a permutation of the inputs $\Susp \omega_1$, $\dotsc$, $\Susp \omega_l$. The set of graphs which admit an admissible labeling is the same for both $\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \omega_l)$ and $\PMC_{lg}(\Susp^l \omega_{\sigma_{1}^{-1}} \otimes \dotsb \otimes \omega_{\sigma_l^{-1}})$; we will pick one such $\Gamma$ and study the admissible labelings $L$ and $L'$, respectively. We write $\eta_i = \eta_{i1}\dots \eta_{i s_i}$ and $\Omega_i = \Susp \omega_i$ for all $i$, $j$, and denote by $I'(\sigma_{L'})$ the integral in the definition of $\PMC_{lg}(\Susp^l \omega_{\mu_1^{-1}} \otimes \dotsb \otimes \omega_{\mu_l^{-1}})$. Let $\tilde{\mu}\in \Perm_{3k}$ be the permutation which acts as the identity on $1$, $\dotsc$, $2e$ and as the block permutation determined by $\mu$ on $2e + 1$,~$\dotsc$, $2e+s$ divided into $l$ blocks of lengths $s_1$, $\dotsc$, $s_l$. For any $\sigma\in \Perm_{3k}$, we have
$$ \begin{aligned}
I'(\sigma) & = \begin{multlined}[t]\int_{x_1,\dotsc,x_k}\!\! \Prpg(x_{\xi(\sigma_1)},x_{\xi(\sigma_2)}) \dotsm \Prpg(x_{\xi(\sigma_{2e-1})},x_{\xi(\sigma_{2e})}) \\ \eta_{\mu_1^{-1} 1}(x_{\xi(\sigma_{2e+1})}) \dots \eta_{\mu_l^{-1} s_{\mu_l^{-1}}}(x_{\xi(\sigma_{2e+s})})\end{multlined} \\
 & = \begin{multlined}[t]\varepsilon(\mu,\eta) \int_{x_1,\dotsc,x_k} \!\! \Prpg(x_{\xi((\sigma\circ\tilde{\mu})_1)},x_{\xi((\sigma\circ\tilde{\mu})_2)}) \dotsm \Prpg(x_{\xi((\sigma\circ \tilde{\mu})_{2e-1})},x_{\xi((\sigma\circ\tilde{\mu})_{2e})}) \\ \eta_{11}(x_{\xi((\sigma\circ \tilde{\mu})_{2e+1})})\dots  \eta_{ls_l}(x_{\xi((\sigma\circ \tilde{\mu})_{2e+s})})\end{multlined} \\
 & = \varepsilon(\mu,\eta) I(\sigma \circ \tilde{\mu}).
\end{aligned} $$
The precomposition with $\tilde{\mu}$ corresponds to a bijection $(L_1,L_3^b)\mapsto (L_1', {L_3^{b}}')$ of partial labelings for $\PMC_{lg}(\Susp^l \omega_1 \dots \omega_l)$ and $\PMC_{lg}(\Susp^l \omega_{\mu_1^{-1}} \otimes \dotsb \otimes \omega_{\mu_l^{-1}})$, respectively. However, if $L_2$ is compatible with $L_1$, then in order to get an $L_2'$ compatible with $L_1'$, the labeling~$L_2$ has to be altered by as many operations of switching two internal edges or changing the orientation of an internal edge as there are transpositions in $\mu$. We explained in the proof of 3) that this produces the sign $(-1)^{(n-1)\mu}$ in $(-1)^{\sigma_{L'}}I(\sigma_{L'})$. Therefore, after the choice of compatible $L_2$ and~$L_2'$, we have
$$ (-1)^{\sigma_{L'}}I'(\sigma_{L'}) = (-1)^{(n-1)\mu} (-1)^{\tilde{\mu}} \varepsilon(\mu, \eta) (-1)^{\sigma_L} I(\sigma_L). $$
If we view $\eta$ as $\eta_{11} \dots \eta_{l s_l}$, we can understand $(-1)^{P(\omega)}$ as the Koszul sign $\varepsilon(\SuspU, \eta)$. Similarly, we write $(-1)^{P(\mu(\omega))}=\varepsilon(\SuspU,\mu(\eta))$, where we first view $\eta$ as $\eta_1 \otimes \dotsb \otimes \eta_l$ to apply $\mu$ and then as the list of components $\eta_{ij}$ to compute the Koszul sign (this is a little ambiguity in our notation). If we denote by $\widebar{\mu}$ the permutation of $1$, $\dotsc$, $s$ permuting the $l$ blocks of lengths $s_1$, $\dotsc$, $s_l$ according to $\mu$, then $\widebar{\mu}$ has the same sign as $\tilde{\mu}$, and the decomposition of $\varepsilon(\SuspU,\mu(\eta))$ into the moves
$$ \begin{aligned}
\SuspU_{1} \dots \SuspU_{s} \eta_{\mu_1^{-1}1} \dots \eta_{\mu_l^{-1} s_{\mu_l^{-1}}} &\xrightarrow{(1)} \SuspU_{\widebar{\mu}_{1}} \dots \SuspU_{\widebar{\mu}_{s}} \eta_{11} \dots \eta_{l s_l} \xrightarrow{(2)} \SuspU_{\widebar{\mu}_1} \eta_{11} \dots \SuspU_{\widebar{\mu}_s} \eta_{l s_l} \\ &\xrightarrow{(3)} \SuspU_{1} \eta_{\mu_1^{-1}1} \dots \SuspU_{s} \eta_{\mu_l^{-1} s_l} \end{aligned} $$
shows that
$$ (-1)^{P(\mu(\omega))} = \underbrace{(-1)^{\tilde{\mu}}\varepsilon(\mu,\eta)}_{(1)} \underbrace{(-1)^{P(\omega)}}_{(2)}\underbrace{\varepsilon(\mu,\omega)}_{(3)}. $$
Using this, we write
$$ (-1)^{P(\mu(\omega))} (-1)^{\sigma_{L'}} I'(\sigma_{L'}) = \varepsilon(\mu,\omega) (-1)^{(n-1)\mu} (-1)^{P(\omega)}(-1)^{\sigma_L} I(\sigma_L), $$
and compute
$$ \begin{aligned}
& \PMC_{lg}(\Omega_{\mu_1^{-1}} \otimes \dotsb \otimes \Omega_{\mu_l^{-1}}) \\ & \qquad =\varepsilon(\mu(\Susp), \mu(\omega)) \PMC_{lg}(\Susp^l \omega_{\mu_1^{-1}} \otimes \dotsb \otimes \omega_{\mu_l^{-1}}) \\
& \qquad= \varepsilon(\mu(\Susp), \mu(\omega)) (-1)^{\Abs{s}\mu} \varepsilon(\mu,\omega) \PMC_{lg}(\Susp^l \omega_{1} \otimes \dotsb \otimes \omega_{l}) \\
& \qquad= \underbrace{\varepsilon(\mu(\Susp), \mu(\omega))}_{(1)} \underbrace{(-1)^{\Abs{s}\mu} \varepsilon(\mu,\omega)}_{(2)} \underbrace{\varepsilon(\Susp,\omega)}_{(3)} \PMC_{lg}(\Susp\omega_{1} \otimes \dotsb \otimes \Susp \omega_{l}) \\
& \qquad= \varepsilon(\mu,\Omega) \PMC_{lg}(\Omega_{1} \otimes \dotsb \otimes \Omega_{l}).
\end{aligned} $$
We used $\Abs{s} = n-1\text{ mod }2$, and the last equality follows from the decomposition of $\varepsilon(\mu,\Omega)$ into the moves
$$  \begin{multlined} \Susp_1 \omega_1 \dots \Susp_l \omega_l \xrightarrow{(3)} \Susp_1 \dots \Susp_l \omega_1 \dots \omega_l \xrightarrow{(2)} \Susp_{\mu_1^{-1}}\dots \Susp_{\mu_l^{-1}} \omega_{\mu_1^{-1}} \dots \omega_{\mu_l^{-1}} \\ \xrightarrow{(1)} \Susp_{\mu_1^{-1}} \omega_{\mu_1^{-1}} \dots \Susp_{\mu_l^{-1}} \omega_{\mu_l^{-1}}. \end{multlined}$$
This proves the symmetry of $\PMC_{lg}$.

As for 6), fix an $i=1$, $\dotsc$, $l$ and let $\mu\in \Perm_{s_i}$ be a cyclic permutation permuting the components of $\omega_i = \alpha_{i1}\dots \alpha_{is_i}$. Similarly to the previous case, we denote by~$\tilde{\mu}$ the corresponding permutation of $1$, $\dotsc$, $3k$ and get a bijection $(L_1,L_3^b) \mapsto (L_1'=L_1,{L_3^b}')$ of admissible labelings of a given graph $\Gamma$ for $\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \alpha_{i1}\dots \alpha_{is_i} \otimes \dotsb \otimes \omega_l)$ and $\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \alpha_{i\mu_1^{-1}} \dots \alpha_{i\mu_{s_i}^{-1}}\otimes \dotsb \otimes \omega_l)$, respectively. This time, there is no change in $L_1$, and thus we can take $L_2'=L_2$, producing no sign. Therefore, we have
$$ (-1)^{\sigma_{L'}}I'(\sigma_{L'}) = (-1)^{\tilde{\mu}}\varepsilon(\mu,\eta_i)(-1)^{\sigma_{L}}I(\sigma_{L}), $$
where $\varepsilon(\mu,\eta_i)$ comes from permuting the forms in $I'(\sigma_{L'})$. Further, we deduce
$$ (-1)^{P(\mu(\omega))} = (-1)^{\tilde{\mu}} \varepsilon(\mu,\eta_i) (-1)^{P(\omega)} \varepsilon(\mu,\omega_i), $$
and hence
$$ \begin{aligned}
&\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \alpha_{i\mu_1^{-1}} \dots \alpha_{i\mu_{s_i}^{-1}}\otimes \dotsb \otimes \omega_l) \\
&\qquad = \varepsilon(\mu,\omega_i) \PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \alpha_{i1}\dots \alpha_{is_i}\otimes\dotsb\otimes \omega_l ). \end{aligned}$$
This shows the symmetry of $\PMC_{lg}$ on cyclic permutations of the components of~$\omega_i$.

As for 7), suppose that $\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \omega_l) \neq 0$, and let $D$ denote the total form-degree of the input $\eta_{11}$, $\dotsc$, $\eta_{l s_l}\in \Harm(M)$; i.e., we define
\begin{equation*}
 D \coloneqq \deg(\eta_{11}) + \dotsb + \deg(\eta_{1s_1}) + \dotsb + \deg(\eta_{l 1}) + \dotsb + \deg(\eta_{l s_l}).
\end{equation*}
Clearly, we must have
\begin{equation}  \label{Eq:TotDeg}
nk = (n-1) e  + D,
\end{equation}
where the left-hand side is the dimension of $M^{\times k}$ and the right-hand side the form-degree of the integrand of $I(\sigma_L)$. If we plug in $e$ from~\eqref{Eq:EulerFormula} and $k$ from~\eqref{Eq:MCk}, we get
$$ \begin{aligned} D &= nk - (n-1) e \\
   &= nk - (n-1)(k+l+2g-2) \\
   & = k - (n-1)(l+2g-2) \\
   & = s + 2l +4g - 4 - (n-1)(l+2g-2) \\
   & = s - (n-3)(l+2g-2). \end{aligned}$$
It follows that
$$ \Abs{\PMC_{lg}} = \Abs{\Susp^l} + \Abs{\omega_1} +  \dotsb + \Abs{\omega_l} =  l(n-3) + D - s = - 2(n-3)(g-1). $$
This is exactly the degree from Definition~\ref{Def:MaurerCartan}.

As for 8), if $\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb\otimes \omega_l)\neq 0$, then
$$ s = k - 2l -4g -4 \ge 1 + 2(2-2g-l) = 1 + 2 \chi_{0lg}, $$
and hence $\PMC_{lg}\in \Filtr^{1+2\chi_{0lg}}\hat{\Ext}_l \CycC$ for the filtration induced from the dual of the filtration of $\BCyc \Harm$ by weights. Therefore, we get
$$ \|\PMC_{lg}\| \ge 1 + 2\chi_{0lg} > 2\chi_{0lg} \quad\text{for all }l\ge 1, g\ge 0. $$
This finishes the proof.
\end{proof}

\Modify[inline,caption={Superfluous signs}]{Add here a remark that we do not have to sum over $L_1^v$!.}
%In~\cite{Cieliebak2018}, however, they might use a different convention for~$s(k,l)$. Our signs come naturally from the formal analogy $\DR(M) \simeq V$, where $V$ is a finite-dimensional vector space with a non-degenerate pairing, under which the formal pushforward Maurer-Cartan element $\PMC$ induced from $\DR(M)$ becomes a genuine pushforward Maurer-Cartan element induced from $V$, which fits in the formalism of~\cite{Cieliebak2015}. See Appendix~\ref{Section:Appendix} for more details.

\begin{Definition}[Vertices of types A, B, C and some special graphs]\label{Def:Graphs}
Let $\Gamma \in \TRG_{klg}$ be a trivalent ribbon graph and $\Vert$ its internal vertex. We say that~$\Vert$ is of \emph{type $A$, $B$ or~$C$} if it is connected to precisely $1$, $2$ or~$3$ internal vertices, respectively (see Figure~\ref{Fig:Vertices}). The graph $\Gamma$ is called (see Figures~\ref{Fig:Types} and~\ref{Fig:YOk}):
\begin{itemize}
\item a \emph{tree} if $[\Gamma] \in \RG_{k10}$ for some $k\ge 1$;
\item \emph{circular} if $[\Gamma]\in \RG_{k20}$ for some $k\ge 1$;
\item the \emph{$Y$-graph} is the unique tree with $k=1$;
\item an \emph{$O_k$-graph} if $\Gamma$ is circular with $k$ internal vertices and no $A$-vertex.
\end{itemize}
We denote the $Y$-graph simply by $Y$.
\end{Definition}

{ \begingroup
\begin{figure}[t]
\centering
\begin{subfigure}{0.4\textwidth}
\centering
\input{\GraphicsFolder/tree.tex}
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\centering
\input{\GraphicsFolder/circular.tex}
\end{subfigure}
\caption[A tree and a circular graph.]{A tree and a circular graph. Internal vertices are denoted with a full dot and external vertices with an empty dot.}\label{Fig:Types}
\end{figure}
\endgroup }
%
{ \begingroup
\begin{figure}[t]
\centering
\begin{subfigure}{0.4\textwidth}
\centering
\input{\GraphicsFolder/ygraphgen.tex}
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\centering
\input{\GraphicsFolder/ok.tex}
\end{subfigure}
\caption{The $Y$-graph and an $O_6$-graph.}\label{Fig:YOk}
\end{figure}
\endgroup }

\begin{Remark}[On $A$, $B$, $C$ vertices and special graphs]
We observe the following:
\begin{RemarkList}
\item A trivalent graph $\Gamma \neq Y$ has each internal vertex of type $A$, $B$ or $C$.
\item The term $\PMC_{10}$ is a sum over trees, and the term $\MC_{10}$ is the contribution of the $Y$-graph to $\PMC_{10}$ (see Proposition~\ref{Prop:FormalPushforwardProp} below). The term $\PMC_{20}$ is a sum over circular graphs.\qedhere
%The elements  of the Maurer-Cartan element are particularly important because they twist $\OPQ_{110}$, $\OPQ_{210}$, $\OPQ_{120}$ (c.f.~\eqref{Eq:TwisteddIBL}), and hence they are the only $\PMC_{lg}$ whose effect might be visible on the homology. See Section~\ref{Section:Proof3} for more details.\qedhere
\end{RemarkList}
\end{Remark}

Wee will also denote by $A$, $B$, $C$ the numbers of internal vertices of the corresponding type. Under the change of variables
\begin{equation} \label{Eq:ChangeOfVariables}
\begin{aligned}
  s &= 2 A + B, \\
  e &= B + \frac{1}{2} A + \frac{3}{2} C, \\
  k &= A + B + C,
\end{aligned}
\end{equation}
the trivalent formula~\eqref{Eq:TrivalentFormula} becomes trivial and the Euler formula~\eqref{Eq:EulerFormula} becomes
\begin{equation} \label{Eq:GenusFormulaa}
 C - A = 2l - 4 + 4g.
\end{equation}

\begin{Proposition}[Chern-Simons Maurer-Cartan element]\label{Prop:FormalPushforwardProp}
The collection $\PMC = (\PMC_{lg})$ from Definition~\ref{Def:PushforwardMCdeRham} is a Maurer-Cartan element for $\dIBL(\Harm(M))$ which is compatible with $\MC$. In particular, the $\AInfty$-algebra $\Harm(M)_\PMC$ is homologically unital and augmented.
\end{Proposition}
\begin{proof}
The fact that $\PMC$ is a Maurer-Cartan element follows from Lemma~\ref{Lem:MCCond} assuming 1) and 9) from \cite{Cieliebak2018}. \Correct[caption={DONE Redundant check of vanishing for $w\le 2$}]{Change it here because the definition of compatible changed!! In particular, the vanishing on words of length $1$ and $2$ follows from the filtration degree condition. Do not have to show it here.}

As for the compatibility with $\MC$,
%by plugging $l=1$, $g=0$ in \eqref{Eq:MCk}, we get $k = s-2$. Therefore, for all $\alpha_1$, $\alpha_2$, $\alpha_3\in\Harm(M)[1]$, we have $\PMC_{10}(\Susp \alpha_1) = \PMC_{10}(\Susp \alpha_1 \alpha_2) = 0$, and
the only graph contributing to $\PMC_{10}(\Susp \alpha_1 \alpha_2 \alpha_3)$  is the $Y$-graph with $k=1$. The group $\Aut(Y)$ consists of three rotations, and there is only one possible~$L_1$, no~$L_2$ and three~$L_3^b$. In Definition~\ref{Def:PushforwardMCdeRham}, we get $s(1,1) = n-2$, $(-1)^{\sigma_L} = 1$ because a cyclic permutation of an odd number of elements is even, and also $P(\alpha_1\alpha_2\alpha_3) =\eta_2$. Finally, we compute
\begin{align*}%\label{Eq:TheFirstTerm}
 \PMC_{10}(\Susp \alpha_1 \alpha_2 \alpha_3) &= \frac{1}{3} (-1)^{n-2 + \eta_2}\sum_{L_3^b} \int_x \alpha_1(x_{\xi(\sigma_1)})\alpha_2(x_{\xi(\sigma_2)})\alpha_3(x_{\xi(\sigma_3)}) \\
 & = (-1)^{n-2 + \eta_2}\int_M \eta_1 \wedge \eta_2 \wedge \eta_3\\[\jot]
 & = \MC_{10}(\Susp \alpha_1 \alpha_2 \alpha_3).\qedhere
\end{align*}
\end{proof}
%
%Appendix~\ref{Section:Appendix}, which hold for a finite-dimensional vector space $V$, in the case of $\DR(M)$, replacing the product by the integral and a permutation of tensors by a change of variables. The formal analogy $V\sim \DR(M)$ is also used to get the signs $s(k,l)$ and $P(\omega)$, which is explained in details at the end of the Appendix. In~\cite{Cieliebak2018} will be argued, using iterated blow-ups, that the integrals $I(\sigma)$ converge, and that $\PMC=(\PMC_{lg})$ satisfies the Maurer-Cartan equation~\eqref{Eq:MaurerCartanEquation} with operations $\OPQ_{110}$, $\OPQ_{210}$ and $\OPQ_{120}$ from Definition~\ref{Def:CanonicaldIBL}. However, they might use a different convention for $s(k,l)$.
%%Our signs come from a formal analogy with the algebraic formalism in Appendix~\ref{Section:Appendix} which corresponds to a finite dimensional $\DR(M)$. In that case~\eqref{Eq:MaurerC1artanEquation} holds as  $(\MC_{10})$ is a Maurer-Cartan element and $(\PMC_{lg})$ its pushforward in the sense of~\cite{Cieliebak2015}.

%In this section we will will work in the setting of Definition~\ref{Def:PushforwardMCdeRham}. To recall, we consider connected trivalent ribbon graphs $\Gamma$ with $k$ internal vertices, $l$ boundary components and genus $g$, the set of whose isomorphism classes is denoted by $RG_{klg}^{3}$; we label them using $L=(L_1,L_2,L_3)$ from Definition~\ref{Def:Labeling} and evaluate on an input $\omega_1$, $\dotsc$, $\omega_l \in \BCyc\Harm(M)$ with $\omega_i = \alpha_{i1}\dots \alpha_{is_i}$ for homogenous $\alpha_{ij}\in \Harm(M)[1]$  as the integral $I(\sigma_L)$. The value $\PMC_{lg}(\Susp^l \omega_1 \otimes \dotsb \otimes \omega_l)$  is then computed as a sum over $[\Gamma]\in RG_{klg}^3$ and all choices of an admissible labeling $L$
%
\begin{figure}[t]
\centering
\input{\GraphicsFolder/vertices.tex}
\caption[Trivalent vertices of types $A$, $B$ and $C$.]{Trivalent vertices of types $A$, $B$ and $C$ with the corresponding forms $A_{\alpha_1,\alpha_2}$, $B_\alpha$ and $C$, respectively.}\label{Fig:Vertices}
\end{figure}
%
%
\begin{Definition}[Contributions of A, B, C vertices]\label{Def:Contributions}
Consider an internal vertex of type A, B or C as in Figure~\ref{Fig:Vertices}. We define the following smooth forms on $M$, $M^{\times 2}$ and $M^{\times 3}$, respectively:\footnote{The definitions can be made precise in local coordinates. Smoothness of $A_{\alpha_1, \alpha_2}$ is clear, smoothness of $B_\alpha$ follows from Lemma~\ref{Lem:Smoothing}, and smoothness of $C$ can be shown by a similar argument.}
$$\begin{aligned}
 A_{\alpha_1, \alpha_2}(y)&\coloneqq \int_x \Prpg(y,x)\eta_1(x)\eta_2(x),\\
 B_\alpha(y_1,y_2) &\coloneqq \int_x \Prpg(y_1,x)\Prpg(x,y_2)\eta(x), \\
 C(y_1,y_2,y_3) &\coloneqq \int_x \Prpg(x,y_1)\Prpg(x,y_2)\Prpg(x,y_3).
\end{aligned}$$
\end{Definition}

\end{document}


\section{ELL Grammars}

A grammar is ELL iff:
\begin{itemize}
    \item It is ELR
    \item It has the Single Transition Property
    \item It has no Left Recursive Derivations (direct or indirect)
\end{itemize}

\subsection{Single Transition Property}
The STP does not hold if for an m-state there are more transitions possible for a given symbol.

\subsection{Parser Control Flow Graph}

From the machine net:
\begin{itemize}
    \item Add \emph{call arcs}: for $q_A \xrightarrow{B} r_A$ add $q_A \dashrightarrow 0_B$
    \item Add \emph{prospect sets} of the states
    \item Add the \emph{Gui} for the following arcs:
    \begin{itemize}
        \item Terminal shift arc: $q \xrightarrow{a} r$
        \item Call arcs: $q_A \dashrightarrow 0_B$
        \item Exiting arcs of the final states
        \item \textbf{Note}: \textbf{no} \emph{Gui} for nonterminal shift ($q_A \xrightarrow{B} r_A$)
    \end{itemize}
\end{itemize}

\subsection{Prospect sets}
The prospect set of state $q_X$ is the set of symbols that can be encountered when exiting the machine.
It is the union of the lookaheads of all the candidates with $q_X$ as kernel.

For an initial state $0_A$
\begin{equation*}
    \pi_{0_A} := \pi_{0_A} \cup \bigcup_{q_i \xrightarrow{A} r_i} (Ini(L(r_i)) \cup \ \text{if}\ Null(L(r_i)) \ \text{then}\ \pi_{q_i} \ \text{else}\ \emptyset)
\end{equation*}

For any other state $q$ (where $X_i$ is terminal or non-terminal)
\begin{equation*}
    \pi_q := \bigcup_{p_i \xrightarrow{X_i} q} \pi_{p_i}
\end{equation*}

\subsection{Guide set}
The guide set ($Gui$) of an arc is the set of symbols that can be met going through that arc.
\begin{itemize}
    \item $Gui(q_A\xrightarrow{a}r_A) = \{a\}$
    \item $Gui(f\rarr) =$ prospect set of $f$ (with $f$ final)
    \item $Gui(q_A\dashrightarrow 0_B) = Ini(L(B)) \cup \{\text{symbols following $B$ if $B$ is nullable}\}$
\end{itemize}

Formally
\begin{equation*}
    Gui(q_A \dashrightarrow 0_{A_1}) := \bigcup
    \begin{cases}
        Ini(L(A_1))\\ \\
        \text{if}\ Null(L(A_1)) \\
        \text{then}\ Ini(L(r_A)) \ \text{else}\ \emptyset\\ \\
        \text{if}\ Null(L(A_1)) \land Null(L(r_A)) \\
        \text{then}\ \pi_{r_A} \ \text{else}\ \emptyset \\ \\
        \bigcup_{0_{A_1} \dashrightarrow 0_{B_i}} Gui(0_{A_1} \dashrightarrow 0_{B_i})
    \end{cases}
\end{equation*}

\subsection{Alternative ELL Definition}
A grammar is ELL iff on alternative arcs the guide sets are disjoint.

\subsection{Top-Down Predictive Analyzer}
Based on the PCFG, using a stack initialized with $0_S$. If the top element is $q_A$ (machine $M_A$ is active at the state $q_A$), and the current character is $cc$:
\begin{description}
    \item[Scan] if $q_A \xrightarrow{cc} r_A$: read $cc$, \textbf{pop}, \textbf{push $r_A$}
    \item[Move] if $a_A \dashrightarrow 0_B$ and $q_A \xrightarrow{B} r_A$ and $cc \in Gui(q_A \dashrightarrow 0_B)$: \textbf{pop}, \textbf{push $r_A$}, \textbf{push $0_B$}
    \item[Return] if $q_A$ final, $cc$ in prospect set of $q_A$: \textbf{pop}
    \item[Acceptance] if $A=S$, $q_A$ is final and $cc = \dashv$: \textbf{accept}
\end{description}

\subsection{Increasing lookahead}
If a grammar is not ELL(1) it may be possible that it is ELL(k).
If the guide sets of length $k$ are disjoint the grammar is ELL(k).