Optimal Control for Structurally Sparse Systems using Graphical Inference

Abstract: Dynamical systems with a distributed yet interconnected structure, like multi-rigid-body robots or large-scale multi-agent systems, introduce valuable sparsity into the system dynamics that can be exploited in an optimal control setting for speeding up computation and improving numerical conditioning. Conventional approaches for solving the Optimal Control Problem (OCP) rarely capitalize on such structural sparsity, and hence suffer from a cubic computational complexity growth as the dimensionality of the system scales. In this paper, we present an OCP formulation that relies on graphical models to capture the sparsely-interconnected nature of the system dynamics. Such a representational choice allows the use of contemporary graphical inference algorithms that enable our solver to achieve a linear time complexity in the state and control dimensions as well as the time horizon. We demonstrate the numerical and computational advantages of our approach on a canonical dynamical system in simulation.

\section{Introduction} \label{intro}

\input{sections/sec_introduction.tex}

\section{Related Work}
\input{sections/sec_relatedwork.tex}

\section{Problem Formulation}
\input{sections/sec_problem.tex}

\section{Technical Approach}
\input{sections/sec_technical.tex}

\section{Results}
In this section, we evaluate SGOPT and present a comparison with conventional LQR methods. Most of the analysis is presented for the linear example of stabilization about the unstable equilibrium, except for the last section which addresses extensions for solving the nonlinear swing-up problem. SGOPT is implemented using the GTSAM \cite{dellaert2012factor} library in C++. The first step is to validate the SGOPT solution by comparing it with the baselines on a relatively small-scale problem. Next, we scale the system dimensionality to demonstrate superior runtimes and numerical conditioning as compared to the conventional LQR solvers.
\subsection{Implementation Details}
We benchmark our results with two baseline methods. The first is the C++ based LQR solver in the Control Toolbox library \cite{adrlCT}. The second is our independent DP implementation of LQR in C++ that relies on column-pivot Householder QR factorization implementation in the Eigen library \cite{eigenweb} for solving the Riccati equations at each time step. The parameters used in our experiments are
$m_c=1kg$, $m_p=0.2kg$, $\ell=0.5m$, $Q_X=Q_\theta=10I_{2\times2}$, $Q_{f_X}=Q_{f_\theta}=3000I_{2\times2}$, $Q_U=0.01$, $\Delta t=0.05s$, $k_{spring}=1000\frac{N}{m}$, $c_{damping}=1\frac{Ns}{m}$.

\subsection{Validation Analysis}
We first compare the three methods on a relatively small-scale problem to validate the solution equivalence of SGOPT to conventional LQR solvers. We consider the example of a 3-CP system with two actuated carts and extract the time response for 150 time-steps given an initial perturbation offset of $\theta_0 = 1.15$ deg from vertical for all pendulums. Runtime and total cost are tabulated in Table \ref{tab:lqr_timing}, while Fig \ref{fig:time_resp} plots the time-response. We observe very similar cost and time responses from all solvers, while the runtime for SGOPT is around 3x slower. This is because the GTSAM backend implementation for constrained QR factorization is currently un-optimized, and hence adds a compute overhead for smaller systems. However, as we will demonstrate in the next section, this overhead becomes insignificant as the system scales due to linear vs cubic complexity.

\begin{figure}
  \centering
  \includegraphics[width=0.42\textwidth]{validation.png}
  \caption{\footnotesize{(Top) $\theta$ trajectory of the pendulum on the underactuated cart; (Bottom) Control trajectory for the first actuated cart.}}
  \label{fig:time_resp}
\end{figure}

\begin{table}[ht!]
  \begin{center}
    \caption{Time-response results}
    \begin{tabular}{lcr}
        \toprule
        \textbf{Method} & \textbf{Cost} & \textbf{Run-time (s)}\\
        \midrule
        SGOPT & 2011.26 & 0.0687 \\
        Control Toolbox & 2011.26 & 0.0226 \\
        C++ LQR & 2011.29 & 0.0252 \\
        \bottomrule
    \end{tabular}
    \label{tab:lqr_timing}
  \end{center}
\end{table}

\subsection{Runtime and Cost Analysis}
In this section, we demonstrate linear growth in runtime for SGOPT as the state and control dimensions scale when compared to the benchmark DP solvers, for a structurally sparse system. Additionally, we can also observe superior numerical conditioning compared to the DP approach as the dynamical system becomes more complex, which manifests in lower total cost solutions. This is due to the VE procedure resulting in far simpler local inversions on sub-matrices as opposed to dense inversions on large matrices at each DP step.

The top part of Fig \ref{fig:scalability} shows runtime and cost as we scale the number of carts while keeping actuation ratio ($\rho$) constant at 0.25. It is evident that OCP solutions using DP approaches face a computational bottleneck in the state dimensionality, which is not the case with SGOPT. The bottom part of Fig \ref{fig:scalability} similarly looks at varying $\rho$ for $N$ held at 30 over 10 time-steps, and here too we can observe slower growth in runtime as control dimension increases compared to DP solvers.

\begin{figure}
\centering
\begin{subfigure}{.24\textwidth}
  \centering
  \includegraphics[width=1.05\linewidth, trim={0.2cm 0.1cm 0.2cm 0.5cm},clip]{scalability_cost.png}
  \label{fig:sub1}
\end{subfigure}%
\hfill
\begin{subfigure}{.24\textwidth}
  \centering
  \includegraphics[width=1.05\linewidth, trim={0.2cm 0.1cm 0.2cm 0.5cm},clip]{scalability_runtime.png}
  \label{fig:sub2}
\end{subfigure}%
\vspace{-0.2cm}
\begin{subfigure}{.24\textwidth}
  \centering
  \includegraphics[width=1.05\linewidth, trim={0.2cm 0.1cm 0.2cm 0.5cm},clip]{figs/underactuation_cost.png}
\end{subfigure}%
\hfill
\begin{subfigure}{.24\textwidth}
  \centering
  \includegraphics[width=1.05\linewidth, trim={0.2cm 0.1cm 0.2cm 0.5cm},clip]{figs/underactuation_runtime.png}
\end{subfigure}
\caption{ \footnotesize{Runtime and Cost comparison for $T$=10 steps as $N$ scales for constant $\rho$ = 0.25 (top); as $\rho$ scales for constant $N$=30 (bottom)}}
\label{fig:scalability}
\end{figure}

\subsection{Extension to Nonlinear Swing Up}
For solving the swing-up problem, we iteratively solve SGOPT by linearizing about a trajectory (starting with an initial guess) until convergence, similar to standard iterative optimization methods such as SQP \cite{gill2005snopt} and DDP \cite{mayne1973differential}. The inner linear optimization is solved using SGOPT and outer loop is governed by the Levenberg-Marquardt algorithm for regularization.

Results are presented for iterative-SGOPT solving the swing-up problem for $N=5$, and $M=2$ starting from stable equilibrium, with a time-response shown in Fig. \ref{fig:swingup}. A comparison with benchmark solvers is not as straightforward in the nonlinear case since there are multiple factors governing convergence speed, regularization, behavior around local minima, etc. Preliminary results from iterative-SGOPT are displayed here as a demonstration of solver capability, while the rigorous characterization and comparison with benchmark solvers is left for future work.

\vspace{-0.2cm}

\begin{figure}
  \centering
  \includegraphics[width=0.4\textwidth, trim={0.5cm 0 0.5cm 0},clip]{figs/nonlinear2.png}
  \caption{\footnotesize{Angles of the 5 pendulums (top) and forces applied by the 2 actuators (bottom) over time for the swing-up solution. Cost = 34719, Run time = 6.15s, Time horizon = 50 steps, Iterations till convergence = 38.}}
  \label{fig:swingup}
\end{figure}

\section{Conclusion}
In this paper we proposed an intuitive modeling paradigm that uses factor graphs to capture the structural sparsity pattern of the OCP for multi-rigid-body systems. We also presented the Variable Elimination algorithm, that capitalizes on sparsity in the factor graph to compute efficient and scalable solutions to the OCP. We utilized the N-cartpole system as a canonical example to demonstrate the inner workings of the modeling and inference, for which we presented benchmark experiments to validate the effectiveness of our approach. Our approach can be extended to control more complicated nonlinear multi-rigid-body systems.

\addtolength{\textheight}{-12cm}

\medskip

\bibliographystyle{unsrt}

\subsection{Optimal Control Problem}

As per the standard formulation, the cost function to be minimized is given by
\begin{equation}\label{ocp}
\begin{aligned}
\min_{X,U} \quad &X_{T-1}^T Q_{X_f} X_{T-1} + \sum_{i=0}^{T-2}{X_i^T Q_X X_i + U_i^T Q_U U_i}\\
\textrm{s.t.} \quad & X_{i+1} = f(X_i, U_i)\\
\end{aligned}
\end{equation}

\vspace{0.1cm}

Where $X_i \in \mathbb{R}^{N_s}$, $U_i \in \mathbb{R}^{M}$, and $T$ are the state, controls, and time horizon respectively. $Q_X, Q_U, Q_{X_f}$ are weights in the form of diagonal matrices. This problem can be solved with conventional FHDT-LQR, which has a computational complexity of $O(T(N_s+M)^3)$ \cite{boyd2004convex}.

To improve computational efficiency, we leverage the structural sparsity inherent in the system dynamics. Most practical robots consist of rigid links, whose relative poses constitute the state, and connecting joints impose constraints that are explicitly or implicitly described by the system dynamics $f$. Fig. \ref{fig:sparsity} illustrates the sparsity pattern among links and joints of a planar robot. Instead of explicitly constructing this pattern matrix, we use the factor graph to keep track of the sparsity.

 In this paper, we present our approach and results on a structurally-sparse canonical system of $N$ identical Cart-Pole (CP) systems in a series, with each cart linked to its neighbor by spring-damper connections. Since the cartpole system is canonical example in control theory, the method we derived on it can generalize to other systems.
 The number ($M$) and order of actuated carts is a user input, but unless otherwise specified they are assumed to be evenly distributed in the CP series according to an actuation ratio $\rho$, where $M=round(\rho N)$. Most of our analysis focuses on linear systems, hence the CP series system is linearized about unstable equilibrium (all pendulums upright). The cost function for this system over $T$ time steps is:

  \begin{equation}\label{pend_ocp}
\begin{footnotesize}
\begin{aligned}
\min_{X,\theta,U} &\quad \left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c c} X_{T-1}^T & \theta_{T-1}^T \end{array} \right]^T
\left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c c} Q_{X_f} & 0 \\ 0 & Q_{\theta_f} \end{array} \right]
\left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c c} X_{T-1}^T & \theta_{T-1}^T \end{array} \right] + ... \\
& \hspace{10pt} \sum_{i=0}^{T-2}{ \{
\left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c c} X_i^T & \theta_i^T \end{array} \right]^T
\left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c c} Q_{X} & 0 \\ 0 & Q_{\theta} \end{array} \right]
\left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c c} X_i^T & \theta_i^T \end{array} \right]
+ U_i^T Q_U U_i \} }\\
\textrm{s.t.} & \quad \left[ \arraycolsep=1.0pt\def1.5{1.0} \begin{array}{c} X_{i+1} \\ \theta_{i+1} \end{array} \right] = f(X_i, \theta_i, U_i)\\
\end{aligned}
\end{footnotesize}
\end{equation}
\vspace{0.1cm}

Where, $X_i \in  \rm I\!R^{2N x 1}$ denotes position and velocities of the carts, $\theta_i \in  \rm I\!R^{2N x 1}$ denotes angles and angular velocities of the carts, $U_i \in  \rm I\!R^{M x 1}$ denotes forces on actuated carts. When we look at the CFG construction in the next section, we will take subsets from $X_i$, $\theta_i$, $U_i$, and $f$ to describe local state transitions between one-hop neighbors.

\subsection{Constrained Factor Graph}
In this section, we transform the OCP for the N-CP system into a CFG. The transformation is similar to that described in \cite{yang2020equality}. In this work, we further subdivide the states and controls of the dynamical system into factor graph nodes instead of treating the full state as one single node.

A factor graph can be interpreted in different views. In robot state estimation \cite{Kaess-2017-106169}, it is commonly viewed as a joint probability distribution over a set of variables. Solving a factor graph inference means finding the Maximum A-Posteriori (MAP) distribution of variables. The factor graph data structure makes it easy to calculate marginalized conditional probabilities of variables. In another view, a factor graph is just a sparse weighted least square problem \cite{yang2020equality}, where graph nodes are decision variables and graph edges form the matrix for the least square problem.

In this paper we will take the weighted least square view since it is easier to draw connections to sparse matrix factorization. A weighted least square problem can be formulated as
\begin{align}
    \min_{Y} \ (FY-g)^TW(FY-g) \label{eqn:wls}
\end{align}
where $W=\text{diag}(w_1,w_2,\dots)$ is a diagonal matrix with non-negative weights. Alternatively we can write the problem as $\norm{FY - g}^2_{\bf{\Sigma}}$ using Mahalanobis norm in which $\Sigma=W^{-1}$. The matrices $F$, $g$ and $W$ can be encoded in factor graph form as shown in Fig \ref{fig:key_figure}. If some weights in $W$ are infinity, then the problem becomes a constrained weighted least square, and the corresponding graph is a constrained factor graph.

Nodes of a factor graph contain either the physical state of a rigid link or a control force input. We denote $X_j^{i} \in  \rm I\!R^{2 x 1}$ as the position and velocity of the cart and $\theta_j^i \in  \rm I\!R^{2 x 1}$ as the angle and angular velocity of the pendulum in CP $j$. $U_j^{i} \in  \rm I\!R$ refers to the $j$th force acting on the associated cart. We define $X_i = vec(X_0^{i}\ X_1^{i}\ X_2^{i} \dots)$ and $U_i = vec(U_0^{i}\ U_1^{i} \dots)$, where $vec$ stacks vectors vertically. We write the value of all nodes in the graph as $Y_i=vec(X_i,U_i)$. For time step $i$, we lay down nodes as shown in the Mid part of Fig. \ref{fig:fg_viz}, where the location of nodes align with the topology of the actual system.

The edges, or factors, in a factor graph represent either unconstrained factors (finite weight) or constrained ones (infinite weight). The cost function from Eqn \ref{pend_ocp} is represented in the factor graph as unconstrained unary factors connected to the respective variables. For a  diagonal $Q_X$ matrix, we define a cost factor $\norm{Q_X^{\frac{1}{2}} X_j^i}^2_\Sigma$ where $\Sigma = I$. The factor occupies one block row of $F$ and $g$ with $Q_X^{\frac{1}{2}}$ located at the colum corresponding to variable $X_j^i$ in $F$. Similarly, we can define cost factors for $\theta_j^i$ and $U_j^i$. In our example graph in Fig \ref{fig:fg_viz} \textit{Bottom}, we have $N$=3 , $M$=1 acting on the first cart, and $T=2$. After linearizing about current operating state, the expressions for constrained factors labeled \textit{C1} and \textit{C2} are:

\begin{equation} \label{c1_c2}
\resizebox{.44 \textwidth}{!}
{
$
\begin{aligned}
&C1: \ \norm{ \theta^2_2 - A_{\theta\_\theta}\theta^1_2 - A_{\theta\_X} X^1_2 - A_{\theta\_nbX} X^1_1  }^2_{\Sigma_0}  \\
&C2: \ \norm{X^2_0 - A_{X\_X}X^1_0 - A_{X\_nbX}X^1_1 - A_{X\_\theta}\theta^1_0 - B_X U^1_0 }^2_{\Sigma_0}
\end{aligned}
$
}
\end{equation}

\vspace{0.2cm}

Where $\Sigma_0=\mathbf{0}$ (infinite weight). Here $A_{\alpha\_\beta}$ with $\alpha, \beta \in \{X,\theta\}$   represents the local linear discrete dynamics state matrix from node type $\beta$ to node type $\alpha$ (at next time-step). Similarly $A_{\alpha\_nb\beta}$ represents the state matrix from $\beta$ to $\alpha$ for neighboring CPs. $B_\alpha$ is the input matrix for node type $\alpha$ due to actuator force. For example: \vspace{0.3cm}

$A_{\theta\_nbX} = \left[ \arraycolsep=1.0pt\def1.5{1.0}
\begin{array}{c c}
\frac{k \Delta t^2}{2 m_c L}  & \frac{c \Delta t^2}{2m_cL} \\
\frac{k\Delta t}{m_c L} & \frac{c \Delta t}{m_c L} \end{array} \right],
A_{X\_nb\theta} = \left[  \arraycolsep=1.0pt\def1.5{1.0}
\begin{array}{c c}
\frac{m_p g \Delta t^2}{2 m_c}  & 0 \\
\frac{m_p g \Delta t}{m_c} & 0 \end{array} \right]$

\vspace{0.3cm}

Where $k,c$ are spring-damper properties, $m_c,m_p$ are cart and pendulum masses respectively, $L$ is pendulum length, $\Delta t$ is the time discretization.

A complete representation in both factor graph form  and matrix form for the N-CP system is shown in Fig. \ref{fig:key_figure}. The matrix $F$ is visibly sparse, and the sparsity pattern is explicitly captured in the factor graph structure. While we present a specific example of a N-CP system, this methodology can be just as easily applied to any multi-rigid-body system.

\subsection{Variable Elimination on CFG}\label{ve_details}
The VE algorithm visits nodes in the factor graph following an \textit{elimination order} and updates different parts of $F$ and $g$ in Eq. \ref{eqn:wls}. After each node is visited once, $F$ will be converted into a sparse upper triangular matrix so $Y$ can be calculated in linear time. For the sake of demonstration, we choose an intuitive ordering of the variable elimination (cart node\textrightarrow pendulum node\textrightarrow control node) backwards in time from $t=T-1$ to $t=0$. This ordering is easy to follow, and makes it possible to extract Markovian feedback policies along with the optimized controls. Section \ref{ordering} will treat the choice of variable ordering further. The square factors in Fig \ref{fig:ve_1} represent hard-constrained factors, while circular factors represent unconstrained factors with a weight $W=\Sigma^{-1}$.

For each variable $Y_k$ in the elimination order, we construct a local sub-problem. We first identify the separator $S_k$: the set of other nodes sharing factors with $Y_k$. We then extract sub-matrices $F_k$, $W_k$, $g_k$ that are blocks of $F$, $g$, $W$ corresponding to the node variable and its separator. These matrices form a local least-squares problem, which is solved using a Modified Gram Schmidt (MGS) orthogonalization \cite{gulliksson1995modified} in the presence of hard-constrained factors ($\Sigma = \mathbf{0}$) and standard unconstrained QR Factorization otherwise. For the sake of visual clarity, only selected factors and arrows are shown in Figs \ref{fig:ve_1}-\ref{fig:ve_3}.

\textbf{Eliminate a cart node $X_0^2$:} Node $X_0^2$ has a cost factor and constraint factor highlighted in red, with the separator containing $\{X_0^1, X_1^1, \theta_0^1, U_0^1\}$.Eqn \ref{ve_1_eqn} shows the local constrained least squares problem and Eqn \ref{ve_1_matrix} shows the corresponding MGS orthogonalization on $[F_k | g_k]$.
\begin{figure} [!h]
  \centering
 \includegraphics[width = 0.9\linewidth]{figs/VE_step1.png}
  \caption{\footnotesize{VE step 1 - Eliminate cart node 0 at $t=2$}}
  \label{fig:ve_1}
\end{figure}

\vspace{-0.65cm}
\begin{equation}   \label{ve_1_eqn}
\resizebox{.4 \textwidth}{!}
{
$
\begin{aligned}
&X_0^{2^*} = \argminB_{X_0^2} \textcolor{red}{(X_0^2)^T Q_X X_0^2} \\
&\textrm{s.t.} \hspace{6pt} \textcolor{red}{ X^2_0 - A_{X\_X}X^1_0 - A_{X\_nbX}X^1_1 - A_{X\_\theta}\theta^1_0 - BU^1_0 = 0} \\
&\hspace{90pt}\downarrow \\
& \color{ForestGreen}{ X^{2^*}_0 = A_{X\_X}X^1_0 + A_{X\_nbX}X^1_1 + A_{X\_\theta}\theta^1_0 + BU^1_0 }\\
& \textcolor{blue}{\phi_{X_0^2}^*(X^1_0, X^1_1, \theta^1_0, U^1_0) } = (X^{2^*}_0)^T Q_X X^{2^*}_0 \\
\end{aligned}
$
}
\end{equation}

\vspace{0.3cm}

\begin{equation}    \label{ve_1_matrix}
\resizebox{.43 \textwidth}{!} {
$
\begin{aligned}
&\begin{array} {c c c c c c}
\color{Maroon}{W_k} & \hspace{0.3cm} \color{Maroon}{X_0^2} & \hspace{0.4cm} \color{Maroon}{X_0^1} & \hspace{0.65cm} \color{Maroon}{X_1^1} & \hspace{0.8cm} \color{Maroon}{\theta_0^1} & \hspace{0.6cm} \color{Maroon}{U_0^1}
\end{array} \\
&\begin{bmatrix} I \\ \infty \\ \end{bmatrix}
\left[  \begin{array} {c c c c c | c}
Q_X^{\frac{1}{2}} & 0  & 0 & 0 & 0 & 0 \\
I & -A_{X\_X} & -A_{X\_nbX} & -A_{X\_\theta} & -B_X & 0 \\
\end{array}
\right]
\Longrightarrow \\
&\begin{bmatrix} \infty \\ I \\ \end{bmatrix}
\left[
\begin{array} {c c c c c | c}
I & -A_{X\_X} & -A_{X\_nbX} & -A_{X\_\theta} & -B_X & 0 \\
0 & Q_X^{\frac{1}{2}}A_{X\_X} & Q_X^{\frac{1}{2}}A_{X\_nbX} & Q_X^{\frac{1}{2}}A_{X\_\theta} & Q_X^{\frac{1}{2}}B_X & 0
\end{array}
\right]
\end{aligned}
$
}
\end{equation}

\vspace{0.3cm}

After orthogonalization, we add the second row of the factorized matrix in Eqn. \ref{ve_1_matrix} back into the factor graph as an unconstrained factor shown in blue in Fig. \ref{fig:ve_1}.

\textbf{Eliminate a pendulum node $\theta_0^2$:} Pendulum nodes are eliminated in a similar manner to cart nodes.

\begin{figure} [!h]
  \centering
  \includegraphics[width = 0.9\linewidth, trim={0cm 0cm 0cm -2cm},clip]{figs/VE_step2.png}
  \caption{\footnotesize{VE step 2 - Eliminate node pendulum 0 at $t=2$}}
  \label{fig:ve_2}
\end{figure}
\begin{equation}   \label{ve_2_eqn}
\resizebox{.4 \textwidth}{!}
{
$
\begin{aligned}
&\theta_0^{2^*} = \argminB_{\theta_0^2} \color{red} (\theta_0^2)^T Q_{\theta} \theta_0^2 \\
&\textrm{s.t.} \hspace{6pt} \textcolor{red}{ \theta^2_0 - A_{\theta\_\theta}\theta^1_0 - A_{\theta\_X} X^1_0 - A_{\theta\_nbX} X^1_1 -  B_{\theta} U_0^1 = 0} \\
&\hspace{90pt}\downarrow \\
& \color{ForestGreen}{ \theta^{2^*}_0 = A_{\theta\_\theta}\theta^1_0 + A_{\theta\_X} X^1_0 + A_{\theta\_nbX} X^1_1 + B_{\theta} U^1_0 }\\
& \textcolor{blue}{\phi_{\theta_0^2}^*(\theta^1_0, X^1_0, X^1_1, U^1_0)} = (\theta^{2^*}_0)^T Q_{\theta} \theta^{2^*}_0 \\
\end{aligned}
$
}
\end{equation}

\begin{equation}    \label{ve_2_matrix}
\resizebox{.43 \textwidth}{!} {
$
\begin{aligned}
\footnotesize
&\begin{array} {c c c c c c}
\color{Maroon}{W_k} & \hspace{0.3cm} \color{Maroon}{\theta_0^2} & \hspace{0.4cm} \color{Maroon}{\theta_0^1} & \hspace{0.6cm} \color{Maroon}{X_0^1} & \hspace{0.75cm} \color{Maroon}{X_1^1} & \hspace{0.5cm} \color{Maroon}{U_0^1}
\end{array} \\
\normalsize
&\begin{bmatrix} I \\ \infty \\ \end{bmatrix}
\left[  \begin{array} {c c c c c | c}
Q_\theta^{\frac{1}{2}} & 0  & 0 & 0 & 0 & 0 \\
I & -A_{\theta\_\theta} & -A_{\theta\_X} & -A_{\theta\_nbX} & -B_\theta & 0 \\
\end{array}
\right]
\Longrightarrow \\
&\begin{bmatrix} \infty \\ I \\ \end{bmatrix}
\left[
\begin{array} {c c c c c | c}
I & -A_{\theta\_\theta} & -A_{\theta\_X} & -A_{\theta\_nbX} & -B_\theta & 0 \\
0 & Q_\theta^{\frac{1}{2}}A_{\theta\_\theta} & Q_\theta^{\frac{1}{2}}A_{\theta\_X} & Q_\theta^{\frac{1}{2}}A_{\theta\_nbX} & Q_\theta^{\frac{1}{2}}B_\theta & 0
\end{array}
\right]
\end{aligned}
$
}
\end{equation}

\vspace{0.3cm}

\textbf{Eliminate a control node $U_0^2$:} Eliminating control nodes results in a local unconstrained least squares problem, since no constrained dynamics factors lie adjacent.

\begin{figure} [!h]
  \centering
  \includegraphics[width = 0.9\linewidth]{figs/VE_step3.png}
  \caption{\footnotesize{VE step 3 - Eliminate node control 0 at t = 1}}
  \label{fig:ve_3}
\end{figure}

\vspace{-0.5cm}

\begin{equation}   \label{ve_3_eqn}
\resizebox{.4 \textwidth}{!}
{
$
\begin{aligned}
&U_0^{1^*} = \argminB_{U_0^1} \{ \textcolor{red}{(U_0^1)^T Q_U U_0^1} + \textcolor{red}{\phi_{X_0^2}^*(X^1_0, X^1_1, \theta^1_0, U^1_0)} + ...\\
& \hspace{70pt} \textcolor{red}{\phi_{\theta_0^2}^*(\theta^1_0, X^1_0, X^1_1, U^1_0)} \}\\
&\hspace{90pt}\downarrow \\
& \color{ForestGreen}{ U^{1^*}_0 = -K_0^1  \left[ \begin{array}{c c c} X_0^1& X_1^1& \theta_0^1 \end{array} \right]^T }\\
&\left[ \begin{array} {c}
\textcolor{blue}{\phi_{U_\_X}^*(X^1_0, X^1_1, \theta^1_0)} \\
\textcolor{blue}{\phi_{U_\_\theta}^*(X^1_0, X^1_1, \theta^1_0)}\\
\end{array} \right] = E_0^1 \left[ \begin{array}{c c c} X_0^1& X_1^1& \theta_0^1 \end{array} \right]^T \\
\end{aligned}
$
}
\end{equation}

\vspace{0.3 cm}

\begin{equation}    \label{ve_3_matrix}
\resizebox{.43 \textwidth}{!} {
$
\begin{aligned}
\footnotesize
&\begin{array} {c c c c c c}
\color{Maroon}{W_k} & \hspace{0.3cm} \color{Maroon}{U_0^1} & \hspace{0.7cm} \color{Maroon}{X_0^1} & \hspace{1.2cm} \color{Maroon}{X_1^1} & \hspace{1.1cm} \color{Maroon}{\theta_0^1}
\end{array} \\
\normalsize
&\begin{bmatrix} I \\ I \\ I \end{bmatrix}
\left[  \begin{array} {c c c c | c}
Q_X^{\frac{1}{2}}B_X & Q_X^{\frac{1}{2}}A_{X\_X} & Q_X^{\frac{1}{2}}A_{X\_nbX} & Q_X^{\frac{1}{2}}A_{X\_\theta} & 0\\
Q_\theta^{\frac{1}{2}}B_\theta &Q_\theta^{\frac{1}{2}}A_{\theta\_X} & Q_\theta^{\frac{1}{2}}A_{\theta\_nbX} &Q_\theta^{\frac{1}{2}}A_{\theta\_\theta} & 0\\
Q_U ^{\frac{1}{2}} & 0 & 0 & 0 & 0 \\
\end{array}
\right] \Longrightarrow \\
& \left[ \arraycolsep=0.1pt\def1.5{1.5}
\begin{array} {c}
R_0^1 \\ \begin{bmatrix} I \\ I \end{bmatrix} \\ \end{array}
\right]
\left[ \arraycolsep=7pt\def1.5{1.5}
\begin{array} {c c | c}
I &  \begin{bmatrix} K_0^1 \end{bmatrix} & 0 \\
\begin{bmatrix} 0\\0 \end{bmatrix} & \begin{bmatrix} E_0^1 \end{bmatrix} & \begin{bmatrix} 0\\0 \end{bmatrix}
\end{array}
\right] \\
\end{aligned}
$
}
\end{equation}
where $R_0^1$, $E_0^1$ and $K_0^1$ are from QR factorization of $F_k$. This yields a feedback policy for $U_0^1$ (in green) and cost-to-go values $\phi$ (in blue). Note that the last step of Eqn. \ref{ve_3_matrix} lumps together the columns corresponding to $\{X_0^1, X_1^1, \theta_0^1\}$.

\begin{align}
F_k & \rightarrow Q \left[ \begin{array}{c c} R_0^1 & T_0^1 \\ 0 & E_0^1 \end{array} \right]\\
K_0^1 & = -(R_0^1)^{-1} T_0^1
\end{align}

\vspace{0.3 cm}

\subsection{Variable Ordering} \label{ordering}
The run time of each local sub-problems is determined by the size of $F_k$ matrix. The $F_k$ matrix has dimensions of $p_1 n \times p_2 n$ where $p_1$ is the number of factors attached to the node in question, $p_2$ is the number of variables in the separator, and $n$ is the state-space dimension of each pendulum/cart node (equals 2 in our example). We expect that for all $F_k$, $p_1$ and $p_2$ are bounded constant. While Section \ref{ve_details} describes a choice of elimination ordering that is intuitive and easy to follow, it creates unnecessary non-zero elements (\textit{fill-in}) when we factorize each $F_k$ matrix, which is equivalent to adding more factors to the factor graph. Then subsequent local sub-problems will have larger dimensions because the separator contains more nodes. Different elimination ordering results in different sub-problem size affecting run time performance.

Since choosing an optimal elimination order is long known to be NP-complete \cite{yannakakis1981computing}, in the numerical analysis community, various heuristic-based methods were developed \cite{amestoy1996approximate, demmel1999supernodal, davis2004column}.
Following \cite{DBLP:journals/corr/abs-1911-10065}, we use Column Approximate Minimum Degree (ColAMD) \cite{davis2004column}. ColAMD selects variable order according to a metric that evaluates potential fill-in introduced when a variable is eliminated.

\subsection{Complexity Analysis} \label{complexity}
Given a proper elimination order, it follows from the structural sparsity that $p_1$ and $p_2$ are constants as the state and control spaces scale. Then the total complexity of our method is $O((M+N_s)T)$ compared to cubic run time complexity in state space size of conventional DP approaches for LQR.

The speed-up comes from breaking the original problem into $(M+N_s)T$ local sub-problems. While eliminating cart nodes and pendulum nodes, a constrained least-squares problem is solved using MGS with $O(p_1n (p_2n)^2)$ floating point operations \cite{gulliksson1995modified}. When we eliminate control nodes, we are solving a local unconstrained least-squares problem to factorize $F_k$ using QR factorization, which in the worst case requires $O(p_1n (p_2n)^2)$ steps \cite{trefethen1997numerical}. This is followed by back-substitution which requires $O((p_1n)^2+(p_2n)^2)$ flops. Hence, the complexity of each local sub-problem is constant.

Finally, the ColAMD algorithm has complexity $O(m)$ for a bounded degree graph with $m$ edges \cite{amestoy1996approximate}, which is $O((M+N_s)T)$ in our case. Moreover, the ordering can be precomputed offline if the system structure and time horizon are fixed. The relationship between the link connection structure and the optimal elimination order is an interesting avenue for future work, since the optimal elimination order can further speed up the factor graph optimization.


Chern Numbers of Smooth Varieties via Homotopy Continuation and Intersection Theory

Abstract: Homotopy continuation provides a numerical tool for computing the equivalence of a smooth variety in an intersection product. Intersection theory provides a theoretical tool for relating the equivalence of a smooth variety in an intersection product to the degrees of the Chern classes of the variety. A combination of these tools leads to a numerical method for computing the degrees of Chern classes of smooth projective varieties in P^n. We illustrate the approach through several worked examples.

\section{Introduction}
In this paper we describe a numerical method for computing the degrees of the Chern classes of a smooth projective variety. The main tools that will be used are drawn from intersection theory and numerical algebraic geometry. In particular, we will be using a refined B\'{e}zout's theorem \cite{FOV,Fu,Vo} together with ideas related to numerical polynomial algebra such as homotopy continuation, monodromy, and the numerical decomposition of zero sets \cite{Li, SVW, SW, St}. In addition, we will need to numerically determine the degree of a certain residual zero-scheme \cite{BPS, DZ, Le, Ley, LVZ}.  Implementations of many of the computational tools that will be used can be found in freely available software packages (e.g. \cite{BHSW, Co, GS, GFS, GKKTFM, LLT, SJ, Ve, WSMMW, Ze}).  The algorithms developed in this paper primarily use the software package {\it Bertini} with help from the software package {\it Macaulay 2} \cite{BHSW,GS}.

From the generators of the ideal of a smooth projective variety, Chern numbers can be computed through a purely symbolic computation. This naturally leads one to ask if a numerical approach is useful or needed. A partial answer is that in the numerical approach described in this paper, the algorithms work equally well whether the generators are sparse or dense and whether they have rational, algebraic or transcendental coefficients. This is not the case with purely symbolic methods.  Furthermore, a surprising amount of information can be extracted from an ideal even in situations where the generators have inaccuracies in their coefficients \cite{HMPS, HSS, NSW}. Another important feature, that will likely play a dominant role in the future, is that homotopy continuation algorithms parallelize well. This will allow such algorithms to take advantage of the trend of more processors on a chip. These features lead us to believe that the introduction of a numerical approach is indeed useful and will allow experimentation in settings outside the domain of purely symbolic methods.

\subsubsection*{Acknowledgments:} The authors would like to thank Frank-Olaf Schreyer and Charles Wampler for stimulating conversations and observations.
\section{intersection Theory and Homotopy Continuation}
In this section, we describe the main tools that will be used from intersection theory and from numerical algebraic geometry. Let $X_1,\dotsc,X_r$ be a set of hypersurfaces in $\p{r}$. Let $Z$ be a smooth connected component of  the scheme defined by $X_1 \cap \dotsc \cap X_r$. We present a well known theorem from intersection theory that relates the equivalence of $Z$ in the intersection product $X_1 \cdot \dotsc \cdot X_r$ to a formula involving the total Chern classes of certain bundles related to $X_1,\dotsc,X_r, Z$, and $\p{r}$. With mild assumptions on the scheme determined by the hypersurfaces, this theorem can be translated into a numerical condition involving the degrees of the Chern classes of $Z$, the degrees of the $X_i$ and the degree of a certain residual zero-scheme. Tools from numerical algebraic geometry can be used to compute the degree of the residual zero-scheme. By varying the degrees of the $X_i$, we obtain multiple numerical conditions that can be used to uniquely determine the degrees of the Chern classes of $Z$.

\subsection{Intersection Theory}
Intersection theory has been primarily developed from the two different viewpoints found in \cite{FOV, Fu, Vo}. Though each viewpoint seems to have its own advantages and disadvantages, Leendert van Gastel showed that the two are closely related \cite{vG}. While either version would be adequate for our purposes, we follow the approach of Fulton-MacPherson as described in \cite{Fu}. We first need to fix the notation and definitions that will be used in this section.
\begin{defn0} Let $Z$ and $X$ be projective varieties in $\mathbb P^r=\mathbb P_{\mathbb C}^r$ with $Z\subseteq X$.
\begin{enumerate}
\item Let $A_*(X)= \bigoplus_k A_k(X)$ where $A_k(X)$ denotes the Chow group of $k$-dimensional cycles on $X$ modulo rational equivalence.\item For $\alpha \in A_{\ast}(X)$, ${\{\alpha \}}_0$  denotes the component of $\alpha$ in $A_0(X)$. Let $\alpha \in A_k(X)$, $\alpha=\sum_{i=1}^m a_iV_i$ where $a_1,\dots,a_m \in \mathbb{Z}$ and $V_1,\dots,V_m \subseteq X$ are irreducible subvarieties. The degree of $\alpha$ is defined by $\deg{\alpha}=\sum_i a_i \deg{V_i}$.
\item $N_{X} \p{r}$ denotes the normal bundle of $X$ in $\mathbb P^r$, $T_X$ denotes the tangent bundle of $X$ and $T_X |_Z$ denotes its restriction to $Z$.
\item Given a vector bundle $E$ of rank $n$ on a smooth variety, $c_i(E)$ denotes the $i^{th}$ Chern class of $E$ and $c(E)=1+c_1(E)+\dots + c_n(E)$  denotes the total Chern class of $E$.
\item The $i^{th}$ Chern class of a smooth variety $X$ is defined as $c_i(T_X)$ and $\deg(c_i(T_X))$ is called a Chern number of $X$.
\end{enumerate}
\end{defn0}

Let $X_1,\dotsc,X_r$ be hypersurfaces in $\p{r}$ and let $Z$ be a smooth connected component of  $X_1 \cap \dotsc \cap X_r$. In \cite{Fu} Fulton considers the intersection product $X_1 \cdot \dotsc \cdot X_r \in A_0(X_1 \cap \dotsc \cap X_r)$ and
defines $(X_1 \cdot \dotsc \cdot X_r)^Z \in A_0(Z)$, the \emph{equivalence} of $Z$ for $X_1 \cdot \dotsc \cdot X_r$, as the part of the intersection product supported on $Z$. The following is a simplified version of Proposition 9.1.1  of \cite{Fu} specialized to our setting.

\begin{prop0} \emph{(Fulton)} \label{prop:equivalence}
Let $X_1,\dotsc,X_r$ be hypersurfaces in $\p{r}$ and let $Z$ be a smooth connected component of $X_1 \cap \dotsc \cap X_r$. Let $N_i$ be the restriction of $N_{X_i} \p{r}$ to $Z$. Then
\begin{equation}\label{formula}(X_1 \cdot \dotsc \cdot X_r)^Z = {\{(\Pi_{i=1}^r c(N_i))c(T_{\p{r}} |_Z)^{-1}c(T_Z)\}}_0.\end{equation}
\end{prop0}

We introduce notation for the purpose of stating a useful corollary of \propref{prop:equivalence}. Let $n_i=\deg{X_i}$, let $\dim{Z}=n$,  and let $c_0,\dots,c_n$ be the Chern classes of $Z$. The $k^{th}$ elementary symmetric function in $n_1,\dots, n_r$ will be denoted by $\sigma_k$. In other words,
$$\sigma_0=1, \quad \sigma_1 = \sum_{i} n_i, \quad \sigma_2=\sum_{i<j} n_i n_j, \quad \sigma_3=\sum_{i<j<k} n_i n_j n_k, \quad \dotsc$$ If we let
$$a_i=\sum_{j=0}^{n-i} (-1)^j \binom{r+j}{j} \sigma_{n-i-j}$$
then we obtain the following identity as a direct corollary of \propref{prop:equivalence}:
\begin{coro0} \label{coro:formula}
$\deg{(X_1 \cdot \dotsc \cdot X_r)^Z} = \sum_{i=0}^n a_i \deg{c_i}.$
\end{coro0}
\begin{proof}
Let $H$ be the hyperplane class in $\p{r}$ and let $H|_Z$ be its restriction to $Z$. Because  $c(T_{\p{r}} |_Z)=(1+H|_Z)^{r+1}$, $$c(T_{\p{r}} |_Z)^{-1}=\sum_{j=0}^n(-1)^j {r+j\choose j}H|_Z^j.$$
As cycle classes on $\p{r}$, $N_{X_i} \p{r}=X_i=n_iH$. Hence $c(N_i)=1+n_iH|_Z$ and we get that $\Pi_{i=1}^r (1+c(N_i))=\sum_{k=0}^n \sigma_k H|_Z^k$. Thus the formula (\ref{formula}) can be written as
$$(X_1 \cdot \dotsc \cdot X_r)^Z = {\left\{(\sum_{k=0}^n \sigma_k H|_Z^k)(\sum_{j=0}^n(-1)^j {r+j\choose j}H|_Z^j)(\sum_{i=1}^n c_i) \right\}}_0.$$
The statement now follows since $\deg{c_i}=\deg{(c_i H|_Z^{n-i})}$ and the component of $(X_1 \cdot \dotsc \cdot X_r)^Z$ in $A_0(Z)$
is given by the sum of terms where $k=n-i-j$.
\end{proof}
The classical version of B\'{e}zout's theorem (Proposition 8.4 of \cite{Fu}) states that $$\deg{(X_1 \cdot \dotsc \cdot X_r)}=\prod_{i=1}^r n_i.$$ A refined version of B\'{e}zout's theorem (Proposition 9.1.2 of \cite{Fu}) ties these results together with an extended B\'{e}zout formula.
\begin{prop0} \label{eq:sum} Suppose $X_1 \cap \dotsc \cap X_r$ consists of a connected component $Z$ and a finite set $S$. For $p \in S$ let  $m_p=i(p,X_1 \cdot \dotsc \cdot X_r;\p{r})$ denote the intersection multiplicity of $p$ in $X_1 \cdot \dotsc \cdot X_r$. Then
$\deg{(X_1 \cdot \dotsc \cdot X_r)^Z}+\sum_{p \in S}m_p=\prod_{i=1}^r n_i.$
\end{prop0}
If $n_1,\dotsc,n_r$ and $\sum_{p \in S} m_p$ are known, then we can use \propref{eq:sum} to solve for  $\deg{(X_1 \cdot \dotsc \cdot X_r)^Z}$. If $Z$ is smooth, \cororef{coro:formula} provides a linear relation among the degrees of the Chern classes of $Z$. We summarize these observations in the following theorem implicit in Fulton \cite{Fu}:
\begin{thm0} \label{num:criterion}
 Let $F_1, \dotsc, F_r$ be homogeneous forms corresponding to hypersurfaces $X_1, \dotsc, X_r \subset \p{r}$. Let $n_i=\deg{X_i}$, let $\sigma_k$ be the $k^{th}$ elementary symmetric polynomial in $n_1,\dots, n_r$ and let $\vec{\mathbf A}=[a_0,\dotsc a_n]$ with $a_k=\sum_{i=0}^{n-k} (-1)^i \binom{r+i}{i} \sigma_{n-k-i}$. Let $Z$ be a smooth connected $n$-dimensional scheme with Chern classes $c_0,\dotsc, c_n$ and let $\vec{\mathbf C}=[\deg{c_0}, \dotsc, \deg{c_n}]$. If the subscheme of $\p{r}$ defined by the ideal $(F_1, \dotsc, F_r)$ is a disjoint union of $Z$ and a (possibly empty) zero-scheme $S$, then $\vec{\mathbf A} \cdot \vec{\mathbf C}= \sigma_r -\deg{S}.$
\end{thm0}
In order to compute the degrees of the Chern classes of an $n$-dimensional smooth variety, it is enough to determine $n+1$ independent linear relations that they satisfy. \thmref{num:criterion} provides a mechanism for producing the linear relations provided we are able to find a sufficient number of $r$-tuples of homogeneous forms that satisfy the conditions of \thmref{num:criterion} and provided we have a method for computing $\deg{S}$. In the next two sections, we present a collection of tools that allow us to complete the latter task.

\subsection{Homotopy Continuation}
In homotopy continuation, a polynomial ideal, $I$,
is cast as a member of
a parameterized family of polynomial ideals one of which has known
isolated solutions. Each of the known isolated solutions is tracked through a
predictor/corrector method to a point which lies numerically close to the algebraic set $V(I)$ determined by $I$. These
points can then be refined to lie within a prescribed tolerance of $V(I)$. An introduction to general
continuation methods can be found in \cite{AG}.
Through the basic algorithms of numerical algebraic geometry \cite{SW},
 from $I$  it is then possible to
produce a collection of subsets of points such
that:
\begin{itemize}
\item The subsets are in one to one correspondence with the
irreducible components of the algebraic set $V(I)$.
\item The points in a subset all lie within a prescribed tolerance of
the irreducible component to which it corresponds.
\item The number of
points in the subset is the same as the degree of the irreducible
component.
\item The subset is a numerical approximation of the
intersection of the irreducible component with a known linear space
of complementary dimension.
\end{itemize}
Note that the decomposition above allows one to determine both the dimension and degree of each algebraic variety appearing in the decomposition of an algebraic set.

\subsection{Degree of a Zero Dimensional Scheme}
To each
irreducible component of an algebraic set, one can use the
defining set of polynomials to attach a positive integer, called the {\it multiplicity}, that
determines roughly how many times the component should be counted
in a computation.
In \cite{DZ}, Dayton and Zeng study the multiplicity inspired, to a large degree, by Macaulay's inverse
systems approach.  They provide an algorithm which yields as
output the multiplicity of isolated solutions. This is essentially done by
counting how many partial derivatives of the polynomials are forced
to be zero. In \cite{BPS}, an alternate approach is presented,
inspired, to a large degree, by
certain Gr\"obner basis calculations coupled with a fundamental result
of Bayer and Stillman on regularity \cite{BS}. Both of these algorithms have been implemented in \emph{Bertini} \cite{BHSW}. Thus, there is an implemented algorithm in place that allows one to determine the degree of a zero-dimensional scheme.

\section{Algorithms}
In this section, we present the pseudocode for  three algorithms. The first algorithm computes the equivalence of a connected scheme $Z$ in an intersection product. The second algorithm determines a linear relation satisfied by the degrees of the Chern classes of a smooth connected scheme. The third algorithm computes the degrees of the Chern classes of a smooth connected scheme. For each of the algorithms, the input is a set of non-zero homogeneous generators for an ideal $I$. It is an assumption of the algorithms that the scheme determined by $I$ is a disjoint union of $Z$ and a zero-scheme $S$. The second and third algorithms have the additional assumption that $Z$ is smooth.
\\ \\* \\*
{\bf Algorithm~1.} {\it Equivalence\_of\_Z} $(\{F_1,F_2,\dots ,F_r\}; D)$ \\ \\*
\underline{\bf Input}: A set of $r$ homogeneous polynomials $\{F_1,F_2,\dots, F_r\}\subset \mathbb C[z_0, z_1, \dots ,z_r]$. The polynomials should generate an ideal $I$ whose corresponding scheme is the disjoint union of a connected scheme $Z$ and a possibly empty zero-scheme $S$. \\ \\*
\underline{\bf Output}: $D=\deg{(X_1 \cdot \dotsc \cdot X_r)^Z}$ where $X_i$ is the hypersurface corresponding to $F_i$.\\ \\*
\underline{\bf Algorithm}:\\
\hspace*{0.15in}Determine the support of $S$.\\
\hspace*{0.15in}Determine the multiplicity of each point in the support of $S$.\\
\hspace*{0.15in}Add up the multiplicities of the points in the support of $S$ and store in $\mu_S$.\\
\hspace*{0.15in}For each $i$, determine the degree of $F_i$ and store in $n_i$.\\
\hspace*{0.15in}Compute $T=\prod_i n_i$.\\
\hspace*{0.15in}Compute $T-\mu_S$ and store in $D$.
\\ \\* \\*
{\bf Algorithm~2.} {\it Linear\_Relation\_On\_Chern\_Numbers} $(\{F_1,F_2,\dots ,F_r\}; \vec{\mathbf A}, D)$ \\ \\*
\underline{\bf Input}: A set of $r$ homogeneous polynomials $\{F_1,F_2,\dots F_r\}\subset \mathbb C[z_0, z_1, \dots ,z_r]$. The polynomials should generate an ideal $I$ whose corresponding scheme is the disjoint union of $Z$ and $S$, where $Z$ is a smooth connected scheme and $S$ is a possibly empty zero-scheme.\\ \\*
\underline{\bf Output}: $\vec{\mathbf A}=[a_0,\dots, a_n]$ and $D\in \mathbb Z,$ where $n$ denotes the dimension of $Z$. If $c_i$ denotes the $i^{th}$ Chern class of $Z$ and $\vec{\mathbf C}=[\deg{c_0},\dots, \deg{c_n}]$ then the linear relation is $\vec{\mathbf A}\cdot\vec{\mathbf C}=D$.\\ \\*
\underline{\bf Algorithm}:\\
\hspace*{0.15in}Determine the dimension of $Z$ and store in $n$.\\
\hspace*{0.15in}Compute {\it Equivalence\_of\_Z} $(\{F_1,F_2,\dots ,F_r\}; D)$.\\
\hspace*{0.15in}Compute the elementary symmetric functions $\sigma_0,\sigma_1, \dots, \sigma_n$ of $n_1, \dots, n_r$.\\
\hspace*{0.15in}Compute $\vec{\mathbf A}=[a_0, a_1, \dots, a_n]$ where $a_k=\sum_{i=0}^{n-k} (-1)^i \binom{r+i}{i} \sigma_{n-k-i}$.
\\ \\* \\*
{\bf Algorithm~3.} {\it Chern\_Numbers} $(\{F_1,F_2,\dots ,F_t\}; \vec{\mathbf C})$\\ \\*
\underline{\bf Input}: A set of $t$ homogeneous polynomials $\{F_1,F_2,\dots F_t\}\subset \mathbb C[z_0, z_1, \dots ,z_r]$. The polynomials should generate an ideal $I$ whose corresponding scheme is the disjoint union of $Z$ and $S$, where $Z$ is a smooth connected scheme and $S$ is a possibly empty zero-scheme.
\\ \\*
\underline{\bf Output}: $\vec{\mathbf C}=[\deg{c_0},\dots, \deg{c_n}]$ where $n$ denotes the dimension of $Z$ and $c_i$ denotes the $i^{th}$ Chern class of $Z$.\\ \\*
\underline{\bf Algorithm}:\\
\hspace*{0.15in}Determine the dimension of $Z$ and store in $n$. \\
\hspace*{0.15in}Determine the degrees of $F_1,\dots,F_t$, and store the maximal degree as $b$.\\
\hspace*{0.15in}Set $l_c=b$ for $c=1,\dots, n+1$.\\
\hspace*{0.15in}For $i=1$ to $n+1$\\
\hspace*{0.24in}Choose $r$ random elements from $I$ of degrees $l_1, l_2, \dots, l_r$. \\
\hspace*{0.24in}Store the random elements as $G_1, G_2, \dots, G_r$.\\
\hspace*{0.24in}Compute {\it Linear\_Relation\_On\_Chern\_Numbers} $(\{G_1,G_2,\dots ,G_r\}; \vec{\mathbf A}_i, D_i)$.\\
\hspace*{0.24in}Let $l_i=l_i+1$.\\
\hspace*{0.15in}Next $i$ \\
\hspace*{0.15in}Build the $(n+1)\times (n+1)$ matrix $M$ whose $i^{th}$ row is $\vec{\mathbf A}_i$.\\
\hspace*{0.15in}Build $\vec{\mathbf D}=[D_1,\dots, D_{n+1}]$.\\
\hspace*{0.15in}Set up the linear system $M\vec{\mathbf C}=\vec{\mathbf D}$, with $\vec{\mathbf C}$ and $\vec{\mathbf D}$ as column vectors.\\
\hspace*{0.15in}Solve the linear system for $\vec{\mathbf C}$.
\\ \\*

There are two potential problems that should be addressed in the use of Algorithm~3. The first potential problem is whether the matrix $M$ has full rank. The second potential problem is whether the random $r$-tuples $G_1,G_2, \dots, G_r$, produced in such a simple manner from $I$, satisfy the input requirements of Algorithm~2. These two questions are answered in \propref{prop:det} and \cororef{coro:Bertinimaxdeg}, respectively.
\begin{prop0} \label{prop:det}
The matrix $M$ defined in Algorithm~3 satisfies $\det(M) = \pm 1$.
\end{prop0}
\begin{proof}
View $M$ as a function of the maximal degree $b$. Let $\sigma_i$ be the $i^{th}$ elementary symmetric polynomial in $r$ variables $b_1,\dots,b_r$ and let  $$\sigma_i^j=\sigma_i(b_1+1,b_2+1,\dots,b_j+1,b_{j+1},\dots,b_r).$$ Define $\tau_i^j \in \mathbb{Z}[b]$ by $\tau_i^j=\sigma_i^j(b,b,\dots,b)$, $\tau_i^0=\sigma_i(b,b,\dots,b)$. Define a $(n+1) \times (n+1)$ matrix $N(b)$ by
\begin{displaymath}
N=\left(
\begin{array}{ccccc}
\tau_n^0 & \tau_{n-1}^0 & \dots & \tau_1^0 & 1 \\
\tau_n^1 & \tau_{n-1}^1 & \dots & \tau_1^1 & 1 \\
& & \vdots \\
\tau_n^n & \tau_{n-1}^n & \dots & \tau_1^n & 1 \\
\end{array}
\right).
\end{displaymath}
Observe first that $M$ can be factored as $M=NR$, where
\begin{displaymath}
R=\left(
\begin{array}{ccccccc}
1 & 0 & 0 & \dotsc & 0 & 0 \\
-(r+1) & 1 & 0 & \dotsc & 0 & 0 \\
\binom{r+2}{2} & -(r+1) & 1 & \dotsc & 0 & 0\\
& & \vdots \\
(-1)^{n} \binom{r+n}{n} & (-1)^{n-1} \binom{r+n-1}{n-1} & \dotsc & \binom{r+2}{2} & -(r+1) & 1
\end{array}
\right).
\end{displaymath}
Since $\det(R)=1$, we have $\det(M)=\det(N)$.

One checks that $\det (N(0))=\pm 1$. We shall show that the determinant of $N(b)$ does not depend on $b$ by showing that $$\frac{d(\det (N))}{db}=0.$$ We shall use the following
fact:
$$\frac{d\tau_i^j}{db}=(r-i+1)\tau_{i-1}^j.$$ Let $C_i$ be the $i^{th}$ column of $N$, $N=(C_0,C_1,\dots,C_n)$. Then we have that $$\frac{d(\det (N))}{db}= \sum_
{i=0}^n \det (C_0,C_1,\dots,C_{i-1},\frac{dC_i}{db},C_{i+1},\dots,C_n),$$ but each term in the above sum is zero since $\frac{dC_i}{db}=(r-n+i+1)C_{i+1}$ for $0 \leq i \leq n-1$ and $\frac{dC_n}{db}=0$.
\end{proof}

Let $I$ be an ideal defining a scheme $X \subset \p{r}$ and let $I_X$ be the homogeneous ideal of $X$. For $d \in \mathbb{N}$, we say that $X$ is cut out scheme theoretically in degree $d$ if the saturation of the ideal generated by $I(d)$ is equal to $I_X$.

\begin{prop0} \label{prop:Bertini}
Let $I$ be an ideal defining a scheme in $\p{r}$ that is the disjoint union of a smooth connected scheme $Z$ and a possibly empty zero-scheme $S$. Let $G_1,\dots,G_k \in I$, $1 \leq k \leq r$, generate an ideal that defines a scheme $X$, such that the singular locus $X_{\emph{sing}}$ satisfies $\codim{(X_{\emph{sing}}\setminus S)} > k$, and $\codim{(X \setminus Z)} \geq k$. Let $d \in \mathbb{N}$ be such that $Z \cup S$ is cut out scheme theoretically in degree $d$ and fix integers $n_{k+1},\dots,n_r$ with $n_i \geq d$ for all $i$. If $G_{k+1},\dots,G_r$ are general forms in $I$ with $\deg{G_i}=n_i$, then the ideal $J=(G_1, G_2, \dots, G_r)$ defines the disjoint union of $Z$ and a possibly empty zero-scheme $S'$. If $S$ is non-singular or empty, then $S'$ is non-singular.
\end{prop0}
\begin{proof}
Suppose $k \neq r$. A generic form $G_{k+1} \in I$ of degree $n_{k+1}$ cuts down the dimension of every component of $X \setminus (Z \cup S)$ as well as every component of $X_{\emph{sing}} \setminus S$. By induction, the scheme $Y$ defined by $J$ is a disjoint union of $Z$ and a zero-scheme $S'$, and $Y$ is nonsingular away from $S$. In particular $Y$ is non-singular on $Z$.
\end{proof}

\begin{coro0} \label{coro:Bertiniregular}
Suppose $I$ and $d$ are as in \propref{prop:Bertini}. If $G_1,\dots,G_k \in I$ is a regular sequence in $I$ such that the scheme $X$ defined by the ideal $(G_1,\dots,G_k)$ is generically smooth, then for general forms $G_{k+1},\dots,G_r$ with $\deg{G_i} =n_i \geq d$, the ideal $J=(G_1, G_2, \dots, G_r)$ defines the disjoint union of $Z$ and a possibly empty zero-scheme $S'$.
\end{coro0}
\begin{proof}
Every component of $X$ has codimension $k$ and is of multiplicity 1. We may therefore apply \propref{prop:Bertini}.
\end{proof}

The following corollary implies that for generic choices of the
forms $G_1,\dots,G_r$ in Algorithm~3, the assumptions on the input of Algorithm~2 are satisfied.
\begin{coro0} \label{coro:Bertinimaxdeg}
Let $I\neq 0$ be as in \propref{prop:Bertini} and let $\{F_1,\dots,F_t\}$ be a set of non-zero generators of $I$. Put $d=\max \{\deg{F_1},\dots,\deg{F_t}\}$ and fix integers $n_1,\dots,n_r$ with $n_i \geq d$ for all $i$. If $G_1,\dots,G_r$ are general forms in $I$ with $\deg{G_i}=n_i$, then the ideal $J=(G_1, G_2, \dots, G_r)$ defines the disjoint union of $Z$ and a possibly empty zero-scheme $S'$.
\end{coro0}
\begin{proof}
Observe that the ideal generated by $I(d)$ is equal to $\oplus_{e \geq d} I(e)$. Since the ideal $\oplus_{e \geq d} I(e)$ and $I$ have the same saturation, namely the homogeneous ideal of $Z \cup S$, the scheme $Z \cup S$ is cut out scheme theoretically in degree $d$.
\end{proof}

For reasons of efficiency it is desirable to keep the degrees of the forms $G_1,\dots,G_r$ in Algorithm~3 as low as possible. We give two examples that have bearing on the question of how much
\cororef{coro:Bertinimaxdeg} can be strengthened.

\begin{exa} \label{ex:conic}
Consider a conic $Z \subset \p{3}$. The conic is cut out by a plane $P$ and a quadric $Q$. The corresponding forms of degree 1 and 2 generate the homogeneous ideal $I$ of $Z$. In this case we cannot choose the generic forms $G_1,G_2,G_3 \in I$ of degrees $(3,1,1)$. A cubic and two planes, all three containing the conic, will intersect in the conic union a line, since the planes are necessarily both equal to $P$. The residue in this case is thus a line and not a finite scheme as required.
\end{exa}

\begin{exa}
This example is along the same lines as \exref{ex:conic}.
Let $A$ be a $2 \times 3$ matrix of general linear forms in $\mathbb{C}[x_0,\dots,x_4]$. Let $F_2,F_3,F_4$ be the $2 \times 2$ minors of $A$ and let $F_1$ be a general form of degree 3. The ideal $I=(F_1,F_2,F_3,F_4)$ is the homogeneous ideal of a curve $Z$ in $\p{4}$ and the minors $F_2,F_3,F_4$ define a surface. We thus have a minimal generating set of $I$ of degrees $(3,2,2,2)$ but 4 general forms of degrees $(4,2,2,2)$ will define a union of the curve $Z$ and another curve, violating the input requirements of Algorithm~2.
\end{exa}

\section{Examples}
In this section we present several examples of computations of Chern numbers which illustrate the algorithms of the previous section.

\subsection{Curves} We consider the case of a smooth connected curve in $\p{r}$ (\cite{Fu} Example 9.1.1).
If $Z$ is a smooth curve of genus $g$ in $\p{r}$ then the first Chern class of $Z$ is $-K_{Z}$ and $\deg{(-K_Z)}=2-2g$. If $(F_1,F_2,
\dots, F_r)\subset \mathbb C[z_0, z_1, \dots ,z_r]$ is a homogeneous ideal $I$ whose corresponding scheme is the disjoint union of the curve $Z$ and a zero-scheme $S$ then \cororef{coro:formula} leads to
$$\deg{(X_1 \cdot \dotsc \cdot X_r)^Z}=(n_1+ \dotsc + n_r -(r+1))\deg{Z} +2-2g$$
where $X_i$ denotes the hypersurface corresponding to $F_i$ and $n_i=\deg{X_i}$.
From \thmref{num:criterion}, we can also write the equation as
\begin{equation} \label{eq:curves2}
\prod_in_i - \deg{S}=(n_1+ \dotsc + n_r -(r+1))\deg{Z} +2-2g.
\end{equation}

\begin{exa}
The homogeneous ideal of the twisted cubic curve in $\p{3}$ is $I=(x^2-wy, y^2-xz, wz-xy) \subset \mathbb C[w,x,y,z]$. It is well known that this curve has degree 3 and genus 0. If we choose $F_1, F_2,F_3\in I$ of degrees $(2,2,2)$ then the numerical irreducible decomposition implemented in \cite{BHSW} determines that the corresponding scheme consists of a degree 3 curve and no additional points ($S$ is empty). Equation (\ref{eq:curves2}) gives the relation $$2\cdot2\cdot2-0=(2+2+2-(3+1))\cdot 3 + 2-2g$$ which we can solve to get $g=0$.

If we choose $F_1, F_2,F_3\in I$ of degrees $(2,2,3)$ then we obtain a degree 3 curve and one additional point of multiplicity 1. Equation (\ref{eq:curves2}) gives the relation $$2\cdot2\cdot3-1=(2+2+3-(3+1))\cdot 3 + 2-2g$$ again leading to $g=0$.

If we did not know the degree of $Z$, the two computations in this example would yield $$2\cdot2\cdot2-0=(2+2+2-(3+1))\deg{Z} + 2-2g,$$ $$2\cdot2\cdot3-1=(2+2+3-(3+1))\deg{Z} + 2-2g.$$ The unique solution to these two equations is $\deg{Z}=3$ and $g=0$.
\end{exa}

\subsection{Surfaces} Now consider the case where $Z$ is a smooth connected surface  in $\p{r}$ (\cite{Fu} Example 9.1.5). Let $I=(F_1,F_2,
\dots, F_r)\subset \mathbb C[z_0, z_1, \dots ,z_r]$ be a homogeneous ideal. If the scheme corresponding to $I$ is the disjoint union of the surface $Z$ and a zero-scheme $S$ then \cororef{coro:formula} and \thmref{num:criterion} lead to the equation
\begin{equation} \label{eq:surfaces}
\prod_in_i - \deg{S}=\deg{(X_1 \cdot \dotsc \cdot X_r)^Z}=a_2\deg{c_2}+a_1\deg{c_1}+ a_0 \deg{Z},
\end{equation}
where
$$a_2=1,\ \ a_1=\sum_{i=1}^r n_i -(r+1) \ \ \textrm{and} \ \ a_0=\sum_{i<j} n_i n_j -(r+1)\sum_{i=1}^r n_i+\binom{r+2}{2}.$$
\begin{exa} \label{ex:surface}
In characteristic zero and up to standard modifications, the Horrocks-Mumford bundle $E$ is the only known indecomposable rank 2 vector bundle on $\p{4}$ \cite{HM}.
For a general section $s$ of $E$, the zero set $V(s)$ is a smooth surface in $\p{4}$ called a Horrocks-Mumford surface. We shall compute the degree of a smooth Horrocks-Mumford surface $Z$ as well as the degrees of its Chern classes $c_1$ and $c_2$. It is known that $Z$ is an Abelian surface of degree 10 \cite{HM}. Hence $\deg{c_0}=10$ and $c_1=c_2=0$. The homogeneous ideal $I$ of $Z$ is generated by three quintics and fifteen sextics and $Z$ is cut out scheme theoretically by three quintics and one sextic. Generators for $I$ can be found by a variety of methods, e.g. by a Beilinson monad \cite{DES}. In this example we do not follow Algorithm~3 in detail but the example is covered by \propref{prop:Bertini}.

The following table shows the number of solutions resulting from zero-dimensional, 128-bit precision runs in \cite{BHSW} on 4 random elements of $I$ for various choices of degrees. We let $(n_1,n_2,n_3,n_4)$ denote the degrees of these elements.
\begin{displaymath}
\begin{tabular}{ccccc}
$(n_1,n_2,n_3,n_4)$ & \vline & non-singular points & \vline & singular points \\ \hline
$(5,5,5,6)$ & \vline & 0 & \vline & 750 \\
$(5,5,6,6)$ & \vline & 40 & \vline & 860 \\
$(5,6,6,6)$ & \vline & 100 & \vline & 980 \\
\end{tabular}
\end{displaymath}
In each of these computations the zero set consists of the Abelian surface together with a finite set $S$ of points of multiplicity one. In each row of the table the entry in the middle column is the cardinality of $S$ and the entry in the rightmost column is the B\'{e}zout number $\prod_{i=1}^4 n_i$ minus the entry in the middle column, i.e. $$n_1n_2n_3n_4-\sum_{p \in S} m_p.$$ By \propref{eq:sum}, this is also the degree of the equivalence of $Z$. Evaluating (\ref{eq:surfaces}) in each case gives:
\begin{displaymath}
\begin{array}{l}
\deg{c_2}+16 \deg{c_1}+ 75 \deg{Z}=750 \\
\deg{c_2}+17 \deg{c_1}+ 86 \deg{Z}=860 \\
\deg{c_2}+18 \deg{c_1}+ 98 \deg{Z}=980.
\end{array}
\end{displaymath}
This system has the unique solution $\deg{Z}=10$, $\deg{c_1}=\deg{c_2}=0$.
\end{exa}
\subsection{Higher Dimensional Varieties} If $Z$ is a smooth $n$-dimensional variety  in $\p{r}$ then the algorithm proceeds in a similar manner to the curve and surface cases. We use homotopy continuation to determine the equivalence of $Z$ in various intersection products. This combines with the formulas appearing in \cororef{coro:formula} and \thmref{num:criterion} to produce a linear system involving the degrees of the Chern classes of $Z$. Finally, we solve the linear system to determine these Chern numbers.

\begin{exa} \label{ex:threefold}
Let $I$ be the ideal defined by the $4\times 4$ minors of a $4\times 5$ matrix of general linear forms in $\mathbb C[x_0,x_1,\dots, x_5]$ and let $Z$ be the corresponding threefold in $\p{5}$.
The following table shows the number of solutions resulting from zero-dimensional, 128-bit precision runs in \cite{BHSW} on 5 random elements of $I$ for various choices of degrees. We let $(n_1,n_2,n_3,n_4, n_5)$ denote the degrees of these elements.
\begin{displaymath}
\begin{tabular}{ccccc}
$(n_1,n_2,n_3,n_4,n_5)$ & \vline & non-singular points & \vline & singular points \\ \hline
$(4,4,4,4,4)$ & \vline & 0 & \vline & 1024 \\
$(4,4,4,4,5)$ & \vline & 1 & \vline & 1279 \\
$(4,4,4,5,5)$ & \vline & 6 & \vline & 1594 \\
$(4,4,5,5,5)$ & \vline & 21 & \vline & 1979 \\
\end{tabular}
\end{displaymath}
In each of these computations the zero set consists of the threefold together with a finite set $S$ of points of multiplicity one. The formulas from \cororef{coro:formula} and \thmref{num:criterion} lead to:
\begin{displaymath}
\begin{array}{l}
\deg{c_3}+14\deg{c_2}+61\deg{c_1}+44\deg{Z}=1024 \\
\deg{c_3}+15\deg{c_2}+71\deg{c_1}+65\deg{Z}=1279 \\
\deg{c_3}+16\deg{c_2}+82\deg{c_1}+92\deg{Z}=1594 \\
\deg{c_3}+17\deg{c_2}+94\deg{c_1}+126\deg{Z}=1979.
\end{array}
\end{displaymath}
The unique solution is $\deg{Z}=10$, $\deg{c_1}=0$, $\deg{c_2}=45$, $\deg{c_3}=-46$.
\end{exa}

\begin{exa} \label{ex:threefold2}
Let $V$ be the image of the Segre embedding $i:\mathbb P^1 \times \mathbb P^3 \hookrightarrow \mathbb P^7$. Let $Z$ be the intersection of $V$ with a general hyperplane and let $I$ be the homogeneous ideal of $Z$.
The following table shows the number of solutions resulting from zero-dimensional, 128-bit precision runs in \cite{BHSW} on 6 random elements of $I$ for various choices of the degrees $(n_1,\dots,n_6)$ of these elements.
\begin{displaymath}
\begin{tabular}{ccccc}
$(n_1,n_2,n_3,n_4,n_5, n_6)$ & \vline & non-singular points & \vline & singular points \\ \hline
$(2,2,2,2,2,2)$ & \vline & 0 & \vline & 64 \\
$(2,2,2,2,2,3)$ & \vline & 0 & \vline & 96 \\
$(2,2,2,2,3,3)$ & \vline & 2 & \vline & 142 \\
$(2,2,2,3,3,3)$ & \vline & 10 & \vline & 206 \\
\end{tabular}
\end{displaymath}
In each of these computations the zero set of the 6 random elements consists of the threefold together with a finite set of points of multiplicity one. The formulas from \cororef{coro:formula} and \thmref{num:criterion} lead to:
\begin{displaymath}
\begin{array}{l}
\deg{c_3}+5\deg{c_2}+4 \deg{c_1}-8 \deg{Z}=64 \\
\deg{c_3}+6\deg{c_2}+7 \deg{c_1}-10 \deg{Z}=96 \\
\deg{c_3}+7\deg{c_2}+11 \deg{c_1}-11 \deg{Z}=142 \\
\deg{c_3}+8\deg{c_2}+16 \deg{c_1}-10 \deg{Z}=206.
\end{array}
\end{displaymath}
The unique solution is $\deg{Z}=4$, $\deg{c_1}=10$, $\deg{c_2}=10$, $\deg{c_3}=6$.
\end{exa}

\section{Conclusion}
The results of this paper demonstrate the viability of computing Chern numbers of smooth varieties through numerical homotopy continuation. Homotopy continuation via square systems is a natural venue through which to compute the equivalence of a scheme in the context of an important generalized B\'{e}zout's theorem from intersection theory. It should be noted that the algorithms of this paper could be implemented in a purely symbolic setting as well. The advantages of the numerical approach is that the algorithms work equally well whether the generators are sparse or dense and whether they have rational, algebraic or transcendental coefficients. In addition, meaning can often be attached to the computations in situations where the generators have inaccuracies in their coefficients. Finally, homotopy continuation algorithms parallelize well allowing such algorithms to take full advantage of multi-processor machines. These features suggest the complementary nature of the approach to purely symbolic methods.

In future work, the authors intend to extend the approach to take further advantage of the ideas of intersection theory. In particular, intersection theory for non-square systems leads to a method for computing intersection numbers of Chern classes.

\bigskip

Algebraic Geometry (math.AG); Commutative Algebra (math.AC)


Positive Tropical Flags and the Positive Tropical Dressian

Abstract: We study the totally non-negative part of the complete flag variety and of its tropicalization. We start by showing that Lusztig's notion of non-negative complete flag variety coincides with the flags in the complete flag variety which have non-negative Plücker coordinates. This mirrors the characterization of the totally non-negative Grassmannian as those points in the Grassmannian with all non-negative Plücker coordinates. We then study the tropical complete flag variety and complete flag Dressian, which are two tropical versions of the complete flag variety, capturing realizable and abstract flags of tropical linear spaces, respectively. The complete flag Dressian properly contains the tropical complete flag variety. However, we show that the totally non-negative parts of these spaces coincide.

\section{Introduction}

\ptitle{Motivation for this work} The \textit{Grassmannian} of $k$ planes in $n$ space describes $k$ dimensional linear subspaces in $n$ dimensional space. It is an algebraic variety cut out by the \emph{Pl{\"u}cker  relations}. We can \textit{tropicalize} these relations to obtain the \emph{tropical Pl{\"u}cker  relations}. The set of points satisfying the tropical Pl{\"u}cker  relations, called the \textit{Dressian}, is the parameter space of abstract tropical linear spaces \cite{Spe}. The set of points satisfying the tropicalizations of all polynomials in the ideal generated by the Pl{\"u}cker  relations, called the \textit{tropical Grassmannian}, is the parameter space of realizable tropical linear spaces \cite{HKT}. In general, the Dressian properly contains the tropical Grassmannian (see, for instance, \cite{HJM}). However, in \cite{SW2}, it is shown that if we restrict to positive solutions, for an appropriate notion of positivity, the situation is simpler: the \textit{positive Dressian} equals the \textit{positive tropical Grassmannian}. More explicitly, this means that a positive solution to the tropicalizations of the Pl{\"u}cker  relations is also a positive solution to the tropicalization of any polynomial in the ideal generated by the Pl{\"u}cker  relations. Our goal is to generalize this fact to the setting of the complete flag variety.

\ptitle{Introduction of the major objects in this paper} The \textit{complete flag variety}, $Fl_n$, is the set of complete flags of linear subspaces $\{0\}=V_0\subsetneq V_1\subsetneq\cdots \subsetneq V_n=\mathbb{R}^n$. Any point of this variety is determined by a set of coordinates called its \textit{Pl{\"u}cker  coordinates}. These are cut out by the \textit{incidence-Pl{\"u}cker  relations}, a set of polynomials which extends the Pl{\"u}cker  relations, which generate an ideal called the \textit{incidence-Pl{\"u}cker  ideal}. We consider the set of points satisfying the tropicalizations of the incidence-Pl{\"u}cker  relations, called the \textit{complete flag Dressian}, $FlDr_n$, and the set of points satisfying the tropicalizations of all polynomials in the incidence-Pl{\"u}cker  ideal, called the \textit{tropical complete flag variety}, $TrFl_n$. These parameterize abstract flags of tropical linear spaces and realizable flags of tropical linear spaces, respectively \cite{BEZ}.

\ptitle{First main theorem} The tropical spaces $FlDr_n$ and $TrFl_n$ are generally different \cite{BEZ}. Motivated by the example of the tropical Grassmannian, we will investigate the totally non-negative (TNN) parts of these spaces. We define the \textit{totally non-negative complete flag Dressian} to be the set of simultaneous positive solutions to the tropicalizations of the incidence-Pl{\"u}cker  relations and the \textit{totally non-negative tropical complete flag variety} to be the set of simultaneous positive solutions to the tropicalizations of all the polynomials in the incidence-Pl{\"u}cker  ideal. Our main result, \cref{mainthm}, says the following:

\begin{intro}
The TNN tropical complete flag variety, $TrFl_n^{\geq{0}}$, equals the TNN complete flag Dressian, $FlDr_n^{\geq 0}$.
\end{intro}

\ptitle{Second main theorem} A number of authors, among them \cite{Rie}, \cite{TW}, \cite{Lam} and \cite{Lus3}, have proven that the TNN Grassmannian, in the sense of Lusztig \cite{Lut}, consists precisely of points in the Grassmannian where each Pl{\"u}cker  coordinate is non-negative. We extend this result to the setting of the complete flag variety. Specifically, in proving theorem \cref{mainthm}, we will need to carefully study the \textit{totally non-negative complete flag variety}, denoted $Fl_n^{\geq0}$. A construction based on the parameterization of $Fl_n^{\geq 0}$ by Marsh and Rietsch \cite{MR} will allow us to understand explicitly the Pl{\"u}cker  coordinates $\{P_I(F)\}_{I\subset [n]}$ of an arbitrary flag $F$ in $Fl_n^{\geq0}$. In \cref{nonnegPluckCoords}, we show:

\begin{intro}
The TNN complete flag variety $Fl_n^{\geq 0}$ equals the set $\{F\in Fl_n|\;P_I(F)\geq 0\; \forall \; I\subset [n]\}$.
\end{intro}

We have learned recently that this result has been independently proven in \cite{BK}, where they show moreover that the only partial flag variety for which this theorem holds are those where the dimensions of the constituent subspaces are consecutive integers. This includes $FL_n^{\geq 0}$, with constituent dimensions $\{1,2,\cdots,n\}$, and the TNN Grassmannian of $k$ planes in $n$ space, with constituent dimension $\{k\}$.

\ptitle{Tangential result of independent interest} We also introduce an alternative description of $FlDr_n$ as the set of points which are common solutions to the three term tropical incidence-Pl{\"u}cker  relations and whose supports form flag matroids. This is analogous to the description of the Dressian as the set of common solutions of all the three-term tropical Pl{\"u}cker  relations \cite{Mur2}*{Theorem 5.2.25}. While this result is independent of the rest of this abstract, it motivates the introduction of a related TNN tropical space which is used in the proof of \cref{mainthm}.

\ptitle{Structure} The structure of this extended abstract is as follows: In section 2, we introduce the TNN complete flag variety. In section 3, we give a parametrization of this space and study its Pl{\"u}cker  coordinates. In section 4, we introduce three tropicalizations of the complete flag variety and demonstrate that two of them are in fact the same. We then focus in on the TNN parts of these three tropical spaces and demonstrate that they are all equal.

\ptitle{Acknowledgements}\textbf{Acknowledgements:} I would like to thank my supervisor Lauren Williams for introducing me to the tropical flag variety and for many helpful conversations as this work developed. I would also like to thank both Melissa Sherman-Bennett and Mario Sanchez for helpful conversations, examples and references.

 \section{The Totally Non-Negative Complete Flag Variety}

\ptitle{Motivation for definition of incidence-Pl{\"u}cker  relations}

 \begin{definition}
 The \textbf{complete flag variety} $Fl_n$ is the collection of all \textbf{complete flags} in $\mathbb{R}^n$, which are collections $(V_i)_{i=0}^n$ of linear subspaces satisfying $\{0\}=V_0\subsetneq V_1 \subsetneq \cdots \subsetneq V_n=\mathbb{R}^n$.
 \end{definition}

 We first observe that $Fl_n$ is a multi-projective variety. We can represent a flag $(V_i)_{i=1}^n$ by a full rank $n$ by $n$ matrix $M$ such that $V_i$ equals the span of the topmost $i$ rows of $M$. Let $GL_n$ be the group of invertible $n$ by $n$ matrices and $SL(n, \mathbb{R})$ be the \textit{special linear group} of real matrices with determinant $1$. Let $B_-$ be the \textit{Borel subgroup} of $GL_n$ consisting of lower triangular matrices. One can check that two matrices $M$ and $M'$ represent the same flag if and only if they are related by left multiplication by some $B\in B_{-}$.  Thus, we can think of the complete flag variety as $Fl_n=\{B_-u|u\in SL(n,\mathbb{R})\}$, where a flag in $Fl_n$ represented by a matrix $u$ is identified with the set $B_-u$.

 For $I\subset[n]=\{1,\cdots,n\}$ and $M$ an $n$ by $n$ matrix, the \textit{Pl{\"u}cker  coordinate} (or, alternatively, \textit{flag minor}) $P_I(M)$ is the determinant of the submatrix of $M$ in rows $\{1,2,\cdots,|I|\}$ and columns $I$. To any flag $F$, associate the collection of Pl{\"u}cker  coordinates $(P_I(F))_{I\subset[n]}$, defined to be the Pl{\"u}cker  coordinates of any matrix representative of that flag.  By \cite{MS}*{Proposition 14.2}, this is an embedding of $Fl_n$ in $\mathbb{R}\mathbb{P}^{{n\choose 1}-1}\times\cdots \times \mathbb{R}\mathbb{P}^{{n\choose n-1}-1}$.  The Pl{\"u}cker  coordinates of flags in $Fl_n$ are cut out by multi-homogeneous polynomials, as shown in the following definition and theorem.  Note that we will often use shorthand notation such as $(S\setminus ab)\cup cd$ in place of $\left(S\setminus \{a,b\}\right)\cup \{c,d\}$.

 \ptitle{Incidence-Pl{\"u}cker  relations}\begin{definition}[\cite{Ful}]
  Consider $\mathbb{R}\mathbb{P}^{{n\choose 1}-1}\times\cdots \times \mathbb{R}\mathbb{P}^{{n\choose n-1}-1}$, with coordinates indexed by proper subsets of $[n]$. For $1\leq r\leq s\leq n$, the \textbf{Incidence-Pl{\"u}cker  relations} for indices of size $r$ and $s$ are
  \begin{equation}
      \mathfrak{P}_{r,s;n}=\left\{\sum_{j\in J\setminus I}sign(j,I,J)P_{I\cup j}P_{J\setminus j }\left| I \in {n\choose r-1},\: J\in {n\choose s+1} \right.\right\},
  \end{equation}
 where $sign(j,I,J)=(-1)^{|\{k\in J|k<j\}|+|\{i\in I|j<i\}|}$.

The full set of incidence-Pl{\"u}cker  relations is given by $\mathfrak{P}_{IP;n}=\bigcup_{1\leq r\leq s\leq n} \mathfrak{P}_{r,s;n}$. The ideal generated by $\mathfrak{P}_{IP;n}$, denoted $I_{{IP;n}}$, is called the \textbf{incidence-Pl{\"u}cker  ideal}.

 \end{definition}

\textit{Remark:} Note that the above definition allows for the option of $r=s$. The incidence-Pl{\"u}cker  relations for which $r=s$ are called the (Grassmann) \textbf{Pl{\"u}cker  relations}.

\ptitle{The complete flag variety from incidence Pl{\"u}cker  ideal}

\begin{theorem}[\cite{Ful}*{Section 9, Proposition 1} and discussion following its proof]
 Let $P\in\mathbb{R}\mathbb{P}^{{n\choose 1}-1}\times\cdots \times \mathbb{R}\mathbb{P}^{{n\choose n-1}-1}$. Then $P=P(F)$ for some $F\in Fl_n$ if and only if $P$ satisfies the incidence-Pl{\"u}cker  relations $\mathfrak{P}_{IP;n}$.
 \end{theorem}

In particular, this means the incidence-Pl{\"u}cker  relations are precisely the relations between the topmost minors of a generic full rank matrix.

Lusztig introduced the notion of non-negativity for flag varieties. We outline here the definition of the \textit{totally non-negative complete flag variety}, following \cite{Lus2}. We work in type A and so the appropriate simplifications will be made in presenting the definition. Let $s_i$ be the transposition $(i, i+1)$ in the symmetric group $S_n$ and let $w_0$ be the longest permutation in $S_n$. For $1\leq k < n$, let $x_k(a)$ be the $n$ by $n$ matrix which is the identity matrix with an $a$ added in row $k$ of column $k+1$. Explicitly,
\begin{equation*}
    x_k(a)=\begin{blockarray}{ccccccc}
& &  & k & k+1 & & \\
\begin{block}{c(cccccc)}
  & 1 &  &  & & & \\
  & & \ddots &  & &  & \\
  k& &  & 1 & a &  &  \\
  k+1& &  &0  & 1 &  &  \\
  & &  &  &  & \ddots  & \\
  &&&&&&1\\
\end{block}
\end{blockarray} \hspace{5pt},
\end{equation*}
\noindent where unmarked off-diagonal matrix entries are $0$.

\begin{definition}[\cite{Lut}]
 Let $N={n\choose2}$. Pick $\left(i_1,i_2,\cdots, i_N\right)$ such that $s_{i_1}\cdots s_{i_{N}}=w_0$. Then let
 \begin{equation*}U_{>0}^{+}=\left\{\left.x_{i_1}(a_1)\cdots x_{i_N}\left(a_{N}\right)\right|a_i\in \mathbb{R}_{>0} \;\forall \; i\right\}
 \end{equation*}
\end{definition}

This definition is independent of the choice of sequence $\left(i_1,\cdots, i_{N}\right)$.

\begin{definition}[\cite{Lut}]\label{lusdef}
 Let $\mathcal{B}_{>0}=\{B_{-}u|u\in U^+_{>0}\}\subset Fl_n$. The \textbf{totally non-negative complete flag variety} (of type A), $Fl_n^{\geq0}$, is the closure of $\mathcal{B}_{>0}$.
\end{definition}

\section{Parametrization of the TNN  Complete Flag Variety}

\subsection{The Marsh-Rietsch Parametrization}

\ptitle{Introduction to MR parameterization} As shown by Rietsch \cite{Rie}, $Fl_n^{\geq 0}$ is a cell complex, whose cells $\mathcal{R}_{v,w}^{>0}$ are indexed by pairs of permutations $v\leq w$ in the Bruhat order on $S_n$. Each such $\mathcal{R}_{v,w}^{>0}$ is given an explicit parameterization in \cite{MR}. We will describe this parameterization here, making some choices that in principle are arbitrary but will be convenient for our purposes, and invite the reader to look at the above references for full generalities.

\ptitle{Useful notation}

\ptitle{Positive Distinguished subexpressions, with an intuitive description} Any permutation $w$ in $S_n$ can be written as a product of simple transpositions $s_i$, called an \textit{expression} for $w$. The \textit{length} of $w$, $\ell(w)$, is the fewest number of transpositions in any expression for $w$. An expression for $w$ consisting of $\ell(w)$ transpositions is called \textit{reduced}. Let $\bm{w}=s_{i_1}s_{i_2}\cdots s_{i_k}$ be a reduced expression for $w$. If $v\leq w$ in the Bruhat order, then there is a reduced \textit{subexpression} $\bm{v}=s_{i_{j_1}}s_{i_{j_2}}\cdots s_{i_{j_m}}$ for $v$ in $\bm{w}$, where $1\leq j_1<j_2<\cdots <j_m\leq k$. We will be interested in a special choice of subexpression which is called the \textit{positive distinguished subexpression}. Intuitively, this can be thought of as the leftmost subexpression.

\begin{definition}\label{negative} Let $v\leq w$. Choose a a reduced expression $\bm{w}=s_{i_1}s_{i_2}\cdots s_{i_k}$ for $w$ and a subexpression $\bm{v}=s_{i_{j_1}}\cdots s_{i_{j_m}}$ for $v$ in $\bm{w}$. Then $\bm{v}$ is a \textbf{positive distinguished subexpression} if:

\begin{enumerate}
    \item It is a reduced expression for $v$.
    \item Whenever $\ell(s_{i_p}s_{i_{j_r}}\cdots s_{i_{j_m}})<\ell(s_{i_{j_r}}\cdots s_{i_{j_m}})$ for $j_{r-1}\leq p< j_{r}$, we have $p=j_{r-1}$.
\end{enumerate}
\end{definition}

\begin{lemma}[\cite{MR}*{Lemma 3.5}]
For every $v\leq w$, and every reduced expression $\bm{w}$ of $w$, there is a unique positive distinguished subexpression for $v$ in $\bm{w}$.
\end{lemma}

\ptitle{Example of positive distinguished subexpression}
\begin{example}
Let $n=4$. Set $\bm{w}=s_1s_2s_3s_1s_2s_1$ and $v=s_1s_2s_1$. The leftmost subexpression for $v$ in $\bm{w}$ is $j_1=1$, $j_2=2$ and $j_3=4$. Indeed, one can verify that this choice satisfies the definition.
\end{example}

For $1\leq k<n$, let $\dot{s}_k$ be the $n$ by $n$ identity matrix with the $2\times 2$ submatrix in rows $\{k,k+1\}$ and columns $\{k,k+1\}$ replaced by the matrix $\begin{pmatrix}
0&1\\
-1&0
\end{pmatrix}$. Explicitly,
\begin{equation*}
    \dot{s}_k=\begin{blockarray}{ccccccc}
& &  & k & k+1 & & \\
\begin{block}{c(cccccc)}
  & 1 &  &  & & & \\
  & & \ddots &  & &  & \\
  k& &  & 0 & 1 &  &  \\
  k+1& &  &-1  & 0 &  &  \\
  & &  &  &  & \ddots  & \\
  &&&&&&1\\
\end{block}
\end{blockarray}\hspace{5pt},
\end{equation*}
\noindent where unmarked off-diagonal matrix entries are $0$.

We will describe each cell of $Fl_n^{\geq 0}$ as a product of matrices of the form $x_k$ and $\dot{s}_{k'}$.

\begin{definition}
Fix $v\leq w$ in the Bruhat order. Fix a vector $\bm{a}\in \mathbb{R}^{\ell(w)-\ell(v)}$. Consider the reduced expression $\bm{w_0}=(s_1s_2\cdots s_{n-1})(s_1s_2\cdots s_{n-2})(\cdots)(s_1s_2)(s_1)$ for $w_0$, the longest permutation in the Bruhat order in $S_n$\footnote{This choice of expression is arbitrary in the context of the Marsh-Rietsch parameterization, but plays an important role in the proofs underlying later results in this abstract.}. Choose the positive distinguished subexpression $\bm{w}$ for $w$ in $\bm{w_0}$, and the positive distinguished subexpression $\bm{v}$ for $v$ in $\bm{w}$, and write them as $\bm{w}= s_{i_1}\cdots s_{i_k}$ and $\bm{v}=s_{i_{j_1}}\cdots s_{i_{j_m}}$, respectively. Let $J=\{j\;|\;j=j_t \textnormal{ for some }t\}$. In other words, $J$ are those indices which correspond to transpositions that are used in $\bm{v}$. Then set
\begin{equation*}
    M_{v,w}(\bm{a})\coloneqq M_1\cdots M_k,\hspace{3mm} \textnormal{  where  }\hspace{3mm} M_j=\begin{cases}\dot{s}_{i_j}, & j\in J\\ x_{i_j}(a_{j}),&j\notin J\end{cases}\hspace{1mm} .
\end{equation*}
\end{definition}

 \begin{theorem}[Marsh-Rietsch Parametrization, \cite{MR}] \label{marshrietsch}

Each cell $\mathcal{R}_{v,w}^{>0}$ of $Fl_{n}^{\geq 0}$ can be parameterized as

\begin{equation*}
    \mathcal{R}_{v,w}^{>0}=\left\{M_{v,w}(\bm{a})\left|\bm{a}\in\mathbb{R}_{>0}^{\ell(w)-\ell(v)}\right.\right\}
\end{equation*}

In particular, each flag $F\in Fl_n^{\geq 0}$ is uniquely represented in some unique $\mathcal{R}_{v,w}^{> 0}$. Moreover, each $\mathcal{R}_{v,w}^{> 0}$ is a cell, meaning it is homeomorphic to an open ball. \end{theorem}

\begin{example}\label{toymodel}
Let $n=4$, $\bm{w}=s_1s_3s_2s_1$ and $v=s_2$. The positive distinguished subexpression for $v$ in $w$ is the subexpression where $j_1=3$, so $J=\{3\}$. Thus, $M_1=x_1(a_1)$, $M_2=x_3(a_2)$, $M_3=\dot{s}_2$ and $M_4=x_1(a_3)$. The cell of the non-negative flag variety corresponding to $v\leq w$ is represented by matrices of the form

\begin{equation*}
    M=M_1M_2M_3M_4
    =\begin{pmatrix}
    1&a_3&a_1&0\\
    0&0&1&0\\
    0&-1&0&a_2 \\
    0&0&0&1
    \end{pmatrix},
\end{equation*}
where the $a_i$ range over all positive real numbers. Note that the Pl{\"u}cker  coordinates of $M$ are all non-negative, as \cref{nonnegPluckCoords} will show must be true for any cell of $Fl_n^{\geq 0}$.
 \end{example}

 \ptitle{Useful results for later}
 We now give a useful property of the cells $\mathcal{R}_{v,w}^{> 0 }$.

 \begin{lemma}\label{cellcoords}
 Each cell $\mathcal{R}_{v,w}^{> 0}$ of $Fl_n^{\geq 0}$ consists entirely of flags for which some fixed collection of Pl{\"u}cker  coordinates is strictly positive and the rest are $0$.
 \end{lemma}

\subsection{Extremal Non-Zero Pl{\"u}cker  Coordinates}

 \ptitle{Outline/goal of the section} We define a special subset of the Pl{\"u}cker  coordinates of a flag which we call \textit{extremal non-zero Pl{\"u}cker  coordinates}. The set of indices of the extremal non-zero Pl{\"u}cker  coordinates of a flag in $Fl_n^{\geq 0}$ will depend only on which cell $\mathcal{R}_{v,w}^{>0}$ that flag lies in. Further, we will show that in any given cell of $Fl_n^{\geq 0}$, the extremal non-zero Pl{\"u}cker  coordinates determine all of the other Pl{\"u}cker  coordinates.

\ptitle{Description and intuition of $\Xi$} \ptitle{Description and intuition of $\Xi$} For any $1\leq k<n$ and any $P\in \mathbb{R}\mathbb{P}^{{n\choose 1}-1}\times\cdots\times \mathbb{R}\mathbb{P}^{{n\choose n-1}-1}$, we define a map $\Xi_P: {[n]\choose k}\rightarrow {[n]\choose k}$.  Intuitively, when applied to the index of a non-zero Pl{\"u}cker  coordinate $I$, this map finds the largest member of $I$ that can be increased without making the corresponding Pl{\"u}cker  coordinate $0$ and increases it maximally. Explicitly, for $I$ such that $P_I\neq 0$, define $b=\max_{i\in I}\left\{i\;|\;\exists\; j,  \;i<j\notin I, \; P_{(I\setminus i)\cup j}\neq 0\right\}$, if that set is non-empty. Otherwise, say $b$ does not exist. If $b$ exists, define $a=\max_{j\notin I}\left\{j\;|\; P_{(I\setminus b)\cup j}\neq 0\right\}$. Then,
\begin{align*}
    \Xi_P(I)=
    \begin{cases}
    (I\setminus b)\cup a &\;\;\textnormal{if } I \textnormal{ is the index of a non-zero Pl{\"u}cker  coordinate and $b$ exists,}\\
    I &\;\;\textnormal{otherwise.}
    \end{cases}
\end{align*}

Note that the indices of non-zero Pl{\"u}cker  coordinates with index of some fixed size can be seen as the bases of a matroid. In this light, $\Xi_P$ acts by basis exchange. Also note that, by \cref{cellcoords}, for a TNN flag $F$, the map $\Xi_{P(F)}$ depends only on the cell $\mathcal{R}_{v,w}$ in which $F$ lies.

The extremal non-zero Pl{\"u}cker  coordinates will be indexed by certain $\Xi$ orbits. To properly define them, we first need a preliminary result on matroids:

 \begin{definition}
  The \textbf{Gale order} on subsets of $[n]$ of size $k$ is a partial order such that, if $I=\{i_1<\cdots< i_k\}$ and $J=\{j_1<\cdots< j_k\}$, then we say $I\leq J$ if $i_r\leq j_r$ for every $r\in[k]$.
 \end{definition}

 \begin{lemma}[\cite{Coxeter}*{Theorem 1.3.1}]
 Any matroid has a unique Gale minimal basis and a unique Gale maximal basis.
 \end{lemma}

Note that the Gale minimal and maximal bases referenced in the previous lemma must simply be the lexicographically minimal and maximal bases, respectively.

 \begin{definition}\label{extremal}
  Given a set of Pl{\"u}cker  coordinates $\{P_I\}$ of a flag, let $I_k$ be the Gale minimal index of size $k$ such that $P_{I_k}\neq 0$.
  The set of indices of the \textbf{extremal non-zero Pl{\"u}cker  coordinates} (referred to as \textbf{extremal indices})
  of a point $P$ in $\mathbb{R}\mathbb{P}^{{n\choose 1}-1}\times\cdots \times \mathbb{R}\mathbb{P}^{{n\choose n-1}-1}$ is the set consisting of those indices which are in the $\Xi_P$ orbit of $I_k$ for some $k\in [n-1]$.

  \end{definition}

 If $F$ is a TNN flag, the extremal indices of the Pl{\"u}cker  coordinates $P(F)$ depend only on the cell $\mathcal{R}_{v,w}^{>0}$ in which $F$ lies, since $\Xi_{P(F)}$ depends only on the cell in which $F$ lies.

 If we have a collection of Pl{\"u}cker  coordinates $\{P_I\}$ such that $P_I\geq 0$ for all $I\subset {[n]\choose k}$, the indices of the non-zero Pl{\"u}cker  coordinates of $P$ of fixed size form not just the bases of a matroid, but the \textit{bases of a positroid.} For background on positroids, see \cite{Oh}. Many of the useful properties of the extremal Pl{\"u}cker  coordinates only hold in this context of positroids.

 \ptitle{Example of extremal indices and Pl{\"u}cker  coordinates}
   \begin{example}
 Let $a,b,c,d,e,f,g\in\mathbb{R}_{>0}$ and consider
 \begin{equation*}
     M=\begin{pmatrix}
    1&a+e+g&ab+af+ef&abc&abcd\\
    0&1&b+f&bc&bcd\\
    0&0&1&c&cd \\
    0&0&0&1&d\\
    0&0&0&0&1
    \end{pmatrix}.
 \end{equation*}

 The minors of this matrix are non-negative and specifically, focusing on indices of size $2$, we can see that they are all positive except for $P_{45}=0$. Thus, the non-zero Pl{\"u}cker  coordinate with Gale minimal index of size $2$ is $P_{12}$. Then, $\Xi_{P(M)}(12)=15$, replacing the $2$ with a $5$. Next, $\Xi_{P(M)}(15)=35$, replacing the $1$ with a $3$. Thus, $P_{12}=1$, $P_{15}=bcd$ and $P_{35}=bcdef$ are the extremal non-zero Pl{\"u}cker  coordinates of size $2$ of this flag.
 \end{example}

The next theorem highlights the importance of the extremal non-zero Pl{\"u}cker  coordinates.

 \begin{theorem}\label{3termgenerate}
 For any flag $F$ with non-negative Pl{\"u}cker  coordinates, the extremal non-zero Pl{\"u}cker  coordinates of $F$ uniquely determine the other non-zero Pl{\"u}cker  coordinates of $F$ by three-term incidence-Pl{\"u}cker  relations.
 \end{theorem}

 \subsection{Pl{\"u}cker  Coordinates of the TNN Flag Variety}

 \ptitle{Motivation for this subsection} Now, given a set of extremal non-zero Pl{\"u}cker  coordinates for a flag lying in $\mathcal{R}_{v,w}^{> 0}$, we want to understand how to construct a set of parameters $a_i$ for which \cref{marshrietsch} yields a matrix agreeing with those coordinates.

\ptitle{Establishment of notation and the first main result of this section}

\begin{theorem}\label{pointtograph}
For any $v\leq w$ with $r=\ell(w)-\ell(v)$, let $\Psi_{v,w}: \mathcal{R}_{v,w}^{> 0}\rightarrow \mathbb{R}^r$ be the map $M_{v,w}(\bm{a})\mapsto \bm{a}$, in the notation of \cref{marshrietsch}. The map $\Psi_{v,w}$ consists of Laurent monomials in the extremal Pl{\"u}cker  coordinates.
\end{theorem}

We can use this theorem to prove the following, which is one of our main results:

\begin{theorem}\label{nonnegPluckCoords}
The TNN flag variety defined in \cref{lusdef} is precisely the set of flags with non-negative Pl{\"u}cker  coordinates. In other words, $Fl_n^{\geq 0}=\{F\in Fl_n|\;P_I(F)\geq 0\; \forall \; I\subset [n]\}$.
\end{theorem}

 It is shown in \cite{KW}*{Lemma 3.10} that any flag in $Fl_n^{\geq 0}$ has non-negative Pl{\"u}cker  coordinates. We now outline the strategy used to obtain the converse.

\begin{definition}
  A (complete) \textbf{flag matroid} on a ground set $E$ of size $n$ is a sequence of matroids $\bm{\mathcal{M}}=(\mathcal{M}_1,\mathcal{M}_2,\cdots, \mathcal{M}_{n-1})$ on the ground set $E$ with the rank of $\mathcal{M}_i$ equal to $i$, called \textbf{constituent matroids}, such that for any $j<k$,

  \begin{itemize}
      \item each basis of $\mathcal{M}_j$ is contained in some basis of $\mathcal{M}_k$.
      \item each basis of $\mathcal{M}_k$ contains some basis of $\mathcal{M}_j$.
  \end{itemize}
   \end{definition}
  We identify a flag matroid with the collection of bases of its constituent matroids, collectively referred to as the \textit{bases of the flag matroid}. For more details about flag matroids, as well as cryptomorphic definitions, see \cite{Coxeter}. Note that the indices of non-zero Pl{\"u}cker  coordinates of an invertible square matrix are easily seen to form a flag matroid.

  \begin{definition}A flag matroid on $[n]$ is \textbf{realizable} if its bases are the non-zero Pl{\"u}cker  coordinates of some $F\in Fl_n$.
  \end{definition}

   We now define two types of flag positroid. The difference between their definitions mirrors the apparent difference between a flag lying in $Fl_n^{\geq 0}$ according to \cref{lusdef} and a flag with non-negative Pl{\"u}cker  coordinates.

  \begin{definition}
  A \textbf{realizable flag positroid} on $[n]$ is the set of indices of non-zero Pl{\"u}cker  coordinates of a flag $F\in Fl_n^{\geq 0}$ (as defined in \cref{lusdef}). A \textbf{synthetic flag positroid} on $[n]$ is the set of indices of non-zero Pl{\"u}cker  coordinates of a flag $F$ satisfying $P_I(F)\geq 0$ for all $I\subset [n]$.
  \end{definition}
  A priori, one may expect that there could be more synthetic flag positroids than realizable flag positroids, but this is not the case.

  \begin{theorem}\label{synthetic}
 The set of synthetic flag positroids on $[n]$ equals the set of realizable flag positroids on $[n]$.
  \end{theorem}

  Note that by \cref{cellcoords}, the realizable flag positroid arising from the non-zero Pl{\"u}cker  coordinates of a TNN flag only depends on which cell $\mathcal{R}_{v,w}^{>0}$ that flag lies in. Thus, we can associate a cell $\mathcal{R}_{v,w}^{>0}$ to any realizable flag positroid. Let $F$ be a flag whose Pl{\"u}cker  coordinates $P$ are all non-negative. Let $\bm{\mathcal{M}}$ be the synthetic (equivalently, realizable) flag positroid which has $I\subset [n]$ as a basis if and only if $P_I> 0$. As above, let $\mathcal{R}_{v,w}^{>0}$ be the cell associated to $\bm{\mathcal{M}}$. To prove \cref{nonnegPluckCoords}, we are left to show that $F\in\mathcal{R}_{v,w}^{>0}$. Extending the domain of the map $\Psi_{v,w}$ defined in \cref{pointtograph}, one can apply it to $F$ and show that $M_{v,w}\left(\Psi_{v,w}(F)\right)$ is a flag in $\mathcal{R}_{v,w}^{>0}$ which has the same extremal Pl{\"u}cker  coordinates as $F$. Then, using \cref{3termgenerate}, one may conclude that $F$ itself lies in $\mathcal{R}_{v,w}^{>0}$, completing the proof of \cref{nonnegPluckCoords}.

\section{Tropicalizing the Complete Flag Variety}

\ptitle{Section outline} We now discuss \textit{tropical varieties} and introduce the precise definitions of the \textit{TNN tropical complete flag variety} and the \textit{TNN complete flag Dressian}.

\ptitle{Definition of tropical polynomials and tropical solutions to polynomials}

\begin{definition}\label{tropsol}
Let $\bm x=(x_1,\cdots,x_n)\in \mathbb{R}^n$ and $\bm{b}=(b_1,\cdots,b_n)\in\mathbb{N}^n$. We will use the notation $\bm {x}^{\bm {b}}=x_1^{{b}_1}\cdots x_n^{{b}_n}$. Let $p=\sum_i \pm a_i\bm{x}^{\bm b_i}$ be a polynomial, where each $a_i>0$ and each $\bm b_i\in \mathbb{N}^n$. We define the \textbf{tropicalization of $p$} by $trop(p)=\min_i \left\{a_i+\bm{x}\cdot \bm {b_i}\right\}$.  We say that a point $\bm{y}\in\mathbb{T}^n\coloneqq (\mathbb{R}\cup\infty)^n$ is a \textbf{solution of the tropicalization of $p$} if

\begin{equation*}
    \min_i \left\{a_i+\bm{y}\cdot \bm {b_i}\right\}= \min_i \left\{a_i+y_1(b_i)_1+\cdots+ y_n(b_i)_n\right\}
\end{equation*}
is achieved at least twice. We further say that a point in $\mathbb{T}^n$ is a \textbf{positive solution of the tropicalization of $p$} if additionally, at least one of the minima comes from a term of $p$ with a $+$ sign, and at least one of the minima comes from a term with a $-$ sign. Equivalently, if we rewrite $p=0$ in the form $\sum_j c_j\bm{x}^{\bm b_j}=\sum_i a_i\bm{x}^{\bm b_i}$ with all $c_j$ and $a_i$ positive, then we want at least one minimum to occur in a term coming from each side of the equality.
\end{definition}

\ptitle{Projective Tropical spaces} The tropical objects we are interested in will live in \textit{projective tropical spaces}, which are spaces that interact nicely with homogeneous polynomials.

\begin{definition}
 \textbf{Projective tropical space}, denoted $\mathbb{T}\mathbb{P}^n$ is given by $\left(\mathbb{T}^{n+1}\setminus (\infty,\cdots \infty)\right)/\sim$ where the equivalence relation is $\bm x \sim \bm y$ if there exists $c\in \mathbb{R}$ such that $x_i=y_i+c$ for all $i\in [n]$.
\end{definition}

The following is immediate from the definition:

\begin{proposition}
If $p$ is a homogeneous polynomial, then $\bm x$ is a (positive) solution of $trop(p)$ if and only if $\bm y$ is a (positive) solution of $trop (p)$ for all $\bm y \sim \bm x$.
\end{proposition}

\ptitle{Example of tropical solutions}

 \ptitle{Definition of tropical prevariety}

\begin{definition}\label{tropideal}
 Given a set of multi-homogeneous polynomials $\mathcal{P}$, each of which is homogeneous with respect to sets of variables of sizes $\{n_i\}_{i=1}^t$, and the ideal $I$ which they generate, we define the following sets in $\mathbb{T}\mathbb{P}^{n_1-1}\times\cdots\times \mathbb{T}\mathbb{P}^{n_t-1}$:

 \begin{itemize}
     \item The \textbf{tropical prevariety} $\overline{\textnormal{trop}}(\mathcal{P})$ or $\overline{\textnormal{trop}}(I)$ is the set of simultaneous solutions to the tropicalizations of all the polynomials in $\mathcal{P}$ or in $I$, respectively.

     \item The \textbf{non-negative tropical prevariety}, $\overline{\textnormal{trop}}^{\geq 0}(\mathcal P)$ or $\overline{\textnormal{trop}}^{\geq 0}(I)$, is the set of simultaneous positive solutions of the tropicalizations of all the polynomials in $\mathcal{P}$ or in $I$, respectively.
 \end{itemize}

\end{definition}

\ptitle{Intuition behind positive tropical solutions} Solutions of tropicalizations of polynomials can alternatively be described in a way that more clearly explains the term ``positive solution". Let $\mathcal{C}=\bigcup_{n=1}^\infty\mathbb{C}((t^{1/n}))$ be the field of \textit{Puisseux series} over $\mathbb{C}$. A Puisseux series $p(t)\in \mathcal{C}$ has a term with a lowest exponent, say $at^{u}$ with $a\in \mathbb{C}^*$ and $u\in\mathbb{Q}$. In this case, we define $\textnormal{val}(p(t))=u$. Also, we will define the semifield $\mathcal{R}^+$ to be the set of $p(t)$ in $\mathcal{C}$ where the coefficient of $t^{\textnormal{val}(p(t))}$ is in $\mathbb{R}^+$. In fact, $\mathcal{R}^+$ and $\mathcal{C}$ can be thought of as analogous to $\mathbb{R}^+$ and $\mathbb{C}$, respectively. Given an ideal $I\trianglelefteq \mathcal{\mathbb{C}}[x_1,\cdots x_n]$, let $V(I)\subseteq \mathcal{C}^n$ be the variety where all polynomials in $I$ vanish. We define the \textit{positive part} of this variety to be $V^+(I)=V(I)\cap \mathcal{({R}^+)}^n$.

\begin{proposition}[\cite{SS} Theorem 2.1 and \cite{SW} Proposition 2.2]\label{otherdef}

Let $I$ be an ideal of $\mathbb{C}[x_1,\cdots, x_n]$. Then $\overline{\textnormal{trop}}(I)=\overline{\textnormal{val}(V(I))}$ and $\overline{\textnormal{trop}}^{\geq0}(I)=\overline{\textnormal{val}(V^+(I))}$, where $\overline{\textnormal{val}(V(I))}$ and $\overline{\textnormal{val}(V^+(I))}$ are the closures of $\textnormal{val}(V(I))$ and $\textnormal{val}(V^+(I))$, respectively.

\end{proposition}

\ptitle{The tropical flag variety and the Flag Dressian} Having introduced $Fl_n$, we now define two tropical analogues of this space along with their totally non-negative parts. Recall that $\mathfrak{P}_{IP;n}$ is the set of incidence-Pl{\"u}cker  relations and $I_{IP;n}$ is the ideal generated by those relations.

\begin{definition}
 We define the \textbf{tropical complete flag variety} to be $trFl_n=\overline{\textnormal{trop}}(I_{IP;n})$ and the \textbf{totally non-negative tropical complete flag variety} to be
 $trFl^{\geq 0}_n=\overline{\textnormal{trop}}^{\geq 0}(I_{IP;n})$. We define the \textbf{complete flag Dressian} to be $FlDr_n=\overline{\textnormal{trop}}(\mathfrak{P}_{IP;n})$ and the \textbf{totally non-negative complete flag Dressian} to be $FlDr_n^{\geq 0}=\overline{\textnormal{trop}}^{\geq0}(\mathfrak{P}_{IP;n})$.

\end{definition}

\ptitle{Prelude and motivation of equality of non-negative parts of Dressian and TFV} \cref{mainthm} will show that $trFl^{\geq 0}_n$ and $FlDr_n^{\geq 0}$ coincide. Note that this is not obvious, since a point in $trFl_n^{\geq 0}$ satisfies more relations than a point in $FlDr_n^{\geq 0}$. In fact, in general, the tropical prevariety of a collection of polynomials will properly contain the tropical prevariety of the ideal those polynomials generate. In the specific case of the complete flag variety, it is shown in \cite{BEZ}*{Example 5.2.4} that for $n\geq 6$, $FlDr_n$ properly contains $trFl_n$. Before getting to \cref{mainthm}, we need to discuss one other type of Dressian.

\begin{definition}
   The \textbf{support} of $P\in\mathbb{T}\mathbb{P}^{{n\choose 1}-1}\times\cdots\times\mathbb{T}\mathbb{P}^{{n\choose n-1}-1}$ is the set $\left\{I\subset [n]\left|P_I\neq \infty\right.\right\}$.
  \end{definition}

  \ptitle{Thee term flag Dressian and why we want it}
  \begin{definition}
   Let $\mathfrak{P}^{3\textnormal{ term}}_{IP;n}$ be the set of incidence-Pl{\"u}cker  relations with precisely three terms. We denote by $FlDr^{3M}_n$ the subset of $\overline{\textnormal{trop}}(\mathfrak{P}^{3\textnormal{ term}}_{IP;n})$ consisting of points whose supports form a flag matroid. We call this the \textbf{three-term complete flag Dressian}. Similarly, we denote by ${(FlDr^{3M}_n)}^{\geq 0}$ the subset of $\overline{\textnormal{trop}}^{\geq 0}(\mathfrak{P}^{3\textnormal{ term}}_{IP;n})$ consisting of points whose supports form a flag matroid, which we call the \textbf{totally non-negative three-term complete flag Dressian}.
  \end{definition}

 We can write down the following complete flag version of the fact that the Dressian is cut out by tropical three term Pl{\"u}cker  relations \cite{Mur2}*{Theorem 5.2.25}.
 \ptitle{Equality of the flag Dressian and three-term flag Dressian}
 \begin{theorem}\label{threegen}
The sets $FlDr^{3M}_n$ and $FlDr_n$ are equal.

 \end{theorem}

We now shift our attention to the non-negative parts of the tropical varieties we have introduced. For $v\leq w$ in the Bruhat order with $r=\ell(w)-\ell(v)$, let $\Phi_{v,w}:\mathbb{R}_{>0}^r\rightarrow \mathbb{R}\mathbb{P}^{{n\choose 1}-1}\times\cdots\times\mathbb{R}\mathbb{P}^{{n\choose n-1}-1}$ be the map which takes a collection of $\bm{a}\in \mathbb{R}_{>0}^r$ to the Pl{\"u}cker  coordinates of the matrix $M_{v,w}(\bm{a})$, in the notation of \cref{marshrietsch}. Note that by construction, this map consists of a collection of polynomials in the $a_i$, and so we can tropicalize this map, obtaining a map $\textnormal{Trop}\; \Phi:\mathbb{R}^r\rightarrow \mathbb{T}\mathbb{P}^{{n\choose 1}-1}\times\cdots\times\mathbb{T}\mathbb{P}^{{n\choose n-1}-1}$. The following corollary can be deduced from \cref{nonnegPluckCoords} with little extra work, and then put to use to help prove our second main result.

\begin{cor}\label{tropvw}
Every point in ${(FlDr^{3M}_n)}^{\geq 0}$ lies in the image of $\textnormal{Trop}\; \Phi_{v,w}$ for some $v\leq w$.
\end{cor}

\ptitle{The main theorem}
\begin{theorem} \label{mainthm}
The following sets are equal:
\begin{enumerate}
    \item The TNN topical flag variety $trFl^{\geq 0}_n$,
    \item The TNN three-term complete flag Dressian ${(FlDr^{3M}_n)}^{\geq 0}$,
    \item The TNN complete flag Dressian $FlDr_n^{\geq 0}$.
\end{enumerate}
\end{theorem}

\bibliographystyle{plain}