\documentclass{llncs}
\usepackage{amsmath,amssymb,url}

\newcommand{\Cyc}{\mathrm{\Phi}}
\newcommand{\Frob}{\mathrm{\Phi}}
\newcommand{\twist}{\mathrm{\Psi}}
\newcommand{\F}{\mathop{\mathbb{F}}}
\newcommand{\half}[1]{{\lfloor#1/2\rfloor}}
\newcommand{\ord}{\qopname\relax{no}{ord}}
\newcommand{\sign}{\qopname\relax{no}{sign}}
\newcommand{\tr}{\qopname\relax{no}{tr}}
\newcommand{\Z}{\mathop{\mathbb{Z}}}
%\newcommand{\Cpp}{C\protect\raisebox{.18ex}{++}}
\newcommand{\Cpp}{C\kern-0.05em\texttt{+\kern-0.03em+}}

\newcommand{\C}{C}

\sloppy

\begin{document}

\pagestyle{plain}

\title{An implementation of the Boneh-Lynn-Shacham Short signature scheme}

\author{%
Michael Scott
}
\institute{
School of Computing\\%
Dublin City University\\%
Ballymun, Dublin~9, Ireland.\\%
\email{mike@computing.dcu.ie}
}

\maketitle

\begin{abstract}

Herein we briefly document our implementation of the Boneh-Lynn-Shacham \cite{boneh-lynn-shacham} short signature
scheme. The implementation uses the MIRACL library.

\end{abstract}

\section{Introduction}\label{sec:intro}

The Boneh-Lynn-Shacham short signature scheme, as originally described \cite{boneh-lynn-shacham}, uses the Weil
pairing to instantiate a scheme which, for the approximate RSA-1024-bit level of security, generates a signature
of size of about 160 bits. This is half the size of signatures based on standard methods such as ECDSA. The security of
the scheme is based on the Computational Diffie-Hellman problem over certain pairing-friendly elliptic curves, in
the random oracle model. Note that this is a classic digital signature -- it is not an identity-based signature.
It does not support message recovery.

The signature itself is the $x$ coordinate of an elliptic curve point over the prime field $\F_p$ with $p\approx 160$ bits.
To obtain the required level of security we assume the use of a pairing-friendly curve with an embedding degree
of $k=6$, which acts as a ``security multiplier'', and raises the index calculus strength of the scheme to ~960 bits.
Since the security of the method depends on the difficulty of the discrete logarithm problem over a sextic extension
field of this size, we are assuming that this gives approximately the same level of security as 1024-bit RSA.

We choose to implement the method using the faster Tate pairing over non-supersingular MNT curves
\cite{miyaji-nakabayashi-takano}, \cite{scott-barreto-1}. For
our particular chosen
curve $p$ is actually 159 bits in length and the group size is 158 bits. In one small variation from the method as
described in \cite{boneh-lynn-shacham}, we fix the actual signature point unambiguously by storing in the
signature an extra bit, so that the $y$ coordinate of the point can be reconstructed (as this enables a certain
optimization -- see below). Therefore our signature size is exactly 160-bits in length.

When using non-supersingular curves, while one parameter to the pairing may be placed on the elliptic curve over
the base field $E(\F_p)$, the other must be placed on a larger extension field. For an MNT curve the best we can
do is to place it on the quadratic twist $E'(\F_{p^3})$. Since the signature (to be short) must be on $E(\F_p)$,
this implies
that the public key must be over the ``bigger'' curve. So the public key will be relatively large. On the other hand
the secret key will be just 158 bits.

We note that potentially faster methods have also been published, for example see \cite{zhang-chen-susilo-mu},
based on different (and arguably less compelling) security assumptions. As
described these require the use of the modified pairing over a supersingular curve, which for an embedding degree
of 6 requires a fast implementation of characteristic 3 arithmetic, which we do not have to hand.

Note that the timings given in the original paper are not representative of the potential of the method. We are
aware of implementations (using a characteristic 3 supersingular curve) which are much faster than those reported in
the paper.

\section{The implementation}

The fixed domain parameters consist of the pairing friendly MNT curve with an embedding degree of 6, and a fixed
point $P$ on the twisted curve $E'(\F_{p^3})$. The private signing key is a 20 byte randomly generated number $s$.
The public key is the point $R=sP$. $R$ will be 120 bytes in size, although using point compression this could be
reduced to 60 bytes.

To sign a message it must first be hashed to a point $Q$ on the curve $E(\F_p)$. Basically the message is hashed
to an $x$ coordinate, and if the RHS of the elliptic curve equation is a quadratic residue (tested by calculating
a jacobi symbol), then a modular square root determines the $y$ coordinate. If the RHS of the elliptic curve equation
is not a quadratic residue, the hash value is incremented until it becomes one. The total cost will thus be one modular
square root and one or more jacobi symbol calculations. The signature is then the point $S=xQ$, compressed using
standard methods to its $x$ coordinate and a single bit, to a size of 20 bytes.

To verify the message we reconstruct $S$ from its compressed form, hash the message again to the point $Q$
and test that $e(Q,R).e(-S,P) = 1$. This should be the case as

$$ e(Q,R).e(-S,P) = e(Q,xP).e(-xQ,P) = e(Q,xP)/e(Q,xP) = 1 $$

Doing it this way the tricks for calculating a product of pairings \cite{scott} can be used, with
some savings.

\bibliographystyle{plain}
\bibliography{bls}

\end{document}


\chapter{BWP model set of equations}
\label[secinapp]{chap:bwp-eqn}
\resetallacronyms

This appendix presents the set of equations for the model presented in
\cpref{sec:bwp-model} with \cpref{fig:bwp-maillefer-break-model}. The
known variables are:

\begin{multicols}{5}
  \begin{itemize}
    \item $\dotM{el}{14}$
    \item $\dotM{02}{26}$
    \item $\dotM{03}{05}$
    \item $\dotM{03}{07}$
    \item $\dotM{09}{06}$
    \item $\eta_{inv}$
    \item $h_{02,in}$
    \item $h_{02,out}$
    \item $h_{03,in}$
    \item $h_{03,out}$
    \item $h_{04,in}$
    \item $h_{04,out}$
    \item $h_{06,in}$
    \item $h_{06,out}$
    \item $h_{12,out}$
    \item $h_{19,out}$
    \item $h_{21,out}$
    \item $h_{22,out}$
    \item $h_{25,out}$
    \item $h_{26,out}$
  \end{itemize}
\end{multicols}

$\eta_{mot}$ is set directly by the solver. $\eta_{rad}$ and
$\eta_{axi}$ are determined with the gas bearings losses model
implemented by \citet{schiffmann-2008a}.

\begin{flalign}
  & \dotM{05}{09} = \dotM{03}{05} \nonumber \\
  & \dotM{06}{04} = \dotM{09}{06} \nonumber \\
  & \dotM{07}{04} = \dotM{03}{07} \nonumber \\
  & \dotM{20}{03} = \dotM{03}{05} + \dotM{03}{07} \nonumber \\
  & \dotM{02}{20} = \dotM{20}{03} \nonumber \\
  & \dotM{04}{19} = \dotM{06}{04} + \dotM{07}{04} \nonumber \\
  & \dotM{26}{22} = f_{01} \, \dotM{02}{26} & 0 < f_{01} < 1 \hspace{1cm} \nonumber \\
  & \dotM{26}{21} = \left( 1 - f_{01} \right) \, \dotM{02}{26} \nonumber \\
  & \dotM{21}{13} = \dotM{26}{21} \nonumber \\
  & \dotM{22}{11} = \dotM{26}{22} \nonumber \\
  & \dotM{13}{12} = \dotM{21}{13} \nonumber \\
  & \dotM{11}{23} = f_{02} \, \dotM{22}{11} & 0 < f_{02} < 1 \hspace{1cm} \nonumber \\
  & \dotM{11}{24} = \left( 1 - f_{02} \right) \, \dotM{22}{11} \nonumber \\
  & \dotM{23}{01} = \dotM{11}{23} \nonumber \\
  & \dotM{24}{12} = \dotM{11}{24} \nonumber \\
  & \dotM{12}{19} = \dotM{24}{12} + \dotM{13}{12} \nonumber \\
  & \dotM{27}{02} = \dfrac{\left( \dotM{02}{26} + \dotM{02}{20} \right)}{1 - f_{03} - f_{04}} \nonumber \\
  & \dotM{02}{10} = f_{03} \, \dotM{27}{02} & 0 < f_{03}+f_{04} < 1 \hspace{1cm} \nonumber \\
  & \dotM{02}{08} = f_{04} \, \dotM{27}{02} \nonumber
\end{flalign}

\begin{flalign}
  & \dotM{10}{25} = \dotM{02}{10} \nonumber \\
  & \dotM{08}{19} = \dotM{02}{08} \nonumber \\
  & \dotM{19}{01} = \dotM{12}{19} + \dotM{04}{19} + \dotM{08}{19} \nonumber \\
  & \dotM{01}{25} = \dotM{19}{01} + \dotM{23}{01} \nonumber \\
  & \dotM{25}{27} = \dotM{27}{02} \nonumber \\
  & \dotE{14}{13} = \eta_{inv} \, \dotE{el}{14} \nonumber \\
  & \dotQ{14}{atm} = \left( 1 - \eta_{inv} \right) \dotE{el}{14} \nonumber \\
  & \dotE{13}{12} = \eta_{mot} \, \dotE{14}{13} \nonumber \\
  & \dot{Q}_{mot} = \left( 1 - \eta_{mot} \right) \, \dotE{14}{13} \nonumber \\
  & \dotQ{13}{07} = f_{05} \, \dot{Q}_{mot} & 0 < f_{05} < 1 \hspace{1cm} \nonumber \\
  & \dotQ{13}{12} = f_{06} \, \dot{Q}_{mot} & 0 < f_{06} < 1 \hspace{1cm} \nonumber \\
  & \dotE{12}{11} = \eta_{rad} \, \dotE{13}{12} \nonumber \\
  & \dotE{11}{01} = \eta_{axi} \, \dotE{12}{11} \nonumber \\
  & \dot{Q}_{rad} = \left( 1 - \eta_{rad} \right) \, \dotE{13}{12} \nonumber \\
  & \dot{Q}_{axi} = \left( 1 - \eta_{axi} \right) \, \dotE{12}{11} \nonumber \\
  & \dotQ{12}{11} = f_{07} \, \left( \dot{Q}_{rad} + \dotQ{13}{12} \right) & 0 < f_{07} < 1 \hspace{1cm} \nonumber \\
  & \dotQ{11}{01} = f_{08} \, \left( \dot{Q}_{axi} + \dotQ{12}{11} \right) & 0 < f_{08} < 1 \hspace{1cm} \nonumber \\
  & \dotQ{11}{23} = f_{09} \, \left( \dot{Q}_{axi} + \dotQ{12}{11} \right) & 0 < f_{09} < 1 \hspace{1cm} \nonumber \\
  & \dotQ{11}{24} = f_{10} \, \left( \dot{Q}_{axi} + \dotQ{12}{11} \right) & 0 < f_{10} < 1 \hspace{1cm} \nonumber \\
  & \dotQ{01}{02} = f_{11} \, \dotQ{11}{01} & 0 < f_{11} < 1 \hspace{1cm} \nonumber \\
  & \dotQ{02}{10} = f_{12} \, \dotQ{01}{02} & 0 < f_{12} < 1 \hspace{1cm} \nonumber \\
  & \dotE{01}{02} = \dotM{27}{02} \, \left( h_{02,out} - h_{02,in} \right) \nonumber \\
  & \dot{E}_{cp2} = \dotE{01}{02} \nonumber \\
  & \dot{E}_{cp1} = \dotE{11}{01} - \dot{E}_{cp2} \nonumber \\
  & h_{10,out} = \dfrac{\dotM{02}{10} \, h_{02,out} + \dotQ{02}{10}}{\dotM{10}{25}} \nonumber \\
  & h_{01,out} = \dfrac{\dotM{25}{27} \, h_{25,out} - \dotM{10}{25} \, h_{10,out}}{\dotM{01}{25}} \nonumber \\
  & h_{01,in} = h_{01,out} - \dfrac{\dot{E}_{cp1}}{\dotM{01}{25}} \nonumber \\
  & h_{23,out} = \dfrac{\left( \dotM{19}{01} + \dotM{23}{01} \right) \, h_{01,in} - \dotM{19}{01} \, h_{19,out}}{\dotM{23}{01}} \nonumber \\
  & h_{07,out} = \dfrac{\dotQ{13}{07} + \dotM{03}{07} \, h_{03,out}}{\dotM{07}{04}} \nonumber \\
  & h_{19,in} = \dfrac{\dotM{12}{19} \, h_{12,out} + \dotM{04}{19} \, h_{04,out}}{\dotM{12}{19} + \dotM{04}{19}} \nonumber \\
  & h_{13,out} = \dfrac{\dotM{21}{13} \, h_{21,out} + \dotE{14}{13} - \dotE{13}{12} - \dotQ{13}{12} - \dotQ{13}{07}}{\dotM{13}{12}} \nonumber \\
  & h_{11,out} = \dfrac{\dotM{22}{11} \, h_{22,out} + \dotQ{12}{11} + \dotE{12}{11} - \dotQ{11}{01} - \dotE{11}{01} - \dotQ{11}{23} - \dotQ{11}{24}}{\dotM{11}{23} + \dotM{11}{24}} \nonumber \\
  & h_{23,in} = h_{11,out} \nonumber \\
  & h_{24,in} = h_{11,out} \nonumber
\end{flalign}

\begin{flalign}
  & h_{04,in} = \dfrac{\dotM{07}{04} \, h_{07,out} + \dotM{06}{04} \, h_{06,out}}{\dotM{07}{04} + \dotM{06}{04}} \nonumber \\
  & h_{24,out} = \dfrac{\dotM{11}{24} \, h_{11,out} + \dotQ{11}{24}}{\dotM{24}{12}} \nonumber \\
  & h_{25,in} = \dfrac{\dotM{10}{25} \, h_{10,out} + \dotM{01}{25} \, h_{01,out}}{\dotM{10}{25} + \dotM{01}{25}} \nonumber \\
  & h_{12,in} = \dfrac{\dotM{13}{12} \, h_{13,out} + \dotM{24}{12} \, h_{24,out}}{\dotM{13}{12} + \dotM{24}{12}} \nonumber \\
  & \dotQ{03}{15} = \left( \dotM{03}{05} + \dotM{03}{07} \right) \, \left( h_{03,in} - h_{03,out} \right) \nonumber \\
  & \dotQ{16}{04} = \left( \dotM{06}{04} + \dotM{07}{04} \right) \, \left( h_{04,out} - h_{04,in} \right) \nonumber \\
  & h_{03,out} = h_{05,in} = h_{05,out} \nonumber \\
  & h_{06,out} = h_{06,in} \nonumber \\
  & \dotQ{20}{atm} = \dotM{02}{20} \, h_{02,out} - \dotM{20}{03} \, h_{20,out} \nonumber \\
  & \dotQ{21}{atm} = \dotM{26}{21} \, h_{26,out} - \dotM{21}{13} \, h_{21,out} \nonumber \\
  & \dotQ{22}{atm} = \dotM{26}{22} \, h_{26,out} - \dotM{22}{11} \, h_{22,out} \nonumber \\
  & \dotQ{27}{atm} = \dotM{25}{27} \, h_{25,out} - \dotM{27}{02} \, h_{27,out} \nonumber
\end{flalign}

\FloatBarrier
\bibliographystyle{plainnat}
\bibliography{main}
\label[secinapp]{sec:bwp-eqn-refs}


\section{SED Modeling Uncertainties from Stellar Evolution} \label{sec:theory}

% figure construct using nb/sps_theoretical_uncertainty.ipynb
\begin{figure}
\begin{center}
\includegraphics[width=0.6\textwidth]{figs/sed_isochrone.pdf}
\caption{
    {\em Top}:
    Spectral energy distributions generated using MIST (black), Padova (blue),
    Parsec (orange), and BaSTI (green) isochrone libraries for an arbitrary set
    of SPS parameters.
    For our fiducial SED model, we use the MIST isochrone.
    {\em Bottom}:
    Ratios of the SEDs generated using differnt isochrone libraries over our
    fiducial MIST SED.
    The ratios reveal $>10\%$ discrepancies at rest-frame UV wavelengths and
    significant offsets at higher wavelengths.
    } \label{fig:sed_iso}
\end{center}
\end{figure}

% figure construct using nb/sps_isochrone_pca.ipynb
\begin{figure}
\begin{center}
\includegraphics[width=0.6\textwidth]{figs/sed_ratio.pdf}
\caption{
    } \label{fig:sed_ratio}
\end{center}
\end{figure}


\section{Ecosystem And Package Development}
\label{JM:sec:ECO}

As mentioned in section \ref{JM:sec:introduction} most high-level languages have a vast ecosystem of available packages, spanning various fields of application and
a diverse userbase. Despite it being a relatively new language, \textit{Julia} has 6068 officially registered open-source packages\footnote{\href{https://juliahub.com/ui/Packages}{JuliaHub}}\footnote{July 29th, 2021}.\\

Due to the focus on scientific computation, we will start looking at packages related to linear algebra. LinearAlgebra is already included with the basic \textit{Julia} installation, already providing BLAS and LAPACK access. \href{https://github.com/JuliaLinearAlgebra/MKL.jl.git}{MKL.jl}
provides an alternative backend for Intels MLK. \href{https://github.com/JuliaLinearAlgebra/Arpack.jl.git}{Arpack.jl} gives access to the arpack-ng library written in \textit{Fortran}.
\href{https://github.com/JuliaLinearAlgebra/IterativeSolvers.jl.git}{IterativeSolvers.jl} provides common algorithms for solving linear systems like MINRES, GMRES or Conjugate Gradients. \href{https://github.com/JuliaLinearAlgebra/GenericSVD.jl.git}{GenericSVD.jl} extends the singular value decomposition to
special number types like BigFloats.\\

In the field of optimization, different packages like \href{https://github.com/JuliaNLSolvers/Optim.jl.git}{Optim.jl}, \href{https://github.com/mohamed82008/Nonconvex.jl.git}{Nonconvex.jl}, or \href{https://github.com/JuliaOpt/NLopt.jl.git}{NLOpt.jl} provide access to a variety of algorithms capable of optimizing multivariate functions written in or interfaced by \textit{Julia}.
For gradient and hessian-based algorithms, various automatic differentiation backends like \href{https://github.com/JuliaDiff/ForwardDiff.jl.git}{ForwardDiff.jl}, \href{https://github.com/JuliaDiff/ReverseDiff.jl.git}{ReverseDiff.jl} or \href{https://github.com/FluxML/Zygote.jl.git}{Zygote.jl} can be used in the absence of analytical expressions.
A more structured approach is provided by the \href{https://github.com/jump-dev/JuMP.jl.git}{JuMP.jl} organization, offering an domain-specific language (DSL) for rigorous modeling of optimization problems.\\

Machine learning is prominently represented by \href{https://github.com/FluxML/Flux.jl.git}{Flux.jl} for (deep) neural networks. Next to \href{https://github.com/cstjean/ScikitLearn.jl.git}{SciKitLearn.jl} similar libraries like
\href{https://github.com/alan-turing-institute/MLJ.jl.git}{MLJ.jl}, \href{https://github.com/JuliaStats/Clustering.jl.git}{Clustering.jl}, and \href{https://github.com/FluxML/FastAI.jl.git}{FastAI.jl}
offer common machine learning models.\\

One of the most influential domains in \textit{Julia} is the numerical simulation domain, mainly the \href{https://sciml.ai/}{Scientific Machine Learning} organization with 76\footnotemark[8] packages registered on JuliaHub. It provides tooling for
simulation via \href{https://github.com/SciML/DifferentialEquations.jl.git}{DifferentialEquations.jl}, \href{https://github.com/SciML/DiffEqFlux.jl.git}{neural ordinary differential equations}, \href{https://github.com/SciML/NeuralPDE.jl.git}{physics informed neural networks},
and \href{https://github.com/SciML/DataDrivenDiffEq.jl.git}{data-driven estimation}. \href{https://github.com/SciML/ModelingToolkit.jl.git}{ModelingToolkit} builds upon \textit{Julia}'s \href{https://github.com/JuliaSymbolics/Symbolics.jl.git}{symbolic computation libraries} and
offers acausal component-based modeling, automatic code optimization and provides a backend for many DSL like \href{https://github.com/SciML/Catalyst.jl.git}{Catalyst.jl} for chemical reactions.\\

While interoperability to \textit{Fortran} and \textit{C} is included in \textit{Julia}, various packages like \href{https://github.com/JuliaInterop/Cxx.jl.git}{Cxx.jl}, \href{https://github.com/JuliaInterop/RCall.jl.git}{RCall.jl},
\href{https://github.com/JuliaPy/PyCall.jl.git}{PyCall}, and \href{https://github.com/JuliaInterop/CxxWrap.jl.git}{CxxWrap.jl} exist to wrap external code easily efficiently reducing the overhead of glue-code.\\
\href{https://github.com/JuliaPackaging/BinaryBuilder.jl}{BinaryBuilder.jl} allows the generation of precompiled binaries as dependencies via virtual machines automatically.
\newpage


\documentclass[12]{scrartcl}
\usepackage{amssymb,amsmath,gensymb,dsfont,calc,multicol,fullpage}
\makeatletter
\newcommand\Aboxed[1]{
   \@Aboxed#1\ENDDNE}
\def\@Aboxed#1&#2\ENDDNE{%
   &
   \settowidth\@tempdima{$\displaystyle#1{}$}
   \setlength\@tempdima{\@tempdima+\fboxsep+\fboxrule}
   \kern-\@tempdima
   \boxed{#1#2}
}
\makeatother

\begin{document}

\title{Homework 22, Section 3.4: 1(b,d), 4(b,d), 6(d), 10 }
\author{Alex Gordon}
\date{\today}
\maketitle
\section*{Homework }
\subsection*{1. B)}
$(ab')'= a' + (ab)$
\subsection*{1. D)}
$((a'b) + a )' = a'b'$
\subsection*{4. B)}
Prove $ab + bc = (a+c)b$\
\begin{align*}
&=ab + bc
\\ &=  b(a + c) \ \ distributive
\end{align*}
By the commutative property, several steps were not explained per Professor Senning saying that we really didn't have to show them.
\subsection*{4. D)}
Prove $ab + (a' + c)' = a(b+c')$\
\begin{align*}
&=ab + (a')')c' \ \ (DeMorgans Law)
&= ab + ac'   \ \ (Double Negative)
\\ &= a(b + c')  \ \ (Distributive)
\end{align*}
\subsection*{6. D)}
\ \\
\ \\
\ \\
\ \\
\ \\
\
\subsection*{10. A}
\ \\
\begin{table}
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    ~  & 1 & 2 & 5 & 7 & 10 & 14 & 35 & 70 \\ \hline
    1  & 1 & 1 & 1 & 1 & 1  & 1  & 1  & 1  \\ \hline
    2  & 1 & 2 & 1 & 1 & 2  & 2  & 1  & 2  \\ \hline
    5  & 1 & 1 & 5 & 1 & 5  & 1  & 5  & 5  \\ \hline
    7  & 1 & 1 & 1 & 7 & 1  & 7  & 7  & 7  \\ \hline
    10 & 1 & 2 & 5 & 1 & 10 & 2  & 5  & 10 \\ \hline
    14 & 1 & 2 & 1 & 7 & 2  & 14 & 7  & 14 \\ \hline
    35 & 1 & 1 & 5 & 7 & 5  & 7  & 35 & 35 \\ \hline
    70 & 1 & 2 & 5 & 7 & 10 & 14 & 35 & 70 \\ \hline
    \end{tabular}
\end{table}
\begin{table}
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    ~  & 1  & 2  & 5  & 7  & 10 & 14 & 35 & 70 \\ \hline
    1  & 1  & 2  & 5  & 7  & 10 & 14 & 35 & 70 \\ \hline
    2  & 2  & 2  & 10 & 14 & 10 & 14 & 70 & 70 \\ \hline
    5  & 5  & 10 & 5  & 35 & 10 & 70 & 35 & 70 \\ \hline
    7  & 7  & 14 & 35 & 7  & 70 & 14 & 35 & 70 \\ \hline
    10 & 10 & 10 & 10 & 70 & 10 & 70 & 70 & 70 \\ \hline
    14 & 14 & 14 & 70 & 14 & 70 & 14 & 70 & 70 \\ \hline
    35 & 35 & 70 & 35 & 35 & 70 & 70 & 35 & 70 \\ \hline
    70 & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70 \\ \hline
    \end{tabular}
\end{table}
\subsection*{10. B}
$u = 70$
\subsection*{10. C}
$z = 1$
\subsection*{10. D}
$1' = 70, 2' = 35, 5' = 14, 7' = 10, 10' = 7, 14' = 5, 35' = 2, 70' = 1$
\end{document}


\chapter{The equifibrant replacement operation}\label{chap:equifibrant}

We begin this chapter with a generalization of the descent theorem for reflexive coequalizers \cref{thm:rcoeq_cartesian}: the \emph{modal descent theorem}.
Any modality $\modal$ gives rise to a class of maps $f:A\to B$ satisfying the condition, due to Wellen \cite{WellenPhD}, that the naturality square
\begin{equation*}
\begin{tikzcd}
A \arrow[r,"f"] \arrow[d,swap,"\eta"] & B \arrow[d,"\eta"] \\
\modal A \arrow[r,swap,"\modal f"] & \modal B
\end{tikzcd}
\end{equation*}
is a pullback square. Following \cite{WellenPhD} we call such maps $\modal$-\'etale maps. The modal descent theorem asserts that a $\modal$-\'etale map into $A$ is equivalently described as a modal map into $\modal A$. Every $\modal$-\'etale map is certainly modal, but the condition of being $\modal$-\'etale is slightly stronger than the condition of being modal.

The difference between the notions of $\modal$-\'etale maps and modal maps becomes perhaps most visible when we look at the left orthogonal classes of the $\modal$-\'etale maps and modal maps. The $\modal$-connected maps are left orthogonal to the modal maps, whereas a map is left orthogonal to the $\modal$-\'etale maps if and only if it is a $\modal$-equivalence (i.e.~a map $f$ such that $\modal f$ is an equivalence). In the case of the $n$-truncation there is a clear difference: a map $f:X\to Y$ is an $n$-equivalence if and only if it induces an isomorphism of homotopy groups $\pi_i(X)\to \pi_i(Y)$ for any $i\leq n$, whereas an $n$-connected map is an $n$-equivalence satisfying the further condition that $\pi_{n+1}(X)\to\pi_{n+1}(Y)$ is surjective.

In \cref{thm:modal_rofs} we show that the $\modal$-equivalences and the $\modal$-\'etale maps form an orthogonal factorization system. We call this factorization system the \emph{reflective} factorization system of a modality. The reflective factorization system is not stable, so it does not form a new modality. What does follow is that for the unique factorization $f=f_r\circ f_l$ of $f:A\to X$ as a $\modal$-equivalence $f_l$ followed by a $\modal$-\'etale map $f_r$, the canonical map
\begin{equation*}
\mathrm{hom}_X(f_r,e)\to\mathrm{hom}_X(f,e)
\end{equation*}
is an equivalence for any $\modal$-\'etale map $e$ into $X$.

We then proceed to apply these ideas to the case of reflexive graphs and the reflexive coequalizer. The class of $\Delta$-\'etale maps is introduces as the class of morphisms $f:\mathsf{rGph}(\mathcal{B},\mathcal{A})$ of reflexive graphs satisfying the condition that the square
\begin{equation*}
\begin{tikzcd}[column sep=huge]
\mathcal{B} \arrow[r,"f"] \arrow[d,swap,"\mathsf{constr}"] & \mathcal{A} \arrow[d,"\mathsf{constr}"] \\
\Delta(\mathsf{rcoeq}(\mathcal{B})) \arrow[r,swap,"\Delta(\mathsf{rcoeq}(f))"] & \Delta(\mathsf{rcoeq}(\mathcal{A}))
\end{tikzcd}
\end{equation*}
is a pullback square, and we show that the class of $\Delta$-\'etale morphisms is precisely the class of fibrations of reflexive graphs, as defined in \cref{defn:graph_fibration}.

In the case of sequential colimits, another way of obtaining a cartesian transformation from an arbitrary one is to take the sequential colimit fiberwise. We establish this result in \cref{thm:colim_fib}. It has many important consequences. First of all, we show in \cref{thm:colim_id} that sequential colimits commute with identity types. Second, we show in \cref{thm:colim_fiberseq} that the sequential colimit of a fiber sequence is again a fiber sequence. Third, we show in \cref{thm:colim_hlevel} that truncation levels are closed under sequential colimits, and that sequential colimits commute with truncations. Finally, we show in \cref{thm:colim_hgroup} that sequential colimits commute with homotopy groups.

\section{Modal descent}\label{sec:modal_descent}
\subsection{\texorpdfstring{$\modal$}{○}-\'etale maps}

\begin{defn}[Definition 4.4.1 of \cite{WellenPhD}]
We say that a map $f:A\to B$ is \define{$\modal$-\'etale} if the square
\begin{equation*}
\begin{tikzcd}
A \arrow[r,"\eta"] \arrow[d,swap,"f"] & \modal A \arrow[d,"\modal f"] \\
B \arrow[r,swap,"\eta"] & \modal B
\end{tikzcd}
\end{equation*}
is a pullback square. We will write
\begin{equation*}
\isetale(f)\defeq\ispullback(\eta,f,\natunit_\modal(f)).
\end{equation*}
\end{defn}

It is immediate from the definition that any equivalence is $\modal$-\'etale, and that the $\modal$-\'etale maps are closed under composition, and that every equivalence is $\modal$-\'etale.

\begin{eg}\label{eg:etale_prop}
We claim that a map $f:A\to B$ is $\brck{\blank}$-\'etale if and only if $A\to \isequiv(f)$. Examples of maps that satisfy this condition include equivalences, maps between propositions, and any map of the form $\emptyt\to B$.

To see that if $f:A\to B$ is $\modal$-\'etale, then $A\to\isequiv(f)$, consider the pullback square
\begin{equation*}
\begin{tikzcd}
A \arrow[r] \arrow[d,swap,"f"] & \brck{A} \arrow[d,"\brck{f}"] \\
B \arrow[r] & \brck{B},
\end{tikzcd}
\end{equation*}
and let $a:A$. Then both $\brck{A}$ and $\brck{B}$ are contractible, so $\brck{f}:\brck{A}\to\brck{B}$ is an equivalence. Since equivalences are stable under pullback it follows that $f$ is an equivalence.

Now suppose that $A\to \isequiv(f)$. Since $\isequiv(f)$ is a proposition, we also have $\brck{A}\to\isequiv(f)$. To see that the gap map
\begin{equation*}
A \to B\times_{\brck{B}}\brck{A}
\end{equation*}
is an equivalence, we will show that its fibers are contractible. Let $b:B$, $x:\brck{A}$ and $p:\bproj{b}=\brck{f}(x)$. Since $\brck{A}\to\isequiv(f)$, it follows that $f$ is an equivalence. Then $\brck{f}$ is also an equivalence, from which it follows that the naturality square is a pullback square. We conclude that the fibers of the gap map are contractible.
\end{eg}

\begin{lem}\label{lem:etale_modal}
Any map between $\modal$-modal types is $\modal$-\'etale.
\end{lem}

\begin{proof}
Suppose $f:X\to Y$ is a map between $\modal$-modal types. Then the top and bottom maps in the square
\begin{equation*}
\begin{tikzcd}
X \arrow[r] \arrow[d] & \modal X \arrow[d] \\
Y \arrow[r] & \modal Y
\end{tikzcd}
\end{equation*}
are equivalences. Therefore this square is a pullback square, so $f$ is $\modal$-\'etale.
\end{proof}

%In this section our goal is to characterize the $\modal$-\'etale maps for the $n$-truncations. We call such maps \define{$n$-\'etale}. Note that the case of propositional truncation has already been addressed in \cref{eg:etale_prop}.

For the following lemma, recall that for a modality all propositions are modal if and only if all units $\eta : X\to \modal X$ are surjective.

\begin{lem}\label{lem:etale_char}
Let $\modal$ be a modality for which all propositions are modal, and consider a map $f:A\to B$. The following are equivalent:
\begin{enumerate}
\item $f$ is $\modal$-\'etale.
\item The commuting square
\begin{equation*}
\begin{tikzcd}[column sep=large]
A\times_{\modal A} A \arrow[d,swap,"\pi_1"] \arrow[r,"{f\times_{\modal f} f}"] & B\times_{\modal B} B \arrow[d,"\pi_1"] \\
A \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
is a pullback square.
\end{enumerate}
\end{lem}

\begin{rmk}
In the special case of $(-1)$-truncation, the characterization of \cref{lem:etale_char} asserts that a map $f:A\to B$ is $(-1)$-\'etale if and only if the square
\begin{equation*}
\begin{tikzcd}
A\times A \arrow[d,swap,"\pi_1"] \arrow[r,"{f\times f}"] & B\times B \arrow[d,"\pi_1"] \\
A \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
is a pullback square.
\end{rmk}

\begin{proof}
Suppose first that $f$ is $\modal$-\'etale, and consider the commuting cube
\begin{equation*}
\begin{tikzcd}
& A\times_{\modal A} A \arrow[dl] \arrow[d] \arrow[dr] \\
A \arrow[d] & B\times_{\modal B} B \arrow[dl] \arrow[dr] & A \arrow[dl,crossing over] \arrow[d] \\
B \arrow[dr] & \modal A \arrow[from=ul,crossing over] \arrow[d] & B \arrow[dl] \\
& \modal B
\end{tikzcd}
\end{equation*}
Since the top, bottom, and both front squares are pullback squares, it follows that both back squares are pullback. This proves that (i) implies (ii).

Now suppose that (ii) holds. Then the map
\begin{equation*}
\fib{\modalunit}{\modalunit(a)}\to \fib{\modalunit}{\modalunit(f(a))}
\end{equation*}
is an equivalence for every $a:A$. Since all propositions are assumed to be modal, it follows that
\begin{equation*}
\fib{\modalunit}{t}\to \fib{\modalunit}{\modal f(t)}
\end{equation*}
is an equivalence for every $t:\modal A$. Thus it follows that the square
\begin{equation*}
\begin{tikzcd}
A \arrow[d,swap,"\modalunit"] \arrow[r] & B \arrow[d,"\modalunit"] \\
\modal A \arrow[r] & \modal B
\end{tikzcd}
\end{equation*}
is a pullback square.
\end{proof}

\begin{cor}
If $f:A\to B$ is $\modal$-\'etale, then the square
\begin{equation*}
\begin{tikzcd}[column sep=large]
A \arrow[d,swap,"\delta_{\modalunit}"] \arrow[r,"f"] & B \arrow[d,"\delta_{\modalunit}"] \\
A\times_{\modal A} A \arrow[r,swap,"f\times_{\modal f}f"] & B\times_{\modal B} B
\end{tikzcd}
\end{equation*}
is a pullback square.
\end{cor}

\begin{proof}
Consider the diagram
\begin{equation*}
\begin{tikzcd}[column sep=large]
A \arrow[d,swap,"\delta_{\modalunit}"] \arrow[r,"f"] & B \arrow[d,"\delta_{\modalunit}"] \\
A\times_{\modal A} A \arrow[d,swap,"\pi_1"] \arrow[r,"{f\times_{\modal f} f}"] & B\times_{\modal B} B \arrow[d,"\pi_1"] \\
A \arrow[r,"f"] & B
\end{tikzcd}
\end{equation*}
The bottom square is a pullback square by \cref{lem:etale_char}, and the outer rectangle is a pullback since both vertical composites are homotopic to the respective identity functions. Therefore the top square is a pullback.
\end{proof}

\begin{thm}
A map $f:A\to B$ is $0$-\'etale if and only if for each $a:A$ the restriction
\begin{equation*}
\begin{tikzcd}
\sm{x:A}\brck{a=x} \arrow[d,swap,"\proj 1"] \arrow[r,densely dotted,"f"] & \sm{y:B}\brck{f(a)=y} \arrow[d,"\proj 1"] \\
A \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
of $f$ to the connected component at $a$ of $A$ is an equivalence.
\end{thm}

\begin{proof}
By \cref{lem:etale_char} and the fact that $\eqv{(\tproj{0}{a}=\tproj{0}{x})}{\brck{a=x}}$, it follows that $f$ is $0$-\'etale if and only if the square
\begin{equation*}
\begin{tikzcd}[column sep=huge]
\sm{a,x:A}\brck{a=x} \arrow[d,swap,"\pi_1"] \arrow[r,"\total{\brck{\apfunc{f}}}"] & \sm{b,y:B}\brck{b=y} \arrow[d,"\pi_1"] \\
A \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
is a pullback square. Furthermore, this square is a pullback if and only if the induced map
\begin{equation*}
\Big(\sm{x:A}\brck{a=x}\Big)\to\Big(\sm{y:B}\brck{f(a)=y}\Big)
\end{equation*}
is an equivalence, for each $a:A$.
\end{proof}

\subsection{Modal descent}

The following theorem can be seen as a `modal flattening lemma', since it is analogous to \cref{thm:rcoeq_cartesian}.

\begin{thm}\label{thm:etale_flattening}
Consider a pullback square
\begin{equation*}
\begin{tikzcd}
E' \arrow[d,swap,"{p'}"] \arrow[r,"g"] & E \arrow[d,"p"] \\
B' \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
with $H:f\circ p'\htpy p\circ g$, where $E$ and $B$ are modal types. Then the square
\begin{equation*}
\begin{tikzcd}
\modal E' \arrow[r,"\tilde{g}"] \arrow[d,swap,"{\modal p'}"] & E \arrow[d,"p"] \\
\modal B \arrow[r,swap,"\tilde{f}"] & B
\end{tikzcd}
\end{equation*}
is a pullback square, where $\tilde{f}$ and $\tilde{g}$ are the unique extensions of $f$ and $g$ along the modal units of $B'$ and $E'$, respectively.
\end{thm}

\begin{proof}
Consider the diagram
\begin{equation*}
\begin{tikzcd}
E' \arrow[r,"{\mathsf{gap}(p',g,H)}"] \arrow[d,swap,"{p'}"] &[2.5em] \modal B'\times_{B} E \arrow[r,"\pi_2"] \arrow[d,swap,"\pi_1"] & E \arrow[d,"p"] \\
B' \arrow[r,swap,"\modalunit"] & \modal B' \arrow[r,swap,"\tilde{f}"] & B
\end{tikzcd}
\end{equation*}
In this diagram, the square on the right is a pullback by definition, and the outer rectangle is a pullback by assumption, so the square on the left is also a pullback. Therefore the gap map $E'\to \modal B'\times_B E$ is $\modal$-connected. Moreover, since the modal types are closed under pullbacks it follows that $\modal B'\times_B E$ is modal, and therefore it follows that $\pi_2:\modal B'\times_B E\to E$ is a modal map. Therefore the composite
\begin{equation*}
\begin{tikzcd}
E' \arrow[r,"{\mathsf{gap}(p',g,H)}"] &[2.5em] \modal B'\times_{B} E \arrow[r,"\pi_2"] & E
\end{tikzcd}
\end{equation*}
factors $g$ as a $\modal$-connected map followed by a $\modal$-modal map. Of course, another such factorization is the composite $g\htpy \tilde{g}\circ\modalunit$. Since factorizations are unique, the claim follows.
\end{proof}

Using modal flattening we establish partial left exactness of the modality.

\begin{cor}\label{cor:etale_lex}
Consider a pullback square
\begin{equation*}
\begin{tikzcd}
A' \arrow[d,swap,"{f'}"] \arrow[r] & A \arrow[d,"f"] \\
B' \arrow[r] & B,
\end{tikzcd}
\end{equation*}
where $f$ is assumed to be $\modal$-\'etale. Then the square
\begin{equation*}
\begin{tikzcd}
\modal A' \arrow[d,swap,"{\modal f'}"] \arrow[r] & \modal A \arrow[d,"\modal f"] \\
\modal B' \arrow[r] & \modal B,
\end{tikzcd}
\end{equation*}
is again a pullback square.
\end{cor}

\begin{proof}
Since $f$ is assumed to be $\modal$-\'etale, the square on the right in the diagram
\begin{equation*}
\begin{tikzcd}
A' \arrow[r] \arrow[d,swap,"{f'}"] & A \arrow[r] \arrow[d,swap,"f"] & \modal A \arrow[d,"\modal f"] \\
B' \arrow[r] & B \arrow[r] & \modal B
\end{tikzcd}
\end{equation*}
is a pullback square. Therefore the outer rectangle is a pullback square by the pullback pasting lemma. Now the claim follows from modal flattening \cref{thm:etale_flattening}, using the outer rectangle.
\end{proof}

\begin{cor}\label{cor:etale_pb}
Consider a pullback square
\begin{equation*}
\begin{tikzcd}
E' \arrow[d,swap,"{p'}"] \arrow[r,"g"] & E \arrow[d,"p"] \\
B' \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
and suppose that $p:E\to B$ is $\modal$-\'etale. Then $p':E'\to B'$ is $\modal$-\'etale.
\end{cor}

\begin{proof}
Consider the commuting cube
\begin{equation*}
\begin{tikzcd}
& E' \arrow[dr] \arrow[d] \arrow[dl] \\
\modal E' \arrow[d] & B' \arrow[dl] \arrow[dr] & E \arrow[dl,crossing over] \arrow[d] \\
\modal B' \arrow[dr] & \modal E \arrow[d] \arrow[from=ul,crossing over] & B \arrow[dl] \\
& \modal B. & \phantom{\modal E'}
\end{tikzcd}
\end{equation*}
The vertical squares on the back right and front right are pullback squares by assumption.
Then it follows from \cref{cor:etale_lex} that the vertical square on the front left is a pullback square.
Therefore the square on the back left is a pullback square by the pullback pasting property.
\end{proof}

\begin{defn}
Let $X$ be a type. We will define an operation
\begin{equation*}
\etmap:\Big(\sm{A:\UU_\modal}A\to\modal X\Big)\to\Big(\sm{Y:\UU}{g:Y\to X}\isetale(g)\Big)
\end{equation*}
\end{defn}

\begin{proof}[Construction]
Given a map $f:A\to \modal X$ we take the pullback
\begin{equation*}
\begin{tikzcd}
X\times_{\modal X}A \arrow[d,swap,"\pi_1"] \arrow[r,"\pi_2"] & A \arrow[d,"f"] \\
X \arrow[r,swap,"\modalunit"] & \modal X.
\end{tikzcd}
\end{equation*}
Then the map $\pi_1:X\times_{\modal X}A\to X$ is $\modal$-\'etale by \cref{lem:etale_modal,cor:etale_pb}.
\end{proof}

The following is a descent theorem for $\modal$-\'etale maps.

\begin{thm}[Modal descent]\label{thm:modal_descent}
For any modality $\modal$, and any type $X$, the operation
\begin{equation*}
\etmap:\Big(\sm{A:\UU_\modal}A\to\modal X\Big)\to\Big(\sm{Y:\UU}{g:Y\to X}\isetale(g)\Big)
\end{equation*}
is an equivalence.
\end{thm}

\begin{proof}
If $g:Y\to X$ is $\modal$-\'etale, then the square
\begin{equation*}
\begin{tikzcd}
Y \arrow[d,swap,"g"] \arrow[r,"\modalunit"] & \modal Y \arrow[d,"\modal g"] \\
X \arrow[r,swap,"\modalunit"] & \modal X
\end{tikzcd}
\end{equation*}
is a pullback square. Therefore $g:Y\to X$ is in the fiber of $\etmap$ at $\modal g : \modal Y\to\modal X$.

It remains to show that for any map $f:A\to\modal X$ with modal domain, there is an equivalence $\eqv{A}{\modal (X\times_{\modal X} A)}$ such that the triangle
\begin{equation*}
\begin{tikzcd}[column sep=tiny]
A \arrow[dr,swap,"f"] \arrow[rr,"\eqvsym"] & & \modal (X\times_{\modal X} A) \arrow[dl,"\modal(\etmap(f))"] \\
\phantom{\modal (X\times_{\modal X} A)} & \modal X
\end{tikzcd}
\end{equation*}
commutes. To see this, note that both $f\circ \pi_2$ and $\modal(\etmap(f))\circ \modalunit$ factor the same map as a $\modal$-connected map followed by a modal map, so the claim follows from uniqueness of factorizations.
\end{proof}

\begin{cor}
Suppose $P:X\to\UU_\modal$ is a family of modal types such that the projection map $\proj 1:\big(\sm{x:X}P(x)\big)\to X$ is $\modal$-\'etale. Then $P$ has a unique extension
\begin{equation*}
\begin{tikzcd}
X \arrow[d,swap,"\modalunit"] \arrow[r,"P"] & \UU_\modal. \\
\modal X \arrow[ur,densely dotted,swap,"\tilde{P}"]
\end{tikzcd}
\end{equation*}
It follows that the square commuting square
\begin{equation*}
\begin{tikzcd}
\sm{x:X}P(x) \arrow[d,swap,"\proj 1"] \arrow[r] & \sm{t:\modal X}\tilde{P}(t) \arrow[d,"\proj 1"] \\
X \arrow[r,swap,"\modalunit"] & \modal X
\end{tikzcd}
\end{equation*}
is a pullback square. In particular the top map is $\modal$-connected, so this square is in fact a $\modal$-naturality square.
\end{cor}

We conclude with a slightly more economic rephrasing of \cref{thm:etale_flattening}, which is an easy corollary of the results in this section.

\begin{thm}
Consider a commuting square
\begin{equation*}
\begin{tikzcd}
E' \arrow[d,swap,"{p'}"] \arrow[r,"g"] & E \arrow[d,"p"] \\
B' \arrow[r,swap,"f"] & B
\end{tikzcd}
\end{equation*}
with $H:f\circ p'\htpy p\circ g$, where $E$ and $B$ are modal types, where $p':E'\to B'$ is $\modal$-\'etale. Then the following are equivalent:
\begin{enumerate}
\item The square is a pullback square.
\item The square
\begin{equation*}
\begin{tikzcd}
\modal E' \arrow[r,"\tilde{g}"] \arrow[d,swap,"{\modal p'}"] & E \arrow[d,"p"] \\
\modal B \arrow[r,swap,"\tilde{f}"] & B
\end{tikzcd}
\end{equation*}
is a pullback square, where $\tilde{f}$ and $\tilde{g}$ are the unique extensions of $f$ and $g$ along the modal units of $B'$ and $E'$, respectively.
\end{enumerate}
\end{thm}

\subsection{The reflective factorization system of a modality}

In this subsection we investigate the reflective factorization system associated to a modality, of which the right class is the class of $\modal$-\'etale maps. The left class is the class of \emph{$\modal$-equivalences}.
\begin{defn}
We say that a map $f:A\to B$ is an \define{$\modal$-equivalence} if $L f:\modal A\to \modal B$ is an equivalence.
\end{defn}

\begin{rmk}
The difference between the notions of $\modal$-equivalences and $\modal$-connected maps is best explained by an example. In the case of $n$-truncation, the $n$-equivalences are precisely the maps that induce isomorphisms on the first $n$ homotopy groups. The $n$-connected maps are the maps that induce isomorphisms on the first $n$ homotopy groups, and moreover induce an epimorphism on the $(n+1)$-st homotopy group.

We also note that the $n$-equivalences are not stable under pullbacks, whereas the $n$-connected maps are. Consider for instance the pullback square
\begin{equation*}
\begin{tikzcd}
\loopspace {\sphere{n+1}} \arrow[r] \arrow[d] & \unit \arrow[d] \\
\unit\arrow[r] & \sphere{n+1}
\end{tikzcd}
\end{equation*}
Here the map on the right is an $n$-equivalence, since $\sphere{n+1}$ is $n$-connected. However, the map on the left is not an $n$-equivalence, since the $n$-th homotopy group of $\loopspace{\sphere{n+1}}$ is not trivial: it is the $(n+1)$-st homotopy group of $\sphere{n+1}$, which is $\Z$.
\end{rmk}

\begin{defn}
The \define{reflective factorization system} associated to a modality $\modal$ consists of the $\modal$-equivalences as the left class, and the $\modal$-\'etale maps as the right class.
\end{defn}

Our goal in this section is to show that the reflective factorization system associated to a modality is an orthogonal factorization system.

\begin{lem}\label{lem:3for2_mequiv}
The $\modal$-equivalences satisfy the 3-for-2 property: given a commuting triangle
\begin{equation*}
\begin{tikzcd}[column sep=tiny]
A \arrow[rr,"h"] \arrow[dr,swap,"f"] & & B \arrow[dl,"g"] \\
& C,
\end{tikzcd}
\end{equation*}
if any two of $f$, $g$, and $h$ are $\modal$-equivalences, then so is the third.
\end{lem}

\begin{proof}
Apply $\modal$ to the commuting triangle, and use the 3-for-2 property of equivalences.
\end{proof}

\begin{lem}\label{lem:modal_equivalence}
For a map $f : A \to B$ the following are equivalent:
\begin{enumerate}
\item $f$ is an $\modal$-equivalence.
\item For any modal type $X$, the precomposition map
\begin{equation*}
\precomp{f} : (B \to X) \to (A \to X)
\end{equation*}
is an equivalence.
\end{enumerate}
\end{lem}

\begin{proof}
Suppose first that $f$ is an $\modal$-equivalence, and let $X$ be $\modal$-modal. Then the square
\begin{equation*}
\begin{tikzcd}
X^B \arrow[r,"\precomp{f}"] \arrow[d,swap,"\precomp{\eta}"] & X^A \arrow[d,"\precomp{\eta}"] \\
X^{\modal B} \arrow[r,swap,"\precomp{\modal f}"] & X^{\modal A}
\end{tikzcd}
\end{equation*}
commutes. In this square the two vertical maps are equivalences by the universal property of modalization, and the bottom map is an equivalence since $\modal f$ is an equivalence. Therefore the map $\precomp{f}:X^B\to X^A$ is an equivalence, as desired.

Conversely, assume that $\precomp{f} : X^B \to X^A$ is an equivalence for every $\modal$-modal type $X$. By the square above it follows that $\precomp{\modal f}:X^{\modal B}\to X^{\modal A}$ is an equivalence for every $\modal$-modal type $X$. The fiber of $\modal A^{\modal B}\to \modal A^{\modal A}$ at $\idfunc:\modal A\to \modal A$ is contractible, so we obtain a retraction $g$ of $\modal f$. To see that $g$ is also a section observe that the fiber of $\modal B^{\modal B}\to \modal B^{\modal A}$ at $\modal f$ is contractible. This fiber contains $(\idfunc[\modal B],\refl{\modal f})$. However, we also have an identification $p:\precomp{\modal f}(\modal f\circ g)=\modal f$, since
\begin{equation*}
\precomp{\modal f}(\modal f\circ g)\jdeq (\modal f \circ g)\circ \modal f\jdeq \modal f \circ (g\circ \modal f) = \modal f.
\end{equation*}
Therefore $(\modal f\circ g,p)$ is in the fiber of $\precomp{\modal f}:\modal B^{\modal B}\to \modal B^{\modal A}$ at $\modal f$. By the contractibility of the fibers it follows that $(\modal f\circ g,p)=(\idfunc[\modal B],\refl{\modal f})$, so it follows that $\modal f\circ g=\idfunc[\modal B]$. In other words, $g$ is both a retraction and a section of $\modal f$, so $\modal f$ is an equivalence.
\end{proof}

\begin{cor}\label{cor:mequiv_mconn}
Every $\modal$-connected map is a $\modal$-equivalence.
\end{cor}

\begin{defn}
Let $f:A\to B$ be a map. We define
\begin{align*}
[A]_f & \defeq B \times_{\modal B}\modal A
\intertext{and we define the maps}
\mathsf{et}(f) & : [A]_f \to B \\
\bar{\eta} : A \to [A]_f
\end{align*}
by the universal property of pullbacks, as indicated in the following diagram
\begin{equation*}
\begin{tikzcd}
A \arrow[ddr,bend right=15,swap,"f"] \arrow[drr,bend left=15,"\modalunit"] \arrow[dr,"\bar{\eta}" description] \\
& {[A]_f} \arrow[d,"\mathsf{et}(f)"] \arrow[r,"\pi_2"] & \modal A \arrow[d,"\modal f"] \\
& B \arrow[r,swap,"\modalunit"] & \modal B.
\end{tikzcd}
\end{equation*}
\end{defn}

\begin{lem}\label{lem:rfs_factor}
For every map $f:A\to B$, the map $\bar{\eta}:A\to[A]$ is a $\modal$-equivalence, and the map $\mathsf{et}(f)$ is $\modal$-\'etale.
\end{lem}

\begin{proof}
The map $\mathsf{et}(f)$ is a pullback of a map between modal types, so it is $\modal$-\'etale by \cref{cor:etale_pb}. Furthermore, the map $\pi_2:[A] \to \modal A$ is a pullback of a $\modal$-connected map, so it is $\modal$-connected. It follows from \cref{cor:mequiv_mconn} that it is a $\modal$-equivalence. Since the modal unit $\modalunit :A\to\modal A$ is also $\modal$-connected, and therefore a $\modal$-equivalence, we obtain by the 3-for-2 property of $\modal$-equivalences established in \cref{lem:3for2_mequiv} that the gap map is also a $\modal$-equivalence.
\end{proof}

\begin{lem}\label{lem:rfs_orthogonal}
The class of $\modal$-equivalences is left orthogonal to the class of $\modal$-\'etale maps.
\end{lem}

\begin{proof}
We have to show that for every $\modal$-equivalence $i:A\to B$, and every $\modal$-\'etale map $f:X\to Y$, the square
\begin{equation*}
\begin{tikzcd}
X^B \arrow[r] \arrow[d] & Y^B \arrow[d] \\
X^A \arrow[r] & Y^A
\end{tikzcd}
\end{equation*}
is a pullback square. Consider the commuting cube
\begin{equation*}
\begin{tikzcd}
& X^B \arrow[dl] \arrow[d] \arrow[dr] \\
(\modal X)^B \arrow[d] & X^A \arrow[dl] \arrow[dr] & Y^B \arrow[d] \arrow[dl,crossing over] \\
(\modal X)^A \arrow[dr] & (\modal Y)^B \arrow[from=ul,crossing over] \arrow[d] & Y^A \arrow[dl] \\
& (\modal Y)^A & \phantom{(\modal X)^B}
\end{tikzcd}
\end{equation*}
In this cube the top and bottom squares are pullback by the assumption that $f$ is $\modal$-\'etale and the fact that exponents of pullback squares are again pullback squares. Furthermore, the square in the front left is pullback, because the two vertical maps are equivalences by the assumption that $i:A\to B$ is a $\modal$-equivalence. Therefore we conclude that the square in the back right is also a pullback square, as desired.
\end{proof}

\begin{cor}
For any map $f:X\to Y$, the type of factorizations into a $\modal$-connected map followed by a $\modal$-\'etale map is contractible.
\end{cor}

The class of $\modal$-\'etale morphisms into a given type $A$, thought of as objects of the slice category $\UU/A$, form a reflective subuniverse in the following sense.

\begin{thm}\label{thm:et_up}
Let $f:A\to X$ be a map. Then the pre-composition function
\begin{equation*}
\mathrm{hom}_X(\mathsf{et}(f),e)\to \mathrm{hom}_X(f,e)
\end{equation*}
is an equivalence for every \'etale map $e:B\to X$.
\end{thm}

\begin{proof}
Let $e:B\to X$ be a $\modal$-\'etale map. Then the square
\begin{equation*}
\begin{tikzcd}
B^{[A]} \arrow[r,"\blank\circ\eta_f"] \arrow[d,swap,"e\circ\blank"] & B^A \arrow[d,"e\circ\blank"] \\
X^{[A]} \arrow[r,swap,"\blank\circ\eta_f"] & X^A
\end{tikzcd}
\end{equation*}
is a pullback square by \cref{lem:rfs_factor,lem:rfs_orthogonal}. Therefore we have a fiberwise equivalence
\begin{equation*}
\prd{i:[A]\to X} \fib{e\circ\blank}{i}\to \fib{e\circ\blank}{i\circ\eta_f}
\end{equation*}
by \cref{cor:pb_fibequiv}. Now the claim follows, since we have a commuting square
\begin{equation*}
\begin{tikzcd}
\fib{e\circ\blank}{i} \arrow[r] \arrow[d,swap,"\eqvsym"] & \fib{e\circ\blank}{i\circ\eta_f} \arrow[d,"\eqvsym"] \\
\mathrm{hom}_X(\mathsf{et}(f),e) \arrow[r] & \mathrm{hom}_X(f,e)
\end{tikzcd}
\end{equation*}
with equivalences on both sides, for each $i:[A]\to X$.
\end{proof}

\section{The reflective factorization system for the reflexive coequalizer}

\subsection{\texorpdfstring{$\Delta$}{Δ}-\'etale maps}

\begin{defn}
Let $f:\mathsf{rGph}(\mathcal{A},\mathcal{B})$ be a morphism of reflexive graphs. We say that $f$ is \define{$\Delta$-\'etale} if the square
\begin{equation*}
\begin{tikzcd}
\mathcal{A} \arrow[d,swap,"f"] \arrow[r] & \Delta(\rcoeq(\mathcal{A})) \arrow[d,"\Delta(\rcoeq(f))"] \\
\mathcal{B} \arrow[r] & \Delta(\rcoeq(\mathcal{B}))
\end{tikzcd}
\end{equation*}
is a pullback square of reflexive graphs. We write $\mathsf{is\usc{}etale}_\Delta(f)$ for the proposition that $f$ is $\Delta$-\'etale, and we also write $\mathcal{R}^\Delta$ for the class of $\Delta$-\'etale morphisms of reflexive graphs.
\end{defn}

\begin{thm}\label{thm:etale_fibration}
Consider a morphism $f:\mathsf{rGph}(\mathcal{A},\mathcal{B})$ of reflexive graphs. The following are equivalent:
\begin{enumerate}
\item The morphism $f$ is a fibration in the sense of \cref{defn:graph_fibration}.
\item The morphism $f$ is $\Delta$-\'etale.
\end{enumerate}
\end{thm}

\begin{proof}
Consider the commuting diagram
\begin{equation*}
\begin{tikzcd}
& & \pts{\tilde A} \arrow[d] \arrow[dr] \\
& \edg{\tilde A} \arrow[dl] \arrow[d] \arrow[ur] & \pts{\tilde B} \arrow[dl] \arrow[dr] & \rcoeq(\mathcal{A}) \arrow[d] \\
\pts{\tilde A} \arrow[d] & \edg{\tilde B} \arrow[dl] \arrow[dr] \arrow[ur] & \rcoeq(\mathcal{A}) \arrow[from=ul,crossing over] \arrow[dl,crossing over] \arrow[d] \arrow[ur,crossing over] & \rcoeq(\mathcal{B}) \\
\pts{\tilde B} \arrow[dr] & \rcoeq(\mathcal{A}) \arrow[d] \arrow[from=ul,crossing over] & \rcoeq(\mathcal{B}) \arrow[dl] \arrow[ur] \\
\phantom{\rcoeq(\mathcal{B})} & \rcoeq(\mathcal{B})
\end{tikzcd}
\end{equation*}
If $f$ is $\Delta$-\'etale, then the three parallel vertical squares are pullback squares, hence so are the two squares on the back left side. This shows that (ii) implies (i).

Now suppose that $f$ is a fibration, or equivalently, that $f$ is cartesian. Then the map $\rcoeq(f)$ is the unique map such that the naturality squares are pullback squares. In particular, $f$ is a $\Delta$-\'etale map.
\end{proof}

\begin{cor}
Let $\mathcal{B}$ be a family of reflexive graphs over $\mathcal{A}$. The following are equivalent:
\begin{enumerate}
\item The family $\mathcal{B}$ is equifibered.
\item The morphism $\proj 1 : \mathsf{rGph}(\msm{\mathcal{A}}{\mathcal{B}},\mathcal{A})$ is $\Delta$-\'etale.
\end{enumerate}
\end{cor}

The following proposition is analogous to \cref{cor:etale_lex}.

\begin{prp}
Consider a pullback square
\begin{equation*}
\begin{tikzcd}
\mathcal{A}' \arrow[r] \arrow[d,swap,"{f'}"] & \mathcal{A} \arrow[d,"f"] \\
\mathcal{B}' \arrow[r] & \mathcal{B}
\end{tikzcd}
\end{equation*}
of reflexive graphs, and suppose that $f$ is a fibration. Then the square
\begin{equation*}
\begin{tikzcd}
\rcoeq(\mathcal{A}') \arrow[r] \arrow[d,swap,"\rcoeq({f'})"] & \rcoeq(\mathcal{A}) \arrow[d,"\rcoeq(f)"] \\
\rcoeq(\mathcal{B}') \arrow[r] & \rcoeq(\mathcal{B})
\end{tikzcd}
\end{equation*}
is again a pullback square.
\end{prp}

\begin{proof}
Consider the diagram
\begin{equation*}
\begin{tikzcd}
\mathcal{A}' \arrow[r] \arrow[d,swap,"{f'}"] & \mathcal{A} \arrow[d,"f"] \arrow[r,"\mathsf{constr}"] &[1ex] \Delta(\rcoeq(\mathcal{A})) \arrow[d,"\Delta(\rcoeq(f))"] \\
\mathcal{B}' \arrow[r] & \mathcal{B} \arrow[r,"\mathsf{constr}"'] & \Delta(\rcoeq(\mathcal{B}))
\end{tikzcd}
\end{equation*}
of reflexive graphs. Since $f$ is assumed to be a fibration, we obtain by \cref{thm:etale_fibration} that the square on the right is a pullback square. Furthermore, since the left square is a pullback square by assumption, it follows that the outer rectangle is again a pullback square. Hence the assertion follows from \cref{thm:rcoeq_cartesian}.
\end{proof}

The following proposition is analogous to \cref{cor:etale_pb}.

\begin{prp}
Consider a pullback square
\begin{equation*}
\begin{tikzcd}
\mathcal{A}' \arrow[r] \arrow[d,swap,"{f'}"] & \mathcal{A} \arrow[d,"f"] \\
\mathcal{B}' \arrow[r] & \mathcal{B}
\end{tikzcd}
\end{equation*}
of reflexive graphs, and suppose that $f$ is a fibration. Then $f'$ is a fibration.
\end{prp}

\begin{proof}
Consider the cube
\begin{equation*}
\begin{tikzcd}
& \mathcal{A}' \arrow[dr] \arrow[d] \arrow[dl] \\
\Delta(\rcoeq(\mathcal{A}')) \arrow[d] & \mathcal{B}' \arrow[dl] \arrow[dr] & \mathcal{A} \arrow[dl,crossing over] \arrow[d] \\
\Delta(\rcoeq(\mathcal{B}')) \arrow[dr] & \Delta(\rcoeq(\mathcal{A})) \arrow[d] \arrow[from=ul,crossing over] & \mathcal{B} \arrow[dl] \\
& \Delta(\rcoeq(\mathcal{B})). & \phantom{\Delta(\rcoeq(\mathcal{A}'))}
\end{tikzcd}
\end{equation*}
Then the two squares in the front and the square in the back right are pullback squares, so it follows that the square in the back left is a pullback square.
\end{proof}

\subsection{The reflective factorization system of discrete graphs}

\begin{defn}
Let $f:\mathsf{rGph}(\mathcal{B},\mathcal{A})$ be a morphism of reflexive graphs. We say that $f$ is a \define{$\Delta$-equivalence} if the map
\begin{equation*}
\begin{tikzcd}
\rcoeq(f):\rcoeq(\mathcal{B})\to \rcoeq(\mathcal{A})
\end{tikzcd}
\end{equation*}
is an equivalence. We also write $\mathcal{L}^\Delta$ for the class of $\Delta$-equivalences of reflexive graphs.
\end{defn}

\begin{lem}
The $\Delta$-equivalences satisfy the 3-for-2 property.\hfill$\square$
\end{lem}

\begin{prp}
Let $f:\mathsf{rGph}(\mathcal{B},\mathcal{A})$ be a morphism of reflexive graphs. The following are equivalent:
\begin{enumerate}
\item $f$ is a $\Delta$-equivalence.
\item For any type $X$, the map
\begin{equation*}
\mathsf{rGph}(\mathcal{A},\Delta(X))\to\mathsf{rGph}(\mathcal{B},\Delta(X))
\end{equation*}
is an equivalence.
\end{enumerate}
\end{prp}

\begin{proof}
We have a commuting square
\begin{equation*}
\begin{tikzcd}
\mathsf{rGph}(\mathsf{rcoeq}(\mathcal{A}),X) \arrow[r,"\blank\circ \mathsf{rcoeq}(f)"] \arrow[d] & \mathsf{rGph}(\mathsf{rcoeq}(\mathcal{B}),X) \arrow[d] \\
\mathsf{rGph}(\mathcal{A},\Delta(X)) \arrow[r,"\blank\circ f"] & \mathsf{rGph}(\mathcal{B},\Delta(X))
\end{tikzcd}
\end{equation*}
in which the two vertical maps are equivalences. Therefore it follows that if $\mathsf{rcoeq}(f)$ is an equivalence, then so is the bottom map in the square. Conversely, if the bottom map in the square is an equivalence for every type $X$, then $\blank\circ\mathsf{rcoeq}(f)$ is an equivalence for any type $X$, which implies by \cref{prp:equiv_precomp} that $\mathsf{rcoeq}(f)$ is an equivalence.
\end{proof}

\begin{defn}
Let $f:\mathsf{rGph}(\mathcal{B},\mathcal{A})$ be a morphism of reflexive graphs. We define the morphisms
\begin{align*}
\mathsf{et}_\Delta(f) & : \mathsf{rGph}(\mathcal{B}^{\eqvsym},\mathcal{A}) \\
\mathsf{\eta}_f & : \mathsf{rGph}(\mathcal{B},\mathcal{B}^{\eqvsym})
\end{align*}
by the universal property of pullbacks, as indicated in the following diagram
\begin{equation*}
\begin{tikzcd}
\mathcal{B} \arrow[ddr,bend right=15] \arrow[drr,bend left=15] \arrow[dr,densely dotted,"\eta_f" near end] \\
& \mathcal{B}^{\eqvsym} \arrow[dr,phantom,"\lrcorner" {very near start,xshift=-1ex}] \arrow[d,"\mathsf{et}_\Delta(f)"] \arrow[r] & \Delta(\rcoeq(\mathcal{B})) \arrow[d] \\[1ex]
& \mathcal{A} \arrow[r,swap,"\mathsf{constr}"] & \Delta(\rcoeq(\mathcal{A}))
\end{tikzcd}
\end{equation*}
The morphism $\mathsf{et}_\Delta(f)$ is called the \define{\'etale factor} of $f$, and the morphism $\eta_f$ is called the \define{unit} of the \'etale factor.
\end{defn}

\begin{lem}\label{lem:D_equiv_pullback}
For any morphism $f:\mathsf{rGph}(\mathcal{B},\mathcal{A})$, the unit $\eta_f$ of the \'etale factor of $f$ is a $\Delta$-equivalence.
\end{lem}

\begin{proof}
By \cref{thm:rcoeq_cartesian}, it follows that the square
\begin{equation*}
\begin{tikzcd}
\rcoeq(\mathcal{B}^{\eqvsym}) \arrow[d] \arrow[r] & \rcoeq(\Delta(\rcoeq(\mathcal{B}))) \arrow[d] \\
\rcoeq(\mathcal{A}) \arrow[r] & \rcoeq(\Delta(\rcoeq(\mathcal{A})))
\end{tikzcd}
\end{equation*}
is a pullback square. Since the bottom map is an equivalence of reflexive graphs, it follows that the top map is an equivalence of reflexive graphs. In other words, we have shown that the map
\begin{equation*}
\begin{tikzcd}
\mathcal{B}^{\eqvsym} \arrow[r] & \Delta(\rcoeq(\mathcal{B}))
\end{tikzcd}
\end{equation*}
is a $\Delta$-equivalence. Of course, the morphism $\mathsf{constr}:\mathcal{B}\to\Delta(\rcoeq(\mathcal{B}))$ is also a $\Delta$-equivalence, so the claim follows by the 3-for-2 property of $\Delta$-equivalences.
\end{proof}

\begin{thm}\label{thm:modal_rofs}
The pair $(\mathcal{L}^\Delta,\mathcal{R}^\Delta)$ forms an orthogonal factorization system of reflexive graphs.
\end{thm}

\begin{proof}
Since any pullback of a morphism between discrete reflexive graphs is a fibration of reflexive graphs, it follows from \cref{lem:D_equiv_pullback} that every morphism of reflexive graphs factors as a $\Delta$-equivalence followed by a $\Delta$-\'etale map. Therefore it remains to show that the class of $\Delta$-equivalences is left orthogonal to the class of $\Delta$-\'etale maps.

We have to show that for every $\Delta$-equivalence $i:\mathcal{A}\to\mathcal{B}$, and every $\Delta$-\'etale morphism $f:\mathcal{X}\to\mathcal{Y}$, the square
\begin{equation*}
\begin{tikzcd}
\mathcal{X}^{\mathcal{B}} \arrow[r] \arrow[d] & \mathcal{Y}^{\mathcal{B}} \arrow[d] \\
\mathcal{X}^{\mathcal{A}} \arrow[r] & \mathcal{Y}^{\mathcal{A}}
\end{tikzcd}
\end{equation*}
is a pullback square. Consider the commuting cube
\begin{equation*}
\begin{tikzcd}
& \mathcal{X}^{\mathcal{B}} \arrow[dl] \arrow[d] \arrow[dr] \\
\Delta(\rcoeq(\mathcal{X}))^{\mathcal{B}} \arrow[d] & \mathcal{X}^{\mathcal{A}} \arrow[dl] \arrow[dr] & \mathcal{Y}^{\mathcal{B}} \arrow[d] \arrow[dl,crossing over] \\
\Delta(\rcoeq(\mathcal{X}))^{\mathcal{A}} \arrow[dr] & \Delta(\rcoeq(\mathcal{Y}))^{\mathcal{B}} \arrow[from=ul,crossing over] \arrow[d] & \mathcal{Y}^{\mathcal{A}} \arrow[dl] \\
& \Delta(\rcoeq(\mathcal{Y}))^{\mathcal{A}} & \phantom{\Delta(\rcoeq(\mathcal{X}))^{\mathcal{B}}}
\end{tikzcd}
\end{equation*}
In this cube the top and bottom squares are pullback by the assumption that $f$ is $\Delta$-\'etale and the fact that exponents of pullback squares are again pullback squares. Furthermore, the square in the front left is pullback, because the two vertical maps are equivalences by the assumption that $i:\mathcal{A}\to\mathcal{B}$ is a $\Delta$-equivalence. Therefore we conclude that the square in the back right is also a pullback square, as desired.
\end{proof}

\begin{thm}\label{thm:rgph_et_up}
For any morphism $f:\mathsf{rGph}(\mathcal{B},\mathcal{A})$, the pre-composition map
\begin{equation*}
\mathsf{rGph}_{\mathcal{A}}(\mathsf{et}_\Delta(f),e)\to \mathrm{hom}_{\mathcal{A}}(f,e)
\end{equation*}
is an equivalence for every $\Delta$-\'etale map $e:\mathcal{C}\to\mathcal{A}$.
\end{thm}

\begin{proof}
Analogous to \cref{thm:et_up}.
\end{proof}

\subsection{Equifibrant replacement}\label{sec:equifibrant_replacement}

\begin{defn}
Let $\mathcal{B}$ and $\mathcal{C}$ be families of reflexive graphs over $\mathcal{A}$. We define the type
\begin{equation*}
\mathsf{rGph}_{\mathcal{A}}(\mathcal{B},\mathcal{C})
\end{equation*}
of morphisms of reflexive graphs \define{over} $\mathcal{A}$ to consist of triples $(\pts{f},\edg{f},\rfx{f})$ consisting of
\begin{align*}
\pts{f}(x) & : \pts{B}(x)\to \pts{C}(x) \\
\edg{f}(e) & : \prd{u:\pts{B}(x)}{v:\pts{B}(y)} \edg{B}(e,u,v)\to \edg{C}(e,\pts{f}(u),\pts{f}(v)) \\
\rfx{f}(x) & : \prd{u:\pts{B}(x)} \edg{f}(\rfx{\mathcal{B}}(x,u))=\rfx{\mathcal{C}}(x,\pts{f}(u))
\end{align*}
\end{defn}

\begin{lem}
Let $\mathcal{B}$ and $\mathcal{C}$ be families of reflexive graphs over $\mathcal{A}$. Then there is an equivalence
\begin{equation*}
\eqv{\mathsf{rGph}_{\mathcal{A}}(\mathcal{B},\mathcal{C})}{\sm{f:\mathsf{rGph}(\msm{\mathcal{A}}{\mathcal{B}},\msm{\mathcal{A}}{\mathcal{B}})} \proj 1 = \proj 1 \circ f}.
\end{equation*}
\end{lem}

Note that, given a reflexive graph $\mathcal{A}$, any family $B:\mathsf{rcoeq}(\mathcal{A})\to\UU$ determines an equifibered family $\mathsf{equifib\usc{}fam}(B)$ over $\mathcal{A}$ given by
\begin{align*}
\pts{\mathsf{equifib\usc{}fam}(B)}(x) & \defeq B(\mathsf{constr}_0(x)) \\
\edg{\mathsf{equifib\usc{}fam}(B)}(e) & \defeq \mathsf{tr}_B(\mathsf{constr}_1(e)) \\
\rfx{\mathsf{equifib\usc{}fam}(B)}(x,y) & \defeq \mathsf{htpy\usc{}eq}(\mathsf{ap}_{\mathsf{tr}_B}(\rfx{\mathsf{constr}}(x)),y).
\end{align*}
In other words, $\mathsf{equifib\usc{}fam}$ is an operation that takes a family $B:\mathsf{rcoeq}(\mathcal{A})\to\UU$ to an equifibered family over $\mathcal{A}$. Moreover, it is not hard to see that
\begin{equation*}
\mathsf{equifib\usc{}fam} : (\mathsf{rcoeq}(\mathcal{A})\to\UU)\to\mathsf{equifib}(\mathcal{A})
\end{equation*}
is in fact an equivalence, where $\mathsf{equifib}(\mathcal{A})$ is the type of all (small) equifibered families over $\mathcal{A}$. In the following definition we observe that any family over $\mathcal{A}$ induces an equifibered family over $\mathcal{A}$.

\begin{defn}
Let $\mathcal{B}$ be a family of reflexive graphs over $\mathcal{A}$. We define the \define{equifibrant replacement} $\mathsf{EqF}(\mathcal{B})$ of $\mathcal{B}$ by
\begin{equation*}
\mathsf{EqF}(\mathcal{B}) \defeq \mathsf{equifib\usc{}fam}(\fibf{\rcoeq(\proj 1)}),
\end{equation*}
and we define the morphism $\eta_{\mathcal{B}}:\mathsf{rGph}_{\mathcal{A}}(\mathcal{B},\mathsf{EqF}(\mathcal{B}))$.
\end{defn}

\begin{thm}\label{thm:eqf_initial}
Consider a family $\mathcal{B}$ of reflexive graphs over $\mathcal{A}$, and let $\mathcal{E}$ be an equifibered family over $\mathcal{A}$. Then the pre-composition operation
\begin{equation*}
\mathsf{rGph}_{\mathcal{A}}(\mathsf{EqF}(\mathcal{B}),\mathcal{E})\to \mathsf{rGph}_{\mathcal{A}}(\mathcal{B},\mathcal{E})
\end{equation*}
is an equivalence for every equifibered family $\mathcal{E}$ over $\mathcal{A}$.
\end{thm}

\begin{proof}
First we observe that the square
\begin{equation*}
\begin{tikzcd}
\msm{\mathcal{A}}{\mathsf{EqF}(\mathcal{B})} \arrow[r] \arrow[d,swap,"p"] & \Delta(\mathsf{rcoeq}(\msm{\mathcal{A}}{\mathcal{B}})) \arrow[d,"\mathsf{rcoeq}(\proj 1)"] \\
\mathcal{A} \arrow[r,swap,"\mathsf{constr}"] & \Delta(\mathsf{rcoeq}(\mathcal{A}))
\end{tikzcd}
\end{equation*}
is a pullback square of reflexive graphs. Thus, the map $p$ is the \'etale factor of the morphism $\proj 1 : \msm{\mathcal{A}}{\mathcal{B}}\to \mathcal{A}$. Now the claim follows by \cref{thm:rgph_et_up}.
\end{proof}

\begin{rmk}
By the universal property of the equifibrant replacement it follows that the family $\pts{\mathsf{EqF}(\mathcal{B})}$ of vertices of the equifibrant replacement of $\mathcal{B}$ can be seen as a `recursive' higher inductive family of types. It comes equipped with
\begin{align*}
\zeta & : \prd{x,y:\pts{A}} \edg{A}(x,y)\to \eqv{\pts{\mathsf{EqF}(\mathcal{B})}(x)}{\pts{\mathsf{EqF}(\mathcal{B})}(y)} \\
\epsilon & : \prd{x:\pts{A}} \zeta(\rfx{\mathcal{A}}(x))\htpy \idfunc[\pts{\mathsf{EqF}(\mathcal{B})}(x)] \\
\pts{\eta} & : \prd{x:\pts{A}} \pts{B}(x) \to \pts{\mathsf{EqF}(\mathcal{B})}(x) \\
\edg{\eta} & : \prd{x,y:\pts{A}}{e:\edg{A}(x,y)}{u:\pts{B}(x)}{v:\pts{B}(y)} \edg{B}(e,u,v) \to \zeta(e,u)=v \\
\rfx{\zeta} & : \prd{x:\pts{A}}{u:\pts{B}(x)} \edg{\eta}(\rfx{\mathcal{A}}(x),\rfx{\mathcal{B}}(u))= \epsilon(x,u).
\end{align*}
In other words, the equifibrant replacement is the homotopy initial family of types over $\pts{A}$ with equivalences over the edges of $\mathcal{A}$ (coherent with reflexivity) and a morphism $\eta : \mathsf{rGph}_{\mathcal{A}}(\mathcal{B},\mathsf{EqF}(\mathcal{B}))$.
\end{rmk}

\subsection{Identity types of reflexive coequalizers}

\begin{defn}
Consider a reflexive graph $\mathcal{A}$ with a base point $a:A_0$. We define the \define{universal $\Delta$-bundle} $\mathcal{E}(a)$ over $\mathcal{A}$ at $a$ to be the equifibered family over $\mathcal{A}$ corresponding to the equifibrant replacement of the morphism $a:\mathsf{rGph}(\unit,\mathcal{A})$ corresponding to $a:A_0$.
\end{defn}

\begin{prp}
Consider a reflexive graph $\mathcal{A}$ with a base point $a:A_0$. Then there are equivalences
\begin{equation*}
\pts{\mathcal{E}(a)}(x) \eqvsym (\mathsf{constr}_0(a)=\mathsf{constr}_0(x))
\end{equation*}
In particular, we have an equivalence $\eqv{\pts{\mathcal{E}(a)}(a)}{\loopspace{\rcoeq(\mathcal{A})}}$.
\end{prp}

\begin{proof}
Immediate from the definition of the equifibrant replacement.
\end{proof}

In the following theorem we establish the universal property of the identity type of $\rcoeq(\mathcal{A})$ as the initial reflexive relation $R$ on $\pts{A}$ with certain extra structure.

\begin{thm}
Consider a reflexive graph $\mathcal{A}$, and let
\begin{align*}
R & : A_0 \to A_0 \to\UU, \\
\rho & : \prd{x:A_0}R(x,x)
\end{align*}
be a reflexive relation on $A_0$ equipped with a `composition' operation
\begin{equation*}
\mu:\prd{a,x,y:\pts{A}} \edg{A}(x,y) \to (\eqv{R(a,x)}{R(a,y)}).
\end{equation*}
satisfying the unit law
\begin{align*}
\mathsf{left\usc{}unit}_\mu & : \prd{a,x:\pts{A}}{r:R(a,x)} \mu(\rfx{\mathcal{A}}(x),r)=r.
\end{align*}
Then there is a unique extension
\begin{equation*}
\begin{tikzcd}
\mathcal{A} \arrow[r,"\bar{\mu}"] \arrow[d] & (A_0,R,\rho) \\
k(\mathsf{constr}_0) \arrow[ur,densely dotted]
\end{tikzcd}
\end{equation*}
of the morphism $\bar{\mu}:\mathsf{rGph}(\mathcal{A},(A_0,R,\rho))$ consisting of
\begin{align*}
\pts{\bar{\mu}} & \defeq \mathsf{constr}_0 \\
\edg{\bar{\mu}}(e) & \defeq \mu(e,\rho(x)) \\
\rfx{\bar{\mu}}(x) & \defeq \mathsf{left\usc{}unit}_\mu(\rho(x)),
\end{align*}
where $k(\mathsf{constr}_0)$ is the pre-kernel of the function $\mathsf{constr}_0:A_0\to\rcoeq(\mathcal{A})$.
\end{thm}

\begin{proof}
The data $(R,\mu,\mathsf{left\usc{}unit}_\mu)$ equivalently gives for every $a:A$ an equifibered family $\mathcal{B}(a)$ over $\mathcal{A}$ consisting of
\begin{align*}
\pts{\mathcal{B}(a)}(x) & \defeq R(a,x) \\
\edg{\mathcal{B}(a)}(e) & \defeq \mu(e) \\
\rfx{\mathcal{B}(a)}(x,r) & \defeq \mathsf{left\usc{}unit}_\mu(r),
\end{align*}
and the reflexivity term $\rho$ provides for every $a:\pts{A}$ a term of type $\pts{\mathcal{B}(a)}$. Thus we have by \cref{thm:eqf_initial} for every $a:\pts{A}$ a unique morphism from the equifibrant replacement of $a:\unit\to \mathcal{A}$ to $\mathcal{B}$ over $\mathcal{A}$. Equivalently, we have a unique extension of $\bar{\mu}$ along $\mathcal{A}\to k(\mathsf{constr}_0)$ as asserted.
\end{proof}

\begin{cor}
The loop space of the suspension $\susp X$ of a pointed type $X$ is the initial pointed type $Y$ equipped with a pointed map
\begin{equation*}
X\to_\ast (\eqv{Y}{Y}).
\end{equation*}
In particular, the loop space of the $(n+1)$-sphere is the initial pointed type $Y$ equipped with a pointed map $\sphere{n}\to (\eqv{Y}{Y})$, or equivalently, an $(n+1)$-loop $\loopspace[n+1]{\mathrm{BAut}(Y)}$. Even more in particular, the loop space of the $2$-sphere is the initial pointed type $Y$ equipped with a homotopy $\idfunc[Y]\htpy\idfunc[Y]$.
\end{cor}

\begin{cor}
The type $\Z$ if integers is the initial pointed type equipped with an automorphism.
\end{cor}

\section{Equifibrant replacement for other homotopy colimits}

\subsection{Equifibrant replacement for diagrams over graphs}

Recall that the colimit of a diagram $\mathcal{D}$ over a reflexive graph $\mathcal{A}$ is simply the reflexive coequalizer of the reflexive graph $\msm{\mathcal{A}}{\mathcal{D}}$.

\begin{defn}
Let $\tau:\mathcal{D}'\to\mathcal{D}$ be a natural transformation of diagrams over a reflexive graph $\mathcal{A}$.
\begin{enumerate}
\item We say that $\tau$ is a \define{weak equivalence} if it induces an equivalence
\begin{equation*}
\tfcolim(\tau):\tfcolim(\mathcal{D}')\to\tfcolim(\mathcal{D}).
\end{equation*}
We write $\mathcal{W}$ for the class of weak equivalences.
\item We say that $\tau$ is \define{\'etale} if the square
\begin{equation*}
\begin{tikzcd}
\msm{\mathcal{A}}{\mathcal{D}'} \arrow[d,swap,"\tau"] \arrow[r] & \Delta(\tfcolim(\mathcal{D}')) \arrow[d,"\tfcolim(\tau)"] \\
\msm{\mathcal{A}}{\mathcal{D}} \arrow[r] & \Delta(\tfcolim(\mathcal{D}))
\end{tikzcd}
\end{equation*}
is a pullback square of reflexive graphs. We write $\mathcal{R}$ for the class of \'etale maps.
\end{enumerate}
\end{defn}

\begin{thm}
A natural transformation $\tau:\mathcal{D}'\to\mathcal{D}$ is \'etale if and only if it is cartesian.
\end{thm}

\begin{proof}
This follows directly by \cref{thm:etale_fibration,prp:nattrans_cartesian}.
\end{proof}

\begin{thm}
The pair $(\mathcal{W},\mathcal{R})$ forms an orthogonal factorization system.
\end{thm}

\begin{proof}
This follows from \cref{thm:modal_rofs}.
\end{proof}

\section{Equifibrant replacement for sequential colimits}\label{sec:seqcolim_eqf}%
\sectionmark{Sequential colimits}

\begin{defn}
Let $\mathcal{B}$ be a sequential family over $\mathcal{A}$, and consider $x:A_n$. We write $\mathcal{B}_n[x]$ for the type sequence
\begin{equation*}
\begin{tikzcd}
B_n(x) \arrow[r] & B_{n+1}(f_n(x)) \arrow[r] & B_{n+2}(f_{n+1}(f_n(x))) \arrow[r] & \cdots.
\end{tikzcd}
\end{equation*}
\end{defn}

\begin{defn}
Let $\mathcal{B}$ be a sequential family over $\mathcal{A}$. We will define an equifibered sequential family $\square\mathcal{B}$ over $\mathcal{A}$ equipped with a morphism
\begin{equation*}
\mathrm{hom}_{\mathcal{A}}(\mathcal{B},\square\mathcal{B})
\end{equation*}
\end{defn}

\begin{proof}[Construction]
We define
\begin{equation*}
\square B : \prd{n:\N}A_n\to\UU
\end{equation*}
by $\square B_n(x)\defeq \tfcolim \mathcal{B}_n[x]$. Next, we have to construct a fiberwise equivalence
\begin{equation*}
g_\infty : \prd{n:\N}{x:A_n} \square B_n(x) \eqvsym \square B_{n+1}(f_n(x))
\end{equation*}
Note that we have the natural transformation
\begin{equation*}
\begin{tikzcd}[column sep=small]
B_n(x) \arrow[d] \arrow[r] & \cdots \arrow[r] & B_{k+n}(f^k(x)) \arrow[r] \arrow[d] & B_{(k+1)+n}(f^{k+1}(x)) \arrow[r] \arrow[d] & \cdots \\
B_{n+1}(x) \arrow[r] & \cdots \arrow[r] & B_{k+(n+1)}(f^k(f(x))) \arrow[r] & B_{(k+1)+(n+1)}(f^{k+1}(f(x))) \arrow[r]
& \cdots
\end{tikzcd}
\end{equation*}
Now we observe that there are identifications
\begin{equation*}
(k+(n+1),f^k(f(x)))=((k+1)+n,f^{k+1}(x)),
\end{equation*}
which we may use to construct equivalences going up diagonally in each naturality square. An induction argument reveals that each square of the form
\begin{equation*}
\begin{tikzcd}
B_{k+(n+1)}(f^k(f(x))) \arrow[r] \arrow[d] & B_{(k+1)+(n+1)}(f^{k+1}(f(x))) \arrow[d] \\
B_{(k+1)+n}(f^{k+1}(x)) \arrow[r] & B_{(k+2)+n}(f^{k+2}(x))
\end{tikzcd}
\end{equation*}
commutes, from which we obtain the desired equivalence.\footnote{A formalization of this argument appears in \url{https://github.com/cmu-phil/Spectral/blob/master/colimit/seq_colim.hlean}}
\end{proof}

\begin{thm}\label{thm:colim_fib}
The equifibered family $\square\mathcal{B}$ over $\mathcal{A}$ satisfies the universal property that
\begin{equation*}
\mathrm{hom}_{\mathcal{A}}(\square\mathcal{B},\mathcal{E})\to\mathrm{hom}_{\mathcal{A}}(\mathcal{B},\mathcal{E})
\end{equation*}
is an equivalence for any equifibered family $\mathcal{E}$ over $\mathcal{A}$.
\end{thm}

\begin{proof}
This fact is formalized in \cite{DoornRijkeSojakova}. An `informalized' proof is work in progress.
\end{proof}

\begin{cor}\label{thm:colim_sigma}
Let $\mathcal{B}$ be a sequential family over $\mathcal{A}$. Then we have a commuting triangle
\begin{equation*}
\begin{tikzcd}[column sep=tiny]
\mathsf{colim}\Big(\msm{\mathcal{A}}{\mathcal{B}}\Big) \arrow[rr] \arrow[dr,swap,"\mathsf{colim}(\proj 1)"] & & \sm{x:A_\infty} B_\infty(x) \arrow[dl,"\proj 1"] \\
\phantom{\sm{x:A_\infty} B_\infty(x)} & A_\infty & \phantom{\mathsf{colim}\Big(\msm{\mathcal{A}}{\mathcal{B}}\Big)}
\end{tikzcd}
\end{equation*}
in which the top map is an equivalence.
\end{cor}

\begin{proof}
Since $\square\mathcal{B}$ and $\mathsf{EqF}\mathcal{B}$ both satisfy the universal property of the equifibrant replacement of $\mathcal{B}$, they are the same sequences over $\mathcal{A}$. It follows that the square
\begin{equation*}
\begin{tikzcd}
\msm{\mathcal{A}}{\square\mathcal{B}} \arrow[r] \arrow[d,swap,"\proj 1"] & \Delta(\mathsf{colim}(\msm{\mathcal{A}}{\mathcal{B}})) \arrow[d,"\Delta(\mathsf{colim}(\mathcal{A}))"] \\
\mathcal{A} \arrow[r,swap,"\mathsf{seq\usc{}in}"] & \Delta(\mathsf{colim}(\mathcal{A}))
\end{tikzcd}
\end{equation*}
is a pullback square of type sequences. We conclude that the top arrow is a colimiting cocone, so the result follows.
\end{proof}

\begin{cor}\label{thm:colim_id}
Consider a type sequence
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r] & A_1 \arrow[r] & A_2 \arrow[r] & \cdots.
\end{tikzcd}
\end{equation*}
Then the canonical map
\begin{equation*}
\mathsf{colim}(f^n(x)= f^n(y)) \to (\mathsf{seq\usc{}in}_0(x)=\mathsf{seq\usc{}in}_0(y))
\end{equation*}
is an equivalence for every $x,y:A_0$.
\end{cor}

\begin{thm}\label{thm:seq_colim_pb}
Consider a sequence
\begin{equation*}
\begin{tikzcd}[column sep=small,row sep=small]
& C_0 \arrow[dl] \arrow[dd] \arrow[rr] & & C_1 \arrow[dl] \arrow[dd] \arrow[rr] & & C_2 \arrow[dl] \arrow[dd] \arrow[rr] & & \cdots \\
A_0 \arrow[dd] \arrow[rr,crossing over] & & A_1 \arrow[rr,crossing over] & & A_2 \arrow[rr,crossing over] & & \cdots \\
& B_0 \arrow[dl] \arrow[rr] & & B_1 \arrow[dl] \arrow[rr] & & B_2 \arrow[dl] \arrow[rr] & & \cdots \\
X_0 \arrow[rr] & \phantom{B_2} & X_1 \arrow[rr] \arrow[from=uu,crossing over] & \phantom{B_2} & X_2 \arrow[rr] \arrow[from=uu,crossing over] & \phantom{B_2} & \cdots
\end{tikzcd}
\end{equation*}
of pullback squares. Then the sequential colimit
\begin{equation*}
\begin{tikzcd}
C_\infty \arrow[r] \arrow[d] & B_\infty \arrow[d] \\
A_\infty \arrow[r] & X_\infty
\end{tikzcd}
\end{equation*}
is again a pullback square.
\end{thm}

\begin{proof}
Since sequential colimits commute with $\Sigma$ and identity types, they commute with pullbacks.
\end{proof}

\begin{cor}\label{thm:colim_fiberseq}
Consider a sequence of fiber sequences
\begin{equation*}
\begin{tikzcd}
F_0 \arrow[d] \arrow[r] & F_1 \arrow[d] \arrow[r] & F_2 \arrow[d] \arrow[r] & \cdots \\
E_0 \arrow[d] \arrow[r] & E_1 \arrow[d] \arrow[r] & E_2 \arrow[d] \arrow[r] & \cdots \\
B_0 \arrow[r] & B_1 \arrow[r] & B_2 \arrow[r] & \cdots
\end{tikzcd}
\end{equation*}
in which all maps and homotopies are assumed to be pointed. Then the colimit
\begin{equation*}
\begin{tikzcd}
F_\infty \hookrightarrow E_\infty \twoheadrightarrow B_\infty
\end{tikzcd}
\end{equation*}
is again a fiber sequence.
\end{cor}

\begin{cor}
Consider a type sequence
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r] & A_1 \arrow[r] & A_2 \arrow[r] & \cdots
\end{tikzcd}
\end{equation*}
of pointed types (and pointed maps between them). Then the canonical map
\begin{equation*}
\mathsf{colim}(\loopspace{A_{n}}) \to \loopspace{A_{\infty}}
\end{equation*}
is an equivalence.
\end{cor}

\begin{prp}\label{thm:colim_hlevel}
Consider a type sequence
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r] & A_1 \arrow[r] & A_2 \arrow[r] & \cdots
\end{tikzcd}
\end{equation*}
If each $A_n$ is $k$-truncated, then so is the sequential colimit $A_\infty$.
\end{prp}

\begin{proof}
We prove the claim by induction on $k\geq -2$. The base case is trivial, and the inductive step follows since sequential colimits commute with identity types.
\end{proof}

\begin{thm}
Consider a type sequence
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r] & A_1 \arrow[r] & A_2 \arrow[r] & \cdots
\end{tikzcd}
\end{equation*}
Then the canonical map
\begin{equation*}
\mathsf{colim}_n \trunc{k}{A_n} \to \trunc{k}{A_\infty}
\end{equation*}
is an equivalence.
\end{thm}

\begin{thm}\label{thm:colim_hgroup}
Consider a type sequence
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r] & A_1 \arrow[r] & A_2 \arrow[r] & \cdots
\end{tikzcd}
\end{equation*}
Then the canonical map
\begin{equation*}
\mathsf{colim}_n(\pi_k(A_n))\to \pi_k(A_\infty)
\end{equation*}
is a group isomorphism, for any $k\geq 1$.
\end{thm}

\endinput
\section{From jww Floris and Kristina}
Recall that the relation $\leq$ on the natural numbers is defined as an inductive family of types $\leq:\N\to\N\to\UU$ with
\begin{align*}
r & : \prd{n:\N} n\leq n \\
s & : \prd{n,m:\N} n\leq m \to n\leq m+1.
\end{align*}
It follows that $n\leq m$ is a mere proposition for each $n,m:\N$.

\begin{defn}
Let $\sequence{A}{f}$ be a type sequence. For any $n,m:\nat$, we define
\begin{equation*}
f^{n\leq m} : A_n\to A_m.
\end{equation*}
where we leave the proof that $n\leq m$ implicit.
\end{defn}

\begin{proof}[Construction]
We define $f^{n\leq m}$ by induction on the proof that $n\leq m$ by taking
\begin{align*}
f^{n\leq n} & \defeq \idfunc[A_n] \\
f^{n\leq m+1} & \defeq f_m\circ f^{n\leq m} \qedhere
\end{align*}
\end{proof}

\begin{defn}
Let $\sequence{A}{f}$ be a type sequence. For any $n,k:\nat$, we define
$f_n^k:A_n\to A_{n+k}$ to be $f^{n\leq n+k}(p)$, where $p$ is the canonical proof that $n\leq n+k$.
\end{defn}

\begin{defn}
A \define{sequence $\sequence{B}{g}$ of types over $\sequence{A}{f}$} consists of a diagram of the form
\begin{equation*}
\begin{tikzcd}
B_{0} \arrow[r,"g_0"] \arrow[d,->>] & B_{1} \arrow[r,"g_1"] \arrow[d,->>] & B_{2} \arrow[r,"g_2"] \arrow[d,->>] & \cdots \\
A_0 \arrow[r,"f_0"] & A_1 \arrow[r,"f_1"] & A_2 \arrow[r,"f_2"] & \cdots
\end{tikzcd}
\end{equation*}
where each $g_n$ has type $\prd{a:A_n} B_n(x)\to B_{n+1}(f_n(a))$, implicitly rendering the
squares commutative.

We say that a sequence $\sequence{B}{g}$ over $\sequence{A}{f}$ is \define{equifibered} if each $g_n$ is a family of equivalences.
\end{defn}

\begin{comment}
\begin{defn}
A \define{global section} $\sequence{t}{T}$ of a sequence $\sequence{P}{f}$ over
$\sequence{A}{a}$ consists of
\begin{align*}
t & : \prd{n:\nat}{x:A_n}P_n(x) \\
T & : \prd{n:\nat}{x:A_n}\id{t_{n+1}(a_n(x))}{f_n(t_n(x))}
\end{align*}
\end{defn}

For the following definition, recall that for any two types $X$ and $Y$, we
may consider the constant type family $\ctxwk{X}{Y}\defeq\lam{x}Y:X\to\type$.
This process is called weakening.

\begin{defn}
Let $\sequence{A}{a}$ and $\sequence{B}{b}$ be sequences of types. Then we
define the \define{weakened sequence} $\ctxwk{\sequence{A}{a}}{\sequence{B}{b}}$ over
$\sequence{A}{a}$ to consist of
\begin{equation*}
\begin{tikzcd}[column sep=large]
\ctxwk{A_0}{B_0} \arrow[r,"\lam{x} b_0"] \arrow[d,->>] & \ctxwk{A_1}{B_1} \arrow[r,"\lam{x}b_1"] \arrow[d,->>] & \ctxwk{A_2}{B_2} \arrow[r,"\lam{x}b_2"] \arrow[d,->>] & \cdots \\
A_0 \arrow[r,"a_0"] & A_1 \arrow[r,"a_1"] & A_2 \arrow[r,"a_2"] & \cdots
\end{tikzcd}
\end{equation*}
\end{defn}
\end{comment}

\begin{defn}
Let $\sequence{A}{f}$ and $\sequence{A'}{f'}$ be type sequences.
A \define{natural transformation} $\sequence{A}{f}\to\sequence{A'}{f'}$
is a pair $\sequence{\tau}{H}$ consisting of a family of maps
\begin{equation*}
\tau : \prd{n:\N} A_n \to A'_n
\end{equation*}
and a family $H_n$ of homotopies witnessing that the diagram
\begin{equation*}
\begin{tikzcd}
A_{0} \arrow[r,"f_0"] \arrow[d,"\tau_0"] & A_{1} \arrow[r,"f_1"] \arrow[d,"\tau_1"] & A_{2} \arrow[r,"f_2"] \arrow[d,"\tau_2"] & \cdots \\
A'_0 \arrow[r,"{f'_0}"] & A'_1 \arrow[r,"{f'_1}"] & A'_2 \arrow[r,"{f'_2}"] & \cdots
\end{tikzcd}
\end{equation*}
commutes.
\end{defn}

\begin{defn}
A \define{natural equivalence} is a natural
transformation $(\tau,H)$ such that each $\tau_n$ is an equivalence.
The type of natural equivalences from $\sequence{A}{f}$ to $\sequence{A'}{f'}$
is called $\mathsf{NatEq}(\sequence{A}{f},\sequence{A'}{f'})$.
\end{defn}

\begin{lem}
The canonical dependent function $\mathsf{idtonateq}$
\begin{equation*}
%\prd{\sequence{A}{f},\sequence{A'}{f'}:\mathrm{Seq}}
(\id{\sequence{A}{f}}{\sequence{A'}{f'}})\to \mathsf{NatEq}(\sequence{A}{f},\sequence{A'}{f'})
\end{equation*}
which sends $\refl{\sequence{A}{f}}$ to the identity natural transformation, is
an equivalence.
\end{lem}

\begin{proof}
Straightforward application of univalence.
\end{proof}

Every type sequence $\sequence{B}{g}$ over $\sequence{A}{f}$ gives rise to a natural transformation, by the following definition.

\begin{defn}
Let $\sequence{B}{g}$ be a sequence over $\sequence{A}{f}$. Then we define the
sequence $\msm{\sequence{A}{f}}{\sequence{B}{g}}$ to consist of the diagram
\begin{equation*}
\begin{tikzcd}[column sep=large]
\sm{a:A_0}B_0(a) \arrow[r,"\pairr{f_0,g_0}"] & \sm{a:A_1}B_1(a) \arrow[r,"\pairr{f_1,g_1}"]
& \sm{a:A_2}B_2(a) \arrow[r,"\pairr{f_2,g_2}"] & \cdots
\end{tikzcd}
\end{equation*}
where we take the usual definition
\begin{equation*}
\pairr{f_n,g_n} \defeq \lam{\pairr{a,b}}\pairr{f_n(a),g_n(a,b)}.
\end{equation*}
Furthermore, we define a natural transformation
\begin{equation*}
\sequence{\pi}{\theta}:\msm{\sequence{A}{f}}{\sequence{B}{g}}\to \sequence{A}{f}
\end{equation*}
by taking
\begin{align*}
\pi_n & \defeq \proj1 & & : (\sm{a:A_n}B_n(a))\to A_n \\
\theta_n(a,b) & \defeq\refl{f_n(a)} & & : f_n(\proj 1(a,b))= \proj 1(f_n(a),g_n(b)).
\end{align*}
\end{defn}

\begin{defn}
A natural transformation is said to be \define{cartesian} if all the naturality squares are pullback squares.
\end{defn}

Of course, every natural equivalence is also cartesian. Recall that for any $f:A\to A'$ and any $g:\prd{a:A}B(a)\to B'(f(a))$, the square
\begin{equation*}
\begin{tikzcd}
\sm{a:A}B(a) \arrow[r,"\pairr{f,g}"] \arrow[d,->>] & \sm{a':A'}B'(a') \arrow[d,->>] \\
A \arrow[r,swap,"f"] & A'
\end{tikzcd}
\end{equation*}
is a pullback square if and only if $g$ is a family of equivalences. Thus, we have the following:

\begin{lem}
A family $\sequence{B}{g}$ of sequences over $\sequence{A}{f}$ is equifibered if and only if the projection transformation $(\pi,\theta):\msm{(A,f)}{(B,g)}\to (A,f)$ is cartesian. \qed
\end{lem}

We end this section with reviewing the shift operation on type sequences, in particular to bring up subtleties that come up in the formalization of mathematics in homotopy type theory. The issue we face is that equality in the natural numbers isn't always strict. For instance, when addition is defined by induction on the second argument, then $n+0$ is judgmentally equal to $n$, while $0+n$ is not. This implies that sometimes we might have to \emph{transport} along the equalities in the natural numbers (such as $n=0+n$), and this complicates the formalization process.

We define the shift operation.
\begin{defn}
For any type sequence $\sequence{A}{f}$ we define the type sequence $(S(A),S(f))$ by taking
\begin{align*}
S(A)_n & \defeq A_{n+1} \\
S(f)_n & \defeq f_{n+1}.
\end{align*}
\end{defn}

Of course we can iterated the shift operation, defining a type sequence $(S^k(A),S^k(f))$ for every $k:\N$. However, while the type $S^k(A)_n$ is $A_{n+k}$, the function $S^k(f)_n$ is some function $A_{n+k}\to A_{(n+1)+k}$ that isn't judgmentally equal to a function of the form $f_m$ for some $m:\N$. Therefore, we make the following alternative definition of the $k$-shift.

\begin{defn}
Given a type sequence $(A,f)$, we define $S_k(A,f)\jdeq(S_k(A),S_k(f))$ to be the type sequence given by
\begin{align*}
S_k(A)_n & \defeq A_{k+n} \\
S_k(f)_n & \defeq f_{k+n}.
\end{align*}
Given a dependent sequence $(B,g)$ over $(A,f)$, we also define $S_k(B,g)\jdeq (S_k(B),S_k(g))$ by
\begin{align*}
S_k(B)_n & \defeq B_{k+n} \\
S_k(g)_n & \defeq g_{k+n}.
\end{align*}
\end{defn}

The sequence $(S_{k+1}(A),S_{k+1}(f))$ is not judgmentally equal to the sequence $S(S_k(A),S_k(f))$, since in general we do not have $(k+1)+n\jdeq (k+n)+1$. Therefore we have the following lemma.

\begin{lem}\label{lem:iterate_succ}
For any $k,n:\nat$ and $a : A_k$, one has $q_{k,n}(a):\dpath{A}{p(k,n)}{f_k^{n+1}(a)}{f_{k+1}^n(f_k(a))}$ where $p(k,n):(k+n)+1=(k+1)+n$ is the canonical path in $\nat$.
\end{lem}

\begin{proof}
By induction on $n:\N$.
\end{proof}

\begin{cor}
For any type sequence $\sequence{A}{f}$, the type sequence $(S_{k+1}(A),S_{k+1}(f))$ is naturally equivalent to the type sequence $(S(S_k(A)),S(S_k(f)))$.
\end{cor}

\begin{comment}
\begin{defn}
A \define{dependent natural transformation} $\tau:\sequence{P}{f}\to\sequence{Q}{g}$ of
dependent sequences over $\sequence{A}{a}$ consists of functions
$\tau_n(x):P_n(x)\to Q_n(x)$ for each $x:A_n$, together with a term witnessing
that any square of the form
\begin{equation*}
\begin{tikzcd}
P_n(x) \arrow[r,"f_n(x)"] \arrow[d,swap,"\tau_n(x)"] & P_{n+1}(a(x)) \arrow[d,"\tau_{n+1}(a(x))"] \\
Q_n(x) \arrow[r,"g_n(x)"] & Q_{n+1}(a(x))
\end{tikzcd}
\end{equation*}
commutes. A \define{dependent natural equivalence} is a dependent natural transformation
$\tau$ for which $\tau_n(x)$ is an equivalence for each $n:\nat$ and $x:A_n$.
\end{defn}

\begin{lem}
For any two dependent sequences $\sequence{P}{f}$ and $\sequence{Q}{g}$ over
$\sequence{A}{a}$, the function
\begin{equation*}
(\id{\sequence{P}{f}}{\sequence{Q}{g}})\to\mathsf{NatEq}_{\sequence{A}{a}}(\sequence{P}{f},\sequence{Q}{g})
\end{equation*}
is an equivalence.
\end{lem}
\end{comment}

\section{Sequential colimits}

\begin{defn}
Consider the sequence $\sequence{A}{f}$ of types
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r,"f_0"] & A_1 \arrow[r,"f_1"] & A_2 \arrow[r,"f_2"] & \cdots
\end{tikzcd}
\end{equation*}
We define the colimit $A_\infty$ to be the higher inductive type with constructors
\begin{align*}
\iota^{A,f} & : \prd{n:\mathbb{N}} A_n\to A_\infty \\
\kappa^{A,f} & : \prd{n:\mathbb{N}}{x:A_n} \id{\iota_{n+1}(f(x))}{\iota_n(x)}.
\end{align*}
\end{defn}

\begin{rmk}
The induction principle for sequential colimits tells us how to construct a dependent function $f:\prd{a:A_\infty}P(a)$ for a type family $P:A_\infty\to\type$.

Given $s:\prd{a:A_\infty}P(a)$ we get
\begin{align*}
\lam{n}{a} s(\iota_n(a)) & : \prd{n:\N}{a:A_n}P(\iota_n(a)) \\
\lam{n}{a} \apd{s}{\kappa_n(a)} & : \prd{n:\N}{a:A_n} s(\iota_n(a)) =_{\kappa_n(a)}^P s(\iota_{n+1}(f_n(a)))
\end{align*}
In other words, we have a canonical map
\begin{equation*}
\Big(\prd{a:A_\infty}P(a)\Big)\to\Big(\sm{h:\prd{n:\N}{a:A_n}P(\iota_n(a))}\prd{n:\N}{a:A_n} h_n(a) =_{\kappa_n(a)}^P h_{n+1}(f_n(a))\Big)
\end{equation*}
Now we can state the induction principle and computation rule concisely: the canonical map described above comes equipped with a section. We assume that the computation rule is strict on the point constructors.
\end{rmk}

The universal property of sequential colimits is a straightforward consequence of the induction principle.

\begin{thm}
Let $\sequence{A}{f}$ be a type sequence, and let $X$ be a type. Then the canonical map
\begin{equation*}
(A_\infty\to X)\to \sm{h:\prd{n:\N}A_n\to X}\prd{n:\N} h_n\htpy h_{n+1}\circ f_n
\end{equation*}
is an equivalence.
\end{thm}

The following theorem is a descent theorem for sequential colimits.

\begin{thm}\label{thm:sequential_descent}
Consider a sequence $\sequence{A}{f}$. The type $A_\infty\to\UU$ is equivalent to the type of equifibered type sequences over $\sequence{A}{f}$.
\end{thm}

\begin{proof}
By the universal property of $A_\infty$ and by univalence we have
\begin{align*}
(A_\infty\to \UU) & \eqvsym \sm{B:\prd{n:\N}A_n\to \UU}\prd{n:\N} B_n\htpy B_{n+1}\circ f_n \\
& \eqvsym \sm{B:\prd{n:\N}A_n\to \UU}\prd{n:\N}{x:A_n} B_n(x)\eqvsym B_{n+1}(f_n(x))\qedhere
\end{align*}
\end{proof}

\begin{lem}\label{lem:seq_colim_functor}
  Given a natural transformation $(\tau,H):\sequence{A}{f}\to\sequence{A'}{f'}$.
  \begin{enumerate}
    \item\label{part:seq_colim_functor} We get a function $\tfcolim(\tau,H)$ or $\tau_\infty:A_\infty\to A'_\infty$.
    \item\label{part:1_functoriality} The sequential colimit is 1-functorial. This means the following three things. If $(\sigma,K):\sequence{A'}{f'}\to\sequence{A''}{f''}$ then $(\tau\circ\sigma)_\infty\sim\tau_\infty\circ\sigma_\infty$. Moreover, $1_\infty\sim \idfunc$, where $1$ is the identity natural transformation. Lastly, if $(\tau',H'):\sequence{A}{f}\to\sequence{A'}{f'}$ and $q:\prd{n:\N}\tau_n\sim\tau'_n$ and we can fill the following square for all $a:A_n$
    \begin{center}\begin{tikzcd}[column sep=25mm]
      \tau_{n+1}(f_na)
      \ar[r,equal,"{q_{n+1}(f_na)}"]
      \ar[d,equal,"{H_n(a)}"] &
      \tau'_{n+1}(f_na)
      \ar[d,equal,"{H'_n(a)}"]\\
      f'_n(\tau_n(a))
      \ar[r,equal,"{\apfunc{f'_n}(q_n(a))}"] &
      f'_n(\tau'_n(a))
    \end{tikzcd}\end{center}
    then $\tau_\infty\sim\tau'_\infty$.
    \item\label{part:functor_equivalence} If $\tau$ is a natural equivalence then $\tau_\infty$ is an equivalence.
  \end{enumerate}
\end{lem}
\begin{proof}\mbox{}
  \begin{enumerate}
    \item
    We define $\tau_\infty(\iota_n(a))\defeq\iota_n(\tau_n(a))$ and
    $$\apfunc{\tau_\infty}(\kappa_n(a))\vcentcolon=\apfunc{\iota_{n+1}}(H(a))\cdot\kappa_n(\tau_n(a)):
    \iota_{n+1}(\tau_{n+1}(f_na))=\iota_n(\tau_n(a)).$$
    \item All three parts are by induction on the element of $A_\infty$, and all parts are straightforward.
    % to do? We might want to give an explicit proof
    \item We define $(\tau_\infty)^{-1}\defeq(\tau^{-1})_\infty$ where $\tau^{-1}$ is the natural transformation by inverting $\tau_n$ for each $n$. Now we can check that this is really the inverse by using all three parts of the 1-functoriality.
    $$\tau_\infty^{-1}\circ\tau_\infty\sim (\tau^{-1}\circ\tau)_\infty\sim 1_\infty\sim\idfunc[A_\infty].$$
    For the second homotopy we need to show that we can fill a certain square, which is straightforward.
    The other composite is homotopic to the identity by a similar argument.\qedhere
  \end{enumerate}
\end{proof}

\begin{lem}\label{lem:colim_shift}
For any type sequence $(A,f)$, the colimits of $(A,f)$ and $S(A,f)$ are equivalent.
\end{lem}

\begin{proof}
We construct a map $\varphi:A_\infty \to S(A)_\infty$ by induction on $A_\infty$, by taking
\begin{align*}
(x:A_n) & \mapsto \iota^{S(A),S(f)}_n(f_n(x)) \\
(x:A_n) & \mapsto \kappa^{S(A),S(f)}_n(f_n(x)).
\end{align*}

Next, we construct a map $\psi:S(A)_\infty\to A_\infty$ by induction on $S(A)_\infty$, by taking
\begin{align*}
(x:S(A)_n) & \mapsto \iota^{A,f}_{n+1}(x) \\
(x:S(A)_n) & \mapsto \kappa^{A,f}_{n+1}(x).
\end{align*}

Then we prove that $\psi\circ \varphi\htpy \idfunc$ by induction on $A_\infty$, by taking
\begin{align*}
(x:A_n) & \mapsto \kappa^{A,f}_n(x)
\end{align*}
Now we compute
\begin{align*}
\mathsf{ap}_{\psi\circ\varphi}(\kappa^{A,f}_n(x))) & = \mathsf{ap}_\psi(\mathsf{ap}_\varphi(\kappa^{A,f}_n(x))) \\
& = \mathsf{ap}_\psi(\kappa^{S(A),S(f)}_n(f_n(x))) \\
& = \kappa^{A,f}_{n+1}(f_n(x))
\end{align*}
from the computation rules of $A_\infty$ and $S(A)_\infty$.

We construct the homotopy $\varphi\circ\psi\htpy\idfunc$ by induction on $A_\infty$, by taking
\begin{align*}
(x:S(A)_n) & \mapsto \kappa_{n+1}(S(f)_n(x))
\end{align*}
Now we compute
\begin{align*}
\mathsf{ap}_{\varphi\circ\psi}(\kappa^{S(A),S(f)}_n(x)) & = \mathsf{ap}_\varphi(\mathsf{ap}_\psi(\kappa^{S(A),S(f)}_n(x))) \\
& = \mathsf{ap}_\varphi(\kappa^{A,f}_{n+1}(x)) \\
& = \kappa^{S(A),S(f)}_{n+1}(f_{n+1}(x)).\qedhere
\end{align*}
\end{proof}

\begin{lem}\label{lem:colim_shift_k}
For any type sequence $(A,f)$, we have an equivalence
\begin{equation*}
\kshiftequiv_{k} : \tfcolim(A,f)\eqvsym\tfcolim (S_k(A,f)).
\end{equation*}
\end{lem}

The shift operations and the corresponding equivalences on the sequential colimits can be used to turn an arbitrary sequence $\sequence{B}{g}$ over $\sequence{A}{f}$ into an equifibered sequence over $\sequence{A}{f}$.

\begin{defn}
Given a dependent sequence $(B,g)$ over $(A,f)$ and $x:A_0$, we define a type sequence $(B[x],g[x])$ by
\begin{align*}
B[x]_n & \defeq B_n(f^n(x)) \\
g[x]_n & \defeq g_n(f^n(x),\blank).
\end{align*}
\end{defn}

\begin{defn}
Given any sequence $\sequence{B}{g}$ over $\sequence{A}{f}$, we define an equifibered sequence
$\sequence{\square B}{\square g}$ over the sequence $\sequence{A}{f}$.
\end{defn}

\begin{constr}
For $x:A_n$ we define
\begin{equation*}
(\square B)_n(x) \defeq S_n(B)[x]_{\infty} \jdeq \tfcolim_m(B_{n+m}(f^m(x))).
\end{equation*}
Now note that
\begin{align*}
  (\square B)_{n+1}(f(x)) & \jdeq \tfcolim_m(B_{(n+1)+m}(f^m(f(x))) \\
  & \simeq \tfcolim_m(B_{n+(m+1)}(f^{m+1}(x))\\
  & \simeq \tfcolim_m(B_{n+m}(f^m(x))\\
  & \jdeq (\square B)_n(x)
\end{align*}
The first equivalence $u_{n,m}$ is given by transporting along the dependent path in \autoref{lem:iterate_succ} in the family $B$. This forms a natural equivalence, because $\mathsf{transport}$ is natural. The second equivalence is given by applying \autoref{lem:colim_shift}. We call the composite equivalence $F$, which shows that $\square B$ is an equifibered sequence.
\end{constr}

\begin{defn}
Let $\sequence{B}{g}$ be a sequence over $\sequence{A}{f}$. Then we define
\begin{equation*}
B_\infty : A_\infty\to\UU
\end{equation*}
to be the family over $A_\infty$ associated to the equifibered sequence $(\square B,\square g)$ via the equivalence of \autoref{thm:sequential_descent}.
\end{defn}

By construction of $B_\infty$ we get the equality
$$r(y):\transfib{B_\infty}{\kappa_n(x)}{y}=F(y)$$
for $y:B_\infty(\iota_{n+1}(f_n(x)))$ witnessing that $B_\infty$ is defined by the equivalence $F$ on the path constructor.

\section{Find a place for this}

State for $n$-connected maps.
\begin{lem}
Consider a type sequence
\begin{equation*}
\begin{tikzcd}
A_0 \arrow[r,"f_0"] & A_1 \arrow[r,"f_1"] & A_2 \arrow[r,"f_2"] & \cdots
\end{tikzcd}
\end{equation*}
in which each $f_n:A_n\to A_{n+1}$ is surjective. Then the map $\mathsf{in}_0:A_0\to A_\infty$ is surjective.
\end{lem}

\begin{proof}
We have to prove that
\begin{equation*}
\prd{x:A_\infty} \brck{\fib{\mathsf{in}_0}{x}}.
\end{equation*}
We do this by the universal property of $A_\infty$. Since $\brck{\fib{\mathsf{in}_0}{x}}$ is a mere proposition, there is nothing to show for the path constructors. Thus, it remains to show that
\begin{equation*}
\prd{n:\N}{x:A_n} \brck{\fib{\mathsf{in}_0}{\mathsf{in}_n(x)}}
\end{equation*}
The base case is trivial. For the inductive step, observe that since $f_n$ is assumed to be surjective, we have
\begin{equation*}
\Big(\prd{x:A_{n}} \brck{\fib{\mathsf{in}_0}{\mathsf{in}_{n+1}(f_n(x))}}\Big)\to\Big(\prd{x:A_{n+1}} \brck{\fib{\mathsf{in}_0}{\mathsf{in}_{n+1}(x)}}\Big)
\end{equation*}
Now note that $\mathsf{in}_{n}(x)=\mathsf{in}_{n+1}(f_n(x))$ to complete the proof.
\end{proof}


\documentclass{article}
\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\allowdisplaybreaks

\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}

\begin{document}
\title{Notes}
\date{January 31, 2014}
\maketitle
\section*{4.5}
\subsection*{what is a partially ordered set (poset)?}

a poset is a special kind of relation.
\subsubsection*{def}
A relation $R$ on a set $X$ is a subset of $X\cross X$. We say $xRy$ if $(x,y)\in R$"x is related to y"
\subsubsection*{properties}
reflexive: $xRx$

symmetric: $xRy\to yRx$

antisymetric: $xRy\to y\slash{R}x, x\neq y$

transitive: $xRy\to yRz\to xRz$

equivalence relations: reflexive, symmetric, transitive.

a poset is a relation that is reflexive, antisymmetric, transitive.

a poset is a set with a partial order "$\leq$" that is reflexive, antisymmetric and transitive.

explain it like i'm 7: rule is graph has to have arrows going in the same way, no cycles.

\subsubsection*{example}
set is positive integers. partial order is divisibility.
$a\leq b$ if $a\|b$

$2\leq 6$ but $5\slash\leq 6$. 5 and 6 are incomparable. prove it is a poset

$l,m,n\in \mathbb{N}$ then $n\|n$, so reflexive. suppose $m\|n$ and $m\neq n$ then $\backE a\in\mathbb{N}$ such that $am=n$ so $m<n$. so $n\slash \| m$. if $l\|m$ and $m\|n$ then blah blah $l\|n$
\subsubsection*{example}
subsets of $\{a,b,c\}$ with partial order of set containment

definition: in a poset we say y covers x if $x<y$ and if $x\leq z\leq y$ then $x=z$ or $z=y$.

definition: the hassediagram of a poset is the (directed) graph of the covers

\subsection*{weak bruhat order}
set is permutations of $[n]$. sometimes easier to find covers and extrapolate order.

covers: y covers x in weak bruhat order if $s_i(x)=y$ and the number of inversions of $y$ is one greater than the number of inversions of x.

can hink of permutations of $[n]$ as words in the alphabet $s_1,s_1,\dots,s_{n-1}$. subject to conditions that $s_i^2=1,s_is_j=s_js_i \|i-j\|>1, s_is_{i+1}s_i=s_{i+1}s_is_{i+1}$

this is defining a group, specifically "a presentation of the symmetric group"

to find weak bruhat set for n=4 google. looks like a soccerball or buckyball, "weak order ?"
\end{document}


\hypertarget{classnumpp_1_1differentiation_1_1symbolic_1_1constant}{}\section{numpp\+:\+:differentiation\+:\+:symbolic\+:\+:constant$<$ Value $>$ Class Template Reference}
\label{classnumpp_1_1differentiation_1_1symbolic_1_1constant}\index{numpp\+::differentiation\+::symbolic\+::constant$<$ Value $>$@{numpp\+::differentiation\+::symbolic\+::constant$<$ Value $>$}}

Class representing constant integer number.

{\ttfamily \#include $<$types.\+hpp$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a7982f91c5d93097b33fe2afb414f0c61}\label{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a7982f91c5d93097b33fe2afb414f0c61}}
using {\bfseries active} = std\+::false\+\_\+type
\item
\mbox{\Hypertarget{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a628b3d3d33b013504778e13737b6e591}\label{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a628b3d3d33b013504778e13737b6e591}}
{\footnotesize template$<$std\+::size\+\_\+t Active$>$ }\\using {\bfseries derivative} = \hyperlink{classnumpp_1_1differentiation_1_1symbolic_1_1constant}{constant}$<$ 0 $>$
\item
\mbox{\Hypertarget{classnumpp_1_1differentiation_1_1symbolic_1_1constant_ad66f7cc2920b701bb875a9e88ff41015}\label{classnumpp_1_1differentiation_1_1symbolic_1_1constant_ad66f7cc2920b701bb875a9e88ff41015}}
using {\bfseries type} = int
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item
static constexpr int \hyperlink{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a8107c312e0715c40161432bf072fcfa9}{calculate} (auto \&\&)
\begin{DoxyCompactList}\small\item\em Returns Value no matter the argument. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Detailed Description}
\subsubsection*{template$<$int Value$>$\newline
class numpp\+::differentiation\+::symbolic\+::constant$<$ Value $>$}

Class representing constant integer number.

\begin{DoxyTemplParams}{Template Parameters}
{\em Value} & integer value contained in constant object\\
\hline
\end{DoxyTemplParams}

\begin{DoxyCode}
\textcolor{preprocessor}{#include"numpp/differentiation/symbolic.hpp"}
\end{DoxyCode}

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a8107c312e0715c40161432bf072fcfa9}\label{classnumpp_1_1differentiation_1_1symbolic_1_1constant_a8107c312e0715c40161432bf072fcfa9}}
\index{numpp\+::differentiation\+::symbolic\+::constant@{numpp\+::differentiation\+::symbolic\+::constant}!calculate@{calculate}}
\index{calculate@{calculate}!numpp\+::differentiation\+::symbolic\+::constant@{numpp\+::differentiation\+::symbolic\+::constant}}
\subsubsection{\texorpdfstring{calculate()}{calculate()}}
{\footnotesize\ttfamily template$<$int Value$>$ \\
static constexpr int \hyperlink{classnumpp_1_1differentiation_1_1symbolic_1_1constant}{numpp\+::differentiation\+::symbolic\+::constant}$<$ Value $>$\+::calculate (\begin{DoxyParamCaption}\item[{auto \&\&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

Returns Value no matter the argument.

\begin{DoxyReturn}{Returns}
int
\end{DoxyReturn}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
differentiation/symbolic/types.\+hpp\end{DoxyCompactItemize}