\documentclass[main.tex]{subfiles}
\begin{document}

\marginpar{Monday\\ 2020-12-21, \\ compiled \\ \today}

Let us continue with gauge-invariant cosmological perturbations.
Let us now give a gauge-invariant definition for the matter velocity:
%
\begin{align} \label{eq:matter-velocity-gauge-invariant}
2 v _{s} = 2 v^{\parallel} + \chi^{\parallel, \prime}
\,,
\end{align}
%
where, as usual, by ``matter'' we mean anything which goes on the right-hand side of the Einstein equations, and \(s\) means ``scalar''.

This velocity is related to the amplitude of the \textbf{shear tensor} for the matter velocity: specifically, from the shear tensor \(\sigma_{\mu \nu }\) we can define the quantity \(\qty(\sigma^{ij} \sigma_{ij} /2 )^{1/2}\).

For the scalar part, we have (following the notation by Bardeen)
%
\begin{align}
\epsilon_m &= \delta \rho + \rho_0' \qty(v^{\parallel} + \omega^{\parallel} )  \\
\rho_0 &= \rho_0 (\eta )
\,.
\end{align}

Note that energy density perturbations themselves are not gauge invariant.
The quantity \(\epsilon _m\) corresponds to \(\delta \rho \) in the gauge where \(v^{\parallel} + \omega^{\parallel} = 0\), which means that we are selecting constant-\(\eta \) hypersurfaces which are orthogonal to the worldlines of the fluid: the fluid's rest frame.

The quantity \(v^{\parallel} + \omega^{\parallel}\) enters into the expression for \(T^{0}_{i}\), which describes the momentum flux of the fluid.
We also define
%
\begin{align}
2 E_g = 2 \delta \rho + \rho_0' \qty(2 \omega^{\parallel} - \chi^{\parallel, \prime})
\,,
\end{align}
%
which is also equal to \(\delta \rho \) in the gauge in which \(2 \omega^{\parallel} - \chi^{\parallel, \prime} = 0\), which is the zero-shear or Poisson gauge.

We can also construct one vector perturbation, since we start with two and remove one with the gauge degree of freedom described as \(d^{i}\):
%
\begin{align}
\Psi_i = \omega^{\perp}_i - \chi_i^{\perp, \prime}
\,.
\end{align}

This is related to the amplitude of the vector geometric component of the geometric shear \(\sigma_{\mu \nu }\).
This term describes frame-dragging effects.

The matter velocity can be described as
%
\begin{align}
V^{i}_{s} = v^{i}_{\perp} + \chi^{i, \prime}_{\perp}
\marginnote{Compare to \eqref{eq:matter-velocity-gauge-invariant}.}
\,.
\end{align}

Also, we can define
%
\begin{align}
V^{i}_{c} = v^{i}_{\perp} + \omega^{i}_{\perp}
\,.
\end{align}

This is related to the amplitude of the vorticity\footnote{Local angular velocity of fluid elements} tensor \(\omega_{\mu \nu }\) (and, specifically, the quantity \(\qty(\omega^{ij} \omega_{ij} / 2)^{1/2}\)).

As for tensor perturbation modes, linear tensor perturbations are automatically gauge-invariant (at linear order, at least):
%
\begin{align}
\chi^{T, \prime}_{ij} =
\chi^{T}_{ij}
\,.
\end{align}

\section{Perturbed Einstein Equations}

Let us write the equations of motion for these linear cosmological perturbations.
We start from the Einstein equations \(G_{\mu \nu } = 8 \pi G T_{\mu \nu }\), and the Bianchi identities \(T^{\mu \nu }_{; \nu } = 0\).
The Einstein tensor is defined as
%
\begin{align}
G_{\mu \nu } &= R_{\mu \nu } - \frac{1}{2} g_{\mu \nu } R  \\
R_{\mu \nu } &= R^{\alpha }_{\mu \alpha \nu }  \\
R^{\alpha }_{\mu \nu \beta }&\sim \pdv{\Gamma }{x} + \Gamma^2  \\
\Gamma^{\mu }_{\nu \rho } &\sim g^{-1} \pdv{g}{x}
\,.
\end{align}

We can compute the nonvanishing Christoffel symbols in the unperturbed case (see, for example, the notes for Theoretical Cosmology), and then the perturbations of these; note that the inverse of a perturbed metric can be computed by inverting the perturbation according to the flat metric only (see \cite[eq.\ 8.20]{tissinoGeneralRelativityExercises2020}):
%
\begin{align}
\delta \Gamma^{0}_{00} &= \psi '  \\
\delta \Gamma^{0}_{0i} &= \partial_{i} \psi + \frac{a'}{a} \partial_{i} \omega^{\parallel}  \\
\delta \Gamma^{i}_{00} &= \frac{a'}{a} \partial^{i} \omega^{\parallel} + \partial^{i} \omega^{\parallel, \prime} + \partial^{i} \psi  \\
\delta \Gamma^{0}_{ij} &= -2 \frac{a'}{a} \psi \delta_{ij} - \partial_{i} \partial_{j} \omega^{\parallel} - 2 \frac{a'}{a} \phi \delta_{ij}
- \phi ' \delta_{ij} + \frac{a'}{a} D_{ij} \chi^{\parallel} + \frac{1}{2} D_{ij} \chi^{\parallel, \prime}  \\
\delta \Gamma^{i}_{0j} &= - \phi \delta^{i}_{j} + \frac{1}{2} D^{i}_{j} \chi^{\parallel, \prime}  \\
\delta \Gamma^{i}_{jk} &= \dots
\,.
\end{align}

The spatial components of the metric can be written as
%
\begin{align}
g_{ij} = \underbrace{a^2(\eta ) \qty[1 - 2 \phi ] \delta_{ij}}_{a^2(\eta , \vec{x})} + \dots
\,,
\end{align}
%
where we can express
%
\begin{align}
a(\eta , \vec{x}) = a(\eta ) \qty(1 - \phi (\eta , \vec{x}))
\,,
\end{align}
%
therefore \(\delta a = - a \phi \), which means that
%
\begin{align}
\delta \qty( \frac{a^{\prime}}{a}) = - \phi '
\,.
\end{align}

The unperturbed Ricci tensor reads
%
\begin{align}
R_{00} &= - 3 \frac{a''}{a} + 3 \qty( \frac{a'}{a})^2  \\
R_{ij} &=  \qty[\frac{a''}{a} + \qty(\frac{a'}{a})^2] \delta_{ij}
\,.
\end{align}

Its perturbation is
%
\begin{align}
\delta R_{00} &= \frac{a'}{a} \nabla^2 \omega^{\parallel} + \nabla^2 \omega^{\parallel, \prime} + 3 \phi^{\parallel} + 3 \frac{a'}{a} \phi' + 3 \frac{a'}{a} \psi '  \\
\delta R_{0i} &= \frac{a'}{a} \partial_{i} \omega^{\parallel} + \qty(\frac{a'}{a})^2 \partial_{i} \omega^{\parallel} +2 \partial_{i} \phi' + 2 \frac{a'}{a} \partial_{i} \psi + \frac{1}{2} \partial_{k} D^{k}_i \qty(\chi_{\parallel})'  \\
\delta R_{ij} &= \dots
\,.
\end{align}

\todo[inline]{Copy full expressions from the notes.}

The Ricci scalar \(R\) is given by \(R = (6/a^2) (a' / a)\) in flat FRLW, while its perturbation is
%
\begin{align}
\delta R &= \frac{1}{a^2} \qty(- 6 \frac{a'}{a} \nabla^2\omega^{\parallel} - 2 \nabla^2 \omega^{\parallel, \prime} - 2 \nabla^2 \psi - 6 \phi^{\parallel} - 6 \frac{a'}{a} \psi' - 18 \frac{a'}{a} \phi ' - 12 \frac{a''}{a} \psi + 4 \nabla^2 \phi + \partial_{k} \partial^{i} D^{k}_{i} \chi^{\parallel})
\,.
\end{align}

This expression is fully general, in a specific gauge it can be significantly simplified.
The stress-energy tensor we will use is given by
%
\begin{align}
T_{\mu \nu } = \rho u_\mu u_\nu + p h_{\mu \nu } + \Pi_{\mu \nu }
\,,
\end{align}
%
where \(\Pi^{\mu }_{\mu } = \Pi_{\mu \nu } u^{\nu } = 0\). This allows us to account for imperfections in the fluid. The only nonvanishing components of \(\Pi \) are the spatial ones \(\Pi_{ij}\).
This is true in any frame.

We can write it as
%
\begin{align}
\Pi_{ij} = D_{ij} \Pi^{\parallel} + 2\Pi^{\perp}_{(i, j)} + \Pi^{T}_{ij}
\,,
\end{align}
%
where, as usual, \(D_{ij} = \partial_{i} \partial_{j} - (1/3) \delta_{ij} \nabla^2\).
The component
%
\begin{align}
- T^{0}_{0} &= \rho_{0} (\eta ) + \delta \rho (\eta , \vec{x})  \\
&= \rho_0 (\eta ) \qty(1 + \delta )
\,,
\end{align}
%
while
%
\begin{align}
p = p_0 (\eta ) \qty(1 + \Pi _L)
\,,
\end{align}
%
where \(\Pi _L = \delta p / p_0 (\eta )\). The \(L\) stands for ``longitudinal''.

The unperturbed spatial components of the stress-energy tensor read:
%
\begin{align}
T^{i}_{j} &= p_0 (\eta ) \qty[ \qty(1 + \Pi _L) \delta^{i}_{j} + \Pi_{T, j}^{i}]  \\
\Pi_{T, j}^{i} &= \eval{\frac{\Pi^{i}_{j}}{p_0 (\eta )}}_{\text{traceless}}
\,.
\end{align}

The perturbation reads
%
\begin{align}
\delta T^{0}_{i} = \qty(\rho_0 + p_0 ) \qty(v_i + \omega _i )
&
\text{or}
&
\delta T^{i}_{0} = - (\rho_0 + p_0 ) v^{i}
\,.
\end{align}

This is quite general: it is the density of the \(i\)-component of the fluid's momentum, or the flux of energy in the \(i\)-th direction.

The linearly perturbed \(00\) EFE for scalar perturbation (as they are decoupled from the vector and tensor ones) reads
%
\begin{align}
\frac{3 a'}{a} \qty(\hat{\phi}' + \frac{a'}{a} \psi ) - \nabla^2 \qty(\hat{\phi} + \frac{a'}{a} \sigma ) = - 4 \pi G a^2 \delta \rho
\,,
\end{align}
%
where \(\hat{\phi} = \phi + (1/6) \nabla^2 \chi^{\parallel}\) and \(\sigma = - \omega^{\parallel} + (1/2) \chi^{\parallel, \prime}\).

The \(0i\) equation is
%
\begin{align}
\hat{\phi}' + \frac{a'}{a} \psi = - 4 \pi G a^2 \qty(\rho_0 + p_0 )V
\,,
\end{align}
%
where \(V = v^{\parallel} + \omega^{\parallel}\).
These two are not really ``evolution'' equations, they should be interpreted as constraints (to relate with \(\delta T_{00} \) and \(\delta T_{0i}\)) for the evolution of the other components.
On the other hand, from the trace of the \(ij\) equations we find
%
\begin{align}
\hat{\phi}'' + 2 \frac{a'}{a} \hat{\phi}' + \frac{a'}{a} \psi +
\qty[2 \qty(\frac{a'}{a})' + \qty(\frac{a'}{a})^2] \psi
= 4 \pi G a^2 \qty(\Pi _L + \frac{2}{3} \nabla^2 \Pi _T)p_0
\,,
\end{align}
%
where the \(T\) in \(\Pi _T = \Pi^{\parallel} / p_0 (\eta )\) means ``traceless''.
From the traceless part of these equations we find
%
\begin{align}
\sigma ' + 2 \frac{a'}{a} \sigma + \hat{\phi} - \psi = 8 \pi G a^2 \Pi _T p_0
\,.
\end{align}

So far we have not chosen a gauge; let us now put ourselves in the Poisson gauge. Here,
%
\begin{align}
\omega^{\parallel} = 0 = \chi^{\parallel}
\,.
\end{align}

Then, \(\hat{\phi} = \phi = - \Phi _H\), and \(\psi = \Psi _A\).
Now \(\sigma = - \omega^{\parallel} + (1/2) \chi^{\parallel, \prime} = 0\).
Then, the equations reads
%
\begin{align}
\phi - \psi &= 8 \pi G a^2 \Pi_T p_0  \\
\Phi _H + \Psi _A  &= - 8 \pi G a^2 \Pi _T  p_0
\,.
\end{align}

If the anisotropic stress can be neglected, then \(\phi = \psi \); this is the case for CDM, not so for nonisotropic relativistic particles or modified gravity.
If this is the case, then we can write the evolution equation in a simpler way: \(\Pi _T\) vanishes, by definition \(\Pi _L p_0 = \delta p\), which we can split into
%
\begin{align}
\delta p = c_s^2 \delta \rho + \delta p _{\text{non-adiab}}
\,,
\end{align}
%
and considering only the adiabatic part we find
%
\begin{align}
\Phi _H'' + 3 \qty(1 + c_s^2) \frac{a'}{a} \Phi _H' +
\qty[2 \qty(\frac{a'}{a})' + \qty(1 + 3 c_s^2) \qty(\frac{a'}{a})^2
- c_s^2 \nabla^2] \Phi _H = 0
\,,
\end{align}
%
which is an isolated evolution equation for \(\Phi _H\), a wave-like propagation equation.

The Poisson gauge is the most Newton-like one: the evolution equation becomes
%
\begin{align}
- \nabla^2 \Phi _H &= 4 \pi G a^2 \underbrace{\qty(\delta \rho - \frac{3 a'}{a} (\rho_0 + p_0 )V )}_{\epsilon_{m}}
\marginnote{Inserting the \(0i\) equation into the \(00\) one.}
\\
&= 4 \pi G a^2\epsilon_m
\,,
\end{align}
%
a Poisson equation.

For the vector perturbation \(\Psi_i\), we find (from the \(0i\) equation)
%
\begin{align}
\nabla^2\Psi _i = 16 \pi G a^2 \qty(\rho_0 + p_0 ) V_{i, c}
\,,
\end{align}
%
while for the tensor perturbations, starting from the traceless part of the \(ij\) EFE, we get
%
\begin{align}
\chi_{ij}^{\prime \prime, T} + 2 \frac{a'}{a} \chi^{T, \prime}_{ij} - \nabla^2 \chi^{T}_{ij} = 16 \pi G a^2p_0 (\eta ) \Pi^{T}_{ij}
\,.
\end{align}

We should also perturb for the matter source of the equations: \(T^{\mu \nu }_{; \nu } =0 \).
The energy density continuity equation (\(\mu = 0\)) reads
%
\begin{align} \label{eq:energy-density-continuity-equation}
\delta \rho ' + \frac{3 a'}{a} \qty(\delta p + \delta \rho ) - 3 \qty(\rho_0 + p_0 )  \hat{\phi}' + \qty(\rho_0 + p_0 ) \nabla^2 \qty(V + \sigma ) &= 0
\,,
\end{align}
%
while for \(\mu = i\) we get
%
\begin{align}
V' + \qty(1 + 3 c_s^2) \frac{a'}{a} V + \psi + \frac{1}{(\rho_0 + p_0 )} \qty(\delta p + \frac{2}{3} p_0 \nabla^2 \Pi _T) &= 0
\,.
\end{align}

The curvature perturbation on uniform energy density hypersurfaces is
%
\begin{align}
\zeta = - \hat{\phi} - H \frac{ \delta \rho }{\dot{\rho}_0 } = - \hat{\phi} - \frac{a'}{a} \frac{ \delta \rho }{\rho_0 '}
\,,
\end{align}
%
where, as usual, \(\hat{\phi} = \phi + (1/6) \nabla^2 \chi^{\parallel}\).

In a uniform energy density gauge \(\zeta = - \hat{\phi}\); also in the flat gauge we have \(\hat{\phi} = 0\), which tells us that \(\zeta \) is an energy density perturbation.
On super-horizon scales and taking equation \eqref{eq:energy-density-continuity-equation} in the gauge where \(\delta \rho = 0\), the Laplacian in the energy density continuity equation can be taken to vanish (\(k \ll 1\)), and we can express it as
%
\begin{align}
\zeta ' = - \frac{a'}{a} \frac{ \delta p}{\rho_0 + p_0 }
\,,
\end{align}
%
but we must evaluate this in the uniform energy density gauge the adiabatic contribution to the pressure perturbation vanishes, therefore we are left with
%
\begin{align}
\zeta ' = - \frac{a'}{a} \frac{ \delta p _{\text{non-adiabatic}}}{\rho_0 + p_0 }
\,.
\end{align}

For single-field models of slow-roll inflation, we find that on super-horizon scales
%
\begin{align}
\delta p _{\text{non-adiabatic}} \propto \frac{k^2 \Phi _H}{a^2} \approx 0 \implies \zeta \approx \const
\,.
\end{align}

The continuity equation for vector perturbations reads
%
\begin{align}
\qty[(\rho_0 +p_0 ) V_{ic}]' + \frac{4 a'}{a} (\rho_0 + p_0 ) V_{ic}
= - \nabla_k \qty(\Pi^{\perp k}_{, i} + \Pi^{\perp, k}_{i})
\,.
\end{align}

By Kelvin's circulation theorem, vorticity is conserved along trajectories unless there are dissipative effects.
Then, the divergence on the right-hand side of this equation vanishes, therefore we can write the left-hand side as
%
\begin{align}
a^3 \qty(\rho_0 + p_0 ) V_{ic} a = \const
\,.
\end{align}

This amounts to a momentum times \(a\), so the equation represents the conservation of the intrinsic angular momentum.

\end{document}


\section{Universal Optimisations}
\label{sec:universal}

There are some optimisations that apply to \emph{all} solvers. These universal optimisations efficiently
try to reduce the overall complexity of a given parity game in order to reduce the effort spent by any solver.
Clearly, such optimisations have to ensure that a solution of the modified game can be effectively and
efficiently translated back into a valid solution of the original game.

In the following we describe optimisations that are implemented on top of every solving algrithm:
SCC decomposition, detection of special cases, and compression. The next section then describes a generic
algorithm that uses (some of -- depending on the configuration) these optimisations in order to call
a real solver on as few and little parts of a game as possible.

\subsection{SCC Decomposition}

Let $G = (V, V_0, V_1, E, \Omega)$ be a parity game. A \emph{strongly connected component} (SCC) is a non-empty set
$S \subseteq V$ with the property that every node in $S$ can reach every other node in $S$, i.e. $uE^*v$ for
all $u, v \in S$ (where $E^*$ denotes the transitive-reflexive closure of $E$). A strongly connected component
$S$ is \emph{proper} iff $uE^+v$ for all $u, v \in S$ (where $E^+$ denotes the transitive closure of $E$). In
other words: An SCC $S$ is proper iff $|S| > 1$ or $S = \{u\}$ and $uEu$.

\begin{theorem}[\cite{tarjan:146}]
Every parity game $G = (V,V_0,V_1,E,\Omega)$ can, in time $\mathcal{O}(|E|)$, be partitioned into SCCs
$S_0, ..., S_n$ with $V = \bigcup_{i \leq n} S_i$ and $S_i \cap S_j = \emptyset$ for all $i \not= j$.
\end{theorem}

Additionally there is a strict partial ordering $\rightarrow$ on these SCCs which is defined as follows:
\begin{displaymath}
S_i \rightarrow S_j \quad:\iff\quad i \not= j \wedge \exists u \in S_i,\, v \in S_j:\, uEv
\end{displaymath}
This strict partial ordering is generally known as the \emph{topology} of the SCC decomposition. An SCC $S$
is called \emph{final} w.r.t.\ $\to$ if there is no SCC $T$ s.t.\ $S \to T$. Note that every SCC topology
of a finite graph must have at least one final SCC.

SCC decomposition of parity games as a universal optimisation works as follows. First, the game is decomposed
into SCCs along with the computation of the strict partial ordering $\rightarrow$. Then, all final SCCs
with respect to $\rightarrow$ are solved by a parity game solver. Since these SCCs are not connected to any
other SCCs, all solutions obtained in this manner can be directly used as solutions in the global game.

Second, the attractors for both players with respect to the computed winning sets of all maximal solved SCCs
are computed and removed from the game. The remainder is still a game, but because of the removal some of the
original SCCs may not be SCCs anymore. All ``damaged'' ex-SCCs are again decomposed into SCCs and replaced by
the new respective decomposition.
%(Note: There is no need to actually replace the SCC in the data structure; it is more convenient to implement
% this by recursion).
In this way, the remaining decomposition can be used again to solve the rest of the game, again starting
with those SCCs that are now final.
%Note that it is convenient to automatically solve improper SCCs since otherwise they usually need to be
%treated differently than normal SCCs in the real solving algorithms.

%\subsection{Excision of Dominions}

%Although there is no obvious way to further reduce a parity game to smaller sub games that need to be solved,

With this SCC decomposition it is not necessary to require solvers to solve an entire SCC let alone an entire
game. Instead it suffices to have them solve at least a dominion for one of the players. Given an SCC $S$ and
two dominions $D_0, D_1 \subseteq S$ with $D_0 \subseteq W_0$ and $D_1 \subseteq W_1$, one simply computes the
attractors $A_i := \attr{}{i}{D_i}$ and considers the induced subgame $(S \setminus A_0) \setminus A_1$ which
can be recursively solved by decomposition into SCCs etc.

% The excision of dominions is particularly useful for algorithms using a certain heuristic to generate ``good''
% strategies or for algorithms trying to find small dominions locally; some solution algorithms of the following
% subsection will apply the dominion excision approach. Since the excision of a dominion possibly leads to a new
% subgame that can be optimised and decomposed again, this optimisation can be very powerful.\TODO{Sehr schwammiger
% Paragraph.}

\subsection{Detection of Special Cases}

There are certain kinds of special games that can be solved very efficiently by the following procedures.
W.l.o.g.\ we can assume games to be proper strongly connected components. Remember that SCCs which are not proper
consist of a single node $v$ only that does not have an edge back to itself. The winner of $v$ is the owner
iff there is a successor that he/she wins. Since all successors belong to topologically greater SCCs we can
assume them to be solved already, and thus, the winner of $v$ is easily determined.

\begin{itemize}
\item \emph{Self-cycle games}: Suppose there is a node $v$ such that $vEv$. Then there are two cases depending on
the node's owner $p$ and the parity of the node's priority. If $\Omega(v) \not\equiv_2 p$ then taking the edge
$(v,v)$ is always a bad choice for player $p$ and this edge can be removed from the game for as long as
totality is preserved. If $\Omega(v) \equiv_2 p$ then taking this edge is always good in the sense that
$\{v\}$ is a dominion for player $p$. Hence, its attractor can be removed as described above.

\item \emph{One-parity games}: If all nodes in a proper SCC have the same parity, the whole game is obviously won
by the corresponding player no matter which transition the player uses. Hence, a winning strategy can be found
by random choice.

\item \emph{One-player games}: A game $G$ is a one-player game for player $i$ iff for all $v \in V_{1 - i}$ we have
$|vE| = 1$. Such a one-player game that is an SCC can be solved using a simple fixed-point iteration.
%\begin{align*}
%E_0\,\, &:= E \\
%E_{j + 1} &:= \{(u, v) \mid uE_jv \vee \exists w:(uE_jw \wedge wE_jv \wedge \Omega(u) \geq \Omega(w) \wedge \Omega(u) \equiv_2 i )\} \\
%E'\,\, &:= \bigcup_{j \in \Nat} E_j
%\end{align*}
%Now the following holds:
Player $i$ wins the game iff there is a node $u$ with $\Omega(u) \equiv_2 i$ and $u$ is reachable from itself
on a path that does not contain a priority greater than $\Omega(u)$.
% As player $i$ wins the game iff there is a cycle in the game won by player $i$ the fixed point iteration
%simply computes which nodes having parity $i$ can reach itself without seeing a greater priority than their
%own. Thus, if $E'$ connects $i$-parity nodes with itself, there needs to be a cycle using that particular
%node being won by player $i$. The conversion also holds: If there is no $i$-parity node $u$ s.t. $uE'u$ then
%the whole SCC is won by player $1-i$.
If there is such a cycle won by player $i$ then the rest of the SCC lies in the attractor of the cycle (since
player $i$ is the only one to make choices); otherwise, if there is no cycle won by player $i$, the whole game
is won by player $1-i$.
\end{itemize}

\subsection{Priority Compression}

The complexity of a parity game rises with the number of different priorities in the game. This optimisation step
attempts to reduce this number. Note that it is not the actual values of priorities that determine the winner.
It is rather their \emph{parity} on the one hand and their \emph{ordering} on the other. For instance, if there are
two priorities $p_1 < p_2$ in a game with $p_1 \equiv_2 p_2$ but there is no $p'$ such that $p_1 < p' < p_2$ and
$p' \not\equiv_2 p_1$ then every occurrence of $p_2$ can be replaced by $p_1$.

In general, let $P = (p_0,\ldots,p_k)$ be the list of all the priorities occurring in a game $G = (V,V_0,V_1,E,\Omega)$
s.t.\ $p_{i-1} < p_i$ for all $0 \le i < k$. W.l.o.g.\ we assume $p_0$ to be even. If the least priority occurring in
$G$ is odd, then simply add $p_0 = 0$ to this list which does not affect the construction in any way. We will also
use $P$ to denote the \emph{set} of all elements in $P$.

Take a decomposition of $P$ into maximal sublists of elements with the same parity, i.e.\
\begin{displaymath}
P \enspace = \enspace (p_{0,0},\ldots,p_{0,m_0},p_{1,0},\ldots,p_{1,m_1},\ldots,p_{n,0},\ldots,p_{n,m_n})
\end{displaymath}
with $p_{i,j} \equiv_2 p_{i,j'}$ for all $0 \le i \le n$, $0 \le j < j' \le m_i$ and
$p_{i,m_i} \not\equiv_2 p_{i+1,0}$ for all $0 \le i < n$. This defines a partial mapping $\omega: \Nat \to \Nat$ as
\begin{displaymath}
\omega(p) \enspace = \enspace
\begin{cases}
i &, \mbox{if } p = p_{i,j} \mbox{ for some } j  \\
\mathrm{undefined} &, \mbox{otherwise}
\end{cases}
\end{displaymath}
Note the following facts about $\omega$:
\begin{itemize}
\item $\omega$ is defined on all priorities occurring in $G$;
\item $\omega$ is \emph{decreasing}: we have $\omega(p) \le p$ for all $p \in P$;
\item $\omega$ is \emph{monotone}: for all $p,p'$ with $p \le p'$ we have $\omega(p) \le \omega(p')$;
\item $\omega$ \emph{preserves parities}: we have $\omega(p) \equiv_2 p$ for all $p \in P$;
\item $\omega$ is \emph{dense}: for all $p,p' \in P$ with $\omega(p)+1 < \omega(p')$ there is a $p''$ with
$\omega(p) < \omega(p'') < \omega(p')$.
\end{itemize}
Now define another parity game $G' := (V,V_0,V_1,E,\Omega')$ with $\Omega'(v) := \omega(\Omega(v))$. I.e.\ $G'$
results from $G$ by reducing the priorities according to the function $\omega$. Then $G'$ is equivalent to $G$
in the sense that the players' winning regions coincide in the two games, and a winning strategy $\sigma$ for
some player $i$ in $G$ is also a winning strategy for him/her in $G'$ and vice-versa. This is guaranteed by the
properties of $\omega$ identified above: due to monotonicity and preservation of parities, the greatest priority
ocurring in an infinite play in $G$ is even iff it is even in the same play in $G'$. The property of being
decreasing guarantees that this should in general be an optimisation, and density says that $G'$ is optimal
w.r.t.\ this optimisation.

% \begin{lemma}
% Every parity game $G = (V,V_0,V_1,E,\Omega)$ induces an equivalent parity game $G' = (V,V_0,V_1,E,\Omega')$ where
% $\Omega'$ is inductively defined as follows:
% \begin{displaymath}
% \Omega'(v) \enspace := \enspace
% \begin{cases}
% m(v) \enspace, &\mbox{if } \Omega(v) \equiv_2 m(v) \\
% m(v) + 1 & \mbox{otherwise}
% \end{cases}
% \end{displaymath}
% and
% \begin{displaymath}
% m(v) \enspace := \enspace \max \{0, \Omega'(w) \mid \Omega(w) < \Omega(v)\}
% \end{displaymath}
% Then $W_0(G) = W_0(G')$, $W_1(G) = W_1(G')$ and every winning strategy for player $i \in \{0, 1\}$ w.r.t. $G$ is a winning strategy for player $i$ w.r.t. $G'$ and vice versa.
% \end{lemma}

% Since $\Omega(v) \leq \Omega(w)$ iff $\Omega'(v) \leq \Omega'(w)$ as well as $\Omega(v) \equiv_2 \Omega'(v)$ it is not hard to see that the greatest priority occurring infinitely often in a play w.r.t. $G$ has the same parity as w.r.t. $G'$.

\subsection{Priority Propagation}

Note that any play visiting a node $v$ has to -- due to totality -- also visit one of the successors of
$v$. Now suppose that the priorities of all successors of $v$ are greater than the priority of $v$ itself.
Then $v$'s priority is irrelevant in the sense that no play is won by either player because $v$'s priority
occurs in it. For those plays not visiting $v$ at all this is trivial and for those plays that do visit
$v$ this is simply because $v$ is certainly not the geatest priority occurring in this play, let alone
occurring infinitely often. Hence, $v$'s priority can be replaced by a greater one.

In general, let $G = (V,V_0,V_1,E,\Omega)$. Applying \emph{backwards propagation} in node $v$ results in
the game $G' = (V,V_0,V_1,E,\Omega')$ where
$\Omega' = \Omega[v \mapsto \max \{ \Omega(v), \min \{ \Omega(w) \mid w \in vE \} \}]$.
Similarly, \emph{forwards propagation} replaces $v$'s priority with the minimum of all
priorities of its predecessors if that is greater than its current priority. It is equally sound because
any play that visits $v$ infinitely often must visit one of its predecessors infinitely often too.

Both backwards and forwards propagation can be iterated and combined thus reducing the range of priorities
in a game.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End:


\newpage{}

\hypertarget{a004---reducing-dispersion-by-assigning-a-concrete-value-per-word-and-learning-from-it}{%
\section{A004 - reducing dispersion by assigning a concrete value per
word and learning from
it}\label{a004---reducing-dispersion-by-assigning-a-concrete-value-per-word-and-learning-from-it}}

A001 collects as many different values for each word as it can get. When
estimating, it uses any of those values more or less randomly (of cause
smoothend by the fact that we take 100 random values and then only use a
value from a certain position representing the percentage of certainty
we want to have). Anyways, that hinders our ability to ``learn''.

The idea behind this algorithm is to assign just one value to each word.
This way, when we see our error margin we might design a little learning
algorithm.

For example: - create an average model - while the mean squared error is
higher than \ldots{} - create 10 mutation of that model, for example by
randomly adding or substracting 1/10th of the value to each weight of
each word. - calculate the mean squared error for each mutation - take
the model with the least mean squared error and repeat


\documentclass{article}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{hyperref}
\usepackage{xcolor}
\large

\begin{document}

 \title{GST108 : Introduction to Quantitative Reasoning}

\author{Oghenemaro Egbodo}
\maketitle
\newpage
\tableofcontents
\centering
\newpage

\section{Introduction}
A logic gate is a building block of a digital circuit which is at the heart of any computer operation.
\\
\subsection{LOGIC GATES}
A logic gate is an idealized model of computation or physical electronic device implementing a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output.
\includegraphics{unknown.png}
\newpage
Behind every digital system is a logic gate.\\
\includegraphics{unknown.jpeg}
\newpage
Logic gates perform logical operations that take binary input (0s and 1s) and produce  a single binary output. They are used in most electronic device including.\\
\begin{table}[h!]
	\begin{center}
		\begin{tabular}{|l|c|c|}
			\hline
		 Smartphones & Tablets & Memory Devices\\
		 \hline
		 \includegraphics[width=0.2\linewidth]{Unknown-1.jpeg} & \includegraphics[width=0.2\linewidth]{Unknown-2.jpeg} & \includegraphics[width=0.2\linewidth]{Unknown-3.jpeg}\\
		 \hline
	\end{tabular}
\end{center}
\end{table}
\newpage
 Now think of a logic gate like a light switch, it is either in an ON or OFF position. Similarly, the input output terminals are always in one of two binary positions false(0) and true(1). Each gate has its own logic or set of rules that determines how it acts based on multiple inputs outlined in a truth table.
\newpage
Combining 10s, 1000s or millions of logic gates makes it possible for a computer to perform highly complex operations and tasks at ever increasing speeds.
\newpage
A gate is a basic electronic circuit which operates on one or more signals to produce an output signal.
Logic gates are digital circuits constructed from diodes, transistors, and resistors connected in such a way that the circuit output is the result of a basic logic operation \textbf{(OR, AND, NOT)} performed on the inputs.
\newpage
\section{TYPES OF LOGIC GATES}
Fundamental gates are \textbf{AND, OR} and \textbf{NOT}\\
\includegraphics[width=0.3\linewidth]{images.png}\\
Derived Gates are \textbf{NAND, NOR, XOR} and \textbf{XNOR} (derived from the fundamental gates)\\
Universal Gates are \textbf{NAND} and \textbf{NOR} gates (the fundamental logic gates can be realized through them).
\\
\newpage
\subsection{AND Gate}
The expression C = A X B reads as “C equals A AND B.“\\
The multiplication sign (X) stands for the AND operation, same for ordinary multiplication of 1s and 0s.\\
 \includegraphics[width=0.5\linewidth]{Picture 1.png} \\
The AND operation produces a true output (result of 1) only for the single case when all of the input variables are 1 and a false output (result of 0) where one or more inputs are 0.
\\
\begin{figure}[h!]
	\centering
	\includegraphics[width=0.5\linewidth]{Unknown-4}
\end{figure}
\newpage
\includegraphics[width=0.2\linewidth]{Picture 1-0.png} \includegraphics[width=0.2\linewidth]{Picture 1-1.png}\\
\includegraphics[width=0.2\linewidth]{Picture 1-2.png} \includegraphics[width=0.2\linewidth]{Picture 1-3.png}\\
\newpage
\subsection{OR Gate}
The expression C = A + B reads as “C equals A OR B". It is the inclusive “OR”
\\
The Addition (+) sign stands for the OR operation
\\
\includegraphics{Picture 2.png}\\
The OR operation produces a true output (result of 1) when any of the input variable is 1 and a false output (result of 0) only when all the input variables are 0.
\\
\includegraphics{images-1.png}
\newpage
\includegraphics[width=0.3\linewidth]{Picture 2-0.png} \includegraphics[width=0.3\linewidth]{Picture 2-1.png}\\
\includegraphics[width=0.3\linewidth]{Picture 2-2.png} \includegraphics[width=0.3\linewidth]{Picture 2-3.png}\\
\newpage
\subsection{NOT GATE}
The NOT gate is called a logical inverter.\\
It has only one input. It reverses the original input (A) to give an inverted output C.\\
C = NOT A or C = $\overline{A}$\\
\includegraphics{Picture 3.png}\\
\begin{figure}[h!]
	\centering
	\includegraphics[width=0.5\linewidth]{Unknown-3}
\end{figure}
\newpage
\includegraphics[width=0.3\linewidth]{Picture 4.png} \includegraphics[width=0.3\linewidth]{Picture 4-1.png}
\newpage
\subsection{NOR GATE}
The NOR (NOT OR) gate circuit is an inverter OR gate.\\
C=$\overline{(A+B)}$\\
Reads as C = NOT of A or B.\\
\includegraphics[width=0.3\linewidth]{Picture 5.png}\includegraphics[width=0.1\linewidth]{Picture 5.1.png}  \includegraphics[width=0.3\linewidth]{Picture 5.2.png}\\
\includegraphics[width=0.3\linewidth]{Unknown-4.png}
\newpage
\includegraphics[width=1.0\linewidth]{Picture 6}\\
\newpage

\subsection{NAND GATE}
The NAND (NOT AND) Gate is an inverted AND Gate.\\
C = $\overline{((A x B)}$\\
Reads as C = NOT of A AND B.\\
The NAND Gate gives a false output (result of 0) only when both inputs are true (1).\\
\includegraphics[width=0.3\linewidth]{Picture 7.png}\includegraphics[width=0.1\linewidth]{Picture 5.1.png}\includegraphics[width=0.3\linewidth]{Picture 7-1.png}\\
\includegraphics[width=0.5\linewidth]{Unknown-5.png}
\newpage
\includegraphics[width=1.0\linewidth]{Picture}
\newpage
\subsection{XOR GATE}
An XOR (exclusive OR) gate acts in the same way as the exclusive OR logical connector. \\
It gives a true output (result of 1) if one, and only one, of the inputs to the gate is true (1), i.e either or but not both.\\
c = A $\oplus$ B = A.$\overline{B}$ + $\overline{A}$.B\\
\includegraphics[width=0.4\linewidth]{8} \includegraphics[width=0.1\linewidth]{Picture 5.1.png} \includegraphics[width=0.4\linewidth]{9}\\
\includegraphics[width=0.5\linewidth]{Unknown-6.png}\\
\newpage
\subsection{XNOR GATE}
The XNOR (exclusive - NOR) gate is a combination XOR gate followed by an inverter. It is represented by the $\odot$\\
Its gives a  true output (1), if the inputs are the same, and a false output (0) if the inputs are different.\\
C=$\overline{A \oplus B}$ = $\overline{(\overline{A}.B + A.\overline{B})}$\\
\includegraphics[width=0.3\linewidth]{10}\includegraphics[width=0.1\linewidth]{Picture 5.1.png} \includegraphics[width=0.3\linewidth]{11.1}\\
\includegraphics[width=0.8\linewidth]{Unknown-7.png}\\
\newpage
\section{Logic Gates and their Truth Tables}
\includegraphics[width=1.0\linewidth]{11}
\newpage
\section{Summary}
Using different combination of logic gates, complex operations can be performed.\cite{grace2020} \\
With the Universal logic gates - NAND and NOR, any other gate can be built.\\
There is no limit to the number of gates that can be arranged together in a single device.\\
However, in practice, there is a limit to the number of gates that can be packed into a given physical space.
\\
Arrays of logic gates are found in digital integrated circuits.
\\
\newpage
\subsection{Summary contd.}
The logic gates are abstract representations of real electronic circuits.\cite{grace2021study}\\
In computers, Logic gates are built using transistors combined with other electrical components like resistors and diodes. \\
These electrical components are wired together in order to transform a particular input to give a desired output.\\
\href{https://www.youtube.com/watch?v=sTu3LwpF6XI&t=481s}{Making Logic Gates from Transistors\textbf{(click to watch)}}
\newpage
\section{QUIZ}
What is the output of an AND gate if the inputs are 1 and 0?
\\
Explain the difference between the AND gate and the OR gate.\\
What is the output of a NOT gate if the inputs is 0?\\
Which logic gate is this?
\includegraphics[width=0.1\linewidth]{12}\\
Which gate is also known as a logical converter?
\\
\newpage
\bibliographystyle{ieeetr}
\bibliography{daBib}
\newpage
\includegraphics[width=1.0\linewidth]{thanks}

\end{document}


%!TEX TX-program = xelatex
\documentclass{article}
\usepackage{allan-eason}

\usetikzlibrary{positioning}
\usetikzlibrary{svg.path}

\graphicspath{ {./images/}}

\newcommand{\Title}{\LaTeX\ Test File}
\newcommand{\Author}{Eason S.}

\title{\Title}
\author{\Author}
\date{\today}

\geometry{a4paper, scale=0.8}

\lhead{\Title}

\begin{document}

	\maketitle

	\section{Maxwell's Equations}

		\subsection{Integral Format}

			\defword{Maxwell's Equations} (in forms of \defword{Integral}):

			\begin{align}
				\oiint_{S} \vect{D} \cdot \diff \vect{S} = \sum q &= \int_V \rho \diff V,\\
				\oiint_{S} \vect{B} \cdot \diff \vect{S} &= 0,\\
				\oint_{L} \vect{H} \cdot \diff \vect{l} = I + I_{\diff} &= \int_{S} \vect{j} \cdot \diff \vect{S} + \int_{S} \frac{\partial \vect{D}}{\partial t} \cdot \diff \vect{S},\\
				\oint_{L} \vect{E} \cdot \diff \vect{l} = - \frac{\diff \varPhi}{\diff t} &= - \int_{S} \frac{\partial \vect{B}}{\partial t} \cdot \diff \vect{S}.
			\end{align}

			Here, (1) states for the \defword{Gauss Theorem} in an \defword{Electric Field}, while (2) states for the \defword{Gauss Theorem} in an \defword{Magnetic Field}. (3) states for the relationship between \defword{A Changing Electric Field} and a magnetic field, or \defword{Ampere's Circulation Theorem}. (4) states for the relationship between \defword{A Changing Magnetic Field} and a electric field, or \defword{Faraday's Theorem of induction}.

	\section{Partial Derivative}

		\subsection{Definition}

			Let \(t=f(x, y, \ldots)\), the \defword{Partial Derivative} of \(f\) towards \(x\) is

			\[
				f'_{x} = \partial_x f = D_x f = D_1 f = \frac{\partial}{\partial x} f = \frac{\partial f}{\partial x} = \lim_{\Delta x \rightarrow 0} \frac{f(x + \Delta x, y, \ldots) - f(x, y, \ldots)}{\Delta x}.
			\]

			Define vector \(\vect{a} = (x, y, \ldots), \vect{\hat{e}_x} = (1, 0, \ldots)\), therefore

			\[
				\frac{\partial}{\partial x} f = \lim_{x\rightarrow 0} \frac{f(\vect{a} + h \vect{e_x}) - f(\vect{a})}{h}.
			\]

		\subsection{Gradient}

			Define \defword{Gradient} as following:

			\[
				\Grad f(\vect{a}) = \nabla f(\vect{a}) = \left(\at{\frac{\partial f}{\partial x}}{\vect{a}}, \at{\frac{\partial f}{\partial y}}{\vect{a}}, \ldots\right).
			\]

			We usually deine Gradient as following in a 3-Dimensional Space:

			\[
				\Grad = \nabla = \left[\frac{\partial}{\partial x}\right]\vect{\hat{e}_x} + \left[\frac{\partial}{\partial y}\right]\vect{\hat{e}_y} + \left[\frac{\partial}{\partial z}\right]\vect{\hat{e}_z}.
			\]

		\subsection{Directional Derivative}

			Define the \defword{Directional Derivative} along vector \(\vect{v} = \left(v_1, v_2, \ldots\right)\),

			\[
				\nabla_{\vect{v}} f(\vect{a}) = \lim_{x \rightarrow 0} \frac{f(\vect{a} + h \vect{v}) - f(\vect{a})}{h}.
			\]

		\subsection{Laplace Operator}

			Define the \defword{Laplace Operator} as following:

			\[
				\Delta = \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + \frac{\partial^2}{\partial z^2} = \nabla \cdot \nabla = \nabla^2.
			\]

		\subsection{Divergence}

			Define the \defword{Divergence} of a vector as following: (it outputs a value)

			\[
				\Div \vect{v} = \nabla \cdot \vect{v} = \left(\frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \frac{\partial}{\partial z} \right) \cdot \left(v_x, v_y, v_z\right) = \frac{\partial v_x}{\partial x} + \frac{\partial v_y}{\partial y} + \frac{\partial v_z}{\partial z}.
			\]

\end{document}


\documentclass{article}

\usepackage{tabu}
\usepackage{pbox}
\usepackage[margin=1in]{geometry}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{tikz}
\usepackage{circuitikz}

\frenchspacing
\setlength{\parskip}{1em}
\renewcommand{\arraystretch}{1.5}
\setlength\parindent{0pt}
\DeclareMathSizes{10}{12}{8}{6}

\begin{document}

\section{MOSFETs}

\textbf{Definitions:}

\vspace{-5mm}
\begin{itemize} \itemsep0pt
	\item \(k_n \equiv \mu_nC_{ox} \frac{W}{L}\), \(k_p \equiv \mu_pC_{ox} \frac{W}{L}\)
	\item \(k'_n \equiv \mu_nC_{ox}\), \(k'_p \equiv \mu_pC_{ox}\)
	\item \(V_{OV} \equiv V_{GS}-V_{th}\)
	\item \(V_A \equiv \frac{1}{\lambda}\)
	\item \(V'_A \equiv \frac{V_A}{L}\)
	\item \(g_m \equiv \frac{\partial i_D}{\partial v_{GS}} = \frac{i_d}{v_{gs}}\)
\end{itemize}

\textbf{Large signal characteristics, \(k=k_n\) or \(k_p\) as appropriate:}

\begin{tabu}{  l  X  X  }
	\hline
	Region & Condition & Properties \\ \hline
	Saturation & \(|V_{GS}| > |V_{th}| \bigwedge |V_{DS}| \geq |V_{OV}|\) &
	\pbox{10cm}{
		\vspace{1mm}
		\(\begin{aligned}
					I_D &= \frac{k}{2} V_{OV}^2 (1+\frac{V_{DS}}{V_A}) \\
					&\approx \frac{k}{2} V_{OV}^2
		\end{aligned}\)
	}\\

	Triode & \(|V_{GS}| > |V_{th}| \bigwedge |V_{DS}| \leq |V_{OV}|\) &
	\pbox{10cm}{ \(I_D = k(|V_{OV}|-\frac{1}{2}|V_{DS}|)|V_{DS}|\) } \\

	Cutoff & \(|V_{GS}| \leq |V_{th}|\) & \(I_D = 0\)\\
	\hline
\end{tabu}

For N-channel devices, all absolute value operations can be ignored.

\vspace{5mm}
\textbf{Small signal characteristics (saturation only):}

\begin{circuitikz}[american voltages] \draw
		(0,2) node[anchor=east]{G}
		to[short, o-] (1,2)
		to[open, v<=\(v_{gs}\)] (1,0)
		(1,0) -- (3,0)
		to[short, -o] (3,-1)
		node[anchor=east]{S}
		(3,2) to[american controlled current source, l_=\(g_mv_{gs}\), -*] (3,0)
		-- (5,0)
		to[R, l=\(r_o\), -*] (5,2)
		(3,2) -- (5,2)
		to[short, -o] (6,2)
		node[anchor=west]{D}
;
\end{circuitikz}

\vspace{-5mm}
\begin{itemize}
	\item \(g_m = \frac{2I_D}{V_{OV}} = k|V_{OV}| = \sqrt{2kI_D}\)
	\item \(r_o = \frac{V_A}{I_D}\)
\end{itemize}

\newpage
\section{BJTs}

\textbf{Definitions:}

\vspace{-5mm}
\begin{itemize} \itemsep0pt
	\item \(V_T \equiv \frac{kT}{q} \approx 25\text{mV}\)
	\item \(\alpha \equiv \frac{\beta}{\beta + 1}\)
	\item \(g_m \equiv \frac{\partial I_C}{\partial V_{BE}}\)
\end{itemize}

\textbf{Large signal characteristics:}

\begin{tabu}{  l  X  X  }
	\hline
	Region & Condition & Properties \\ \hline

	Saturation & Both junctions forward biased &
	\pbox{10cm}{
		\vspace{-5mm}
		\setstretch{1.2}
		\(|V_{BE}| \approx 0.7\text{V}\) \\
		\(|V_{CE}| \approx 0.2\text{V}\) \\
		\(|V_{BC}| \approx 0.5\text{V}\) \\
		\(I_C = \beta_{forced} I_B\)
	}
	\\[-13mm]

	Active & EB junction forward biased, CB junction reverse biased &
	\pbox{10cm}{
		\setstretch{1.3}
		\(\begin{aligned}
					I_C &= I_S e^{\frac{|V_{BE}|}{V_T}} (1 + \frac{V_{CE}}{V_A}) \\[-3mm]
						   &\approx I_S e^{\frac{|V_{BE}|}{V_T}}
		\end{aligned} \) \\
		\(I_C = \beta I_B\) \\
		\(I_E = \frac{I_C}{\alpha} = I_B + I_C\) \\
		\(|V_{BE}| \text{is effectively limited at around 0.7V}\)
	} \\[-5mm]

	Cutoff & Both junctions reverse biased & \(I_C = I_B = 0\) \\[1mm]
	\hline
\end{tabu}

A junction is considered forward biased if the voltage over it is greater than 0.4V. For NPN devices, all absolute value operations can be ignored.

\vspace{5mm}
\textbf{Small signal characteristics (active only):}

\begin{circuitikz}[american voltages] \draw
		(0,2) node[anchor=east]{B}
		to[short, o-] (1,2)
		to[R, l=\(r_\pi\), v<=\(v_{be}\)] (1,0)
		(1,0) -- (4,0)
		to[short, -o] (4,-1)
		node[anchor=east]{E}
		(4,2) to[american controlled current source, l_=\(g_mv_{be}\), -*] (4,0)
		-- (6,0)
		to[R, l=\(r_o\), -*] (6,2)
		(4,2) -- (6,2)
		to[short, -o] (7,2)
		node[anchor=west]{C}
;
\end{circuitikz}

\vspace{-5mm}
\begin{itemize}
	\item \(g_m = \frac{I_C}{V_T}\)
	\item \(r_{\pi} = \frac{\beta}{g_m} = \frac{V_T}{I_B}\)
	\item \(r_o = \frac{V_A}{I_C}\)
\end{itemize}

\end{document}


\section{Conclusion}

The main research question is whether Chinese stocks show a positive return-variance correlation.
We cannot claim that in general since, in all periods, more than half of the Chinese companies' leverage effect is insignificant, i.e.\ the posterior $\rho$'s 5\% to 95\% credible interval contains the 0.
On the other hand, we see that the Chinese market participants uniformly have weaker leverage effect than the German ones.
Moreover, sometimes they even have anti-leverage.

Examining further differences and similarities is most interesting with the global crisis of 2007 in mind.
We found proof for $\rho$ being shifted to the negative direction throughout the crisis.
Even though the negative shift is present unquestionably in both countries, the hectic changes of the leverage effect in China bring doubts about the importance of the crisis as a driving factor.

While $\rho$ behaves similarly in China and in Germany throughout the crisis, estimates of $\phi$ contrast the two countries at the same period.
When there is a trend in the volatility, i.e.\ it is not constant plus white noise, then there is high autocorrelation and persistence.
These trends exist in the German stocks' volatilities around the Subprime Crisis and the European Debt Crisis, so at those times $\phi$ is considerably larger than its prior.
On the contrary, this phenomenon is not present in China.

\subsection*{Future work}

While there are many possible explanations for the leverage effect, there is not any for the anti-leverage effect, to the best of our knowledge.
Unusual regulations are likely to be the main factor here, but a different investment culture is also a possible reason.
Either way, a microeconomics-based approach could be the key that models agents maximising utility in a well designed environment.

Finally, time-varying leverage effect models could be another direction for improvements.
Simple linear functions would not be sufficient to model the shifts in crises, probably a higher order polynomial that still avoids overfitting, or an ARCH process for $\rho$ would increase the predictive power.
We did not find such attempts in the literature.


\section{Realizability-Enforcing Limiter}
\label{sec:limiter}

Condition~2 of Theorem~\ref{the:realizableDGIMEX} requires that the polynomial approximation $\vect{\cM}_{h}=\vect{\cM}_{h}^{(j)}$ ($j\in\{0,\ldots,i-1\}$) is realizable in every point in the quadrature set $S=\cup_{k=1}^{d}\hat{\vect{S}}^{k}$.
Following Zhang \& Shu \cite{zhangShu_2010a} we use the limiter in \cite{liuOsher_1996} to enforce the bounds on the zeroth moment $\cJ$.
%The bound-preserving DG-IMEX method developed in previous sections is designed to preserve realizability of the cell averaged moments, i.e., $\vect{\cM}_{\bK}\in\cR$, provided sufficiently accurate quadratures are used to integrate integrals in the DG method, a CFL condition is satisfied, and that the polynomial approximation $\vect{\cM}_{h}$, at time $t^{n}$, is realizable in a set of quadrature points in each element $\bK$.
%We denote this quadrature set by $S=\cup_{k=1}^{d}\hat{\vect{S}}^{k}\subset\bK$.
%In the DG method, we use the limiter proposed by Zhang \& Shu \cite{zhangShu_2010a} for scalar conservation laws to enforce the bounds on the zeroth moment $\cJ$ (see also \cite{liuOsher_1996}).
We replace the polynomial $\cJ_{h}(\vect{x})$ with the limited polynomial
\begin{equation}
  \tilde{\cJ}_{h}(\vect{x})
  =\vartheta_{1}\,\cJ_{h}(\vect{x})+(1-\vartheta_{1})\,\cJ_{\bK},
  \label{eq:limitDensity}
\end{equation}
where the limiter parameter $\vartheta_{1}$ is given by
\begin{equation}
  \vartheta_{1}
  =\min\Big\{\,\Big|\f{M-\cJ_{\bK}}{M_{S}-\cJ_{\bK}}\Big|,\Big|\f{m-\cJ_{\bK}}{m_{S}-\cJ_{\bK}}\Big|,1\,\Big\},
\end{equation}
with $m=0$ and $M=1$, and
\begin{equation}
  M_{S}=\max_{\vect{x}\in S}\cJ_{h}(\vect{x})
  \quad\text{and}\quad
  m_{S}=\min_{\vect{x}\in S}\cJ_{h}(\vect{x}).
\end{equation}

In the next step, we ensure realizability of the moments by following the framework of \cite{zhangShu_2010b}, developed to ensure positivity of the pressure when solving the Euler equations of gas dynamics.
We let $\widetilde{\vect{\cM}}_{h}=\big(\tilde{\cJ}_{h},\vect{\cH}_{h}\big)^{T}$.
Then, if $\widetilde{\bcM}_{h}$ lies outside $\cR$ for any quadrature point $\vect{x}_{q}\in S$, i.e., $\gamma(\widetilde{\bcM}_{h})<0$, there exists an intersection point of the straight line, $\vect{s}_{q}(\psi)$, connecting $\vect{\cM}_{\bK}\in\cR$ and $\widetilde{\vect{\cM}}_{h}$ evaluated in the troubled quadrature point $\vect{x}_{q}$, denoted $\widetilde{\vect{\cM}}_{q}$, and the boundary of $\cR$.
This line is given by the convex combination
\begin{equation}
  \vect{s}_{q}(\psi)=\psi\,\widetilde{\vect{\cM}}_{q}+(1-\psi)\,\bcM_{\bK},
\end{equation}
where $\psi\in[0,1]$, and the intersection point $\psi_{q}$ is obtained by solving $\gamma(\bs_{q}(\psi))=0$ for $\psi$, using the bisection algorithm\footnote{In practice, $\psi$ needs not be accurate to many significant digits, and the bisection algorithm can be terminated after a few iterations.}.
We then replace the polynomial representation $\widetilde{\vect{\cM}}_{h}\to\widehat{\vect{\cM}}_{h}$, where
\begin{equation}
  \widehat{\vect{\cM}}_{h}(\vect{x})=\vartheta_{2}\,\widetilde{\vect{\cM}}_{h}(\vect{x})+(1-\vartheta_{2})\,\vect{\cM}_{\bK},
  \label{eq:limitMoments}
\end{equation}
and $\vartheta_{2}=\min_{q}\psi_{q}$ is the smallest $\psi$ obtained in the element by considering all the troubled quadrature points.
This limiter is conservative in the sense that it preserves the cell-average $\widehat{\vect{\cM}}_{\bK}=\widetilde{\vect{\cM}}_{\bK}=\vect{\cM}_{\bK}$.

The realizability-preserving property of the DG-IMEX scheme results from the following theorem.
\begin{theorem}
  Consider the IMEX scheme in Eqs.~\eqref{imexStages}-\eqref{eq:imexCorrection} applied to the DG discretization of the two-moment model in Eq.~\eqref{eq:semidiscreteDG}.
  Suppose that
  \begin{itemize}
    \item[1.] The conditions of Theorem~\ref{the:realizableDGIMEX} hold.
    \item[2.] With $\vect{\cM}_{\bK}^{(i)}\in\cR$, the limiter described above is invoked to enforce
    \begin{equation*}
      \vect{\cM}_{h}^{(i)}(\vect{x})\in\cR ~ \text{for all} ~ \vect{x} \in S.
    \end{equation*}
    \item[3.] The IMEX scheme is GSA.
  \end{itemize}
  Then $\vect{\bcM}_{\bK}^{n+1}\in\cR$.
  \label{the:realizableDGIMEX2}
\end{theorem}
\begin{proof}
  By Theorem~\ref{the:realizableDGIMEX} (with $i=1$), we have $\vect{\cM}_{\bK}^{(1)}\in\cR$.
  Application of the realizability-enforcing limiter gives $\vect{\cM}_{h}^{(1)}(\vect{x})\in\cR$ for all $\vect{x} \in S$.
  Repeated application of these steps give $\vect{\cM}_{h}^{(i)}(\vect{x})\in\cR$ for all $\vect{x} \in S$ and $i\in\{1,\ldots,s\}$.
  Since the IMEX scheme is GSA, $\tilde{\vect{\cM}}_{\bK}^{n+1}\in\cR$.
  Finally, $\vect{\bcM}_{\bK}^{n+1}\in\cR$ follows from Lemma~\ref{lem:imexCorrectionCellAverage}.
\end{proof}


\documentclass[a4paper,11pt]{article}
%\documentclass[a4paper,11pt]{scrartcl}

\input{../preambles/preamble}
\input{../preambles/unicode}

\setmainlanguage{english}
\setotherlanguages{german,greek,russian}

\input{../preambles/math-single}
\input{../preambles/math-brac}
\input{../preambles/math-thm}
\input{../preambles/phys-chem}

\setromanfont[Mapping=tex-text]{Linux Libertine O}
% \setsansfont[Mapping=tex-text]{DejaVu Sans}
% \setmonofont[Mapping=tex-text]{DejaVu Sans Mono}

\usepackage[style=authoryear-icomp,
			backend=biber]{biblatex}
\addbibresource{../singular-dynamics.bib}

\title{Notes on Canonical Singular Dynamics}
\author{Yi-Fan Wang (王\ 一帆)}
%\date{}

\begin{document}
\maketitle

\section{Classical formalism}

Lagrangian with velocity
\begin{equation}
L^\text{v} \coloneqq \fat{L}{\dot{q} = v}
\end{equation}
Equations of motion
\begin{equation}
\sum_j M_{ij}\dot{v}_j = K^\text{v}_i,\quad
\dot{q}_i = v_i.
\end{equation}
where
\begin{equation}
\rfun{M_{ij}}{q,v} \coloneqq \frpa{^2 L^\text{v}}{v_i\,\partial v_j}.
\end{equation}

Adding
\begin{equation}
p_i \coloneqq \frpa{L^\text{v}}{v_i}.% \eqqcolon \rfun{\ol{p}_i}{q,v}.
\end{equation}
Variation of
\begin{equation}
\sfun{S}{q, p; v} \coloneqq \int\dd t\,\sbr{L^\text{v} + \sum_i
p_i\rbr{\dot{q}_i - v_i}}.
\end{equation}
gives the \emph{Euler--Lagrange equations with velocities}
\begin{equation}
\dot{q}_i = v_i,\quad
\dot{p}_i = \frpa{L^\text{v}}{q_i},\quad
p_i = \frpa{L^\text{v}}{v_i}.
\end{equation}

Hamiltonian with velocity
\begin{equation}
\rfun{H^\text{v}}{q, p; v} \coloneqq \sum_i p_i v_i - L^\text{v}.
\end{equation}
Identities
\begin{equation}
\frpa{H^\text{v}}{q_i} \equiv - \frpa{L^\text{v}}{q_i},\quad
\frpa{H^\text{v}}{p_i} \equiv v_i,\quad
\frpa{H^\text{v}}{v_i} \equiv p_i - \frpa{L^\text{v}}{v_i}.
\end{equation}
Variation of
\begin{equation}
\sfun{S}{q, p; v} \coloneqq \int\dd t\,\sbr{\sum_i
p_i \dot{q}_i - H^\text{v}}
\end{equation}
gives the \emph{canonical equations with velocities}
\begin{equation}
\dot{q}_i = \sbr{q_i, H^\text{v}}_\text{P},\quad
\dot{p}_i = \sbr{p_i, H^\text{v}}_\text{P},\quad
\frpa{H^\text{v}}{v_i} = 0,
\end{equation}
where the \emph{Poisson bracket} is defined as
\begin{equation}
\sbr{f^\text{v}, g^\text{v}}_\text{P} \coloneqq
\sum_i\rbr{\frpa{f^\text{v}}{q_i}\frpa{g^\text{v}}{p_i} -
\frpa{f^\text{v}}{p_i}\frpa{g^\text{v}}{q_i}}.
\end{equation}

$v_a = \rfun{\ol{v}_a}{q,p;\cbr{v_\alpha}}$ can be solved, $a = 1, 2, \ldots,
r_M$; $v_\alpha$
cannot be solved, $\alpha = r_M + 1, \ldots, n$, where $r_M = \rank M$.

(need to show $v_a = \rfun{\ol{v}_a}{q,p_a}$)

\emph{Primary constraints in the standard form}
\begin{equation}
\rfun{\Phi_\alpha}{q, p} \coloneqq
\fat{\frpa{H^\text{v}}{v_\alpha}}{\cbr{v_\alpha = \ol{v}_\alpha}} \equiv
p_\alpha - \rfun{\ol{p}_\alpha}{q, \cbr{p_a}},
\end{equation}
where
\begin{equation}
\rfun{\ol{p}_\alpha}{q, \cbr{p_a}}
\coloneqq \fat{\frpa{L^\text{v}}{v_\alpha}}{\cbr{v_a = \ol{v}_a}}.
\end{equation}

\emph{Hamiltonian with primary constraint}
\begin{equation}
H^\text{p} \coloneqq \fat{H^\text{v}}{\cbr{v_a = \ol{v}_a}} \equiv
\rfun{H^\text{v}}{q, p; \cbr{\rfun{\ol{v}^a}{q, p_a; \cbr{v_\alpha}},
v_\alpha}}.
\end{equation}

\emph{Subspace of primary constraints}
\begin{equation}
\Gamma_\text{P} = \cbr{ \rbr{q, p}\, |\, \rfun{\Phi_\alpha}{q, p} = 0,
\forall \alpha}
\end{equation}

Since
\begin{equation}
\frpa{H^\text{p}}{v_\alpha} =
\fat{\frpa{H^\text{v}}{v_\alpha}}{\cbr{v_a = \ol{v}_a}} = \Phi_\alpha
\equiv p_\alpha - \rfun{\ol{p}_\alpha}{q, \cbr{p_a}},
\end{equation}
$H^\text{p}$ is linear in $v_\alpha$. One writes
\begin{equation}
\rfun{H^\text{p}}{q, \cbr{p_a}; \cbr{p_\alpha}, \cbr{v_\alpha}} = \rfun{H}{q,
\cbr{p_a}} + \sum_\alpha v_\alpha \Phi_\alpha,
\end{equation}
where $H^\text{c}$ is the \emph{canonical Hamiltonian} or simply
\emph{Hamiltonian}.

\paragraph{Proposition}
$H^\text{c}$ is independent of $\cbr{p_\alpha}$.

\paragraph{Proposition}
Canonical equations with primary constraints
\begin{align}
\dot{q}_i &= \sbr{q_i, H}_\text{P} + \sum_\beta v_\beta
\sbr{q_i, \phi_\beta}_\text{P},
\label{eq:q-i-primary}\\
\dot{p}_i &= \sbr{p_i, H}_\text{P} + \sum_\beta v_\beta
\sbr{p_i, \phi_\beta}_\text{P}, \\
\rfun{\Phi_\alpha}{q, p} &= 0,
\end{align}
where $v_\beta$'s are undetermined. Note that \cref{eq:q-i-primary} for $i =
\alpha$ holds identically: $\dot{q}_\alpha = \dot{q}_\alpha$.

Weak equality: $f_1 \approx f_2$ iff $\fat{f_1}{\Gamma_\text{P}} =
\fat{f_2}{\Gamma_\text{P}}$.

\paragraph{Proposition} if $f$ and $g$ are two functions over the phase space
$\Gamma$, and $f \approx h$, then
\begin{align}
\frpa{}{q_i} \rbr{f-\sum_\beta \phi_\beta \frpa{f}{p_\beta}} &\approx
\frpa{}{q_i} \rbr{h-\sum_\beta \phi_\beta \frpa{h}{p_\beta}}, \\
\frpa{}{p_i} \rbr{f-\sum_\beta \phi_\beta \frpa{f}{p_\beta}} &\approx
\frpa{}{p_i} \rbr{h-\sum_\beta \phi_\beta \frpa{h}{p_\beta}}.
\end{align}

\paragraph{Corollary}
$\forall H_1 \approx H$,
\begin{equation}
\dot{q}_i \approx \sbr{q_i, H}_\text{P},\qquad
\dot{p}_i \approx \sbr{p_i, H}_\text{P}.
\end{equation}

Primary and second constraints $\phi^{(1,)}_\mu$, $\phi^{(2,)}_\omega$; first
and second class constraints $\phi^{(,1)}_u$, $\phi^{(,2)}_w$.

\section{Examples}

%\begin{equation}
%L^\text{v} = \frac{1}{2} \sum_{i,j}\rfun{W_{ij}}{q} v_i v_j + \sum_i
%\rfun{\eta_i}{q}
%v_i - \rfun{V}{q}.
%\end{equation}

%\begin{equation}
%p_i = \frpa{L^\text{v}}{v_i} = \sum_{i,j} W_{ij} v_j + \eta_i.
%\end{equation}

%Let
%\begin{align}
%\sum_j W_{ij} e_j^{(a)} &= \lambda^{(a)} e_i \neq 0, \\
%\sum_j W_{ij} e_j^{(\alpha)} &= 0.
%\end{align}

\subsection{Toy examples}

\subsubsection*{Example 0}
\cite[sec.\ 1.2]{Gitman1990}
\begin{equation}
L = \frac{1}{2}\rbr{\dot{x}-y}^2
\end{equation}

\subsubsection*{Example 1}
\begin{equation}
L = \frac{1}{2} \dot{x}^2 + \dot{x} y - \frac{1}{2}\rbr{x-y}^2.
\end{equation}

One has
\begin{equation}
L^\text{v} = \frac{1}{2} v_x^2 + v_x y - \frac{1}{2} \rbr{x-y}^2,
\end{equation}
so that
\begin{equation}
p_x = \frpa{L^\text{v}}{v_x} = v_x + y, \qquad p_y = 0,
\end{equation}
thus
\begin{equation}
\ol{v}_x = p_x - y.
\end{equation}
So that $v_y$ is the primary inexpressible velocity.

The Hamiltonian with velocity reads
\begin{equation}
\rfun{H^\text{v}}{q, p; v} = v_x p_x + v_y p_y - \frac{1}{2} v_x^2 - v_x y
+ \frac{1}{2}\rbr{x-y}^2,
\end{equation}
whilst the Hamiltonians are
\begin{align}
\rfun{H^\text{p}}{q, p; \ol{v}_x, v_y} &= H^\text{c} + v_y \Phi_1,\\
\rfun{H^\text{c}}{q, p} &= \frac{1}{2}\rbr{p_x - y}^2 + \frac{1}{2} \rbr{x-y}^2,
\end{align}
where the only primary constraint $\Phi_1 = p_y$.

Persistence condition of $\Phi_1$ leads to
\begin{equation}
0 \approx \sbr{\Phi_1, H^\text{p}}_\text{P} = p_x + x - 2y \eqqcolon \Phi_2.
\end{equation}
Note that $\sbr{\Phi_1, \Phi_2} = p_x - x$ does not vanish on $\Gamma$, thus
$\Phi_{1,2}$ are second-class constraints, and no more constraint can be
generated. To solve for $v_y$ one evaluates
\begin{equation}
0 \eqqcolon \sbr{\Phi_1, H^\text{p}}_\text{P} = p_x - x - 2v_y,
\end{equation}
so that $v_y \coloneqq \rbr{p_x - x}/2$ solves the constraint.

One also has
\begin{equation}
Q_{\alpha\beta} = \sbr{\Phi_\alpha, \Phi_\beta}_\text{P} =
\begin{pmatrix} 0 & +2 \\ -2 & 0 \end{pmatrix},\qquad
\rbr{Q^{-1}}_{\alpha\beta} =
\begin{pmatrix} 0 & -1/2 \\ +1/2 & 0 \end{pmatrix},
\end{equation}
so that the Dirac brackets are defined as
\begin{equation}
\sbr{f,g}_\text{D} \coloneqq \sbr{f,g}_\text{P} + \frac{1}{2}
\rbr{\sbr{f,p_y}_\text{P}\sbr{p_x+x-2y,g}_\text{P}
-\sbr{f,p_x+x-2y}_\text{P}\sbr{p_y,g}_\text{P}}.
\end{equation}
The fundamental ones different from Possion brackets are
\begin{equation}
\sbr{x,y}_\text{D} = \sbr{y,p_x}_\text{D} = \frac{1}{2},\qquad
\sbr{y,p_y}_\text{D} = 0.
\end{equation}
\textbf{Last one different from book?}

\subsubsection*{Example 2}

\begin{equation}
L = \frac{1}{2}\dot{x}^2 + \dot{x} y + \frac{1}{2}\rbr{x-y}^2
\end{equation}

Primary constraint
\begin{equation}
p_y = 0;
\end{equation}
Hamiltonian with primary constraint
\begin{equation}
H^\text{p} = \frac{1}{2}p_x^2 - p_x y - \frac{1}{2} x^2 + xy + v_y p_y.
\end{equation}

\subsection*{Example 3}

\begin{equation}
L = \frac{1}{2} \rbr{\dot{q}_2 - \ee^{q_1}}^2 + \frac{1}{2} \rbr{\dot{q}_3 -
q_2}^2.
\end{equation}

\subsection{Parametrised systems}

\subsubsection*{Non-relativistic point particle}

\cite[sec.\ 3.1.1]{Kiefer2012}
\begin{equation}
\sfun{S}{\rfun{q}{t}} \coloneqq \int_{t_1}^{t_2}\dd t\,\rfun{L}{q, \frde{q}{t}}
\end{equation}

\subsubsection*{Relativistic charged point particle}

\cite[sec.\ 16]{Landau1975},
\cite[sec.\ 3.1.2]{Kiefer2012}
\begin{equation}
S \coloneqq \int -m\,\dd s + e \rfun{A_\mu}{x} \,\dd x^\mu \eqqcolon \int\dd
\tau\, L,\\
\label{eq:point-charged-action}
\end{equation}
where the Lagrangian reads
\begin{equation}
L = -m \sqrt{-\eta_{\mu\nu} \dot{x}^\mu \dot{x}^\nu } + q \dot{x}^\mu
\rfun{A_\mu}{x}.
\end{equation}

\begin{equation}
M_{\mu\nu} \coloneqq \frpa{^2 L^\text{v}}{v^\mu\,\partial v^\nu} =
m\frac{-\eta_{\mu\nu}\eta_{\alpha\beta} + \eta_{\mu\alpha}\eta_{\nu\beta}}%
{\rbr{-\eta_{\rho\sigma}v^\rho v^\sigma}^{3/2}} v^\alpha v^\beta,
\end{equation}
which has one and only one eigenvector with null eigenvalue
\begin{equation}
v^\mu M_{\mu\nu} = 0.
\end{equation}

Momenta
\begin{equation}
p_\mu = \frpa{L^\text{v}}{v^\mu} =
\frac{m\eta_{\mu\nu}v^\nu}{\sqrt{-\eta_{\rho\sigma}v^\rho v^\sigma}} + q A_\mu.
\label{eq:point-charged-pvrel}
\end{equation}
If one chooses $v^0$ to be the primary inexpressible velocity, then eliminating
$p_0$ in \cref{eq:point-charged-pvrel} yields
\begin{equation}
v^i = \frac{\xi \eta^{ij} \rbr{p_j - q A_j} v^0}{\sqrt{m^2 + \eta^{kl}
\rbr{p_k - q A_k}\rbr{p_l - q A_l}}},
\label{eq:point-charged-pvrel0}
\end{equation}
where $\xi = \sgn v^0$. In the following $\xi = +1$ will be chosen.

Inserting \cref{eq:point-charged-pvrel0} into the Hamiltonian with velocity
\begin{equation}
H^\text{v} = v^\mu p_\mu - L^\text{v} = m\sqrt{-\eta_{\mu\nu}v^\mu v^\nu} +
v^\mu\rbr{p_\mu - q \rfun{A_\mu}{x}},
\end{equation}
one obtains the Hamiltonian with primary constraint
\begin{equation}
H^\text{p} = v^0 \rbr{p_0 - q A_0 + \sqrt{m^2 + \eta^{kl}
\rbr{p_k - q A_k}\rbr{p_l - q A_l}}},
\end{equation}
where only a primary constraint survives, which is obviously a first-class
constraint
\begin{equation}
\phi^{(1,1)} = p_0 - q A_0 + \sqrt{m^2 + \eta^{kl}
\rbr{p_k - q A_k}\rbr{p_l - q A_l}},
\end{equation}
and the canonical Hamiltonian vanishes
\begin{equation}
H^\text{c} = 0.
\end{equation}

To compare, note in the non-covariant formalism (\cite[sec.\ 8]{Landau1975})
\begin{equation}
S = \int \dd t\,L,\qquad L = -m\sqrt{1-\dot{\vec{x}}^2} - q \phi +
q \dot{\vec{x}} \cdot \vec{A},
\end{equation}
the system is regular, and the canonical Hamiltonian reads
\begin{equation}
H^\text{c} = \sqrt{m^2 + \rbr{\vec{p}-q\vec{A}}^2} + q\phi,
\end{equation}
which corresponds to setting $\phi^{(1,1)} = 0$, $p_0 \to -H^\text{c}$
($p_\mu = \rbr{-E, \vec{p}}$), and noting $A_\mu = \rbr{-\phi, \vec{A}}$.

\subsubsection*{Relativistic point particle with einbein}

\cite[sec.\ 2.1]{Blumenhagen2013}
\begin{equation}
L \coloneqq \frac{1}{2} \rbr{e^{-1}\eta_{\mu\nu}\dot{x}^\mu \dot{x}^\nu - m^2 e}
\label{eq:point-aux-lagrangian}
\end{equation}

\begin{equation}
p_\mu = \frpa{L^\text{v}}{v^\mu} = e^{-1}\eta_{\mu\nu}v^\nu, \qquad
p_e = 0.
\end{equation}
Choosing $v^e$ to be the primary inexpressible velocity, one has
\begin{equation}
v^\mu = e\eta^{\mu\nu}p_\nu.
\end{equation}

Hamiltonian with velocity
\begin{equation}
H^\text{v} = v^\mu p_\mu + v^e p_e + \frac{1}{2} \rbr{-e^{-1} \eta_{\mu\nu}
v^\mu v^\nu + m^2 e};
\end{equation}
Hamiltonian with primary constraint
\begin{equation}
H^\text{p} = \frac{e}{2} \rbr{\eta^{\mu\nu}p_\mu p_\nu + m^2} + v^e p_e;
\end{equation}
canonical Hamiltonian
\begin{equation}
H^\text{c} = \frac{e}{2} \rbr{\eta^{\mu\nu}p_\mu p_\nu + m^2}.
\end{equation}

The only primary constraint
\begin{equation}
\Phi^{(1,)} = p_e;
\end{equation}
its time evolution
\begin{align}
\sbr{\Phi^{(1,)}, H^\text{p}}_\text{P} &=
\sbr{p_e, e}_\text{P}\frac{1}{2}\rbr{\eta^{\mu\nu}p_\mu p_\nu + m^2}
\nonumber \\
&= -\frac{1}{2}\rbr{\eta^{\mu\nu}p_\mu p_\nu + m^2}.
\end{align}
Choose
\begin{equation}
\Phi^{(2,)} = \eta^{\mu\nu}p_\mu p_\nu + m^2,
\end{equation}
whose Possion bracket with $H^\text{p}$ vanishes; furthermore,
\begin{equation}
\sbr{\Phi^{(1,)},\Phi^{(2,)}}_\text{P} \equiv 0.
\end{equation}
Thus one ends up with two first-class constraints.

\subsubsection{Neutral scalar field}
\cite[sec.\ 3.3]{Kiefer2012}

\subsection{Maxwell--Proca theory}

\begin{equation}
\Ld = -\frac{1}{4} F_{\mu\nu} F^{\mu\nu} - \frac{1}{2} m^2 A_\mu A^\mu
+ A_\mu J^\mu,
\end{equation}
where $m > 0$ corresponds to the Proca theory \cite[sec.\ 2.3]{Gitman1990}, and
$m = 0$ the Maxwell theory \cite[sec.\ 3.3.3]{Rothe2010}, \cite[sec.\
2.4]{Gitman1990}.

Lagrangian density with velocity
\begin{equation}
\Ld^\text{v} = \frac{1}{2} \rbr{V_i - \partial_i A_0}^2 - \frac{1}{4} F_{ij}^2
+ \frac{m^2}{2} \rbr{A_0^2 - A_i^2} + A_0 J^0 + A_i J^i;
\end{equation}
momenta density
\begin{equation}
B^0 \coloneqq \frpa{\Ld^\text{v}}{V_0} = 0,\qquad
B^i \coloneqq \frpa{\Ld^\text{v}}{V_i} = V^i - \partial^i A_0;
\end{equation}
Hamiltonians
\begin{align}
\mscrH^\text{p} &= \mscrH^\text{c} + V_0 \Phi_1,\\
\mscrH^\text{c} &= \frac{1}{2} \rbr{B^i}^2 + B^i \partial_i A_0 + \frac{1}{4}
F_{ij}^2 + \frac{m^2}{2} \rbr{-A_0^2 + A_i^2} - A_0 J^0 - A_i J^i,\\
\end{align}
where
\begin{equation}
\Phi_1 = B^0
\end{equation}
is the only primary constraint.

\begin{align}
\sbr{\rfun{\Phi_1}{\vec{x}_1},\rfun{\mscrH^\text{p}}{\vec{x}_2}}_\text{P} &=
\sbr{\rbr{B^0}_1,\rbr{B^i\partial_i A_0-\frac{m^2}{2}A_0^2-A_0 J^0}_2}_\text{P}
\nonumber \\
&= \rbr{-B^i\partial_i + m^2 A_0 - J_0}_2
\rfun{\delta}{\vec{x}_1-\vec{x}_2},
\end{align}
where $J_0 = -J^0$. Integration with $\dd^d x_2$ yields the secondary constraint
\begin{equation}
\sbr{\Phi_1, H^\text{p}}_\text{P} = \partial_i B^i + m^2 A_0 - J_0
\eqqcolon \Phi_2,
\end{equation}
so that
\begin{equation}
\sbr{\rfun{\Phi_1}{\vec{x}_1},\rfun{\Phi_2}{\vec{x}_2}}_\text{P} =
-m^2\rfun{\delta}{\vec{x}_1-\vec{x}_2}.
\label{eq:Maxwell-Proca-Q}
\end{equation}
One may further compute
\begin{equation}
\sbr{\rfun{\Phi_2}{\vec{x}_1}, \rfun{\mscrH^\text{c}}{\vec{x}_2}}_\text{P} =
\sbr{\rbr{\partial_i B^i}_1,
\rbr{\frac{1}{4} F_{jk}^2 + \frac{m^2}{2} A_j^2 - A_j J^j}_2}_\text{P},
\end{equation}
in which
\begin{align}
\sbr{\rbr{\partial_i B^i}_1, \rbr{\frac{1}{4} F_{jk}^2}_2}_\text{P} &=
\rbr{\partial_j A_k - \partial_k A_j}_2 \rbr{\partial_i}_1
\sbr{\rbr{B^i}_1, \rbr{\partial^j A^k}_2}_\text{P} \nonumber \\
&= -\rbr{F^{ij} \partial_j}_2 \rbr{\partial_i}_1
\rfun{\delta}{\vec{x}_1-\vec{x}_2}.
\end{align}
The Poisson bracket can be evaluated to be
\begin{equation}
\sbr{\rfun{\Phi_2}{\vec{x}_1}, \rfun{\mscrH^\text{c}}{\vec{x}_2}}_\text{P} =
-\rbr{F^{ij} \partial_j + m^2 A^i + J^i}_2 \rbr{\partial_i}_1
\rfun{\delta}{\vec{x}_1-\vec{x}_2}.
\end{equation}
Integration with $\dd^3 x_2$ yields
\begin{equation}
\sbr{\Phi_2, H^\text{c}}_\text{P} = -\partial_i\rbr{m^2 A^i + J^i}.
\end{equation}

For Proca theory $m > 0$ , then the algorithm terminates, and one obtains a
pure second-class system.
\begin{equation}
\mbfQ = \begin{pmatrix}0 & -m^2 \\ +m^2 & 0\end{pmatrix},
\qquad
\mbfQ^{-1} = \begin{pmatrix}0 & +m^{-2} \\ -m^{-2} & 0\end{pmatrix}.
\end{equation}
Dirac bracket
\begin{equation}
\begin{split}
&\phantom{}
\sbr{\rfun{f}{\vec{x}_1},\rfun{g}{\vec{x}_2}}_\text{D} =
\sbr{\rbr{f}_1, \rbr{g}_2}_\text{P} + \int \dd^d x_3 \\
\Bigl(&- \sbr{\rbr{f}_1, \rbr{B^0}_3}_\text{P}
\sbr{\rbr{m^{-2}\partial_i B^i + A_0}_3, \rbr{g}_2}_\text{P} \\
&+ \sbr{\rbr{f}_1, \rbr{m^{-2}\partial_i B^i + A_0}_3}_\text{P}
\sbr{\rbr{B^0}_3, \rbr{g}_2}_\text{P} \Bigr).
\end{split}
\end{equation}
The fundamental ones different from Poisson brackets are
\begin{equation}
\sbr{\rfun{A_0}{\vec{x}_1},\rfun{A_i}{\vec{x}_2}}_\text{D} =
m^{-2} \rbr{\partial_i}_1 \rfun{\delta}{\vec{x}_1 - \vec{x}_2},\qquad
\sbr{\rfun{A_0}{\vec{x}_1},\rfun{B^0}{\vec{x}_2}}_\text{D} = 0.
\end{equation}

Introducing the regularising coordinates
\begin{alignat}{3}
\alpha_i &= A_i + m^{-2}\rbr{\partial_i B^0 - J_i},&\qquad \beta^i &= B^i; \\
\alpha_0 &= A_0 + m^{-2}\rbr{\partial_i B^i - J_0},&\qquad \beta^0 &= B^0.
\end{alignat}
Note that $J^i = J_i$. It is easy to show that
\begin{align}
\sbr{\rfun{\alpha_i}{\vec{x}_1},\rfun{\beta^j}{\vec{x}_2}}_\text{D} &=
\delta^i_j\rfun{\delta}{\vec{x}_1,\vec{x}_2},\\
\sbr{\rfun{\alpha_i}{\vec{x}_1},\rfun{\alpha_j}{\vec{x}_2}}_\text{D} &= 0 =
\sbr{\rfun{\beta^i}{\vec{x}_1},\rfun{\beta^j}{\vec{x}_2}}_\text{D}.
\end{align}
Furthermore, one has
\begin{equation}
\mscrH^\text{p} = \mscrH^\text{phy}+\mscrH^\text{con}+\mscrH^\text{irr},
\end{equation}
where
\begin{align}
\begin{split}
\mscrH^\text{phy} &= \frac{1}{2}\rbr{\beta^i}^2 + \frac{m^2}{2}\alpha_i^2 +
\frac{1}{4}\rbr{\partial_i \alpha_j - \partial_j \alpha_i}^2 +
\frac{1}{2m^2}\rbr{\partial_i \beta^i}^2 \\
&\quad +\frac{1}{m^2} J^0 \partial_i \beta^i,
\end{split}\\
\mscrH^\text{con} &= -\frac{m^2}{2}\alpha_0^2 - \frac{1}{2m^2}
\rbr{\partial_i \beta^0}^2,\\
\begin{split}
\mscrH^\text{irr} &= \partial_i\rbr{\alpha_0\beta^i - \beta^0\alpha_i +
\frac{1}{m^2}\rbr{\beta^0\partial_i\beta^0 -
\beta^i\partial_j\beta^j - J^0 \beta^i}} \\
&\quad + \frac{1}{2m^2}\rbr{\rbr{J^0}^2 - \rbr{J^i}^2}.
\end{split}
\end{align}
Further more,
\begin{equation}
\Phi_1 = \beta^0,\qquad\Phi_2 = m^2\alpha_0 \propto \alpha_0.
\end{equation}
Thus the $\rbr{\alpha_i, \beta^i}$ are regular pairs of canonical variables,
whereas $\rbr{\alpha_0, \beta^0}$ are the singular variables as constraints.
The canonical dynamics of the physical $\rbr{\alpha_i, \beta^i}$'s are
determined by $\mscrH^\text{phy}$ as a regular system.

\textbf{Should one compute $\mscrH^\text{a}$ here?}

For Maxwell theory $m = 0$.

%\subsection{Dirac field}

%\subsection{Gauge theories}

%\subsubsection{Spinor electrodynamics}

%\subsubsection{Yang--Mills theory}

%\subsubsection{Yang--Mills--Higgs theory}

\subsection{String theories}

\subsubsection*{Nambu--Gotō action}

Generalising the kinetic part of \eqref{eq:point-charged-action}, one has
\begin{equation}
S_\text{NG} \coloneqq -T \int_\Sigma \dd A
\eqqcolon -T \int_\Sigma\dd^2\sigma \Ld,
\end{equation}
where the Lagrangian density
\begin{equation}
\Ld = \sqrt{-\Gamma},\quad
\Gamma \coloneqq \det \Gamma_{\alpha\beta},\quad
\Gamma_{\alpha\beta} \coloneqq \frpa{X^\nu}{\sigma^\alpha}
\frpa{X_\nu}{\sigma^\alpha}.
\end{equation}

Historically \cite{Nambu1970,Goto1971}; Reference e.g.\
\cite{Blumenhagen2013}
\cite[sec.\ 3.2]{Kiefer2012}

\subsubsection*{Polyakov action}

Generalising \eqref{eq:point-aux-lagrangian}
\begin{equation}
\sfun{S_\text{P}}{X^\mu, h_{\alpha\beta}} = -\frac{T}{2}\int_\Sigma \Ld,
\end{equation}
where
\begin{equation}
\Ld \coloneqq \sqrt{-h} h^{\alpha\beta}\Gamma_{\alpha\beta}.
\end{equation}

Historically \cite{Brink1976,Deser1976,Polyakov1981};
Reference
\cite[sec.\ 3.2]{Kiefer2012}

\subsection{Gravitation theories}

\subsubsection*{Closed Friedmann universe}
This part adapts \cite[sec.\ 8.1.2]{Kiefer2012}.

The total action reads
\begin{equation}
S \coloneqq S_\text{EG} + S_\phi,
\end{equation}
where $S_\text{EG}$ follows \eqref{eq:action-einstein-gravity}, and
\begin{equation}
S_\phi \coloneqq \int_\mscrM\dd^4 x\, \sqrt{-g}\,
\rbr{-\frac{1}{2} g^{\mu\nu} \rbr{\nabla_\mu\phi} \rbr{\nabla_\nu\phi}
-m^2\phi^2}.
\end{equation}

Adapting
\begin{equation}
\dd s^2 = -\rfun{N^2}{t}\,\dd t^2 + \rfun{a^2}{t}\,\dd\Omega_3^2,
\end{equation}
where
\begin{equation}
\d\Omega_3^2 = \dd\chi^2+\sin^2\chi\,\rbr{\dd\theta^2+\sin^2\theta\,\dd\phi^2}.
\end{equation}
One has
\begin{equation}
\sqrt{-g} = N a^3 \sin^2\chi\,\sin\theta,\qquad
\sqrt{h} = a^3\sin^2\chi\,\sin\theta;
\end{equation}
whereas
\begin{equation}
R = \frac{6}{N^2}\rbr{-\frac{\dot{N}\dot{a}}{Na} + \frac{\ddot{a}}{a} +
\rbr{\frac{\dot{a}}{a}}^2} + \frac{6}{a^2},\qquad
K = \frac{3\dot{a}}{Na}.
\end{equation}

\begin{equation}
S_\text{EG} = \frac{A_3}{16\pp\nG} \rbr{\int_{t_1}^{t_2} \dd t
Na^3\rbr{R - 2\Lambda} - \sbr{\frac{6\dot{a}a^2}{N}}_{t_1}^{t_2}},
\end{equation}
where
\begin{equation}
A_3 = \int \sin^2\chi\,\sin\theta\,\dd\chi\,\dd\theta\,\dd\phi = 2\pp^2.
\end{equation}
The term proportional to $\ddot{a}/a$ in the integrand can be integrated by
parts
\begin{equation}
\int_{t_1}^{t_2} \dd t\,Na^3 \frac{6}{N^2} \frac{\ddot{a}}{a}
= 6\rbr{\sbr{\frac{\dot{a}a^2}{N}}_{t_1}^{t_2} - \int_{t_1}^{t_2}\dd t
\,\dot{a}\frde{}{t}\frac{a^2}{N^2}},
\end{equation}
in which the first term cancels the Gibbons--Hawking--York term. One has
\begin{equation}
S_\text{EG} = \frac{3\pp}{4\nG}\int_{t_1}^{t_2} \dd t\,
\rbr{-\frac{a}{N}\dot{a}^2 + N a - \frac{\Lambda}{3}N a^3}.
\end{equation}

The matter part of the action reads
\begin{equation}
S_\phi = \pp^2 \int_{t_1}^{t_2}\dd t\,
a^3 \rbr{\frac{1}{N}\dot{\phi}^2 - m^2N\phi^2}.
\end{equation}

Lagrangian with velocity
\begin{equation}
L^\text{v} = \frac{3\pp}{4\nG}\rbr{-\frac{a}{N} {v^a}^2 + Na -
\frac{\Lambda}{3} Na^3} + \pp^2 a^3 \rbr{\frac{1}{N}{v^\phi}^2 - m^2 N
\phi^2}.
\end{equation}
Canonical momenta
\begin{equation}
p_N \coloneqq \frpa{L^\text{v}}{v^N} = 0,\quad
p_a \coloneqq \frpa{L^\text{v}}{v^a} = -\frac{3\pp}{2\nG} \frac{a}{N} v^a,\quad
p_\phi \coloneqq \frpa{L^\text{v}}{v^\phi} = 2\pp^2 \frac{a^3}{N} v^\phi.
\end{equation}
Choosing $v^N$ to be the primary inexpressible velocity, one obtains
\begin{align}
H^\text{p} &= -N H_\perp + v^N \Phi, \\
H^\text{c} &= -N H_\perp,
\end{align}
where
\begin{align}
H_\perp &\coloneqq \frac{\nG}{3\pp} \frac{p_a^2}{a}  - \frac{1}{4\pp^2}
\frac{p_\phi^2}{a^3}  - \frac{3\pp}{4\nG}\rbr{\frac{\Lambda}{3}a^2 - 1}a
- \pp^2 m^2 a^3 \phi^2, \\
\Phi &= p_N
\end{align}
are the \emph{Hamiltonian constraint} and the primary constraint, respectively.

Evaluating the time evolution of $\Phi$ yields
\begin{equation}
\sbr{\Phi,H^t}_\text{P} = H_\perp,
\end{equation}
so that the Hamiltonian constraint is indeed a constraint. There is no further
constraint, and $\sbr{\Phi, H_\perp}_\text{P}$ vanishes identically. Therefore
there are two and only two first-class constraints.

\subsubsection{Einstein--Hilbert action}

\begin{equation}
S_\text{EG} = S_\text{EH} + S_\text{GHY},
\label{eq:action-einstein-gravity}
\end{equation}
\begin{equation}
S_\text{EH} = \frac{1}{16\pp\nG}\int_\mscrM\dd^4 x\,\sqrt{-g}
\rbr{R-2\mitLambda},
\end{equation}
and
\begin{equation}
S_\text{GHY} = -\frac{1}{8\pp\nG}\int_{\partial\mscrM}\dd^3 x\,\sqrt{h} K,
\end{equation}
which is named after \cite{Gibbons1977,York1972} but actually already mentioned
in \cite{Einstein1916}. See \cite{Dyer2009} for a brief review.

\printbibliography

\end{document}