Metric inequalities for polygons

Abstract: Let $A_1,A_2,...,A_n$ be the vertices of a polygon with unit perimeter, that is $\sum_{i=1}^n |A_i A_{i+1}|=1$. We derive various tight estimates on the minimum and maximum values of the sum of pairwise distances, and respectively sum of pairwise squared distances among its vertices. In most cases such estimates on these sums in the literature were known only for convex polygons.In the second part, we turn to a problem of Braß regarding the maximum perimeter of a simple $n$-gon ($n$ odd) contained in a disk of unit radius. The problem was solved by Audet et al. \cite{AHM09b}, who gave an exact formula. Here we present an alternative simpler proof of this formula. We then examine what happens if the simplicity condition is dropped, and obtain an exact formula for the maximum perimeter in this case as well.

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

Let $A_1,A_2,\ldots,A_n$ be the vertices of a possibly self-crossing
polygon (i.e., closed polygonal chain) with unit perimeter in the
Euclidean plane. Here the perimeter is
 ${\rm per}(A_1 A_2 \ldots A_n)=$ \linebreak
$\sum_{i=1}^n |A_i A_{i+1}|$, where indices are taken modulo $n$
(i.e., $A_{n+1}=A_1$).
Let $s(n)$ be the infimum of the sum of pairwise distances among the $n$ vertices,
and $s_c(n)$ be the same infimum for the case of convex polygons:

\begin{align} \label{E8}
s(n) &= \inf_{{\rm per}(A_1 A_2 \ldots A_n)=1} \ \sum_{i<j} |A_i A_j|. \\
s_c(n) &= \inf_
{\substack
{{\rm per}(A_1 A_2 \ldots A_n)=1\\
A_1 A_2 \ldots A_n {\rm \ convex}}}
\ \sum_{i<j} |A_i A_j|.
\end{align}

Larcher and Pillichshammer~\cite{LP08} proved that $s_c(n)$ grows
linearly in $n$, and more precisely, that $s_c(n) \geq \frac{n-1}{2}$.
Alternative proofs were recently given by Aggarwal~\cite{Ag10}
and L\"{u}k\H{o}~\cite{Lu10}.
We have nearly equality, if $A_1$ is
close to $(0,0)$ and the other $n-1$ vertices $A_i$ $(i>1)$ are all close
to $(\frac12,0)$. Hence $s_c(n) = \frac{n-1}{2}$, as
previously conjectured by Audet et al.~\cite{AHM07}.
Here we extend this result for arbitrary
polygons and show that $s(n)$ has a similar behavior.

\begin{theorem} \label{T1}
For every $n \geq 3$,
$ s(n) \geq \frac{n}{4}$.
For $n$ even equality holds; for $n$ odd, $s(n) \leq \frac{n+1}{4}$.
\end{theorem}

Let now $S(n)$ be the supremum of the sum of pairwise distances among the
vertices, and $S_c(n)$ be the same supremum for the case of convex
polygons:

\begin{align} \label{E9}
S(n) &= \sup_{{\rm per}(A_1 A_2 \ldots A_n)=1} \ \sum_{i<j} |A_i A_j|. \\
S_c(n) &= \sup_
{\substack
{{\rm per}(A_1 A_2 \ldots A_n)=1\\
A_1 A_2 \ldots A_n {\rm \ convex}}}
\ \sum_{i<j} |A_i A_j|.
\end{align}

Larcher and Pillichshammer~\cite{LP06} considered the following
generalization of the sum of pairwise distances, for which they proved:

\begin{thma} {\rm \cite[Theorem~1]{LP06}}
Let $f \colon [0,1/2] \to \RR_0^+$ be a function such that
$f(x)/x \leq 2 f(1/2)$. Then for any $n \geq 3$ and for any convex polygon
with $n$ vertices and unit perimeter we have
$$ \sum_{i<j} f(|A_i A_j|) \leq f\left(\frac{1}{2}\right)
\left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil. $$
This bound is best possible.
\end{thma}

By taking $f(x)=x$, it follows from Theorem~A
(as proved in~\cite{LP06})
that $S_c(n)$ is quadratic in $n$, and more precisely, that $S_c(n) \leq
\frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor \left \lceil \frac{n}{2}
\right \rceil $, as previously conjectured by Audet et
al.~\cite{AHM07}. An alternative proof was given recently by Aggarwal~\cite{Ag10}
based on classical results of Altman~\cite{Al72} for convex polygons.
We have nearly equality if
$A_1,\ldots,A_{\lfloor n/2 \rfloor}$ are close to $(0,0)$
and $A_{\lfloor n/2 \rfloor +1},\ldots,A_n$ are close to
$(\frac{1}{2},0)$; see~\cite{AHM07}.  Hence the above upper bound
is best possible, thus $S_c(n) =
\frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor \left \lceil \frac{n}{2}
\right \rceil $. Here we show that convexity can be dropped and the
same inequality holds for arbitrary (not necessarily convex, and
possibly self-crossing) polygons: that is,
$S(n) \leq  \frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor \left \lceil
\frac{n}{2} \right \rceil $.
This result has been also obtained recently by L\"{u}k\H{o}~\cite{Lu10}.
(Since both his proof as well as ours rely on the triangle inequality,
both work in any metric space.)

\begin{theorem} \label{T2}
For every $n \geq 3$,
$$ S(n) =
\frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor \left \lceil
\frac{n}{2} \right \rceil. $$
\end{theorem}

Next we consider the sum of squared distances.
Let now $t(n)$ be the infimum of the sum of pairwise squared distances among the
vertices, and $t_c(n)$ be the same infimum for the case of convex polygons:

\begin{align} \label{E10}
t(n) &= \inf_{{\rm per}(A_1 A_2 \ldots A_n)=1} \ \sum_{i<j} |A_i A_j|^2. \\
t_c(n) &= \inf_
{\substack
{{\rm per}(A_1,A_2,\ldots,A_n)=1\\
A_1 A_2 \ldots A_n {\rm \ convex}}}
\ \sum_{i<j} |A_i A_j|^2.
\end{align}

For convex polygons, it is known that $t_c(n)$ is linear in $n$.
The current best lower bound, $t_c(n) \geq \frac{2n}{3\pi^2}$, is due
to Januszewski~\cite{J11}. From the other direction, placing $A_1$ near $(0,0)$,
$A_2$ near $(\frac12,0)$ and the other $n-2$ points near the midpoint of $A_1
A_2$, all in convex position, shows that $t_c(n) \leq \frac{n}{8}$~\cite{N09}.
(An earlier version of this/current paper {\tt arXiv:0912.3929v2}
reports a lower bound $ t_c(n) \geq \frac{5n-1}{76}$.
However, its proof had an error.)

For arbitrary polygons, it is easy to make a construction for which this sum
converges to $1/4$ as $n$ tends to infinity. For even $n$, place the
odd index vertices at $(0,0)$,
and the even index vertices at $(\frac{1}{n},0)$. Then
$ Z = \frac{n^2}{4} \cdot \frac{1}{n^2} = \frac{1}{4}$.
For odd $n$, place the odd index vertices at
$(0,0)$, and the even index vertices at $(\frac{1}{n-1},0)$. Then
$ Z = \frac{n^2-1}{4} \cdot \frac{1}{(n-1)^2} = \frac{1}{4} \cdot
\frac{n+1}{n-1} \to \frac {1}{4} $.
Here we obtain a lower bound that is off by a factor of $2$.

\begin{theorem} \label{T3}
For every $n \geq 3$,
$$\frac18 \leq t(n) \leq \frac14. $$
\end{theorem}

Finally, let $T(n)$ be the supremum of the sum of pairwise squared
distances  among the vertices, and $T_c(n)$ be the same supremum for
the case of convex polygons:

\begin{align} \label{E11}
T(n) &= \sup_{{\rm per}(A_1 A_2 \ldots A_n)=1} \ \sum_{i<j} |A_i A_j|^2. \\
T_c(n) &= \sup_
{\substack
{{\rm per}(A_1 A_2 \ldots A_n)=1\\
A_1 A_2 \ldots A_n {\rm \ convex}}}
\ \sum_{i<j} |A_i A_j|^2.
\end{align}

By taking $f(x)=x^2$, it follows from Theorem~A (see~\cite{LP06})
that $T_c(n)$ is quadratic in $n$, and more precisely, that
$T_c(n) \leq \frac{1}{4} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil $. An easy construction~\cite{LP08}
(also mentioned earlier in connection to $S_c(n)$) with
vertices $A_1,\ldots, A_{\lfloor n/2 \rfloor}$ near $(0,0)$
and $A_{\lfloor n/2 \rfloor +1},\ldots, A_n$ near $(1/2,0)$,
all in convex position, shows that the above inequality is tight:
$T_c(n) = \frac{1}{4} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil $.
Again, here we show that convexity can be dropped and the same
inequality holds for arbitrary (not necessarily convex, and possibly
self-crossing) polygons. That is,
$T(n) \leq \frac{1}{4} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil $, and we obtain:

\begin{theorem} \label{T4}
For every $n \geq 3$,
$$ T(n) = \frac{1}{4} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil . $$
\end{theorem}

In the second part of the paper we turn to the following
problem~\cite[p. 437]{BMP05} posed by Bra\ss: For $n \geq 5$ odd,
what is the maximum perimeter of a simple $n$-gon ($n$ odd) contained
in a disk of unit radius? The problem can be traced back to the
collection of open problems in~\cite{B03}~(Problem 4, p.~449).
A solution was recently found by Audet et al.~\cite{AHM09b}
(Theorem~\ref{T5} below), and another more general
solution was offered by Langi~\cite{La10}.
Here we give yet another alternative solution.
As noted in~\cite{B03,BMP05}, for even $n$, one can
come arbitrarily close to the trivial upper bound $2n$ by a simple
polygon whose sides go back and forth near a diameter of the disk, but
for odd $n$ this construction does not work. Let $\Omega$ be a disk of
unit radius, and let
\begin{equation} \label{E12}
F(n) = \sup_
{\substack
{\{A_1,A_2,\ldots,A_n\} \subset \Omega \\
A_1 A_2 \ldots A_n {\rm \ simple}}}
\ {\rm per}(A_1 A_2 \ldots A_n).
\end{equation}
So trivially, $F(n)=2n$, for even $n$.
Fortunately, an exact formula for $F(n)$ can be also determined for
odd $n$:

\begin{theorem} {\rm \cite{AHM09b}.} \label{T5}
For every $n \geq 3$ odd,
\begin{equation} \label{E16}
F(n) =
\frac{\sqrt{8(n-2)^2 -2 +2 \sqrt{1+8(n-2)^2}} \cdot \left(\sqrt{1+8(n-2)^2}+3\right)}
{4(n-2)}.
\end{equation}
\end{theorem}

A natural question is: What happens if the simplicity condition is dropped?
As before (for simple polygons) for even $n$, one can
come arbitrarily close to the trivial upper bound $2n$; however, for
odd $n$, the construction described previously (with the sides which go back and
forth near a diameter of the disk) still does not work. Let
\begin{equation} \label{E18}
G(n) = \sup_
{\{A_1,A_2,\ldots,A_n\} \subset \Omega}
\ {\rm per}(A_1 A_2 \ldots A_n).
\end{equation}

Clearly, $G(n) \geq F(n)$ holds, so $G(n)=2n$, for even $n$.
For odd $n$, we determine an exact formula for $G(n)$ as well:
\begin{theorem} \label{T6}
For every $n \geq 3$ odd,
\begin{equation} \label{E19}
G(n) = 2n \cos \frac{\pi}{2n}.
\end{equation}
\end{theorem}

\paragraph{Notation.} Throughout the paper, let $P$ be a polygon with
$n$ vertices and unit perimeter, and $V(P)=\{A_1,A_2,\ldots,A_n\}$
denote its vertex set.
Let $\ell(s)$ denote the line containing a segment $s$.
Let $x(p)$ and $y(p)$ stand for the $x$- and $y$-coordinates of a
point $p$. For brevity we denote the set $\{1,2,\ldots,n\}$ by $[n]$.

\paragraph{Related problems and results.}
Various extremal problems on the sum of distances and respectively
squares of distances among $n$ points in $\RR^d$ have been
raised over time. For instance, more than 30 years ago,
Witsenhausen~\cite{W74} has conjectured that the maximum sum of
squared distances among $n$ points in $\RR^d$, whose pairwise
distances are each at most $1$ is maximized when the points are
distributed as evenly as possible among the $d+1$ vertices of a
regular simplex of edge-length $1$. He also proved
that this maximum is at most $\frac{d}{2(d+1)} n^2$, which
verified the conjecture at least when $n$ is a multiple of $d+1$.
The conjecture has been proved for the plane by
Pillichshammer~\cite{Pi00}, and subsequently in higher dimensions
by Benassi and Malagoli~\cite{BM08}.
See also~\cite{Ag10,AHM07,AHM09a,AHM09b,FT56,FT59,J11,N09,N11,Pi00,Pi01} for
related questions on the sum of pairwise distances.
In the spirit of Theorems~\ref{T5} and~\ref{T6},
a mathematical puzzle from Winkler's collection~\cite[p.~114]{W07} asks for
the minimum area of a simple polygon with an odd number of sides, each
of unit length.

\section{Sum of distances: proofs of Theorems~\ref{T1} and~\ref{T2}}
\label{sec:T12}

\paragraph{Proof of Theorem~\ref{T1}.}
Let $p \in V(P)$ be an arbitrary vertex of $P$, and let
$Z(p)= \sum_{q \in V(P)} |pq|$ be the sum of distances from $p$ to the
other vertices. The sum of pairwise distances $Z$ satisfies
$ 2Z= \sum_{p \in V(P)} Z(p)$.
By the triangle inequality, for any $i \in [n]$, we
have
$$ |p A_i| + |p A_{i+1}| \geq |A_i A_{i+1}|. $$
By summing over $i \in [n]$, we get
$$ 2Z(p) \geq \sum_{i=1}^n |A_i A_{i+1}|=1. $$
By summing over $p \in V(P)$, we get
$4 Z \geq n$, or $Z \geq n/4$, as required.

To see that this inequality is almost tight, construct a non-convex
polygon as follows: For even $n$, place the odd index vertices at
$(0,0)$, and the even index vertices at $(\frac{1}{n},0)$. Then
$ Z = \frac{n^2}{4} \cdot \frac{1}{n} = \frac{n}{4}$.
For odd $n$, place the odd index vertices at
$(0,0)$, and the even index vertices at $(\frac{1}{n-1},0)$. Then
$ Z = \frac{n^2-1}{4} \cdot \frac{1}{n-1} = \frac{n+1}{4}$.
\qed

\medskip
The following simple fact is needed in the proofs of Theorems~\ref{T2}
and~\ref{T4}.

\begin{lemma} \label{L3}
Given an arbitrary polygon $P= A_1 A_2 \ldots A_n$, let
$Q= A_{i_1} A_{i_2} \ldots A_{i_k}$, where $i_1<i_2<\ldots<i_k$, $k
\geq 3$, be a sub-polygon of it. Then ${\rm per}(Q) \leq {\rm per}(P)$.
\end{lemma}
\begin{proof}
By the triangle inequality, for any $j \in [k]$, we have
$$ |A_{i_j} A_{i_{j+1}}| \leq \sum_{r = i_j}^{i_{j+1}-1} |A_r A_{r+1}|. $$
By adding up the above inequality over all $j \in [k]$, yields
${\rm per}(Q) \leq {\rm per}(P)$, as required.
\end{proof}

\paragraph{Proof of Theorem~\ref{T2}.}
(Sketch.) The proof is identical to that given by Larcher and
Pillichshammer~\cite{LP08} for the convex case, and we refer the
reader to their paper for details.
A set of quadrilaterals $\{Q_{ij}\}$ and a set of triangles $\{R_i\}$
are defined~\cite{LP08} so that the edges of the quadrilaterals $Q_{ij}$ and the
triangles $R_i$ form a partition of the edge set $\{A_i A_j \ | \ i<j\}$
(each edge appears exactly once).
By Lemma~\ref{L3}, one has ${\rm per}(Q_{ij}) \leq 1$, and  ${\rm per}(R_i) \leq 1$,
for the quadrilaterals $Q_{ij}$ and for the triangles $R_i$ defined in
their proof. By adding up the perimeters of these polygons, it follows
that the overall sum is bounded as
$S(n) \leq
\frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil$.

From the other direction, we clearly have
$S(n) \geq S_c(n) =
\frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor \left \lceil \frac{n}{2}
\right \rceil $, and the equality
$S(n) = \frac{1}{2} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil $ is proved.
\qed

\section{Sum of squared distances: proofs of
  Theorems~\ref{T3} and~\ref{T4}} \label{sec:T345}

We will need the following simple inequality:
\begin{lemma} \label{L1}
Let $AB$ be a segment of length $a$, and $O$ be any point in the
plane. Then
$$ OA^2+OB^2 \geq \frac{a^2}{2} + 2 y^2, $$
where $y$ is the distance from $O$ to the line $\ell(AB)$ determined by $A$ and
$B$. In particular, $ OA^2+OB^2 \geq a^2/2$.
\end{lemma}
\begin{proof}
Let $M$ be the projection of $O$ onto $\ell(AB)$, and write
$a_1=MA$, and $a_2=MB$.
Clearly,
$$ OA^2+OB^2 = a_1^2 +y^2+a_2^2 +y^2 \geq \frac{a^2}{2} + 2 y^2, $$
as desired.
\end{proof}

\paragraph{Proof of Theorem~\ref{T3}.}
The proof follows the same line of argument as that of
Theorem~\ref{T1}. Let $p \in V(P)$ be an arbitrary vertex of $P$, and let
$Z(p)= \sum_{q \in V(P)} |pq|^2$ be the sum of squared distances from $p$ to the
other vertices. The sum of squared pairwise distances $Z$ satisfies
$ 2Z= \sum_{p \in V(P)} Z(p)$.
By Lemma~\ref{L1}, for any $i \in [n]$, we
have
$$ |p A_i|^2 + |p A_{i+1}|^2 \geq \frac{|A_i A_{i+1}|^2}{2}. $$
By summing over $i \in [n]$, we get
$$ 2Z(p) \geq \frac{1}{2} \sum_{i=1}^n |A_i A_{i+1}|^2. $$
The Cauchy-Schwarz inequality yields
$$ \sum_{i=1}^n |A_i A_{i+1}|^2 \geq
\frac{1}{n} \left(\sum_{i=1}^n |A_i A_{i+1}|\right)^2 = \frac{1}{n} . $$
Hence $4Z(p) \geq \frac{1}{n}$ for any $p \in V(P)$.
Summing up this inequality over all $p \in V(P)$ yields
$$ 8Z= 4\sum_{p \in V(P)} Z(p) \geq \sum_{i=1}^n \frac{1}{n} =1, $$
or $Z \geq1/8$, as required.
\qed

\paragraph{Remark.}
Interestingly enough, besides the construction mentioned in the
Introduction (with two groups of vertices,  $\lfloor n/2 \rfloor$ near $(0,0)$
and $\lceil n/2 \rceil$ near $(\frac{1}{n},0)$),
there is yet another construction for which the sum of the squares of
the distances is at most $1/4$ in the limit. For odd $n$, consider $n$
points evenly distributed on a circle of radius $r=1/(2n \cos \frac{\pi}{2n})$,
and labeled from $1$ to $n$, say in clockwise order.
The polygon $P$ is the thrackle which connects the point labeled $i$
with the point labeled $i+ \frac{n-1}{2}$ (as usually the indexes are
taken modulo $n$). It is easy to verify that $P$ has unit perimeter
(see also Theorem~\ref{T6}).  Write $Z= \sum_{i<j} |A_i A_j|^2$.
We have
$$ Z=n \sum_{i=1}^{(n-1)/2} 4r^2 \sin^2 \frac{i \pi}{n}=
4nr^2 \left( \sum_{i=1}^{(n-1)/2} \sin^2 \frac{i \pi}{n} \right). $$
Setting $k=\frac{n-1}{2}$ and $\alpha=\frac{\pi}{n}$ in the
trigonometric identity~\cite[p.~64]{SCY79}
$$ \sum_{i=1}^{k} \sin^2 i \alpha= \frac{k+1}{2} -
\frac{\sin [(k+1) \alpha] \cdot \cos [k \alpha]}{2 \sin \alpha} $$
yields
$$ \sum_{i=1}^{(n-1)/2} \sin^2 \frac{i \pi}{n} = \frac{n+1}{4} -
\frac{1}{4}=\frac{n}{4} \ \Longrightarrow \
Z= 4nr^2 \cdot \frac{n}{4} = \frac{n^2}{4n^2} \cdot \frac{1}{\cos^2 \frac{\pi}{2n}}=
\frac {1}{4} \cdot \frac{1}{\cos^2\frac{\pi}{2n}} \xrightarrow[n \to \infty]{}
\frac {1}{4} . $$
For even $n$, duplicate one point in the above construction, and
obtain a similar estimate.

\paragraph{Proof of Theorem~\ref{T4}.}
(Sketch.) We only need to observe that the proof given by Larcher and
Pillichshammer~\cite{LP06} for the convex case,~\cite[Theorem~1]{LP06},
can be extended for arbitrary polygons. We refer the reader to their
paper for the missing details; see also~\cite{LP08} for a simpler
proof of a slightly weaker upper bound, $n^2/16$.
A set of quadrilaterals $\{Q_{ij}\}$ and a set of triangles $\{R_i\}$
are defined~\cite{LP06} so that the edges of the quadrilaterals $Q_{ij}$ and the
triangles $R_i$ form a partition of the edge set $\{A_i A_j \ | \ i<j\}$
(each edge appears exactly once).
By Lemma~\ref{L3}, one has ${\rm per}(Q_{ij}) \leq 1$, and  ${\rm per}(R_i) \leq 1$,
for the quadrilaterals $Q_{ij}$ and for the triangles $R_i$ defined in
their proof. Moreover, the proof of Lemma~1 in ~\cite{LP06}
continues to hold without the convexity assumption.
By this lemma it follows that the sum of the
squares of the edges of each such quadrilateral or triangle (along their
perimeters) is at most $1/2$. Similarly to the proof of Theorem~\ref{T2},
by adding up the sums of the squares of the edges of all these
quadrilaterals and triangles, it follows that  the overall sum is
bounded as $T(n) \leq
\frac{1}{4} \left \lfloor \frac{n}{2} \right \rfloor
\left \lceil \frac{n}{2} \right \rceil$.

From the other direction, we clearly have
$T(n) \geq T_c(n) =
\frac{1}{4} \left \lfloor \frac{n}{2} \right \rfloor \left \lceil \frac{n}{2}
\right \rceil $, and the proof of Theorem~\ref{T4} is complete.
\qed

\section{Odd polygons: proofs of Theorems~\ref{T5} and~\ref{T6}}
\label{sec:T57}

\paragraph{Proof of Theorem~\ref{T5}.}
For $n=3$ it is easily seen that the extremal polygon is
an equilateral triangle of side $\sqrt{3}$. Let $a=a(n)=\sqrt{1+8(n-2)^2}$
and let $H(n)$ be the right hand side of~\eqref{E16}.
Then $H(n)$ can be also written as
\begin{equation} \label{E25}
H(n)=\frac{[(a+1)^2-4]^{1/2} (a+3)}{4(n-2)}.
\end{equation}

Clearly, we have $a \geq 2\sqrt{2}(n-2) \geq 2\sqrt{2} \geq 3/2$,
hence  $(a+1)^2-4=a^2+2a-3 \geq a^2$, and consequently
$[(a+1)^2-4]^{1/2} \geq a$. We show that this implies the inequality
$H(n) \geq 2(n-2)+\frac{3\sqrt{2}}{2}$:
\begin{equation} \label{E26}
H(n) \geq \frac{a(a+3)}{4(n-2)} \geq
\frac{2\sqrt{2}(n-2)}{4(n-2)} \left(2\sqrt{2}(n-2)+3 \right)=
\frac{2\sqrt{2}(n-2)+3}{\sqrt{2}} = 2(n-2)+\frac{3\sqrt{2}}{2}.
\end{equation}

Let $o$ be the center of $\Omega$,
and let $P$ be an extremal (limit) polygon.
Note that $P$ may have overlapping edges but is otherwise
non-crossing. We will show that $P$ is unique and
${\rm per}(P) = H(n)$.
We start with the upper bound ${\rm per}(P) \leq H(n)$.
Let $BC$  be a longest side of $P$ of length $|BC|=z \leq 2$.
We can assume that $BC$ is horizontal. Label each side $A_i A_{i+1}$ by $1$ or $0$
depending on whether it goes from left to right, or from right to left
in the $x$-direction (vertical sides are labeled arbitrarily). Since
$n$ is odd, we can find two consecutive sides of $P$ with the same label, say
$1$: they form a (weakly) $x$-monotone path, $\sigma$, of two
edges. By relabeling the vertices (if necessary),
we can assume that this path consists of the edges $A_1 A_2$ and $A_2
A_3$: $\sigma= A_1 A_2 A_3$. Let $L_1=|\sigma|=|A_1 A_2|+ |A_2 A_3|$,
and let $L_2$ be the total edge length of the other $n-2$ edges, so
that ${\rm per}(P)=L_1 +L_2 \leq |\sigma| + (n-2)z$.

Since $z \leq 2$ we can write $z=2 \sin \alpha$, for some $\alpha \in
[0,\pi/2]$. We first note that if $z \leq \sqrt3$ the upper bound
${\rm per}(P) \leq H(n)$ follows immediately.
Indeed: (i) for $n=5$, ${\rm per}(P) \leq 5 \cdot \sqrt3 =8.66\ldots \leq
H(5)=8.97\ldots$ and we are done;
(ii) for $n=7$, ${\rm per}(P) \leq 7 \cdot \sqrt3 =12.12\ldots \leq
H(7)=12.92\ldots$ and we are done;
(iii) for $n \geq 9$, by \eqref{E26},
${\rm per}(P) \leq n\sqrt3 \leq 2(n-2)+ \frac{3\sqrt{2}}{2} \leq H(n)$,
and we are also done.
Therefore we can assume that $z \geq \sqrt3 =2\sqrt{3}/2$, hence
$z=2 \sin \alpha$, for some $\alpha \in [\frac{\pi}{3},\frac{\pi}{2}]$.

\begin{lemma} \label{L4}
If $z=2 \sin \alpha$, for some $\alpha \in [\frac{\pi}{3},\frac{\pi}{2}]$,
then $L_1 \leq 4 \cos \frac{\alpha}{2}$.
\end{lemma}
\begin{proof}
Since the path $\sigma=A_1 A_2 A_3$ is $x$-monotone and the polygon
$P$ is non-crossing, the vertical segments extended from
interior points of $BC$ meet the path on the same side of $BC$, if at all.
Assume without loss of generality that $\sigma$ lies above $BC$ in
this sense. See Fig.~\ref{f2}(left and center) for two examples.
\begin{figure} [htb]
\centerline{\epsfxsize=6.2in \epsffile{f2.eps}}
\caption{For a fixed length $z$, $L_1$ is maximum when $BC$ is a
chord of $\Omega$.}
\label{f2}
\end{figure}

Consider for a moment the case when $BC$ is a right sub-segment
of the horizontal diameter $\Delta$ of $\Omega$; see
Fig.~\ref{f2}(right). Let $v$ be the length of the vertical chord
incident to $B$. We have
$$ v=2\sqrt{1-x^2}=2\sqrt{1-(z-1)^2}=2\sqrt{1-(2 \sin \alpha-1)^2}=
4\sqrt{\sin \alpha - \sin^2 \alpha}.
$$

We next verify that for $\alpha \in [\frac{\pi}{3},\frac{\pi}{2}]$ we have
\begin{equation} \label{E27}
z+v< 4 \cos \frac{\alpha}{2},
\end{equation}
or equivalently,
\begin{equation} \label{E28}
\sin \alpha + 2\sqrt{\sin \alpha - \sin^2 \alpha} < 2 \cos \frac{\alpha}{2}.
\end{equation}
Observe that both $f(\alpha)= \sin \alpha + 2\sqrt{\sin \alpha - \sin^2 \alpha}$
and $g(\alpha)= 2 \cos \frac{\alpha}{2}$ are decreasing functions on
the interval $[\frac{\pi}{3},\frac{\pi}{2}]$.
Partition the interval $[\frac{\pi}{3},\frac{\pi}{2}]$ into two
interior-disjoint intervals:
$$ \left[\frac{\pi}{3},\frac{\pi}{2}\right]=
[\alpha_1,\beta_1] \cup [\alpha_2,\beta_2], $$
where $\alpha_1= \pi/3$, $\beta_1=\alpha_2= 5\pi/12$, and $\beta_2=\pi/2$.
It is enough to check that $ f(\alpha_i) < g(\beta_i)$, for $i=1,2$:
$f(\alpha_1)=1.547\ldots < g(\beta_1)=1.586\ldots$,
and $f(\alpha_2)=1.328\ldots < g(\beta_2)=1.414\ldots$.
We have thereby verified \eqref{E28}.

According to whether the slopes of $A_1 A_2$ and $A_2 A_3$
are $\geq 0$ or $\leq 0$, we say that the path $\sigma=A_1 A_2 A_3$ is of
type $++$, $+-$, $-+$, or $--$ (zero slopes are labeled arbitrarily).
For example, $\sigma$ in Fig.~\ref{f2}(left) is of
type $+-$, while $\sigma$ in Fig.~\ref{f2}(center) is of type $-+$.
We distinguish three cases:

\smallskip
{\em Case 1:} The path $A_1 A_2 A_3$ is of type $-+$, as in
Fig.~\ref{f2}(center) or in Fig.~\ref{f3}(left). If $A_2$ lies below $\ell(BC)$,
then $|A_1 A_2| \leq v$ and obviously $|A_2 A_3| \leq z$, and by \eqref{E27},
the inequality claimed in the lemma follows.  Assume now that $A_2$
lies above $\ell(BC)$ and refer to Fig.~\ref{f3}.
\begin{figure} [htb]
\centerline{\epsfxsize=4.2in \epsffile{f3.eps}}
\caption{Case 1 in the proof of Lemma~\ref{L4}.}
\label{f3}
\end{figure}
By symmetry we can assume that $x(o) \leq x(A_2)$.
Let $MN$ be the vertical chord through $A_2$, and $Q =\ell(BC) \cap \ell(MN)$.
Assume that $MN$ subtends a center angle $2\beta$, for some
$\beta \in [0,\pi/2]$.
For a fixed $x(A_2)$, the length $|\sigma|$ is maximized when $A_2=Q$,
$A_3=M$, and $A_1 \in \partial \Omega$.
Observe that the width and height of the rectangle with opposite
vertices $o$ and $Q$ are $\cos \beta$ and $\cos \alpha$, respectively.
Note that $|A_2 A_3|= \cos \alpha + \sin \beta$.
By the triangle inequality (used twice) we have
$$ |A_1 A_2| \leq |A_1 o| + |oQ| \leq |A_1 o| + \cos \alpha + \cos \beta =
1+ \cos \alpha + \cos \beta. $$
Note also the standard trigonometric inequality
$\cos \beta + \sin \beta \leq \sqrt2$.
Putting these together we obtain
\begin {align} \label{E1}
|\sigma| &=|A_1 A_2| + |A_2 A_3| \leq (1+ \cos \alpha + \cos \beta) +
(\cos \alpha + \sin \beta) \\ \nonumber
&= 1 + 2\cos \alpha +(\cos \beta + \sin \beta)
\leq 1 + \sqrt2 + 2\cos \alpha.
\end{align}
Since $\cos \alpha= 2 \cos^2 \frac{\alpha}{2} -1$,
it remains to verify that
$1 + \sqrt2 + 4\cos^2 \frac{\alpha}{2} -2 \leq 4 \cos \frac{\alpha}{2}$.
Make the substitution $t=\cos \frac{\alpha}{2}$;
then $t \in [\cos \pi/4, \cos \pi/3]=[\sqrt2/2,\sqrt3/2]$, and we
need to verify that
$$ 1 + \sqrt2 + 4t^2 -2 \leq 4t, $$
or equivalently,
\begin{equation} \label{E2}
(2t-1)^2 \leq 2 -\sqrt2, \ \ {\rm for} \ \ t \in [\sqrt2/2,\sqrt3/2].
\end{equation}
It is easy to see that for the above range of $t$ we have
$$ (2t-1)^2 \leq (2 \sqrt3/2 -1)^2 = (\sqrt3 -1)^2 \leq 2 -\sqrt2,
$$
as required.

\smallskip
{\em Case 2:} The path $A_1 A_2 A_3$ is of type $+-$, as in
Fig.~\ref{f2}(left). If $x(A_2) \leq x(B)$
(the other case when $x(A_2) \geq x(C)$ is symmetric),
then $|A_1 A_2| \leq v$ and $|A_2 A_3| \leq z$, and inequality
\eqref{E27} concludes the proof.
Otherwise, replace $A_1 A_2 A_3$ by a longer path
as follows. Move $A_1$ on $\ell(A_1 A_2)$ away from $A_2$ to
the intersection point of this line with the circle $\partial \Omega$
or $BC$, whichever comes first.
In the latter case, move $A_1$ left on $\ell(BC)$ to
the intersection point of $\partial \Omega$ and $\ell(BC)$
(a strict increase in length follows from the fact that $\sigma$ is $x$-monotone).
Proceed similarly with $A_3$ by extending $A_2 A_3$.
Now move $A_2$ upward to the circle $\partial \Omega$ while increasing $|\sigma|$.
We now have a path $A_1 A_2 A_3$ of type $+-$ with all three points
$A_1,A_2,A_3$ on the circle. Move $BC$ downward until it hits $\partial \Omega$,
and then rotate it around the endpoint on $\partial \Omega$;
so now both endpoints $B$ and $C$ lie on the circle, and $z=|BC|$ is unchanged.
Unless $A_1=B$ and $A_3=C$, further increase $|\sigma|$
while keeping $z$ fixed by moving the points $A_1$ and $A_3$ on the
circle towards $B$ and respectively $C$.
In such a configuration, the chord $BC$ subtends an angle
of $2\alpha$ from the center $o$. Hence for a fixed $z$, $L_1$ is
maximized when the triangle $\Delta{A_1 A_2 A_3}$ is isosceles with
$|A_2 A_1|=|A_2 A_3|$. Indeed, $ L_1 = 2 (\sin \beta + \sin \gamma)$,
where $2(\alpha+ \beta+ \gamma)=2 \pi$, thus
$$ L_1 =2 (\sin \beta + \sin \gamma) =
4 \sin \frac{\beta+\gamma}{2} \cos\frac{\beta-\gamma}{2}
\leq 4 \sin \frac{\beta+\gamma}{2} = 4 \cos \frac{\alpha}{2}. $$
Observe that in the (unique) maximizing position,
$\beta=\gamma=\frac{\pi-\alpha}{2}$.

\smallskip
{\em Case 3:} The path $A_1 A_2 A_3$ is of type $++$ (or symmetrically,
$--$). If $A_2$ lies below $\Delta$, $|A_1 A_2|$ can be (possibly) increased by
moving $A_1$ to the intersection between $\partial \Omega$ and
the horizontal line through $A_2$. The new path $A_1 A_2 A_3$ is
$x$-monotone, still lies above $BC$, but is now of type $-+$ (Case 1, above).
If $A_2$ lies above $\Delta$, $|A_2 A_3|$ can be (possibly) increased by
moving $A_3$ to the intersection between $\partial \Omega$ and
the horizontal line through $A_2$. The new path $A_1 A_2 A_3$ is
$x$-monotone, still lies above $BC$, but is now of type $+-$ (Case 2, above).
In either case, since one edge of $A_1 A_2 A_3$ is horizontal,
the length of $A_1 A_2 A_3$ can be further strictly increased by using
the operations described in Case 2.

\medskip
This concludes our case analysis. If any increase had occurred, a simple polygon
whose perimeter is strictly larger than that of $P$
could be constructed by taking the new path $A_1 A_2 A_3$ and
then going back and forth near $A_2 A_3$ with the remaining $n-2$ edges.
However, this would contradict the fact that $P$ was an extremal polygon.
Observe that $L_1 \leq 4 \cos \frac{\alpha}{2}$ can hold with equality
only in Case 2. We have thus shown that for a fixed length $z$,  $L_1$
is maximized when $z$ is a chord of $\Omega$, $A_1=B$, $A_3=C$,
and $|A_2 A_1|=|A_2 A_3|$ with $A_1,A_2,A_3$ on the circle.
\end{proof}

\medskip
Since $z=2 \sin \alpha$ is the length of a longest side, by
Lemma~\ref{L4} we get
\begin{equation} \label{E13}
F(n) \leq L_1 + (n-2)z \leq 4 \cos \frac{\alpha}{2} + 2(n-2) \sin \alpha.
\end{equation}
We are thus led to maximizing the following function of one variable
$\alpha \in [0,\pi/2]$:
$$ f(\alpha)= 4 \cos \frac{\alpha}{2} + 2(n-2) \sin \alpha. $$
The function $f(\cdot)$ is maximized at the root of the derivative:
$$ f'(\alpha)= -2 \sin \frac{\alpha}{2} + 2(n-2) \cos \alpha. $$
Making the substitution $x= \sin \frac{\alpha}{2}$,
and using the trigonometric identity
$\cos \alpha= 1 - 2 \sin^2 \frac{\alpha}{2}$, yields the quadratic
equation in $x$:
$$ -2x + 2(n-2) (1-2x^2)=0, \ {\rm or} $$
$$ 2(n-2)x^2 +x -(n-2) =0. $$
The solution (corresponding to $\alpha \in [0,\pi/2]$) is
\begin{equation} \label{E14}
x= \sin \frac{\alpha}{2}=
\frac{-1 + \sqrt{1+8(n-2)^2}}{4(n-2)}.
\end{equation}

This implies
$$ \cos \frac{\alpha}{2}= \sqrt{1- \sin^2 \frac{\alpha}{2}} =
\frac{ \sqrt{8(n-2)^2 -2 +2 \sqrt{1+8(n-2)^2}}}{4(n-2)}. $$
Consequently, $F(n)$ is bounded from above by
the maximum value of $f(\cdot)$, namely
\begin{align} \label{E15}
F(n) &\leq 4 \cos \frac{\alpha}{2} + 2(n-2) \sin \alpha =
4 \cos \frac{\alpha}{2} \left( (n-2) \sin \frac{\alpha}{2} +1 \right)
\nonumber \\
&= \frac{\sqrt{8(n-2)^2 -2 +2 \sqrt{1+8(n-2)^2}} \cdot
\left(\sqrt{1+8(n-2)^2}+3\right)} {4(n-2)} =H(n).
\end{align}

To see that this upper bound is tight construct a simple polygon as
follows. Let $A_1 A_3$ be a horizontal chord of length $z=2 \sin \alpha$,
below the center $o$, with $\alpha$ set according to \eqref{E14}.
Let $A_2$ be the intersection point above $A_1 A_3$ of the vertical
bisector of $A_1 A_3$ with the unit circle $\partial \Omega$. The
remaining $n-2$ sides of the polygon go back and forth near the
horizontal chord $A_1 A_3$. Thus formula \eqref{E16} holds for every odd $n \geq 3$.
This concludes the proof of Theorem~\ref{T5}.
\qed

\paragraph{Proof of Theorem~\ref{T6}.}
We start with the upper bound on $G(n)$.
Consider the set of $n$-gons contained in $\Omega$, where each such
$n$-gon is given by the $n$-tuple of its vertex coordinates.
Note that this forms a compact set, hence there exists an
extremal polygon $P=A_1 \ldots A_n$, where $(A_{n+1}=A_1)$ which
attains the maximum perimeter. Observe two properties of $P$ that we
justify below:
\begin{itemize}
\item Each vertex of $P$ lies on $\partial \Omega$.
\item All sides of $P$ have equal length $<2$.
\end{itemize}

First, assuming that $A_i$ lies in the interior of $\Omega$,
${\rm per}(P)$ could be increased by moving $A_i$ orthogonally away from
$A_{i-1} A_{i+1}$, or away from $A_{i-1}$ in case $A_{i-1} = A_{i+1}$.
This would contradict the maximality of $P$, hence all
vertices of $P$ lie on the circle.
Second, assume now that $A_{i-1}, A_i, A_{i+1}$ lie on the circle
$\partial \Omega$, and $|A_{i-1} A_i| \neq |A_i A_{i+1}|$. Then
${\rm per}(P)$ could be increased by moving $A_i$ on the circle and further
from $A_{i-1} A_{i+1}$ (to the midpoint of the arc).
This again would contradict the maximality of $P$, hence
all sides of $P$ are equal. Since $n$ is odd, it is obvious that the
common edge length is strictly smaller than $2$, since otherwise
$A_{n+1}$ cannot coincide with $A_1$.

Having established the two properties above, we can now easily
obtain an upper bound on the perimeter of $P$.
Let $o$ be the center of $\Omega$.
For each $i \in [n]$, label the side $A_i A_{i+1}$ by $+$ or $-$
depending on whether the center $o$ lies on the right of
$\overrightarrow{A_i A_{i+1}}$ or on the left of $\overrightarrow{A_i A_{i+1}}$.
This labeling encodes the winding of the edges of $P$ around the center $o$.
Let $[n]=\Gamma_+ \cup \Gamma_-$ be the corresponding partition of $[n]$
determined by a positive or, respectively, negative labeling of $A_i
A_{i+1}$. Write $k=|\Gamma_+|$, and $l=|\Gamma_-|$, so $k+l=n$.

We can assume that $l=0$; indeed if both $k>0$ and $l>0$, then there
exist two consecutive sides, $A_{i-1} A_i$ and $A_i A_{i+1}$,
one with a positive label and one with a negative label. This implies
that $A_{i-1} = A_{i+1}$, hence ${\rm per}(P)$ could be increased
(recall that the side length is smaller than $2$) by moving
$A_i$ to the point diametrically opposite to $A_{i-1}$ (and $A_{i+1}$),
a contradiction. Hence $l=0$, $\Gamma_-=\emptyset$, and  $\Gamma= \Gamma_+=[n]$.
For each $i \in [n]$, let $\angle{A_i  o A_{i+1}}=2\alpha$,
where $0 < \alpha <\frac{\pi}{2}$.
Since $P$ is a closed polygonal chain, $2n \alpha = m \pi$
for some positive integer $m$, $ 1 \leq m \leq n-1$.
Consequently, the perimeter of $P$ is
\begin{equation} \label{E23}
{\rm per}(A_1 \ldots A_n)= 2n \sin \alpha = 2n \sin \frac{m \pi}{2n}
\leq 2n \sin \frac{(n-1)\pi}{2n}= 2n \cos \frac{\pi}{2n},
\end{equation}
as claimed.

It remains to show that this bound can be attained.
Consider $n$ points evenly distributed on the unit circle,
and labeled from $1$ to $n$, say in clockwise order. The polygon we need is the
thrackle which connects the point labeled $i$ with the point labeled $i+
\frac{n-1}{2}$ (as usually the indexes are taken modulo $n$).
It is easy to verify that its perimeter is given by the upper bound in
\eqref{E23}, and this concludes the proof of Theorem~\ref{T6}.
\qed

\medskip
\noindent {\bf Remarks.} For instance, $F(3)=3 \sqrt{3}=5.19\ldots$ corresponds
to an equilateral triangle of side $\sqrt{3}$, and
$ F(5)= \sqrt{70 + 2 \sqrt{73}} \cdot (\sqrt{73}+3)/12= 8.9774\ldots$.
The exact formula \eqref{E16} easily yields an approximation of the form:
$$ F(n)= 2(n-2) + 2 \sqrt{2} + O\left(\frac{1}{n}\right). $$

Note that the sum of the first two terms in this formula,
$ 2(n-2) + 2 \sqrt{2}$, gives (in the limit) the perimeter of a simple polygon
whose first two sides have length $\sqrt{2}$ each, and whose remaining $n-2$ sides
go back and forth near a diameter of the unit disk. Thus the perimeter
of the extremal polygon in Theorem~\ref{T5} exceeds the perimeter of
the polygon described above only by a term that tends to zero with $n$.

It is interesting to observe that (for odd $n$) in contrast to $F(n)$,
$G(n)$ does get arbitrarily close to $2n$, as $n$ tends to infinity; that is,
$G(n)=2n-o(1)$. Indeed, the series expansion of $\cos x$ around $x=0$,
$\cos x = 1-\frac{x^2}{2} + \ldots$ gives\footnote{%
A closed formula approximation, avoiding the infinite sum is easily obtainable.}
$$ G(n)= 2n \cos \frac{\pi}{2n} =
2n \left( 1 - \frac{\pi^2}{8n^2} + \ldots \right)=
2n- \frac{\pi^2}{4n} + \ldots = 2n-o(1) . $$

\paragraph{Acknowledgment.}
The author is grateful to an anonymous reviewer for pointing out a gap
in our earlier proof of Theorem~\ref{T5} and for suggesting a
significantly shorter proof of Theorem~\ref{T6}.

Metric Geometry (math.MG); Discrete Mathematics (cs.DM)

Metric inequalities for polygons


Generalized Lyndon Factorizations of Infinite Words

Abstract: A generalized lexicographic order on words is a lexicographic order where the total order of the alphabet depends on the position of the comparison. A generalized Lyndon word is a finite word which is strictly smallest among its class of rotations with respect to a generalized lexicographic order. This notion can be extended to infinite words: an infinite generalized Lyndon word is an infinite word which is strictly smallest among its class of suffixes. We prove a conjecture of Dolce, Restivo, and Reutenauer: every infinite word has a unique nonincreasing factorization into finite and infinite generalized Lyndon words. When this factorization has finitely many terms, we characterize the last term of the factorization. Our methods also show that the infinite generalized Lyndon words are precisely the words with infinitely many generalized Lyndon prefixes.

\section{Introduction}\label{1}
A {\it rotation} of a finite word $w$ is a word of the form $vu$, where $w = uv$ is a factorization of $w$.  A finite word is called {\it Lyndon} if it is strictly smallest among its class of rotations with respect to the standard lexicographic order. In particular, every finite word is a conjugate of some power of a Lyndon word. Lyndon words were introduced in 1953 by Shirshov in \cite{Shi} and studied by Lyndon in \cite{Lyn}.  Lyndon words have been given various names throughout their history, including {\it standard lexicographic sequences}, {\it regular words}, and {\it prime words}.  These names hint at their significant role in the factorization of words.

Let $A^*$ denote the free monoid on a totally ordered (possibly infinite) alphabet $A$, where $A^*$ is ordered lexicographically.  The Chen-Fox-Lyndon factorization theorem for words states that the Lyndon words form a basis for $A^*$ \cite{CFL}.  Put more concretely, any finite word on $A$ can be written uniquely as a product of nonincreasing Lyndon words.

About 40 years later, infinite Lyndon words were introduced in \cite{SMDS}.  There are several equivalent definitions, but we use the definition which focuses on the idea of rotation.  An infinite word is called {\it Lyndon} if it is strictly smallest among its suffixes with respect to the standard lexicographic order.  If $w$ is an infinite word with a nontrivial factorization $uv$, the suffix $v$ can be viewed as the rotation with respect to this factorization.  Let $A^\omega$ denote the set of sequences, or infinite words, over $A$.  These too yielded deep factorization properties; Siromoney et al. showed that every sequence in $A^\omega$ has a unique factorization as a nonincreasing product of finite and infinite Lyndon words.

The extension of the Lyndon property to generalized lexicographic orders came about 10 years later by Reutenauer \cite{Reu}.  A {\it generalized lexicographic order} is a modified lexicographic order where the total order of the alphabet depends on the index of comparison. This naturally induces a notion of finite and infinite {\it generalized Lyndon words} under a generalized lexicographic order.  (See Section \ref{2}.) Reutenauer showed that the finite generalized Lyndon words form a basis for $A^*$ using Hall set theory, and Dolce et al. provided a combinatorial proof in 2018 \cite{Reu,DRR}.  Generalized Lyndon words are studied further by Dolce et al. in \cite{DRR2}.

An example of a generalized lexicographic order is the {\it alternating order} $\leq_{\text{alt}}$, where the alphabet is given its standard order when the index of comparison is odd and its opposite order when the index is even.  This order can be connected with continued fractions by noting that the map $\phi: \mathbb{N}^\omega \to \mathbb{R}$ defined by
\vspace{-2mm}$$\displaystyle\phi(x_1x_2\cdots) = x_1 +  \cfrac{1}{x_2 + \cfrac{1}{\;\;\;\;\ddots}}\vspace{-1mm}$$
satisfies $u \leq_{\text{alt}} v$ in $\mathbb{N}^\omega$ if and only if $\phi(u) \leq \phi(v)$ in $\mathbb{R}$.  Generalized Lyndon words with respect to the alternating order are called {\it Galois words}, and Galois factorizations were given further characterization in \cite{DRR2}.  Another special case are the anti-Lyndon words, introduced in \cite{GM}, which are generalized Lyndon words with respect to the opposite lexicographic order.

Dolce et al. conjectured that the finite and infinite generalized Lyndon words provide a unique nonincreasing (with respect to $\omega$-powers) factorization of all infinite words.  Our main result is to show that this is indeed the case.

In Section \ref{3}, we focus on words with a generalized Lyndon suffix.  Theorem \ref{L} shows that these are precisely the words with finitely many terms in their nonincreasing generalized Lyndon factorization.  Moreover, we characterize the last term as the first generalized Lyndon suffix (with respect to the index).

Sections \ref{4} and \ref{5} focus on the existence and uniqueness, respectively, of nonincreasing generalized Lyndon factorizations for words which have no generalized Lyndon suffix.  In the process we develop powerful machinery to take advantage of the strong properties of these factorizations.  A product of this machinery is presented briefly in Section \ref{6}, where we show that an infinite word is generalized Lyndon if and only if it has infinitely many generalized Lyndon prefixes. This is the generalized analogue of the result of Siromoney et al. showing that infinite Lyndon words are precisely the words with infinitely many Lyndon prefixes.

\section{Preliminaries}\label{2}
Let $\mathbb{N} = \{1,2,3,\dots\}$.  Words are finite or infinite (to the right) sequences of letters from a fixed (possibly infinite) alphabet $A$.  For $i < j$, the contiguous substring beginning at the $i^{\mathrm{th}}$ letter and ending with the $j^{\mathrm{th}}$ (inclusive on both ends) is denoted $x[i,j]$.  A word $v$ is a {\it factor} of $x$ if $x = uvw$ for (possibly empty) words $u$ and $w$.  In the case that $u$ is empty, $v$ is a {\it prefix} of $x$, and if $w$ is empty, then $v$ is a {\it suffix} of $x$.  If in addition $w$ (resp. $u$) is nonempty, we say that the prefix (resp. suffix) is {\it proper}.  If $x$ is an infinite word, the suffix of $x$ beginning at the $j^{\mathrm{th}}$ index of $x$ is denoted $x[j,\infty)$.  The length of a finite word $w$ is denoted by $|w|$.

Let $A^\infty = A^* \cup A^\omega$.  Given a total order on an alphabet $A$, the {\it lexicographic ordering} $<_{\text{lex}}$ on $A^\infty$ is defined such that $x <_{\text{lex}} y$ if and only if $x$ is a proper prefix of $y$ or $x = pas$ and $y = pbs'$ for words $p,s,s'$ and letters $a < b$.  We are primarily interested in a generalization of this order.

For each $n \in \mathbb{N}$, let $<_n$ be a total order on $A$.  The {\it generalized lexicographic order} $<$ induced by $(<_n)_{n \in \mathbb{N}}$ is defined such that $x < y$ if and only if $x$ is a proper prefix of $y$ or $x = pas$ and $y = pbs'$ for words $p,s,s'$ and letters $a <_{|p| + 1} b$.

If $u$ is a prefix of $v$ or $v$ is a prefix of $u$, we write $u \sim v$.  Note that if $|u| = |v|$, then $u \sim v$ implies $u = v$.  We will use the $\sim$ operator ``transitively'', where the expression $w_1 \sim w_2 \sim \cdots \sim w_n$ implies that the shortest of the $n$ words is a prefix of the rest.  We also define a modified comparison operator $\lesssim$ such that $w_1 \lesssim \cdots \lesssim w_n$ if the prefixes $p_i$ of $w_i$ having length $\min\{|w_1|,\dots,|w_n|\}$ satisfy $p_1 \leq \cdots \leq p_n$, where $\leq$ is the generalized lexicographic order.  The same property of only comparing the prefixes up to the length of the shortest word in a chain also applies when the operators $\sim$ and $\lesssim$ are applied together in a chain.

A finite word $v$ is called a {\it power} of a finite word $u$ if $v = u^k$ for some integer $k \geq 2$.  Let the $\omega$-power of $u$, denoted by $u^\omega$, be the infinite word $\prod_{i=1}^\infty u$.  An infinite word $v$ is called a {\it power} of a finite word $u$ if $v = u^\omega$; we also say that $v$ is {\it periodic}.  If $u$ is infinite, we use the convention $u^\omega = u$. An infinite word with a periodic suffix is called {\it eventually periodic}, and an infinite word which is not eventually periodic is called {\it aperiodic}.  A word which is not a power is called {\it primitive}.  A finite word $w$ is called a {\it fractional power} of a finite word $u$ if $w \sim u^\omega$.  We write $w = u^{|w|/|u|}$, e.g., $01 = (0111)^{1/2}$. See \cite{Lot2}, \cite{Lot}, and \cite{PR} for more on the combinatorics of words.

A word $w$ is a {\it finite generalized Lyndon word} if it is strictly smallest among its class of rotations with respect to a generalized lexicographic order.  That is, for any nontrivial factorization $w = uv$, we have $uv < vu$.  An infinite word $w$ is an {\it infinite generalized Lyndon word} if it is strictly smallest among its class of suffixes with respect to a generalized lexicographic order.  A nonincreasing generalized Lyndon factorization of a word $w$ is a product of the form $w = \prod_{i = 1}^n \ell_i$  where $n \in \mathbb{N} \cup \{\infty\}$, each $\ell_i$ is generalized Lyndon, and $\ell_i^\omega \geq \ell_{i+1}^\omega$ for all $i \in [1,n)$.

\section{Existence and Uniqueness of Finite Factorizations}\label{3}

In this section, we show that the words admitting a unique finite nonincreasing generalized Lyndon factorization are precisely the words that have a generalized Lyndon suffix.

\begin{lemma}\emph{(\cite{DRR}, Lemma 31)} \label{C1}
Let $u,v$ be nonempty finite words.  Then the following four conditions are equivalent:
\\\emph{(1) $u^\omega < v^\omega$ \hspace{.75cm} (2) $(uv)^\omega < v^\omega$ \hspace{.75cm} (3) $u^\omega < (vu)^\omega$ \hspace{.75cm} (4) $(uv)^\omega < (vu)^\omega$.}
\end{lemma}

We will also make use of a result by Lyndon and Sch{\" u}tzenberger \cite{LS} concerning commuting words, which can easily be strengthened when one of the words is generalized Lyndon.

\begin{lemma}\emph{(\cite{LS})}\label{C2}
Two finite words commute if and only if they are powers of a common word.
\end{lemma}

\begin{corollary}\label{I}
Suppose $u$ is a finite generalized Lyndon word, $v$ is any finite word, and $uv = vu$.  Then $v$ is a power of $u$.
\end{corollary}
\begin{proof}
This follows from Lemma \ref{C2} and the fact that generalized Lyndon words are primitive.
\end{proof}

\begin{lemma}\label{J}
Suppose $u$ and $v$ are finite words satisfying $u^\omega \lesssim v \lesssim u^nv$ (resp. $u^\omega \gtrsim v \gtrsim u^nv$) for some $n \in \mathbb{N}$.  Then $v\sim u^\omega$.
\end{lemma}
\begin{proof}
Suppose there exists a maximum nonnegative integer, $m$, such that $u^m \sim v$; note that $|u^m| < |v|$.  Then
$$u^{m+1} \leq u^\omega  \lesssim v \lesssim u^n v \sim u^{m + n}.$$
Thus $v \sim u^{m+n}$, a contradiction to our choice of $m$.  The proof proceeds analogously for the case where the inequalities are reversed.
\end{proof}

\begin{theorem}\label{G}
Suppose $w$ is an infinite word. If $w$ is a nonincreasing product of finite generalized Lyndon words, then $w$ has no generalized Lyndon suffixes.
\end{theorem}
\begin{proof}
Suppose $w$ has a generalized Lyndon suffix $\ell$.  Without loss of generality, we can assume $w = \ell_0\ell_1\ell_2\cdots$ and $\ell = u\ell_1\ell_2\cdots$, where each $\ell_i$ is a generalized Lyndon word, $\ell_0^\omega \geq \ell_1^\omega \geq \cdots$, and $u$ is a suffix of $\ell_0$.  Since $\ell_0$ is generalized Lyndon, Lemma \ref{C1} implies $u^\omega \geq \ell_0^\omega$. Furthermore, since $\ell$ is generalized Lyndon, we have $\ell_r \gtrsim u$ for all $r \in \mathbb{N}$.  Thus, for all $r \in \mathbb{N}$ we have $u^\omega \geq \ell_0^\omega \geq \ell_r^\omega \sim \ell_r \gtrsim u$, hence $\ell_r \sim u$.

Suppose that there exists some $r \in \mathbb{N}$ such that $|\ell_r| < |u|$.  Note that each such $\ell_r$ is a prefix of $u$.  By the nonincreasing property of the generalized Lyndon factors, either there exist finitely many such $r$, or there exists some $n \in \mathbb{N}$ and $\alpha \in (0,1)$ such that for all $r \geq n$, we have $\ell_r = u^\alpha$. The latter case holds because there are only finitely many prefixes of $u$, so one prefix must appear infinitely many times. By the nonincreasing property of the factorization, this means that all terms in the factorization after the first term equal to this prefix must also equal this prefix. Observe that in the latter case, we have
$$(u^\alpha)^\omega = \ell_n^\omega \leq u^\omega \sim u \lesssim \ell_n\ell_{n+1}\cdots = (u^\alpha)^\omega,$$
hence $u \sim (u^\alpha)^\omega$.

We conclude that there exists a minimal $k \in \mathbb{N}$ such that $\ell_k = u^\alpha$ for some $\alpha \in (0,1)$ and $u \sim \ell_{k+1}\ell_{k+2}\cdots$.  Since $u^\alpha u \sim \ell_k\ell_{k+1}\cdots$, then $u^\alpha u \gtrsim u\ell_1$. Thus, $u^\alpha u\gtrsim u\sim u^\omega\geq \ell_k^\omega=(u^\alpha)^\omega$, so Lemma \ref{J} implies $u\sim (u^\alpha)^\omega$. Suppose $|\ell_1|\geq |u|$. Then $uu^\alpha$ is a prefix of $w$, so
$$(u^\alpha)^\omega \sim u^\alpha u \geq u u^\alpha \sim u^\omega \geq (u^\alpha)^\omega,$$
hence $u$ is a power of $u^\alpha$ by Corollary \ref{I}.  Thus, $u$ is not generalized Lyndon, so $u^\omega > \ell_0^\omega \geq \ell_k^\omega = (u^\alpha)^\omega = u^\omega$, a contradiction.

Thus, we must have that $|\ell_1| < |u|$.  By the minimality of $k$, we have that $|\ell_r| < |u|$ for $1 \leq r \leq k$, which implies that $\ell_r \sim u \sim (u^\alpha)^\omega = \ell_k^\omega$ for $1 \leq r \leq k$. As $u \sim \ell_k^\omega$, we have that $u \sim \ell_k u \sim \ell_k\ell_{k+1}$. Hence
$$\ell_{k-1}^\omega \leq u^\omega \sim u \lesssim \ell_{k-1}\ell_k\ell_{k+1}\cdots \sim \ell_{k-1}u.$$
In particular, by Lemma \ref{J}, we have $u \sim \ell_{k-1}^\omega$ and $u \sim \ell_{k-1}\ell_k\cdots$.  We repeat this process, showing that $u\sim \ell_i^\omega$ and $u \sim \ell_i\ell_{i+1}\cdots$ for all $1 \leq i \leq k$.  Hence $\ell_1 u \sim \ell_1\ell_2\cdots \gtrsim u\ell_1$.  However, since $\ell_1^\omega \leq u^\omega$, Lemma \ref{C1} implies $\ell_1 u \leq u\ell_1$.  Thus $u$ and $\ell_1$ commute, so Corollary \ref{I} implies $u$ is a power of $\ell_1$.  In particular, $\ell_1$ is a proper suffix of $\ell_0$, so $\ell_1^\omega > \ell_0^\omega$, contradicting our nonincreasing assumption.

Thus, we must have $|\ell_r| \geq |u|$ for all $r \in \mathbb{N}$.  $w$ has a generalized Lyndon suffix, so it cannot be periodic. We can fix $s$ to be the smallest index such that $\ell_s \not= u$.  By Lemma \ref{J}, the inequality
$$u^\omega \geq \ell_s^\omega \sim \ell_s \gtrsim u \ell_1 \cdots \ell_s = u^s \ell_s,$$
implies that $\ell_s \sim u^\omega$.  Hence $\ell_s = u^{n + \beta}$ for some $n \in \mathbb{N}$ and $\beta \in [0,1)$.  On the one hand, we have $u^\omega \geq \ell_s^\omega = (u^{n+\beta})^\omega$, hence $u^nuu^\beta \geq u^nu^\beta u$.  On the other hand, since $u^nu u^\beta \sim u^{s + n + \beta}$ is a prefix of $\ell$ and $u^nu^\beta u\sim\ell_s\ell_{s+1}$ is a factor, we have $u^nu u^\beta \leq u^nu^\beta u$ because $\ell$ is generalized Lyndon.  Hence, Lemma \ref{C2} implies $(u^\beta)^\omega = u^\omega = \ell_s^\omega$, contradicting that $(u^\beta)^\omega > \ell_s^\omega$ by the generalized Lyndon property of $\ell_s$.
\end{proof}

\begin{lemma}\label{H}
If $u$ is a finite word and $v$ is an infinite word, then $u^\omega > v$ (resp. $u^\omega < v$) if and only if $uv > v$ (resp. $uv < v$).
\end{lemma}
\begin{proof}
Suppose $u^\omega > v$.  Let $j$ be the largest integer such that $u^j \sim v$.  Hence $v = u^jv'$ for some infinite word $v' \not\sim u$.  Thus, the comparison between $uv$ and $v$ happens between index  $j|u| + 1$ and index $(j+1)|u|$, inclusive.  In particular, $uv \sim u^{j+1} > v$.

Now suppose $uv > v$.  Let $k$ be the largest index such that $u^k \sim v$.  Thus, the comparison between $uv$ and $v$ happens between index  $k|u| + 1$ and index $(k+1)|u|$, inclusive.  In particular, $u^\omega \sim u^{k+1} \sim uv > v$.

The proof with the reverse inequalities proceeds analogously.
\end{proof}

\begin{comment}
{\begin{corollary}\label{K}
An infinite generalized Lyndon word has a unique nonincreasing factorization into generalized Lyndon words.
\end{corollary}
\begin{proof}
Fix an infinite generalized Lyndon word $w$.  From Theorem \ref{G}, we know that $w$ cannot have a nonincreasing factorization into infinitely many generalized Lyndon words.  Suppose $w = \ell_1\cdots \ell_n \ell$, where $\ell_1,\dots,\ell_n,\ell$ are generalized Lyndon words satisfying $\ell_1^\omega \geq \cdots \geq \ell_n^\omega \geq \ell$.  A repeated application of Lemma \ref{C1} yields that $(\ell_1\cdots \ell_n)^\omega \geq \ell_n^\omega \geq \ell$.  By Lemma \ref{H}, we have $\ell_1\cdots\ell_n\ell \geq \ell$, which contradicts the fact that $w$ is a generalized Lyndon word.  Thus, $w$ is its own unique nonincreasing factorization into generalized Lyndon words.
\end{proof}
\end{comment}

In order to show the existence and uniqueness of generalized Lyndon factorizations of infinite words, we will invoke a theorem of Reutenauer which gives the analogous result for finite words \cite{Reu}.

\begin{theorem}\emph{\cite{Reu,DRR}}\label{C3}
Any finite word has a unique nonincreasing factorization into generalized Lyndon words.
\end{theorem}

\begin{theorem}\label{L}
An infinite word with an infinite generalized Lyndon suffix has a unique factorization into generalized Lyndon words, and this factorization is finite.  Furthermore, the last term in this factorization is the first generalized Lyndon suffix by index.
\end{theorem}
\begin{proof}
We first show existence.  Let $\ell$ be the first generalized Lyndon suffix of $w$ by index, that is, $w = v\ell$ where the length of $v$ is minimum such that $\ell$ is generalized Lyndon.  Let $\ell_1, \dots, \ell_n$ be the unique nonincreasing factorization of $v$ from Theorem \ref{C3}.  It is enough to show that $\ell_n^\omega \geq \ell$, as this will yield $\ell_1, \dots, \ell_n, \ell$ as a nonincreasing generalized Lyndon factorization of $w$.

Suppose that $\ell_n^\omega < \ell$.  By Lemma \ref{H}, this implies $\ell_n\ell < \ell$.  Let $s$ be the shortest (not necessarily proper) suffix of $\ell_n$ such that $s\ell$ is minimal.  Note that we have $s\ell \leq \ell_n\ell < \ell$, so $s$ is nonempty.  However, by construction we have $s\ell \leq s'\ell$ for every suffix $s'$ of $s$. Notably, $s\ell\leq \ell\leq\ell'$ for any suffix $\ell'$ of $\ell$ because $\ell$ is generalized Lyndon. Thus $s\ell$ is generalized Lyndon.  This contradicts our choice of $\ell$ to be the first generalized Lyndon suffix of $w$. Therefore $\ell_n^\omega \geq \ell$, so we have produced a nonincreasing factorization of $w$.

By Theorem \ref{G}, any factorization of $w$ must have only finitely many terms. Let $\ell_1, \dots, \ell_n \ell$ be a nonincreasing factorization of $w$ into generalized Lyndon words.  Suppose, seeking a contradiction, that $\ell$ is not the longest generalized Lyndon suffix of $w$, i.e., there is a suffix $s$ of $w$ of the form $u\ell_{j+1}\cdots\ell_n\ell$ where $u$ is a suffix of $\ell_j$.  From the nonincreasing property of the factorization $w$ and the generalized Lyndon property of $\ell_j$, we know $u^\omega \geq \ell_j^\omega \geq \cdots \geq \ell_n^\omega \geq \ell$.  By Lemma \ref{C1}, $(u\ell_j)^\omega \geq \ell_j^\omega$.  Inductively, we find $(u\ell_j\cdots\ell_n)^\omega \geq \ell_n^\omega \geq \ell$.  Thus,  by Lemma \ref{H}, we have $s = u\ell_j\cdots\ell_n\ell \geq \ell$, contradicting that $s$ is generalized Lyndon.

Now that we have uniquely determined $\ell$, the other factors $\ell_1,\dots,\ell_n$ are uniquely determined.  This follows because the prefix $w[1, |\ell_1|+\cdots + |\ell_n|]$ of $w$ has a unique nonincreasing factorization into generalized Lyndon words.  Thus by our initial assumption that $\ell_1, \dots, \ell_n, \ell$ is a nonincreasing factorization of $w$, the unique factorization of $w[1, |\ell_1|+\cdots + |\ell_n|]$ must be $\ell_1, \dots, \ell_n$.
\end{proof}
\section{Existence of Infinite Factorizations}\label{4}

In this section, we describe a method to construct an infinite factorization of a word with no generalized Lyndon suffix by taking a limit of the finite factorizations of some of its prefixes.

\begin{lemma}\label{A}
If a primitive infinite word has infinitely many generalized Lyndon prefixes, then it is a generalized Lyndon word.
\end{lemma}
\begin{proof}
Let $w$ be a primitive word which is not infinite generalized Lyndon, and let $m\in \mathbb{N}$ be minimal such that $w[m,\infty) < w$.  Let $i$ be the index of comparison between $w[m,\infty)$ and $w$.  Then for any $n \geq m + i$, we have $w[m,n] \sim w[m,\infty) < w \sim w[1,n]$ with a comparison at index $i$.  Thus $w[1,n]$ is not generalized Lyndon for any $n \geq m+i$, so we can conclude that $w$ has finitely many generalized Lyndon prefixes.
\end{proof}

\begin{lemma}\label{M}
If $\ell$ is a finite word that is not generalized Lyndon, then $\ell^\omega$ has finitely many generalized Lyndon prefixes.
\end{lemma}
\begin{proof}
If $\ell$ is not generalized Lyndon, then we can write $\ell = uv$ where $vu < uv$ for some prefix $u$.  Observe that $vu$ will be a factor of any prefix of $\ell^\omega$ having length at least $|\ell| + |u|$, and $uv$ will be a prefix of any such prefix of $\ell^\omega$.  Thus any prefix of $\ell^\omega$ having length at least $|\ell| + |u|$ is not generalized Lyndon.
\end{proof}

\begin{theorem}\label{N}
An infinite word has a nonincreasing factorization into generalized Lyndon words.
\end{theorem}
\begin{proof}
Fix an infinite word $w$.  Theorem \ref{L} completes the proof in the case that $w$ has an infinite generalized Lyndon suffix.  So we can assume that $w$ has no infinite generalized Lyndon suffix.  In particular, $w$ is not generalized Lyndon.

We will first consider the case where $w$ is not eventually periodic.  Since $w$ is not generalized Lyndon, Lemma \ref{A} implies that $w$ has finitely many generalized Lyndon prefixes.   Thus one of its generalized Lyndon prefixes must appear in the factorization of $w[1,n]$ yielded by Theorem \ref{C3} for infinitely many $n \in \mathbb{N}$.  Let $\ell_1$ be such a prefix, and let $w = \ell_1w_1$.

We will now inductively construct a factorization of $w$.  Suppose we can write $w = \ell_1 \cdots \ell_k w_k$ such that each $\ell_j$ is a finite generalized Lyndon word, $\ell_1^\omega \geq \cdots \geq \ell_k^\omega$, and $w$ has infinitely many prefixes whose factorizations begin with $\ell_1, \dots, \ell_k$.  Since $w$ has no generalized Lyndon suffixes, $w_k$ is not generalized Lyndon, so it must have finitely many generalized Lyndon prefixes.  Since infinitely many prefixes of $w$ have factorizations beginning with $\ell_1, \dots, \ell_k$, one of the generalized Lyndon prefixes of $w_k$, which we label $\ell_{k+1}$, must be such that infinitely many prefixes of $w$ have factorizations beginning with $\ell_1,\dots, \ell_k, \ell_{k+1}$.  We can then write $w = \ell_1\cdots \ell_{k+1}w_{k+1}$.  Note that by construction, $\ell_k^\omega \geq \ell_{k+1}^\omega$.  By induction, we get a nonincreasing generalized Lyndon factorization $\ell_1,\ell_2,\dots$ of $w$.

Now suppose that $w$ is eventually periodic.  If $w$ is a power of a generalized Lyndon word $\ell$, we can use the factorization $w = \ell^\omega$.  Otherwise, $w$ is a power of a finite word that is not generalized Lyndon or $w$ is primitive.  In either case, Lemmas \ref{A} and \ref{M} imply that $w$ has finitely many generalized Lyndon prefixes.  We can thus apply the construction from the previous paragraph, in each step yielding a factorization of $w$ starting with $\ell_1,\cdots, \ell_k$.  This process will halt only if $w_k$ has infinitely many generalized Lyndon prefixes $p_i$ such that $\ell_1, \dots, \ell_k, p_i$ is the factorization of a prefix of $w$.  By Lemmas \ref{A} and \ref{M}, this implies that $w_k$ is a power of a generalized Lyndon word $\ell$.  Moreover, since the $p_i$'s have unbounded length and  $\ell_k^\omega \geq p_i^\omega$, we must have $\ell_k^\omega \geq \ell^\omega$.  Therefore $\ell_1, \dots, \ell_k, \ell^\omega$ is a factorization of $w$.  Thus, in any case, this construction yields a nonincreasing factorization of $w$ into generalized Lyndon words.
\end{proof}

\section{Uniqueness of Infinite Factorizations}\label{5}

We will determine the uniqueness of the factorization constructed in Section \ref{4}, handling first the eventually periodic words and then aperiodic words with no generalized Lyndon suffix.

\begin{theorem}\label{O}
An eventually periodic infinite word has a unique nonincreasing factorization into generalized Lyndon words.
\end{theorem}
\begin{proof}
Fix an infinite word $w$ with a periodic suffix.  Observe that this implies we can write $w$ as $u\ell^\omega$ where $u$ is a (possibly empty) finite word and $\ell$ is a nonempty finite generalized Lyndon word. We may assume $w$ has no generalized Lyndon suffix, as this case is handled by Theorem \ref{L}.

We first claim that the factorization (from Theorem \ref{N}) of $w = \prod_{i=1}^\infty \ell_i$ must terminate with $\ell^\omega$. Since $\ell$ is generalized Lyndon hence not equal to any of its rotations, we have that $\ell^\omega[i,\infty) = \ell^\omega$ if and only if $i-1$ is an integer multiple of $|\ell|$.  Moreover, if $i-1$ is not a multiple of $|\ell|$, then $\ell^\omega[i,\infty)$ is a power of a word which is not generalized Lyndon and hence has finitely many generalized Lyndon prefixes by Lemma \ref{M}.  If one of these generalized Lyndon prefixes, $\ell'$, appears infinitely many times in the factorization of $w$, then $(\ell')^\omega$ is a suffix of $w$. Since $(\ell')^\omega$ and $\ell^\omega$ are suffixes of $w$, they are powers of rotations of $\ell$ and $\ell'$, respectively. Because $\ell$ and $\ell'$ are generalized Lyndon, this means that $\ell=\ell'$.  That is, only finitely many terms of the factorization are not equal to $\ell$.  Thus, we can conclude $\ell_i = \ell$ for sufficiently large $i$.

Now suppose $\ell_1, \dots, \ell_n, \ell^\omega$ and $h_1, \dots,  h_m, \ell^\omega$ are two distinct factorizations of $w$.  Note that $|\ell_1\cdots\ell_n| - |h_1\cdots h_m|$ must be an integer multiple of $|\ell|$, as $\ell$ is a generalized Lyndon word and hence not equal to any of its rotations.  Without loss of generality, assume $|\ell_1\cdots\ell_n| - |h_1\cdots h_m|>0$.  In this case, there exists $k \in \mathbb{N}$ such that $\ell_1\cdots \ell_n = h_1\cdots h_m \ell^k$, which violates the uniqueness of the nonincreasing generalized Lyndon factorization for finite words from Theorem \ref{C3}.  Thus, the nonincreasing factorization of $w$ into generalized Lyndon words is unique.
\end{proof}

\begin{lemma}\label{U}
Let $w = v\ell_1\ell_2\cdots \ell_n u$ be a finite generalized Lyndon word where $n \in \mathbb{Z}_{\geq 0}$, $\ell_i$ is a finite generalized Lyndon word for all $i\in \{1,\ldots,n\}$, $v$ is a suffix of a finite generalized Lyndon word $\ell_0$, $u$ is a prefix of a finite generalized Lyndon word $\ell_{n+1}$, and $\ell_0^\omega \geq \ell_1^\omega \geq \cdots \geq \ell_{n+1}^\omega$. Then $u \sim v$ and $u\sim v \sim \ell_i\cdots \ell_n u$ for all $i \in \{1,\dots,n\}$.
\end{lemma}
\begin{proof}
The generalized Lyndon property of $w$ implies $u \gtrsim v$.  The nonincreasing property of the factors implies $v \sim v^\omega \geq \ell_0^\omega \geq \ell_{n+1}^\omega \sim u$. Combining these inequalities, we have $u \sim v$.

Suppose $|u| \leq |v|$.  The generalized Lyndon property of $w$ and the nonincreasing property furthermore implies
$$\ell_n u \gtrsim v \sim u \sim v \sim v^\omega \geq \ell_0^\omega \geq \ell_n^\omega.$$
Hence Lemma \ref{J} implies that $u \sim \ell_n^\omega$, so $\ell_n u \sim u$.  Repeating this process, we can conclude $u \sim v \sim \ell_n u \sim \ell_{n-1}\ell_n u \sim \cdots \sim  \ell_1\cdots \ell_n u$.

Similarly, suppose $|u| > |v|$.  The generalized Lyndon property of $w$ and the nonincreasing property  implies
$$\ell_n v \sim \ell_n u \gtrsim v \sim v^\omega \geq \ell_0^\omega \geq \ell_n^\omega.$$
Hence Lemma \ref{J} implies that $v \sim \ell_n^\omega$, so $v \sim \ell_n v \sim \ell_n u$.  Repeating this process, we can conclude $v \sim u \sim  \ell_n u \sim \ell_{n-1}\ell_n u \sim \cdots \sim \ell_1\cdots \ell_n u$.
\end{proof}

\begin{lemma}\label{Q}
Let $w$ satisfy the hypotheses of Lemma \ref{U}. If $|u| \geq |v|$, then there exists some $m$ with $0\leq m \leq n$ such that
$$
\ell_j =
\begin{cases}
v & \text{ if } 1\leq j \leq m\\
v^{\alpha_j} \text{ for some } \alpha_j \in (0,1) & \text{ if } m < j \leq n.
\end{cases}
$$
\end{lemma}
\begin{proof}
We assume that $\ell_j = v$ for $1\leq j\leq k$ with $0\leq k\leq n-1$ and proceed by induction on $k$. Note that the base case of $k=0$ is automatic. Furthermore, we suppose there exists $m$ with $0\leq m\leq n$ that satisfies the property of Lemma 8 when we restrict to considering $\ell_j$ with $j\leq k$. Note that we can have $m \geq k$. By Lemma \ref{U}, we have $\ell_{k+1} \sim u \sim v$ and $|v| \leq |u|$, hence $\ell_{k+1} \sim v$. Thus, if $|\ell_{k+1}| < |v|$, then we are done.

Suppose $m < k$ and $|\ell_{k+1}| \geq |v|$, so $v$ is a prefix of $\ell_{k+1}$.  Let $\ell_{m+i} = v^{\alpha_{i}}$ for $1 \leq i \leq k-m$, where each $\alpha_{i} \in (0,1)$.  Let $t = k-m$.  Thus
$v\ell_1\cdots\ell_k \ell_{k+1} \sim v^k v^{\alpha_1}\cdots v^{\alpha_{t}} v$.  By Lemma \ref{U}, we have $v \sim u \sim v^{\alpha_2}\cdots v^{\alpha_{k-m}} v$, so $v^{\alpha_1} v$ is a factor of $w$.  Since $vv^{\alpha_1}$ is a prefix of $w$, by the generalized Lyndon property we have $v^{\alpha_1}v \geq vv^{\alpha_1}$.  On the other hand, we have $v^\omega \geq \ell_0^\omega \geq \ell_{m+1}^\omega = (v^{\alpha_1})^\omega$,
 which implies $v^\omega \geq (v^{\alpha_1} v)^\omega$ by Lemma \ref{C1}.  In particular, we have $vv^{\alpha_1} \geq v^{\alpha_1}v$.  Combining inequalities yields $vv^{\alpha_1} = v^{\alpha_1}v$, implying $v$ is a power of $v^{\alpha_1}$ by Corollary \ref{I}. Thus $$(v^{\alpha_1})^\omega=v^\omega\geq \ell_0^\omega\geq \ell_{m+1}^\omega=(v^{\alpha_1})^\omega,$$ so Corollary \ref{I} and Lemma \ref{C1} imply $\ell_0=v^{\alpha_1}=v$. This contradicts our choice of $m$, hence $|\ell_{k+1}| < |v|$ and $\ell_{k+1} \sim v$, as desired.

 In the other case, we need to consider is $|\ell_{k+1}| > |v|$ and $m \geq k$.  Let $\ell_{k+1} = v^r v^\alpha$ for $r \in \mathbb{N}$ and $\alpha \in (0,1)$, noting that $r + \alpha \not\in \mathbb{N}$ since $\ell_{k+1}$ is generalized Lyndon, and hence primitive.  If $k + 1 = n$ or if $|\ell_{k+2}| \geq v$, then $\ell_{k+1}v$ is a factor of $w$.  Note by our inductive hypothesis that $v^rvv^\alpha$ is a prefix of $w$.  By the generalized Lyndon property, we have $v^rv^\alpha v \geq v^r vv^\alpha$.  However, we also have
 $$v^rv^\alpha v \sim (v^rv^\alpha)^\omega = \ell_{k+1}^\omega \leq \ell_0^\omega \leq v^\omega \sim v^rvv^\alpha.$$
 Combining inequalities yields $v^rv^\alpha v = v^rv v^\alpha$, implying $v$ is a power of $v^{\alpha}$ by Corollary \ref{I}. This means $\ell_{k+1}=v^rv^\alpha$ is a power of $v^\alpha$, contradicting the primitiveness of $\ell_{k+1}$, so we must have $k < n-1$ and $|\ell_{k+2}| < |v|$.  Since we assume $|u| > |v|$, there must exist some $q \in \{k+2,\dots,n\}$ such that $|\ell_q| < n$ and $\ell_q\ell_{q+1}\cdots \ell_n u \sim \ell_q v$. Notably, the largest value of $q$ such that $|\ell_q|<n$ works.  Then $v\ell_q$ is a prefix of $w$, and $\ell_q v$ is a factor of $w$. By the generalized Lyndon property of $w$ and our inductive hypothesis, we have $\ell_q v \geq v\ell_q$.  However, we also have $\ell_q^\omega \leq \ell_0^\omega \leq  v^\omega$, hence $(\ell_qv)^\omega \leq v^\omega$ by Lemma $\ref{C1}$.  In particular, $\ell_qv \lesssim vv \sim v\ell_q$.  Again, we combine inequalities and use Corollary \ref{I} and Lemma \ref{C1} to conclude $\ell_q = v$, our final contradiction.
\end{proof}

\begin{lemma}\label{S}
If $w$ satisfies the hypotheses of Lemma \ref{U}, then $\ell_1 = \cdots = \ell_n = v$.
\end{lemma}
\begin{proof}
It is enough to show that $\ell_n = v$, since $v^\omega \geq \ell_0^\omega \geq \ell_i^\omega \geq \ell_n^\omega= v^\omega$.  If $\ell_n \not= v$, then by Lemma \ref{Q}, we have $\ell_n = v^\alpha$ for some $\alpha \in (0,1)$.  Moreover, by Lemma \ref{U} and our assumption $|u| \geq |v|$, we have $\ell_1\dots\ell_nu \sim v$, hence $w = v\ell_1\dots\ell_nu \sim vv$.  Thus, $v^\alpha v$ is a factor of $w$ and $vv^\alpha$ is a prefix, so the generalized Lyndon property of $w$ implies $vv^\alpha \leq v^\alpha v$.  Since we have $(v^\alpha)^\omega = \ell_n^\omega \leq \ell_0^\omega \leq v^\omega \sim v \lesssim v^\alpha v,$
Lemma \ref{J} implies $v \sim (v^\alpha)^\omega$.  In particular, $v^\alpha v \sim (v^\alpha)^\omega  \leq v^\omega \sim v v^\alpha$.  Combining inequalities, we have $vv^\alpha \leq v^\alpha v$.  This implies $v$ is a power of $v^\alpha$ by Corollary \ref{I}.  Thus $(v^\alpha)^\omega = v^\omega \geq \ell_0^\omega \geq \ell_n^\omega = (v^\alpha)^\omega$. In particular $\ell_0^\omega = v^\omega$, which implies $v = \ell_0$ by the generalized Lyndon property of $\ell_0$.  Therefore $v = \ell_0 = v^\alpha$, contradicting our choice of $\alpha$.
\end{proof}

\begin{corollary}\label{T}
Let $w$ be as in the statement of Lemma \ref{S}.  If we additionally assume that $v$ is a proper suffix of $\ell_0$ and $n \geq 1$, then $|u| < |v|$.
\end{corollary}
\begin{proof}
    By Lemma \ref{S}, we have $\ell_1 = \ell_2 = \cdots = \ell_n = v$.  Since $v$ is a proper suffix of $\ell_0$, we have $v^\omega > \ell_0^\omega$.  Thus $v^\omega > \ell_0^\omega \geq \ell_1^\omega = v^\omega$, which is a contradiction.
\end{proof}

\begin{theorem}\label{R}
 An aperiodic infinite word with no generalized Lyndon suffix has a unique nonincreasing factorization into finite generalized Lyndon words.
\end{theorem}
\begin{proof}
Suppose $w$ is an aperiodic word with no generalized Lyndon suffix such that $w$ has two distinct nonincreasing factorizations into generalized Lyndon words.  Note that each factor in both factorizations must be finite.  We can remove any initial common factors, so without loss of generality $w = \prod_{i=0}^\infty w_i = \prod_{j=0}^\infty \ell_j$ where $w_i^\omega \geq w_{i+1}^\omega$ for all $i \in \mathbb{Z}_{\geq 0}$, $\ell_j^\omega \geq \ell_{j+1}^\omega$ for all $j \in \mathbb{Z}_{\geq 0}$, and $|w_0| >  |\ell_0|$. Since we know finite words have unique nonincreasing generalized Lyndon factorizations from Theorem \ref{C3}, we have $\prod_{i=0}^x w_i \not= \prod_{j=0}^y \ell_j $ for any $x,y \in \mathbb{Z}_{\geq 0}$.
\vspace{-0.3in}
\begin{figure}[h]
\centering
\includegraphics[width = 4.5 in]{ly.pdf}
\caption[Figure 1.]{The construction of $v_k$, $\ell_{j_k}$, $w_{i_k}$, and $u_k$}
\label{fig1}
\end{figure}
\vspace{-.2in}

Define $v_0 = \ell_0$, $\ell_{j_0} = \ell_0$, and $w_{i_0} = w_0$. We define $j_{k+1}$ to be the unique integer such that $w_{i_k}$ can be written as $v_k \ell_{j_k + 1} \cdots \ell_{j_{k+1} - 1} u_k$, where $u_k$ is a prefix of $\ell_{j_{k+1}}$.  We define $i_{k+1}$ to be the unique integer such that $\ell_{j_{k+1}}$  can be written as $u_k w_{j_k + 1}\cdots w_{j_{k+1}-1} v_{k+1}$, where $v_{k+1}$ is a prefix of $w_{j_{k+1}}$.  This construction is illustrated in Figure \ref{fig1}.  Observe that for each $k \in \mathbb{Z}_{\geq 0}$ we have that $v_k$ is a proper prefix of $w_{i_k}$, $u_k$ is a proper suffix of $w_{i_k}$, $u_k$ is a proper prefix of $\ell_{j_{k+1}}$, and $v_{k+1}$ is a proper suffix of $\ell_{j_{k+1}}$.

We aim to show that $|v_{k+1}| < |v_k|$ for each $k \in \mathbb{Z}_{\geq 0}$, and since this reduction can only be applied finitely many times, we will reach a contradiction.  Assume not, that $|v_{k+1}| \geq |v_k|$ for a certain $k \in \mathbb{Z}_{\geq 0}$.

 First suppose that $|u_k| \geq |v_k|$, and note that we cannot have $u_k$ be a power of $v_k$  or $u_k = v_k$, or else $w_{i_k}$ is not primitive by Lemma \ref{S}. Thus Lemmas \ref{S} and \ref{U} imply that $u_k = v_k^r v_k^\alpha$ for some $r \in \mathbb{N}$ and $\alpha \in (0,1)$.   Moreover, Corollary \ref{T} implies that $w_{i_k} = v_k u_k$.   Lemma \ref{U} implies that $v_k \sim u_k$ and $u_k \sim v_{k+1}$, hence $|v_k|\leq |u_k|, |v_{k+1}|$ implies $v_k \sim v_{k+1}$. Furthermore, Lemma \ref{U} yields  $v_k \sim v_{k+1} \sim w_{i_{k}+1}\cdots w_{i_{k+1}-1}v_{k+1}$, so $u_kw_{i_{k}+1}\cdots w_{i_{k+1}-1}v_{k+1} \sim v_k^rv_k^\alpha v_k$.  Thus
  $$v_k^rv_kv_k^\alpha \sim v_k^\omega \geq \ell_{j_k}^\omega = (u_kw_{i_k+1} \cdots w_{i_{k+1}-1}v_{k+1})^\omega \sim v_k^rv_k^\alpha v_k.$$
  However, by the generalized Lyndon property of $w_{i_k}$ and Lemma \ref{Q}, we also have
$$v_k^rv_k^\alpha v_k \sim (v_k^r v_k^\alpha)^\omega =  u_k^\omega \geq (v_k\ell_{j_k + 1}\dots\ell_{j_{k+1} -1})^\omega = v_k^\omega \sim v_k^r v_k v_k^\alpha.$$
Combining inequalities yields $v_k^rv_k^\alpha v_k = v_k^r v_k v_k^\alpha$, which implies that $v_k$ and $v_k^\alpha$ are powers of a common word by Lemma \ref{C2}.  Thus $w_{i_k}$ is not primitive, contradicting that it is generalized Lyndon.  So in this case we have $|v_{k+1}| < |v_k|$.

Now suppose $|u_k| < |v_k|$.  By the generalized Lyndon property of $w_k$, we have $v_k \lesssim u_k$.  The nonincreasing property of our factors implies $u_k \sim \ell_{j_{k+1}}^\omega \leq \ell_{j_k}^\omega \leq v_k^\omega \sim v_k.$
Hence $v_k \sim u_k$, so $u_k = v_k^\alpha$ for some $\alpha \in (0,1)$.  Since $|u_k| < |v_k| \leq |v_{k+1}|$, Corollary \ref{T} applies to $\ell_{j_k}$.  In particular, $\ell_{j_{k+1}} = u_kv_{k+1}$.
By the generalized Lyndon property of $w_{i_k}$ and $\ell_{j_{k+1}}$ along with Lemma \ref{C1}, we have
$$(v_k^\alpha)^\omega = u_k^\omega \geq w_{i_k}^\omega \geq w_{i_{k+1}}^\omega \sim v_{k+1} \sim v_{k+1}^\omega \geq u_k^\omega = (v_k^\alpha)^\omega.$$
Hence $v_{k+1} \sim (v_k^\alpha)^\omega$.  Note that $v_k \sim w_{i_k}^\omega$, so we also have $v_k \sim v_{k+1} \sim (v_k^\alpha)^\omega$.  On the one hand, we have
$$v_k^\alpha v_k \sim u_kv_{k+1} = \ell_{j_{k+1}} \sim \ell_{j_{k+1}}^\omega \leq \ell_{j_k}^\omega \leq v_k^\omega \sim v_kv_k^\alpha.$$
However, the generalized Lyndon property of $w_1$ and Lemma \ref{U} imply
$$v_k^\alpha v_k = u_kv_k \sim u_kv_k \ell_{j_k + 1}\cdots \ell_{j_{k+1} - 1} \gtrsim v_k \ell_{j_k + 1}\cdots \ell_{j_{k+1} - 1} u_k \sim v_k u_k = v_k^\alpha v_k.$$
Therefore $v_k^\alpha v_k =  v_kv_k^\alpha$, which implies $v_k$ and $v_k^\alpha$ are powers of a common word.  However, we reach our final contradiction by noting that $\ell_{j_{k+1}}$ is not primitive, contradicting that it is generalized Lyndon.
\end{proof}

\begin{theorem}
Every infinite word has a unique factorization into a nonincreasing product of generalized Lyndon words.
\end{theorem}
\begin{proof}
This follows directly from Theorems \ref{L}, \ref{O}, and \ref{R}.
\end{proof}

\section{Characterization of Infinite Generalized Lyndon Words}\label{6}
Siromoney et al. showed in \cite{SMDS} that the infinite Lyndon words are precisely the limits of prefix-preserving increasing sequences of finite Lyndon words.  We show that this result still holds when Lyndon words are replaced with generalized Lyndon words provided that the infinite word is primitive.

\begin{theorem}
A primitive infinite word is generalized Lyndon if and only if it has infinitely many generalized Lyndon prefixes.
\end{theorem}
\begin{proof}
Lemma \ref{A} handles the reverse direction. Suppose that there exists an infinite generalized Lyndon word $w$ with finitely many generalized Lyndon prefixes.  Since $w$ has infinitely many prefixes, one of its generalized Lyndon prefixes must appear in the unique nonincreasing generalized Lyndon factorizations (from Theorem \ref{C3}) of infinitely many of the prefixes of $w$.

We will now use the method presented in the proof of Theorem \ref{N} to construct a nontrivial factorization of $w$, contradicting the result of Theorem \ref{L}.   Suppose that $w = \ell_1 \dots \ell_n w_n$ where $\ell_j$ is a finite generalized Lyndon word and $\ell_1^\omega \geq \ell_2^\omega\geq \ell_{n}^\omega>w_n$. Further suppose that $w$ has infinitely many prefixes with factorizations beginning with $\ell_1, \dots, \ell_n$.  If $w_n$ is not generalized Lyndon, the process proceeds as in Theorem \ref{N}.

Suppose $w_n$ is generalized Lyndon.  If we can choose a generalized Lyndon prefix $\ell_{n+1}$ of $w_n$ such that infinitely many prefixes of $w$ have factorizations beginning with $\ell_1, \dots, \ell_n, \ell_{n+1}$, then the process can continue.  Otherwise, there must be infinitely many prefixes $p$ of $w_n$ such that $\ell_1, \dots, \ell_n, p$ is a factorization of a prefix of $w$.  In particular, we have that $p^\omega \leq \ell_n^\omega$ for infinitely many prefixes of $p$.  Taking the limit of these prefixes, we find that $w_n \leq \ell_n^\omega$.  Thus, $\ell_1, \dots, \ell_n, w_n$ is a nontrivial factorization of $w$, contradicting Theorem $\ref{L}$.

Therefore either the process terminates and produces a nontrivial finite generalized Lyndon factorization of $w$, or it continues indefinitely and produces a nonincreasing generalized Lyndon factorization of $w$.  Either case contradicts Theorem \ref{L}, so $w$ must have infinitely many generalized Lyndon prefixes.
\end{proof}

We cannot hope this result extends to the case where the infinite word is not primitive. For example, consider $(01)^\omega$ under the alternating order.  It has infinitely many Galois prefixes, namely the prefixes of the form $(01)^k 0$ for any $k \in \mathbb{N}$, but $01$ is not Galois.

\section{Further Directions}

Theorem \ref{S} shows that infinite generalized Lyndon words have infinitely many generalized Lyndon prefixes.  But which finite generalized Lyndon words can arise as Lyndon prefixes?  It is straightforward to see that if the alphabet $A$ is finite, then the maximum $1$-letter word will not arise as a prefix of any infinite generalized Lyndon word. However, we conjecture that every other finite generalized Lyndon word is extendable to an infinite generalized Lyndon word.

\begin{conjecture}
Every finite generalized Lyndon word of length at least $2$ is a prefix of an infinite generalized Lyndon word.
\end{conjecture}

Observe that every finite Lyndon word can be extended to an infinite Lyndon word by appending an $\omega$-power of the maximum letter.  However, in the generalized case there is no notion of a maximal letter appearing in a word.  Moreover, there exist finite generalized Lyndon words which cannot be extended to infinite generalized Lyndon words by appending a power of a letter.  For example, $01000010$ is a Galois word but $01000010(0^{\omega})$ and $01000010(1^\omega)$ are not Galois.  The Galois word $01000010$ is still extendable to an infinite Galois word by appending a slightly more complicated suffix, e.g., $01^\omega$.  Given an infinite word $w$, it may be interesting to characterize which finite generalized Lyndon words are extendable to an infinite generalized Lyndon word by appending $w$.

Given that every word has a unique nonincreasing factorization into generalized Lyndon words, one may wish to characterize or compute this factorization. For example, given a simple representation (e.g. a finite expression of products and powers) of an infinite word and a generalized lexicographical ordering, one may wish to compute the factorization of the word in polynomial time.

In a different direction, the existence and uniqueness of a factorization of a general transfinite (ordinally indexed) word into Lyndon words is proved in \cite{BC}. It remains to be seen whether this factorization theorem still holds when using generalized Lyndon words. Lastly, one may seek a general characterization of the first factor in a generalized Lyndon factorization along the lines of \cite{Ufn}. While simple characterizations such as longest Lyndon prefix fail, there may be a more clever characterization lurking in the background.

\section{Acknowledgements}
We extend our thanks to the anonymous referees for their detailed comments.  The paper was greatly improved by their suggestions.

Combinatorics (math.CO); Discrete Mathematics (cs.DM)