\documentclass[ALCO,ThmDefs,Unicode,epreuves]{cedram}
\OneNumberAllTheorems


\DeclareMathOperator{\oinv}{oinv}
\DeclareMathOperator{\onsp}{onsp}
\DeclareMathOperator{\nneg}{neg}
\DeclareMathOperator{\oneg}{oneg}
\DeclareMathOperator{\inv}{inv}
\DeclareMathOperator{\nsp}{nsp}
\DeclareMathOperator{\ensp}{ensp}
\DeclareMathOperator{\eneg}{eneg}
\DeclareMathOperator{\einv}{einv}
\DeclareMathOperator{\hgt}{ht}
\DeclareMathOperator{\Des}{Des}

\newcommand{\N}{\mathbb N}
\newcommand{\PP}{{\mathbb P}}

\numberwithin{equation}{section}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\mk}{\mkern -1mu}
\newcommand*{\Mk}{\mkern -2mu}
\newcommand*{\mK}{\mkern 1mu}
\newcommand*{\MK}{\mkern 2mu}

\hypersetup{urlcolor=purple, linkcolor=blue, citecolor=red}


\newcommand*{\romanenumi}{\renewcommand*{\theenumi}{\roman{enumi}}}
\newcommand*{\Romanenumi}{\renewcommand*{\theenumi}{\Roman{enumi}}}
\newcommand*{\alphenumi}{\renewcommand*{\theenumi}{\alph{enumi}}}
\newcommand*{\Alphenumi}{\renewcommand*{\theenumi}{\Alph{enumi}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Auteur

\author{\firstname{Francesco} \lastname{Brenti}} %%%%1


\address{Dipartimento di Matematica \\
Universit{\`a} di Roma ``Tor Vergata''\\
Via della Ricerca Scientifica, 1 \\
00133 Roma, Italy}

\email{brenti@mat.uniroma2.it}


%%%
\author{\firstname{Angela} \lastname{Carnevale}} %%%%2

\address{Fakult{\"a}t f{\"u}r Mathematik\\
 Universit{\"a}t Bielefeld\\ 
 Postfach 100131\\ 
 D-33501 Bielefeld, Germany}

\curraddr{\emph{Current address:} School of Mathematics\\ 
applied mathematics and statistics\\
 National University Galway\\
 Galway, Ireland}

\email{angela.carnevale@nuigalway.ie}

%%%%% Sujet

\keywords{Root system, Weyl group, Coxeter group, odd length, enumeration.}
 
\subjclass{17B22, 20F55, 05E99}


%%%%% Gestion
%
%\DOI{10.5802/alco.69}
%\datereceived{2018-08-19}
%\daterevised{2019-02-28}
%\dateaccepted{2019-03-02}


%%%%% Titre et résumé

\title[Odd length in Weyl groups]{Odd length in Weyl groups}

\begin{abstract}
We define for any crystallographic root system a new statistic on the corresponding Weyl group which we call the odd length. This statistic reduces, for
Weyl groups of types $A$, $B$, and $D$, to the each of the statistics by the same name that have already been 
defined and studied in [8], [12], [13], and [3]. We show that the sign-twisted generating function of the odd length
always factors completely,
and we obtain multivariate analogues of these
factorizations in types $B$ and $D$.	
\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%








\begin{document}


\maketitle

\section{Introduction}

A new statistic on the symmetric group was introduced in~\cite{KV} in relation to formed spaces.
This statistic combines combinatorial and parity conditions and is now known as the odd
length. Similar statistics were introduced and studied in~\cite{VS} and~\cite{VS2} in type $B$ in relation to local
factors of representation zeta functions of certain groups and in type $D$ in~\cite{BC2}.
The sign-twisted distribution of the odd length on certain quotients of the hyperoctahedral group of rank $n$ is closely related to the number of $n\times n$ symmetric matrices of given rank over finite fields (see~\cite{VS} for the conjecture relating these quantities and~\cite{BC1} for a proof). In~\cite{KV} and~\cite{VS2} closed product formulas were conjectured for the signed generating
function of the odd length over all quotients of the symmetric and hyperoctahedral groups, 
respectively. These conjectures were proved in~\cite{BC1} in types $A$ and $B$ and independently in~\cite{Lan} in type~$B$. 

In this paper we define, for any crystallographic root system, a new statistic on the corresponding Weyl group. We compute this statistic combinatorially for the classical root systems of types $A$, $B$, $C$, and $D$.
As a consequence we verify that this statistic coincides, in types $A$, $B$, and $D$, with each of the odd length statistics defined and studied in 
these types in~\cite{BC2,KV,Lan,VS,VS2}. Our combinatorial computation of the odd length in the classical types shows that it is the sum of some more
fundamental statistics and we compute the sign-twisted multivariate generating functions of these statistics in types $B$ and $D$. These results reduce to results in~\cite{KV},~\cite{VS2}, and~\cite{BC1} when all
the variables are equal.
We also show that the signed generating function of the odd length factors completely for any crystallographic
root system. In type $E_8$ this result is due to John Stembridge, who in~\cite{Stepre} also provides 
a unified description of these factorizations. More precisely, in~\cite{Stepre} Stembridge gives a, different, case by case proof of the factorization result, and shows that the factors themselves can be
described in terms of the degrees of the free generators of the polynomial invariants of a canonically associated reflection group.


The organization of the paper is as follows. In the next section we recall some definitions, notation and
results that are used in the sequel. In \S~\ref{sec:oddl} we define a new statistic on any Weyl group, which we call the odd
length. This statistic depends on the choice of a simple system in the root system of the Weyl group and we
show that its generating function over the Weyl group only depends on the root system. Using a convenient
choice of simple systems we compute combinatorially the odd length of any element of any Weyl group of
classical type and verify that it coincides, in types $A$, $B$, and $D$, with the odd length statistics already
defined in~\cite{KV,VS,VS2,BC2} in these types. In
\S~\ref{sec:multib} and \S~\ref{sec:multid} we compute, motivated by the results in \S~\ref{sec:oddl}, the signed
multivariate distributions of certain statistics 
over the Weyl groups of types $B$ and $D$ and show that they factor as products of binomials in almost all cases. In \S~\ref{sec:main}
we show, using previous results and computer calculations, that the signed generating function of the odd length factors completely for all irreducible crystallographic root systems. Finally,
in \S~\ref{sec:oddrefl}, we study the signed generating function of another statistic, defined in terms of reflections. Its definition is suggested by the results in \S~\ref{sec:multib}, it is defined on any Coxeter system, and we prove product formulas for its signed generating function on all Weyl groups.






\section{Preliminaries}\label{sec:pre}
In the following $V$ is a real vector space endowed with a symmetric bilinear form $(\cdot,\cdot)$. A reflection is a linear operator $s$ on $V$ which sends some nonzero vector $\alpha$ to its negative and fixes pointwise the hyperplane $H_\alpha$ orthogonal to it. For $v\in V$ the action of $s=s_\alpha$ is given by:
\[s_\alpha v=v-2\frac{(\alpha,v)}{(\alpha,\alpha)}\alpha.\]
It is easy to see that $s_\alpha$ is an involution in $O(V)$, the group of orthogonal transformations of $V$. Finite reflection groups are finite subgroups of $O(V)$ generated by reflections. We are interested in Coxeter groups of type $A$, $B$ and $D$, which arise as reflection groups of crystallographic root systems.

\begin{defi}
Let $V$, $(\cdot,\cdot)$ be as before. A finite subset $\Phi \subset V$ of nonzero vectors is a \emph{crystallographic root system} if it spans $V$ and satisfies:
\begin{enumerate}
\item\label{defi2.1_1} $\Phi \cap \mathbb R \alpha=\{\alpha,-\alpha\}$ for all $\alpha \in \Phi$
\item\label{defi2.1_2} $s_{\alpha}\Phi=\Phi$ for all $\alpha \in \Phi$
\item\label{defi2.1_3} $2\frac{(\alpha,\beta)}{(\alpha,\alpha)} \in \mathbb Z$ for all $\alpha,\beta\in \Phi$.
\end{enumerate}
Vectors in $\Phi$ are called \emph{roots}.
\end{defi}
The group $W$ generated by the reflections $\{s_\alpha, \,\alpha \in \Phi\}$, is the \emph{Weyl group} of $\Phi$.

We call a subset $\Delta \subseteq \Phi$ a \emph{simple system} if it is a basis of the $\mathbb R-$span of $\Phi$ in $V$ and if moreover each $\alpha \in \Phi$ is a linear combination of elements of $\Delta$ with all nonnegative or all nonpositive coefficients. It is well known that simple systems exist (for details see~\cite{Hum}) and that for crystallographic root systems all the roots are integer linear combinations of simple roots. The group $W$ is indeed generated by $S=\{s_\alpha,\,\alpha\in \Delta\}$, the set of simple reflections. Moreover $(W,S)$ is a Coxeter system. For an element $w=s_{\alpha_1}\cdots s_{\alpha_r}\in W$ and a root $\alpha$ we let $w(\alpha)$ denote the action of $w$ on $\alpha$ as composition of the reflections $s_{\alpha_1},\ldots,s_{\alpha_r}$.

We follow~\cite{BB} for notation and terminology about Coxeter groups. In particular, for a Coxeter system $(W,S)$ associated with a root system as above, we let $\ell_\Delta$ be the Coxeter length and $T$ be the set of reflections
\[ T=\{w^{-1}sw\;:\; w\in W, s\in S\}.\] For 
$I\subseteq S$ we define the quotient
\[
^{I}W := \{w\in W \;:\; D_L(w)\subseteq S\setminus I\},
\]
where 
$D_L(w)=\{s\in S \;:\; \ell_\Delta(sw)<\ell_\Delta(w)\}$. We define similarly
$D_R(w)$. The parabolic subgroup $W_I$
is the subgroup generated by $I$. The following result is well known (see, e.g.~\cite[Proposition~2.4.4]{BB}).

\begin{prop}
Let $(W,S)$ be a Coxeter system, $J \subseteq S$, and $w \in W$. Then there exist
unique elements ${^Jw} \in {^JW}$ and 
${_Jw} \in W_J$ such that $w={_Jw} \, {^Jw}$. Furthermore
$\ell_\Delta(w)=\ell_\Delta({_Jw})+\ell_\Delta({^Jw})$.
\end{prop}

For $\Delta=\{\alpha_s,\,s\in S\}$, we let $\Phi_\Delta ^+$ denote the set of roots that are nonnegative linear combinations of simple roots, and $\Phi_\Delta ^-=-\Phi_\Delta^+$, so $\Phi_\Delta=\Phi_\Delta^+\cup \Phi_\Delta^-$.

\noindent 
For $\alpha \in \Phi$, $\alpha=\sum_{s\in S} c_s \alpha_s$, we call \emph{height} of $\alpha$ (with respect to $\Delta$) the sum of the coefficients of the linear combination: 
\begin{equation}\label{hg}
\hgt_\Delta(\alpha):=\sum_{s\in S}{c_s}.
\end{equation}

For a Coxeter system $(W,S)$ as above, the Coxeter length has an interpretation in terms of the action of $W$ on $\Phi$:\begin{equation}\label{lengthroot}
\ell_\Delta(w)=|\{\alpha\in\Phi^+\,:\,w(\alpha)\in \Phi^-\}|,
\end{equation}
that is, for any element $w\in W$ it counts the number of positive roots sent to negative roots by its action as a composition of reflections.



Let now $\Phi$ be a crystallographic irreducible root system of type $A$, $B$, $C$, or $D$. We consider, in particular, for each of these types the following root systems:
\begin{enumerate}
\item $\Phi=\{\pm(e_i-e_j),\,1\leq i<j\leq n\}$, for type $A_{n-1}$,
\item $\Phi=\{\pm(e_i\pm e_j),\,1\leq i<j\leq n\}\cup\{\pm e_i, i\in [n]\}$, for type $B_{n}$,
\item $\Phi=\{\pm(e_i\pm e_j),\,1\leq i<j\leq n\}\cup\{\pm 2e_i, i\in [n]\}$, for type $C_{n}$,
\item $\Phi=\{\pm(e_i\pm e_j),\,1\leq i<j\leq n\}$, for type $D_{n}$.
\end{enumerate}
For these systems, we will consider in the sequel the following convenient choices of simple systems:
\begin{enumerate}
\item $\Delta=\{(e_{i+1}-e_{i}),\, i\in [n-1]\}$, for type $A_{n-1}$,
\item $\Delta=\{(e_{i+1}- e_{i}),\, i\in [n-1]\}\cup\{e_1\}$, for type $B_{n}$,
\item $\Delta=\{(e_{i+1}- e_i),\, i\in [n-1]\}\cup\{2e_1\}$, for type $C_{n}$,
\item $\Delta=\{(e_{i+1}- e_i),\, i\in [n-1]\} \cup \{ e_1 + e_2 \}$, for type $D_{n}$.
\end{enumerate}
We recall here that for suitable sets of generators, the groups
$W(\Phi)$ are not only Coxeter groups, but they have very nice
combinatorial descriptions as permutation groups. We employ here, for
these groups, notation from~\cite[Chapter~8]{BB}. In particular, we
write $S^B_n$ for the group of signed permutations of degree $n$,
namely permutations $\sigma$ of $[-n,n]$ satisfying
$\sigma(i)=-\sigma(-i)$ for all $i\in[-n,n]$. We write $S^D_n$ for the
group of even signed permutations of degree $n$, subgroup of $S^B_n$
consisting of signed permutations with an even number of negative
entries in their restriction to $[n]$. Given $\sigma \in S^B_n$
we write $ \sigma = [a_1, \ldots , a_n]$ to mean that $\sigma (i) =a_i$ 
for all $i \in [n]$ (called \emph{window
 notation} of the signed permutation $\sigma$). We also use, for (even) signed permutations, the disjoint cycle notation. 
\begin{prop}\label{prelim}
Let $\Delta\subseteq\Phi$ and $S$ be as above. Then $(W(\Phi),S)$ is isomorphic to:
\begin{enumerate}
\item the symmetric group $S_n$, with Coxeter generators the simple transpositions $(i,i+1)$, for $i=1\ldots n-1$, if $\Phi$ is of type $A_{n-1}$;
\item the group of signed permutations $S_n^ B$, with Coxeter generators the simple trans\-positions $(i,i+1)(-i,-i-1)$, for $i=1\ldots n-1$, and $s_0^B=[-1,2,\ldots,n]$, if $\Phi$ is of type $B_n$ or $C_n$;
\item the group of even signed permutations $S^D_n$, with Coxeter generators the simple transpositions $(i,i+1)(-i,-i-1)$, for $i=1\ldots n-1$, and $s_0^D=[-2,-1,3,\ldots,n]$, if $\Phi$ is of type $D_n$.
\end{enumerate} 
Moreover, with the above choices of simple systems, the Coxeter length has combinatorial interpretations in terms of statistics on the window notation. In particular, for $\sigma\in W(\Phi)$ 
\[\ell_\Delta(\sigma)=\begin{cases} \inv(\sigma),& \mbox{ if $\Phi$ is of type $A$,}\\
 \inv(\sigma)+\nneg(\sigma)+\nsp(\sigma), &\mbox{ if $\Phi$ is of type $B$ or $C$,}\\
 \inv(\sigma)+\nsp(\sigma),& \mbox{ if $\Phi$ is of type $D$,}\end{cases}
 \]
 where $\inv(\sigma)=|\{(i,j)\in[n]^2\colon i<j,\,\sigma(i)>\sigma(j)\}|$, $\nneg(\sigma)=|\{i \in[n]\colon \sigma(i)<0\}|$ and $\nsp(\sigma)=|\{(i,j)\in[n]^2\colon i<j,\,\sigma(i)+\sigma(j)<0\}|$.
\end{prop}
 In the sequel, we write $\ell$ for $\ell_\Delta$ when using the above
 combinatorial interpretations of the Coxeter length.

\section{Odd length}\label{sec:oddl}
In this section we define, for any crystallographic root system $\Phi$, a new statistic on the corresponding Weyl group $W(\Phi)$. 
While this statistic, which we call the odd length, depends on the choice
of a simple system $\Delta \subseteq \Phi$, we show that its generating function over the corresponding Weyl group does not. 
We then compute combinatorially this new statistic for the classical Weyl groups, for a natural
choice of simple system, and show that it coincides with each of the statistics by the same name that 
have already been defined and studied in~\cite{BC1,BC2,KV,VS,VS2}. 

\begin{defi}
Let $\Phi$ be a crystallographic root system and $W=W(\Phi)$ be the corresponding Weyl group. Let 
$\Delta \subseteq \Phi$ be a simple system for $\Phi$, and let 
$\Phi^{+}_{\Delta}$ and $\Phi^{-}_{\Delta}$ be the corresponding sets of positive and negative
roots. Given a positive root $\alpha \in \Phi^{+}_{\Delta}$, we let $\hgt_{\Delta}(\alpha)$ be its height,
relative to $\Delta$.
For any $w \in W$, we let
\begin{equation}
L_{\Delta}(w):=|\{\alpha\in \Phi^{+}_{\Delta}\,: \, \hgt_{\Delta}(\alpha) \equiv 1 \pmod 2 ,\,
w(\alpha)\in \Phi^{-}_{\Delta} \}|.
\end{equation}
We call $L_\Delta(w)$ the {\em odd length} of $\sigma$, and we call \emph{odd roots} the positive roots of odd height.
\end{defi}
Our object of interest in this work is the sign-twisted generating function of the odd length over
the Weyl group. We now show that this generating function does not depend on the simple system
used to compute $L_{\Delta}$ and $\ell_{\Delta}$.
\begin{prop}\label{pro:conj}
Let $\Phi$ be a crystallographic root system and $\Delta, \Delta' \subseteq \Phi$ be simple systems for $\Phi$.
Then there exists $u\in W$ such that
\[L_{\Delta'}(w)=L_{\Delta}(u^{-1} w u)\]
for all $w \in W$.
\end{prop}
\begin{proof}
It is well known (see, e.g.~\cite[\S~1.4]{Hum}) that under our hypotheses there exists $u \in W$ 
such that $u(\Delta) = \Delta'$, and so $u(\Phi^{+}_{\Delta})= \Phi^{+}_{\Delta'}$. From this it
follows easily that for any $\alpha \in \Phi^{+}_{\Delta}$ we have that $\hgt_{\Delta}(\alpha) =
\hgt_{\Delta'}(u(\alpha))$. Therefore 
\begin{align*}
L_{\Delta'}(w)&= 
|\{\alpha\in \Phi^{+}_{\Delta'}\,: \, \hgt_{\Delta'}(\alpha) \equiv 1 \pmod 2 ,\,
w(\alpha)\in \Phi^{-}_{\Delta'} \}| \\
&=
|\{\beta \in \Phi^{+}_{\Delta}\,: \, \hgt_{\Delta'}(u(\beta)) \equiv 1 \pmod 2 ,\,
w(u(\beta))\in \Phi^{-}_{\Delta'} \}| \\
&= |\{\beta\in \Phi^{+}_{\Delta}\,: \, \hgt_{\Delta}(\beta) \equiv 1 \pmod 2 ,\,
w(u(\beta))\in u(\Phi^{-}_{\Delta}) \}| \\
&=L_{\Delta}(u^{-1} wu)
\end{align*} for all $w \in W$. 
\end{proof}
\begin{coro}
 Let $\Phi,\Delta,\Delta'$ be as before. Then
 \[
\sum_{w \in W} x^{\ell_{\Delta}(w)} y^{L_{\Delta}(w)} =
\sum_{w \in W} x^{\ell_{\Delta'}(w)} y^{L_{\Delta'}(w)}.
\]
In particular, $\sum_{w \in W} (-1)^{\ell_{\Delta}(w)} y^{L_{\Delta}(w)} =
\sum_{w \in W} (-1)^{\ell_{\Delta'}(w)} y^{L_{\Delta'}(w)}$.
\end{coro}
\begin{proof}
 By Proposition~\ref{pro:conj}, there exists $u\in W$ with $L_{\Delta'}(w)=L_{\Delta}(u^{-1} wu)$ for all $u \in W$. Similarly, $\ell_{\Delta'}(w) = \ell_{\Delta}(u^{-1} wu)$ for all $w\in W$.
 Hence
\[
\sum_{w\in W} x^{\ell_{\Delta'}(w)} y^{L_{\Delta'}(w)}=
\sum_{w \in W} x^{\ell_{\Delta}(u^{-1}w u )} y^{L_{\Delta}(u^{-1}wu)} =
\sum_{v \in W} x^{\ell_{\Delta}(v)} y^{L_{\Delta}(v)}.\qedhere
\]

 \end{proof}

We now derive combinatorial descriptions of $L_{\Delta}$ for the root systems of types 
$A$, $B$, $C$, and $D$, for the same choice of simple systems used in Proposition~\ref{prelim}.
For $\sigma \in S^B_n$ we let, following~\cite{BC1},
\begin{align*}
\oneg(\sigma)&:=|\{i\in [n] \colon\sigma(i)<0, \; i \equiv 1 \pmod 2 \}|\\
\onsp(\sigma)&:=|\{(i,j)\in [n]\times[n]\colon i<j, \,\sigma(i)+\sigma(j)<0, \; j-i \equiv 1 \pmod 2 \}|, \\
\oinv(\sigma)&:= |\{(i,j)\in [n]\times[n] \colon i<j, \,\sigma(i) > \sigma(j), \; j-i \equiv 1 \pmod 2\}|,
\end{align*}
and define similarly their ``even'' analogues $\eneg$, $\ensp$, and $\einv$.

\begin{prop} \label{oddcomb}
Let $\Phi$ be a crystallographic root system of type $A$, $B$, $C$, or $D$, and 
$\Delta \subseteq \Phi$ be the simple system considered in Proposition~\ref{prelim}. Then
\[
L_{\Delta}(\sigma)=\begin{cases} 
\oinv(\sigma), \quad&\mbox{if $\Phi$ is of type $A$} \\
\oneg(\sigma)+\oinv(\sigma)+\onsp(\sigma), \quad&\mbox{if $\Phi$ is of type $B$}, \\
\nneg(\sigma)+\oinv(\sigma)+\ensp(\sigma), \quad&\mbox{if $\Phi$ is of type $C$}, \\
\oinv(\sigma)+\onsp(\sigma), \quad&\mbox{if $\Phi$ is of type $D$}, \\
\end{cases}
\]
for all $\sigma$ in the Weyl group of $\Phi$.							
\end{prop}
\begin{proof}
In all types a simple computation shows that
$
\hgt_\Delta(-e_i+e_j)=j-i,
$
for all $1\leq i<j\leq n$. Furthermore, if $\Phi$ is of type $B$ then one obtains that
$
\hgt_\Delta(e_i)=i $ for all $1 \leq i \leq n$ and $\hgt_\Delta(e_i+e_j)=i+j$ for
all $1\leq i<j\leq n$. If $\Phi$ is of type $C$ then
$\hgt_\Delta(e_i+e_j)=i+j-1$ for all $1\leq i \leq j\leq n$. Finally,
$ \hgt_\Delta(e_i+e_j)=i+j-2$ for all $1\leq i<j\leq n$
if $\Phi$ is of type~$D$.
\end{proof}

So, for example, if $n=5$, and $\sigma=[3,-1,-4,-2,5]\in S_5^B$, then $L_{\Delta}(\sigma)=6$, if $\Phi$ is of type $B$,
while $L_{\Delta}(\sigma)=8$ if $\Phi$ is of type $C$.

Proposition~\ref{oddcomb} shows that in types $A$, $B$, and $D$, with the choice of simple system
made there, $L_{\Delta}$ coincides with the odd length $L$ defined and studied in~\cite{BC1,BC2,KV,VS,VS2}.

We note the following simple consequence of Proposition~\ref{oddcomb}.
\begin{prop} \label{oddmax}
Let $\Phi$ be a crystallographic root system of type $A$, $B$, $C$, or $D$, 
let $\Delta \subseteq \Phi$ be the simple system considered in Proposition~\ref{prelim}, let $W$ be the corresponding Weyl group, and let $w_0$ be
the longest element of $W$. Then
\[
L_{\Delta}(w_0)=\begin{cases} 
\lfloor \frac{n}{2} \rfloor \lceil \frac{n}{2} \rceil, \quad&\mbox{if $\Phi$ is of type $A_{n-1}$,} \\
\binom{n+1}{2}, \quad&\mbox{if $\Phi$ is of type $B_n$}, \\
\binom{n+1}{2}, \quad&\mbox{if $\Phi$ is of type $C_n$}, \\
2 \lfloor \frac{n}{2} \rfloor \lceil \frac{n}{2} \rceil, \quad&\mbox{if $\Phi$ is of type $D_n$}. \\
\end{cases}
\]						
\end{prop}



\iffalse \section{Signed multivariate distributions}\label{sec:multiv}
Taking inspiration from the combinatorial descriptions of the odd length proved in Proposition~\ref{oddcomb}, we define here some natural generalizations of these statistics and study their signed (multivariate) distributions over the classical Weyl groups. In all cases, we show that these generating functions factor in a very explicit way.
\fi
\section{Type \texorpdfstring{$A$}{A}}\label{sec:typeA}
We showed in the previous section that the odd length combinatorially
defined for type~$A$ coincides with $L_{\Delta}$ for a very natural
choice of simple system of type $A_{n-1}$. Product formulas for the
sign-twisted distribution of this statistic over all quotiens of the
symmetric groups were proved in~\cite{BC1}. For later use (see
Section~\ref{sec:multid}), we prove here that the signed generating function of $L_{\Delta}(=\oinv)$ over $S_n$ is the same as the one over the set of unimodal permutations, whose definition we now recall. 


\begin{defi}
Let $\sigma \in S_n$. We say that $i\in [2,n-1]$ is a \emph{peak} if $\sigma(i-1)<\sigma(i)>\sigma(i+1)$.
\end{defi}
\begin{defi}
We say that a permutation $\sigma\in S_n$ is \emph{unimodal} if it has no peaks. We denote by $U_n$ the set of unimodal permutations.
\end{defi}
It is easy to see that peaks (and valleys) allow the definition of involutions that preserve the number of odd inversions and change the length by $\pm 1$. In the following lemma we use in particular ``the highest peak'' to define an involution of this type.
\begin{prop}
\label{lem:unim} Let $n\in \N$. Then
\[\sum_{\sigma \in S_n}(-1)^{\ell(\sigma)}x^{\oinv(\sigma)}=\sum_{\sigma \in U_n}(-1)^{\ell(\sigma)}x^{\oinv(\sigma)}.\]
\end{prop}
\begin{proof}
Let $\sigma \in S_n \setminus U_n$. Let $R_{\sigma}:=\{\sigma(i)\colon i \mbox{ peak}\}$ be the set of the values of the images of the peaks of $\sigma$. By hypothesis $R_{\sigma}$ is non-empty. Let $r$ be such that $\sigma(r)=\max R_{\sigma}$ and define the involution $\sigma^r:=\sigma(r-1,r+1)$. Then $\ell(\sigma^r)=\ell(\sigma)\pm1$ while $\oinv(\sigma^r)=\oinv(\sigma)$. Thus
\[\sum_{\sigma \in S_n}(-1)^{\ell(\sigma)}x^{\oinv(\sigma)}=\sum_{\sigma \in U_n}(-1)^{\ell(\sigma)}x^{\oinv(\sigma)},\] as desired.\end{proof}


In fact, a finer result holds: the signed generating function is the same when restricted to chessboard elements, defined in~\cite{VS}, whose definition we recall here.
\begin{defi}
	We say that a permutation $\sigma\in S_n$, resp.\ a signed permutation $\sigma \in S^B_n$, is \emph{chessboard} if $\sigma(i)\equiv i \pmod 2$ for all $i\in[n]$ or if $\sigma(i)\equiv i+1 \pmod 2 $ for all $i \in [n ]$. We write $C(S_n)$, resp.\ $C(S^B_n)$, for the subgroup of the chessboard elements of the relative group and for $X\subset S_n$, resp.\ $X\subset S^B_n$, we denote $C(X)=X\cap C(S_n)$, resp.\ $C(X)=X\cap C(S^B_n)$.
\end{defi}


\begin{rema}
As the involution defined in the proof of Proposition~\ref{lem:unim} preserves the parity of the entries in all positions, the same equality holds true when restricting the supports of the sums on both sides to chessboard elements, 
\begin{equation}\label{eq:chbunim}\sum_{\sigma \in C(S_n)}(-1)^{\ell(\sigma)}x^{\oinv(\sigma)}=\sum_{\sigma \in C(U_n)}(-1)^{\ell(\sigma)}x^{\oinv(\sigma)}.\end{equation} \end{rema}





\section{Types \texorpdfstring{$B$}{B} and \texorpdfstring{$C$}{C}}\label{sec:multib}
In this section we study the signed multivariate distributions of
the statistics $\oneg$, $\eneg$, $\oinv$, $\onsp$, and $\ensp$ over
the groups of signed permutations $S^B_n$. In almost all cases we show that these factor as product of binomials. In particular,
we obtain the signed generating function of $L_{\Delta}$ for
root systems of types ($B$ and)~$C$.




We begin with the following lemmas. Their proofs are straightforward verifications from the definitions and are 
therefore omitted. We first fix some notation used for the rest of this section.
\begin{defi}\label{def:sigmas}
Let $n\in \N$, $n\geq 2$. For $\sigma \in B_{n-1}$ we let
$\tilde\sigma:=[\sigma(1),\ldots,\sigma(n-1),-n]$,
$\hat\sigma:=[n,\sigma(1),\ldots,\sigma(n-1)]$ and $\check\sigma:=[-n,\sigma(1),\ldots,\sigma(n-1)]$.
\end{defi}

\begin{lemma}\label{tilde}
 Let $n\in \N$, $n\geq 2$ and keep notation from
 Definition~\ref{def:sigmas}. Let $\delta:=n-1 \pmod 2$.
Then:
%$$
%\begin{aligned}
%\oneg(\tilde\sigma)&=\oneg(\sigma)+1-\delta 
%&&& \eneg(\tilde\sigma)&=\eneg(\sigma)+\delta \\
%\oinv(\tilde\sigma)&=\oinv(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil 
%&&& \einv(\tilde\sigma)&=\einv(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor\\
%\onsp(\tilde\sigma)&=\onsp(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil
% &&& \ensp(\tilde\sigma)&=\ensp(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor .\\
%\end{aligned}
%$$

\vspace{1mm}
\begin{tabular}{ll}
$\oneg(\tilde\sigma)=\oneg(\sigma)+1-\delta$ & $\eneg(\tilde\sigma)=\eneg(\sigma)+\delta$ \\
$\oinv(\tilde\sigma)=\oinv(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil$ & $\einv(\tilde\sigma)=\einv(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor$\\
$\onsp(\tilde\sigma)=\onsp(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil$ & $\ensp(\tilde\sigma)=\ensp(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor$ .\\
\end{tabular}
\end{lemma}


\begin{lemma}\label{hat}
 Let $n\in \N$, $n\geq 2$ and keep notation from
 Definition~\ref{def:sigmas}. Then:
%$$
%\begin{aligned}
%\oneg(\hat\sigma)&=\eneg(\sigma) 
%&&& \eneg(\hat\sigma)&=\oneg(\sigma) \\
%\oinv(\hat\sigma)&=\oinv(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil
% &&& \einv(\hat\sigma)&=\einv(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor \\
%\onsp(\hat\sigma)&=\onsp(\sigma) &&& \ensp(\hat\sigma)&=\ensp(\sigma). \\
%\end{aligned}
%$$

\vspace{1mm}
\begin{tabular}{ll}
$\oneg(\hat\sigma)=\eneg(\sigma)$ & $\eneg(\hat\sigma)=\oneg(\sigma)$ \\
$\oinv(\hat\sigma)=\oinv(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil$ & $\einv(\hat\sigma)=\einv(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor$ \\
$\onsp(\hat\sigma)=\onsp(\sigma)$ & $\ensp(\hat\sigma)=\ensp(\sigma)$. \\
\end{tabular}
\end{lemma}

\begin{lemma}\label{check}
 Let $n\in \N$, $n\geq 2$ and keep notation from
 Definition~\ref{def:sigmas}. Then:
%$$
%\begin{aligned}
%\oneg(\check\sigma)&=\eneg(\sigma)+1 &&& \eneg(\check\sigma)&=\oneg(\sigma) \\
%\oinv(\check\sigma)&=\oinv(\sigma&&&\einv(\check\sigma)&=\einv(\sigma) \\
%\onsp(\check\sigma)&=\onsp(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil &&& \ensp(\check%\sigma)&=\ensp(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor .\\
%\end{aligned}
%$$

\vspace{1mm}

\begin{tabular}{ll}
$\oneg(\check\sigma)=\eneg(\sigma)+1$ & $\eneg(\check\sigma)=\oneg(\sigma)$ \\
$\oinv(\check\sigma)=\oinv(\sigma)$ & $\einv(\check\sigma)=\einv(\sigma)$ \\
$\onsp(\check\sigma)=\onsp(\sigma)+\left\lceil\frac{n-1}{2}\right\rceil$ & $\ensp(\check\sigma)=\ensp(\sigma)+\left\lfloor\frac{n-1}{2}\right\rfloor$ .\\
\end{tabular}
\end{lemma}

The key observation to prove the formulas for the signed multivariate distributions is the following, which is analogous to~\cite[Lemma~3.3]{BC2}.

\begin{lemma}\label{zerotri}
Let $\sigma \in S^B_n$, $s \in \{ \oneg, \eneg, \onsp, \ensp \}$, and $a \in [\pm n] \setminus \{\pm 1,\pm n\}$. Then, if $\sigma^*:=\sigma(a-1,a+1)(-a+1,-a-1)$, one has:
\[ s(\sigma^*)=s(\sigma), \quad \quad
\ell(\sigma^*)=\ell(\sigma)\pm 1.
\]
Furthermore, if $a=\sigma^{-1}(n)$, then $\oinv(\sigma^*)=\oinv(\sigma)$.
\end{lemma}


In the following we let, for $n\in \mathbb N$,
$$F_n(x_1,x_2,y,z_1,z_2):=\sum_{\sigma \in S^B_n} (-1)^{\ell(\sigma)} x_1^{\oneg(\sigma)}x_2^{\eneg(\sigma)}y^{\oinv(\sigma)}z_1^{\onsp(\sigma)}z_2^{\ensp(\sigma)}.$$ The signed multivariate distributions that we study in this section are specializations of the polynomials $F_n$.
\begin{theo}
\label{triv2}
Let $n \in \mathbb P$. Then 
\begin{multline*}
F_n(x_1,x_2,y,1,z)\\
=\begin{cases}
\displaystyle\prod_{i=1}^{n-1}(1+ (-1)^i y^{\lceil \frac{i}{2} \rceil})
\prod_{i=0}^{\lfloor \frac{n-2}{2} \rfloor}(1-x_1 x_2 z^{2i}), 
& \mbox{if $n \equiv 0 \pmod 2$,} \\
\displaystyle (1-x_1 z^{\frac{n-1}{2}})
\prod_{i=1}^{n-1}(1+ (-1)^i y^{\lceil \frac{i}{2} \rceil})
\prod_{i=0}^{\lfloor \frac{n-2}{2} \rfloor}(1-x_1 x_2 z^{2i}), 
& \mbox{if $n \equiv 1 \pmod 2$,}
\end{cases}
\end{multline*}


\end{theo}
\begin{proof}
We proceed by induction on $n \in \PP$, the result being easy to check if $n \leq 2$. Assume $n \geq 3$. Let $f(\sigma)=(-1)^{\ell(\sigma)}x_1^{\oneg(\sigma)} x_2^{\eneg(\sigma)} y^{\oinv(\sigma)}z^{\ensp(\sigma)}$ for all $\sigma \in S^B_n$. 
By Lemma~\ref{zerotri} we have:
\begin{align}
 F_n(x_1,x_2,y,1,z)
 &= \sum_{ \substack{\{\sigma\in S^B_n :\\ \sigma(n)=n\}}}{f(\sigma)} +\sum_{ \substack{\{\sigma\in S^B_n :\\ \sigma(-n)=n\}}}{f(\sigma)} +\sum_{ \substack{\{\sigma\in S^B_n :\\ \sigma(1)=n\}}}{f(\sigma)}+\sum_{\substack{\{\sigma\in S^B_n :\\ \sigma(-1)=n\}}}{f(\sigma)}\nonumber\\\label{sumtri}
&= \sum_{\sigma \in S^B_{n-1}}
\left( f(\sigma)+f(\tilde\sigma)+f(\hat\sigma)+f(\check\sigma) \right) 
\end{align}
where $\tilde\sigma,\,\hat\sigma,\,\check\sigma$ are as in~\ref{def:sigmas}.
But, by Lemmas~\ref{tilde},~\ref{hat}, and~\ref{check} we have 
\begin{align*}
 f(\tilde\sigma)
 &=x_1^{1-\delta(n)} x_2^{\delta(n)} y^{\lceil \frac{n-1}{2} \rceil } z^{\lfloor \frac{n-1}{2} \rfloor} (-1)^{n-1} f(\sigma)
 ,\\
f(\hat\sigma)
&= (-1)^{n-1} y^{\lceil \frac{n-1}{2} \rceil}{(-1)^{\ell(\sigma)}x_1^{\eneg(\sigma)}x_2^{\oneg(\sigma)}y^{\oinv(\sigma)}z^{\ensp(\sigma)}}
, \\
f(\check\sigma)
&= x_1 z^{\lfloor \frac{n-1}{2} \rfloor} {(-1)^{\ell(\sigma)}x_1^{\eneg(\sigma)} x_2^{\oneg(\sigma)} y^{\oinv(\sigma)} z^{\ensp(\sigma)}}
,\end{align*}
for all $\sigma \in S^B_{n-1}$. 


Suppose now that $n \equiv 0 \pmod 2$. Then by our induction hypotheses we have
\begin{align*}
\sum_{\sigma \in S^B_{n}} f(\sigma)
& =  (1-x_2 y^{\frac{n}{2}} z^{\frac{n-2}{2}})F_{n-1}(x_1,x_2,y,1,z)
+ (x_1 z^{\frac{n-2}{2}}-y^{\frac{n}{2}}) F_{n-1}(x_2,x_1,y,1,z)\\ 
& =(1-x_2 y^{\frac{n}{2}} z^{\frac{n-2}{2}}) 
(1-x_1 z^{\frac{n-2}{2}}) 
\prod_{i=1}^{n-2}(1+(-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\frac{n-4}{2}}(1-x_1 x_2 z^{2i}) \\
&\hspace*{10mm} +  (x_1 z^{\frac{n-2}{2}}-y^{\frac{n}{2}})(1-x_2 z^{\frac{n-2}{2}}) 
\prod_{i=1}^{n-2} (1+(-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\frac{n-4}{2}} (1-x_1 x_2 z^{2i}) \\
 & =  (1+x_1 x_2 y^{\frac{n}{2}} z^{n-2}-y^{\frac{n}{2}}-x_1 x_2 z^{n-2}) 
\prod_{i=1}^{n-2} (1\Mk +\Mk (-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\frac{n-4}{2}}(1-x_1 x_2 z^{2i})
\end{align*}
and the result follows. Similarly, if $n \equiv 1 \pmod 2$ 
then we obtain 
\begin{align*}
\sum_{\sigma \in S^B_{n}} \Mk f(\sigma)
& =  (1\Mk +\Mk x_1 y^{\frac{n\Mk -\Mk 1}{2}} z^{\frac{n\Mk -\Mk 1}{2}}) F_{n\Mk -\Mk 1}(x_1,x_2,y,1,z)
\Mk +\Mk  (x_1 z^{\frac{n\Mk -\Mk 1}{2}}\Mk +\Mk y^{\frac{n\Mk -\Mk 1}{2}}) F_{n-1}(x_2,x_1,y,1,z)\\
&=(1+x_1 y^{\frac{n-1}{2}} z^{\frac{n-1}{2}}) 
\prod_{i=1}^{n-2}(1+(-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\frac{n-3}{2}}(1-x_1 x_2 z^{2i}) \\
& \hspace*{15mm}+ (x_1 z^{\frac{n-1}{2}}+y^{\frac{n-1}{2}}) 
\prod_{i=1}^{n-2} (1+(-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\frac{n-3}{2}} (1-x_1 x_2 z^{2i}) \\
 & =  \Mk (1\Mk +\Mk x_1 y^{\frac{n-1}{2}} z^{\frac{n-1}{2}}\Mk +\Mk y^{\frac{n-1}{2}}\Mk +\Mk x_1 z^{\frac{n-1}{2}}) 
\prod_{i=1}^{n-2} (1+(-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\lfloor \frac{n-2}{2} \rfloor}(1-x_1 x_2 z^{2i}) \\
 & =  (1+x_1 z^{\frac{n-1}{2}}) (1+y^{\frac{n-1}{2}}) 
\prod_{i=1}^{n-2} (1+(-1)^{i} y^{\lceil \frac{i}{2} \rceil}) \prod_{i=0}^{\lfloor \frac{n-2}{2} \rfloor}(1-x_1 x_2 z^{2i}),
\end{align*}
and the result again follows.
\end{proof}
As an immediate corollary of the previous result we obtain the generating function for the signed distribution of $L_{\Delta}$
for root systems of type $C$.
\begin{coro}
Let $n\in \mathbb P$. Then
\[
\sum_{w \in W(\Phi(C_n))}{(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}}= 
\frac{1}{2} \prod_{i=1}^{n} \left(1+x^{\left\lfloor\frac{i}{2}\right\rfloor}\right) \left(1-x^{\left\lceil\frac{i}{2}\right\rceil}\right).
\]\end{coro}
\begin{proof}
This follows easily from the combinatorial description of $L_\Delta$
in Proposition~\ref{oddcomb} and Theorem~\ref{triv2} by letting $x_1=x_2=y=z=x$.
\end{proof}

The following result gives the signed multivariate generating functions of $(\oneg,\oinv,\onsp)$ and $(\eneg,\oinv,\onsp)$ over the hyperoctahedral group $S^B_n$.
The proof is analogous to that of Theorem~\ref{triv2} and is therefore omitted.

\begin{theo}\label{triv1}
Let $n \in \mathbb P$. Then 
\begin{equation}
\label{triooo}
F_n(x,1,y,z,1)=\begin{cases}
\displaystyle (1-x) (1-y^\frac{n}{2} z^\frac{n}{2})
\prod_{i=1}^{\lfloor \frac{n-1}{2} \rfloor}(1-x z^{2i})(1-y^{2i}), 
& \mbox{if $n \equiv 0 \pmod 2$,} \\
\displaystyle (1-x) 
\prod_{i=1}^{\lfloor \frac{n-1}{2} \rfloor}(1-x z^{2i})(1-y^{2i}), 
& \mbox{if $n \equiv 1 \pmod 2$,}
\end{cases}
\end{equation}
and
\begin{equation}
\label{trieoo}
F_n(1,x,y,z,1)=\begin{cases}
\displaystyle (1-x) (z^\frac{n}{2}-y^\frac{n}{2} )
\prod_{i=1}^{\lfloor \frac{n-1}{2} \rfloor}(1-x z^{2i})(1-y^{2i}), 
& \mbox{if $n \equiv 0 \pmod 2$,} \\
\displaystyle 0, 
& \mbox{if $n \equiv 1 \pmod 2$.}
 \end{cases}
\end{equation}
\end{theo}


Note that the sign-twisted joint distribution of the statistics 
$(\oneg,\eneg,\oinv,\onsp)$ over~$S^B_n$
does not, instead, factor nicely in general. For example, 
\begin{multline*} 
F_4(x_1,x_2,y,z,1)\\
=\Mk (1\Mk -\Mk y^2) (1\Mk -\Mk  x_1 x_2 z^2) (1\Mk +\Mk x_1 x_2 y^2 z^2 \Mk -\Mk x_1 x_2 z^2 
\Mk -\Mk  x_2 y^2 z^2 \Mk  +\Mk  x_1 z^2 \Mk +\Mk  x_2 y^2 \Mk -\Mk x_1 \Mk -\Mk y^2 ).
\end{multline*} 
Similarly, the sign-twisted joint distributions of the statistics $(\oneg,\oinv,\onsp,\ensp)$ and $(\eneg,\oinv,\onsp,\ensp)$ also do not
factor nicely in general. For example, 
\begin{multline*}
F_4(x,1,y,z_1,z_2) \\
=\Mk (1\Mk -\Mk x)(1\Mk -\Mk y^2)(x y^2 z_1^4 z_2^2\Mk +\Mk x z_1^3 z_2\Mk -\Mk x z_1^3 z_2^2\Mk -\Mk x z_1^2 z_2\Mk -\Mk  y^2 z_1\Mk -\Mk  y^2 z_1^2 z_2\Mk +\Mk  y^2 z_1 z_2+1)
\end{multline*} 
and 
\begin{multline*} 
F_4(1,x,y,z_1,z_2)
\\
=\Mk (1\Mk -\Mk x)(1\Mk -\Mk y^2)
(x y^2 z_1^3 z_2^2\Mk -\Mk x y^2 z_1^3 z_2\Mk +\Mk x y^2 z_1^2 z_2\Mk -\Mk x z_1^4 z_2^2\Mk +\Mk  z_1^2 z_2\Mk -\Mk y^2+z_1\Mk -\Mk z_1 z_2).
\end{multline*} 
Analogous observations can be made for the polynomials $F_n(x_1,x_2,y,z_1,z_2)$. More precisely, our computations 
suggest that
\[
F_n(x_1,x_2,y,z_1,z_2) = H_n(x_1,x_2,y,z_1,z_2)
\prod_{i=1}^{\lfloor \frac{n-1}{2} \rfloor} (1-y^{2i}) 
\]
where $H_n(x_1,x_2,y,z_1,z_2)$ is an irreducible polynomial.
We have checked that this holds for $n \leq 6$. 

As an immediate corollary of Theorem~\ref{triv1} we obtain the
following result, which also follows from~\cite[Theorem~5.4]{BC1}.
\begin{coro}
Let $n\in \N$, $n\geq 2$. Then
\[
\sum_{w \in W(\Phi(B_n))}{(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}}= \prod_{i=1}^{n} (1-x^{i}).
\]
\end{coro}
\begin{proof}
 This follows easily from the combinatorial description of $L_\Delta$
in Proposition~\ref{oddcomb} and Theorem~\ref{triv1} by letting
$y=z=x$ in~\eqref{triooo}.
\end{proof}
\begin{rema}\label{rmk:char}
In all our formulas, the twist is always given by the sign character
of the relevant Weyl group. There are three other linear characters on groups
of type $B$: the trivial character, the negative character and the
product of negative and sign character. Character-twisted generating
functions for various choices of the characters
have been studied, for instance, in~\cite{Beu,Rei1,Rei2}. Note that formulas for the
joint distribution of $(\oneg,\eneg,\oinv,\ensp)$ twisted by the
 character $(-1)^{\ell+\nneg}$ are given by $F_n(-x_1,-x_2,y,1,z)$ in
Theorem~\ref{triv2}. We did not investigate, instead, 
negative-twisted generating functions involving our statistics. 
\end{rema}
\begin{rema}\label{rmk:matrices}
Univariate and multivariate signed generating functions over the
groups of signed permutations and their quotients---analogous to those
proved in this section---proved to have remarkable
enumerative applications. As we mentioned in the Introduction,
formulas for the
sign-twisted distribution of the odd length over quotients of signed
permutations have applications in the enumeration of symmetric
matrices of fixed rank over finite fields. The coincidence of analogous formulas
 relating character-twisted distributions of length-like statistics on
 quotients of the hyperoctahedral groups and rank enumeration of
 matrices is an intriguing phenomenon also observed for generic and
 antisymmetric matrices, cf.~\cite{VS}, and for traceless matrices,
 cf.~\cite{CSV}. Factorizations relating (possibly signed) joint
 distributions of statistics over the groups of signed permutations
 and their restrictions over the symmetric groups also have
 applications in this context; see, for instance,~\cite[Proposition~3.4 and Conjecture~3.7]{CSV}. It would be interesting to have similar applications for
 the product formulas involving the statistics studied here.
\end{rema}
We conclude by noting the following univariate natural special
cases of the multivariate results in this section.
For $n\in \mathbb P$ and $\sigma \in S^B_n$ we let
\begin{align}\label{def:uni}
L_{ooe}(\sigma)&:=\oneg(\sigma)+\oinv(\sigma)+\ensp(\sigma) \\ \nonumber
L_{eoe}(\sigma)&:=\eneg(\sigma)+\oinv(\sigma)+\ensp(\sigma) \\ \nonumber
L_{eoo}(\sigma)&:=\eneg(\sigma)+\oinv(\sigma)+\onsp(\sigma). \nonumber
\end{align}


\begin{coro}\label{cor:uni}
Let $n \in \N$, $n\geq 3$. Then
\begin{equation}\label{ooe}
\sum_{\sigma \in S^B_n}{(-1)^{\ell(\sigma)}x^{L_{ooe}(\sigma)}}=(1-x^{\left\lceil \frac{n}{2}\right\rceil})\prod_{i=1}^{n-1} (1-x^i),
\end{equation}
\begin{equation}\label{eoe}
\sum_{\sigma \in S^B_n}{(-1)^{\ell(\sigma)}x^{L_{eoe}(\sigma)}}=(1-x^{\left\lfloor \frac{n}{2}\right\rfloor})\prod_{i=1}^{n-1} (1-x^i ),
\end{equation}
and
\begin{equation}\label{eoo}
\sum_{\sigma \in S^B_n}{(-1)^{\ell(\sigma)}x^{L_{eoo}(\sigma)}}=0.
\end{equation}
\end{coro}
We will show in \S~\ref{sec:oddrefl} that the statistic $L_{ooe}$ has a type-independent description in terms of reflections.








\section{Type \texorpdfstring{$D$}{D}}\label{sec:multid}
As for type $B$, we derive in this section signed multivariate
generating functions for the statistics $\oinv,\, \onsp,\,\ensp$ over
the even hyperoctahedral groups. Product formulas for the
sign-twisted distribution of the odd length over the even
hyperoctahedral groups (and some of their quotients) were proved
in~\cite{BC2}. There it was also observed that they coincide with the
squares of the analogous formulas for $S_n$, cf.~\cite[Corollary~4.2]{BC2}. 
The proof of the result giving some of the signed
multivariate generating functions for the groups $S^D_n$ also explains
the mentioned coincidence. We prove formulas for various
specializations of the polynomial defined, for $n\in\mathbb N$, as follows
\[ G_n(x,y_1,y_2):=\sum_{\sigma\in S^D_n}
(-1)^{\ell(\sigma)}x^{\oinv(\sigma)}y_1^{\onsp(\sigma)}y_2^{\ensp(\sigma)}.\]
Our first result shows that 
 the signed joint distribution of $\oinv$ and $\ensp$ is zero.
\begin{prop}
	Let $n\in \mathbb P$. Then
	\begin{equation}
	G_n(x,1,y) =0.
	\end{equation}
\end{prop}
\begin{proof}
We define, for $\sigma \in S^D_n$, the following involution:
$$\overline \sigma=\begin{cases} \sigma s_1, & \mbox{ if } ||\sigma^{-1}(1)|-|\sigma^{-1}(2)||\equiv 2 \pmod 2 \\
 \sigma s_0^D, & \mbox{ if } ||\sigma^{-1}(1)|-|\sigma^{-1}(2)||\equiv 1 \pmod 2. \end{cases}$$
 It is clear that in both cases $\ell_D(\overline{\sigma})=\ell_D(\sigma)\pm 1$. We now show that, for all $\sigma\in S^D_n$, $\ensp(\sigma)=\ensp(\overline{\sigma})$ and $\oinv(\sigma)=\oinv(\overline{\sigma})$.
 
 Consider $\sigma$ for which the entries of absolute values $1$ and $2$ appear at an even distance. In this case the involution is defined by right multiplication by $s_1$, that is it exchanges these values. As the involution involves no sign changes, $\ensp(\sigma)=\ensp(\overline{\sigma})$. The only inversion involved is between positions at even distance, thus $\oinv(\sigma)=\oinv(\overline{\sigma})$. Similar reasoning shows that these equalities hold also in the other case. This implies the result.\qedhere
\end{proof}
Similarly to Corollary~\ref{cor:uni}, the previous result implies the following result about the univariate signed generating function of the statistic
\[L_{oe}(\sigma):=\oinv(\sigma)+\ensp(\sigma).\]
\begin{coro}
		Let $n\geq 2$. Then
		\begin{equation}
		\sum_{\sigma\in S^D_n}{(-1)^{\ell_D (\sigma)}x^{L_{oe}}(\sigma) } =
		0.
			\end{equation}
\end{coro}
We now study the signed bivariate generating function of
$(\oinv,\onsp)$, that refines the one of the odd length $L_{\Delta}$
in type $D$. 
We will need some preliminary results. 

The next lemma shows that, as in the case of the symmetric and hyperoctahedral groups, the signed generating function of the odd length over $S^D_n$ is the same when restricted to chessboard elements. We prove a finer result, namely that this holds also for the signed bivariate generating function of odd inversions and odd negative sum pairs.
\begin{lemma}\label{lem:chb}
Let $n \geq 2$. Then 
\[G_n(x,y,1)=\sum_{\sigma \in C(S^D_n)}{(-1)^{\ell_D(\sigma)}x^{\oinv(\sigma)}y^{\oneg(\sigma)}}.\]
\end{lemma}
\begin{proof}Let $\sigma \in S^D_n \setminus C(S^D_{n})$. Then there exists $i\in[n-1]$ such that $\sigma^{-1}(i)\equiv \sigma^{-1}(i+1) \pmod 2$. 
Let $i$ be minimal with this property and define $\sigma^{*}=s_{i} \sigma$. It is a well defined involution on $S^D_n \setminus C(S^D_{n})$. Clearly $\oinv(\sigma^{*})=\oinv(\sigma)$ and $\onsp(\sigma^{*})=\onsp(\sigma)$, while $\ell_D(\sigma^{*})=\ell_D(\sigma) \pm 1$. This implies the thesis.
\end{proof}
Recall that for $\sigma\in S^D_n$ the descent set is
$\Des(\sigma)=\{i\in [0,n-1]\colon \sigma(i)>\sigma(i+1)\}$, where we set $\sigma(0):=-\sigma(2)$. Also, recall that $S_n$ is naturally isomorphic to the parabolic subgroup $({S^D_n})_{[n-1]}$ of $S^D_n$, and that $S^D_n$ can be written as 
\[S^D_n=T_n S_n,\]
where $T_n=\{\tau \in S^D_n \colon \Des(\tau)\subseteq \{0\}\}$. That is, every even signed permutation $\sigma\in S^D_n$ can be uniquely written as $\sigma=\sigma^{[n-1]}\sigma_{[n-1]}$, with $\sigma^{[n-1]}\in T_n$ and $\sigma_{[n-1]}\in S_n$. Moreover,
 \[\ell_D(\sigma)=\ell_D(\sigma^{[n-1]})+\ell_D(\sigma_{[n-1]}),\]
 we refer the reader to~\cite[Chapter~8.2]{BB} for further
 details. This last property does not hold in general for
 $L_{\Delta}$. It does, however, for $L_{\Delta}$ on a special subset
 of chessboard elements of $S^D_n$, which we now define.

\begin{defi}
We say that an even signed permutation $\sigma$ is a \emph{good} chessboard element if $\sigma, \sigma^{[n-1]}$ and $\sigma_{[n-1]}$ are chessboard elements. We write $gC(S^D_n)$ for good chessboard elements of~$S^D_n$.\end{defi}
In the following lemma we show that the odd inversions and the odd negative sum pairs (and thus the odd length $L_{\Delta}$) are additive with respect to the parabolic factorization $S^D_n=T_n S_n$ on good chessboard elements. 
\begin{lemma}\label{lem:addD}
 Let $\sigma \in gC(S^D_n)$. Then 
 $$\oinv(\sigma)=\oinv(\sigma^{[n-1]})+\oinv(\sigma_{[n-1]}) \quad \mbox{and} \quad \onsp(\sigma)=\onsp(\sigma^{[n-1]})+\onsp(\sigma_{[n-1]}), $$
 where $\sigma=\sigma^{[n-1]}\sigma_{[n-1]}$, $\sigma^{[n-1]}\in C(T_n)$ and $\sigma_{[n-1]}\in C(S_n)$.
\end{lemma}
\begin{proof}
Let $\sigma$ be a good chessboard element. The set of inversions of $\sigma$ and $\sigma_{[n-1]}$ coincide. Moreover it is clear that $\oinv(\sigma^{[n-1]})=0$, thus
\[\oinv(\sigma)=\oinv(\sigma_{[n-1]})=\oinv(\sigma^{[n-1]})+\oinv(\sigma_{[n-1]}).\]
Since by assumption $\sigma^{[n-1]}$ is a chessboard element, the relative parities of pairs with negative sum are the same as for $\sigma$. Clearly $\onsp(\sigma_{[n-1]})=0$, thus
\[\onsp(\sigma)=\onsp(\sigma^{[n-1]})=\onsp(\sigma^{[n-1]})+\onsp(\sigma_{[n-1]}).\qedhere\]
\end{proof}
We show now that the signed bivariate generating function equals the one over good chessboard elements. The result follows from its analogue for type $B$.
\begin{lemma}\label{lem:good}
	Let $n\geq 2$. Then
\[G_n(x,y,1)=\sum_{\sigma\in gC(S^D_n)}{(-1)^{\ell_D (\sigma)}x^{\oinv (\sigma) }y^{\onsp (\sigma)}}.\]
\end{lemma}
\begin{proof}
The lemma follows by~\cite[Lemma~16 and Lemma~19]{VS}, observing that the involution defined in~\cite[Lemma~19]{VS} restricts to an involution on the relevant subset of $S^D_n$, since it does not involve sign changes.
\end{proof}
The next theorem implies (and gives a direct proof of)~\cite[Corollary~4.2]{BC2}.
\begin{theo}
	Let $n\geq 2$. Then
\[G_n(x,y,1)= \left(\sum_{\sigma\in S_n }{(-1)^{\ell (\sigma)}x^{\oinv (\sigma)}} \right)\left(\sum_{\sigma\in S_n }{(-1)^{\ell (\sigma)}y^{\oinv (\sigma)}}\right).\]
\end{theo}
%
\begin{proof}Thanks to Lemmas~\ref{lem:good} and~\ref{lem:addD} the sum on the left hand side can be rewritten as
\begin{align}\nonumber
G_n(x,y,1)&=\sum_{\sigma\in gC(S^D_n)}{(-1)^{\ell_D (\sigma)}x^{\oinv (\sigma) }y^{\onsp (\sigma)}}\\ \label{eq:fact} 
&=\left(\sum_{\sigma\in C(T_n)}{(-1)^{\ell_D (\sigma)}y^{\onsp (\sigma)}}\right)\left(\sum_{\sigma\in C(S_n)}{(-1)^{\ell (\sigma)}x^{\oinv (\sigma) }}\right).
\end{align}
We claim that the first factor of~\eqref{eq:fact} equals the signed distribution of the odd inversions on the symmetric group. Consider the map $$|\cdot|:S^D_n \rightarrow S_n,\qquad\sigma = [\sigma(1),\ldots,\sigma(n)] \mapsto |\sigma|=[|\sigma(1)|,\ldots,|\sigma(n)|].$$ Its restriction to $C(T_n)$ is a bijection onto $C(U_n)$, the set of chessboard unimodal permutations. It is easy to see that (odd) negative sum pairs of elements of $C(T_n)$ are (odd) inversions of their images in $C(U_n)$ through $|\cdot|$. More precisely, for $\sigma \in C(T_n)$
$$\nsp(\sigma)=\inv(|\sigma|), \qquad\onsp(\sigma)=\oinv(|\sigma|).$$
This observation proves that indeed
\[\sum_{\sigma\in C(T_n)}{(-1)^{\ell_D (\sigma)}y^{\onsp (\sigma)}}=\sum_{\sigma\in C(U_n)}{(-1)^{\ell (\sigma)}y^{\oinv (\sigma)}},\]
which together with~\eqref{eq:fact} and~\eqref{eq:chbunim} yields the result. \end{proof}
Setting $y=x$ gives the known result for the signed distribution of the odd length over~$S^D_n$ (cf.~\cite[Theorem 4.1 and Corollary 4.2]{BC2}).
\begin{coro}
\label{wholeD}
Let $n\geq 2$. Then
\[\sum_{w\in W(\Phi(D_n))}{(-1)^{\ell_{\Delta(D_n)} (w)}x^{L_{\Delta(D_n)} (w)}}= \left(\sum_{w\in W(\Phi(A_{n-1})) }{(-1)^{\ell_{\Delta(D_n)} (w)}x^{L_{\Delta(D_n)} (w)}} \right)^2.\]
\end{coro}



\section{Signed generating functions for Weyl groups}\label{sec:main}
We summarize in this section the results obtained for the signed generating functions of the odd length on the classical Weyl groups, and we record some computations that we made for the exceptional types. The signed generating functions for the exceptional types were computed with the Python package \verb|PyCox| (see~\cite{Ge}) and SageMath (\cite{Sage}).
The main result of this section (Theorem~\ref{mainPhi}) follows 
immediately from the results in \S~\ref{sec:multib}, \S~\ref{sec:multid} and these computer calculations.
However, we believe that a more conceptual proof would be interesting,
so we provide such a proof for the infinite families of classical
Weyl groups. We feel that the results presented for this proof 
are interesting in their own right.

We begin with some preliminary lemmas about bijections that
preserve the parity of the height of the roots and the odd length of
certain elements.

\begin{lemma}\label{lem:a}
Let $\Phi$ be a crystallographic root system, $W$ its Weyl group, and $s,t,\tilde s,\tilde t\in S$ be such that $m(s,\tilde s)=m(s,t)=m(t,\tilde t)=3$, and $m(s,r)=2$ for all $r\in S\setminus\{s,t,\tilde s\}$,
$m(t,r)=2$ for all $r\in S\setminus\{s,t,\tilde t\}$. Then 
$$\hgt(\alpha)\equiv\hgt(sts(\alpha))\pmod 2$$ 
for all $\alpha \in \Phi$ and
$$ L_\Delta(wsts)=L_\Delta(w) $$
for all $w \in W$ such that $|D_R(w)\cap\{s,t\}|=1$.
\end{lemma}
\begin{proof}
Let $\alpha=\sum_{r\in S}c_r\alpha_r$. Then
\begin{align*}
sts\left(\sum_{r\in S}c_r\alpha_r\right)&= 
\sum_{r\in S \setminus \{s,t,\tilde s,\tilde t \}} c_r\alpha_r+ sts(c_s\alpha_s)+ sts(c_{\tilde s}\alpha_{\tilde s})+ sts(c_t\alpha_t)+ sts(c_{\tilde t}\alpha_{\tilde t})\\
&=\sum_{r\in S \setminus \{s,t,\tilde s,\tilde t \}} c_r\alpha_r +c_s(-\alpha_t)+c_{\tilde s}(\alpha_{\tilde s}+\alpha_s+\alpha_t)+c_t(-\alpha_s)\\ 
&\hspace*{15mm}+c_{\tilde t}(\alpha_{\tilde t}+\alpha_s+\alpha_t)\\
&=\sum_{r\in S \setminus \{s,t \}} c_r\alpha_r +\alpha_t(c_{\tilde t}+c_{\tilde s}-c_{s}) +\alpha_s(c_{\tilde t}+c_{\tilde s}-c_{t}).
\end{align*}
Therefore 
$$
\hgt(sts(\alpha))=\hgt(\alpha)-2c_s-2c_t+2c_{\tilde s}+2c_{\tilde t} ,
$$
 and the first equality follows.

Let $\alpha \in \Phi^+$. Then $sts(\alpha)<0$ if and only if $s_\alpha \in \{s,t,sts\}$, that is if and only if $\alpha \in \{\alpha_s,\alpha_t,\alpha_{sts}\}$. But $\alpha_{sts}=s(\alpha_t)$, and, since $m(s,t)=3$, we have
$\alpha_{sts}=\alpha_t+\alpha_s$. So $sts(\alpha)<0$ if and only if $\alpha\in \{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}$. Furthermore, the map
$\alpha \mapsto sts(\alpha) $ is a bijection of $\Phi^+ \setminus \{ \alpha_s,\alpha_t,\alpha_{sts} \}$ which, by what we just proved,
preserves the parity of the height. So we have
\begin{align*}
L_\Delta(w)&=\lvert\{\alpha\in\Phi^+\colon w(\alpha)<0,\,\hgt(\alpha)\equiv 1\pmod 2\}\rvert\\
&=\lvert\{\alpha\in\Phi^+\setminus\{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}\colon w(\alpha)<0,\,\hgt(\alpha)\equiv 1\pmod 2\}\rvert\\
&\hspace*{15mm}+\lvert\{\alpha\in\{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}\colon w(\alpha)<0,\,\hgt(\alpha)\equiv 1\pmod 2\}\rvert\\
&=\lvert\{\beta\in\Phi^+\setminus\{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}\colon wsts(\beta)<0,\,\hgt(\beta)\equiv 1\pmod 2\}\rvert\\
&\hspace*{15mm}+\lvert\{\alpha\in\{\alpha_s,\alpha_t\}\colon w(\alpha)<0 \}\rvert \\
&=\lvert\{\beta\in\Phi^+\setminus\{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}\colon wsts(\beta)<0,\,\hgt(\beta)\equiv 1\pmod 2\}\rvert\\
&\hspace*{15mm}+\lvert D_R(w)\cap\{s,t\}\rvert\\
&=\lvert\{\beta\in\Phi^+\setminus\{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}
\colon wsts(\beta)<0,\,\hgt(\beta)\equiv 1\pmod 2\}\rvert\\ 
&\hspace*{15mm}+\lvert D_R(wsts)\cap\{s,t\}\rvert\\
&=L_{\Delta}(wsts).\qedhere
\end{align*}
\end{proof}

The next lemma is the analogue of Lemma~\ref{lem:a} for the case of two 
commuting generators.
\begin{lemma}\label{lem:d}
Let $\Phi$ be a crystallographic root system, $W$ its Weyl group, and $s,t,\tilde s\in S$ be such that $m(s,\tilde s)=m(t,\tilde s)=3$, and $m(s,t)=m(s,r)=m(t,r)=2$ for all $r\in S\setminus\{s,t,\tilde s\}$. 
Then 
$$\hgt(\alpha)\equiv\hgt(st(\alpha))\pmod 2$$
for all $\alpha \in \Phi$ 
and $$L_\Delta(wst)=L_\Delta(w)$$
for all $w \in W$ such that $|D_R(w)\cap\{s,t\}|=1$.
\end{lemma}
\begin{proof}
Let $\alpha=\sum_{r\in S}c_r\alpha_r$. Then
\begin{align*}
st\left(\sum_{r\in S}c_r\alpha_r\right)&= 
\sum_{r \in S \setminus \{s,t,\tilde s\}} c_r\alpha_r+st(c_s\alpha_s)+
st(c_t\alpha_t)+st(c_{\tilde s}\alpha_{\tilde s})\\
&=\sum_{r \in S \setminus \{s,t,\tilde s\}} c_r\alpha_r -c_s\alpha_s -c_t\alpha_t+c_{\tilde s}(\alpha_t+\alpha_s+\alpha_{\tilde s}).
\end{align*}
Therefore 
$$
\hgt(st(\alpha))=\hgt(\alpha)-2c_s-2c_t+2c_{\tilde s} ,
$$ 
and the 
first equality follows.

Let $\alpha \in \Phi^+$. Then $st(\alpha)<0$ if and only if $s_\alpha \in \{s,t\}$, that is if and only if $\alpha \in \{\alpha_s,\alpha_t\}$. 
Furthermore, the map
$\alpha \mapsto st(\alpha) $ is a bijection of $\Phi^+ \setminus \{ \alpha_s,\alpha_t\}$ which, by what we have just proved,
preserves the parity of the height. So we have
\begin{align*}
L_\Delta(w)&=\lvert\{\alpha\in\Phi^+\colon w(\alpha)<0,\,\hgt(\alpha)\equiv 1\pmod 2\}\rvert\\
&=\lvert\{\alpha\in\Phi^+\setminus\{\alpha_s,\alpha_t\}\colon w(\alpha)<0,\,\hgt(\alpha)\equiv 1\pmod 2\}\rvert\\
&\hspace*{15mm}+\lvert\{\alpha\in\{\alpha_s,\alpha_t\}\colon w(\alpha)<0,\,\hgt(\alpha)\equiv 1\pmod 2\}\rvert\\
&=\lvert\{\beta\in\Phi^+\setminus\{\alpha_s,\alpha_t\}\colon wst(\beta)<0,\,\hgt(\beta)\equiv 1\pmod 2\}\rvert\\
&\hspace*{15mm}+\lvert\{\alpha\in\{\alpha_s,\alpha_t\}\colon w(\alpha)<0 \}\rvert \\
&=\lvert\{\beta\in\Phi^+\setminus\{\alpha_s,\alpha_t\}\colon wst(\beta)<0,\,\hgt(\beta)\equiv 1\pmod 2\}\rvert+\lvert D_R(w)\cap\{s,t\}\rvert\\
&=\lvert\{\beta\in\Phi^+\setminus\{\alpha_s,\alpha_t,\alpha_s+\alpha_t\}
\colon wsts(\beta)<0,\,\hgt(\beta)\equiv 1\pmod 2\}\rvert \\ 
&\hspace*{15mm}+\lvert D_R(wst)\cap\{s,t\}\rvert\\
&=L_{\Delta}(wsts).\qedhere
\end{align*} 

\end{proof}

The following lemmas are straightforward computations and their
verification is omitted.
\begin{lemma}
\label{lem:bc}
Let $\Phi$ be a crystallographic root system of type $B_n$ or $C_n$ and $W=W(\Phi)$ be its Weyl group. Then 
$$L_{\Delta}(w s_0)=
\begin{cases} L_{\Delta}(w),&\mbox{ if $\Phi$ is of type $B_n$} \\
L_{\Delta}(w)+1&\mbox{ if $\Phi$ is of type $C_n$,}
 \end{cases}
$$
for all $w\in W$ such that $s_0^B \not\in D_R(w)$.
\end{lemma}


\begin{lemma}\label{lem:add} 
Let $\Phi$ be a crystallographic root system of type type 
$C_n$ or $D_n$ and $W=W(\Phi)$ be its Weyl group. Then
\begin{equation}
\label{eq:dadd}
L_{\Delta}(u s_{n-1}\cdots s_1)=L_{\Delta}(u)+L_{\Delta}(s_{n-1}\cdots s_1)= L_{\Delta}(u)+\left\lfloor\frac{n}{2}\right\rfloor.
\end{equation}
for all $u \in W_I$ where $I := S \setminus \{ s_{n-1} \}$. 
\end{lemma}
We can now give a more conceptual proof of the main result of this
section.
\begin{theo}\label{mainPhi}
Let $\Phi$ be a crystallographic root system. Then
\begin{multline*}
\sum_{w \in W(\Phi)}{(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}}
\\
=\begin{cases}
\prod\limits_{i=2}^{n} \left(1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor}\right), &\quad\mbox{if $\Phi$ is of type $A_{n-1}$,}\\ 
\prod\limits_{i=1}^{n} (1-x^{i}), &\quad\mbox{if $\Phi$ is of type $B_n$,}\\ 
 \frac{1}{2} \prod\limits_{i=1}^{n} (1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor}) (1+(-1)^i x^{\left\lceil\frac{i}{2}\right\rceil}), &\quad\mbox{if $\Phi$ is of type $C_n$,}\\
 \prod\limits_{i=2}^{n}(1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor})^2, &\quad\mbox{if $\Phi$ is of type $D_n$}.
 \end{cases}
 \end{multline*}
Moreover,\begin{align*}
\sum_{w\in W(\Phi)}(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}&=(1-x^2)^2(1-x^4)(1-x^6), &\mbox{if $\Phi$ is of type $F_4$},\\
\sum_{w\in W(\Phi)}(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}&=(1-x^2)^2,&\mbox{if $\Phi$ is of type $G_2$}, \\
\sum_{w\in W(\Phi)}(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}&=\prod_{i=1}^4 (1-x^{2i}),&\mbox{if $\Phi$ is of type $E_6$}, \\
\sum_{w\in W(\Phi)}(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}&=\prod_{i=2}^{8}(1-x^i),&\mbox{if $\Phi$ is of type $E_7$} .
\end{align*}
\end{theo}
\begin{proof}
We proceed by induction using, in all four infinite cases, 
the good behaviour of the Coxeter 
length and of the odd length with respect to a special parabolic decomposition of the respective Weyl groups.

Let $S$ be the generating set of $W$ as in \S~\ref{sec:pre}, and $I 
\subseteq S$. Then
\begin{equation}
\label{eq:parab}
\sum_{w\in W} (-1)^{\ell_{\Delta} (w)}x^{L_{\Delta}(w)}=\sum_{u\in ^I W}\sum_{w\in W_I u} (-1)^{\ell_{\Delta} (w)}x^{L_{\Delta}(w)}.
\end{equation} 
Let $\Phi$ be of type $A_{n-1}$ and $I:= S \setminus \{ s_{n-1} \}$. 
It is not hard to see that the elements of $^I W$ are:
\begin{equation}\label{eq:repsA}
\{e,\,s_{n-1},s_{n-1}s_{n-2},\,\dots,\, s_{n-1}\cdots s_2, s_{n-1}\cdots s_2, s_{n-1}\cdots s_2s_1 \}.
\end{equation}
Fix $2\leq i \leq n-2$ and let $w\in W_I s_{n-1}\cdots s_{i+1}s_i$. That is, $w=us_{n-1}\cdots s_{i+1}s_i$ for a $u\in W_I$. Then
$$
\begin{aligned}
\ell_{\Delta}(w s_{i-1})&=\ell_{\Delta}(us_{n-1}\cdots s_{i+1}s_i s_{i-1})\\
&=\ell_{\Delta}(u)+\ell_{\Delta}(s_{n-1}\cdots s_i s_{i-1})\\
&=\ell_{\Delta}(u)+n-i+1>\ell_{\Delta}(w),
 \end{aligned}
$$
while 
$$
\begin{aligned}
\ell_{\Delta}(w s_{i})&=\ell_{\Delta}(us_{n-1}\cdots s_{i+1})\\
&=\ell_{\Delta}(u)+\ell_{\Delta}(s_{n-1}\cdots s_{i+1})\\
&=\ell_{\Delta}(u)+n-i-1<\ell_{\Delta}(w),
 \end{aligned}
$$
so 
$$
|D_R(w) \cap \{s_i,s_{i-1}\}|=1\text{ for all } 
w\in W_I s_{n-1}\cdots s_{i+1}s_i.
$$
Furthermore, the map $w\mapsto w s_{i-1} s_i s_{i-1}$ is a bijection of $W_I s_{n-1}\cdots s_{i+1}s_i$ onto itself. By Lemma~\ref{lem:a} we have that $L_\Delta(w s_{i-1} s_i s_{i-1})=L_\Delta(w)$ for all $w\in W_I s_{n-1}\cdots s_i$, implying that the sum over the elements in $ W_I s_{n-1}\cdots s_{i+1}s_i$ is zero. 
Therefore
\begin{multline*} 
\sum_{u\in ^I W}\sum_{w\in W_I u} (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}
\\
\begin{aligned} 
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\Mk +\Mk\Mk \sum_{w\in W_Is_{n-1}\cdots s_1}(-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_I w_0}(-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_I }(-1)^{\ell_{\Delta} (ww_0)}x^{L_\Delta(ww_0)}\\ 
&=\sum_{w\in W_I } (-1)^{\ell (w)}x^{L_\Delta(w)} %\\ &
+(-1)^{\ell_{\Delta}(w_0)}x^{L_\Delta(w_0)}\sum_{w\in W_I }(-1)^{-\ell_{\Delta} (w)}x^{-L_\Delta(w)}\\
&=\prod_{i=1}^{n-1} (1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor}) %\\ &
+(-1)^{n-1}x^{\left\lfloor\frac{n}{2}\right\rfloor}\prod_{i=2}^{n-1}(x^{\left\lfloor\frac{i}{2}\right\rfloor}+(-1)^{i-1})(-1)^{i-1}\\
&=\prod_{i=2}^n \left(1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor}\right),
\end{aligned}
\end{multline*}
where we have used our induction hypothesis. This proves the first equality.

Let now $\Phi$ be of type $B_n$ or $C_n$, and $I:= S \setminus \{ s_{n-1} \}$.
It is not hard to see that the elements of $^I W$ are: 
\begin{enumerate}
\item\label{proof_theo7.5_enum1_1} $e$,
\item\label{proof_theo7.5_enum1_2} $s_{n-1}s_{n-2}\cdots s_i$, for $2\leq i \leq n-1$,
\item\label{proof_theo7.5_enum1_3} $s_{n-1}s_{n-2}\cdots s_2 s_1 $,
\item\label{proof_theo7.5_enum1_4} $s_{n-1}s_{n-2}\cdots s_2 s_1 s_0$,
\item\label{proof_theo7.5_enum1_5} $s_{n-1}s_{n-2}\cdots s_2 s_1 s_0 \cdots s_i $, for $1\leq i \leq n-2$,
\item\label{proof_theo7.5_enum1_6} $s_{n-1}s_{n-2}\cdots s_2 s_1 s_0 s_1 s_2 \cdots s_{n-1}$.
\end{enumerate}
Using the same argument as for type $A$, it is easy to see that the signed generating function of the odd length is zero on cosets with representatives of the form~\eqref{proof_theo7.5_enum1_2}. Moreover, for $i\in[n-2]$, the map $w\mapsto w s_i s_{i+1} s_i$ is a bijection of each of the cosets of the form~\eqref{proof_theo7.5_enum1_5} onto themselves. Arguing as before one can see that the signed generating function is zero also on these cosets.
Finally, the map $w\mapsto w s_0$ is clearly a bijection between $W_I s_{n-1}\dots s_1$ and $W_I s_{n-1}\dots s_1 s_0$. This, together with Lemma~\ref{lem:bc} and our induction hypothesis, yields, in type $B_n$,
\begin{align*} 
\sum_{u\in ^I W}\sum_{w\in W_I u} (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_I }(-1)^{\ell_{\Delta} (ww_0)}x^{L_\Delta(ww_0)}\\
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\ 
&\hspace*{15mm}+(-1)^{\ell_{\Delta}(w_0)}x^{L_\Delta(w_0)}\sum_{w\in W_I }(-1)^{-\ell_{\Delta} (w)}x^{-L_\Delta(w)}\\
&=\prod_{i=1}^{n-1}(1-x^i)+(-1)^n x^{\binom{n+1}{2}}\prod_{i=1}^{n-1}(1-x^{-i})\\
&=\prod_{i=1}^{n}(1-x^i),
\end{align*}
proving the second equality.

When $\Phi$ is of type $C_n$, on the other hand, Lemmas~\ref {lem:bc} and~\ref{lem:add} and the bijection $w\mapsto ws_0$ between $W_I s_{n-1}s_{n-2}\dots s_1$ and $W_I s_{n-1}s_{n-2}\dots s_1 s_0$ yield 
\begin{multline*}
\sum_{u\in ^I W}\sum_{w\in W_I u} (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
\begin{aligned} 
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_I }(-1)^{\ell_{\Delta} (ww_0)}x^{L_\Delta(ww_0)}\\
&\hspace*{15mm}+(-1)^{n-1}x^{\left\lfloor\frac{n}{2}\right\rfloor} \sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
&\hspace*{15mm}+(-1)^{n}x^{\left\lceil\frac{x}{2}\right\rceil} \sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_{\Delta}(w)}\\
&=(1+(-1)^{n-1}x^{\left\lfloor\frac{n}{2}\right\rfloor})(1+(-1)^{n}x^{\left\lceil\frac{n}{2}\right\rceil})\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)},
\end{aligned}
\end{multline*}
which, together with our induction hypothesis, yields the third equality.

Let now $\Phi$ be of type $D_n$, and $I:= S \setminus \{ s_{n-1} \}$. The elements of $^I W$ are: 
\begin{enumerate}
\item\label{proof_theo7.5_enum2_1} $e$,
\item\label{proof_theo7.5_enum2_2} $s_{n-1}s_{n-2}\cdots s_i$, for $2\leq i \leq n-1$,
\item\label{proof_theo7.5_enum2_3} $s_{n-1}s_{n-2}\cdots s_2 s_1$,
\item\label{proof_theo7.5_enum2_4} $s_{n-1}s_{n-2}\cdots s_2 s_0$,
\item\label{proof_theo7.5_enum2_5} $s_{n-1}s_{n-2}\cdots s_2 s_0 s_1 s_2 \cdots s_i$, for $2\leq i \leq n-2$,
\item\label{proof_theo7.5_enum2_6} $s_{n-1}s_{n-2}\cdots s_2 s_0 s_1 s_2 \cdots s_{n-1}$.
\end{enumerate}
By the same arguments as before, the signed distribution over cosets of type~\eqref{proof_theo7.5_enum2_2} and~\eqref{proof_theo7.5_enum2_5} is zero.
Therefore the sum in~\eqref{eq:parab} becomes
\begin{multline*}
\sum_{u\in ^I W}\sum_{w\in W_I u} (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
\begin{aligned}
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_Is_{n-1}\cdots s_2 s_0 s_1 \cdots s_{n-1}}(-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
&\hspace*{15mm}+\sum_{w\in W_Is_{n-1}\cdots s_2 s_0}(-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_Is_{n-1}\cdots s_2 s_1}(-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\ \nonumber
&=\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}+\sum_{w\in W_I w_0}(-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\\nonumber
&\hspace*{15mm}+2\sum_{u\in W_I} (-1)^{\ell_{\Delta} (u s_{n-1}\cdots s_1)}x^{L_\Delta(u s_{n-1}\cdots s_1)},
\end{aligned}
\end{multline*}
where, for the last equality, we have used the bijection defined in Lemma~\ref{lem:d} with $s=s_0$, $t=s_1$. But 
Lemma~\ref{lem:add} and our induction hypothesis allow us to rewrite this
last equation as
\begin{align*}
\sum_{w\in W} (-1)^{\ell_{\Delta}(w)}x^{L_\Delta(w)}&=(1+(-1)^{n-1}x^{\left\lfloor\frac{n}{2}\right\rfloor})^2\sum_{w\in W_I } (-1)^{\ell_{\Delta} (w)}x^{L_\Delta(w)}\\
&= \prod\limits_{i=2}^{n}(1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor})^2
\end{align*}
which yields the fourth equality.
\end{proof}
 
 
We have been unable to carry out the computation in type $E_8$ with the computing resources at our disposal. When this paper was in the final 
stages of preparation John Stembridge showed a product formula also for type $E_8$.
\begin{theo}{\cite[Theorem 6.1]{Stepre}}\label{e8thm}
 \[\sum_{w\in E_8}(-1)^{\ell_{\Delta}(w)}x^{L_{\Delta}(w)}=(1-x^8)\prod\limits_{i=1}^{8}(1-x^{2i})\]
\end{theo}
 He also gave a unified description of these factorizations and a conceptual proof of all of them~\cite{Stepre}.

\begin{rema} We record here the functions used to compute the generating functions with \verb|PyCox|.

\verb|def f(n):|

\verb| W = coxeter("W",n)|
 
\verb| y = var('y')|
 
\verb| A = allcoxelms(W)|
 
\verb| Or = [i for i in range(W.N) if mod(sum((W.roots[i])),2)==1]|
 
\verb| B = [W.coxelmtoperm(A[i][j]) for i in range(len(A))| 

\verb|                                         for j in range(len(A[i]))]|
 
\verb| return sum((-1)^(W.permlength(v)) * x^(oddr(v,W.N,Or)) for v in B)|

\verb|def oddr(v,n,Or): |

\verb| return sum(1 for j in Or if v[j]>n-1)|
\end{rema}

\begin{rema}
 In light of Remark~\ref{rmk:matrices} and of the observations in the introduction, it would be interesting to have enumerative applications of geometric flavour for the formulas we proved.
 \end{rema}

\section{Odd reflections}\label{sec:oddrefl}
In this section we introduce, for any
finite Coxeter system $(W,S)$, a statistic defined in terms of \emph{odd reflections}. We also prove product formulas for its sign-twisted generating function over reducible finite Coxeter systems, for the dihedral groups, and for
all Weyl groups. We start with its definition.
\begin{defi}\label{lrdef}
 Let $(W,S)$ be a Coxeter system and let $w\in W$. We let
\[L_T(w):=|\{t\in T\,:\,\ell(w t)<\ell(w)\,\mbox{ and }\,\ell(t)\equiv 1\pmod 4\}|.\]
\end{defi}
 We first show that it is enough to compute the signed generating function of $L_T$ over
irreducible finite Coxeter systems.
\begin{prop}
Let $(W,S)$ be a finite Coxeter system, and $A,B \subseteq S$ be such that $S=A \cup B$, 
$A \cap B=\emptyset$, and $m(a,b)=2$ for all $a \in A$ and $b \in B$. Then $L_T(uv)=L_T(u)+L_T(v)$ for all
such $u\in W_A$ and $v\in W_B$. In particular
\[
\sum_{w \in W}(-1)^{\ell(w)}x^{L_{T}(w)}=
\sum_{u \in W_A}(-1)^{\ell(u)}x^{L_{T}(u)} 
\sum_{v \in W_B}(-1)^{\ell(v)}x^{L_{T}(v)}.
\]
\end{prop}
\begin{proof}
Under these hypotheses it is well known that the map $(u,v) \mapsto uv$ is a bijection between 
$W_A \times W_B$ and $W$, and that $T=T_A \cup T_B$ where
$T_A$ and $T_B$ are the reflections of the parabolic subgroups $W_A$ and $W_B$, respectively.
Furthermore $\{ t \in T : \ell(uvt)<\ell(uv) \}= \{ t \in T_A : \ell(ut)<\ell(u) \} \cup \{ t \in T_B : \ell(vt)<\ell(v) \}$
for all $u \in W_A$ and $v \in W_B$. So $\ell(uv)=\ell(u)+\ell(v)$ and $L_T(uv)=L_T(u)+L_T(v)$ for all
such $u$ and $v$ and the result follows.
\end{proof}

The following result shows that the polynomial $\sum_{w \in W}(-1)^{\ell(w)}x^{L_{T}(w)}$
is always either symmetric or antisymmetric. 
\begin{prop}
Let $(W,S)$ be a finite Coxeter system, and $w_0$ be its longest element. Then
$L_T(w w_0)=L_T(w_0 w)=L_T(w_0)-L_T(w)$ for all $w \in W$. In particular
\[
\sum_{w \in W}(-1)^{\ell(w)}x^{L_{T}(w)}=(-1)^{\ell(w_0)} x^{L_T(w_0)}
\sum_{w \in W}(-1)^{\ell(w)} \left(\frac{1}{x}\right)^{L_{T}(w)}.
\]
\end{prop}
\begin{proof}
It is well known (see, e.g.~\cite[Proposition 2.3.4]{BB}) that multiplication on the right (or left) by $w_0$ is an antiautomorphism
for Bruhat order. Hence, $\ell(w w_0 t)<\ell(w w_0)$ if and only if $\ell(w t)>\ell(w)$ for all $t \in T$, so
$L_T(w w_0)=L_T(w_0)-L_T(w)$. The result follows.
\end{proof}

While $L_T$ is not an extension of $L_{\Delta}$ to all Coxeter groups, the 
two functions do coincide on simply laced Weyl groups. 
\begin{prop}
\label{coincide}
Let $\Phi$ be an irreducible root system of simply laced type, $\Delta$ be 
a simple system for $\Phi$, and $(W,S)$ be the corresponding Weyl group and 
generating set. Then
\[
\ell_{S}(s_{\alpha})= 2 \hgt_{\Delta}(\alpha)-1
\]
for all $\alpha \in \Phi^+$. In particular, $L_T(w)=L_{\Delta}(w)$ for all
$w \in W$.
\end{prop}
\begin{proof}
It is easy to verify the result for the root systems of types $A$ and $D$.
Indeed, in both types a simple computation using Proposition~\ref{prelim} shows that
$\ell_S((i,j))=2(j-i)-1=2 \hgt_\Delta(e_j-e_i)-1$
and $\ell_S((i,j)(-i,-j))=2(j-i)-1=2 \hgt_\Delta(e_j - e_i)-1$
for all $1\leq i<j\leq n$. Furthermore, 
$ \ell_S((i,-j)(j,-i))=2(i+j-2)-1=2 \hgt_\Delta(e_i+e_j)-1$
if $\Phi$ is of type $D$, for all $1\leq i<j\leq n$.
One can verify by computer that the result also holds for the exceptional types.
\end{proof}

As we mentioned in \S~\ref{sec:multib}, one of the statistics defined in~\eqref{def:uni} has a type-independent description. We prove here that it coincides with $L_T$.
\begin{prop}
\label{LTB}
Let $\sigma \in S^B_n$. Then
\[L_T(\sigma)=\oneg(\sigma)+\oinv(\sigma)+\ensp(\sigma).
\]
\end{prop}
\begin{proof}
It is well known (see, e.g.~\cite[\S 8.1]{BB}) that the reflections of $S^B _n$ are given by
\begin{equation}
\label{refB}
T=\{(i,j)(-i,-j)\,:\,1\leq i<|j|\leq n\}\cup\{(i,-i)\,:\,i\in[n]\}.
\end{equation}
Furthermore, an easy computation using the description given in Proposition~\ref{prelim} shows that
\begin{align*}
\ell_B((i,-i))&=2i-1\\
\ell_B((i,j)(-i,-j))&=2(j-i)-1,\,\,\mbox{for }\,1\leq i<j\leq n\\
\ell_B((i,-j)(-i,j))&=2(i+j)-3,\,\,\mbox{for }\,1\leq i<j\leq n ,
\end{align*}
so the result follows.
\end{proof}

The next result shows that the signed generating function of $L_T$ always 
factors as product of binomials for finite Weyl groups and for the dihedral groups.

\begin{theo}
Let $(W,S)$ be an irreducible finite Coxeter system. Then
\begin{equation*}\sum_{w \in W}{(-1)^{\ell(w)}x^{L_{T}(w)}}=\begin{cases}
\prod\limits_{i=2}^{n} \left(1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor}\right), &\quad\mbox{if $W$ is of type $A_{n-1}$,}\\ 
(1-x^{\left\lceil \frac{n}{2}\right\rceil})\prod\limits_{i=i}^{n-1} (1-x^i), &\quad\mbox{if $W$ is of type $B_n$,}\\ 
 \prod\limits_{i=2}^{n}(1+(-1)^{i-1}x^{\left\lfloor\frac{i}{2}\right\rfloor})^2, &\quad\mbox{if $W$ is of type $D_n$}.
 \end{cases}\end{equation*}
Moreover,
\begin{equation*}\sum_{w \in W}{(-1)^{\ell(w)}x^{L_{T}(w)}}=\begin{cases}
(1-x^2)^2(1-x^4)^2, &\quad\mbox{if $W$ is of type $F_4$,}\\ 
\prod\limits_{i=1}^{4}(1-x^{2i}), &\quad\mbox{if $W$ is of type $E_6$,} \\
\prod\limits_{i=2}^{8}(1-x^i), &\quad\mbox{if $W$ is of type $E_7$,}\\
(1-x^8)\prod\limits_{i=1}^{8}(1-x^{2i}), &\quad\mbox{if $W$ is of type $E_8$,}
 \end{cases}\end{equation*}
 and
\begin{equation*}\sum_{w \in W}{(-1)^{\ell(w)}x^{L_{T}(w)}}=\begin{cases}
1-x^{\lceil \frac{m}{2} \rceil}, &\quad\mbox{if $m \equiv 1 \pmod{2}$,}\\ 
(1-x^{\lceil \frac{m}{4} \rceil})^2, &\quad\mbox{if $m \equiv 0 \pmod{2}$},
 \end{cases}\end{equation*}
if $W$ is of type $I_2(m)$.
\end{theo}

\begin{proof}
In the simply laced types the result follows immediately from 
Theorem~\ref{mainPhi}, Theorem~\ref{e8thm} and Proposition~\ref{coincide}. The result for type $B$ follows from Proposition~\ref{LTB} and Corollary~\ref{cor:uni}.

Let now $(W,S)$ be a Coxeter system of type $I_2(m)$.
Let $\{ a,b \} := S$ and let, for brevity, $v_{k}(b,a):=\underbrace{baba \ldots}_{k}$ for all $k \in \N$.

Let $m \equiv 0 \pmod{2}$, $m=2n$. Then
\begin{equation*}
\ell(v_{2r+1}(b,a))=
\begin{cases}
2r+1, &\quad\mbox{if $2r+1 \leq 2n$,}\\ 
2n-(2r+1-2n), &\quad\mbox{if $2n \leq 2r \leq 4n-1$},
 \end{cases}
 \end{equation*}
so
\begin{equation*}
\ell(v_{2r+1}(b,a)) \equiv 
\begin{cases}
2r+1 \pmod{4}, &\quad\mbox{if $2r+1 \leq 2n$,}\\ 
-(2r+1) \pmod{4}, &\quad\mbox{if $2n+1 \leq 2r+1 \leq 4n$},
 \end{cases}
 \end{equation*}
for all $0 \leq r \leq 2n-1$. Hence $L_T(v_{2k+1}(a,b))=k+1$, if $2k+1 \leq n$, while
$L_T(v_{2k+1}(a,b))=\lceil \frac{n}{2} \rceil + \lceil \frac{2k+1-n}{2} \rceil =k+1$ if $2n-1 \geq 2k \geq n$
and $n \equiv 1 \pmod{2}$, and $L_T(v_{2k+1}(a,b))=\lceil \frac{n}{2} \rceil + \lfloor \frac{2k+1-n}{2} \rfloor =k$ if $2n-1 \geq 2k \geq n$ and $n \equiv 0 \pmod{2}$. So
\begin{equation*}L_T(v_{2k+1}(a,b))= \begin{cases}
k+1, &\quad\mbox{if $2k+1 \leq n$,}\\ 
k+ c, &\quad\mbox{if $n \leq 2k \leq 2n-1$}. \end{cases}
\end{equation*}


where $c:=1$ if $n \equiv 1 \pmod{2}$, and $c:=0$ otherwise. Similarly,
\begin{equation*}
L_T(v_{2k}(a,b))= 
\begin{cases}
k, &\quad\mbox{if $2k \leq n$,}\\ 
k+ c, &\quad\mbox{if $n < 2k \leq 2n$}.
 \end{cases}
 \end{equation*}
Therefore,
\begin{multline*}
\sum_{w \in W} (-1)^{\ell(w)}x^{L_{T}(w)}\\
\begin{aligned}
& = 1+
\sum_{k=1}^{2n-1} \left((-1)^{\ell(v_{k}(a,b))} x^{L_T(v_{k}(a,b))} + (-1)^{\ell(v_{k}(b,a))} x^{L_T(v_{k}(b,a))} \right) \\
&\hspace*{25mm}+ (-1)^{\ell(v_{2n}(a,b))} x^{L_T(v_{2n}(a,b))} \\
&= 1+ 2 \sum_{k=1}^{2n-1} (-1)^{k} x^{L_T(v_{k}(a,b))} + x^{n+c} \\
& = 1+ 2 \left(\sum_{k=1}^{n-1} x^{L_T(v_{2k}(a,b))}- \sum_{k=0}^{n-1} x^{L_T(v_{2k+1}(a,b))} \right) + x^{n+c} \\
 & = 1+ 2 \left( \sum_{k=1}^{\lfloor \frac{n}{2} \rfloor} x^{k} + \sum_{k=\lfloor \frac{n}{2} \rfloor+1}^{n-1} x^{k+c} - \sum_{k=0}^{\lfloor \frac{n-1}{2} \rfloor} x^{k+1} - \sum_{k=\lfloor \frac{n-1}{2} \rfloor+1}^{n-1} x^{k+c} \right) + x^{n+c} \\
& = 1+2 ( -c \, x^{\frac{n+1}{2}} + (c-1) x^{\frac{n}{2}}) + x^{n+c} \\
& = (1- x^{\lceil \frac{n}{2} \rceil} )^2.
\end{aligned}
\end{multline*}

Let now $m \equiv 1 \pmod{2}$, $m=2n+1$, $n \in \PP$. Then, similarly
\begin{equation*}
\ell(v_{2r+1}(b,a))=
\begin{cases}
2r+1, &\quad\mbox{if $2r+1 \leq 2n+1$,}\\ 
4n+2-(2r+1), &\quad\mbox{if $2n+2 \leq 2r+1 \leq 4n+2$},
 \end{cases}
 \end{equation*}
so $ \ell(v_{2r+1}(b,a)) \equiv 2r+1 \pmod{4}$ for all $0 \leq r \leq 2n$.
Hence
$L_T(v_{2k+1}(b,a))=k+1$ for $ 1 \leq 2k+1 \leq 2n+1$, and
$L_T(v_{2k}(b,a))=k$ for $0 \leq 2k \leq 2n$. Therefore,
\begin{align*}
&\sum_{w \in W} (-1)^{\ell(w)}x^{L_{T}(w)}\\
&\hspace*{15mm} = 1+
\sum_{k=1}^{2n} \left((-1)^{\ell(v_{k}(a,b))} x^{L_T(v_{k}(a,b))} + (-1)^{\ell(v_{k}(b,a))} x^{L_T(v_{k}(b,a))} \right) \\
&\hspace*{40mm}+ (-1)^{\ell(v_{2n+1}(a,b))} x^{L_T(v_{2n+1}(a,b))} \\
&\hspace*{15mm} = 1+2 \sum_{k=1}^{2n} (-1)^k x^{\lceil \frac{k}{2} \rceil} - x^{n+1} \\
&\hspace*{15mm} = 1- x^{n+1}.\qedhere
\end{align*}
\end{proof}

For finite Coxeter
systems in general, there seems to be no analogous factorization phenomenon. For example, one can compute that if $(W,S)$ is a Coxeter system of type $H_3$ then
$\sum_{w \in W} (-1)^{\ell(w)}x^{L_{T}(w)}=(1+4x+6x^2+9x^3+6x^4+4x^5+x^6)(1-x)^3$.


 
\longthanks{We would like to thank the referees for very detailed, insightful, and helpful comments. Some of the computations for this research 
were carried out using Maple packages for handling Coxeter systems
and root systems developed by Pietro Mongelli and John Stembridge. 
Angela Carnevale was
partly supported by the German-Israeli Foundation for Scientific Research and Development (GIF) through grant no.\ 1246. Francesco Brenti acknowledges 
support from the MIUR Excellence Department Project %awarded to the Department of Mathematics, University of Rome Tor Vergata, 
CUP E83C18000100006.}


%\nocite{*}
\bibliographystyle{amsplain-ac}
\bibliography{ALCO_Brenti_224}
\end{document}
