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

\begin{document}
        A strongly homotopy associative algebra, or $A_\infty$-algebra, over a field is a graded vector space together with homogenous linear maps $m_n:A^{\otimes n}\rightarrow A$ of degree $n-2$ satisfying some homotopical relations. This will be made precise later. We may regard $m_2$ to be a multiplication of $A$, it is however not a priori associative. The associator of $m_2$ is taken to be the homotopical relation of $m_3$. Thus, we know that the homotopy of $A$ is an associative algebra. The maps $m_n$ corresponds uniquely to a map $m^c:BA\rightarrow \bar{A}[1]$, which extends to a coderivation $m^c : BA\rightarrow BA$ of the bar construction of $A$. So we could instead define an $A_\infty$-algebra to be a coalgebra on the form $BA$.

        In order to understand the bar construction we will first study it on associative algebras. Given a differential graded coassociative coalgebra $C$ and a differential graded associative algebra $A$, we say that a homogenous linear transformation $\alpha: C\rightarrow A$ is twisting if it satisfies the Maurer-Cartan equation:
            \begin{equation*}
                \partial\alpha + \alpha\star\alpha = 0.
            \end{equation*}
        Let $Tw(C,A)$ be the set of twisting morphisms, then considering it as a functor $Tw : CoAlg_{\mathbb{K}}^{op}\times Alg_{\mathbb{K}} \rightarrow Ab$ we want to show that it is represented in both arguments. Moreover, these representations give rise to an adjoint pair of functors, called the bar and cobar construction.

        \begin{center}
            \begin{tikzcd}
                \substack{Aug \\ Alg}_{\mathbb{K}}^\bullet \ar[bend left]{r}[pos=0.55]{B} \ar[phantom]{r}{\top} & \substack{Conil \\ CoAlg}_{\mathbb{K}}^\bullet \ar[bend left]{l}[pos=0.45]{\Omega}
            \end{tikzcd}
        \end{center}

    \section{Algebras}

            This section is a review of associative algebras. We will define unital associative algebras and possibly non-unital associative algebras, which we will call algebras and non-unital algebras respectively. The collection of algebras together with homomorphisms between them form the category $Alg_{\mathbb{K}}$ of algebras. Other types of algebras such as augmented and tensor algebras will be defined as well.

            \begin{definition}[Algebra]
                Let $\mathbb{K}$ be a field with unit $1$. An algebra $A$ over $\mathbb{K}$ is a vector space with structure morphisms called multiplication and unit,
                \begin{align*}
                    (\nabla_A) & : A\otimes_{\mathbb{K}}A \rightarrow A \\
                    \upsilon_A & : \mathbb{K} \rightarrow A,
                \end{align*}
                satisfying the associativity and identity laws.
                \begin{align*}
                    \text{(associativity)}\quad & (a \nabla_A b) \nabla_A c = a \nabla_A (b \nabla_A c) \\
                    \text{(unitality)}\quad & \upsilon_A(1) \nabla_A a = a = a \nabla_A \upsilon_A(1)
                \end{align*}
                Whenever $A$ does not posess a unit morphism, we will call $A$ a non-unital algebra. Only the associativity law must hold.
            \end{definition}

            \begin{definition}[Algebra homomorphisms]
                Let $A$ and $B$ be algebras. Then $f: A\rightarrow B$ is an algebra homomorphism if
                \begin{enumerate}
                    \item $f$ is $\mathbb{K}$-linear
                    \item $f(ab)=f(a)f(b)$
                    \item $f\circ\upsilon_A = \upsilon_B$
                \end{enumerate}
                Whenever $A$ and $B$ are non-unital, we only require 1 and 2 for a homomorphism of non-unital algebras.
            \end{definition}

            \begin{definition}[Category of algebras]
                \begin{itemize}
                    \item Let $Alg_{\mathbb{K}}$ denote the category of algebras. It's objects consists of every algebra $A$, and the morphisms are algebra homomorphisms. The sets of morphisms between $A$ and $B$ are denoted as $Alg_{\mathbb{K}}(A,B)$.
                    \item Let $nAlg_{\mathbb{K}}$ denote the category of non-unital algebras. It's objects consists of every non-unital algebra $A$, and the morphisms are non-unital algebra homomorphisms. The sets of morphisms between $A$ and $B$ are denoted as $nAlg_{\mathbb{K}}(A,B)$.
                \end{itemize}
            \end{definition}

            Observe that for an algebra $A$, the triple $(A,\nabla_A,\upsilon_A)$ is a monoid in $mod_{\mathbb{K}}$. Thus, we may say that an algebra is a triple where the following diagrams commute.
            \begin{center}
                \begin{tikzcd}
                    A \otimes_{\mathbb{K}} A \otimes_{\mathbb{K}} A \ar[]{r}{(\nabla_A)\otimes id_{\mathbb{K}}} \ar[]{d}[]{id_{\mathbb{K}}\otimes (\nabla_A)} & A \otimes_{\mathbb{K}} A \ar[]{d}{(\nabla_A)} \\
                    A \otimes_{\mathbb{K}} A \ar[]{r}[]{(\nabla_A)} & A
                \end{tikzcd} \quad
                \begin{tikzcd}
                    A \otimes_{\mathbb{K}} \mathbb{K} \ar[]{r}[]{id_A \otimes \upsilon_A} \ar[]{rd}[below]{\simeq} & A \otimes_{\mathbb{K}} A \ar[]{d}[]{(\nabla_A)} & \mathbb{K} \otimes_{\mathbb{K}} A \ar[]{l}[above]{\upsilon_A \otimes id_A} \ar[]{ld}[]{\simeq}\\
                    & A
                \end{tikzcd}
            \end{center}
            The final method we will use to represent an algebra are electric circuits. An electric circuit is a diagram read from top to bottom, where each column represent a different vector space in a tensor. Morphisms in such diagrams are figures, conjunctions, twistings and etc. E.g. The multiplication operator may be represented as a converging fork, and the unit as a source.
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-3, 0) {(Multiplication)};

                    \node[op, scale = 0.75] (1) at (0,0) {$\nabla_A$};

                    \draw [line width=1pt] (-0.5, 1) -- (-0.5, 0.5) -- (1) -- (0, -1);
                    \draw [line width=1pt] (0.5, 1) -- (0.5, 0.5) -- (1);

                    \node at (1.5,0) {$=$};

                    \draw [line width=1pt] (2.5,1) -- (2.5, 0.5) -- (3,0) -- (3,-1);
                    \draw [line width=1pt] (3.5,1) -- (3.5, 0.5) -- (3,0);
                \end{tikzpicture} \qquad
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-1.5,0.25) {(Unit)};

                    \node[op, scale = 0.75] (1) at (0,1) {$\upsilon_A$};
                    \draw [line width=1pt] (1) -- (0,-0.75);

                    \node at (1, 0.25) {$=$};

                    \node[op, scale=1] (2) at (1.75,1) {};
                    \draw [line width=1pt] (2) -- (1.75,-0.75);

                    \node at (0,-0.5) {};
                \end{tikzpicture}
            \end{center}
            Using these operations we can now reformulate the algebra laws. These are the electric laws for an algebra:
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-3,0.5) {(Associativity)};

                    \draw [line width=1pt] (-0.75, 1.25) -- (-0.75, 1) -- (-0.5, 0.75) -- (-0.5, 0.5) -- (0,0) -- (0, -0.5);
                    \draw [line width=1pt] (-0.25, 1.25) -- (-0.25, 1) -- (-0.5, 0.75);
                    \draw (0.5, 1.25) -- (0.5, 0.5) -- (0,0);

                    \node at (1.25,0.5) {$=$};

                    \draw [line width=1pt] (2,1.25) -- (2, 0.5) -- (2.5, 0) -- (2.5, -0.5);
                    \draw [line width=1pt] (2.75, 1.25) -- (2.75, 1) -- (3, 0.75) -- (3, 0.5) -- (2.5, 0);
                    \draw [line width=1pt] (3.25, 1.25) -- (3.25, 1) -- (3, 0.75);
                \end{tikzpicture}
            \end{center}
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-2,0) {(unitality)};

                    \node[op, scale=0.75] (1) at (-0.5, 1) {};

                    \draw [line width=1pt] (1) -- (-0.5, 0.5) -- (0,0) -- (0, -0.5);
                    \draw [line width=1pt] (0.5, 1) -- (0.5, 0.5) -- (0,0);

                    \node at (1.25,0.) {$=$};

                    \draw [line width=1pt] (2, 1) -- (2, -0.5);

                    \node at (2.75,0) {$=$};

                    \node[op, scale=0.75] (2) at (4.5, 1) {};
                    \draw [line width=1pt] (3.5, 1) -- (3.5, 0.5) -- (4, 0) -- (4, -0.5);
                    \draw [line width=1pt] (2) -- (4.5, 0.5) -- (4, 0);

                \end{tikzpicture}
            \end{center}

            \begin{definition}[Augmented algebras]
                Let $A$ be an algebra. It is called augmented if there is an algebra homomorphism $\varepsilon : A \rightarrow \mathbb{K}$.
            \end{definition}

            If $A$ is an augmented algebra, then it decomposes into $\mathbb{K}\oplus Ker\varepsilon$ as a module. The splitting is given by unitality of the morphism $\varepsilon: A \rightarrow \mathbb{K}$, as we know that $\varepsilon(\upsilon_A) = id_{\mathbb{K}}$. The kernel of $\varepsilon$ is called the augmentation ideal or redecued algebra and we will denote it as $\bar{A}$. Taking kernels gives an equivalence of categories between augmented algebras and non-unital algebras, with unitization as the quasi-inverse. The category of augmented algebras is denoted as $AugAlg_\mathbb{K}$ or $\substack{Aug \\ Alg}_\mathbb{K}$.

            \begin{definition}[Tensor algebra]
                Let $V$ be a $\mathbb{K}$-module. We define the tensor algebra $T(V)$ of $V$ as the module
                \begin{align*}
                    T(V) = \mathbb{K}\oplus V\oplus V^{\otimes 2} \oplus V^{\otimes 3} \oplus ...
                \end{align*}
                Given two strings $v^1..v^i$ and $w^1...w^j$ in $T(V)$ we define the multiplication by the concatenation operation.
                \begin{align*}
                    \nabla_{T(V)} : T(V)\otimes_{\mathbb{K}} T(V) & \rightarrow T(V) \\
                    (v^1...v^i)\otimes(w^1...w^j) & \mapsto v^1...v^iw^1...w^j
                \end{align*}
                The unit is given by including $\mathbb{K}$ into $T(V)$.
                \begin{align*}
                    \upsilon_{T(V)} : \mathbb{K} & \rightarrow T(V) \\
                    1 & \mapsto 1
                \end{align*}
            \end{definition}

            Observe that the tensor algebra is augmented. The projection from $T(V)$ into $\mathbb{K}$ is an algebra homomorphism, so we may split the tensor algebra into its unit and its augmentation ideal $T(V) \simeq \mathbb{K}\oplus\bar{T(V)}$. We call $\bar{T(V)}$ the reduced tensor algebra.

            \begin{proposition}[Tensor algebra is free]
                The tensor algebra is the free algebra over the category of $\mathbb{K}$-modules, i.e. for any $\mathbb{K}$-module $V$ there is a natural isomorphism $Hom_{\mathbb{K}}(V,A)\simeq Alg_{\mathbb{K}}(T(V),A)$.

                The reduced tensor algebra is the fre non-unital algebra over the category of $\mathbb{K}$-modules, i.e. for any $\mathbb{K}$-module $V$ there is a natural isomorphism $Hom_{\mathbb{K}}(V,A)\simeq nAlg_{\mathbb{K}}(\bar{T(V)},A)$.
            \end{proposition}

            \begin{proof}
                This proposition should be evident from the description of an algebra homomorphism from a tensor algebra. If $f: T(V) \rightarrow A$ is an algebra homomorphism, then $f$ must satisfy the following conditions:
                \begin{itemize}
                    \item (Unitality)\quad $f(1) = 1$
                    \item (Homomorphism property)\quad Given $v,w\in V$, then $f(vw) = f(v)\nabla_Af(w)$
                \end{itemize}
                By induction, we see that $f$ is completely determined by where it sends the elements of $V$. Thus restriction by the inclusion of $V$ into $T(V)$ induces a bijection.
            \end{proof}

            \begin{definition}[Modules]
                Let $A$ be an algebra. A $\mathbb{K}$-module $M$ is said to be a left (right) $A$-module if there exists a structure morphism $\mu_M : A\otimes_{\mathbb{K}}M \rightarrow A$ ($\mu_M : M\otimes_{\mathbb{K}}A \rightarrow A$) called multiplication. We require that $\mu_M$ is associative with respect to the multiplication and preserves the unit of $A$, i.e. the electric laws are satisfied.
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                        \node at (-2.4,0) {(Associativity)};

                        \node at (0,1.75) {A};
                        \node at (1,1.75) {A};
                        \node at (2,1.75) {M};

                        \node[op, scale = 0.5] (a) at (1,-0.25) {$\mu_M$};

                        \draw [line width=1pt] (0,1.25) -- (0, 1) -- ((0.5, 0.5) -- (0.5, 0.25) -- (a);
                        \draw [line width=1pt] (a) -- (2,0.5) -- (2,1.25);
                        \draw [line width=1pt] (0.5,0.5) -- (1,1) -- (1, 1.25);
                        \draw [line width=1pt] (a) -- (1,-1);

                        \node at (2.5,0) {$=$};

                        \node at (3,1.75) {A};
                        \node at (4,1.75) {A};
                        \node at (5,1.75) {M};

                        \node[op, scale = 0.5] (b) at (4.5,0.5) {$\mu_M$};
                        \node[op, scale = 0.5] (c) at (4,-0.25) {$\mu_M$};

                        \draw [line width=1pt] (3,1.25) -- (3, 0.5) -- (c);
                        \draw [line width=1pt] (c) -- (b) -- (5,1) -- (5,1.25);
                        \draw [line width=1pt] (4, 1.25) -- (4,1) -- (b);
                        \draw [line width=1pt] (c) -- (4,-1);
                    \end{tikzpicture}\\

                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                        \node at (-2,0) {(unitality)};

                        \node at (1.75,1.5) {M};

                        \node[op, scale=0.75] (1) at (0.25, 1) {};
                        \draw [line width=1pt] (1) -- (0.25, 0.75) -- (1,0);
                        \draw [line width=1pt] (1,0) -- (1.75,0.75) -- (1.75, 1);
                        \draw [line width=1pt] (1,0) -- (1,-0.75);

                        \node at (2.25,0) {$=$};

                        \node at (3,1.5) {M};

                        \draw [line width=1pt] (3,1) -- (3,-0.75);
                    \end{tikzpicture}
                \end{center}
            \end{definition}

            \begin{definition}[A-linear homomorphisms]
                Let $M,N$ be two left $A$-modules. A morphism $f:M\rightarrow N$ is called $A$-linear if it is $\mathbb{K}$-linear and for any $a$ in $A$, $f(am) = af(m)$.
            \end{definition}

            The category of left $A$-modules is denoted as $Mod_A$, where the morphisms $Hom_A(\_,\_)$ are $A$-linear. Likewise, the category of right $A$-modules is denoted as $Mod^A$.

            \begin{proposition}
                Let $M$ be a $\mathbb{K}$-module. The module $A\otimes_{\mathbb{K}}M$ is a left $A$-module. Moreover, it is the free left module over $\mathbb{K}$-modules, i.e. there is an isomorphism $Hom_{\mathbb{K}}(M,N)\simeq Hom_{A}(A\otimes_{\mathbb{K}}M,N)$.
            \end{proposition}

    \section{Coalgebras}
            This section aims to dualize the definitions from last section. To this end we will define counital coassociative coalgebras and non-counital coassociative coalgebras, which will be called coalgebras and non-counital coalgebras respectively. The collection of coalgebras together with coalgebra homomorphisms is the category $CoAlg_{\mathbb{K}}$. Due to some ill-behavior, this dualization is only a true dualization under some finiteness conditions for the algebras. Thus we will see that the proper dual concept will be of conilpotent coalgebras. We will see that the cofree coalgebra is conilpotent.

            \begin{definition}[Coalgebra]
                Let $\mathbb{K}$ be a field. A coalgebra $C$ over $\mathbb{K}$ is a $\mathbb{K}$-module with structure morphisms called comultiplication and counit,
                \begin{align*}
                    (\Delta_C) & : C \rightarrow C\otimes_{\mathbb{K}}C \\
                    \varepsilon_C & : C \rightarrow \mathbb{K},
                \end{align*}
                satisfying the coassociativity and coidentity laws.
                \begin{align*}
                    \text{(coassociativity)} \quad & (\Delta_C\otimes id_C)\circ\Delta_C(c) = (id_C\otimes\Delta_C)\circ\Delta_C(c) \\
                    \text{(counitality)} \quad & (id_C\otimes\varepsilon_C)\circ\Delta_C(c) = c = (\varepsilon_C\otimes id_C)\circ\Delta_C(c)
                \end{align*}
            \end{definition}

            We define repeated application of comultiplication as $\Delta_C^n = (\Delta_C\otimes id_C\otimes ...)\circ\Delta_C^{n-1}$. Notice that the choice of where we put comultiplication in the tensor does not matter, as coassociativity require all of the choices to be equal.

            We may dualize the electric circuits of an algebra to coalgebras. In this manner our structure morphisms would be upside down relative to the algebra morphisms. Thus comultiplication becomes a diverging fork and counit is a sink.
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale = 0.75}, scale = 0.7]
                    \node at (-3.5, 0) {(Comultiplication)};

                    \node[op, scale=0.75] (1) at (0,0) {$\Delta_C$};

                    \draw [line width=1pt] (0,1) -- (1) -- (-0.5, -0.5) -- (-0.5, -1);
                    \draw [line width=1pt] (1) -- (0.5, -0.5) -- (0.5, -1);

                    \node at (1.5,0) {$=$};

                    \draw [line width=1pt] (3, 1) -- (3, 0) -- (2.5, -0.5) -- (2.5, -1);
                    \draw [line width=1pt] (3, 0) -- (3.5, -0.5) -- (3.5, -1);

                \end{tikzpicture} \qquad
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-2.5, 0) {(Counit)};

                    \node[op, scale=0.75] (1) at (0,-1) {$\varepsilon_C$};
                    \draw [line width=1pt] (0, 1) -- (1);

                    \node at (1, 0) {$=$};

                    \node[op, scale=1] (2) at (2, -1) {};
                    \draw [line width=1pt] (2, 1) -- (2);

                    \node at (0,0.5) {};
                \end{tikzpicture}
            \end{center}
            We then obtain the electric laws for a coalgebra by flipping the circuits around.
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-3.5,0) {(Coassociativity)};

                    \draw [line width=1pt] (0, 1) -- (0, 0) -- (-0.5, -0.5) -- (-0.5, -0.75) -- (-0.75, -1) -- (-0.75, -1.25);
                    \draw [line width=1pt] (-0.5, -0.75) -- (-0.25, -1) -- (-0.25, -1.25);
                    \draw [line width=1pt] (0, 0) -- (0.5, -0.5) -- (0.5, -1.25);

                    \node at (1.5,0) {$=$};

                    \draw [line width=1pt] (3, 1) -- (3, 0) -- (3.5, -0.5) -- (3.5, -0.75) -- (3.25, -1) -- (3.25, -1.25);
                    \draw [line width=1pt] (3.5, -0.75) -- (3.75, -1) -- (3.75, -1.25);
                    \draw [line width=1pt] (3, 0) -- (2.5, -0.5) -- (2.5, -1.25);
                \end{tikzpicture}
            \end{center}
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                    \node at (-3,0) {(Counitality)};

                    \node[op, scale=0.75] (1) at (-0.5, -1) {};

                    \draw [line width=1pt] (0, 1) -- (0, 0) -- (-0.5, -0.5) -- (1);
                    \draw [line width=1pt] (0, 0) -- (0.5, -0.5) -- (0.5, -1);

                    \node at (1,0) {$=$};

                    \draw [line width=1pt] (2,1) -- (2,-1);

                    \node at (3,0) {$=$};

                    \node[op, scale=0.75] (2) at (4.5,-1) {};

                    \draw [line width=1pt] (4, 1) -- (4, 0) -- (3.5, -0.5) -- (3.5, -1);
                    \draw [line width=1pt] (4, 0) -- (4.5, -0.5) -- (2);
                \end{tikzpicture}
            \end{center}

            \begin{definition}[Coalgebra homomorphism]
                Let $C$ and $D$ be coalgebras. Then $f:C\rightarrow D$ is a coalgebra morphism if
                \begin{enumerate}
                    \item $f$ is $\mathbb{K}$-linear
                    \item $(f\otimes f)\circ\Delta_C(c) = \Delta_D(f(c))$
                    \item $\varepsilon_D(f) = \varepsilon_C$
                \end{enumerate}
                Whenever $C$ and $D$ are non-counital, we only require 1 and 2 for a homomorphism of non-counital coalgebras.
            \end{definition}

            \begin{definition}[Category of Coalgebras]
                \begin{itemize}
                    \item Let $CoAlg_{\mathbb{K}}$ denote the category of coalgebras. It's objects consists of every coalgebra $C$, and the morphisms are coalgebra homomorphisms. The sets of morphisms between $C$ and $D$ are denoted as $CoAlg_{\mathbb{K}}(C,D)$.
                    \item Let $nCoAlg_{\mathbb{K}}$ denote the category of non-unital algebras. It's objects consists of every non-unital algebra $C$, and the morphisms are non-unital algebra homomorphisms. The sets of morphisms between $C$ and $D$ are denoted as $nCoAlg_{\mathbb{K}}(C,D)$.
                \end{itemize}
            \end{definition}

            \begin{example}[The coalgebra $\mathbb{K}$]
                The field $\mathbb{K}$ can be given a coalgebra structure over itself. Since $\{1\}$ is a basis for $\mathbb{K}$ we define the structure morphisms as
                \begin{align*}
                    \Delta_{\mathbb{K}}(1) & = 1\otimes 1 \\
                    \varepsilon(1) & = 1.
                \end{align*}
                One may check that these morphisms are indeed coassociative and counital. Thus we may regard our field as either an algebra or coalgebra over itself.
            \end{example}

            \begin{definition}[Coaugmented coalgebras]
                Let $C$ be a coalgebra. $C$ is coagumented if there is a coalgebra homomorphism $\upsilon:\mathbb{K}\rightarrow C$.
            \end{definition}

            If $C$ is a coaugmented coalgebra, then it splits as $C\simeq \mathbb{K}\oplus Cok\upsilon$. The splitting is given by counitality of $\upsilon$, as $\varepsilon_C(\upsilon) = id_{\mathbb{K}}$. We call the cokernel $Cok\upsilon = \bar{C}$ for the coaugmentation quotient or reduced coalgebra, and its reduced coproduct may be explicitly given as
            \begin{align*}
                \bar{\Delta}_C(c) = \Delta_C(c) - 1\otimes c - c\otimes 1.
            \end{align*}

            \begin{definition}[Tensor Coalgebras]
                Let $V$ be a $\mathbb{K}$-module. We define the tensor coalgebra $T^c(V)$ of $V$ as the module
                \begin{align*}
                    T^c(V) = \mathbb{K}\oplus V\oplus V^{\otimes 2}\oplus V^{\otimes 3}\oplus ...
                \end{align*}
                Given a string $v^1...v^i$ in $T(V)$ we define the comultiplication by the deconcatenation operation.
                \begin{align*}
                    \Delta_{T^c(V)}:T^c(V) & \rightarrow T^c(V)\otimes_{\mathbb{K}}T^c(V) \\
                    v^1...v^i & \mapsto 1\otimes(v^1...v^i) + (\sum_{j=1}^{n-1} (v^1...v^{j})\otimes(v^{j+1}...v^i)) + (v^1...v^i)\otimes 1
                \end{align*}
                The counit is given by projecting $T^c(V)$ onto $\mathbb{K}$.
                \begin{align*}
                    \varepsilon_{T^c(V)} : T^c(V) & \rightarrow \mathbb{K} \\
                    1 & \mapsto 1 \\
                    v^1...v^i & \mapsto 0
                \end{align*}
            \end{definition}

            Notice that the tensor coalgebra is coaugmented. Its coaugmentation is given by the inclusion of $\mathbb{K}$ into $T^c(V)$. We may split $T^c(V) \simeq \mathbb{K}\oplus \bar{T^c}(V)$, where $\bar{T^c}(V)$ is the reduced tensor coalgebra.

            In order to get cofreeness for the tensor coalgebra we need some finiteness conditions. This is one of the properties which is ill-behaved when we are dualizing the tensor algebra. The extra assumption which we will need is to assume that the coalgebras are conilpotent. Let $C \simeq \mathbb{K} \oplus \bar{C}$ be a coaugmented coalgebra, we define the coradical filtration of $C$ as a filtration $Fr_0C \subseteq Fr_1C \subseteq ... \subseteq Fr_rC \subseteq ...$ by the submodules:
            \begin{align*}
                Fr_0C & = \mathbb{K} \\
                Fr_rC & = \mathbb{K} \oplus \{c\in\bar{C}\mid \forall n\geq r \bar{\Delta}_C(c) = 0\}.
            \end{align*}

            \begin{definition}[Conilpotent coalgebras]
                Let $C$ be a coaugmented coalgebra. We say that $C$ is conilpotent if its coradical filtration is exhaustive, i.e. $\substack{\varinjlim \\ r}Fr_rC \simeq C$. The subcategory of conilpotent coalgebras will be denoted as $ConilCoAlg_\mathbb{K}$ or $\substack{Conil \\ CoAlg}_{\mathbb{K}}$.
            \end{definition}

            \begin{proposition}[Conilpotent tensor coalgebra]\label{prop: conilpotent-tensor}
                Let $V$ be a $\mathbb{K}$-module. The tensor coalgebra $T^c(V)$ is conilpotent.
            \end{proposition}

            \begin{proof}
                Let $v\in V$, then $\Delta_{T^c(V)}(v)=1\otimes v + v\otimes 1$ and $\bar{\Delta}_{T^c(V)}(v)=0$. We then observe the following:
                \begin{align*}
                    Fr_0T^c(V) & = \mathbb{K} \\
                    Fr_1T^c(V) & = \mathbb{K} \oplus V \\
                    Fr_rT^c(V) & = \bigoplus_{i\leq r} V^{\otimes i}
                \end{align*}
                This shows that the coradical filtration is exhaustive.
            \end{proof}

            \begin{proposition}[Cofree tensor coalgebra]\label{prop: cofree-tensor}
                The tensor coalgebra is the cofree conilpotent coalgebra over the category of $\mathbb{K}$-modules, i.e. for any $\mathbb{K}$-module $V$ and any conilpotent coalgebra $C$ there is a natural isomorphism $Hom_{\mathbb{K}}(\bar{C}, V)\simeq \substack{Conil \\ CoAlg}_{\mathbb{K}}(C, T^c(V))$.
            \end{proposition}

            \begin{proof}
                This proposition should be evident from the description of a coalgebra homomorphism into the a tensor coalgebra. If $g:C\rightarrow T^c(V)$ is a coalgebra homomorphism, then $g$ must satisfy the following conditions:
                \begin{enumerate}
                    \item (Coaugmentation)\quad $g(1)=1$
                    \item (Counitality)\quad Given $c\in \bar{C}$ then $\varepsilon_{T^c(V)}\circ g(c)=0$
                    \item (Homomorphism property)\quad Given $c\in C$ then $\Delta_{T^c(V)}(g(c))=(g\otimes g)\circ\Delta_C(c)$
                \end{enumerate}

                We will construct the maps for the isomorphism explicitly. If $g:C\rightarrow T^c(V)$ is a coalgebra homomorphism, then composing with projection gives a map $\pi\circ g:C\rightarrow V$. Note that $\pi\circ g(1)=0$, so this is essentially a map $\pi\circ g:\bar{C}\rightarrow V$. For the other direction, let $\bar{g}:\bar{C}\rightarrow V$. We will then define $g$ as
                \begin{align*}
                    g = id_{\mathbb{K}} \oplus \sum_{i=1}^{\infty}(\otimes^{i}\bar{g})\bar{\Delta}_C^{i-1}.
                \end{align*}
                Observe that $g$ is well defined, since convergence of the sum follows from conilpotency of $C$. One may then check that $g$ is a coalgebra homomorphism, which yields the result.
            \end{proof}

            \begin{definition}[Comodules]
                Let $C$ be a coalgebra. A $\mathbb{K}$-module $M$ is said to ba left (right) $C$-comodule if there exist a structure morphism $\omega_M: M \rightarrow C\otimes_{\mathbb{K}}M$ ($\omega_M: M \rightarrow M\otimes_{\mathbb{K}}C$) called comultiplication. We require that $\omega_M$ is coassociative with respect to the comultiplication of $C$ and preserves the counit of $C$, i.e. the electric laws are satisfied.
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                        \node at (-3.5,0) {(Coassociativity)};

                        \node at (0, 1.5) {M};
                        \node[op, scale=0.5] (1) at (0, 0) {$\omega_M$};

                        \draw [line width=1pt] (0, 1) -- (1) -- (-0.5, -0.5) -- (-0.5, -0.75) -- (-0.75, -1) -- (-0.75, -1.25);
                        \draw [line width=1pt] (-0.5, -0.75) -- (-0.25, -1) -- (-0.25, -1.25);
                        \draw [line width=1pt] (1) -- (0.5, -0.5) -- (0.5, -1.25);

                        \node at (1.5,0) {$=$};

                        \node at (3, 1.5) {M};
                        \node[op, scale=0.5] (2) at (3, 0) {$\omega_M$};
                        \node[op, scale=0.5] (3) at (3.5, -0.75) {$\omega_M$};

                        \draw [line width=1pt] (3, 1) -- (2) -- (3) -- (3.25, -1) -- (3.25, -1.25);
                        \draw [line width=1pt] (3) -- (3.75, -1) -- (3.75, -1.25);
                        \draw [line width=1pt] (2) -- (2.5, -0.5) -- (2.5, -1.25);
                    \end{tikzpicture}
                \end{center}
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                        \node at (-3,0) {(Counitality)};

                        \node[op, scale=0.75] (1) at (-0.5, -1) {};

                        \draw [line width=1pt] (0, 1) -- (0, 0) -- (-0.5, -0.5) -- (1);
                        \draw [line width=1pt] (0, 0) -- (0.5, -0.5) -- (0.5, -1);

                        \node at (1,0) {$=$};

                        \draw [line width=1pt] (2,1) -- (2,-1);

                        \node at (3,0) {$=$};

                        \node[op, scale=0.75] (2) at (4.5,-1) {};

                        \draw [line width=1pt] (4, 1) -- (4, 0) -- (3.5, -0.5) -- (3.5, -1);
                        \draw [line width=1pt] (4, 0) -- (4.5, -0.5) -- (2);
                    \end{tikzpicture}
                \end{center}
            \end{definition}

            \begin{definition}[C-colinear homomorphism]
                Let $M,N$ be two left $C$-comodules. A morphism $g:M\rightarrow N$ is called $C$-colinear if it is $\mathbb{K}$-linear and for any $m$ in $M$, $\omega_N(g(m)) = (id_C\otimes g)\omega_M(m)$.
            \end{definition}

            The category of left $C$-comodules is denoted as $CoMod_C$, where the morphisms $CoHom_C(\_,\_)$ are $C$-colinear. Likewise, the category of right $C$-comodules is denoted as $CoMod^C$.

            \begin{proposition}
                Let $M$ be a $\mathbb{K}$-module. The module $C\otimes_{\mathbb{K}}M$ is a left $C$-comodule. Moreover, it is the cofree left comodule over $\mathbb{K}$-modules, i.e. there is an isomorphism $Hom_{\mathbb{K}}(N,M)\simeq CoHom_C(N,C\otimes_{\mathbb{K}}M)$.
            \end{proposition}

    \section{Derivations and DG-Algebras}
            In this section we will look at differential graded objects and convolution products. We will define derivations and coderivations to obtain differential graded algebras and coalgebras. Moreover we will see that the set of homogenous homomorphisms between differential graded objects is itself differential graded. Moreover, whenever we look at morphisms between dg coalgebras and dg algebras, we can give this object the convolution operator, making the set a dg algebra.

            \begin{definition}[Derivations and Coderivations]
                Let $M$ be an $A$-bimodule. A $\mathbb{K}$-linear morphism $d:A\rightarrow M$ is called a derivation if $d(ab)=d(a)b+ad(b)$, i.e. electrically:

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                        \node at (-0.5, 1) {a};
                        \node at (0.5, 1) {b};
                        \node[op, scale = 0.75] (d) at (0,-0.5) {d};

                        \draw [line width=1pt] (-0.5, 0.75) -- (-0.5, 0.5) -- (0,0) -- (0.5,0.5) -- (0.5, 0.75);
                        \draw [line width=1pt] (0,0) -- (d) -- (0,-1);

                        \node at (1,0) {$=$};

                        \node at (1.5, 1) {a};
                        \node at (2.5, 1) {b};

                        \node[op, scale = 0.75] (e) at (1.5, 0.25) {d};
                        \node[op, scale = 0.5] (r) at (2,-0.5) {$\mu_M^r$};

                        \draw [line width=1pt] (1.5, 0.75) -- (e) -- (1.5, 0) -- (r) -- (2.5,0) -- (2.5,0.75);
                        \draw [line width=1pt] (r) -- (2,-1);

                        \node at (3,0) {$+$};

                        \node at (3.5, 1) {a};
                        \node at (4.5, 1) {b};

                        \node[op, scale = 0.75] (f) at (4.5, 0.25) {d};
                        \node[op, scale = 0.5] (l) at (4,-0.5) {$\mu_M^l$};

                        \draw [line width=1pt] (3.5, 0.75) --  (3.5, 0) -- (l) -- (4.5,0) -- (f) -- (4.5,0.75);
                        \draw [line width=1pt] (l) -- (4,-1);
                    \end{tikzpicture}
                \end{center}

                Let $N$ be a $C$-bicomodule. A $\mathbb{K}$-linear morphism $d:N\rightarrow C$ is called a coderivation if $\Delta_C\circ d = (d\otimes id_C)\circ\omega_N^r + (id_C\otimes d)\circ\omega_N^l$, i.e. electrically:
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                        \node[op, scale = 0.75] (d) at (0,0.5) {d};

                        \draw [line width=1pt] (-0.5, -0.75) -- (-0.5, -0.5) -- (0,0) -- (0.5,-0.5) -- (0.5, -0.75);
                        \draw [line width=1pt] (0,0) -- (d) -- (0,1);

                        \node at (1,0) {$=$};

                        \node[op, scale = 0.75] (e) at (1.5, -0.25) {d};
                        \node[op, scale = 0.5] (r) at (2,0.5) {$\omega_N^r$};

                        \draw [line width=1pt] (1.5, -0.75) -- (e) -- (1.5, 0) -- (r) -- (2.5,0) -- (2.5,-0.75);
                        \draw [line width=1pt] (r) -- (2,1);

                        \node at (3,0) {$+$};

                        \node[op, scale = 0.75] (f) at (4.5, -0.25) {d};
                        \node[op, scale = 0.5] (l) at (4,0.5) {$\omega_N^l$};

                        \draw [line width=1pt] (3.5, -0.75) --  (3.5, 0) -- (l) -- (4.5,0) -- (f) -- (4.5,-0.75);
                        \draw [line width=1pt] (l) -- (4,1);
                    \end{tikzpicture}
                \end{center}
            \end{definition}

            \begin{proposition}\label{prop: tensor-derivation}
                Let $V$ be a $\mathbb{K}$-module and $M$ be a $T(V)$-bimodule. A $\mathbb{K}$-linear morphism $f:V\rightarrow M$ uniquely determines a derivation $d_f:T(V)\rightarrow M$, i.e. there is an isomorphism $Hom_{\mathbb{K}}(V,M)\simeq Der(T(V),M)$.

                Let $N$ be a $T^c(V)$-cobimodule. A $\mathbb{K}$-linear morphism $g:M\rightarrow V$ uniquely determines a coderivation $d_g^c:N\rightarrow T^c(V)$, i.e. there is an isomorphism $Hom_{\mathbb{K}}(N,V)\simeq Coder(N,T^c(V))$.
            \end{proposition}

            \begin{proof}
                Let $a_1\otimes ... \otimes a_n$ be an elementary tensor of $T(V)$. We define $d_f(a_1\otimes ... \otimes a_n) = \sum_{i=1}^n a_1...f(a_i)...a_n$ and $d_f(1) = 0$. Notice that $d_f$ is by definition a derivation.

                Restriction to $V$ gives the natural isomorphism. Let $i : V\rightarrow T(V)$, then $i^*d_f = f$. Let $d : T(V) \rightarrow M$ be a derivation, then $d_{i^*d}=d$. Suppose that $g: M \rightarrow N$ is a morphism between $T(V)$-bimodules, then naturality follows from bi-linearity.

                In the dual case, $d_g^c$ is a bit tricky to define. Let $\omega^l_N:N\rightarrow N\otimes T^c(V)$ and $\omega^r_N : N\rightarrow T^c(V) \otimes N$ denote the coactions on $N$. Since $T^c(V)$ is conilpotent we get the same kind of finiteness restrictions on $N$. We define the reduced coactions as $\bar{\omega}^l_N = \omega^l_N - \_\otimes 1$ and $\bar{\omega}^r_N = \omega^r_N - 1\otimes\_\ $, this is well-defined by coassociativity. Observe that for any $n\in N$ there are $k, k'>0$ such that ${\bar{\omega}^{l^k}_N}(n) = 0$ and ${\bar{\omega}^{r^{k'}}_N}(n)=0$.

                Let $n_{(k)}^{(i)}$ denote the extension of $n$ by $k$ coactions at position $i$, i.e. $n_{(k)}^{(i)} = \bar{\omega}^{r^i}_N\bar{\omega}^{l^{k-i}}_N(n)$. The extension of $n$ by $k$ coactions is then the sum over every position $i$, $n_{(k)} = \sum_{i=0}^kn_{(k)}^{(i)}$. Observe that $n_{(0)} = n$. The grade of $n$ may be thought of as the smallest $k$ such that $n_{(k)}$ is zero. This grading gives us the coradical filtration of $N$, and it is exhaustive by the finiteness restrictions given above. So every element of $N$ may be given a finite grade.

                If $g: N \rightarrow V$ is a linear map, we may think of it as a map sending every element of $N$ to an element of $T^c(V)$ of grade $1$. To get a map which sends element of grade $k$ to grade $k$, we must extend the morphism. Let $\pi : T^c(V) \rightarrow V$ be the linear projection and define $g_{(k)}^{(i)} = \pi\otimes ... \otimes \pi \circ g \otimes \pi$ as a morphism which is $g$ at the i-th argument, but the projection otherwise. $d_g^c$ is then defined as the sum over each coaction and coordinate.
                \begin{align*}
                    d_g^c(n) = \sum_{k=0}^\infty \sum_{i=0}^k g_{(k)}^{(i)}(n_{(k)}^{(i)})
                \end{align*}

                Upon closer inspection we may observe that this is the dual construction of the derivation morphism. It is well-defined as the sum is finite by the finiteness restrictions. The map is a coderivation by duality, and the natural isomorphism is given by composition with the projection map $\pi$.
            \end{proof}

            \begin{definition}[Differential algebra]
                Let $A$ be an algebra. We say that $A$ is a differential algebra if it is equipped with at least one derivation $d:A\rightarrow A$. Dually, a coalgebra $C$ is called differential if it is equipped with at least one coderivation $d:C\rightarrow C$.
            \end{definition}

            \begin{definition}[A-derivation]
                Let $(A,d_A)$ be a differential algebra and $M$ a left $A$-module. A $\mathbb{K}$-linear morphism $d_M:M\rightarrow M$ is called an $A$-derivation if $d_M(am)=d_A(a)m + ad_M(m)$, or electrically:
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                        \node at (-0.5, 1) {a};
                        \node at (0.5, 1) {m};
                        \node[op, scale = 0.5] (d) at (0,-0.5) {$d_M$};

                        \draw [line width=1pt] (-0.5, 0.75) -- (-0.5, 0.5) -- (0,0) -- (0.5,0.5) -- (0.5, 0.75);
                        \draw [line width=1pt] (0,0) -- (d) -- (0,-1);

                        \node at (1,0) {$=$};

                        \node at (1.5, 1) {a};
                        \node at (2.5, 1) {m};

                        \node[op, scale = 0.5] (e) at (1.5, 0.25) {$d_A$};

                        \draw [line width=1pt] (1.5, 0.75) -- (e) -- (1.5, 0) -- (2,-0.5) -- (2.5,0) -- (2.5,0.75);
                        \draw [line width=1pt] (2,-0.5) -- (2,-1);

                        \node at (3,0) {$+$};

                        \node at (3.5, 1) {a};
                        \node at (4.5, 1) {m};

                        \node[op, scale = 0.5] (f) at (4.5, 0.25) {$d_M$};

                        \draw [line width=1pt] (3.5, 0.75) --  (3.5, 0) -- (4,-0.5) -- (4.5,0) -- (f) -- (4.5,0.75);
                        \draw [line width=1pt] (4,-0.5) -- (4,-1);
                    \end{tikzpicture}
                \end{center}
                Dually, given a differential coalgebra $(C,d_C)$ and $N$ a left $C$-comodule, a $\mathbb{K}$-linear morphism $d_N:N\rightarrow N$ is a coderivation if $\omega_N\circ d_N = (d_C\otimes id_N + id_C\otimes d_N)\circ \omega_N$, or electrically:
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                        \node[op, scale = 0.5] (d) at (0,0.5) {$d_N$};

                        \draw [line width=1pt] (-0.5, -0.75) -- (-0.5, -0.5) -- (0,0) -- (0.5,-0.5) -- (0.5, -0.75);
                        \draw [line width=1pt] (0,0) -- (d) -- (0,1);

                        \node at (1,0) {$=$};

                        \node[op, scale = 0.5] (e) at (1.5, -0.25) {$d_C$};

                        \draw [line width=1pt] (1.5, -0.75) -- (e) -- (1.5, 0) -- (2,0.5) -- (2.5,0) -- (2.5,-0.75);
                        \draw [line width=1pt] (2,0.5) -- (2,1);

                        \node at (3,0) {$+$};

                        \node[op, scale = 0.5] (f) at (4.5, -0.25) {$d_N$};

                        \draw [line width=1pt] (3.5, -0.75) --  (3.5, 0) -- (4,0.5) -- (4.5,0) -- (f) -- (4.5,-0.75);
                        \draw [line width=1pt] (4,0.5) -- (4,1);
                    \end{tikzpicture}
                \end{center}
            \end{definition}

            \begin{proposition}\label{prop: free-derivation}
                Let $A$ be a differential algebra and $M$ a $\mathbb{K}$-module. A $\mathbb{K}$-linear morphism $f:M\rightarrow A\otimes_{\mathbb{K}} M$ uniquely determines a derivation $d_f:A\otimes M\rightarrow A\otimes M$, i.e. there is an isomorphism $Hom_{\mathbb{K}}(M,A\otimes_{\mathbb{K}}M)\simeq Der(A\otimes_{\mathbb{K}}M)$. Moreover, $d_f$ is given as $(\nabla_A\otimes id_M)\circ (id_A\otimes f) + d_A\otimes id_M$.

                Dually, if $C$ is a differential coalgebra and $N$ is a $\mathbb{K}$-module, then a $\mathbb{K}$-linear morphism $g:C\otimes N\rightarrow N$ uniquely determines a coderivation $d_g:C\otimes_{\mathbb{K}}N\rightarrow C\otimes_{\mathbb{K}}N$. There is an isomorphism $Hom_{\mathbb{K}}(C\otimes_{\mathbb{K}}N,N)\simeq Coder(C\otimes_{\mathbb{K}}N)$, and $d_g$ is given as $(id_C\otimes g)\circ (\Delta_C\otimes id_N) + d_C\otimes id_N$.
            \end{proposition}

            \begin{proof}
                ...
            \end{proof}

            Recall that a module $M^*$ is $\mathbb{Z}$ graded if it decomposes as a sum $M^* = \substack{\bigoplus \\ z:\mathbb{Z}}M^z$. Let $M^*,N^*$ be graded modules and $f:M^*\rightarrow N^*$ is a homogenous $\mathbb{K}$-linear morphism of degree $n$ if it preserves the grading, that is $f(M^i) \subseteq N^{n+i}$. We denote the degree of $f$ as $|f|$. The category of graded modules will be denoted as $GrMod_{\mathbb{K}}$ or $Mod_\mathbb{K}^*$. Generally $\mathcal{C}^*$ is the category of graded objects whenever it makes sense, and the graded $\mathbb{K}$-module of morphisms between two graded objects is denoted as $Hom_{\mathbb{K}}^*(M^*,N^*)$.

            $M^{\bullet}$ is called a chain complex if it comes equipped with a homogenous morphism of degree $1$, like $d_M^{\bullet}:M^{\bullet}\rightarrow M^{\bullet}$, such that ${d_M^{\bullet}}^2=0$. This morphism is called differential. A chain morphism $f: M^{\bullet}\rightarrow N^{\bullet}$ is a homogenous $\mathbb{K}$-linear morphism of degree $0$, such that $f\circ d_M^{\bullet} = d_N^{\bullet}\circ f$. The category of chain complexes will be denoted as $ChMod_{\mathbb{K}}$ or $Mod_\mathbb{K}^\bullet$. Generally $\mathcal{C}^\bullet$ is the category of chain complexes whenever it makes sense, and the $\mathbb{K}$-module of morphisms between two chain complexes is denoted as $Hom_{\mathbb{K}}^{\bullet}(M^{\bullet},N^{\bullet})$.

            The functor $\_[n]:Mod_\mathbb{K}^\bullet\rightarrow Mod_\mathbb{K}^\bullet$ shifts the degree on each object by adding $n$ to each grade, it is called the shift functor. Let $\otimes$ denote the total tensor product in $Mod_\mathbb{K}^\bullet$. There is an isomorphism between the identity shift functor and total tensor of the stalk of $\mathbb{K}$, $\_[0] \simeq \bar{\mathbb{K}}\otimes\_$. In the same manner, shifting $n$-fold becomes isomorphic to tensoring with the shifted stalk of $\mathbb{K}$, $\_[n] \simeq \bar{\mathbb{K}}[n]\otimes\_$. For our purposes we will let $(A^\bullet, d_A^\bullet)[n] = (A^{\bullet + n}, -d_A^{\bullet + n})$. The koszul sign rule gives us a switching map for the tensor product. Thus, if $f^*:A^\bullet\rightarrow B^\bullet$ is a morphism of degree $k$, then $f^*[n] = (-1)^{k\cdot n}f^{*+n}$.

            In electric diagrams we will write triangles for the differential if there are no ambiguity.

            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                    \node[op, scale = 0.75] (1) at (0,0) {$d_M^\bullet$};

                    \draw [line width = 1pt] (0, 1) -- (1) -- (0, -1);

                    \node at (1, 0) {$=$};

                    \node[diff, scale=0.75] (2) at (2, 0) {};

                    \draw [line width = 1pt] (2, 1) -- (2) -- (2, -1);

                \end{tikzpicture}
            \end{center}

            \begin{proposition}
                Let $M^{\bullet}$ and $N^{\bullet}$ be two chain complexes. The graded module of morphisms $Hom_{\mathbb{K}}^*(M^{\bullet},N^{\bullet})$ is a chain complex, given by the differential $\partial(f) = d_N^{\bullet}\circ f - (-1)^{|f|}f\circ d_M^{\bullet}$.
            \end{proposition}

            \begin{proof}
                We observe that $\partial : Hom_{\mathbb{K}}^*(M^{\bullet},N^{\bullet}) \rightarrow Hom_{\mathbb{K}}^*(M^{\bullet},N^{\bullet})$ is a morphism of degree $1$. It remains to check that $\partial^2 = 0$. Pick any homogenous morphism $f : M^{\bullet}\rightarrow N^{\bullet}$.
                \begin{multline*}
                    \partial^2(f) = \partial(d_N^{\bullet}\circ f - (-1)^{|f|}f\circ d_M^{\bullet}) = \partial(d_N^{\bullet}\circ f) - (-1)^{|f|}\partial(f\circ d_M^{\bullet}) \\ = - (-1)^{|d_N^{\bullet}\circ f|}d_N^{\bullet}\circ f\circ d_M^{\bullet} - (-1)^{|f|}d_N^{\bullet}\circ f\circ d_M^{\bullet} = 0
                \end{multline*}
            \end{proof}

            In an electric diagram we write $\partial f$ as a sum of circuits.
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                    \node at (0,0) {$\partial f =$};

                    \node[op, scale=0.75] (f1) at (1, 0.5) {$f$};
                    \node[diff, scale=0.75] (d1) at (1, -0.5) {};

                    \draw [line width = 1pt] (1, 1) -- (f1) -- (d1) -- (1, -1);

                    \node at (2.5, 0) {$+(-1)^{|f|}$};

                    \node[diff, scale=0.75] (d2) at (4, 0.5) {};
                    \node[op, scale=0.75] (f2) at (4, -0.5) {$f$};

                    \draw [line width = 1pt] (4, 1) -- (d2) -- (f2) -- (4, -1);

                \end{tikzpicture}
            \end{center}

            Observe that $f:M^{\bullet}\rightarrow N^{\bullet}$ of degree $0$ is a chain morphism if and only if $\partial(f) = 0$. We then observe that $Hom_{\mathbb{K}}^{\bullet}(M^{\bullet},N^{\bullet})\simeq Z^0Hom_{\mathbb{K}}^*(M^{\bullet})$.

            To complete the definitions of graded modules and chain complexes to algebras we would like the structure morphisms to respect the given structure. E.g. if $a$ and $b$ are homogenous elements, we would like that the degree of $ab$ is the sum of its parts, i.e. $|ab| = |a| + |b|$. Since multiplication by identity doesn't do anything, we want that the identity lives in the $0$'th degree, and so forth.

            \begin{definition}[Graded algebra]
                Let $A^*$ be a graded $\mathbb{K}$-module. We say that $A^*$ is a graded algebra if $A^*$ is an algebra such that $\nabla_A$ and $\upsilon_A$ are homogenous and of degree $0$.
                Dually, $C^*$ is a graded coalgebra if $\Delta_C$ and $\varepsilon_C$ are homogenous and of degree $0$.
            \end{definition}

            \begin{definition}[Differential graded algebra]
                Let $A^{\bullet}$ be a chain complex over $\mathbb{K}$. We say that $A^{\bullet}$ is a differential graded algebra, or dg algebra, if it is a graded algebra and the differential is a graded derivation, i.e. $d_A(ab) = d_A(a)b + (-1)^{|a|}ad_A(b)$.

                Dually, $C^{\bullet}$ is a differential graded coalgebra if $C^{\bullet}$ is a graded coalgebra and the differential is a graded coderivation.
            \end{definition}

    \section{Convolution Algebras}

            Let $C$ be a coalgebra and $A$ an algebra, then if $f,g:C\rightarrow A$ are $\mathbb{K}$-linear morphism we may define $f\star g = \nabla_A(f\otimes g)\Delta_C$. We call the operation $\star$ for convolution.

            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={triangle, draw, scale=0.75}, scale=0.7]

                    \node at (-2.5, 0) {$f\star g$};

                    \node at (-1.5, 0) {$=$};

                    \node[op, scale=0.75] (a) at (-0.5, 0) {$f$};
                    \node[op, scale=0.75] (b) at (0.5, 0) {$g$};

                    \draw [line width=1pt] (0, 1.25) -- (0, 1) -- (-0.5, 0.5) -- (a) -- (-0.5, -0.5) -- (0, -1) -- (0, -1.25);
                    \draw [line width=1pt] (0, 1) -- (0.5, 0.5) -- (b) -- (0.5, -0.5) -- (0, -1);

                \end{tikzpicture}
            \end{center}

            \begin{proposition}[Convolution algebra]
                The $\mathbb{K}$-module $Hom_{\mathbb{K}}(C,A)$ is an associative algebra when equipped with convolution $\star:Hom_{\mathbb{K}}(C,A)\rightarrow Hom_{\mathbb{K}}(C,A)$. The unit is given by $1 \mapsto \upsilon_A\circ\varepsilon_C$.
            \end{proposition}

            \begin{proof}
                This proposition follows from (co)associativity and (co)unitality of (C) A.

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                        % \node at (-3, 0) {Associativity};

                        \node at (-3,0) {$(f\star g) \star h$};

                        \node at (-1, 0) {$=$};

                        \node[op, scale = 0.75] (f1) at (0,0) {f};
                        \node[op, scale = 0.75] (g1) at (1,0) {g};
                        \node[op, scale = 0.75] (h1) at (2,0) {h};

                        \draw (1, 1.5) -- (1,1.25) -- (0.5,1) -- (0.5, 0.75) -- (0,0.5) -- (f1) -- (0,-0.5) -- (0.5, -0.75) -- (0.5,-1) -- (1,-1.25) -- (1, -1.5);
                        \draw (0.5, 0.75) -- (1,0.5) -- (g1) -- (1, -0.5) -- (0.5, -0.75);
                        \draw (1,1.25) -- (2,0.75) -- (h1) -- (2, -0.75) -- (1, -1.25);

                        \node at (3,0) {$=$};

                        \node[op, scale = 0.75] (f2) at (4,0) {f};
                        \node[op, scale = 0.75] (g2) at (5,0) {g};
                        \node[op, scale = 0.75] (h2) at (6,0) {h};

                        \draw (5, 1.5) -- (5,1.25) -- (4, 0.75) -- (f2) -- (4,-0.5) -- (4.5, -0.75) -- (4.5,-1) -- (5,-1.25) -- (5, -1.5);
                        \draw (5, 1.25) -- (5.5, 1) -- (5.5, 0.75) -- (5,0.5) -- (g2) -- (5, -0.5) -- (4.5, -0.75);
                        \draw (5.5, 0.75) -- (6, 0.5) -- (h2) -- (6, -0.75) -- (5, -1.25);

                        \node at (7,0) {$=$};

                        \node[op, scale = 0.75] (f3) at (8,0) {f};
                        \node[op, scale = 0.75] (g3) at (9,0) {g};
                        \node[op, scale = 0.75] (h3) at (10,0) {h};

                        \draw (9, 1.5) -- (9,1.25) -- (8, 0.75) -- (f3) -- (8,-0.75) -- (9,-1.25) -- (9, -1.5);
                        \draw (9, 1.25) -- (9.5, 1) -- (9.5, 0.75) -- (9,0.5) -- (g3) -- (9, -0.5) -- (9.5, -0.75);
                        \draw (9.5, 0.75) -- (10, 0.5) -- (h3) -- (10, -0.5) -- (9.5, -0.75) -- (9.5, -1) -- (9,-1.25);

                        \node at (11, 0) {$=$};

                        \node at (13, 0) {$f\star (g\star h)$};
                    \end{tikzpicture}

                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]
                        \node at (-6, 0) {$(\upsilon_A\circ\varepsilon_C)\star f$};

                        \node at (-4, 0) {$=$};

                        \node[op, scale = 0.75] (f3) at (-2,0) {f};
                        \node[op, scale = 0.5] (c') at (-3, 0.25) {};
                        \node[op, scale = 0.5] (u') at (-3, -0.25) {};

                        \draw (-2.5, 1.25) -- (-2.5, 1) -- (-2, 0.75) -- (f3) -- (-2,-0.75) -- (-2.5,-1) -- (-2.5,-1.25);
                        \draw (-2.5, 1) -- (-3, 0.75) -- (c');
                        \draw (u') -- (-3, -0.75) -- (-2.5, -1);

                        \node at (-1,0) {$=$};

                        \node[op, scale = 0.75] (f1) at (0,0) {f};

                        \draw (0,1) -- (f1) -- (0,-1);

                        \node at (1,0) {$=$};

                        \node[op, scale = 0.75] (f2) at (2,0) {f};
                        \node[op, scale = 0.5] (c) at (3, 0.25) {};
                        \node[op, scale = 0.5] (u) at (3, -0.25) {};

                        \draw (2.5, 1.25) -- (2.5, 1) -- (2, 0.75) -- (f2) -- (2,-0.75) -- (2.5,-1) -- (2.5,-1.25);
                        \draw (2.5, 1) -- (3, 0.75) -- (c);
                        \draw (u) -- (3, -0.75) -- (2.5, -1);

                        \node at (4,0) {$=$};

                        \node at (6, 0) {$f\star (\upsilon_A\circ\varepsilon_C)$};
                    \end{tikzpicture}
                \end{center}
            \end{proof}

            If $A$ is an algebra and $C$ is a coalgebra, then they may be given the structure of a differential algebra by attaching the $0$ morphism to each algebra as the (co)derivation. In this case proposition \ref{prop: free-derivation} says that a morphism $f : M \rightarrow A \otimes_\mathbb{K} M$ determines the derivation given as $d_f = (\nabla_A \otimes id_M) \circ (id_A\otimes f)$. Dually, a morphism $g : C \otimes_\mathbb{K} M \rightarrow M$ determines the coderivation $d_g = (id_C \otimes g) \circ (\Delta_C \otimes id_N)$.

            If $\alpha : C \rightarrow A$ is a $\mathbb{K}$-linear morphism, then there are two ways to extend $\alpha$ to obtain a (co)derivation. Precomposing with $C$s comultiplication gives us a morphism from $C$ to the free $A$-module $A\otimes_\mathbb{K} C$.

            \begin{align*}
                (\alpha \otimes id_C) \circ \Delta_C : C \rightarrow A \otimes_\mathbb{K} C
            \end{align*}

            Postcomposing with $A$s multiplication gives us a morphism from to the cofree $C$-comodule $C\otimes_\mathbb{K}A$ to $A$.
            \begin{align*}
                \nabla_A \circ (\alpha \otimes id_A) : C \otimes_\mathbb{K} A \rightarrow A
            \end{align*}

            Notice that when applying proposition \ref{prop: free-derivation} to both morphisms yields the same map, and it is thus both a derivation and a coderivation.
            \begin{align*}
                d_\alpha = (\nabla_A\otimes id_C) \circ (id_A \otimes \alpha \otimes id_C) \circ (id_A \otimes \Delta_C)
            \end{align*}

            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                    \node at (-3, 0) {$d_\alpha$};

                    \node at (-2, 0) {$=$};

                    \node[op, scale=0.75] (a) at (0,0) {$\alpha$};

                    \draw [line width=1pt] (-0.5, 1.25) -- (-0.5, 1) -- (0, 0.5) -- (a) -- (0, -0.5) -- (0.5, -1) -- (0.5, -1.25);
                    \draw [line width=1pt] (-0.5, 1) -- (-1, 0.5) -- (-1, -1.25);
                    \draw [line width=1pt] (1, 1.25) -- (1, -0.5) -- (0.5, -1);

                \end{tikzpicture}
            \end{center}

            \begin{proposition}\label{prop: convolution to endomorphism}
                $d_{(\_)}:Hom_\mathbb{K}(C,A)\rightarrow End(C\otimes_\mathbb{K}A)$ is a morphism of algebras. Moreover, if $\alpha\star \alpha = 0$, then $d_\alpha^2 = 0$.
            \end{proposition}

            \begin{proof}
                The proof quickly follows from (co)associativity and (co)unitality.
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                        \node at (-3, 0) {$d_{\alpha\star \beta}$};

                        \node at (-2, 0) {$=$};

                        \node[op, scale=0.75] (a) at (-0.5, 0) {$\alpha$};
                        \node[op, scale=0.75] (b) at (0.5, 0) {$\beta$};

                        \draw [line width=1pt] (-0.5, 2) -- (-0.5, 1.75) -- (0, 1.25) -- (0, 1) -- (-0.5, 0.5) -- (a) -- (-0.5, -0.5) -- (0, -1) -- (0, -1.25) -- (0.5, -1.75) -- (0.5, -2);
                        \draw [line width=1pt] (0, 1) -- (0.5, 0.5) -- (b) -- (0.5, -0.5) -- (0, -1);
                        \draw [line width=1pt] (-0.5, 1.75) -- (-1, 1.25) -- (-1, -2);
                        \draw (1, 2) -- (1, -1.25) -- (0.5, -1.75);

                        \node at (2, 0) {$=$};

                        \node[op, scale=0.75] (a') at (4, 0) {$\alpha$};
                        \node[op, scale=0.75] (b') at (5, 0) {$\beta$};

                        \draw [line width=1pt] (4, 2) -- (4, 1.75) -- (3.5, 1.25) -- (3.5, 1) -- (3, 0.5) -- (3, -2);
                        \draw [line width=1pt] (3.5, 1) -- (4, 0.5) -- (a') -- (4, -0.75) -- (5, -1.75);
                        \draw [line width=1pt] (4, 1.75) -- (5, 0.75) -- (b') -- (5, -0.5) -- (5.5, -1);
                        \draw [line width=1pt] (6, 2) -- (6, -0.5) -- (5.5, -1) -- (5.5, -1.25) -- (5, -1.75) -- (5, -2);

                        \node at (7, 0) {$=$};

                        \node at (8.5, 0) {$d_\alpha \circ d_\beta$};

                    \end{tikzpicture}
                \end{center}

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, scale=0.7]

                        \node at (-3.5, 0) {$d_{\upsilon_A \circ\varepsilon_C}$};

                        \node at (-2, 0) {$=$};

                        \node[op, scale=0.5] (a) at (0, 0.25) {};
                        \node[op, scale=0.5] (b) at (0, -0.25) {};

                        \draw [line width=1pt] (-0.5, 1.25) -- (-0.5, 1) -- (0, 0.5) -- (a);
                        \draw [line width=1pt] (b) -- (0, -0.5) -- (0.5, -1) -- (0.5, -1.25);
                        \draw [line width=1pt] (-0.5, 1) -- (-1, 0.5) -- (-1, -1.25);
                        \draw [line width=1pt] (1, 1.25) -- (1, -0.5) -- (0.5, -1);

                        \node at (2, 0) {$=$};

                        \draw [line width=1pt] (3, 1.25) -- (3, -1.25);
                        \draw [line width=1pt] (4, 1.25) -- (4, -1.25);

                        \node at (5, 0) {$=$};
                        \node at (6.5, 0) {$id_{C \otimes_\mathbb{K} A}$};

                    \end{tikzpicture}
                \end{center}
            \end{proof}

            Suppose that $C$ and $A$ are differential graded (co)algebras. We want to expect that the differential $\partial$ makes $Hom_\mathbb{K}^*(C,A)$ into a dg-algebra.

            \begin{proposition}
                The convolution algebra $(Hom_\mathbb{K}^*(C,A),\star)$ is a dg-algebra with differential $\partial$.
            \end{proposition}

            \begin{proof}
                We know that $(Hom_\mathbb{K}^*(C,A),\star)$ is a convolution algebra and that $(Hom_\mathbb{K}^*(C,A),\partial)$ is a chain complex. It remains to verify that the differential is compatible with the multiplication, i.e. $\partial(f\star g) = \partial{f}\star g + (-1)^{|f|}f\star\partial{g}$.

                Let $f,g\in Hom_\mathbb{K}^*(C,A)$ be two homogenous morphisms. The key property to arrive at the result is that the differential in a dg-(co)algebra is a (co)derivation. We denote the degree of $f\star g$ as $|f\star g| = |f| + |g| = d$

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                        \node at (0,0) {$\partial (f\star g) =$};

                        \node at (1.35,0) {$\partial$};
                        \node[op, scale = 0.75] (f1) at (2, 0) {$f$};
                        \node[op, scale = 0.75] (g1) at (3, 0) {$g$};

                        \draw [line width = 1pt] (2.5, 1.25) -- (2.5, 1) -- (2, 0.5) -- (f1) -- (2, -0.5) -- (2.5, -1) -- (2.5, -1.25);
                        \draw [line width = 1pt] (2.5, 1) -- (3, 0.5) -- (g1) -- (3, -0.5) -- (2.5, -1);

                        \node at (4, 0) {$=$};

                        \node[diff, scale=0.75] (d1) at (5.5, -1) {};
                        \node[op, scale=0.75] (f2) at (5, 0.5) {$f$};
                        \node[op, scale=0.75] (g2) at (6, 0.5) {$g$};

                        \draw [line width = 1pt] (5.5, 1.75) -- (5.5, 1.5) -- (5, 1) -- (f2) -- (5, 0) -- (5.5, -0.5) -- (d1) -- (5.5, -1.5);
                        \draw [line width = 1pt] (5.5, 1.5) -- (6, 1) -- (g2) -- (6, 0) -- (5.5, -0.5);

                        \node at (7.5, 0) {$-(-1)^{d}$};

                        \node[op, scale = 0.75] (f3) at (9, -0.5) {$f$};
                        \node[op, scale = 0.75] (g3) at (10, -0.5) {$g$};
                        \node[diff, scale = 0.75] (d2) at (9.5, 1) {};

                        \draw [line width = 1pt] (9.5, 1.5) -- (d2) -- (9.5, 0.5) -- (9, 0) -- (f3) -- (9, -1) -- (9.5, -1.5) -- (9.5, -1.75);
                        \draw [line width = 1pt] (9.5, 0.5) -- (10, 0) -- (g3) -- (10, -1) -- (9.5, -1.5);

                    \end{tikzpicture}
                \end{center}

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                        \node at (0,0) {$=$};

                        \node[op, scale = 0.75] (f1) at (1, 0.5) {$f$};
                        \node[op, scale = 0.75] (g1) at (2, 0) {$g$};
                        \node[diff, scale = 0.75] (d1) at (1, -0.25) {};

                        \draw [line width = 1pt] (1.5, 1.75) -- (1.5, 1.5) -- (1, 1) -- (f1) -- (d1) -- (1, -0.75) -- (1.5, -1.25) -- (1.5, -1.5);
                        \draw [line width = 1pt] (1.5, 1.5) -- (2, 1) -- (g1) -- (2, -0.75) -- (1.5, -1.25);

                        \node at (3.5, 0) {$+(-1)^{|f|}$};

                        \node[op, scale = 0.75] (f2) at (5, 0) {$f$};
                        \node[op, scale = 0.75] (g2) at (6, 0.5) {$g$};
                        \node[diff, scale = 0.75] (d2) at (6, -0.25) {};

                        \draw [line width = 1pt] (5.5, 1.75) -- (5.5, 1.5) -- (5, 1) -- (f2) -- (5, -0.75) -- (5.5, -1.25) -- (5.5, -1.5);
                        \draw [line width = 1pt] (5.5, 1.5) -- (6, 1) -- (g2) -- (d2) -- (6, -0.75) -- (5.5, -1.25) -- (5.5, -1.5);

                        \node at (8.25, 0) {$-(-1)^{d}((-1)^{|g|}$};

                        \node[op, scale = 0.75] (f3) at (10.5, -0.25) {$f$};
                        \node[op, scale = 0.75] (g3) at (11.5, 0) {$g$};
                        \node[diff, scale = 0.75] (d3) at (10.5, 0.5) {};

                        \draw [line width = 1pt] (11, 1.75) -- (11, 1.5) -- (10.5, 1) -- (d3) -- (f3) -- (10.5, -0.75) -- (11, -1.25) -- (11, -1.5);
                        \draw [line width = 1pt] (11, 1.5) -- (11.5, 1) -- (g3) -- (11.5, -0.75) -- (11, -1.25);

                        \node at (12.25, 0) {$+$};

                        \node[op, scale = 0.75] (f4) at (13, 0) {$f$};
                        \node[op, scale = 0.75] (g4) at (14, -0.25) {$g$};
                        \node[diff, scale = 0.75] (d4) at (14, 0.5) {};

                        \draw [line width = 1pt] (13.5, 1.75) -- (13.5, 1.5) -- (13, 1) -- (f4) -- (13, -0.75) -- (13.5, -1.25) -- (13.5, -1.5);
                        \draw [line width = 1pt] (13.5, 1.5) -- (14, 1) -- (d4) -- (g4) -- (14, -0.75) -- (13.5, -1.25);
                        \node at (14.5, 0) {$)$};
                    \end{tikzpicture}
                \end{center}

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                        \node at (0,0) {$=$};

                        \node[op, scale = 0.75] (f1) at (1, 0.5) {$f$};
                        \node[op, scale = 0.75] (g1) at (2, 0) {$g$};
                        \node[diff, scale = 0.75] (d1) at (1, -0.25) {};

                        \draw [line width = 1pt] (1.5, 1.75) -- (1.5, 1.5) -- (1, 1) -- (f1) -- (d1) -- (1, -0.75) -- (1.5, -1.25) -- (1.5, -1.5);
                        \draw [line width = 1pt] (1.5, 1.5) -- (2, 1) -- (g1) -- (2, -0.75) -- (1.5, -1.25);

                        \node at (3.5, 0) {$-(-1)^{|f|}$};

                        \node[op, scale = 0.75] (f3) at (5, -0.25) {$f$};
                        \node[op, scale = 0.75] (g3) at (6, 0) {$g$};
                        \node[diff, scale = 0.75] (d3) at (5, 0.5) {};

                        \draw [line width = 1pt] (5.5, 1.75) -- (5.5, 1.5) -- (5, 1) -- (d3) -- (f3) -- (5, -0.75) -- (5.5, -1.25) -- (5.5, -1.5);
                        \draw [line width = 1pt] (5.5, 1.5) -- (6, 1) -- (g3) -- (6, -0.75) -- (5.5, -1.25) -- (5.5, -1.5);

                        \node at (7.5, 0) {$+(-1)^{|f|}($};

                        \node[op, scale = 0.75] (f2) at (9, 0) {$f$};
                        \node[op, scale = 0.75] (g2) at (10, 0.5) {$g$};
                        \node[diff, scale = 0.75] (d2) at (10, -0.25) {};

                        \draw [line width = 1pt] (9.5, 1.75) -- (9.5, 1.5) -- (9, 1) -- (f2) -- (9, -0.75) -- (9.5, -1.25) -- (9.5, -1.5);
                        \draw [line width = 1pt] (9.5, 1.5) -- (10, 1) -- (g2) -- (d2) -- (10, -0.75) -- (9.5, -1.25) -- (9.5, -1.5);

                        \node at (11.5, 0) {$-(-1)^{|g|}$};

                        \node[op, scale = 0.75] (f4) at (13, 0) {$f$};
                        \node[op, scale = 0.75] (g4) at (14, -0.25) {$g$};
                        \node[diff, scale = 0.75] (d4) at (14, 0.5) {};

                        \draw [line width = 1pt] (13.5, 1.75) -- (13.5, 1.5) -- (13, 1) -- (f4) -- (13, -0.75) -- (13.5, -1.25) -- (13.5, -1.5);
                        \draw [line width = 1pt] (13.5, 1.5) -- (14, 1) -- (d4) -- (g4) -- (14, -0.75) -- (13.5, -1.25);
                        \node at (14.5, 0) {$)$};
                    \end{tikzpicture}
                \end{center}

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                        \node at (0,0) {$=$};

                        \node[op, scale = 0.75] (df) at (1, 0) {$\partial f$};
                        \node[op, scale = 0.75] (g) at (2, 0) {$g$};

                        \draw [line width = 1pt] (1.5, 1.25) -- (1.5, 1) -- (1, 0.5) -- (df) -- (1, -0.5) -- (1.5, -1) -- (1.5, -1.25);
                        \draw [line width = 1pt] (1.5, 1) -- (2, 0.5) -- (g) -- (2, -0.5) -- (1.5, -1);

                        \node at (3.5, 0) {$+(-1)^{|f|}$};

                        \node[op, scale = 0.75] (f) at (5, 0) {$f$};
                        \node[op, scale = 0.75] (dg) at (6, 0) {$\partial g$};

                        \draw [line width = 1pt] (5.5, 1.25) -- (5.5, 1) -- (5, 0.5) -- (f) -- (5, -0.5) -- (5.5, -1) -- (5.5, -1.25);
                        \draw [line width = 1pt] (5.5, 1) -- (6, 0.5) -- (dg) -- (6, -0.5) -- (5.5, -1);

                        \node at (7, 0) {$=$};

                        \node at (10.5, 0) {$\partial (f) \star g + (-1) ^{|f|}f \star \partial (g)$};

                    \end{tikzpicture}
                \end{center}

            \end{proof}

    \section{Twisting Morphisms}

            In this section we will define twisting morphisms from coalgebras to algebras. They are of importance as the bifunctor $Tw(C,A)$ is represented in both arguments. To understand the elements of $Tw$ we start this section be reviewing the Maurer-Cartan equation.

            Suppose that $C$ is a dg-coalgebra and $A$ is a dg-algebra. We say that a morphism $\alpha\in Hom_\mathbb{K}^*(C,A)$ is twisting if it is of degree $-1$ and satisfies the Maurer-Cartan equation:
            \begin{align*}
                \partial\alpha + \alpha\star\alpha = 0\text{.}
            \end{align*}
            We say that $\alpha$ is an element of $Tw(C,A)\subset Hom_\mathbb{K}^{-1}(C,A)\subset Hom_\mathbb{K}^*(C,A)$. In light of proposition \ref{prop: convolution to endomorphism}, every morphism between coalgebras and algebras extend to a unique (co)derivation on the tensor product $C\otimes_\mathbb{K}A$. Let $d_\alpha^r$ denote this unique morphism. In the case of dg-coalgebras and dg-algebras we perturbate the total differential on the tensor with $d_\alpha^r$, as in proposition \ref{prop: free-derivation}. We call this derivation for the perturbated derivative.
            \begin{align*}
                d_\alpha^\bullet = d_{C\otimes_\mathbb{K}A}^\bullet + d_\alpha^r = d_C^\bullet\otimes id_A + id_C\otimes d_A^\bullet + d_\alpha^r
            \end{align*}
            \begin{proposition}\label{prop: twisted-differential}
                Suppose that $C$ is a dg-coalgebra and $A$ is a dg-algebra, and $\alpha\in Hom_\mathbb{K}^*(C,A)$. The perturbated derivation satisfies the following relation.
                \begin{align*}
                    {d^\bullet_\alpha}^2 = d^r_{\partial \alpha + \alpha\star\alpha}
                \end{align*}
                Moreover, a morphism is twisting if and only if the perturbated derivative is a differential.
            \end{proposition}

            \begin{proof}
                ${d^\bullet_\alpha}^2 = d_{C\otimes_\mathbb{K}A}^\bullet \circ d_\alpha^r + d_\alpha^r \circ d_{C\otimes_\mathbb{K}A}^\bullet + {d_\alpha^r}^2$. By proposition \ref{prop: convolution to endomorphism} $d_?^r$ is an algebra homomorphism from the convolution algebra to the endomorphism algebra, thus ${d_\alpha^r}^2 = d_{\alpha\star\alpha}^r$.
                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                        \node at (0,0) {$d_{C\otimes_\mathbb{K} A}^\bullet\circ d_\alpha^r=$};

                        \node[diff, scale = 0.75] (dc1) at (2.25,0) {};
                        \node[op, scale = 0.75] (f1) at (3.25, 0) {$f$};

                        \draw [line width = 1pt] (2.75, 1.75) -- (2.75, 1.5) -- (2.25, 1) -- (dc1) -- (2.25, -1.75);
                        \draw [line width = 1pt] (2.75, 1.5) -- (3.25, 1) -- (f1) -- (3.25, -1) -- (3.75, -1.5) -- (3.75, -1.75);
                        \draw [line width = 1pt] (4.25, 1.75) -- (4.25, -1) -- (3.75, -1.5);

                        \node at (4.75, 0) {$+$};

                        \node[op, scale = 0.75] (f2) at (6.25, 0.5) {$f$};
                        \node[diff, scale = 0.75] (da1) at (6.25, -0.5) {};

                        \draw [line width = 1pt] (5.75, 1.75) -- (5.75, 1.5) -- (5.25, 1) -- (5.25, -1.75);
                        \draw [line width = 1pt] (5.75, 1.5) -- (6.25, 1) -- (f2) -- (da1) -- (6.25, -1) -- (6.75, -1.5) -- (6.75, -1.75);
                        \draw [line width = 1pt] (7.25, 1.75) -- (7.25, -1) -- (6.75, -1.5);

                        \node at (7.75, 0) {$-$};

                        \node[op, scale = 0.75] (f3) at (9.25, 0) {$f$};
                        \node[diff, scale = 0.75] (da2) at (10.25, 0) {};

                        \draw [line width = 1pt] (8.75, 1.75) -- (8.75, 1.5) -- (8.25, 1) -- (8.25, -1.75);
                        \draw [line width = 1pt] (8.75, 1.5) -- (9.25, 1) -- (f3) -- (9.25, -1) -- (9.75, -1.5) -- (9.75, -1.75);
                        \draw [line width = 1pt] (10.25, 1.75) -- (da2) -- (10.25, -1) -- (9.75, -1.5);

                    \end{tikzpicture}
                \end{center}

                \begin{center}
                    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                        \node at (0,0) {$d_\alpha^r\circ d_{C\otimes_\mathbb{K} A}^\bullet=-$};

                        \node[diff, scale = 0.75] (dc1) at (2.25,0) {};
                        \node[op, scale = 0.75] (f1) at (3.25, 0) {$f$};

                        \draw [line width = 1pt] (2.75, 1.75) -- (2.75, 1.5) -- (2.25, 1) -- (dc1) -- (2.25, -1.75);
                        \draw [line width = 1pt] (2.75, 1.5) -- (3.25, 1) -- (f1) -- (3.25, -1) -- (3.75, -1.5) -- (3.75, -1.75);
                        \draw [line width = 1pt] (4.25, 1.75) -- (4.25, -1) -- (3.75, -1.5);

                        \node at (4.75, 0) {$+$};

                        \node[op, scale = 0.75] (f2) at (6.25, -0.5) {$f$};
                        \node[diff, scale = 0.75] (da1) at (6.25, 0.5) {};

                        \draw [line width = 1pt] (5.75, 1.75) -- (5.75, 1.5) -- (5.25, 1) -- (5.25, -1.75);
                        \draw [line width = 1pt] (5.75, 1.5) -- (6.25, 1) -- (da1) -- (f2) -- (6.25, -1) -- (6.75, -1.5) -- (6.75, -1.75);
                        \draw [line width = 1pt] (7.25, 1.75) -- (7.25, -1) -- (6.75, -1.5);

                        \node at (7.75, 0) {$+$};

                        \node[op, scale = 0.75] (f3) at (9.25, 0) {$f$};
                        \node[diff, scale = 0.75] (da2) at (10.25, 0) {};

                        \draw [line width = 1pt] (8.75, 1.75) -- (8.75, 1.5) -- (8.25, 1) -- (8.25, -1.75);
                        \draw [line width = 1pt] (8.75, 1.5) -- (9.25, 1) -- (f3) -- (9.25, -1) -- (9.75, -1.5) -- (9.75, -1.75);
                        \draw [line width = 1pt] (10.25, 1.75) -- (da2) -- (10.25, -1) -- (9.75, -1.5);

                    \end{tikzpicture}
                \end{center}

                By summing the above terms we get
                \begin{align*}
                    d_{C\otimes_\mathbb{K}A}^\bullet\circ d_\alpha^r + d_\alpha^r\circ d_{C\otimes_\mathbb{K} A}^\bullet = d_{d_C^\bullet\circ\alpha + \alpha\circ d_A^\bullet}^r = d_{\partial\alpha}^r\text{,}
                \end{align*}
                to obtain the result.
                \begin{align*}
                    {d_\alpha^\bullet}^2 = d_{C\otimes_\mathbb{K}A}^\bullet \circ d_\alpha^r + d_\alpha^r \circ d_{C\otimes_\mathbb{Kwe}A}^\bullet + {d\alpha^r}^2 = d_{\partial \alpha}^r + d_{\alpha\star\alpha}^r = d_{\partial \alpha + \alpha\star\alpha}
                \end{align*}
            \end{proof}

            \begin{corollary}
                If $\alpha:C\rightarrow A$ is a twisting morphism, then $(C\otimes_\mathbb{K}A, d_\alpha^\bullet)$ is a chain complex. It is called the right twisted tensor product and is denoted as $C\otimes_\alpha A$.
            \end{corollary}

            Normally $A\otimes C$ and $C\otimes A$ are isomorphic as modules. In general, it is not true that $C\otimes_\alpha A$ and $A\otimes\alpha C$ are isomorphic, since we choose a particular side to perform the twisting. However, if $A$ is commutative and $C$ is cocommutative then they are isomorphic. To illustrate we realize the unique derivation above as a right derivative. The left derivative $d_\alpha^l$ is then defined analogously.
            \begin{center}
                \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm, thick, op/.style={circle, draw, scale=0.75}, diff/.style={regular polygon, draw, regular polygon sides = 3, scale=0.75, rotate = 180}, scale=0.7]

                    \node at (0, 0) {$d_\alpha^l =$};

                    \node[op, scale = 0.75] (a) at (2, 0) {$\alpha$};

                    \draw [line width = 1pt] (1, 1.25) -- (1, -0.5) -- (1.5, -1) -- (1.5, -1.25);
                    \draw [line width = 1pt] (2.5, 1.25) -- (2.5, 1) -- (2, 0.5) -- (a) -- (2, -0.5) -- (1.5, -1) -- (1.5, -1.25);
                    \draw [line width = 1pt] (2.5, 1) -- (3, 0.5) -- (3, -1.25);

                \end{tikzpicture}
            \end{center}

            \begin{remark}
                Functoriality of $\otimes_\alpha$ is obtained from the category of elements. I propose that there is an equivalence of categories, that is:
                \begin{align*}
                    \int_{(C,A)} Tw(C,A) \simeq \text{right twisted tensors.}
                \end{align*}
            \end{remark}

    \section{Bar and Cobar Construction}

            The bar and cobar construction has been subjected to abstraction many times since its creation (Reference here!). The bar construction was made by MacLane and Moore in the 50s (Reference here!). It's dual, the cobar construction was made by Adams (reference here! Jeg har kildene på lesesal, lover) to complement their work. We will mainly follow the work of \cite{Loday12} to obtain the bar and cobar construction. The approach which we are going to take is slightly inspired by MacLanes\cite{MacLane71} canonical resolutions of comonads.

            For our purposes, the bar construction of an augmented algebra is a simplicial resoulution with the cofree coalgebra structure. For a dg-algebra, we will realize this resoultion as the total complex of its resoultion. Dually, the cobar construction of a conilpotent coalgebra is a cosimplicial resolution with the free algebra structure. We will see that these constructions defines an adjoint pair of functors.

            \begin{definition}
                The simplex category $\Delta$ consists of ordered sets $[0] = \emptyset$ and $[n] = \startset{1,...,n}$ for any $n\in\mathbb{N}$. A morphism is a monotone function between the sets.

                $\Delta^+$ is the full subcategory of $\Delta$ where $n>0$. $\Delta_+$ is the wide subcategory of $\Delta$ with only injective functions.
            \end{definition}

            The simplex category comes equipped with coface and codegeneracy morphisms. The coface maps are the injective morphisms $\delta_i : [n] \rightarrow [n+1]$, and the codegeneracy maps are the surjective morphisms $\sigma_i: [n] \rightarrow [n-1]$.
            \begin{align*}
                \delta_i(k) = \biggl\{\substack{k\text{, if }k<i \\ k+1\text{, otherwise}} \qquad
                \sigma_i(k) = \biggl\{\substack{k\text{, if }k\leq i \\ k-1\text{, otherwise}}
            \end{align*}

            Every morphism in $\Delta$ may be realized as a composition of coface and codegeneracy maps, see \cite{MacLane71}. Furthermore, these maps are characterized by some identites, called the cosimplicial identites.
            \begin{align*}
                1.&\ \delta_j\delta_i = \delta_i\delta_{j-1} \text{, if }i<j \\
                2.&\ \sigma_j\delta_i = \delta_i\sigma_{j-1} \text{, if }i<j \\
                3.&\ \sigma_j\delta_i = id \text{, if }i=j\text{ or }i=j+1 \\
                4.&\ \sigma_j\delta_i = \delta_{i-1}\sigma_j \text{, if }i>j+1 \\
                5.&\ \sigma_j\sigma_i = \sigma_i\sigma_{j+1} \text{, if }i\leq j
            \end{align*}
            We may arrange the arrows of the simplex category in the following way:
            \begin{center}
                \begin{tikzcd}
                    {[}0{]} \ar[]{r}[]{} & {[}1{]} \ar[yshift = 0.5ex]{r}[]{\delta_i} \ar[yshift = -0.5ex]{r}[]{} & {[}2{]} \ar[yshift = 0.75ex]{r}[]{\delta_i} \ar[]{r}[]{} \ar[yshift = -0.75ex]{r}[]{} & {[}3{]} \ar[yshift = 1ex]{r}[]{\delta_i} \ar[yshift = 0.33ex]{r}[]{} \ar[yshift = -0.33ex]{r}[]{} \ar[yshift = -1ex]{r}[]{} & ...
                \end{tikzcd}

                \begin{tikzcd}
                    {[}0{]} & {[}1{]} & {[}2{]} \ar[]{l}[above]{\sigma_1} & {[}3{]} \ar[yshift = 0.5ex]{l}[above]{\sigma_i} \ar[yshift = -0.5ex]{l}[]{} & ... \ar[yshift = 0.75ex]{l}[above]{\sigma_i} \ar[]{l}[]{} \ar[yshift = -0.75ex]{l}[]{}
                \end{tikzcd}
            \end{center}

            Let $\mathcal{C}$ be a category. A simplicial object in $\mathcal{C}$ is a functor $S:(\Delta^+)^{op}\rightarrow \mathcal{C}$. It may be viewed as a collection of objects $\startset{S_n}_{n\in\mathbb{N}^+}$ together with face maps $d^i:S_n\rightarrow S_{n-1}$ and degeneracy maps $s^i:S_n \rightarrow S_{n+1}$ satisfying the simplicial identities. An augmented simplicial object is a functor $S:\Delta^{op}\rightarrow \mathcal{C}$. The restricted functor $S^+:(\Delta^+)^{op}\rightarrow \mathcal{C}$ is the augmentation ideal of $S$. An augmented semi-simplicial object is a functor $S:(\Delta_+)^{op}\rightarrow \mathcal{C}$. Dually, a cosimplicial object is a functor $S:\Delta^+\rightarrow \mathcal{C}$, it may be regarded as a sequence of objects with coface and codegeneracy maps satisfying the cosimplicial identities.

            Let $\mathcal{A}$ be an abelian category. To each semi-simplical object $M:(\Delta^+_+)^{op}\rightarrow \mathcal{A}$ there is an associated chain complex $M^\bullet$. Let $M^\bullet = \bigoplus_{i=1}^\infty M[i]$ with differential $d_M^n = \sum_{i=1}^n (-1)^{i-1}d^i$. This differential is well-defined by simplicial identity $1$.
            \begin{center}
                \begin{tikzcd}
                    ... \ar[]{r}[]{} & M_3 \ar[]{r}[]{d^1-d^2+d^3} & M_2 \ar[]{r}[]{d^1-d^2} & M_1 \ar[]{r}[]{0} & 0 \ar[]{r}[]{} & ...
                \end{tikzcd}
            \end{center}
            As face maps and degeneracy maps have the same identites, but flipped around, we could also have defined a chain complex by using the degeneracies instead.

            The simplex category has a universal monoid. Let $+:\Delta\time\Delta\rightarrow\Delta$ be a functor acting on objects and morphisms as:
            \begin{align*}
                [m]+[n] = [m+n] \\
                (f+g)(k) = \biggl\{\substack{f(k)\text{, if }k\leq m \\ g(k)+m\text{, otherwise}}
            \end{align*}
            Notice that $[0]+\_\simeq Id_\Delta$, so $(\Delta, +, [0])$ is a monoidal category. Since $[1]$ is terminal in $\Delta$ it becomes a monoid with $\delta_0: [0]\rightarrow [1]$ as unit and $\sigma_1:[2]\rightarrow [1]$ as multiplication. Associativity and unitality is satisfied by uniqueness of morphisms $f:[n]\rightarrow [1]$.
            \begin{proposition}\label{prop: universal-monoid}
                Let $(\mathcal{C}, \otimes, Z)$ be a monoidal category. If $(C, \eta, \mu)$ is a monoid in $\mathcal{C}$, then there is a strong monoidal functor $:\Delta\rightarrow \mathcal{C}$, such that $F[1] \simeq C$, $F\delta_0 \simeq \eta$ and $F\sigma_1 \simeq \mu$.
            \end{proposition}

            % A monad is a monoid in the monoidal category of endofunctors. This is a functor $M:\mathcal{C}\rightarrow\mathcal{C}$, with natural transformations $\mu:M^2\implies M$ and $\eta:Id_\mathcal{C}\implies M$ called multiplication and unit. The triple $(M, \mu, \eta)$ is a monad whenever it is a monoid, i.e. multiplication satisfies associativity and unit is the unit of the multiplication. Dually a comonad $W:\mathcal{C}\rightarrow\mathcal{C}$ is a triple $(W, \nu, \varepsilon)$ such that it is a comonoid.

            % \begin{proposition}
            %     Suppose that $W:\mathcal{C}\rightarrow\mathcal{C}$ is comonad. The sequence of functors $(W^{n})_\mathbb{N}$ is an augmented simplicial functor with face and degeneracy maps
            %     \begin{align*}
            %         d_n^i & = W^i\varepsilon_{W^{n-i}} \\
            %         s_n^i & = W^i\nu_{W^{n-i}}\text{.}
            %     \end{align*}

            %     Suppose that $M:\mathcal{C}\rightarrow\mathcal{C}$ is a monad. The sequence of functors $(M^{n})_\mathbb{N}$ is a coaugmented cosimplicial functor with coface and codegeneracy maps
            %     \begin{align*}
            %         d^n_i & = M^i\eta_{M^{n-i}} \\
            %         s^n_i & = M^i\mu_{M^{n-i}}\text{.}
            %     \end{align*}
            % \end{proposition}

            % \begin{proof}
            %     Follows from the universal property of the simplex category, see \cite{MacLane71}.
            % \end{proof}

            % Let $W^?:\Delta^{op}\rightarrow\mathcal{C}$ denote the simplical functor. If $C\in\mathcal{C}$ is an object, then there is a simplical object, denoted $W_C^?$. The face and degeneracy maps are obtained by applying $C$, i.e. $(d_n^i)_C$ and $(s_n^i)_C$. Dually, if $M$ is a monad we obtain a cosimplicial object $M_C^?$.

            % \begin{definition}
            %     Suppose that $\mathcal{A}$ is an abelian category. Let $W:\mathcal{A}\rightarrow\mathcal{A}$ be a comonad and $A$ and object of $\mathcal{A}$. The canonical $W$-projective resolution of $A$ is the chain complex $W^\bullet_A$ together with an augmentation $\varepsilon_A:W^\bullet_A \rightarrow A$.

            %     Dually, suppose that $M:\mathcal{A}\rightarrow\mathcal{A}$ is a monad. The canonical $M$-injective resolution of A is the chain complex $M_A^\bullet$ together with an augmentation $\eta_A:A\rightarrow MA$.
            % \end{definition}

            % \begin{remark}
            %     It makes sense to call these canonical resolutions for projective or injective. Whenever the object $A$ is $W$-projective we get that the augmentation is a quasi-isomorphism. See Weibel for more information.
            % \end{remark}

            % \begin{lemma}\label{lem: adjoints-make-monads}
            %     Suppose that there is an adjoint pair of functors $F: \mathcal{C}\rightleftharpoons\mathcal{D}:G$, where $F$ is left adjoint to $G$. The composite $GF$ is a monad, and $FG$ is a comonad.
            % \end{lemma}

            % We will use this lemma to construct the canonical resolution for algebras. One may observe that this is the same as the Hochschild complex.

            % \begin{example}
            %     Let $A$ be an algebra over the ring $\mathbb{K}$. The functor $A\otimes_\mathbb{K}\_:Mod_\mathbb{K}\rightarrow Mod_A$ is the free $A$-module over a $\mathbb{K}$-module. Let $U:Mod_A\rightarrow Mod_\mathbb{K}$ denote the forgetfull functor.

            %     \begin{minipage}[c]{0.3\textwidth}
            %         \begin{center}
            %             \begin{tikzcd}
            %                 Mod_\mathbb{K} \ar[phantom]{r}{\top} \ar[bend right]{r}[below]{A\otimes_\mathbb{K}\_} & Mod_A \ar[bend right]{l}[above]{U}
            %             \end{tikzcd}
            %         \end{center}
            %     \end{minipage}
            %     \begin{minipage}[c]{0.7\textwidth}
            %         The unit of the adjunction is given by adjoining the unit of $A$, $\eta_M(m) = 1_A \otimes m$. The counit is given by the structure morphism of each $A$-module, i.e. $\varepsilon_M:A\otimes_\mathbb{K}M\rightarrow M$ is the algebra action. These morphisms are by definition natural and satisfy the triangle identities.
            %     \end{minipage}

            %     By lemma \ref{lem: adjoints-make-monads} $A\otimes_\mathbb{K}U : Mod_A \rightarrow Mod_A$ is a comonad. $\varepsilon$ is the counit and the comultiplication is given by $A\otimes_\mathbb{K}\eta_U$. If $M$ is an $A$-module we get the canonical free-resolution of $M$ as $A\otimes_\mathbb{K}U_M^\bullet$:
            %     \begin{center}
            %         \begin{tikzcd}
            %             ... \ar[]{r}[]{} & A\otimes_\mathbb{K}A\otimes_\mathbb{K}M \ar[]{r}[]{\substack{\varepsilon_{A\otimes\mathbb{K}M} \\ -A\otimes_\mathbb{K}\varepsilon_M}} & A\otimes_\mathbb{K}M \ar[]{r}[]{0} & 0 \ar[]{r}[]{} & ...
            %         \end{tikzcd}
            %     \end{center}
            % \end{example}

            An algebra $A$ is a monoid in the monoidal category $(Mod_\mathbb{K}, \otimes_\mathbb{K}, \mathbb{K})$. By proposition \ref{prop: universal-monoid} we may think of $A$ as an augmented cosimplicial object $A:\Delta \rightarrow Mod_\mathbb{K}$. Notice that all of the cosimplical identities follow from associativity and unitality. If $A$ is an augmented algebra, we may instead give it the structure of an augmented simplicial set. Let $d^1_1 = \varepsilon_A$ be the augmentation. We define $d^n_n = A^{\otimes n-1}\otimes\varepsilon_A$ and set $d^i_n = A^{i-1}\otimes \nabla_A \otimes A^{\otimes n-i-1}$. All the degeneracies are set to be the units, i.e. $s^i_n = A^{\otimes i}\otimes \upsilon_A \otimes A^{\otimes n-i-1}$. One may check that this structure defines a simplical object $A:\Delta^{op}\rightarrow Mod_\mathbb{K}$. Observe that the associated chain complex $A^\bullet$ is exactly the Hochschild complex of $A$. We depict the simplicial object as the following diagram:
            \begin{center}
                \begin{tikzcd}
                    \mathbb{K} & A \ar[]{l}[above]{\varepsilon_A} & A^{\otimes 2} \ar[yshift = 0.5ex]{l}[above]{\nabla_A} \ar[yshift = -0.5ex]{l}[]{A\otimes \varepsilon_A} & A^{\otimes 3} \ar[yshift = 0.75ex]{l}[above]{\nabla_A} \ar[]{l}[]{} \ar[yshift = -0.75ex]{l}[]{A^{\otimes 2}\otimes \varepsilon_A} & ... \ar[yshift = 1ex]{l}[above]{\nabla_A} \ar[yshift = 0.33ex]{l}[]{} \ar[yshift = -0.33ex]{l}[]{} \ar[yshift = -1ex]{l}[]{A^{\otimes 4}\otimes\varepsilon_A}
                \end{tikzcd}

                \begin{tikzcd}
                    \mathbb{K} & A \ar[]{r}[]{s^1} & A^{\otimes 2} \ar[yshift = 0.5ex]{r}[]{s^i} \ar[yshift = -0.5ex]{r}[]{} & A^{\otimes 3} \ar[yshift = 0.75ex]{r}[]{s^i} \ar[]{r}[]{} \ar[yshift = -0.75ex]{r}[]{} & ...
                \end{tikzcd}
            \end{center}

            The augmentation ideal $\bar{A}$ carries a natural semi-simplical structure induced by $A$. By restricting each of the face maps ${\bar{d}}^i = d^i {\mid}_{\bar{A}}:\bar{A}^{\otimes n} \rightarrow \bar{A}^{\otimes n-1}$ we obtain the maps together with the simplical identity 1. This is the non-unital Hochschild complex of $A$. We may depict the semi-simplical object as the following diagram:
            \begin{center}
                \begin{tikzcd}
                    \mathbb{K} & \bar{A} \ar[]{l}[above]{0} & \bar{A}^{\otimes 2} \ar[yshift = 0.5ex]{l}[above]{\nabla_A} \ar[yshift = -0.5ex]{l}[]{0} & \bar{A}^{\otimes 3} \ar[yshift = 0.75ex]{l}[above]{\nabla_A} \ar[]{l}[]{} \ar[yshift = -0.75ex]{l}[]{0} & ... \ar[yshift = 1ex]{l}[above]{\nabla_A} \ar[yshift = 0.33ex]{l}[]{} \ar[yshift = -0.33ex]{l}[]{} \ar[yshift = -1ex]{l}[]{0}
                \end{tikzcd}
            \end{center}

            Notice that as graded modules, the chain complex $\bar{A}^\bullet$ is isomorphic to $T^c(\bar{A})$. We will now instead consider the suspended non-unital algebra $\bar{A}[1]$. Every algebra may be considered as a graded algebra concentrated in degree $0$, the shift functor then recontextualize the degree the algebra is concentrated in. With Koszul sign rule, we may define the suspended multiplication as $\nabla_{A[1]}(a_1 \otimes a_2) = (-1)^{|a_1|}a_1a_2$. Notice that $\nabla_{A[1]}$ is a morphism of degree $-1$. Repeating Koszul sign rule, we may se that associativity does not longer hold, as multiplying the multiplication on the right first introduces a sign, contrary to first multiplying on the left side.

            \begin{proposition}
                The suspended augmentation ideal $\bar{A}[1]$ is a semi-simplical set with face maps:
                \begin{align*}
                    \bar{d}^i = (-1)^{i-1}d^i = (-1)^{i-1}(\nabla_{A[1]})_{(i-1)}^{(n-1)}\text{.}
                \end{align*}
            \end{proposition}

            \begin{corollary}\label{cor: a-to-dgc}
                The differential $d_{\bar{A}[1]}^\bullet$ is a coderivation for the cofree coalgebra $T^c(\bar{A}[1])$. Thus $(\bar{A}[1]^\bullet, d_{\bar{A}[1]}^\bullet)$ is a dg-coalgebra.
            \end{corollary}

            \begin{proof}
                The differential is given by the alternating sum of face maps.
                \begin{align*}
                    d_{\bar{A}[1]}^n = \sum_{i=1}^n (-1)^{i-1}\bar{d}^i = \sum_{i=1}^n (-1)^{2(i-1)}d^i = \sum_{i=1}^n (\nabla_{A[1]})_{(i-1)}^{(n-1)}
                \end{align*}
                By injecting $\bar{A}[1]$ into $T^c(\bar{A}[1])$ we may think of $\nabla_{\bar{A}[1]} : \bar{A}[1]^{\otimes 2} \rightarrow T^c(\bar{A}[1])$ as a morphism into the tensor coalgebra. By using proposition \ref{prop: tensor-derivation}, $\nabla_{\bar{A}[1]}$ extends uniquely into a coderivation:
                \begin{align*}
                    d_{\bar{A}[1]}^c = \sum_{n=0}^{\infty}\sum_{i=0}^n(\nabla_{\bar{A}[1]})_{(i)}^{(n)} = d_{\bar{A}[1]}^\bullet\text{.}
                \end{align*}
            \end{proof}

            If $(A, d_A^\bullet)$ is an augmented dg-algebra, then $A$ is a simplical object of $Mod_\mathbb{K}^\bullet$. It has an associated chain complex. Taking the alternate sum of face maps gives us a double complex as below. We define the double complex $A^\bullet$ as the associated chain complex to $A$.
            \begin{center}
                \begin{tikzcd}
                    & \vdots \ar[xshift = -1ex]{d}[left]{\nabla_A} \ar[]{d}[]{} \ar[xshift = 1ex]{d}[]{A^{\otimes 2}\otimes\varepsilon_A} & \vdots \ar[xshift = -1ex]{d}[left]{\nabla_A} \ar[]{d}[]{} \ar[xshift = 1ex]{d}[]{A^{\otimes 2}\otimes\varepsilon_A} & \vdots \ar[xshift = -1ex]{d}[left]{\nabla_A} \ar[]{d}[]{} \ar[xshift = 1ex]{d}[]{A^{\otimes 2}\otimes\varepsilon_A} & \\
                    ... \ar[]{r}[below]{d_{A^{\otimes 2}}^\bullet} & (A^{\otimes 2})^{1} \ar[]{r}[below]{d_{A^{\otimes 2}}^\bullet} \ar[xshift = -0.5ex]{d}[left]{\nabla_A} \ar[xshift = 0.5ex]{d}[]{A\otimes\varepsilon_A} & (A^{\otimes 2})^0 \ar[]{r}[below]{d_{A^{\otimes 2}}^\bullet} \ar[xshift = -0.5ex]{d}[left]{\nabla_A} \ar[xshift = 0.5ex]{d}[]{A\otimes\varepsilon_A} & (A^{\otimes 2})^{-1} \ar[]{r}[below]{d_{A^{\otimes 2}}^\bullet} \ar[xshift = -0.5ex]{d}[left]{\nabla_A} \ar[xshift = 0.5ex]{d}[]{A\otimes\varepsilon_A} & ... \\
                    ... \ar[]{r}[below]{d_A^\bullet} & A^{1} \ar[]{r}[below]{d_A^\bullet} \ar[]{d}[]{\varepsilon_A} & A^0 \ar[]{r}[below]{d_A^\bullet} \ar[]{d}[]{\varepsilon_A} & A^{-1} \ar[]{r}[below]{d_A^\bullet} \ar[]{d}[]{\varepsilon_A} & ... \\
                    ... \ar[]{r}[below]{0} & 0 \ar[]{r}[below]{0} & \mathbb{K} \ar[]{r}[below]{0} & 0 \ar[]{r}[below]{0} & ...
                \end{tikzcd}
            \end{center}

            For simplicity we write $d_1$ for the horizontal differential and $d_2$ for the vertical differential. The total associated chain complex is the total complex for $Tot(A^\bullet)$, denoted $A^\bullet$ if there are no confusion. In the case of the suspended algebra, the signs mess up commutativity of the squares, thus we change the sign of the horizontal differential to $(-1)^n$. We may also define the differential of the total complex simply as the sum of $d_1$ and $d_2$.

            \begin{proposition}
                Let $A$ an augmented dg-algebra. The bar complex $BA$ is the total associated chain complex $\bar{A}[1]^\bullet$ of the suspended augmentation ideal $\bar{A}$. $(BA, d_{BA}^\bullet)$ is the cofree conilpotent coalgebra equipped with $d_{BA}^\bullet = d_1 + d_2$ as coderivation.
            \end{proposition}

            \begin{proof}
                    It is apparent that $d_1$ and $d_2$ are coderivations with respect to deconcatenation. Since the multiplication $\nabla_A$ is a chain map ${d_{BA}^\bullet}^2 = d_1 \circ d_2 + d_2 \circ d_1= 0$. We will show this for each element in $A^{\otimes 2}$, then the result may be extended to all of $BA$.

                \begin{multline*}
                    d_1 \circ d_2 (a_1\otimes a_2) = (-1)^{|a_1|}d_1 (a_1a_2) = (-1)^{|a_1|}d_A^\bullet[1](a_1a_2) \\ = (-1)^{|a_1|+1}d_A^\bullet(a_1a_2) = (-1)^{|a_1|+1}(d_A^\bullet(a_1)a_2 + (-1)^{|a_1|}a_1d_A^\bullet(a_2)) \\ = (-1)^{|a_1|+1}d_A^\bullet(a_1)a_2 - a_1d_A^\bullet(a_2)
                \end{multline*}
                \begin{multline*}
                    d_2\circ d_1 (a_1\otimes a_2) = d_2\circ (d_A^\bullet[1]\otimes id_{A[1]} + id_{A[1]}\otimes d_A^\bullet[1]) (a_1\otimes a_2) \\ = -d_2 \circ (d_A^\bullet(a_1)\otimes a_2 + (-1)^{|a_1|+1}a_1\otimes d_A^\bullet(a_2)) \\ = (-1)^{|d_A^\bullet(a_1)|+1}d_A^\bullet(a_1)a_2 + (-1)^{2|a_1|+2}a_1d_A^\bullet d_A^\bullet(a_2) \\ = (-1)^{|a_1|}d_A^\bullet(a_1)a_2 + a_1d_A^\bullet (a_2) = -d_1\circ d_2 (a_1\otimes a_2)
                \end{multline*}
            \end{proof}

            \begin{remark}
                For now we don't need to show that $BA$ is a functor. This property follows from $BA$ being the representing object of $Tw(\_,A)$.
            \end{remark}

            On the other hand, a coalgebra $C$ is a comonoid in $Mod_\mathbb{K}$. By the dual of proposition \ref{prop: universal-monoid} we may think of it as a simplical object $C:(\Delta)^{op} \rightarrow Mod_\mathbb{K}$. Dually, all of the simplical identities follows from coassociativity and counitality. A coaugmented coalgebra $C$ may be given a cosimplicial structure in the opposite way of algebras. We then get that the coaugmentation quotient $\bar{C}$ is a semi-cosimplical object of $Mod_\mathbb{K}$. Observe that $\bar{C}$ has an associated chain complex like $\bar{A}$, but every arrow goes in the opposite direction.

            \begin{center}
                \begin{tikzcd}
                    \mathbb{K} \ar[]{r}[]{\upsilon_C} & C \ar[yshift = 0.5ex]{r}[]{\Delta_C} \ar[yshift = -0.5ex]{r}[below]{A\otimes \upsilon_C} & C^{\otimes 2} \ar[yshift = 0.75ex]{r}[]{\Delta_C} \ar[]{r}[]{} \ar[yshift = -0.75ex]{r}[below]{C^{\otimes 2}\otimes \upsilon_C} & C^{\otimes 3} \ar[yshift = 1ex]{r}[]{\Delta_C} \ar[yshift = 0.33ex]{r}[]{} \ar[yshift = -0.33ex]{r}[]{} \ar[yshift = -1ex]{r}[below]{C^{\otimes 4}\otimes\upsilon_C} & ...
                \end{tikzcd}

                \begin{tikzcd}
                    \mathbb{K} & C & C^{\otimes 2} \ar[]{l}[above]{s_1} & C^{\otimes 3} \ar[yshift = 0.5ex]{l}[above]{s_i} \ar[yshift = -0.5ex]{l}[]{} & ... \ar[yshift = 0.75ex]{l}[above]{s_i} \ar[]{l}[]{} \ar[yshift = -0.75ex]{l}[]{}
                \end{tikzcd}
            \end{center}

            The cobar construction is made from the inverse shifted, or desuspended coalgebra $C[-1]$. We realize it as the free tensor algebra $T(\bar{C}[-1])$, where the comultiplication $\Delta_{\bar{C}[-1]}$ induces a derivation $d_{\bar{C}[-1]}$ by proposition \ref{prop: tensor-derivation}.

            \begin{remark}
                As we have chosen to define $\nabla_{A[1]}(a_1\otimes a_2)=(-1)^{|a_1|}a_1a_2$, we are forced by the linear dual to define $\Delta_{C[-1]}(c)=-(-1)^{|c_{(1)}|}c_{(1)}\otimes c_{(2)}$.
            \end{remark}

            \begin{proposition}
                Let $C$ be a coaugmented dg-coalgebra. The cobar complex $\Omega C$ is the total associated chain complex $\bar{C}[-1]^\bullet$ of the desuspended coaugmentation quotient $\bar{C}$. $(\Omega C, D_{\Omega C}^\bullet)$ is the free algebra equipped with $d_{\Omega C}^\bullet = d_1 + d_2$ as derivation.
            \end{proposition}

            We will now see that the bar and cobar construction defines an adjoint pair of functors. Note that since for any conilpotent dg-coalgebra $C$, the object $\Omega C$ represents the functor in the category of augmented algebras. By Yoneda's lemma, the data of morphisms are then defined, so $\Omega$ does truly define a functor.

            \begin{thm}
                Let $C$ be a conilpotent dg-coalgebra and $A$ an augmented dg-algebra. The functor $Tw(C,A)$ is represented in both arguments, i.e.
                \begin{align*}
                    \substack{Aug \\ Alg}^\bullet(\Omega C, A)\simeq Tw(C, A) \simeq\substack{Conil \\ CoAlg}^\bullet(C, BA)\text{.}
                \end{align*}
            \end{thm}

            \begin{proof}
                We will show that $\Omega C$ represents the set of twisting morphisms in the first argument. Showing that $BA$ represents the second argument uses every dual proposition. Thus, it is necessary that $C$ is conilpotent, in order to dualize the arguments.

                Suppose that $f:\Omega C \rightarrow A$ is an augmented dg-algebra homomorphism. $f$ is then a morphism of degree $0$. By freeness, $f$ is uniquely determined by a morphism $f\mid_{\bar{C}[-1]}:\bar{C}\rightarrow \bar{A}$ of degree $0$, which corresponds to a morphism $f':C\rightarrow A$ of degree $-1$.

                Since $f$ is a morphism of chain complexes it commutes with the differential, i.e.
                \begin{align*}
                    f\circ d_{\Omega C}^\bullet = d_A^\bullet\circ f \\
                    f\circ (d_1 + d_2) = d_A^\bullet\circ f
                \end{align*}
                This is equivalent to say that $-f'\circ d_C^\bullet - f'\star f' = d_A^\bullet\circ f'$. Thus $f'$ is a twisting morphism.
            \end{proof}

    \section{Strongly Homotopy Associative Algebras and Coalgebras}
        We have seen from corollary \ref{cor: a-to-dgc} that any algebra $A$ defines a dg-coalgebra $T^c(A[1])$, the bar construction, with a coderivation $m^c$ of degree $-1$. Does this however work in reverse? I.e. if $A$ is a vector space such that $T^c(A[1])$ with coderivation $m^c$ is a dg-coalgebra, is then $A$ an algebra. The answer to this is no, but it leads to the definition of a strongly homotopy associative algebra.

        \begin{definition}
            An $A_\infty$-algebra is a graded vector space $A$ together with a differential $m:\bar{T}^c(A[1])\rightarrow\bar{T}^c(A[1])$ that is a coderivation of degree $-1$.
        \end{definition}

        The differential $m$ induces structure morphisms on $A[1]$. By proposition \ref{prop: tensor-derivation} there is a natural bijection $Hom_\mathbb{K}(\bar{T}^c(A[1]),A[1])\simeq Coder(\bar{T}^c(A[1]),\bar{T}^c(A[1]))$ given by the projection onto $A[1]$. Thus $m:\bar{T}^c(A[1])\rightarrow\bar{T}^c(A[1])$ corresponds to maps $\widetilde{m}_n:A[1]^{\otimes n}\rightarrow A[1]$ of degree $-1$ for any $n\geq 1$. We define maps $m_n : A^{\otimes n}\rightarrow A$ by the composite $s^{-1}\widetilde{m}_ns^{\otimes n}$. Since $s^{\otimes n}$ is of degree $n$, $\widetilde{m}_n$ and $s^{-1}$ is of degree $-1$, we get that $m_n$ is of degree $n-2$.
        \begin{center}
            \begin{tikzcd}
                A^{\otimes n} \ar[]{r}[]{m_n} \ar[]{d}[]{\simeq}[left]{s^{\otimes n}} & A \\
                A[1]^{\otimes n} \ar[]{r}[]{\widetilde{m}_n} & A[1] \ar[]{u}[right]{\simeq}[]{s^{-1}}
            \end{tikzcd}
        \end{center}

        \begin{proposition}\label{prop: A-infinity def}
            An $A_\infty$-algebra is equivalent to a graded vector space $A$ together with homogenous morphisms $m_n:A^{\otimes n}\rightarrow A$ of degree $n-2$. Moreover, the morphism must satisfy the following relations for any $n\geq 1$:
            \begin{align*}
                (\text{rel}_n)\qquad \sum_{p+q+r = n}(-1)^{p+qr}m_{p+1+r}\circ (id^{\otimes p}\otimes m_q \otimes id^{\otimes r}) = 0
            \end{align*}
        \end{proposition}

        \begin{remark}
            We make a more convenient notation for $(\text{rel}_n)$, called partial composition $\circ_i$.
            \begin{align*}
                & m_{p+1+r} \circ_{p+1} m_q = m_k \circ (id^{\otimes p}\otimes m_q \otimes id^{\otimes r}) \\
                (\text{rel}_n)\qquad & \sum_{p+q+r = n} (-1)^{p+qr} m_{p+1+r} \circ_{p+1} m_q = 0
            \end{align*}
        \end{remark}

        Before starting with the proof we will use a lemma for checking whether a coderivation $m: T^c(A) \rightarrow T^c(A)$ is a differential.

        \begin{lemma}\label{lem: coderivation-is-diff?}
            Let $m: T^c(A) \rightarrow T^c(A)$ be a coderivation, and denote $m_n = m|_{A^{\otimes n}}$. $m$ is a differential if and only if the following relations are satisfied:
            \begin{align*}
                & \sum_{p+q+r = n}m_{p+1+r}\circ_{p+1}m_q = 0
            \end{align*}
        \end{lemma}

        \begin{proof}
            By proposition \ref{prop: tensor-derivation} we may write $m = \sum_{n = 0}^\infty \sum_{i = 0}^n m_{(n)}^{(i)}$. By using partial composition, we rewrite its n'th component as:
            \begin{align*}
                m_n = \sum_{q=1}^n\sum_{p = 1}^n id^{\otimes (n-q)}\circ_{p} m_q = \sum_{p + q + r = n}id^{\otimes (p+1+r)}\circ_{p+1}m_q
            \end{align*}

            For $m^2$ we denote it's n'th component as $m^2_n$. Observe the following:
            \begin{align*}
                & m^2_n = m\circ m_n = m\circ \sum_{p + q + r = n}id^{\otimes (p+1+r)}\circ_{p+1}m_q = \sum_{p + q + r = n}m\circ_{p+1}m_q \\
                & \pi m^2_n = \pi \sum_{p + q + r = n}m\circ_{p+1}m_q = \sum_{p + q + r = n}m_{p+1+r}\circ_{p+1}m_q
            \end{align*}
            Since every coderivation are uniquely determined by $\pi$, its projection onto $A$ we get that $m^2 = 0$ if and only if
            \begin{align*}
                \sum_{p+q+r = n}m_{p+1+r}\circ_{p+1}m_q = 0\text{.}
            \end{align*}
        \end{proof}

        \begin{proof}[Proof of proposition \ref{prop: A-infinity def}]
            Let $(A,m)$ be an $A_\infty$-algebra. We denote the n'th component of $m$ as $\widetilde{m}_n$. The n'th components thus define maps $m_n:A^{\otimes n}\rightarrow A$ as $m_n = s^{-1}\widetilde{m}_ns^{\otimes n}$.

            By the above lemma we know that the n'th component of $m^2$ is:
            \begin{multline*}
                \sum_{p + q + r = n}\widetilde{m}_{p+1+r}\circ_{p+1}\widetilde{m}_q \\
                = \sum_{p + q + r = n}sm_{p+1+r}s^{-\otimes (p+1+r)}\circ_{p+1}sm_qs^{-\otimes q} = \sum_{p + q + r = n}(-1)^{pq+r}sm_{p+1+r}\circ_{p+1}m_q s^{-\otimes n}
            \end{multline*}

            Since suspension and desuspension are isomorphism we get that $m^2 = 0$ if and only if $(\text{rel}_n)$ are $0$ for every $n\geq 1$, i.e.
            \begin{align*}
                \sum_{p+q+r = n} (-1)^{p+qr} m_{p+1+r} \circ_{p+1} m_q = 0
            \end{align*}
        \end{proof}

        Given an $A_\infty$ algebra $A$ we may either think of it as a differential tensor coalgebra $\bar{T}^c(A[1])$ with differential $m: \bar{T}^c(A[1])\rightarrow \bar{T}^c(A[1])$ or as a graded vector space with morphisms $m_n:A^{\otimes n} \rightarrow A$ satisfying $(\text{rel}_n)$. We will calculate $(\text{rel}_n)$ for $1,2,3$:
        \begin{align*}
            (\text{rel}_1)\qquad & m_1\circ m_1 = 0 \\
            (\text{rel}_2)\qquad & m_1\circ m_2 - m_2\circ_{1}m_1 - m_2\circ_2m_1 = 0 \\
            (\text{rel}_3)\qquad & m_1\circ m_3 + m_2\circ_1 m_2 - m_2\circ_2m_2 + m_3\circ_1m_1 + m_3\circ_2m_1 + m_3\circ_3m_1 = 0
        \end{align*}

        We see that $(\text{rel}_1)$ states that $m_1$ should be a differential, we may thus think of $(A, m_1)$ as a chain complex. Furthermore, $(\text{rel}_2)$ says that $m_2 : (A^{\otimes 2}, m_1\otimes id_A + id_A\otimes m_1) \rightarrow (A, m_1)$ is a morphism of chain complexes. Lastly, $(\text{rel}_3)$ gives us a homotopy for the associator of $m_2$, namely $m_3$. Thus we may regard $(A, m_1, m_2)$ as an algebra which is associative up to homotopy. Regarding $A$ as a chain complex instead we obtain our final definition of an $A_\infty$-algebra.

        \begin{proposition}
            Suppose that $(A, d)$ is a chain complex, and that there exists morphisms $m_n: A^{\otimes n} \rightarrow A$ for any $n\geq 2$. A is an $A_\infty$-algebra if and only it satisfies the following relations:
            \begin{align*}
                (\text{rel'}_n)\qquad & \partial(m_n) = -\sum_{\substack{n = p + q + r \\ k = p + 1 + r \\ k > 1, q > 1}}(-1)^{p + qr}m_k\circ_p+1m_q
            \end{align*}
        \end{proposition}

        We define the homotopy of an $A_\infty$-algebra to be the homology of the chain complex $(A, m_1)$. Since $\partial(m_3) = m_2\circ_1m_2 - m_2\circ_2m_2$, we get that $m_2$ is associative in homology. Thus for any $A_\infty$-algebra $A$, the homotopy $HA$ is an associative algebra. The operadic homology of $A$ is defined as the homology of $(T^c(A[1]), m)$, which is the non-unital augmented Hochschild homology of $A$.

        \begin{example}
            An associative dg-algebra is an $A_\infty$ algebra with trivial higher morphisms.
        \end{example}

        \begin{example}
            Eksemplet jeg fikk fra Torgeir.
        \end{example}

        A morphism between $A_\infty$-algebras is called an $\infty$-morphism. Suppose that $A$ and $B$ are two $A_\infty$-algebras, an $\infty$-morphism $f:A\rightsquigarrow B$ is a dg-coalgebra homomorphism $\widetilde{f}:(\bar{T}^c(A[1]), m^A)\rightarrow (\bar{T}^c(B[1]), m^B)$. By proposition \ref{prop: tensor-derivation}, $\widetilde{f}$ is uniquely determined by homogenous morphisms $f_n : A^{\otimes n} \rightarrow B$ of degree $n-1$ for any $n\geq 1$. $f_1$ is required to be a morphism of the chain complexes $f_1:(A,m^A_1)\rightarrow (B,m^B_1)$. For any $n \geq 2$ $f$ should satisfy the relations:
        \begin{align*}
            & (\text{rel}_n)\qquad \partial(f_n) = \sum_{\substack{p + 1 + r = k \\ p + q + r = n}}(-1)^{pq+r}f_k\circ_{p+1}m^A_q - \sum_{\substack{k\geq 2 \\ i_1 + ... + i_k = n}}(-1)^{e}m^B_k \circ (f_{i_1}\otimes f_{i_2}\otimes ... \otimes f_{i_k}) \\
            & \text{where } e \text{ is given as: } e = (k-1)(i_1-1) + (k-2)(i_2-1) + ... + 2(i_{k-2}-1) + (i_{k-1} - 1)
        \end{align*}

        Since the composition of two dg-coalgebra homomorphism is again a dg-algebra homomorphism, we get that the composition of two $\infty$-morphisms is again an $\infty$-morphism. More explicitly if $f:A\rightsquigarrow B$ and $g: B\rightsquigarrow C$ are two $\infty$-morphisms, then their composition is defined as:
        \begin{align*}
            (fg)_n = \sum_r\sum_{i_1 + ... + i_r = n} (-1)^eg_r(f_{i_1}\otimes ... \otimes f_{i_r})\text{.}
        \end{align*}

        An $\infty$-quasi-isomorphism is an $\infty$-morphism $f$ such that $f_1$ is a quasi-isomorphism.

        Let $Alg_\infty$ denote the category of $A_\infty$-algebras. The morphisms in this category are the $\infty$-morphisms. Observe that the bar construction $B : Alg_\infty \rightarrow ConilCoalg^\bullet$ is a fully fatihful functor, identifying $Alg_\infty$ as a subcategory of $ConilCoalg^\bullet$.

        Dual to $A\infty$-algebras we got $A_\infty$-coalgebras. This will be th

        \begin{definition}
            A graded vector space $C$ is called an $A_\infty$-coalgebra if it is a dg-algebra of the form $(\bar{T}(B[-1]), d)$ where $d$ is a derivation of degree $-1$. Dually, this is equivalent to a chain complex $(B, d^1)$, where $d^1$ is of degree $1$, and together with morphisms $d^n : B \rightarrow B^{\otimes n}$. The morphism should satisfy the relations:
            \begin{align*}
                (\text{rel}_n)\qquad & \sum_{p+q+r = n}(-1)^{pq+r}d^{p+1+q}\circ^{op}_{p+1}d^q = 0
            \end{align*}
        \end{definition}
\end{document}