%% if you are submitting an initial manuscript then you should have submission as an option here
%% if you are submitting a revised manuscript then you should have revision as an option here
%% otherwise options taken by the article class will be accepted
\documentclass[finalversion]{FPSAC2023}
\articlenumber{45}
%% but DO NOT pass any options (or change anything else anywhere) which alters page size / layout / font size etc

%% note that the class file already loads {amsmath, amsthm, amssymb}

\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}

%\usepackage{lipsum}
\usepackage{float}
\usepackage{amsfonts,latexsym,mathtools}
\usepackage{ytableau}
\usepackage{centernot}
\usepackage{tikz-cd}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usepackage{stmaryrd}
\usepackage{wrapfig}
 \usepackage{url}
\usetikzlibrary{calc, shapes, backgrounds,arrows,positioning,plotmarks}
\tikzset{>=stealth',
  head/.style = {fill = white, text=black},
  plaque/.style = {draw, rectangle, minimum size = 10mm}, 
  pil/.style={->,thick},
  junct/.style = {draw,circle,inner sep=0.5pt,outer sep=0pt, fill=black}
  }
  \newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{falsehood}[theorem]{Falsehood}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
% \newenvironment{example}
%   {\pushQED{\qed}\renewcommand{\qedsymbol}{$\diamondsuit$}\examplex}
%   {\popQED\endexamplex}
\newtheorem{xca}[theorem]{Exercise}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\numberwithin{equation}{section}
\usepackage{tikz}
\newcommand{\Plus}{\mathord{\begin{tikzpicture}[baseline=0ex, line width=1.2, scale=0.13]
\draw (1,0) -- (1,2);
\draw (0,1) -- (2,1);
\end{tikzpicture}}}
% Fancy comments


\usepackage[colorinlistoftodos]{todonotes}
\newcommand{\jenna}[1]{\todo[size=\tiny,color=red!30]{#1 \\ \hfill --- Jenna}}
\newcommand{\Jenna}[1]{\todo[size=\tiny,inline,color=red!30]{#1
      \\ \hfill --- Jenna}}
\newcommand{\colleen}[1]{\todo[size=\tiny,color=blue!30]{#1 \\ \hfill --- Colleen}}
\newcommand{\Colleen}[1]{\todo[size=\tiny,inline,color=blue!30]{#1
      \\ \hfill --- Colleen}}
\newcommand{\anna}[1]{\todo[size=\tiny,color=green!30]{#1 \\ \hfill --- Anna}}
\newcommand{\Anna}[1]{\todo[size=\tiny,inline,color=green!30]{#1
      \\ \hfill --- Anna}}

% use these commands for typesetting doi and arXiv references in the bibliography
% \newcommand{\doi}[1]{\href{https://doi.org/#1}{\texttt{doi:#1}}}
\newcommand{\arxiv}[1]{\href{https://arxiv.org/abs/#1}{\texttt{arXiv:#1}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  MACROS for this particular,document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
\newcommand \mdCR[1]{{\tt md}(#1)}
\newcommand \maCR[1]{{\tt ma}(#1)}
\newcommand{\gTab}{{\sf Tab}}

\newcommand{\code}{{\sf code}}

\newcommand{\spec}{{\rm Spec}}

\newcommand \partitions[1]{\mathcal P_{#1}}
\newcommand \avoid[1]{S_{#1}^{321-\text{av}}}

\newcommand\mydef[1]{{\bf #1}}

\newcommand{\onebox}{of type 2}
\newcommand{\gronebox}{of type 1}

\newcommand{\FSVT}{{\sf FSVT}}
\newcommand{\FSVD}{{\sf FSVD}}
\newcommand{\maxexcited}{D_{\tt top}}
\newcommand{\minexcited}{D_{\tt bot}}

\newcommand \trail[1]{{\sf trail}_{#1}}
\newcommand \room[1]{{\sf trail}_{#1}}

%Coded based on subset of grid, so same notation for vex / diagram ok. 
\newcommand{\SVT}{{\sf SVT}}

% essential set
\newcommand{\Ess}{{\sf Ess}}
\newcommand{\GL}{{\rm GL}}


%demazure product

\newcommand{\dem}{\delta}
%young diagram
\newcommand{\yd}{{\sf YD}}

\newcommand{\Pipes}{{\sf Pipes}}

\newcommand{\KPipes}{\overline{\sf Pipes}}

%size of sylvester triangle
\newcommand{\sv}{{\sf sv}}

% truncate columns from parition
\newcommand{\trunc}{{\sf trunc}}

%I have no clue what to call this so I made a macro.  -Anna
\newcommand{\incstat}{ \alpha}

\newcommand{\excited}{{\sf ExcitedYD}}
\newcommand{\kexcited}{{\sf KExcitedYD}}

\newcommand{\skewexcited}{{\sf SEYD}}

\newcommand{\kskewexcited}{\overline{\sf SEYD}}

\newcommand{\wt}{{\tt wt}}

\newcommand{\core}{{\sf core}}

% Patch assoc to v
\newcommand\codePD[1]{{\mathcal{R}_{#1}}}

% permutation assoc to pipe dream
\newcommand \permPD[1]{{\sf perm}(#1)}


%%%%%%%%%

%Symmetric group
\newcommand{\Sym}{S}

%CM regularity
\newcommand{\reg}{{\rm reg}}

%Diagonals and antidiagonals
\newcommand{\maxsizediag}{\rho_d}
\newcommand{\maxsizeantidiag}{\rho_a}

%shortcut for "fake" diagonal formula for 1432-avoiding
\newcommand{\diagstat}{f_d}


%shortcut for "fake" diagonal formula for 2143-avoiding
\newcommand{\antidiagstat}{f_a}

\newcommand{\pdTab}{{\sf eTab}}

\newcommand{\dist}{{\rm dist}}

\newcommand{\indec}{{\text indecomposable}}

\newcommand{\topPatch}{{\sf imComp}}

%% define your title in the usual way
\title[Regularity of $321$-avoiding Kazhdan--Lusztig varieties]{ Castelnuovo--Mumford regularity for $321$-avoiding Kazhdan--Lusztig varieties}

%% define your authors in the usual way
%% use \addressmark{1}, \addressmark{2} etc for the institutions, and use \thanks{} for contact details
\author{
Colleen Robichaux\thanks{\href{mailto:robichaux@ucla.edu}{robichaux@ucla.edu}. Colleen Robichaux was supported by the NSF GRFP under Grant No. DGE 1746047 and NSF RTG Grant No. DMS 1937241.
}\addressmark{1}}

%% then use \addressmark to match authors to institutions here
\address{\addressmark{1} Dept.~of Mathematics,
University of California, Los Angeles,
Los Angeles, CA  90095, USA}

%% put the date of submission here
\received{\today}

%% leave this blank until submitting a revised version
%\revised{}

%% put your English abstract here, or comment this out if you don't have one yet
%% please don't use custom commands in your abstract / resume, as these will be displayed online
%% likewise for citations -- please don't use \cite, and instead write out your citation as something like (author year)
\abstract{We introduce an algorithm to compute the degrees of 321-avoiding unspecialized Grothendieck polynomials. Our result provides an algorithm to compute the Castelnuovo--Mumford regularity of 321-avoiding Kazhdan--Lusztig ideals. This extends the work of an earlier paper of Rajchgot, the author, and Weigandt (2022) which gives a formula in the case of Grassmannian Kazhdan--Lusztig ideals. 
% This 
}

%% put your French abstract here, or comment this out if you don't have one
% \resume{\lipsum[2]}

%% put your keywords here, or comment this out if you don't have them yet
\keywords{Kazhdan--Lusztig varieties, Grothendieck polynomials, Castelnuovo--\-Mum\-ford regularity, excited Young diagrams}

%% you can include your bibliography however you want, but using an external .bib file is STRONGLY RECOMMENDED and will make the editor's life much easier
%% regardless of how you do it, please use numerical citations; i.e., [xx, yy] in the text

%% this sample uses biblatex, which (among other things) takes care of URLs in a more flexible way than bibtex
%% but you can use bibtex if you want
\usepackage[backend=bibtex]{biblatex}
\addbibresource{FPSAC23reg.bib}
%% note the \printbibliography command at the end of the file which goes with these biblatex commands

\begin{document}

\maketitle
%% note that you DO NOT have to put your abstract here -- it is generated by \maketitle and the \abstract and \resume commands above


\section{Introduction}
A.~Woo and A.~Yong \cite{WooYongSings} introduced
\emph{Kazhdan--Lusztig varieties} to study singularities of Schubert varieties. Kazhdan--Lusztig varieties are generalized determinantal varieties which include \emph{Matrix Schubert varieties} \cite{Fulton.Flags} as special cases. Another well-studied class of these Kazhdan--Lusztig varieties is the \emph{ladder determinantal varieties}, introduced by S.~S.~Abhyankar \cite{Abhyankar}. 

The \emph{Castelnuovo--Mumford regularity} of a graded module is an invariant used to measure its complexity. In general, this regularity may be computed using the minimal free resolution of the module. 
Using the fact that Kazhdan--Lusztig varieties are Cohen--Macaulay, one may instead compute their regularities combinatorially in terms of degrees of \emph{unspecialized Grothendieck polynomials}.


% \Colleen{fix module, variety, etc}
% Let $\mathbb{C}$ be a field. Let $S = \mathbb{C}[x_1,\dots, x_n]$ be a polynomial ring with the standard grading, $\text{deg}(x_i) = 1$, and let  $I\subseteq S$ be a homogeneous ideal. 
% When $S/I$ is Cohen-Macaulay, as is the case throughout this paper, the regularity of $S/I$ is known to satisfy 
% \begin{equation}\label{eq:regFormula}
%     \reg(S/I)=\deg  K(S/I;t)-{\rm ht}_S(I),
% \end{equation}
%  where $K(S/I;t)$ is the \emph{K-polynomial} of $S/I$ and ${\rm ht}_S(I)$ is the height of $I$ in $S$. 

Our main results \cref{thm:321321IndDeg,thm:321321IndReg} extend the work of \cite{RRW} to provide an algorithm which computes the Castelnuovo--Mumford regularity for Kazhdan--Lusztig varieties indexed by a pair of $321$-avoiding permutations. These results continue the work of J.~Rajchgot, the author, and A.~Weigandt \cite{RRW} which provides a combinatorial formula to compute the regularity for Kazhdan--Lusztig varieties indexed by a pair of grassmannian permutations. This is an extended abstract of \cite{Rob321}.

Due to a correspondence with matrix Schubert varieties in this case, this result in \cite{RRW} may be recovered using the results of O.~Pechenik--D.~Speyer--A.~Weigandt \cite{PSW}. The work in \cite{PSW} uses different techniques to compute the regularity of arbitrary matrix Schubert varieties. Our paper extends the techniques used in \cite{RRW} to compute the regularities of certain Kazhdan--Lusztig varieties which are \emph{not} isomorphic to matrix Schubert varieties. That is, the results of this abstract cannot, in general, be recovered using \cite{PSW}.
% This algorithm generalizes work of Abhyankar--Krattenthaler \cite{GK15} which computes the closely related $a$-invariant of certain \emph{two sided mixed ladder determinantal varieties}. 


\section{Combinatorial Background}
\label{sec:skewexcited}
In this section we define the underlying combinatorial objects used for our algorithm.



\subsection{Pipe complexes}
\label{sec:pipeCompl}
Let $S_n$ denote the symmetric group on $n$ letters.
The \mydef{Rothe diagram} of $u\in \Sym_n$ is the subset
	\[ D(u)= \{(i, j)\in [n]\times [n] \,|  \,  u_i > j \text{ and } u^{-1}_j > i\}.\]
	We illustrate $D(u)$ as cells remaining in the $n\times n$ grid after placing points in cells $(i,u_i)$ for each $i\in[n]$ and drawing a line through cells which appear weakly south or weakly east of each $(i,u_i)$. Let $\ell(u):=\# D(u)$ denote the {\bf Coxeter length} of $u$. 



\begin{example}\label{ex:Rothe} Below are $D(v)$ and $D(w)$ for $v=46128935(10)7$ and $w=412368597(10)$.
    \[
\begin{tikzpicture}[scale=.35]
\draw (0,0) rectangle (10,10);

 \draw (0,10) rectangle (3,8);
\draw (0,9)--(3,9);
\draw (1,10)--(1,8);
\draw (2,10)--(2,8);

\draw (4,8) rectangle (5,9);


\draw (2,6) rectangle (3,4);
 \draw (2,5)--(3,5);
 
\draw (4,6) rectangle (5,4);
 \draw (4,5)--(5,5);

\draw (6,6) rectangle (7,4);
 \draw (6,5)--(7,5);

\draw (6,1) rectangle (7,2);

 


\filldraw (3.5,9.5) circle (.5ex);
\draw[line width = .2ex] (3.5,0) -- (3.5,9.5) -- (10,9.5);
\filldraw (5.5,8.5) circle (.5ex);
\draw[line width = .2ex] (5.5,0) -- (5.5,8.5) -- (10,8.5);
\filldraw (0.5,7.5) circle (.5ex);
\draw[line width = .2ex] (0.5,0) -- (0.5,7.5) -- (10,7.5);
\filldraw (1.5,6.5) circle (.5ex);
\draw[line width = .2ex] (1.5,0) -- (1.5,6.5) -- (10,6.5);
\filldraw (7.5,5.5) circle (.5ex);
\draw[line width = .2ex] (7.5,0) -- (7.5,5.5) -- (10,5.5);
\filldraw (8.5,4.5) circle (.5ex);
\draw[line width = .2ex] (8.5,0) -- (8.5,4.5) -- (10,4.5);
\filldraw (2.5,3.5) circle (.5ex);
\draw[line width = .2ex] (2.5,0) -- (2.5,3.5) -- (10,3.5);
\filldraw (4.5,2.5) circle (.5ex);
\draw[line width = .2ex] (4.5,0) -- (4.5,2.5) -- (10,2.5);
\filldraw (9.5,1.5) circle (.5ex);
\draw[line width = .2ex] (9.5,0) -- (9.5,1.5) -- (10,1.5);
\filldraw (6.5,0.5) circle (.5ex);
\draw[line width = .2ex] (6.5,0) -- (6.5,0.5) -- (10,0.5);
\end{tikzpicture}
\hspace{3em} 
\begin{tikzpicture}[scale=.35]
\draw (0,0) rectangle (10,10);


 \draw (0,10) rectangle (3,9);
 \draw (1,10) -- (1,9);
 \draw (2,10) -- (2,9);
 
\draw (4,6) rectangle (5,4);
 \draw (4,5)--(5,5);

\draw (6,5) rectangle (7,4);

\draw (6,3) rectangle (7,2);



\filldraw (3.5,9.5) circle (.5ex);
\draw[line width = .2ex] (3.5,0) -- (3.5,9.5) -- (10,9.5);
\filldraw (0.5,8.5) circle (.5ex);
\draw[line width = .2ex] (0.5,0) -- (0.5,8.5) -- (10,8.5);
\filldraw (1.5,7.5) circle (.5ex);
\draw[line width = .2ex] (1.5,0) -- (1.5,7.5) -- (10,7.5);
\filldraw (2.5,6.5) circle (.5ex);
\draw[line width = .2ex] (2.5,0) -- (2.5,6.5) -- (10,6.5);
\filldraw (5.5,5.5) circle (.5ex);
\draw[line width = .2ex] (5.5,0) -- (5.5,5.5) -- (10,5.5);
\filldraw (7.5,4.5) circle (.5ex);
\draw[line width = .2ex] (7.5,0) -- (7.5,4.5) -- (10,4.5);
\filldraw (4.5,3.5) circle (.5ex);
\draw[line width = .2ex] (4.5,0) -- (4.5,3.5) -- (10,3.5);
\filldraw (8.5,2.5) circle (.5ex);
\draw[line width = .2ex] (8.5,0) -- (8.5,2.5) -- (10,2.5);
\filldraw (6.5,1.5) circle (.5ex);
\draw[line width = .2ex] (6.5,0) -- (6.5,1.5) -- (10,1.5);
\filldraw (9.5,0.5) circle (.5ex);
\draw[line width = .2ex] (9.5,0) -- (9.5,0.5) -- (10,0.5);
\end{tikzpicture}
% \vspace{-0.2cm}
\]
Here $\ell(w)=\# D(w)=7$.
\end{example}



Define an algebra over $\mathbb Z$ generated by $\{e_u \, | \, u\in S_n\}$ with multiplication such that
\[e_ue_{s_i}=
\begin{cases}
e_{us_i} &\text{if } \ell(us_i)>\ell(u) \\
e_u & \text{otherwise.}
\end{cases}\]
Here $s_i$ is the simple transposition permuting elements $i$ and $i+1$.







Label the boxes of $D(u)$ along rows so that $k$th  westmost box in row $i$
 is assigned the label $i+k-1$.
 Given $P\subseteq D(u)$ let ${\sf word}(P)$ in $D(u)$ be the sequence formed by reading the labels of $P$ in $D(u)$, moving east to west across rows, starting with the northmost row and progressing south. Define $I(u):={\sf word}(D(u))$ in $D(u)$. The \mydef{Demazure product} of ${\sf word}(P)$, denoted $\dem(P)$, is the permutation determined by \[e_{s_{i_1}}\cdots e_{s_{i_k}}=e_{\dem(P)},\]
 where ${\sf word}(P)=(i_1,i_2,\ldots,i_k)$.
 
 Take $v\geq w\in S_n$, where $\geq$ denotes Bruhat order on $S_n$. 
 % Similarly, define  $D^{SW}(v,w)\subseteq D(v)$ be the boxes corresponding to the latest subsequence of ${\sf word}(D(v))$ that forms $I(w)$. These $D^{NE}(v,w),D^{SW}(v,w)$ exist since $v\geq w$. 
 Define \[\Pipes(v,w)=\{P\subseteq D(v)\,|  \,{\sf word}(P)=(i_1,i_2,\ldots,i_{\ell(w)}) \text{ in } D(v) \text{ and } \dem(P)=w\}.\]  
 Similarly, let \[\KPipes(v,w)=\{P\subseteq D(v)\,|  \,\dem(P)=w\}.\]
 We illustrate $P\subseteq D(v)$ by marking $(i,j)\in D(v)$ with a $+$ whenever $(i,j)\in P$.
Lastly, let $D^{NE}(v,w)\subseteq D(v)$ be the boxes corresponding to the earliest subsequence of ${\sf word}(D(v))$ that forms $I(w)$.  Since $v\geq w$, $D^{NE}(v,w)$ exists.
\begin{example}\label{ex:pipeSubword} The left two diagrams are $D(v)$ and $D(w)$ for $w,v$ as in \cref{ex:Rothe} with $I(v)$ and $I(w)$ labeled. This gives $I(v)=(3,2,1,5,7,6,8)$ in $D(v)$. 
% To the right are $P_1,P_2\in \KPipes(v,w)$. 
The third diagram is $D^{NE}(v,w)\in \Pipes(v,w)\subseteq  \KPipes(v,w)$ and the fourth is another $P\in \KPipes(v,w)$.
% and the fourth is $D^{SW}(v,w)$.
    \[
\begin{tikzpicture}[scale=.35]
\draw (0,0) rectangle (10,10);

 \draw (0,10) rectangle (3,8);
\draw (0,9)--(3,9);
\draw (1,10)--(1,8);
\draw (2,10)--(2,8);

\draw (4,8) rectangle (5,9);


\draw (2,6) rectangle (3,4);
 \draw (2,5)--(3,5);
 
\draw (4,6) rectangle (5,4);
 \draw (4,5)--(5,5);

\draw (6,6) rectangle (7,4);
 \draw (6,5)--(7,5);

\draw (6,1) rectangle (7,2);

 
\put(3,92){\scriptsize{$1$}}
\put(13,92){\scriptsize{$2$}}
\put(23,92){\scriptsize{$3$}}
\put(3,82){\scriptsize{$2$}}
\put(13,82){\scriptsize{$3$}}
\put(23,82){\scriptsize{$4$}}

\put(43,82){\scriptsize{$5$}}


\put(23,52){\scriptsize{$5$}}
\put(43,52){\scriptsize{$6$}}
\put(63,52){\scriptsize{$7$}}
\put(23,42){\scriptsize{$6$}}
\put(43,42){\scriptsize{$7$}}
\put(63,42){\scriptsize{$8$}}

\put(63,12){\scriptsize{$9$}}


\filldraw (3.5,9.5) circle (.5ex);
\draw[line width = .2ex] (3.5,0) -- (3.5,9.5) -- (10,9.5);
\filldraw (5.5,8.5) circle (.5ex);
\draw[line width = .2ex] (5.5,0) -- (5.5,8.5) -- (10,8.5);
\filldraw (0.5,7.5) circle (.5ex);
\draw[line width = .2ex] (0.5,0) -- (0.5,7.5) -- (10,7.5);
\filldraw (1.5,6.5) circle (.5ex);
\draw[line width = .2ex] (1.5,0) -- (1.5,6.5) -- (10,6.5);
\filldraw (7.5,5.5) circle (.5ex);
\draw[line width = .2ex] (7.5,0) -- (7.5,5.5) -- (10,5.5);
\filldraw (8.5,4.5) circle (.5ex);
\draw[line width = .2ex] (8.5,0) -- (8.5,4.5) -- (10,4.5);
\filldraw (2.5,3.5) circle (.5ex);
\draw[line width = .2ex] (2.5,0) -- (2.5,3.5) -- (10,3.5);
\filldraw (4.5,2.5) circle (.5ex);
\draw[line width = .2ex] (4.5,0) -- (4.5,2.5) -- (10,2.5);
\filldraw (9.5,1.5) circle (.5ex);
\draw[line width = .2ex] (9.5,0) -- (9.5,1.5) -- (10,1.5);
\filldraw (6.5,0.5) circle (.5ex);
\draw[line width = .2ex] (6.5,0) -- (6.5,0.5) -- (10,0.5);
\end{tikzpicture}
\hspace{1.5em} 
\begin{tikzpicture}[scale=.35]
\draw (0,0) rectangle (10,10);


 \draw (0,10) rectangle (3,9);
 \draw (1,10) -- (1,9);
 \draw (2,10) -- (2,9);
 
\draw (4,6) rectangle (5,4);
 \draw (4,5)--(5,5);

\draw (6,5) rectangle (7,4);

\draw (6,3) rectangle (7,2);

\put(3,92){\scriptsize{$1$}}
\put(13,92){\scriptsize{$2$}}
\put(23,92){\scriptsize{$3$}}


\put(43,52){\scriptsize{$5$}}
\put(43,42){\scriptsize{$6$}}
\put(63,42){\scriptsize{$7$}}

\put(63,22){\scriptsize{$8$}}


\filldraw (3.5,9.5) circle (.5ex);
\draw[line width = .2ex] (3.5,0) -- (3.5,9.5) -- (10,9.5);
\filldraw (0.5,8.5) circle (.5ex);
\draw[line width = .2ex] (0.5,0) -- (0.5,8.5) -- (10,8.5);
\filldraw (1.5,7.5) circle (.5ex);
\draw[line width = .2ex] (1.5,0) -- (1.5,7.5) -- (10,7.5);
\filldraw (2.5,6.5) circle (.5ex);
\draw[line width = .2ex] (2.5,0) -- (2.5,6.5) -- (10,6.5);
\filldraw (5.5,5.5) circle (.5ex);
\draw[line width = .2ex] (5.5,0) -- (5.5,5.5) -- (10,5.5);
\filldraw (7.5,4.5) circle (.5ex);
\draw[line width = .2ex] (7.5,0) -- (7.5,4.5) -- (10,4.5);
\filldraw (4.5,3.5) circle (.5ex);
\draw[line width = .2ex] (4.5,0) -- (4.5,3.5) -- (10,3.5);
\filldraw (8.5,2.5) circle (.5ex);
\draw[line width = .2ex] (8.5,0) -- (8.5,2.5) -- (10,2.5);
\filldraw (6.5,1.5) circle (.5ex);
\draw[line width = .2ex] (6.5,0) -- (6.5,1.5) -- (10,1.5);
\filldraw (9.5,0.5) circle (.5ex);
\draw[line width = .2ex] (9.5,0) -- (9.5,0.5) -- (10,0.5);
\end{tikzpicture}
\hspace{1.5em} 
\begin{tikzpicture}[scale=.35]
\draw (0,0) rectangle (10,10);

 \draw (0,10) rectangle (3,8);
\draw (0,9)--(3,9);
\draw (1,10)--(1,8);
\draw (2,10)--(2,8);

\draw (4,8) rectangle (5,9);


\draw (2,6) rectangle (3,4);
 \draw (2,5)--(3,5);
 
\draw (4,6) rectangle (5,4);
 \draw (4,5)--(5,5);

\draw (6,6) rectangle (7,4);
 \draw (6,5)--(7,5);

\draw (6,1) rectangle (7,2);


\put(0.5,91.5){$+$}
\put(10.5,91.5){$+$}
\put(20.5,91.5){$+$}

\put(40.5,82){$+$}


\put(40.5,52){$+$}
\put(60.5,52){$+$}
\put(60.5,42){$+$}
 

\filldraw (3.5,9.5) circle (.5ex);
\draw[line width = .2ex] (3.5,0) -- (3.5,9.5) -- (10,9.5);
\filldraw (5.5,8.5) circle (.5ex);
\draw[line width = .2ex] (5.5,0) -- (5.5,8.5) -- (10,8.5);
\filldraw (0.5,7.5) circle (.5ex);
\draw[line width = .2ex] (0.5,0) -- (0.5,7.5) -- (10,7.5);
\filldraw (1.5,6.5) circle (.5ex);
\draw[line width = .2ex] (1.5,0) -- (1.5,6.5) -- (10,6.5);
\filldraw (7.5,5.5) circle (.5ex);
\draw[line width = .2ex] (7.5,0) -- (7.5,5.5) -- (10,5.5);
\filldraw (8.5,4.5) circle (.5ex);
\draw[line width = .2ex] (8.5,0) -- (8.5,4.5) -- (10,4.5);
\filldraw (2.5,3.5) circle (.5ex);
\draw[line width = .2ex] (2.5,0) -- (2.5,3.5) -- (10,3.5);
\filldraw (4.5,2.5) circle (.5ex);
\draw[line width = .2ex] (4.5,0) -- (4.5,2.5) -- (10,2.5);
\filldraw (9.5,1.5) circle (.5ex);
\draw[line width = .2ex] (9.5,0) -- (9.5,1.5) -- (10,1.5);
\filldraw (6.5,0.5) circle (.5ex);
\draw[line width = .2ex] (6.5,0) -- (6.5,0.5) -- (10,0.5);
\end{tikzpicture}
\hspace{1.5em} 
\begin{tikzpicture}[scale=.35]
\draw (0,0) rectangle (10,10);

 \draw (0,10) rectangle (3,8);
\draw (0,9)--(3,9);
\draw (1,10)--(1,8);
\draw (2,10)--(2,8);

\draw (4,8) rectangle (5,9);


\draw (2,6) rectangle (3,4);
 \draw (2,5)--(3,5);
 
\draw (4,6) rectangle (5,4);
 \draw (4,5)--(5,5);

\draw (6,6) rectangle (7,4);
 \draw (6,5)--(7,5);

\draw (6,1) rectangle (7,2);

\put(40.5,82){$+$}

 
\put(0.5,91.5){$+$}
\put(10.5,91.5){$+$}
\put(20.5,91.5){$+$}

\put(20.5,52){$+$}


\put(20.5,42){$+$}
\put(60.5,52){$+$}
\put(60.5,42){$+$}


\filldraw (3.5,9.5) circle (.5ex);
\draw[line width = .2ex] (3.5,0) -- (3.5,9.5) -- (10,9.5);
\filldraw (5.5,8.5) circle (.5ex);
\draw[line width = .2ex] (5.5,0) -- (5.5,8.5) -- (10,8.5);
\filldraw (0.5,7.5) circle (.5ex);
\draw[line width = .2ex] (0.5,0) -- (0.5,7.5) -- (10,7.5);
\filldraw (1.5,6.5) circle (.5ex);
\draw[line width = .2ex] (1.5,0) -- (1.5,6.5) -- (10,6.5);
\filldraw (7.5,5.5) circle (.5ex);
\draw[line width = .2ex] (7.5,0) -- (7.5,5.5) -- (10,5.5);
\filldraw (8.5,4.5) circle (.5ex);
\draw[line width = .2ex] (8.5,0) -- (8.5,4.5) -- (10,4.5);
\filldraw (2.5,3.5) circle (.5ex);
\draw[line width = .2ex] (2.5,0) -- (2.5,3.5) -- (10,3.5);
\filldraw (4.5,2.5) circle (.5ex);
\draw[line width = .2ex] (4.5,0) -- (4.5,2.5) -- (10,2.5);
\filldraw (9.5,1.5) circle (.5ex);
\draw[line width = .2ex] (9.5,0) -- (9.5,1.5) -- (10,1.5);
\filldraw (6.5,0.5) circle (.5ex);
\draw[line width = .2ex] (6.5,0) -- (6.5,0.5) -- (10,0.5);
\end{tikzpicture}
% \vspace{-0.2cm}
\]
\end{example}
 As defined by Woo--Yong \cite{WooYongGrobner}, the \mydef{unspecialized Grothendieck polynomial} is 
 \begin{equation}
 \label{eq:unspecgroth}
     \mathfrak G_{v,w}(\mathbf t)=\sum_{P\in\KPipes(v,w)}(-1)^{\# P-\ell(w)} \prod_{(i,j)\in P}t_{ij}.
 \end{equation}
 By setting $v=w_0\in S_n$ and specializing variables $t_{ij}$, these unspecialized Grothendieck polynomials recover the \emph{double Grothendieck polynomials} of \cite{LS82}. 
Note that we follow the conventions of \cite{RRW} for $\mathfrak G_{v,w}(\mathbf t)$, which differ from those in \cite{WooYongGrobner}.


\subsection{Skew Excited Young Diagrams}
% Here we expand the definitions presented in \cref{sec:EYD} for $u\in \Sym_n$ $321$-avoiding.
A permutation $u\in \Sym_n$ is \mydef{$321$-avoiding} if there does not exist a \emph{$321$ pattern} in $u$, i.e., indices
$i<j<k$ such that $u_k<u_j<u_i$. 
For example, $u=1\underline{7}2\underline{5}83\underline{4}6$ is not $321$-avoiding; we underlined the positions of a $321$ pattern. Let $\avoid{n}:=\{u\in S_n \,|\, u \text{ is } 321\text{-avoiding}\}$.



For this subsection assume $v\geq w$ where $v,w\in \avoid{n}$. Let \[\phi_v:\{P\subseteq D(v)\}\rightarrow \{S\subset [n]\times[n]\}\] be the map which deletes empty rows and columns of $D(v)$ from $P\subset D(v)$. The shape $\codePD{v}:=\phi_v(D(v))$ is a skew Young diagram, \emph{i.e.}, $\lambda / \mu$ for some partitions $\mu\subseteq\lambda$. Our conventions for drawing Young diagrams reflect the diagrams in English notation across the $y$-axis. Define $\maxexcited{(v,w)}:=\phi_v(D^{NE}(v,w))$. 


We visualize $D\subseteq\codePD{v}$ by marking $(i,j)\in [n]\times[n]$  with a $+$ when $(i,j)\in D$. In general, we call a collection of $+$'s inside $\codePD{v}$ a \mydef{diagram} in $\codePD{v}$. 

\begin{example}\label{ex:SEYDexSetup}
    For $v,w$ as in \cref{ex:pipeSubword}, the left picture is $\codePD{v}$, the middle is $\maxexcited{(v,w)}$, and the rightmost diagram is $\phi_v(P)$ for the rightmost $P$ in \cref{ex:pipeSubword}.
    \[\begin{picture}(280,50)
\put(0,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 \ &  \ &  \ \\
 \ &  \ & \ & \ \\
 \none &  \none & \ & \  & \ \\
  \none &  \none & \ & \  & \ \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\put(100,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 + &  + &  + \\
 \ &  \ & \ & + \\
 \none &  \none & \ & +  & + \\
  \none &  \none & \ & \  & + \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\put(200,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 + &  + &  + \\
 \ &  \ & \ & + \\
 \none &  \none & + & \  & + \\
  \none &  \none & + & \  & + \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\end{picture}
\]
\end{example}


% \Colleen{example}


An \mydef{excited move} of a diagram $D$ in $\codePD{v}$ is the operation on a $2\times 2$ subsquare of $D$ such that
\begin{equation}\label{eq:EYDsimple}
    \ytableausetup{boxsize=0.8em}
\begin{ytableau}
\, & + \\
& \ 
\end{ytableau}
\hspace{1em}
 \raisebox{-.2em}{$\mapsto$}
 \hspace{1em}
\begin{ytableau}
\ &\\
+ &
\end{ytableau} \ .
\end{equation}
 For this move to occur, the subsquare must be contained in $\codePD{v}$.
We let 
$\skewexcited(v,w)$ denote the set of $D\subseteq \codePD{v}$ which can be computed through sequential applications of excited moves to $\maxexcited{(v,w)}$. We call $D\in \skewexcited(v,w)$ a \mydef{skew excited Young diagram}.
% , see e.g., \cite[Lemma 7.4]{Weigandt.BPD}.  

 % \Colleen{might need to actually prove this}

We also may apply \mydef{K-theoretic excited moves} to diagrams in $\codePD{v}$
\begin{equation}\label{eq:EYDkTh}
    \ytableausetup{boxsize=0.8em}
\begin{ytableau}
\ & +\\
\ &
\end{ytableau}
\hspace{1em}
 \raisebox{-.2em}{$\mapsto$}
 \hspace{1em}
\begin{ytableau}
\, & + \\
+ & \ \\
\end{ytableau} \ ,
\end{equation}
again, where all cells pictured are contained in $\codePD{v}$.
Write $\kskewexcited(v,w)$ for the set of diagrams which can be obtained by sequential applications of excited and K-theoretic excited moves on $\maxexcited{(v,w)}$ in $\codePD{v}$. We say $D\in \kskewexcited(v,w)$ is a \mydef{K-theoretic skew excited Young diagram}.
Let $\#D$ denote the number of pluses in $D$. We say $D\in \kskewexcited(v,w)$ define to be \mydef{maximal} if $D'\in \kskewexcited(v,w)$ implies $\#D'\leq \#D$.

\begin{example}\label{ex:SEYDex}
    Continuing \cref{ex:SEYDexSetup}, the left two diagrams are in $\skewexcited(v,w)$. The right two diagrams are both maximal diagrams in $\kskewexcited(v,w)$.
    \[\begin{picture}(350,45)
\put(0,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
+ &  + &  + \\
 \ &  \ & \ & \ \\
 \none &  \none & + & \  & + \\
  \none &  \none & + & \  & + \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\put(100,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 + &  + &  + \\
 \ &  \ & \ & + \\
 \none &  \none & \ & \  & + \\
  \none &  \none & + & \  & + \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\put(200,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 + &  + &  + \\
 \ &  \ & \ & + \\
 \none &  \none & \ & +  & + \\
  \none &  \none & + & \  & + \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\put(300,35){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 + &  + &  + \\
 \ &  \ & \ & + \\
 \none &  \none & + & \  & + \\
  \none &  \none & + & \  & + \\
    \none &  \none & \none & \none  & \
\end{ytableau}}}
\end{picture}
\]
\end{example}


Using \cite{BergeronBilley} and the fact that $v,w\in\avoid{n}$ we obtain the following: 
\begin{proposition}\label{prop:EYDpipesbij}
   For $v\geq w$ where $v,w\in \avoid{n}$, the map $\phi_v$ restricted to $\KPipes{(v,w)}$ gives a bijection 
\begin{equation}\label{eq:unspGroth}
  \widetilde{\phi}_v:\KPipes(v,w)\rightarrow\kskewexcited(v,w)
\end{equation} 
such that for $P\in \KPipes(v,w)$, $\# P=\# \widetilde{\phi}_v(P)$.
\end{proposition}
%  \Colleen{add proof}   
% \begin{proof}
%     This statement follows for $\Pipes(v,w)\rightarrow\skewexcited(v,w)$ using \cite{BergeronBilley}
%     follows by the fact that since $w\in\avoid{n}$, the braid move is never employed. 
% \end{proof}




 Combining \cref{prop:EYDpipesbij} with Equation (\ref{eq:unspGroth}) produces the following result. 

 
 \begin{corollary}\label{cor:unspGrSEYD} Suppose $v,w\in S_n$. Then
\[\deg( \mathfrak G_{v,w}(\mathbf t))=\max\{\# D \, | \, D\in \kskewexcited(v,w)\}.\]
\end{corollary}
% \begin{proof}
% This follows by Equation (\ref{eq:unspGroth}) and the definition of $\#D$.
% \end{proof}


% \Colleen{update example}
\begin{example}\label{ex:degVWeyd}
 Since the rightmost diagram in \cref{ex:SEYDex} is maximal, $\deg(\mathfrak G_{v,w}(\mathbf t))=8$ by \cref{cor:unspGrSEYD}.
\end{example}


% By the definition of $\skewexcited(v,w)$, there is a unique diagram $D_{\sf bot}(v,w)$ in $\skewexcited(v,w)$ to which no excited moves can be applied. Through \cref{prop:EYDpipesbij}, $D_{\sf bot}(v,w)=\widetilde{\phi}(D^{SW}(v,w))$, where $D^{SW}(v,w)\subset D(v)$ is the subset of boxes corresponding to the latest subsequence of ${\sf word}(D(v))$ such that $\delta(D^{SW}(v,w))=w$.  In \cref{ex:SEYDex}, the leftmost diagram is $D_{\sf bot}(v,w)$.
% Let $\phi_{+}:D_{\sf top}(v,w)\rightarrow D_{\sf bot}(v,w)$ be such that $\phi_{+}(i,j)$ denotes the $+$ in $D_{\sf bot}(v,w)$ corresponding to the $+$ in position $(i,j)\in D_{\sf top}(v,w)$. 

%  We index $[n]\times [n]$ using matrix indexing and identify the northwest most box in $\codePD{v}$ with $(1,1)$.  

 % \begin{example}
 %     In \cref{ex:SEYDex} the middle diagram is $D_{\sf bot}(v,w)$. Then in this case $\phi_+(1,3)=(1,3)$ and $\phi_+(3,4)=(4,3)$.
 % \end{example}

In \cref{sec:321321alg} we give an algorithm to compute statistics $\Delta_{v,w}(q)$ from $\maxexcited{(v,w)}$ for certain $q\in\mathbb{Z}_{>0}$. Using \cref{cor:unspGrSEYD}, we prove the following. 
\begin{theorem}\label{thm:321321IndDeg} Suppose $v\geq w$, where $v,w\in \avoid{n}$.  
Then if $\maxexcited{(v,w)}=\bigcup_{q\in[s]}C_q$ where $C_q$ are the connected components of $\maxexcited{(v,w)}$,
% \[ \reg (\mathbb{C}[{\bf z}^v]/J_{v,w})=\sum_{q\in[s]}\sum_{k\in[\ell(q)]} \Delta_k(q).\]
\[\deg( \mathfrak G_{v,w}(\mathbf t))=\#D(w)+\sum_{q\in[s]}\Delta_{v,w}(q).\]
\end{theorem}

A proof sketch for \cref{thm:321321IndDeg} appears in \cref{sec:321321rec}.

% \Colleen{fix this}








\section{Castelnuovo--Mumford Regularity of Kazhdan--Lusztig varieties}
In this section, we define Castelnuovo--Mumford regularity and Kazhdan--Lusztig varieties. We then recall results of \cite{RRW} which provide combinatorial interpretations of the Castelnuovo--Mumford regularity of Kazhdan--Lusztig varieties.

\subsection{Castelnuovo--Mumford Regularity}
Let $S = \mathbb{C}[x_1,\ldots, x_n]$ be a polynomial ring with the standard grading and let $I\subseteq S$ be a homogeneous ideal. 
 The \mydef{Hilbert series} of $S/I$ is a formal power series
\[
H(S/I; t) = \sum_{k\in \mathbb{Z}}\text{dim}_{\mathbb{C}}((S/I)_{k}){t}^{k}
=\frac{K(S/I;t)}{(1-{t})^{n}}.
\]
The numerator of the Hilbert series $K(S/I;{t})\in \mathbb{C}[t^{\pm 1}]$ is the $\mathbf{K}$\mydef{-polynomial} of $S/I$. 
% When $S$ has the standard grading, that is $\text{deg}(x_i) = 1$, the K-polynomial is a Laurent polynomial in a single indeterminate $t$.
% For the rest of this subsection, assume that $S$ has the standard grading, and let $I\subseteq S$ be a homogeneous ideal. 
A minimal free resolution of $S/I$ is the complex
\[
 0 \rightarrow \bigoplus_jS(-j)^{\beta_{l,j}(S/I)}\rightarrow \bigoplus_jS(-j)^{\beta_{l-1,j}(S/I)}\rightarrow \cdots \rightarrow \bigoplus_jS(-j)^{\beta_{0,j}(S/I)} \rightarrow S/I \rightarrow 0,
\]
where $l\leq n$ and $S(-j)$ is the free $S$-module shifted by $j$ in degree. 
The \mydef{Castelnuovo-Mumford regularity} of $S/I$, written $\reg(S/I)$, is the statistic
\[
\reg(S/I):=\max\{j-i \,|  \, \beta_{i,j}(S/I)\neq 0\}.
\]
In cases where $S/I$ is Cohen-Macaulay,
\begin{equation}\label{eq:mainRegEquation}
\reg(S/I) = \text{deg }K(S/I;t) - \text{ht}_S I,
\end{equation}
where $\text{ht}_S I$ denotes the height of the ideal $I$. For more context, consult \cite[Lemma 2.5]{Benedetti.Varbaro}. 
% See, for example, \cite[Lemma 2.5]{Benedetti.Varbaro} for justification of this formula. 
% In this paper, we use Equation~\eqref{eq:mainRegEquation} to compute Castelnuovo-Mumford regularity of coordinate rings of certain matrix Schubert varieties and certain standard-graded Kazhdan--Lusztig varieties. 


\subsection{Kazhdan--Lusztig varieties}
% We next recall Kazhdan--Lusztig ideals, which were introduced by A. Woo and A. Yong in \cite{WooYongSings} to study singularities of Schubert varieties. 
% We follow the conventions of \cite{RRW}.
For $v\in S_n$, define $M^{(v)}=(m_{ij})$ to be the matrix such that for $i,j\in[n]$,
\[m_{ij}=
\begin{cases}
1 &\text{if } j=v_i, \\
z_{ij} & \text{if } (i,j)\in D(v),\\
0 & \text{ otherwise}.
\end{cases}\]
% to be the matrix with $1$'s at locations $(i,v_i)$,  indeterminate $z_{ij}$ in location $(i,j)\in D(v)$, and $0$'s elsewhere. 
Let $\mathbb{C}[{\bf z}^v]:= \mathbb{C}[z_{ij}\,|  \,(i,j)\in D(v)]$. For $v\geq w\in S_n$ the \mydef{Kazhdan--Lusztig ideal} $J_{v,w}\subseteq \mathbb{C}[{\bf z}^v]$ is defined by
\[
J_{v,w} = \langle r_w(i,j)+1 - \text{minors}  \text{ in } M^{(v)}_{[i],[j]}\,|  \, (i,j)\in D(w)\rangle,
\]
where  $M_{I,J}$ denote the submatrix of $M$ with row indices in $I$ and column indices in $J$ for $I,J\subseteq[n]$. As noted in \cite{RRW} when $v\in\avoid{n}$, $J_{v,w}$ is homogeneous with respect to the standard grading. 

% which is not the unit ideal precisely when $w\leq v$ in Bruhat order. 
Let $B_+,B_-\subset \GL_n(\mathbb{C})$ denote the Borel and opposite Borel subgroups, respectively. As defined in \cite{WooYongSings}, the \mydef{Kazhdan--Lusztig variety} is the intersection of the Schubert variety $B_-\backslash \overline{B_- w B_+}\subseteq B_-\backslash \GL_n(\mathbb{C})$ with the opposite Schubert cell $B_-\backslash B_-vB_-$. The coordinate ring of this {Kazhdan--Lusztig variety} is precisely $\mathbb{C}[{\bf z}^{v}]/J_{v,w}$. 
 Through this fact, $\mathbb{C}[{\bf z}^{v}]/J_{v,w}$ is Cohen-Macaulay. 
 Again we follow the conventions used in \cite{RRW} rather than those in \cite{WooYongSings}. For additional context concerning Kazhdan--Lusztig varieties, see the survey \cite{WooYongsurvey}.
 % This follows by \cite[Lemma A.4]{Kazhdan--Lusztig} together with the Cohen-Macaulayness of Schubert varieties \cite{Ramanathan}. See \cite[Section 3.2]{WooYongSings} for further discussion. 
 
 % , see e.g., \cite[Footnote on pg. 25]{Knutson-Frob}.
 
% Some further partial results on the problem of when Kazhdan--Lusztig ideals are homogeneous with respect to the standard grading \cite[Problem 5.5]{WooYongSings} can be found in the recent preprint \cite{Neye}.


Reformulating \cite[Theorem 4.5]{WooYongGrobner} for the case $v,w\in \avoid{n}$,
% As reformulated in \cite[Lemma 6.3]{RRW},
\begin{lemma}\cite[Lemma 6.3]{RRW}\label{lem:321KFormula}
Let $v,w\in \avoid{n}$ where $w\leq v$.
Then 
\begin{equation*}
   K(\mathbb{C}[{\bf z}^v]/J_{v,w};t) =  \sum_{P\in \KPipes(v,w)}(-1)^{\#P-\ell(w)}(1-t)^{\#P}.
\end{equation*}
\end{lemma}

We apply this Lemma along with Equation~\eqref{eq:mainRegEquation} for the following proposition.
\begin{proposition}\cite[Proposition 6.4]{RRW}
\label{prop:pipeKLreg}
Let $v,w\in \avoid{v}$ where $w\leq v$.  Then,
\begin{equation*}\label{eq:keyDegFormula}
   \deg K(\mathbb{C}[{\bf z}^v]/J_{v,w};t) = \deg \mathfrak{G}_{v,w}(\bf{t}).
\end{equation*}
Furthermore, the Castelnuovo-Mumford regularity of $\mathbb{C}[{\bf z}^v]/J_{v,w}$ is given by
\begin{equation*}\label{eq:regInTermsOfPipes}
    \reg (\mathbb{C}[{\bf z}^v]/J_{v,w}) =   \deg \mathfrak{G}_{v,w}({\bf{t}})-\#D(w).
\end{equation*}
\end{proposition}



% \begin{corollary}\label{cor:regPipes}
% Let $v,w\in \avoid{v}$ where $w\leq v$.  Then the Castelnuovo-Mumford regularity of $\mathbb{C}[{\bf z}^v]/J_{v,w}$ is given by
%     \begin{equation}\label{eq:regInTermsOfSEYD}
%     \reg (\mathbb{C}[{\bf z}^v]/J_{v,w}) =   \max\{\# D \ | \ D\in \kskewexcited(v,w)\}-\#D(w).
% \end{equation}
% \end{corollary}

By combining \cref{prop:pipeKLreg} and
% with \cref{cor:unspGrSEYD}, we obtain the following.
% Using 
\cref{thm:321321IndDeg}, we obtain the following theorem.
% and \cref{cor:regPipes},
\begin{theorem}\label{thm:321321IndReg} Suppose $v\geq w$, where $v,w\in \avoid{n}$.  
Then if $\maxexcited{(v,w)}=\bigcup_{q\in[s]}C_q$ where $C_q$ are the connected components of $\maxexcited{(v,w)}$,
% \[ \reg (\mathbb{C}[{\bf z}^v]/J_{v,w})=\sum_{q\in[s]}\sum_{k\in[\ell(q)]} \Delta_k(q).\]
\[ \reg (\mathbb{C}[{\bf z}^v]/J_{v,w})=\sum_{q\in[s]}\Delta_{v,w}(q).\]
\end{theorem}
% This builds upon previous work of the author with Rajchgot and Weigandt \cite{RRW}, which presents explicit combinatorial formulas for $\reg(\mathbb{C}[{\bf z}^v]/J_{v,w})$ in which $v,w\in S_n$ are grassmannian permutations. 
In \cite{GK15} S.~R.~Ghorpade--C.~Krattenthaler give an algorithm to compute a related invariant called the $a$-invariant of certain two-sided ladder determinantal varieties.
% , see \cite{Gorla} for additional background concerning ladder determinantal varieties. 
Two-sided ladder determinantal varieties are Kazhdan--Lusztig varieties indexed by particular $v,w\in\avoid{n}$. In this setting, the $a$-invariant is easily computed from the Castelnuovo--Mumford regularity. As we show in the full version of this abstract, \cref{thm:321321IndReg} may be applied to generalize \cite[Lemma~14]{GK15}.
% Additionally this generalizes 

% \newpage











\section{Construction and Recurrence for \cref{thm:321321IndDeg}}\label{sec:mainThmPf}

Assume $v\geq w\in \avoid{n}$. In \cref{sec:321321alg} we describe how to compute the statistics $\Delta_{v,w}(q)$ used in \cref{thm:321321IndDeg}. In \cref{sec:321321rec} we sketch the proof of \cref{thm:321321IndDeg}.


\subsection{Construction for \cref{thm:321321IndDeg}}\label{sec:321321alg}


 We index $\codePD{v}$ using matrix indexing, identifying the northwest most box in $\codePD{v}$ with $(1,1)$. Suppose $\maxexcited{(v,w)}=\bigcup_{q\in[s]}C_q$ where $C_q$ are the connected components of $\maxexcited{(v,w)}$. Order $C_q$ such that the indices increase when viewing components from northwest to southeast. 

\begin{example}\label{ex:DtopCC}
 % For $\maxexcited{(v,w)}$, reading the $+$'s from top to bottom, left to right, the $+$'s  lie in positions $(1,1),(1,2),(1,3),(2,4),(3,4),(3,5),(4,5)$. 
 Consider  
 $D=\maxexcited{(v,w)}$ below for some $v, w\in\avoid{15}$. 
     \[\begin{picture}(100,70)
\put(0,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &  \ &  + &  + \\
\ &  \ &  + &  + & \ &  + &  + &  + &  +\\
\ &  \ &  \ &  + & \ &  + &  + &  + &  +\\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + &  +\\
 \none &  \none &  \ &  \ & \ &  \ &  \ &  + &  +\\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ &  \ \\
\end{ytableau}}}
\end{picture}
% \vspace*{-0.4cm}
\]
Then $D$ has connected components $C_1$ and $C_2$, where $C_1=\{(1,3),(1,4),(2,3),(2,4),\break(3,3)\}$ and $C_2=\{(2,6),(2,7),(2,8),(2,9),(3,6),(3,7),(3,8),(3,9),(4,8),(4,9),(5,8),\break(5,9)\}$.
 \end{example}

For $q\in[s]$ in decreasing order, compute 
 $\mdCR{C_q}=\{{\sf d}_k^q\}_{{k\in[\ell_q]}}\subseteq C_q$, such that
 $\mdCR{C_q}$ is 
the westmost then southmost diagonal of length $\ell_q$ that minimizes
\[\#\big([\|\psi_E({\sf d}_{\ell_q}^q)\|+1]\cap \{\|{\sf d}_{k'}^{q'}\|\}_{q'>q,k'\in[\ell_{q'}]}\big).\]
Here $\|{\sf{b}}\|:={\sf{b}}(1)+{\sf{b}}(2)$ for ${\sf{b}}=({\sf{b}}(1),{\sf{b}}(2))\in \maxexcited{(v,w)}$. Boxes in $\mdCR{C_q}$ are ordered increasingly northwest to southeast.


Set $D_{\tt zip}^{(0)}(v,w):=\maxexcited{(v,w)}$. 
For $q\in[s]$, we define $D_{\tt zip}^{(q)}(v,w)$ iteratively by applying exited moves to certain pluses in $C_q\subseteq D_{\tt zip}^{(q-1)}(v,w)$. In $D_{\tt zip}^{(q-1)}(v,w)$, 
set \[S=\{{\sf b}\in C_q-\mdCR{C_q} \text{ weakly southwest of } \mdCR{C_q}\}.\] 
To each in ${\sf b}\in S$, working west to east and south to north, let ${\sf b}'$ be the new position of ${\sf b}$ after applying as many excited moves as possible to ${\sf b}$. 
Let 
\[D_{\tt zip}^{(q)}(v,w):= D_{\tt zip}^{(q-1)}(v,w) -S\cup \{{\sf b}' \ | \ {\sf b}\in S\}.\]
Define $D_{\tt zip}(v,w):=D_{\tt zip}^{(s)}(v,w)$. 
% Let $D_{\tt zip}^K(v,w)$ be the diagram after applying a maximal number of K-theoretic excited moves to each ${\sf b}\in \mdCR{C_q}$, for each $q\in [s]$. 
For ${\sf b}\in \mdCR{C_q}$, define $\room{v,w}({\sf b})$ such that
\begin{multline*}
    \room{v,w}({\sf b}):=\max\{k\in\{0,1,\ldots,n\} \ | \ 
    {\sf b}+(k',-k'),{\sf b}+(k',1-k'),\\
    {\sf b}+(k'-1,-k')\in \codePD{v}- D_{\tt zip}(v,w) \text{ for each } k'\in [k]\}.
\end{multline*}   

 We define the statistic \[\Delta_{v,w}(q):=\sum_{k\in[\ell_q]}\room{v,w}({\sf d}_k^q).\]

\begin{example}\label{ex:showComput}
 We continue with $v,w$ as in \cref{ex:DtopCC}. Left to right, the diagrams below are $D_{\tt zip}^{(0)}(v,w)$, $D_{\tt zip}^{(1)}(v,w)$, and $D_{\tt zip}^{(2)}(v,w)$, respectively. In $D_{\tt zip}^{(0)}(v,w)$, ${\sf Diag}_{v,w}(C_1)$ is bolded, and $\mdCR{C_1}$ is shaded. In $D_{\tt zip}^{(1)}(v,w)$, ${\sf Diag}_{v,w}(C_2)$ is bolded, and $\mdCR{C_2}$ is shaded.
     \[\begin{picture}(360,70)
\put(0,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &   \ &  *(lightgray)+ &  + \\
\ &  \ &  \Plus &  *(lightgray)+ & \ &  + &  + &  + &  +\\
\ &  \ &  \ &  \Plus & \ &  + &  + &  + &  +\\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + &  +\\
 \none &  \none &  \ &  \ & \ &  \ &  \ &  + &  +\\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ &  \ \\
\end{ytableau}}}
\put(130,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &  \ &  + &  + \\
\ &  \ &  + &  + & \ &  *(lightgray)\Plus &  + &  + &  +\\
\ &  \ &  \ &  + & \ &  + &  *(lightgray)\Plus &  + &  +\\
\ &  \ &  \ &  \ & \ &  \ &  \ &  *(lightgray)\Plus &  +\\
 \none &  \none &  \ &  \ & \ &  \ &  \ &  + &  *(lightgray)\Plus\\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ &  \ \\
\end{ytableau}}}
\put(260,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &  \ &  + &  + \\
\ &  \ &  \ &  + & \ &  + &  + &  + &  +\\
\ &  \ &  \ &  \ & \ &  \ &  + &  + &  +\\
+ &  \ &  + &  \ & \ &  \ &  \ &  + &  +\\
 \none &  \none &  \ &  + & \ &  \ &  \ &  \ &  +\\
 \none &  \none &  \none &  \none & \ &  \ &  + &  \ &  \ \\
\end{ytableau}}}
\end{picture}
\]
Using $D_{\tt zip}^{(0)}(v,w)$ and ${\sf Diag}_{v,w}(C_1)$, we find $\Delta_{v,w}(1)=(2+1)$. Similarly using $D_{\tt zip}^{(1)}(v,w)$ and ${\sf Diag}_{v,w}(C_2)$, we compute $\Delta_{v,w}(2)=(2+2+1+1)$.
Therefore, \cref{thm:321321IndDeg} determines \[\deg( \mathfrak G_{v,w}(\mathbf t))=\#D(w)+\Delta_{v,w}(1)+\Delta_{v,w}(2)=17+3+6=26.\]
By \cref{cor:unspGrSEYD}, there exists $D\in \kskewexcited{(v,w)}$ where $\#D=26$. We have drawn such a diagram below. This is computed by applying $\room{v,w}({\sf d}_k^q)$-many K-theoretic excited moves along the antidiagonals of ${\sf d}_k^q\in \mdCR{C_q}$ for each $k\in[\ell_q], q\in [s]$. The pluses that result from these K-theoretic excited moves are drawn in blue. 
 \[\begin{picture}(100,70)
\put(0,55){\ytableausetup
{boxsize=0.8em}

{\begin{ytableau}
  \ &  \ &  + &  + \\
\ &  \textcolor{blue}{\Plus} &  \ &  + & \ &  + &  + &  + &  +\\
\textcolor{blue}{\Plus} &  \ &  \textcolor{blue}{\Plus} &  \ & \textcolor{blue}{\Plus} &  \ &  + &  + & + \\ 
+ &  \ &  + &  \textcolor{blue}{\Plus} & \ &  \textcolor{blue}{\Plus} &  \ &  + &  +\\
 \none &  \none &  \ &  + & \textcolor{blue}{\Plus} &  \ &  \textcolor{blue}{\Plus} &  \ &  +\\
 \none &  \none &  \none &  \none & \ &  \ &  + &  \textcolor{blue}{\Plus} &  \ \\
\end{ytableau}}}
\end{picture}
\]
\cref{thm:321321IndReg} gives $\reg (\mathbb{C}[{\bf z}^v]/J_{v,w})=\Delta_{v,w}(1)+\Delta_{v,w}(2)=9$. This corresponds precisely with the number of blue pluses in the diagram above.
\end{example}
% \begin{align}
%     D_{\tt zip}^{(q)}(v,w)=
% \{z-&(\room{v,w}(\widetilde{z}),\room{v,w}(\widetilde{z})) \ | \ z\in C_q\setminus \mdCR{C_q} \text{ weakly SW of } \mdCR{C_q}\} \\
% &\cup \{z \ | \ z\in C_q \text{ weakly NE of } 
%  \mdCR{C_q}\}\cup \big(D_{\tt zip}^{(q-1)}(v,w)\setminus C_q \big).
% \end{align}
% \Colleen{want original $C_q$ or comp in $q$th step of zip?}


\subsection{Proof Sketch for \cref{thm:321321IndDeg}}\label{sec:321321rec}

% \section{$1432$-avoiding Grothendieck polynomials}
In proving \cref{thm:321321IndDeg}, we utilize a particular recurrence on $\mathfrak G_{v,w}(\mathbf t)$. 
% First we set up a recurrence.
% Let $(a,b)$ be the northmost then eastmost plus in $\maxexcited{(v,w)}$. 
% % Let $\code(v)=(c_1,c_2,\ldots,c_n)$.
% Take
% \[b'=\max\{j\in[n] \, | \, (a,j)\in \codePD{v}\}.\]
% % and $\codePD{}:=\codePD{v}-\{(a,b')\}$. 
% Then $\codePD{{v_P}}=\codePD{v}-\{(a,b')\}$, where ${v_P}:={s_{a+b'-1}v}$. Define ${w_P}:={s_{a+b-1}w}$, $w_C:=w$, and ${v_C}:={v_P}$. To proceed, we first establish $v_P,w_P\in\avoid{n}$. This follows from the definition of $b$ and $b'$ as northwest most choices along with the graphical definition of $321$-avoiding. That is, $u\in \avoid{n}$ if and only if $\codePD{u}$ is a skew Young diagram.
Let $(a,b)$ be the northmost then eastmost plus in $\maxexcited{(v,w)}$. 
Take $(a',b')$ to be the northmost then eastmost box in $\codePD{v}$.
Set $i={\sf word}(\phi_v^{-1}(\{(a,b)\}))$ and $i'={\sf word}(\phi_v^{-1}(\{(a',b')\}))$ in $D(v)$.
Define $v_P=s_{i'} v$, which gives $\codePD{{v_P}}=\codePD{v}-\{(a',b')\}$. 
Define ${w_P}:={s_{i}w}$, $w_C:=w$, and ${v_C}:={v_P}$. 

To proceed, we first establish $v_P,w_P\in\avoid{n}$. This follows from the definition of $(a,b)$ and $(a',b')$ as northeast most choices along with the graphical definition of $321$-avoiding. That is, $u\in \avoid{n}$ if and only if $\codePD{u}$ is a skew Young diagram.


\begin{example} Below we have $\maxexcited{(v,w)}$ on the left and $\maxexcited{(v_C,w_C)}$ on the right for particular $v,w\in\avoid{15}$. In this case, $(a,b)\neq(a',b')$. 
   \[\begin{picture}(360,70)
\put(60,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &  + &  + &  + & \ & \ \\
\ &  \ &  \ &  + & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ \\
\end{ytableau}}}
\put(180,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &  + &  + &  + & \ \\
\ &  \ &  \ &  + & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ \\
\end{ytableau}}}
\end{picture}
% \vspace*{-0.2cm}
\] 
Below are $\maxexcited{(v',w')}$, $\maxexcited{(v'_C,w'_C)}$, and $\maxexcited{(v'_P,w'_P)}$, listed from left to right, for particular $v',w'\in\avoid{15}$. In this case, $(a,b)=(a',b')$.

 \[\begin{picture}(360,70)
\put(0,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
  \ &  + &  + &  + \\
\ &  \ &  \ &  + & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ \\
\end{ytableau}}}
\put(120,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
 \ &   \ &  \  \\
+ &  + &  + &  \ & \ &  \ &  + &  + \\
\ &  \ &  + &  \ & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ \\
\end{ytableau}}}
\put(240,55){\ytableausetup
{boxsize=0.8em}
{\begin{ytableau}
   \ &  + &  + \\
\ &  \ &  \ &  + & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  + &  + \\
\ &  \ &  \ &  \ & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  + \\
 \none &  \none &  \none &  \none & \ &  \ &  \ &  \ \\
\end{ytableau}}}
\end{picture}
% \vspace*{-0.2cm}
\] 
\end{example}
 
% The above example hints at a correspondence between the skew excited Young diagrams of $(v,w)$, $(v_C,w_C)$, and $(v_P,w_P)$. By \cref{cor:unspGrSEYD} such a close relationship can be leveraged  to compare the degrees of the unspecialized Grothendieck polynomials they index. 
We give a general correspondence of these K-theoretic skew excited Young diagrams. 
\begin{lemma}\label{lem:recTrimwv}
For $v\geq w$ and $v,w\in\avoid{n}$, the following hold:
\begin{enumerate}
    \item   If $(a,b)\neq(a',b')$,
\[\kskewexcited(v,w)=\kskewexcited(v_C,{w_C}).\] 
    \item If $(a,b)=(a',b')$,
\[\kskewexcited(v,w)=\kskewexcited(v_C,w_C)\bigsqcup\Big\{D\cup(a,b)\, | \, D\in \kskewexcited(v_C,{w_C})\cup\kskewexcited(v_P,w_P)\Big\}.\]
\end{enumerate}
% \[\mathfrak G_{v,w}(\mathbf t)=z_{ab}\mathfrak G_{v_P,w_P}(\mathbf t)+(1-z_{ab})\mathfrak G_{v_C,w_C}(\mathbf t)\]
%   If $b'>b$,
% \[\kskewexcited(v,w)=\kskewexcited(v_C,{w_C}).\]
\end{lemma}
% \begin{proof}
% When $b'>b$ the definitions of $b$ and $b'$,  for any $D\in \kskewexcited(v,w)$, $(a,b')\not\in D$. Thus the result follows.
% % \end{proof}
%
% % It suffices to show $\maxexcited{(v,w)}$
% Now we assume $b'=b$. Note that $\skewexcited(v_C,{w_C})$ will possibly be empty in this case.
%
% \noindent $(\subseteq)$
% Fix $D\in\kskewexcited(v,w)$. First assume $(a,b)\not\in D$.
% % Then if $(i,j)\in D$, $(i,j)\in \codePD{{v_C}}$.  By definition, 
% $\delta({D})w=w_C$, so $D\in \kskewexcited(v_C,w_C)$.
%
% Now we may assume  $(a,b)\in D$.
% When $\delta({D-\{(a,b)\}})\neq\delta({D})$,
% % Removing $(a,b)$ from $D$ changes the Demazure product of $D$.
% then $\delta({D-\{(a,b)\}})=w_P$ 
% % by the definition of $w_P$. For those $(i,j)\in D-\{(a,b)\}$, then $(i,j)\in \codePD{{v_P}}$, 
% so $D-\{(a,b)\}\in \kskewexcited(v_P,w_P)$.
% Otherwise $\delta({D-\{(a,b)\}})=\delta({D})$.
% In this case, $\delta({D-\{(a,b)\}})=w=w_C$,
% % For those $(i,j)\in D-\{(a,b)\}$, $(i,j)\in \codePD{{v_C}}$, 
% so $D-\{(a,b)\}\in \kskewexcited(v_C,w_C)$.
%
%
%
% \noindent $(\supseteq)$ Fix $D'$ in RHS.
% %  Take $k=w^{-1}(a+b)$.
% % Consider $(k+k',c(k)+k')\in D_{\sf bot}(v,w)$, the last $+$ in row $k+k'$. 
% % % As proven in  \cite[Theorem 1.5]{Gao}, $D_{\sf bot}(v,w)$ and $D_{\sf top}(v,w)$ are connected by simple ladder moves. 
% % Thus it follows that
% % \begin{equation}\label{eq:abSource}
% % \phi_{+}^{-1}(a,b)=(k+k',c(k)+k').
% % \end{equation}
% % \Colleen{double check this works for rewritten version}
% If $D'\in \kskewexcited(v_C,w_C)$ or $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_P,w_P)$, then $\delta({D'})=w$, so $D\in \kskewexcited(v,w)$. 
% % definition of $b$. 
% Thus we assume  $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_C,w_C)$. The result follows if we show $\delta({D'})=w$.
%
% We know $\delta({D'})=\delta({D\cup(a,b)})=\delta({\maxexcited{(v_C,w_C)}\cup(a,b)})$ since $\delta(D)=\delta(\maxexcited{(v_C,w_C)})$. 
% %
% % Since $w=w_C$ and $\codePD{{v_C}}\subset \codePD{{v}}$,
% % it follows that $D'\in \kskewexcited(v,w)$.
% %
% %
% % \noindent {\bf Case 2:}  $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_C,w_C)$.
% % It suffices to show $\delta(D)=\delta(D')=w$. 
% % % Let $S$ be the collection of moves used to obtain $D$ from the bottom pipe dream $D_{\sf bot}(w_C)$.
% % % Consider $D_{\sf bot}(v,w)$.
% % % By Equation (\ref{eq:abSource}), since $w_c=w$ one can move a copy of $(k+k',c(k)+k')\in D_{\sf bot}(w_C)$ to $(a,b)$ using one K-theoretic move, then a sequence of ordinary moves. Then apply the moves $S$ to obtain $D'$. Then $D'\in \kskewexcited(v,w)$.
% %
% % \noindent {\bf Case 3:}  $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_P,w_P)$.
% %
% % Let $S$ be the collection of moves used to obtain $D$ from the bottom pipe dream $D_{\sf bot}(w_P)$. By definition of $w_P$ and Equation  (\ref{eq:abSource}), $D_{\sf bot}(w_P)=D_{\sf bot}(v,w)-\{(k+k',c(k)+k')\}$.
% % % Consider $(k,c(k))\in D_{\sf bot}$, the last $+$ in row $k$. 
% % Start with $D_{\sf bot}(v,w)$. Move $(k+k',c(k)+k')\in D_{\sf bot}(w_C)$ to $(a,b)$ using ordinary moves. Then apply the moves $S$ to obtain $D'$. It follows that $D'\in \kskewexcited(v,w)$.
% \end{proof}






% For the remainder of this section, we assume $b=b'$. 
% Set $w_P:=\permPD{D-\{(a,b)\}}$, i.e. $w_P=s_{a+b-1}w$.  

% \begin{lemma}\label{lem:recTrimwv} If $b=b'$,
% \[\kskewexcited(v,w)=\kskewexcited(v_C,w_C)\bigsqcup\Big\{D\cup(a,b)\, | \, D\in \kskewexcited(v_C,{w_C})\cup\kskewexcited(v_P,w_P)\Big\}.\]
% \end{lemma}

% \begin{proof}
% % It suffices to show $\maxexcited{(v,w)}$
% \noindent $(\subseteq)$
% Fix $D\in\kskewexcited(v,w)$. First assume $(a,b)\not\in D$.
% % Then if $(i,j)\in D$, $(i,j)\in \codePD{{v_C}}$.  By definition, 
% $\delta({D})w=w_C$, so $D\in \kskewexcited(v_C,w_C)$.

% Now we may assume  $(a,b)\in D$.
% When $\delta({D-\{(a,b)\}})\neq\delta({D})$,
% % Removing $(a,b)$ from $D$ changes the Demazure product of $D$.
% then $\delta({D-\{(a,b)\}})=w_P$ 
% % by the definition of $w_P$. For those $(i,j)\in D-\{(a,b)\}$, then $(i,j)\in \codePD{{v_P}}$, 
% so $D-\{(a,b)\}\in \kskewexcited(v_P,w_P)$.
% Otherwise $\delta({D-\{(a,b)\}})=\delta({D})$.
% In this case, $\delta({D-\{(a,b)\}})=w=w_C$,
% % For those $(i,j)\in D-\{(a,b)\}$, $(i,j)\in \codePD{{v_C}}$, 
% so $D-\{(a,b)\}\in \kskewexcited(v_C,w_C)$.



% \noindent $(\supseteq)$ Fix $D'$ in RHS.
% %  Take $k=w^{-1}(a+b)$.
% % Consider $(k+k',c(k)+k')\in D_{\sf bot}(v,w)$, the last $+$ in row $k+k'$. 
% % % As proven in  \cite[Theorem 1.5]{Gao}, $D_{\sf bot}(v,w)$ and $D_{\sf top}(v,w)$ are connected by simple ladder moves. 
% % Thus it follows that
% % \begin{equation}\label{eq:abSource}
% % \phi_{+}^{-1}(a,b)=(k+k',c(k)+k').
% % \end{equation}
% % \Colleen{double check this works for rewritten version}
% If $D'\in \kskewexcited(v_C,w_C)$ or $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_P,w_P)$, then $\delta({D'})=w$, so $D\in \kskewexcited(v,w)$. 
% % definition of $b$. 
% Thus we assume  $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_C,w_C)$. The result follows if we show $\delta({D'})=w$.

% We know $\delta({D'})=\delta({D\cup(a,b)})=\delta({\maxexcited{(v_C,w_C)}\cup(a,b)})$ since $\delta(D)=\delta(\maxexcited{(v_C,w_C)})$. 
% %
% % Since $w=w_C$ and $\codePD{{v_C}}\subset \codePD{{v}}$,
% % it follows that $D'\in \kskewexcited(v,w)$.
% %
% %
% % \noindent {\bf Case 2:}  $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_C,w_C)$.
% % It suffices to show $\delta(D)=\delta(D')=w$. 
% % % Let $S$ be the collection of moves used to obtain $D$ from the bottom pipe dream $D_{\sf bot}(w_C)$.
% % % Consider $D_{\sf bot}(v,w)$.
% % % By Equation (\ref{eq:abSource}), since $w_c=w$ one can move a copy of $(k+k',c(k)+k')\in D_{\sf bot}(w_C)$ to $(a,b)$ using one K-theoretic move, then a sequence of ordinary moves. Then apply the moves $S$ to obtain $D'$. Then $D'\in \kskewexcited(v,w)$.
% %
% % \noindent {\bf Case 3:}  $D'=D\cup\{(a,b)\}$, where $D\in \kskewexcited(v_P,w_P)$.
% %
% % Let $S$ be the collection of moves used to obtain $D$ from the bottom pipe dream $D_{\sf bot}(w_P)$. By definition of $w_P$ and Equation  (\ref{eq:abSource}), $D_{\sf bot}(w_P)=D_{\sf bot}(v,w)-\{(k+k',c(k)+k')\}$.
% % % Consider $(k,c(k))\in D_{\sf bot}$, the last $+$ in row $k$. 
% % Start with $D_{\sf bot}(v,w)$. Move $(k+k',c(k)+k')\in D_{\sf bot}(w_C)$ to $(a,b)$ using ordinary moves. Then apply the moves $S$ to obtain $D'$. It follows that $D'\in \kskewexcited(v,w)$.
% \end{proof}


% % \Colleen{double check indices for this proposition}
% \begin{proposition}\label{prop:321GwRec}The following hold
% \begin{enumerate}
%     \item if $b<b',$ $\mathfrak G_{v,w}(\mathbf t)=\mathfrak G_{v_C,w_C}(\mathbf t)$, and 
%     \item if $b=b',$ $\mathfrak G_{v,w}(\mathbf t)=z_{ab}\mathfrak G_{v_P,w_P}(\mathbf t)+(1-z_{ab})\mathfrak G_{v_C,w_C}(\mathbf t)$. 
% \end{enumerate}
% % \[\mathfrak G_{v,w}(\mathbf t)=z_{ab}\mathfrak G_{v_P,w_P}(\mathbf t)+(1-z_{ab})\mathfrak G_{v_C,w_C}(\mathbf t)\]
% \end{proposition}
% \begin{proof}
% This follows by combining the definition of $\mathfrak G_{v,w}(\mathbf t)$ with Lemmas \ref{lem:trimV} and \ref{lem:recTrimwv}.
% \end{proof}
Combining \cref{cor:unspGrSEYD} with \cref{lem:recTrimwv},
we obtain the following corrollary.
\begin{corollary}\label{cor:321GwDegRec}
For $v\geq w$ and $v,w\in\avoid{n}$, the following hold:
\begin{enumerate}
    \item if $(a,b)\neq(a',b'),$ $\deg(\mathfrak G_{v,w}(\mathbf t))=\deg(\mathfrak G_{v_C,w_C}(\mathbf t))$.
    \item If $(a,b)=(a',b'),$ $\deg(\mathfrak G_{v,w}(\mathbf t))=\max(\deg(\mathfrak G_{v_P,w_P}(\mathbf t)),\deg(\mathfrak G_{v_C,w_C}(\mathbf t)))+1$.
\end{enumerate}
\end{corollary}
% \begin{proof}
% By \cref{prop:321Trim} this follows. 
% \end{proof}

% We prove \cref{thm:321321IndDeg} through induction on $\ell(v)$ using \cref{cor:321GwDegRec} along with the following proposition.


% \begin{proof}
% These follow by the definition of $\maxexcited{(v,w)}$ along with \cref{lem:recTrimwv}. 
% \end{proof}
With this recurrence established, we now sketch the proof. 

\noindent
\emph{Proof sketch  of \cref{thm:321321IndDeg}:}
 
% Take $D_{\tt zip}(v,w):=D_{\tt zip}^{(s)}(v,w)$.

% For $b=(x,y)\in D_{\tt zip}(v,w)$ let \[\trail{v,w}(b)=\max\{k \ | \ (x-k',y-k'),(x-k',y-k'-1),(x-k'-1,y-k')\not\in D_{\tt zip}(v,w) \text{ for each } k'\in [k]\}.\]

% \begin{theorem}\label{thm:321321IndDeg} Suppose $v\geq w$, where $v,w\in \avoid{n}$.  
% Then if $\maxexcited{(v,w)}=\bigcup_{q\in[s]}C_q$ where $C_q$ are the connected components,
% % \[ \reg (\mathbb{C}[{\bf z}^v]/J_{v,w})=\sum_{q\in[s]}\sum_{k\in[\ell(q)]} \Delta_k(q).\]
% \[ \reg (\mathbb{C}[{\bf z}^v]/J_{v,w})=\sum_{q\in[s]}|\Delta_{v,w}(q)|.\]
% \end{theorem}




% \begin{proof}
We proceed by induction on $\ell(v)$.
For $\ell(v)=0$, the statement is trivial since 
 in this case $\skewexcited(v,w)=\emptyset$.
Suppose the statement holds for $v$ such that $\ell(v)=k-1$ for $k\geq 1$. Consider $v$ such that $\ell(v)=k$. For brevity let $d(u_1,u_2)=\sum_{q\in[s]}\Delta_{u_1,u_2}(q)$ where $\maxexcited{(u_1,u_2)}$ has $s$ components. 
% $\sum_{i\in[s]}\sum_{b_j\in \mdCR{C_i}} \trail{u_1,u_2}(b_j)$.

If $(a,b)\neq(a',b')$, by \cref{cor:321GwDegRec}, $\deg(\mathfrak G_{v,w}(\mathbf t))=\deg(\mathfrak G_{v_C,w_C}(\mathbf t))$. Using \cref{lem:recTrimwv}, we determine $D_{\tt zip}(v,w)=D_{\tt zip}(v_C,w_C)$, so $d(v,w)=d(v_C,w_C)$. Thus the result follows by the inductive assumption. 

Now assume $(a,b)=(a',b')$. Then by \cref{cor:321GwDegRec}, \[\deg(\mathfrak G_{v,w}(\mathbf t))=\max(\deg(\mathfrak G_{v_P,w_P}(\mathbf t)),\deg(\mathfrak G_{v_C,w_C}(\mathbf t)))+1.\] 
% By the inductive assumption,  
% \begin{align*}
%     \deg(\mathfrak G_{v_P,w_P}(\mathbf t))&=\#D(w_P)+d(v_P,w_P)\\
%     \deg(\mathfrak G_{v_C,w_C}(\mathbf t))&=\#D(w_C)+d(v_C,w_C).
% \end{align*}
Since $\#D(w)=\#D(w_C)$ and $\#D(w)=\#D(w_P)+1$,
from the inductive assumption,
\begin{equation*}
    \deg(\mathfrak G_{v,w}(\mathbf t))=\#D(w)+\max(d(v_P,w_P),d(v_C,w_C)+1).
\end{equation*}
Thus
it suffices to prove 
\begin{equation}\label{eq:diagRec}
    d(v,w)=\max(d(v_P,w_P),d(v_C,w_C)+1).
\end{equation}

To establish Equation~\eqref{eq:diagRec}, we perform a careful case analysis on the position of $(a,b)\in C_q$ in relation to $\mdCR{C_q}$. The following claim is useful in this examination.


\begin{claim}\label{prop:DtopCompare}
Suppose $(a,b)=(a',b')\in C_q$ where $C_q$ is a connected component in $\maxexcited{(v,w)}$. Let $R_q=\{{\sf d}\in C_q \ | \  {\sf d} \text{ lies weakly southwest of } (a,b)\}$. Then
\begin{enumerate}
    \item $\maxexcited{(v_P,w_P)}=\maxexcited{(v,w)}-(a,b)$, and 
    \item $\maxexcited{(v_C,w_C)}=\maxexcited{(v,w)}- R_q\cup R_q'$,
\end{enumerate}
     where  $R_q'=\{{\sf d}+(1,-1) \ | \ {\sf d}\in R_q\}$.
\end{claim}
With Equation~\eqref{eq:diagRec} proven, \cref{thm:321321IndDeg} follows.
\qed

% \begin{proposition}\label{prop:DtopCompare}
% Suppose $(a,b)\in C_q$ and $b=b'$. Let $R_q=\{z\in C_q \ | \  z \text{ lies weakly SW of } (a,b)\}$. Then
% \begin{enumerate}
%     \item $\maxexcited{(v_P,w_P)}=\maxexcited{(v,w)}\setminus(a,b)$, and 
%     \item $\maxexcited{(v_C,w_C)}=\maxexcited{(v,w)}\setminus R_q\cup R_q'$,
% \end{enumerate}
%      where  $R_q'=\{z-(1,1) \ | \ z\in R_q\}$.
% \end{proposition}
% \begin{proof}
% These follow by the definition of $\maxexcited{(v,w)}$ along with \cref{lem:recTrimwv}. 
% \end{proof}

% Let $C_q^{u_1,u_2}$ specify the $q$th connected component of $D_{top}(u_1,u_2)$. 
% \Colleen{Prove $\geq$ in \eqref{eq:diagRec}}
% $\mdCR{C_q}$


% By definitions of $(a,b)$ 
% and $\mdCR{C_i}$, it follows that $(a,b)$ is the only box in $C_i$ in row $a$. 
% By \cref{prop:DtopCompare}, it follows that $d(v,w)\geq d(v_P,w_P)$. 

% By the definition of $\mdCR{C_i}$, it follows that $\mdCR{R_i'}$ lies SW of $R_i\cap \mdCR{C_i}$. Since $b=b'$, the definition of $\mdCR{C_i}$ implies that $R_i\cap \mdCR{C_i}\neq \emptyset$. Thus by the definition of ${\sf trail}$, $d(v,w)>d(v_C,w_C)$. Therefore $d(v,w)\geq \max(d(v_P,w_P),d(v_C,w_C)+1)$.


% \noindent {\bf Case 1:} $(a,b)\not\in \mdCR{C_i}$ for all $i$.
% By the definition of $b$, $(a,b)$ lies northeast of $\mdCR{C_i}$ for all $i$.
% By \cref{prop:DtopCompare} and the definition of $\mdCR{C_i}$, $D_{\tt zip}(v_P,w_P)=D_{\tt zip}(v,w)\setminus(a,b)$. Thus $d(v,w)=d(v_P,w_P)$ by the definition of $\Delta_{v,w}(q)$.

% We know if ${\sf z}\in C_i$ lies southwest of $(a,b)$, then
% $\room{v,w}({\sf z})=\room{v_C,w_C}({\sf z})+1$. 


% \noindent {\bf Case 2:} $(a,b)\in \mdCR{C_q}$ for some $q$.
 

% If $\trail{v,w}((a,b))=0$, it follows that $\skewexcited(v_C,{w_C})=\emptyset$. Further, by \cref{prop:DtopCompare} and the definition of $\mdCR{C_i}$, $D_{\tt zip}(v_P,w_P)=D_{\tt zip}(v,w)\setminus(a,b)$. Thus $d(v,w)=d(v_P,w_P)$. 
 
%  % By \cref{lem:DtopCompare}, it follows that $d(v,w)> d(v_C,w_C)$, so it remains to show $d(v,w)= d(v_C,w_C)+1$.
% Otherwise, 
% by \cref{prop:DtopCompare}, it follows that 
% $D_{\tt zip}(v_C,w_C)=D_{\tt zip}(v,w)\setminus (a,b)\cup (a-1,b-1)$.  
% Thus $d(v,w)= d(v_C,w_C)+1$, so the claim follows. \qed
% \end{proof}





% \section{Ladder Determinantal Varieties}
% A \emph{ladder} $L$ is a skew-Young diagram (in English notation flipped across the $y$-axis) in which the box in row $i$, column $j$ is filled with indeterminate $x_{ij}$. Such a ladder is determined by a choice of southwest corners $L^{SW} = \{(a_i,b_i)\}_{i\in [s]}$ and northeast corners $L^{NE} = \{(c_i,d_i)\}_{i\in [t]}$ ordered northwest to southeast. Label the northwest box of $L$ to be $(0,0)$. Take $(a_{s+1},b_{s+1})=(c_{t+1},d_{t+1})$ to be the northwestmost box of the ladder and take $(a_1,b_1)=(c_1,d_1)$ be the southeastmost box of the ladder. 
% Let $\mathcal{M}=\{\sf{b}_i\}_{i\in[s']}$ denote a subset of boxes $\sf{b}_i$ along the southwest border of $L$. To each box $\sf{b}_i=(\sf{b}_{i1},\sf{b}_{i2})$ in $\mathcal{M}$, assign a rank $r_i\in \mathbb{Z}_{> 0}$.

 
% Let $\mathbb{C}[L]$ denote the polynomial ring generated by these indeterminate entries. Let $L_{I,J}$ denote the submatrix of $L$ with row indices in $I$ and column indices in $J$ for $I,J\subseteq[n]$. 
% Define the \emph{two-sided mixed ladder determinantal ideal} $I_{L,{\bf{r}}}$:
% \[I_{L,{\bf{r}}} = \langle \text{minors of size } r_j \text{ in } L_{[\sf{b}_{j1}],[\sf{b}_{j2}]}\,:  \, j\in[s']\rangle\subseteq \mathbb{C}[L].\] 
% Letting $I_j$ denote the ideal of $r_j\times r_j$ minors of $L_{[\sf{b}_{j1}],[\sf{b}_{j2}]}$, one observes that
% \[
% I_{L,{\bf r}} = \sum_{j\in[s']} I_j.
% \]
% Following \cite{KM}, we assume 
% \begin{equation}\label{eq:laddRed}
%     0<c_1-r_1<c_2-r_2<\dots<c_{s'}-r_{s'} \text{ and } 0<d_1-r_1<d_2-r_2<\dots<d_{s'}-r_{s'}
% \end{equation}
%  so that 
% $I_j\subsetneq I_k$ for any $j\neq k$, $j,k\in [s']$. 
% Unlike in \cite{RRW} in the case of one-sided ladders ({\emph{i.e.}} $L^{NE}=\emptyset$), $L$ can be no longer identified with a matrix Schubert variety. However, $L$ can realized as a Kazhdan--Lusztig variety. 


% \Colleen{Describe $u,g$ in terms of code?}
% \begin{proposition}
%     Given a two-sided ladder determinantal ideal $I_{L,{\bf{r}}}$ and $u,g$ as above,
% $J_{u,g}$ and $I_{L,{\bf{r}}}$ share the same generators.
% \end{proposition}

% \begin{example}\label{ex:1sidelad}
% To the left is a ladder $L$. Then $L^{\sf SE}=\{(5,3),(3,5)\}$ with marked points and corresponding ranks given in red. To the right is the associated permutation $v$.
% \[\begin{picture}(280,65)
% \put(0,35){$L=$}
% \put(30,-10){\begin{tikzpicture}[scale=.5]
% \draw[line width = .1ex, gray] (0,4) -- (5,4);
% \draw[line width = .1ex, gray] (0,3) -- (5,3);
% \draw[line width = .1ex, gray] (0,2) -- (3,2);
% \draw[line width = .1ex, gray] (0,1) -- (3,1);

% \draw[line width = .1ex, gray] (1,5) -- (1,0);
% \draw[line width = .1ex, gray] (2,5) -- (2,0);
% \draw[line width = .1ex, gray] (3,5) -- (3,2);
% \draw[line width = .1ex, gray] (4,5) -- (4,2);



% \draw[line width = .25ex] (0,5)--(5,5)--(5,2)--(3,2)--(3,0)--(0,0)--(0,5);
% \filldraw[red] (5,2) circle (1ex);
% \filldraw[red] (3,2) circle (1ex);
% \filldraw[red] (3,0) circle (1ex);
% \put(1,62){\scriptsize{$z_{11}$}}
% \put(15,62){\scriptsize{$z_{12}$}}
% \put(30,62){\scriptsize{$z_{13}$}}
% \put(44,62){\scriptsize{$z_{14}$}}
% \put(57.5,62){\scriptsize{$z_{15}$}}
% \put(1,48){\scriptsize{$z_{21}$}}
% \put(15,48){\scriptsize{$z_{22}$}}
% \put(30,48){\scriptsize{$z_{23}$}}
% \put(44,48){\scriptsize{$z_{24}$}}
% \put(57.5,48){\scriptsize{$z_{25}$}}
% \put(1,34){\scriptsize{$z_{31}$}}
% \put(15,34){\scriptsize{$z_{32}$}}
% \put(30,34){\scriptsize{$z_{33}$}}
% \put(44,34){\scriptsize{$z_{34}$}}
% \put(57.5,34){\scriptsize{$z_{35}$}}
% \put(1,20){\scriptsize{$z_{41}$}}
% \put(15,20){\scriptsize{$z_{42}$}}
% \put(30,20){\scriptsize{$z_{43}$}}
% \put(1,6){\scriptsize{$z_{51}$}}
% \put(15,6){\scriptsize{$z_{52}$}}
% \put(30,6){\scriptsize{$z_{53}$}}
% \put(77,25){\small{$\textcolor{red}3$}}
% \put(47,19){\small{$\textcolor{red}2$}}
% \put(47,-3){\small{$\textcolor{red}3$}}
% \end{tikzpicture}}
% \put(150,-10){\begin{tikzpicture}[scale=.43]
% \draw (0,0) rectangle (6,6);

% \draw (1,5) rectangle (3,3);
% \draw[line width = .1ex] (1,4) -- (3,4);
% \draw[line width = .1ex] (2,3) -- (2,5);

% \draw (4,4) rectangle (5,3);
% \draw (2,1) rectangle (3,2);

% \filldraw (0.5,5.5) circle (.5ex);
% \draw[line width = .2ex] (0.5,0) -- (0.5,5.5) -- (6,5.5);
% \filldraw (3.5,4.5) circle (.5ex);
% \draw[line width = .2ex] (3.5,0) -- (3.5,4.5) -- (6,4.5);
% \filldraw (5.5,3.5) circle (.5ex);
% \draw[line width = .2ex] (5.5,0) -- (5.5,3.5) -- (6,3.5);
% \filldraw (1.5,2.5) circle (.5ex);
% \draw[line width = .2ex] (1.5,0) -- (1.5,2.5) -- (6,2.5);
% \filldraw (4.5,1.5) circle (.5ex);
% \draw[line width = .2ex] (4.5,0) -- (4.5,1.5) -- (6,1.5);
% \filldraw (2.5,0.5) circle (.5ex);
% \draw[line width = .2ex] (2.5,0) -- (2.5,0.5) -- (6,0.5);
% \end{tikzpicture}}
% \end{picture}
% \]
%  Then 
%  \begin{align*}
%      I_{L,\bf r}&=\langle 3-\text{minors of } L_{[5],[3]}, 2-\text{minors of } L_{[3],[3]} ,3-\text{minors of } L_{[3],[5]}  \rangle\\
%      &=\langle \det(L_{[3],\{3,4,5\}}), 2-\text{minors of } L_{[3],[3]} ,\det(L_{\{3,4,5\},[3]})  \rangle.  \qedhere
%  \end{align*}
% \end{example}



% Let $L$ be a two-sided ladder defined by southwest corners $L^{\sf SW}=\{(a_i,b_i)\}_{i\in[s]}$ and northeast corners $L^{\sf NE}=\{(c_j,d_j)\}_{j\in[t]}$, ordered northwest to southeast. 






% \begin{theorem}\label{thm:ladSingle321}
% Let $L$ be a two-sided ladder where $L^{\sf NE}=\{(c_i,d_i)\}_{i\in [s]}$ and $L^{\sf SW}=\{(a,0)\}$, with marked points
% $S=\{(a-\ell_j,w_j)\}$.
% Then
% ${\rm reg}(I_L)=\deg \mathfrak G_{u,w}-\#D(w)$ where $u,w\in \Sym_n$ with $u$ Grassmannian and $w$ $321$-avoiding.
% \end{theorem}
% \begin{proof}
% We know $I_{L}\cong I_{u,w}$ for $u,w\in \Sym_n$ $321$-avoiding by Appendix \ref{appendix}. Thus ${\rm reg}(I_L)=\deg \mathfrak G_{u,w}$ where $u,w\in \Sym_n$ are $321$-avoiding. Since $L^{\sf SW}=\{(a,0)\}$, it follows if $(x,y)\in \Ess(u)$, then $x=a$. Thus, $u$ is Grassmannian. 
% \end{proof}


% \begin{lemma}\label{lem:invSame}
% Let $u,w\in \Sym_n$.
% Then
% ${\rm reg}(I_{u,w})={\rm reg}(I_{u^{-1},w^{-1}})$.
% \end{lemma}
% \begin{proof}
% We know $I_{u,w}\cong I_{u^{-1},w^{-1}}$ for $u,w\in \Sym_n$ by the definition of $I_{u,w}$, where $\phi:I_{u,w}\rightarrow I_{u^{-1},w^{-1}}$ maps $x_{ij}\mapsto x_{ji}$. Thus, the result follows.
% \end{proof}



\acknowledgements{The author would like to thank Elisa Gorla, Jenna Rajchgot, Anna Weigandt, Alexander Yong for enlightening comments and conversations. We also would like to thank the reviewers for their helpful feedback. }

%% if you use biblatex then this generates the bibliography
%% if you use some other method then remove this and do it your own way
\printbibliography



\end{document}
