\section{Introduction}

The motivation of this work comes from the study of mirror symmetry.
Mirror symmetry is a conjectural duality between Calabi-Yau manifolds.
A particular type of torus fibration, called \emph{SYZ fibration}, plays an important role in the subject (cf.\ \cite{SYZ_1996}).
The enumerative geometry of an SYZ fibration associated to a Calabi-Yau manifold is intimately related to the construction of its mirror manifold.
More precisely, we are interested in counting open holomorphic curves with boundaries on the torus fibers of SYZ fibrations.
Remarkable progresses are made in this direction, notably by Fukaya, Oh, Ohta, Ono and many others (cf.\ \cite{Fukaya_Lagrangian_intersection_2009,Fukaya_Lagrangian_Floer_2012}).
However, there is a fundamental difficulty in the story:
One observes that in general, the numbers from open curve counting are not invariants.
They depend on various choices.

In order to overcome this difficulty, in \cite{Yu_Enumeration_cylinders_2015}, we explored a new approach using non-archimedean geometry.
The counting of holomorphic cylinders was obtained for log Calabi-Yau surfaces.
The key idea was to relate the counting of cylinders to the counting of particular types of rational curves.
Since the approach was rather indirect, and went through the mysterious non-archimedean geometry,
it is a priori unclear whether we have obtained the \emph{right} invariants.

In this paper, we prove three fundamental properties of these invariants, indicating that these invariants really reflect open curve counting.
The three properties are positivity, integrality and the gluing formula.
Positivity and integrality assert that the numbers of cylinders, defined via virtual techniques, are in fact nonnegative integers.
The gluing formula roughly says that cylinders can be glued together to form longer cylinders, and the number of longer cylinders equals the product of the numbers of shorter cylinders.
In fact, we count cylinders with boundaries on fibers of (non-archimedean) SYZ torus fibrations.
Given three torus fibers $F_1, F_2, F_3$, we are interested in counting cylinders going from $F_1$ to $F_2$, going from $F_2$ to $F_3$, and going from $F_1$ to $F_3$.
The gluing formula claims that the number of cylinders going from $F_1$ to $F_3$ passing through $F_2$ is equal to the product of the number of cylinders going from $F_1$ to $F_2$ and the number of cylinders going from $F_2$ to $F_3$.

\bigskip
Let us now give the precise statements of our theorems.

Let $(Y,D)$ be a Looijenga pair, i.e.\ a connected smooth complex projective surface $Y$ together with a singular nodal curve $D$ representing the anti-canonical class $-K_Y$.
Let $k\coloneqq\mathbb C(\!( t)\!)$ be the field of formal Laurent series.
Let $X\coloneqq Y\setminus D$, $X_k\coloneqq X\otimes_\mathbb C k$, and let $X^\mathrm{an}_k$ be the analytification in the sense of Berkovich (cf.\ \cite{Berkovich_Spectral_1990}).
We have a non-archimedean SYZ fibration $\tau\colon X^\mathrm{an}_k\to B$, where $B$ is a singular $\mathbb Z$-affine\xspace manifold homeomorphic to $\mathbb R^2$.

A \emph{spine} $L$ in $B$ is a triple $\big(\Gamma,(v_1,v_2),h\colon\Gamma\to B\big)$ where $\Gamma$ is a chain of segments, $(v_1,v_2)$ are the two endpoints of the chain, and $h$ is a piecewise linear map.
Here we omit some technical conditions on $L$ (cf.\ \cref{def:spine}).
Given a spine $L$ in $B$ and a curve class $\beta\in\NE(Y)$, we constructed in \cite{Yu_Enumeration_cylinders_2015} the number of holomorphic cylinders $N(L,\beta)$ associated to $L$ and $\beta$.

\begin{thm}[Positivity and integrality, cf.\ \cref{thm:degree}]\label{thm:positivity_integrality}
	The number $N(L,\beta)$ of holomorphic cylinders associated to the spine $L$ and the curve class $\beta$ is a nonnegative integer.
\end{thm}

In order to state the gluing formula, we start with two spines
\begin{align*}
& L^1 = \big(\Gamma^1, (v^1_1, v^1_2),\ h^1\colon\Gamma^1\to B\big),\\
& L^2 = \big(\Gamma^2, (v^2_1, v^2_2),\ h^2\colon\Gamma^2\to B\big).
\end{align*}
Let $e^1_2$ denote the edge of $\Gamma^1$ connected to the vertex $v^1_2$;
let $e^2_1$ denote the edge of $\Gamma^2$ connected to the vertex $v^2_1$.
Assume $h^1(v^1_2)=h^2(v^2_1)$ and $w_{v^1_2}(e^1_2)+w_{v^2_1}(e^2_1)=0$,
where $w_\cdot(\cdot)$ denotes the tropical weight vector.
So we can glue $L^1$ and $L^2$ at the vertices $v^1_2$ and $v^2_1$, and form a new spine $L^3$ (cf.\ \cref{fig:L3}).
Let $\beta^3\in\NE(Y)$ be a curve class.

\begin{figure}[!ht]
	\centering
	\setlength{\unitlength}{0.5\textwidth}
	\begin{picture} (1,0.32)
	\put(0,0){\includegraphics[width=\unitlength]{images/L3}}%
	\put(0.0,0.12){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^1_1$}}}%
	\put(0.44,0.275){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^1_2$}}
	\put(0.36,0.262){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$e^1_2$}}
	\put(0.44,0.18){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^2_1$}}
	\put(0.52,0.278){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$e^2_1$}}
	\put(0.99,0.01){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^2_2$}}}%
	\put(0.2,0.18){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$L_1$}}}%
	\put(0.72,0.24){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$L_2$}}}%
	\put(0.5,0.11){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$L_3$}}}%
	\end{picture}
	\caption{The spines $L^1$, $L^2$ and $L^3$.}
	\label{fig:L3}
\end{figure}

\begin{thm}[Gluing formula]\label{thm:gluing_formula}
	We have the following gluing formula:
	\[ \sum_{\beta^1+\beta^2=\beta^3} N(L^1,\beta^1)\cdot N(L^2,\beta^2) = N(L^3,\beta^3) .\]
\end{thm}

We use a combination of techniques from tropical geometry, Berkovich geometry, deformation theory and Gromov-Witten theory.
The proof of the positivity and integrality is based on three main ideas: First, the cylinder counts are invariant under deformations of the Looijenga pair $(Y,D)$; Second, for generic $(Y,D)$ in the deformation space, no bubbling can occur for our holomorphic cylinders in question; Third, by the deformation theory of rational curves in surfaces (cf.\ \cite{Keel_Rational_curves_1999}), we deduce that the moduli space responsible for our counting is generically smooth and of expected dimension.

For the proof of the gluing formula, we need to study carefully the moduli space of tropical curves and the corresponding moduli space of analytic curves.
We will rely on the work of Abramovich-Caporaso-Payne \cite{Abramovich_Tropicalization_2012} and the author's previous work \cite{Yu_Tropicalization_2014}.
This allows us to reduce the gluing formula for cylinders to a formula concerning particular types of rational curves.
The latter is a refinement of the associativity relations of Gromov-Witten invariants.
A main ingredient of our proof consists of degenerating the domain curve in different ways.
Comparing with the algebraic case, we need to take extra care of the properness of various moduli spaces in the proofs.

The results of this paper give us a deeper understanding of open curve counting of log Calabi-Yau surfaces.
They provide evidence that our cylinder counts obtained via Berkovich geometry satisfy expected properties and reflect honest open curve enumeration.
The counting of cylinders is intimately related to the combinatorial notion of broken line in the work of Gross-Hacking-Keel \cite{Gross_Mirror_Log_published}\footnote{The notion of broken line in general was developed by Gross, Hacking, Keel, Siebert and their coauthors in a series of papers \cite{Gross_Mirror_symmetry_for_P2_2010,Carl_A_tropical_view_2010,Gross_Mirror_Log_published,Gross_Theta_2012,Gross_Theta_2015}. It was also suggested by Abouzaid, Kontsevich and Soibelman in different occasions}.
The positivity, integrality and the gluing formula proved in this paper suggest a precise conjectural relation with broken lines which we state below:

Let $\gamma$ be a broken line in $B$ for the canonical scattering diagram in the sense of \cite{Gross_Mirror_Log_published}.
Let us use the notations of Section 2.3 in loc.\ cit..
Let $\alpha$ be any negative number such that $(-\infty,\alpha]$ is a proper subset of the unique unbounded domain of linearity of $\gamma$.
Then the restriction of $\gamma$ to the interval $[\alpha,0]$ gives rise to a spine in $B$, which we denote by $L_\gamma$.
Let $c\cdot z^q$ denote the monomial attached to the last domain of linearity of $\gamma$.
Write $q=\beta+\lambda$ for $\beta\in\NE(Y)$ and $\lambda\in\Lambda_{\gamma(0)}$.

\begin{conj}
	The number $N(L_\gamma,\beta)$ of holomorphic cylinders associated to the spine $L_\gamma$ and the curve class $\beta$ is equal to the number $c$.
\end{conj}

Note that it is easy to verify the conjecture in simple cases, such as for toric $(Y,D)$.
Moreover, we would like to mention that the number $c$ is known to be a nonnegative integer via indirect combinatorial arguments (cf.\ \cite{Gross_Canonical_bases_2014}).
If the conjecture above holds, then \cref{thm:positivity_integrality} gives a geometric understanding of this fact.


\bigskip
\paragraph{\textbf{Related works}}
Besides the works already cited above, the following works are related to this paper in a broader context:  the works of Kontsevich-Soibelman \cite{Kontsevich_Homological_2001,Kontsevich_Affine_2006}, Auroux \cite{Auroux_Mirror_symmetry_anticanonical_2007,Auroux_Special_Lagrangian_fibrations_2009}, Gross-Siebert \cite{Gross_Real_Affine_2011}, Abouzaid \cite{Abouzaid_Family_2014} and Tu \cite{Tu_On_the_reconstruction_2014} on mirror symmetry, the works of Pandharipande-Solomon \cite{Pandharipande_Disk_enumeration_2008}, Welschinger \cite{Welschinger_Open_GW_2013}, Chan-Lau \cite{Chan_Open_GW_2014}, Fang-Liu \cite{Fang_Open_GW_2013}, Chan \cite{Chan_Open_GW_2012}, Nishinou \cite{Nishinou_Disk_2012}, Lin \cite{Lin_Open_GW_2014}, Brini-Cavalieri-Ross \cite{Brini_Crepant_resolutions_2013} and Ross \cite{Ross_Localization_and_gluing_of_orbifold_amplitudes_2014} on open curve enumeration, and the works of Chen-Satriano \cite{Chen_Chow_quotients_2013} and Ranganathan \cite{Ranganathan_Skeletons_I_2015} on stable maps in logarithmic geometry.

\bigskip
\paragraph{\textbf{Acknowledgements}}
I am very grateful to Maxim Kontsevich for sharing with me many ideas.
I am equally grateful to Vladimir Berkovich, Antoine Chambert-Loir, Mark Gross, Bernd Siebert and Michael Temkin for valuable discussions.
The smoothness argument in \cref{sec:smoothness} I learned from Sean Keel.
I would like to thank him in particular.
This research was partially conducted during the period the author served as a Clay Research Fellow.

\section{Review of the counting of cylinders}\label{sec:review_of_cylinder_counts}

In this section, we review the construction of the counting of holomorphic cylinders in log Calabi-Yau surfaces following \cite{Yu_Enumeration_cylinders_2015}.

We start with a Looijenga pair $(Y,D)$, i.e.\ a connected smooth complex projective surface $Y$ together with a singular nodal curve\footnote{A singular nodal curve is a singular curve with at worst ordinary double point singularities.
	It is not necessarily irreducible.} $D$ representing the anti-canonical class $-K_Y$.
Let $X\coloneqq Y\setminus D$.
It is called a log Calabi-Yau surface.

Note that our initial data are all defined over the complex numbers.
We will now use non-archimedean geometry as a tool in order to extract geometric invariants from $X$.

Let $k\coloneqq\mathbb C(\!( t)\!)$ be the field of formal Laurent series.
Let $X_k\coloneqq X\otimes_\mathbb C k$, and let $X_k^\mathrm{an}$ be the analytification in the sense of Berkovich \cite{Berkovich_Spectral_1990}.

Let $l$ be the number of irreducible components of $D$.
Without loss of generality, up to passing to a toric blowup, we will assume that $l\ge 3$.
Let $(\mathbf e_1,\dots,\mathbf e_l)$ be the standard basis of $\mathbb R^l$.
Let $B$ be the (incomplete) fan in $\mathbb R^l$ consisting of $l$ one-dimensional cones given by $\mathbf e_1,\dots,\mathbf e_l$ and $l$ two-dimensional cones generated respectively by the pairs $(\mathbf e_1,\mathbf e_2), (\mathbf e_2,\mathbf e_3), \dots, (\mathbf e_l,\mathbf e_1)$.
We have a canonical continuous map $\tau\colon X^\mathrm{an}_k\to B$.
Outside the origin $O\in B$, the map $\tau$ is an affinoid torus fibration\footnote{Recall that a continuous map from a $k$-analytic\xspace space to a topological space is called an \emph{affinoid torus fibration} if locally on the target, it is isomorphic to the pullback of the coordinate-wise valuation map $\val^n\colon(\mathbb G_{\mathrm m/k}^\mathrm{an})^n\to\mathbb R^n$ along an open subset $U\subset\mathbb R^n$.} (cf.\ \cite[Proposition 3.6]{Yu_Enumeration_cylinders_2015}).
Our goal is to study the counting of holomorphic cylinders with boundaries on affinoid fiber tori.

Consider a holomorphic cylinder in $X^\mathrm{an}_k$, i.e.\ a closed annulus $C$ with two boundary points $v_1, v_2$, and a holomorphic map $f\colon C\to X^\mathrm{an}_k$.
Let $\Gamma$ be the skeleton of $C$, i.e.\ the path in $C$ connecting $v_1$ and $v_2$.
Let $h\coloneqq (\tau\circ f)|_{\Gamma}$.
It is a piecewise linear map from $\Gamma$ to $B$.
We call $(\Gamma,(v_1,v_2),h)$ the spine associated to the holomorphic cylinder.

Now fix a spine $L$ (in the sense of \cref{def:spine}) and a curve class $\beta\in\NE(Y)$; we would like to count holomorphic cylinders in $X^\mathrm{an}_k$ whose associated spine is $L$ and whose associated curve class\footnote{For simplicity, here we omit the explanations regarding curve classes.} is $\beta$.
Unfortunately, the moduli space of such holomorphic cylinders is infinite dimensional.
In order to obtain a finite number, our strategy in \cite{Yu_Enumeration_cylinders_2015} is to restrict to cylinders whose boundaries satisfy an extra regularity condition:
we require that when we make analytic continuation at the boundaries, our cylinders should extend straight to infinity in an appropriate sense.
In this way, we are able to relate the counting of cylinders to the counting of particular types of rational curves.

The way to carry out the idea above is the following:
First, using the $\mathbb Z$-affine\xspace structure on $B\setminus O$ induced by the non-archimedean SYZ fibration, we extend the spine $L$ at both ends straightly to an infinite spine $\widehat L$, which we call an extended spine.
When such an extension is possible, we call $L$ an extendable spine.
We will restrict to extendable spines only.
Note that all spines are extendable when the Looijenga pair $(Y,D)$ is positive (cf.\ \cite[Definition 6.10]{Gross_Mirror_Log_published}), in particular when $X$ is affine.

Put $\widetilde B\coloneqq\mathbb R\times B$.
The graph of the extended spine $\widehat L$ gives an extended spine $\widetilde L$ in $\widetilde B$.
We also have an associated curve class $\widetilde{\beta}$ whose explanation we omit.
Let $\widetilde Y$ be a toroidal compactification of $\mathbb G_{\mathrm m/k}\times X_k$ which has two boundary divisors $\widetilde D_1, \widetilde D_2$ corresponding to the two infinite directions of $\widetilde L$.
Let $\widetilde{\tau}\colon(\mathbb G_{\mathrm m/k}\times X_k)^\mathrm{an}\to \widetilde B$ be the map induced by $\tau\colon X^\mathrm{an}_k\to B$.
Fix a point $p$ in $(\mathbb G_{\mathrm m/k}\times X_k)^\mathrm{an}$ such that $\widetilde{\tau}(p)\in\widetilde B$ is the point in the image of $\widetilde L$ corresponding to an endpoint of $L$.
Let $\mathcal M$ be the stack of analytic stable maps into $\widetilde Y^\mathrm{an}$ of class $\widetilde{\beta}$ with three marked points, such that the first marked point maps to $\widetilde D^\mathrm{an}_1$, the second marked point maps to $\widetilde D^\mathrm{an}_2$, and the third marked point maps to $p$.
For any stable map $\big(C,(s_1,s_2,s_3),f\colon C\to\widetilde Y^\mathrm{an}\big)$ in $\mathcal M$, let $\Gamma$ be the path in $C$ connecting $s_1$ and $s_2$, and let $h\coloneqq (\widetilde{\tau}\circ f)|_{\Gamma\setminus\{s_1,s_2\}}$.
We call $(\Gamma,(s_1,s_2),h)$ the extended spine in $\widetilde B$ associated to the stable map.

Let $\mathcal M(\widetilde L)$ be the substack of $\mathcal M$ consisting of stable maps whose associated extended spine equals $\widetilde L$.
It is proved in \cite{Yu_Enumeration_cylinders_2015} that $\mathcal M(\widetilde L)$ is a proper analytic stack.
Moreover, it possesses a virtual fundamental class of dimension zero.
Finally, we define the number of holomorphic cylinders $N(L,\beta)$ associated to the spine $L$ and the curve class $\beta$ to be the degree of this virtual fundamental class.
We have shown in loc.\ cit.\ that the number $N(L,\beta)$ is well-defined, i.e.\ it does not depend on the various choices we have made during the construction, in particular the choice of the point $p$.

Above is a sketch of the construction of the number $N(L,\beta)$.
We remark that although $N(L,\beta)$ is supposed to represent the number of cylinders, its actual construction involves enumeration of rational curves and virtual fundamental classes.
Therefore, the positivity and integrality in \cref{thm:positivity_integrality} and the gluing formula in \cref{thm:gluing_formula} are not at all obvious.
In order to prove these theorems, we will start by a series of constructions in tropical geometry.
This is the subject of the next section.

\section{Tropical constructions}\label{sec:tropical_constructions}

In this section, we will make a series of constructions concerning tropical curves and tropical moduli spaces.

\begin{defin}\label{def:unbounded_tree}
	An \emph{unbounded tree} $(\Gamma,V_\infty(\Gamma))$ consists of a finite connected tree $\Gamma$ and a subset of 1-valent vertices $V_\infty(\Gamma)$ called \emph{unbounded vertices}.
	Vertices that are not unbounded are called \emph{bounded vertices}.
	We require that there is at least one bounded vertex.
\end{defin}

\begin{defin}\label{def:Zaffine_unbounded_tree}
	An \emph{unbounded $\mathbb Z$-affine\xspace tree} $(\Gamma,V_\infty(\Gamma))$ consists of an unbounded tree and
	\begin{enumerate}
		\item for every edge $e$ with two bounded endpoints, a $\mathbb Z$-affine\xspace structure\footnote{We refer to \cite[\S 2]{Yu_Enumeration_cylinders_2015} for the definition of $\mathbb Z$-affine\xspace structure.} on $e$ which is isomorphic to the interval $[0,\alpha]\subset\mathbb R$ for a positive real number $\alpha$,
		\item for every edge $e$ with one unbounded endpoint $v_\infty$, a $\mathbb Z$-affine\xspace structure on $e\setminus\{v_\infty\}$ which is isomorphic to the interval $[0,+\infty)\subset\mathbb R$.
	\end{enumerate}
	We set $\Gamma^\circ\coloneqq\Gamma\setminus V_\infty(\Gamma)$.
	We will simply say a \emph{$\mathbb Z$-affine\xspace tree} when unbounded vertices are not present.
\end{defin}

\begin{rem}
	\cref{def:Zaffine_unbounded_tree} differs slightly from \cite[Definition 4.2]{Yu_Enumeration_cylinders_2015} in the sense that here we require that the tree is connected and contains at least one bounded vertex.
	The other cases are useless for our purpose.
\end{rem}

\begin{rem}
	Note that a one-dimensional $\mathbb Z$-affine\xspace structure is equivalent to a metric.
	So an unbounded $\mathbb Z$-affine\xspace tree is a rational tropical curve in the sense of \cite[\S 4.1]{Abramovich_Tropicalization_2012}.
	Our unbounded vertices correspond to the legs in loc.\ cit..
\end{rem}

\begin{defin} \label{def:Zaffine_map}
	Let $(\Gamma, V_\infty(\Gamma))$ be an unbounded $\mathbb Z$-affine\xspace tree.
	Let $(\Sigma,\Sigma_0)$ be a polyhedral $\mathbb Z$-affine\xspace manifold with singularities, i.e., a polyhedral complex $\Sigma$ equipped with a piecewise $\mathbb Z$-affine\xspace structure, an open subset $\Sigma_0\subset\Sigma$ which is a manifold without boundary, and a $\mathbb Z$-affine\xspace structure on $\Sigma_0$ compatible with the piecewise $\mathbb Z$-affine\xspace structure on $\Sigma$ (cf.\ \cite[\S 2]{Yu_Enumeration_cylinders_2015}).
	A $\mathbb Z$-affine\xspace map $h\colon\Gamma\setminus V_\infty(\Gamma)\to\Sigma$ is a continuous proper map such that every edge maps to a cell in $\Sigma$ compatibly with the $\mathbb Z$-affine\xspace structures.
	A $\mathbb Z$-affine\xspace immersion is a $\mathbb Z$-affine\xspace map that does not contract any edge to a point\footnote{A $\mathbb Z$-affine\xspace immersion is not an injective map in general.}.
	Given a $\mathbb Z$-affine\xspace map $h\colon\Gamma\setminus V_\infty(\Gamma)\to\Sigma$, a bounded vertex $v\in V(\Gamma)$ mapping to $\Sigma_0$, and an edge $e$ connected to $v$, we denote by $w^0_v(e)$ the unitary integral tangent vector at $v$ pointing to the direction of $e$, and by $w_v(e)$ the image of $w^0_v(e)$ in $T_{h(v)}\Sigma(\mathbb Z)$, the integral lattice in the tangent space $T_{h(v)}\Sigma$.
	We call $w_v(e)$ the weight vector of the edge $e$ at $v$.
	The $\mathbb Z$-affine\xspace map $h$ is said to be \emph{balanced} at the vertex $v$ if $\sum_{e\ni v} w_v(e)=0\in T_{h(v)}\Sigma(\mathbb Z)$, where the sum is taken over all edges of $\Gamma$ connected to $v$.
\end{defin}

\begin{rem}
	Let $B$ be as in \cref{sec:review_of_cylinder_counts}, i.e.\ the base of the non-archimedean SYZ fibration $\tau\colon X^\mathrm{an}_k\to B$.
	Let $O\in B$ be the origin in $B$.
	The embedding $B\subset\mathbb R^l$ induces a piecewise $\mathbb Z$-affine\xspace structure on $B$ by restriction.
	The non-archimedean SYZ fibration induces a $\mathbb Z$-affine\xspace structure on $B\setminus O$ (cf.\ \cite[\S 3]{Yu_Enumeration_cylinders_2015}).
	So the pair $(B, B\setminus O)$ is a polyhedral $\mathbb Z$-affine\xspace manifold with singularities.
\end{rem}

\begin{defin}\label{def:spine}
	A \emph{spine} in the tropical base $B$ consists of a $\mathbb Z$-affine\xspace tree $\Gamma$, two 1-valent vertices $(v_1,v_2)$ of $\Gamma$, and a $\mathbb Z$-affine\xspace immersion $h\colon\Gamma\to B$ satisfying the following conditions:
	\begin{enumerate}
		\item The image of $h$ does not contain the origin $O\in B$.
		\item The vertices $v_1$ and $v_2$ are the only 1-valent vertices of $\Gamma$.
		\item There is no edge $e$ of $\Gamma$ such that $h(e)$ is contained in a ray starting from $O$.
		\item For every 2-valent vertex $v$, the vector $-\sum_{e\ni v} w_v(e)$ is either zero or points towards the origin $O\in B$, where $w_v(e)$ denotes the weight vector defined in \cref{def:Zaffine_map}.
	\end{enumerate}
\end{defin}

\begin{defin}
	An \emph{extended spine} in the tropical base $B$ consists of an unbounded $\mathbb Z$-affine\xspace tree $\Gamma$, two unbounded vertices $(v_1,v_2)$, and a $\mathbb Z$-affine\xspace immersion $h\colon\Gamma^\circ\to B$ such that the Conditions (1)-(4) of \cref{def:spine} hold.
\end{defin}

Fix a spine $L^0=\big(\Gamma^0,(v^0_1,v^0_2),h^0\colon\Gamma^0\to B\big)$ in $B$.
Let $L^1$, $L^2$ and $L^3$ be the spines in the statement of \cref{thm:gluing_formula}.
For $i=0,\dots,3$, let
\[\widehat L^i=\bigl(\widehat\Gamma^i,(u^i_1,u^i_2),\ \widehat h^i\colon(\widehat\Gamma^i)^\circ\to B\bigr)\]
be the extended spine in $B$ obtained from $L^i$ by extending at both ends straightly with respect to the $\mathbb Z$-affine\xspace structure on $B\setminus O$ 
 (cf.\ \cite[\S 4]{Yu_Enumeration_cylinders_2015} for a detailed description of the extension).

Let us glue $\widehat L^1$ and $\widehat L^2$ along the vertices $v^1_2\in\widehat\Gamma^1$ and $v^2_1\in\widehat\Gamma^2$ to form an unbounded $\mathbb Z$-affine\xspace tree $\Gamma^d$ with four unbounded vertices $u^1_1,u^1_2,u^2_1,u^2_2\in\Gamma^d$.
Let us denote the vertex $v^1_2=v^1_1\in \Gamma^d$ by $v^d$.
The $\mathbb Z$-affine\xspace map $\widehat h^1\colon(\widehat\Gamma^1)^\circ\to B$ and $\widehat h^2\colon(\widehat\Gamma^2)^\circ\to B$ induce a $\mathbb Z$-affine\xspace map $h^d\colon(\Gamma^d)^\circ\to B$ (cf. \cref{fig:Ld}).

\begin{figure}[!ht]
	\centering
	\setlength{\unitlength}{0.8\textwidth}
	\begin{picture} (1,0.273)
	\put(0,0){\includegraphics[width=\unitlength]{images/Ld}}%
	\put(0.02,0.03){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$u^1_1$}}
	\put(0.22,0.07){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^1_1$}}
	\put(0.77,0.07){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^2_2$}}
	\put(0.03,0.18){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$u^2_1$}}}%
	\put(0.94,0.26){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$u^1_2$}}
	\put(0.47,0.22){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$v^d$}}
	\put(0.975,0.00){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$u^2_2$}}}%
	\end{picture}
	\caption{}
	\label{fig:Ld}
\end{figure}

Let $\widehat\Gamma^4$ be the path connecting $u^2_1$ to $u^1_2$ in $\Gamma^d$ and let $\widehat h^4\colon(\widehat\Gamma^4)^\circ\to B$ the restriction of $h^d$.
Denote $u^4_1\coloneqq u^2_1$, $u^4_2\coloneqq u^1_2$.
We see that
\[\widehat L^4=\bigl(\widehat\Gamma^4,(u^4_1,u^4_2),\ \widehat h^4\colon(\widehat\Gamma^4)^\circ\to B\bigr)\]
is an extended spine in $B$ that is straight with respect to the $\mathbb Z$-affine\xspace structure on $B\setminus O$.

For $i=0,\dots,4$, let $f^i_1$, $f^i_2$ denote the edges of $\widehat\Gamma^i$ connected to the unbounded vertices $u^i_1, u^i_2$ respectively.
Let $u'^i_1$ denote the other endpoint of the edge $f^i_1$, and $u'^i_2$ the other endpoint of the edge $f^i_2$.
Let $w^i_1\coloneqq w_{u'^i_1}(f^i_1)$ and $w^i_2\coloneqq w_{u'^i_2}(f^i_2)$ denote the weight vectors.

The following two constructions concern subdivisions of the tropical bases.
The subdivisions will serve us for toric blowups in \cref{sec:analytic_constructions}.

\begin{construction}\label{const:tB}
	Let $\widetilde B\coloneqq\mathbb R\times B$.
	We endow the first factor $\mathbb R$ with the simplicial cone complex structure $\mathbb R=\mathbb R_{<0}\cup\{0\}\cup\mathbb R_{>0}$.
	Then $\widetilde B$ obtains also the structure of a simplicial cone complex.
	Let $\widetilde B'$ be a finite rational subdivision of $\widetilde B$ into simplicial cones satisfying the following conditions:
	\begin{enumerate}
		\item The integer points in every simplicial cone can be generated by a subset of a basis of the lattice $\mathbb Z^{1+l}$.
		This condition is achievable by \cite[Chapter I Theorem 11]{Kempf_Toroidal_1973}.
		\item \label{item:tB:ray} For every $i=0,\dots,4$, there are two rays $\widetilde r^i_1$ and $\widetilde r^i_2$ in the subdivision $\widetilde B'$ pointing to the directions of the vectors $(1, w^i_1)$ and $(1, w^i_2)$ respectively.
	\end{enumerate}
\end{construction}

Here is the idea of the following \cref{const:CB}:
In \cref{sec:analytic_constructions}, it will be difficult to work directly with the tropical base $B$ which is infinite.
So we approximate $B$ by a bounded subset $B_f\subset B$.
The conditions in \cref{const:CB} ensure that the approximation is good enough, so that it captures enough information about tropical curves in $B$ that are related to the spines $L^i$.

\begin{construction}\label{const:CB}
	Let $C_B\coloneqq\mathbb R_{\ge 0}\times B$ and we embed $B$ into $C_B$ by the map $x\mapsto(1,x)$.
	Let $C'_B$ be a finite rational subdivision of $C_B$ into simplicial cones satisfying the following conditions:
	\begin{enumerate}
		\item The integer points in every simplicial cone can be generated by a subset of a basis of the lattice $\mathbb Z^{1+l}$.
		\item Let $B'$ denote the subdivision of $B$ induced by $C'_B$.
		Let $B_f$ denote the union of the bounded faces of $B'$.
		The subscript \textit{f} in the notation is short for ``finite''.
		Let $\partial B_f$ denote the boundary of $B_f$ viewed as subset of $B$ and let $B_f^\circ$ denote the interior.
		We require that the origin $O$ and the images of the spines $L^0$, $L^1$, $L^2$ are all contained in the interior $B_f^\circ$.
		\item \label{item:CB:infinity} For every $i=0,\dots,4$, for every unbounded 2-dimensional cell $\rho$ in the subdivision $B'$ containing the ray $\widehat h^i(f^i_1\setminus u^i_1)$ (resp.\ $\widehat h^i(f^i_2\setminus u^i_2)$) except a finite part, we require that $\rho$ has two infinite 1-dimensional boundary faces pointing to the same direction.
		\item \label{item:CB:projection} Let $B'_{\infty}$ denote the conical subdivision of $B$ induced by the directions of the infinite 1-dimensional cells in $B'$.
		We require that the projection $\widetilde B\to B$ induces a map of simplicial cone complexes $\widetilde B'\to B'_{\infty}$.
	\end{enumerate}
\end{construction}

\begin{construction}[cf.\ \cref{fig:graphs}]\label{const:graphs}
	We define two graphs with legs:
	\begin{itemize}
		\item The graph $G$ consists of three vertices $v_1, v_2, v_3$, an edge connecting $v_1, v_3$, an edge connecting $v_2, v_3$, two legs $l^2_1, l^1_2$ attached to the vertex $v_1$, two legs $l^1_1, l^2_2$ attached to the vertex $v_2$, and one leg $l_5$ attached to the vertex $v_3$.
		\item The graph $G'$ consists of three vertices $v_1, v_2, v_3$, an edge connecting $v_1, v_3$, an edge connecting $v_2, v_3$, two legs $l^1_1, l^1_2$ attached to the vertex $v_1$, two legs $l^2_1, l^2_2$ attached to the vertex $v_2$, and one leg $l_5$ attached to the vertex $v_3$.
	\end{itemize}
\end{construction}

\begin{figure}[!ht]
	\centering
	\setlength{\unitlength}{0.6\textwidth}
	\begin{picture} (1,0.426)
	\put(0,0){\includegraphics[width=\unitlength]{images/graphs}}%

	\put(0.05,0.33){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^2_1$}}}%
	\put(0.05,0.09){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^1_1$}}}%
	\put(0.3,0.33){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^1_2$}}}%
	\put(0.3,0.09){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^2_2$}}}%
	\put(0.62,0.33){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^1_1$}}}%
	\put(0.62,0.09){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^2_1$}}}%
	\put(0.87,0.33){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^1_2$}}}%
	\put(0.87,0.09){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l^2_2$}}}%
		
	\put(0.35,0.24){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l_5$}}}%
	\put(0.92,0.24){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$l_5$}}}%
	
	\put(0.18,0.01){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$G$}}}
	\put(0.74,0.01){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$G'$}}}
		
	\end{picture}
	\caption{The graphs $G$ and $G'$.}
	\label{fig:graphs}
\end{figure}

\begin{construction} \label{const:Delta}
Following Abramovich-Caporaso-Payne \cite{Abramovich_Tropicalization_2012}, let $\widebar M^\mathrm{trop}_{g,n}$ denote the coarse moduli space of extended tropical curves of genus $g$ with $n$ legs.
For the extended tropical curves parametrized by $\widebar M^\mathrm{trop}_{0,5}$, we label the five legs by $l^1_1, l^1_2, l^2_1, l^2_2, l_5$ respectively.
For any $r\in(0,+\infty]$, let $G_r$ (resp.\ $G'_r$) denote the extended tropical curve such that
\begin{enumerate}
	\item the underlying graph is $G$ (resp.\ $G'$),
	\item the lengths of both vertical edges (as shown in \cref{fig:graphs}) are equal to $r$.
\end{enumerate}
Note that for $r=0$, we have the degenerate case $G_0=G'_0$.
Now varying $r$ from $0$ to $+\infty$, $G_r$ and $G'_r$ give two paths in $\widebar M^\mathrm{trop}_{0,5}$.
We denote the union of the two paths by $\Delta\subset\widebar M^\mathrm{trop}_{0,5}$.
\end{construction}

\begin{defin}\label{def:pointed_extended_tropical_cylinder}
	A \emph{pointed extended tropical cylinder} in the tropical base $B$ consists of an unbounded $\mathbb Z$-affine\xspace tree $\Gamma$ with exactly two unbounded vertices $(v_1,v_2)$, a marked point $v_3\in\Gamma$, and a $\mathbb Z$-affine\xspace immersion $h\colon\Gamma^\circ\to B$ satisfying the following condition:
	For every bounded vertex $v$ of $\Gamma$ such that $h(v)\neq O$, the $\mathbb Z$-affine\xspace map $h$ is balanced at $v$.
\end{defin}

\begin{defin}\label{def:tropical_double_cylinder}
	A \emph{pointed extended tropical double cylinder} in the tropical base $B$ consists of an unbounded $\mathbb Z$-affine\xspace tree $\Gamma$ with exactly four unbounded vertices $v_1,v_2,v_3,v_4$, a marked point $v_5\in\Gamma$, and a $\mathbb Z$-affine\xspace immersion $h\colon\Gamma^\circ\to B$ satisfying the same condition as in \cref{def:pointed_extended_tropical_cylinder}.
\end{defin}

\begin{construction}\label{const:subset_Ti}
	For $i=0,\dots,4$, let $T^i$ be the set of pointed extended tropical cylinders $(\Gamma,(v_1,v_2,v_3),h)$ satisfying the following conditions:
	\begin{enumerate}
		\item If $i=0$, then we have $h(v_3)=h^0(v^0_1)$.
		\item If $i=1,\dots,4$, then we have $h(v_3)=h^d(v^d)$. (Recall that $h^d(v^d)=h^1(v^1_2)=h^2(v^2_1)$.
		\item Let $\Gamma^s$ denote the path in $\Gamma$ connecting the unbounded vertices $v_1$ and $v_2$.
		Then $(\Gamma^s,(v_1,v_2,v_3),h|_{\Gamma^s})$ is isomorphic to  $(\widehat\Gamma^i,(u^i_1,u^i_2,v^i_1),\widehat h^i)$.
	\end{enumerate}
\end{construction}

\begin{construction}\label{const:subset_Td}
	Let $T^d$ be the set of pointed extended tropical double cylinders $(\Gamma,(v_1,v_2,v_3,v_4,v_5),h)$ satisfying the following conditions:
	\begin{enumerate}
		\item We have $h(v_5)=h^d(v^d)\in B$.
		\item Let $\Gamma^s$ denote the convex hull of the vertices $v_1,\dots,v_4$ in $\Gamma$.
		Then $(\Gamma^s,(v_1,\dots,\allowbreak v_5),\allowbreak h|_{\Gamma^s})$ is isomorphic to $(\Gamma^d,(u^1_1,u^1_2,u^2_1,u^2_2,v^d),h^d)$.
	\end{enumerate}
\end{construction}

\begin{defin} \label{def:rational_tropical_curve_in_Bf}
	A \emph{pointed rational tropical curve in $B_f$ with $n$ boundary points} consists of a $\mathbb Z$-affine\xspace tree $\Gamma$, $(n+1)$ marked points $v_1,\dots,v_{n+1}\in\Gamma$, and a $\mathbb Z$-affine\xspace immersion $h\colon\Gamma\to B_f$ satisfying the following conditions:
	\begin{enumerate}
		\item \label{item:boundary} For $i=1,\dots,n$, $h(v_i)$ lies in the boundary $\partial B_f$.
		\item \label{item:balancing1} For any vertex $v$ of $\Gamma$, if $h(v)$ lies in $B_f^\circ\setminus O$, then the $\mathbb Z$-affine\xspace map $h$ is balanced at $v$.
		\item \label{item:balancing2} For any vertex $v$ of $\Gamma$, if $h(v)$ lies in the relative interior of a 1-dimensional cell $\sigma$ of $\partial B$, let $\rho$ denote the unbounded 2-dimensional cell in $B'$ containing $\sigma$.
		Since the subdivision $B'$ of $B$ is induced by the simplicial conical subdivision $C'_B$ of $C_B$, the two other boundary faces of $\rho$ are two rays pointing to the same direction.
		Let $w_\rho$ denote this direction.
		Consider the quotient $T_{h(v)}B/w_\rho$, where $T_{h(v)}B$ denotes the tangent space of $B$ at $h(v)$.
		We require that $\sum_{e\ni v}w_v(e)$ is zero in $T_{h(v)}B/w_\rho$, where the sum is taken over all edges of $\Gamma$ connected to $v$.
	\end{enumerate}
	A pointed rational tropical curve in $B_f$ with $n$ boundary points is called \emph{simple} if there is no balanced 2-valent vertex.
	Note that any pointed rational tropical curve in $B_f$ with $n$ boundary points can be made simple by removing all the balanced 2-valent vertices and gluing the corresponding edges.
\end{defin}

\begin{construction} \label{const:tropical_moduli}
Let $M_{n+1}(B_f)$ denote the space of simple pointed rational tropical curves in $B_f$ with $n$ boundary points.

For $i=0,\dots,4$, let $M^i_{2+1}(B_f)\subset M_{2+1}(B_f)$ denote the subset consisting of pointed rational tropical curves in $B_f$ with 2 boundary points $(\Gamma,(v_1,v_2,v_3),h\colon\Gamma\to B_f)$ such that $h(v_3)=h^0(v^0_1)$ for $i=0$, and $h(v_3)=h^d(v^d)$ for $i=1,\dots,4$.

Let $M^d_{4+1}(B_f)\subset M_{4+1}(B_f)$ denote the subset consisting of pointed rational tropical curves in $B_f$ with 4 boundary points $(\Gamma,(v_1,\dots,v_5),h\colon\Gamma\to B_f)$ satisfying the following conditions:
\begin{enumerate}
	\item We have $h(v_5)=h^d(v^d)\in B_f$.
	\item Let $P_{13}$ denote the path in $\Gamma$ connecting $v_1$, $v_3$, and $P_{24}$ the path connecting $v_2$, $v_4$.
	Then the intersection $P_{13}\cap P_{24}$ is nonempty.
	Moreover, the vertex $v_5$ lies in the intersection.
\end{enumerate}
\end{construction}

\begin{construction} \label{const:TiTd}
Via the natural retraction map $\tau_f\colon B\to B_f$, pointed extended tropical cylinders and pointed extended tropical double cylinders induce simple pointed rational tropical curves in $B_f$.
In this way, the sets $T^i$, for $i=0,\dots,4$, and $T^d$ induce subsets of $M(B_f)$, which we denote by $T^i_f$ and $T^d_f$ respectively.
We see that $T^i_f$ is a subset of $M^i_{2+1}(B_f)$, and $T^d_f$ is a subset of $M^d_{4+1}(B_f)$.
\end{construction}

\begin{prop}\label{prop:tropical_rigidity}
	For $i=0,\dots,4$, the subset $T^i_f\subset M^i_{2+1}(B_f)$ is a union of connected components of $M^i_{2+1}(B_f)$.
	Similarly, the subset $T^d_f\subset M^d_{4+1}(B_f)$ is a union of connected components of $M^d_{4+1}(B_f)$.
\end{prop}

\begin{lem} \label{lem:twig}
	Let $\Gamma$ be a $\mathbb Z$-affine\xspace tree, and $r$ a vertex of $\Gamma$ called root.
	Let $h\colon\Gamma\to B$ be a $\mathbb Z$-affine\xspace immersion satisfying the following conditions:
	\begin{enumerate}
		\item The image $h(r)\neq O\in B$.
		\item \label{item:twig:balancing} For any vertex $v$ of $\Gamma$ except the root, if $h(v)$ lies in $B\setminus O$, then the $\mathbb Z$-affine\xspace map $h$ is balanced at $v$.
	\end{enumerate}
	Then there exists a ray $R$ in $B$ starting from $O\in B$ with rational slope such that the image $h(\Gamma)$ lies in $R$.
	In particular, the image $h(r)$ lies in $R$.
\end{lem}
\begin{proof}
	Let $V(\Gamma)$ denote the set of vertices of $\Gamma$.
	We call 1-valent vertices in $V(\Gamma)\setminus\{r\}$ leaves of $\Gamma$.
	By Condition (\ref{item:twig:balancing}), if $v$ is a leaf of $\Gamma$, then $h(v)=O\in B$.
	Therefore, for every edge $e$ of $\Gamma$ containing a leaf, the image $h(e)$ is contained in a ray $R_e$ in $B$ starting from $O\in B$.
	Since $h$ is a $\mathbb Z$-affine\xspace immersion, the ray $R_e$ has rational slope.
	Let $v$ be any vertex of $\Gamma$ except $r$ such that $h(v)\neq O$.
	Let $e_0,\dots,e_n$ be the edges connected to $v$.
	If we know that for $i=1,\dots,n$, the image $h(e_i)$ is contained in a ray $R_{e_i}$ in $B$ starting from $O$, then the rays $R_{e_1},\dots,R_{e_n}$ are all equal; moreover, by Condition (\ref{item:twig:balancing}), the image $h(e_0)$ is also contained in the same ray.
	Therefore, reasoning from the leaves to the root, we conclude that for all edge $e$ of $\Gamma$, the image $h(e)$ is contained in a same ray $R$ starting from $O\in B$ with rational slope.
\end{proof}

\begin{proof}[Proof of \cref{prop:tropical_rigidity}]
	In order to show that the subset $T^i_f\subset M^i_{2+1}(B_f)$ is a union of connected components, it suffices to show that for any continuous path $\mu\colon[0,1]\to M^i_{2+1}(B_f)$ with $\mu(0)\in T^i_f$, we have $\mu(1)\in T^i_f$.
	Given any continuous path $\mu\colon[0,1]\to M^i_{2+1}(B_f)$ with $\mu(0)\in T^i_f$, for $t\in [0,1]$, let $(\Gamma_t,(v_{1,t},v_{2,t},v_{3,t}),h_t\colon\Gamma_t\to B_f)$ be the pointed rational tropical curve in $B_f$ with two boundary points corresponding to $\mu(t)\in M^i_{2+1}(B_f)$,
	and let $\Gamma^s_t$ denote the path connecting $v_{1,t}$ and $v_{2,t}$ in $\Gamma_t$.
	
	Let $v$ be a 2-valent vertex of $\Gamma_t^s$ and let $e_1, e_2$ denote the two edges connected to $v$.
	We call $v$ a bending vertex of $\Gamma_t^s$ if we have $w_v(e_1)+w_v(e_2)\neq 0$ for the weight vectors.
	Now assume that $v$ is a bending vertex of $\Gamma_t^s$.
	Let $\Gamma_v$ be a connected component of the closure of $\Gamma_t\setminus\Gamma_t^s$ that contains $v$.
	Applying \cref{lem:twig} to $\Gamma_v$, $v$ and $h_t|_{\Gamma_v}$, we see that $h_t(v)$ lies in a ray $R_v$ in $B$ starting from $O\in B$ with rational slope.
	Therefore, during any small deformation, the image $h_t(v)$ must stay on the ray $R_v$.
	Since $\mu(t)\in M_{2+1}^i(B_f)$, the image $h_t(v_{3,t})\in B_t$ is fixed independent of $t$.
	Combining with the fact that $h_t$ is a $\mathbb Z$-affine\xspace immersion, and the previous discussion on bending vertices, we see that all the images of the bending vertices are fixed independent of $t$.
	Moreover, by \cref{const:CB} Condition (\ref{item:CB:infinity}) and \cref{def:rational_tropical_curve_in_Bf}(\ref{item:boundary}), the image $h_t(\Gamma_t^s)$ intersects $\partial B_f$ at exactly two endpoints of $\Gamma_t^s$.
	To conclude, we have shown that $(\Gamma^s_t,(v_{1,t},v_{2,t},v_{3,t}),h_t|_{\Gamma^s_t})$ is fixed independent of $t$.	
	Therefore, the image of $\mu\colon[0,1]\to M^i_{2+1}(B_f)$ lies in $T^i_f$.
	We conclude that $T^i_f\subset M^i_{2+1}(B_f)$ is a union of connected components.
	
	Now we show that the subset $T^d_f\subset M^d_{4+1}(B_f)$ is a union of connected components using the same idea.
	Let $\mu\colon[0,1]\to M^d_{4+1}(B_f)$ be any continuous path with $\mu(0)\in T^d_f$.
	For $t\in[0,1]$, let $(\Gamma_t,(v_{1,t},\dots,v_{5,t}),h_t\colon\Gamma_t\to B_f)$ be the pointed rational tropical curve in $B_f$ with four boundary points corresponding to $\mu(t)\in M^d_{4+1}(B_f)$.
	Let $P_{13,t}$ be the path connecting $v_1$, $v_3$ in $\Gamma_t$, and $P_{24,t}$ the path connecting $v_2$, $v_4$ in $\Gamma_t$.
	Let $\Gamma^s_t$ denote the convex hull of $v_{1,t},\dots,v_{4,t}$ in $\Gamma_t$.
	Since $\mu(t)\in M^d_{4+1}(B_f)$, the paths $P_{13,t}$ and $P_{24,t}$ intersect.
	Therefore, during the deformation $\Gamma_t$, the 4-valent vertex $v^d$ of $\Gamma^d$ cannot deform into two 3-valent vertices at which $h_t$ is balanced.
	So the intersection $P_{13,t}\cap P_{24,t}$ is always a point during the deformation, which is exactly the point $v_{5,t}$.
	Now let $P_{14,t}$ be the path connecting $v_1$, $v_4$ in $\Gamma_t$, and $P_{23,t}$ the path connecting $v_2$, $v_3$ in $\Gamma_t$.
	Note that $P_{14,t}$ and $P_{23,t}$ intersect at the point $v_{5,t}$.
	The fact that $\mu(t)\in M^d_{4+1}(B_f)$ implies that the image $h_t(v_{5,t})\in B_f$ is fixed independent of $t$.
	Applying the argument in the previous paragraph to the paths $P_{14,t}$ and $P_{23,t}$ respectively, we see that $(\Gamma^s_t,(v_{1,t},\dots,v_{5,t}),h_t|_{\Gamma^s_t})$ is fixed independent of $t$.
	Therefore, the image of $\mu$ lies in $T^d_f$.
	We conclude that $T^d_f\subset M^d_{4+1}(B_f)$ is a union of connected components.
\end{proof}

\section{Analytic constructions}\label{sec:analytic_constructions}

In this section, we apply the tropical constructions in \cref{sec:tropical_constructions} to the constructions of analytic moduli spaces.

We endow the projective line $\mathbb P^1_k$ with the standard toric structure.
The subdivision $\widetilde B'$ in \cref{const:tB} induces a toric blowup\footnote{We refer to \cite[Chapter II]{Kempf_Toroidal_1973} for the relationship between subdivisions and blowups.} $\widetilde Y\to\mathbb P^1_k\times Y_k$.
The subdivision $B'_\infty$ in \cref{const:CB} induces a toric blowup $Y'\to Y_k$.
Let $\partial\widetilde Y$ and $\partial Y'$ denote the toroidal boundaries of $\widetilde Y$ and $Y'$ respectively.
By \cref{const:CB} Condition (\ref{item:CB:projection}), the map of simplicial cone complexes $\widetilde B'\to B'_\infty$ induces a map of $k$-varieties $p_{Y,2}\colon\widetilde Y\to Y'$.

For $i=0,\dots,4$, let $m^i_1$ be the lattice length of the weight vector $w^i_1$ defined before \cref{const:tB}.
Let $\widetilde r^i_1$ be as in \cref{const:tB}(\ref{item:tB:ray}).
Let $r^i_1$ be the image of $\widetilde r^i_1$ under the map $\widetilde B'\to B'_\infty$.
Let $\widetilde D^i_1$ be the divisor in $\widetilde Y$ corresponding to the ray $\widetilde r^i_1$.
Let $D^i_1$ be the divisor in $Y'$ corresponding to the ray $r^i_1$.
Similarly, we define $m^i_2$, $\widetilde D^i_2$ and $D^i_2$.

Now, let $i\in\set{0,\dots,4}$, and let $\beta$ be an element in $\NE(Y)$, the cone of curves of $Y$.
Constructions \ref{const:sbeta} - \ref{const:sdbeta} below define the curve classes in $\NE(Y')$ and $\NE(\widetilde Y)$ that are relevant to our purposes.

\begin{construction}\label{const:sbeta}
	 Let $s(L^i,\beta)$ denote the subset of $\NE(Y')$ consisting of elements $\gamma\in\NE(Y')$ satisfying the following conditions:
	 \begin{enumerate}
		\item The element $\gamma$ admits a representative which is a closed rational curve $C$ contained in $(Y'\setminus\partial Y')\cup(D^i_1\cup D^i_2)$ that intersects the divisor $D^i_1$ at exactly one point with multiplicity $m^i_1$, and the divisor $D^i_2$ at exactly one point with multiplicity $m^i_2$.
		\item Under the composite morphism $\NE(Y')\to\NE(Y_k)\xrightarrow{\sim}\NE(Y)$, the image of $\gamma$ equals $\beta\in\NE(Y)$.
	\end{enumerate}
\end{construction}

\begin{construction}\label{const:spbeta}
	Let $s^p(L^i,\beta)$ denote the subset of $\NE(\widetilde Y)$ consisting of elements $\gamma\in\NE(\widetilde Y)$ satisfying the following conditions:
	\begin{enumerate}
		\item The element $\gamma$ admits a representative which is a closed rational curve $C$ contained in $(\widetilde Y\setminus\partial\widetilde Y)\cup\widetilde D^i_1\cup\widetilde D^i_2$ that intersects the divisor $\widetilde D^i_1$ transversally at exactly one point, and the divisor $\widetilde D^i_2$ also transversally at exactly one point.
		\item Under the projection $\NE(\widetilde Y)\to\NE(\mathbb P^1_k)$, the image of $\gamma$ is the fundamental class of $\mathbb P^1_k$.
		\item Under the composite morphism $\NE(\widetilde Y)\to\NE(Y_k)\xrightarrow{\sim}\NE(Y)$, the image of $\gamma$ equals $\beta\in\NE(Y)$.
	\end{enumerate}
	The superscript p in the notation is short for ``parametrized''.
\end{construction}

\begin{construction}\label{const:sdbeta}
	Let $s^d(\beta)$ denote the subset of $\NE(Y')$ consisting of elements $\gamma\in\NE(Y')$ satisfying the following conditions:
	\begin{enumerate}
		\item The element $\gamma$ admits a representative which is a closed rational curve $C$ contained in $(Y'\setminus\partial Y')\cup (D^1_1\cup D^1_2\cup D^2_1\cup D^2_2)$ that intersects the divisor $D^1_1$ (resp.\ $D^1_2, D^2_1, D^2_2$) at exactly one point with multiplicity $m^1_1$ (resp.\ $m^1_2, m^2_1, m^2_2$).
		\item Under the composite morphism $\NE(Y')\to\NE(Y_k)\xrightarrow{\sim}\NE(Y)$, the image of $\gamma$ equals $\beta\in\NE(Y)$.
	\end{enumerate}
\end{construction}

\begin{rem}
	Each of the subsets we defined in Constructions \ref{const:sbeta} - \ref{const:sdbeta} contains at most one element.
	To see this for $s(L^i,\beta)$, note that $N^1(Y')$ is a direct sum of $N^1(Y_k)$ with classes of exceptional curves, where $N^1(-)$ denotes divisors modulo numerical equivalence.
	So the conditions in \cref{const:sbeta} determine the curve class uniquely.
	The same reasoning applies to Constructions \ref{const:spbeta} and \ref{const:sdbeta} too.
\end{rem}

Recall that a stable map into a variety is a map from a pointed proper nodal curve to the variety having only finitely many automorphisms.
We refer to \cite{Kontsevich_Enumeration_1995,Fulton_Stable_1997} for the theory of stable maps in algebraic geometry, and to \cite{Yu_Gromov_2014} for the theory in non-archimedean analytic geometry.

\begin{construction}\label{const:Mbeta}
	Let $\mathcal M(L^i,\beta)$ denote the stack of 3-pointed rational stable maps into $Y'$ satisfying the following conditions:
	\begin{enumerate}
		\item The first marked point maps to $D^i_1$ with multiplicity $m^i_1$; the second marked point maps to $D^i_2$ with multiplicity $m^i_2$.
		\item The image of the fundamental class of the domain curve belongs to $s(L^i,\beta)$.
	\end{enumerate}
\end{construction}

\begin{construction}\label{const:Mpbeta}
	Let $\mathcal M^p(L^i,\beta)$ denote the stack of 3-pointed rational stable maps into $\widetilde Y$ satisfying the following conditions:
	\begin{enumerate}
		\item The first marked point maps to $\widetilde D^i_1$; the second marked point maps to $\widetilde D^i_2$.
		\item The image of the fundamental class of the domain curve belongs to $s^p(L^i,\beta)$.
	\end{enumerate}
\end{construction}

\begin{construction}\label{const:Mdbeta}
	Let $\mathcal M^d(\beta)$ denote the stack of 5-pointed rational stable maps into $Y'$ satisfying the following conditions:
	\begin{enumerate}
		\item The first four marked points map respectively to the divisors $D^1_1, D^1_2, D^2_1, D^2_2$ with multiplicities $m^1_1, m^1_2, m^2_1, m^2_2$.
		\item The image of the fundamental class of the domain curve belongs to $s^d(\beta)$.
	\end{enumerate}
\end{construction}

\begin{rem}
	Let $\mathcal M(L^i,\beta)^\mathrm{an}$ denote the analytification of the algebraic stack $\mathcal M(L^i,\beta)$ (cf.\ \cite[\S 6.1]{Porta_Yu_Higher_analytic_stacks_2014}).
	By \cite[Theorem 8.7]{Yu_Gromov_2014}, the $k$-analytic\xspace stack $\mathcal M(L^i,\beta)^\mathrm{an}$ parametrizes 3-pointed rational analytic stable maps into the analytification $(Y')^\mathrm{an}$ satisfying the conditions of \cref{const:Mbeta}.
	Similar remarks apply also to the stacks in Constructions \ref{const:Mpbeta} and \ref{const:Mdbeta}.
\end{rem}

The subdivision $B'$ of $B$ gives rise to an snc log-model $(\mathscr X,H)$ of the $k$-variety $X_k$ (cf.\ \cite[\S 2]{Yu_Enumeration_cylinders_2015}).
Note that the generic fiber of $\mathscr X$ is isomorphic to the $k$-variety $Y'$.
In other words, $\mathscr X$ is an snc model of $Y'$.
Up to a finite ground field extension, we can assume furthermore that $\mathscr X$ is a strictly semi-stable model of $Y'$ (cf.\ \cite{Kempf_Toroidal_1973}).
By construction, the Clemens polytope associated to $\mathscr X$ is isomorphic to $B_f$ as a simplicial complex.
Let $\tau_Y\colon (Y')^\mathrm{an}\to B_f$ denote the corresponding retraction map.

Let $(C, (s_1,s_2,s_3), f\colon C\to (Y')^\mathrm{an})$ be an analytic stable map in $\mathcal M(L^i,\beta)^\mathrm{an}$.
Applying the tropicalization procedure of \cite[\S 3]{Yu_Tropicalization_2014}, we obtain a 3-pointed rational parametrized tropical curve in $B_f$ in the sense of \cite[Definition 3.2]{Yu_Tropicalization_2014}.
This is also a pointed rational tropical curve in $B_f$ with 2 boundary points in the sense of \cref{def:rational_tropical_curve_in_Bf}.
Indeed, for any point $p\in B^\circ_f\setminus O$, there exists an open neighborhood $V$ of $p$ in $B_f$ such that the map $\tau^{-1}_Y(V)\to V$ is a trivial affinoid torus fibration.
So \cref{def:rational_tropical_curve_in_Bf} Condition (i) is satisfied (cf.\ \cite[Theorem 6.14]{Baker_Nonarchimedean_2011}).
For Condition (ii), consider the extension of the valuation map $\val\colon\mathbb G_{\mathrm m/k}^\mathrm{an}\to\mathbb R$ to the map $\widebar{\val}\colon(\mathbb A^1_k)^\mathrm{an}\to\mathbb R\cup\{+\infty\}$.
Let $\phi\colon\mathbb R\cup\{+\infty\}\to(-\infty,0]$ be the map contracting $[0,+\infty]$ to the point 0.
Let $\psi\coloneqq\phi\circ\widebar{\val}\colon(\mathbb A^1_k)^\mathrm{an}\to(-\infty,0]$ be the composition.
For any point $p$ in the relative interior of a 1-dimensional cell of $\partial B$, there exists a small open neighborhood $V$ of $p$ in $B_f$ such that the map $\tau^{-1}_Y(V)\to V$ is isomorphic to the map $(\psi,\val)\colon(\mathbb A^1_k)^\mathrm{an}\times(\mathbb G_{\mathrm m/k})^\mathrm{an}\to(-\infty,0]\times\mathbb R$ localized over an open subset of $(-\infty,0]\times\mathbb R$.
This implies that \cref{def:rational_tropical_curve_in_Bf} Condition (ii) is also satisfied.

Therefore, we obtain a tropicalization map
\[\tau^i_\mathcal M\colon\mathcal M(L^i,\beta)^\mathrm{an}\to M_{2+1}(B_f).\]
Similarly, we obtain a tropicalization map for the stack $\mathcal M^d(\beta)$
\[\tau_{\mathcal M^d}\colon\mathcal M^d(\beta)^\mathrm{an}\to M_{4+1}(B_f).\]

A point in the stack $\mathcal M^p(L^i,\beta)^\mathrm{an}$ corresponds to a 3-pointed rational analytic stable map into $\widetilde Y^\mathrm{an}$.
If we compose this stable map with the map $p^\mathrm{an}_{Y,2}\colon\widetilde Y^\mathrm{an}\to(Y')^\mathrm{an}$, we obtain a map from a nodal curve to $(Y')^\mathrm{an}$.
Its tropicalization is a pointed rational tropical curve in $B_f$ with 2 boundary points in the sense of \cref{def:rational_tropical_curve_in_Bf}.
So we obtain a tropicalization map
\[\tau^i_{\mathcal M^p}\colon\mathcal M^p(L^i,\beta)^\mathrm{an}\to M_{2+1}(B_f).\]

Let us denote
\begin{align*}
\mathcal M(L^i,\beta,T)&\coloneqq(\tau^i_\mathcal M)^{-1}(T^i_f),\\
\mathcal M^p(L^i,\beta,T)&\coloneqq(\tau^i_{\mathcal M^p})^{-1}(T^i_f),\\
\mathcal M^d(\beta,T)&\coloneqq(\tau_{\mathcal M^d})^{-1}(T^d_f).
\end{align*}

Let
\begin{align*}
	W^0&\coloneqq\tau_Y^{-1}(h^0(v^0_1))\subset (Y')^\mathrm{an},\\
	W^p&\coloneqq\mathbb G_{\mathrm m/k}^\mathrm{an}\times W^0\subset \widetilde Y^\mathrm{an},\\
	W^d&\coloneqq\tau^{-1}_Y(h^d(v^d))\subset (Y')^\mathrm{an}.
\end{align*}

\begin{prop}\label{prop:properness}
	Consider the evaluation map of the third marked point for the stack $\mathcal M(L^0,\beta)^\mathrm{an}$
	\[\mathit{ev}_3\colon\mathcal M(L^0,\beta)^\mathrm{an}\to(Y')^\mathrm{an}.\]
	Let $\mathcal M(L^0,\beta)_W\coloneqq\mathit{ev}^{-1}_3 W^0$ and
	\[\mathcal M(L^0,\beta,T)_W\coloneqq \mathcal M(L^0,\beta)_W\cap\mathcal M(L^0,\beta,T).\]
	Then the restriction
	\[\mathit{ev}_3|_{\mathcal M(L^0,\beta,T)_W}\colon \mathcal M(L^0,\beta,T)_W \to W^0\]
	is a proper map.
	Similarly, consider the evaluation map of the third marked point for the stack $\mathcal M^p(L^0,\beta)^\mathrm{an}$
	\[\mathit{ev}_3\colon\mathcal M^p(L^0,\beta)^\mathrm{an}\to\widetilde Y^\mathrm{an}.\]
	Let $\mathcal M^p(L^0,\beta)_W\coloneqq\mathit{ev}_3^{-1} W^p$ and
	\[\mathcal M^p(L^0,\beta,T)_W\coloneqq \mathcal M^p(L^0,\beta)_W\cap\mathcal M^p(L^0,\beta,T).\]
	Then the restriction
	\[\mathit{ev}_3|_{\mathcal M^p(L^0,\beta,T)_W}\colon \mathcal M^p(L^0,\beta,T)_W \to W^p\]
	is a proper map.
\end{prop}
\begin{proof}
	Let us prove the first statement.
	The same argument applies to the second statement.
	Consider the tropicalization map
	\[\tau^0_\mathcal M\colon\mathcal M(L^0,\beta)^\mathrm{an}\to M_{2+1}(B_f).\]
	Let $\big(C,(p_1,p_2,p_3),f\colon C\to (Y')^\mathrm{an}\big)$ be the analytic stable map corresponding to a point in $\mathcal M(L^0,\beta)_W$.
	Let $\big(\Gamma,(v_1,v_2,v_3),h\colon\Gamma\to B_f\big)$ be the associated rational tropical curve in $B_f$ with two boundary points.
	Since $\mathcal M(L^0,\beta)_W=\mathit{ev}_3^{-1}(W^0)$ and $W^0=\tau_Y^{-1}(h^0(v^0_1))$, we have $\tau_Y(f(p_3))=h^0(v^0_1)$.
	So $h(v_3)=h^0(v^0_1)$.
	We deduce that
	\[\tau^0_\mathcal M(\mathcal M(L^0,\beta)_W)\subset M^0_{2+1}(B_f),\]
	where $M^0_{2+1}(B_f)$ is defined in \cref{const:tropical_moduli}.
	
	By \cref{prop:tropical_rigidity}, the subset $T^0_f\subset M^0_{2+1}(B_f)$ is a union of connected components.
	Therefore, the subspace $\mathcal M(L^0,\beta,T)_W\subset\mathcal M(L^0,\beta)_W$ is a union of connected components.
	Since the algebraic stack $\mathcal M(L^0,\beta)$ is proper over $k$, by \cite[Proposition 6.4]{Porta_Yu_Higher_analytic_stacks_2014}, its analytification $\mathcal M(L^0,\beta)^\mathrm{an}$ is a proper $k$-analytic\xspace stack.
	So the map
	\[\mathit{ev}_3\colon\mathcal M(L^0,\beta)^\mathrm{an}\to(Y')^\mathrm{an}\]
	is proper.
	By base change, the map
	\[\mathit{ev}_3|_{\mathcal M(L^0,\beta)_W}\colon\mathcal M(L^0,\beta)_W\to W^0\]
	is proper.
	Since the subspace $\mathcal M(L^0,\beta,T)_W\subset\mathcal M(L^0,\beta)_W$ is a union of connected components, we deduce that the map
	\[\mathit{ev}_3|_{\mathcal M(L^0,\beta,T)_W}\colon \mathcal M(L^0,\beta,T)_W \to W^0\]
	is proper, completing the proof.
\end{proof}

\begin{lem}\label{lem:components_of_the_domain_curve}
	Any analytic stable map $\big(C, (\text{marked points}),f\colon C\to(Y')^\mathrm{an}\big)$ in $\mathcal M(L^0,\beta,T)$ (resp.\ $\mathcal M^d(\beta,T)$) satisfies the following properties:
	\begin{enumerate}
		\item \label{item:components:boundary} There is no irreducible component of $C$ mapping into the boundary $(\partial Y')^\mathrm{an}$.
		\item \label{item:components:marked_points} The preimage $f^{-1}((\partial Y')^\mathrm{an})$ contains exactly the first two (resp.\ four) marked points on $C$.
		\item \label{item:components:unstable} Let $C'$ be an irreducible component of $C$ that contains at most two special points\footnote{A special point is by definition either a marked point or a node.}, then $f(C')$ does not meet the boundary $(\partial Y')^\mathrm{an}$ and $(\tau\circ f)(C')=O\in B$.
		\item \label{item:components:stabilization} Let $C_m\subset C$ be the union of irreducible components containing the marked points.
		Let $\st(C)$ be the stabilization of the pointed domain curve (obtained by iterated contractions of non-stable components).
		We have $C_m=\st(C)$.
	\end{enumerate} 
\end{lem}
\begin{proof}
	Let us prove the lemma in the case of $\mathcal M^d(\beta,T)$.
	The proof in the case of $\mathcal M(L^0,\beta,T)$ is similar and simpler.
	
	Let $Z=(\Gamma,(v_1,\dots,v_5),h\colon\Gamma\to B_f)$ denote the pointed rational tropical curve in $B_f$ with four boundary points associated to the stable map.
	Let $C_b$ denote the union of the irreducible components of $C$ mapping into the boundary $(\partial Y')^\mathrm{an}$.
	Let $C'_b$ be a connected component of $C_b$.
	Since $Z$ belongs to $T^d_f$, the intersection $h(\Gamma)\cap\partial B_f$ consists of finitely many points in $\partial B_f$.
	So $(\tau_Y\circ f)(C'_b)$ is a point in $\partial B_f$, which we denote by $b$.
	Since $\tau_Y^{-1}(b)$ is an affinoid domain in $(Y')^\mathrm{an}$, the image $f(C'_b)\subset(Y')^\mathrm{an}$ must be a point in $(Y')^\mathrm{an}$.
	Let $C_i$ be the union of the irreducible components of $C$ not contained in $C_b$.
	Let $v\in\set{v_1,\dots,v_4}$ be the vertex of $\Gamma$ corresponding to $C'_b$.
	Since $Z$ belongs to $T^d_f$, $v$ is a 1-valent vertex.
	So $C'_b\cap C_i$ contains exactly one point.
	Moreover, $Z\in T^d_f$ implies that $v_1,\dots,v_4$ are four different points on $\Gamma$.
	So $C'_b$ contains at most one marked point.
	Let $C_1$ be the union of the irreducible components of $C$ not contained in $C'_b$.
	We have $C_1=(C_b\setminus C'_b)\cup C_i$.
	So
	\[C'_b\cap C_1=C'_b\cap\big((C_b\setminus C'_b)\cup C_i\big)=C'_b\cap C_i\]
	contains exactly one point.
	Combining with the fact that $C'_b$ has arithmetic genus zero and contains at most one marked point, we get a contradiction to the stability condition of the stable map.
	Therefore, $C_b$ must be empty.
	This proves Property (\ref{item:components:boundary}).
	
	Using Property (\ref{item:components:boundary}) and the conditions on the intersections numbers in \cref{const:sbeta} (resp.\ \cref{const:sdbeta}), we obtain Property (\ref{item:components:marked_points}).
	
	Now let $C'$ be the irreducible component of $C$ in Property (\ref{item:components:unstable}).
	In this case, $C$ is reducible, so $C'$ contains at least one node of $C$.
	By Property (\ref{item:components:marked_points}), $f(C')$ can meet the boundary $(\partial Y')^\mathrm{an}$ at at most one point.
	If $f(C')$ meets $(\partial Y')^\mathrm{an}$ at exactly one point, then by the balancing condition (cf.\ \cref{def:rational_tropical_curve_in_Bf}(\ref{item:balancing1})), $(\tau_Y\circ f)(C')$ must be the intersection of a rational ray starting from $O$ in $B$ with $B_f$.
	This contradicts the fact that the associated pointed rational tropical curve $Z$ belongs to $T^d_f$.
	Therefore, $f(C')$ must lie in the interior $(Y'\setminus \partial Y')^\mathrm{an}\simeq X^\mathrm{an}_k$.
	In this case, by the balancing condition, $(\tau\circ f)(C')$ is a point in $B$.
	By the stability condition, $f|_{C'}$ is nontrivial.
	Moreover, since $\tau\colon X^\mathrm{an}_k\to B$ is an affinoid torus fibration outside $O\in B$, the only possibility for the image $(\tau\circ f)(C')$ is the origin $O\in B$.
	This proves Property (\ref{item:components:unstable}).
	
	Let $C_m$ and $\st(C)$ be as in Property (\ref{item:components:stabilization}).
	Let us first prove that $C_m$ is connected.
	Assume on the contrary that $C_m$ is not connected.
	Let $C_n\subset C$ be the union of irreducible components of $C$ not contained in $C_m$.
	By Property (\ref{item:components:marked_points}), $f(C_n)$ does not meet the boundary $(\partial Y')^\mathrm{an}$.
	Let $C'_n$ be a connected component of $C_n$.
	Assume that $C'_n$ meets at least two connected components of $C_m$.
	Since the associated pointed rational tropical curve $Z$ belongs to $T^d_f$, we see that $(\tau_Y\circ f)(C'_n)$ must be the point $h^d(v^d)\in B_f$.
	Since $\tau_Y^{-1}(h^d(v^d))$ is affinoid, the image $f(C'_n)$ is a point in $X^\mathrm{an}_k$.
	Then by the stability condition, the intersection $C'_n\cap C_m$ has at least three points. 
	Since $C$ is rational, we see that $C_m$ must have at least three connected components.
	Using again the fact that $Z$ belongs to $T^d_f$, we see that only the following situation is possible: $C_m$ has exactly three connected components, one containing the last marked point, one containing two among the first four marked points, and one containing the remaining two marked points.
	We denote the three connected components by $C^1_m$, $C^2_m$, $C^3_m$ respectively.
	Since $C$ is rational, $C'_n$ intersects each of $C^1_m$, $C^2_m$ and $C^3_m$ exactly once.
	Since $C^1_m$ has only one marked point, by Property (\ref{item:components:unstable}), $C^1_m$ must contain two nodes of $C$.
	So there exists a connected component $C''_n$ of $C_n$ different from $C'_n$ that meets $C^1_m$.
	By the same reasoning as for $C'_n$, the intersection $C''_n\cap C_m$ has at least three points.
	However, since $C$ is rational and $C_m\cup C'_n$ is connected, we see that $C''_n\cap(C_m\cup C'_n)$ can contain at most one point.
	So we have reached a contradiction.
	Therefore, $C_m$ is connected.
	
	By Property (\ref{item:components:unstable}), every irreducible component in $C_m$ contains at least three special points.
	Combining with the fact that $C$ is rational and $C_m$ is connected, we conclude that $C_m=\st(C)$, completing the proof of Property (\ref{item:components:stabilization}).
\end{proof}

\begin{construction}\label{const:tDelta}
	Let $\widebar{\mathcal M}_{0,5}$ denote the moduli space of 5-pointed rational algebraic stable curves over $k$.
	Let $\tau_{\widebar{\mathcal M}_{0,5}}\colon\widebar{\mathcal M}^\mathrm{an}_{0,5}\to\widebar M^\mathrm{trop}_{0,5}$ denote the tropicalization map sending pointed analytic stable curves to the associated extended tropical curves (cf.\ \cite{Abramovich_Tropicalization_2012}).
	Let $\Delta\subset\widebar M^\mathrm{trop}_{0,5}$ be as in \cref{const:Delta}.
	We set $\widetilde{\Delta}\coloneqq\tau_{\widebar{\mathcal M}_{0,5}}^{-1}(\Delta)\subset\widebar{\mathcal M}^\mathrm{an}_{0,5}$.
\end{construction}

\begin{prop}\label{prop:properness_d}
Let
\[\Phi=(\mathrm{st},\mathit{ev}_5)\colon\mathcal M^d(\beta)^\mathrm{an}\to\widebar{\mathcal M}^\mathrm{an}_{0,5}\times (Y')^\mathrm{an}\]
be the map given by stabilization of domain curves and the evaluation map of the fifth marked point.
Let
\[\mathcal M^d(\beta)_W\coloneqq\Phi^{-1}(\widetilde{\Delta}\times W^d),\]
\[\mathcal M^d(\beta,T)_W\coloneqq\mathcal M^d(\beta)_W\cap\mathcal M^d(\beta,T).\]
Then the restriction
\[\Phi|_{\mathcal M^d(\beta,T)_W} \colon \mathcal M^d(\beta,T)_W \to\widetilde{\Delta}\times W^d\]
is a proper map.
\end{prop}
\begin{proof}
	Consider the tropicalization map
	\[\tau_{\mathcal M^d}\colon\mathcal M^d(\beta)^\mathrm{an}\to M_{4+1}(B_f).\]
	Let $\big(C,(p_1,\dots,p_5),f\colon C\to (Y')^\mathrm{an}\big)$ be the analytic stable map corresponding to a point in $\mathcal M^d(\beta)_W$.
	Let $\big(\Gamma,(v_1,\dots,v_5),h\colon\Gamma\to B_f\big)$ be the associated pointed rational tropical curve in $B_f$ with four boundary points.
	Since $\mathcal M^d(\beta)_W=\Phi^{-1}(\widetilde{\Delta}\times W^d)$ and $W^d=\tau_Y^{-1}(h^d(v^d))$, we have $\tau_Y(f(p_5))=h^d(v^d)$.
	So $h(v_5)=h^d(v^d)$.
	
	Let $\st(C)$ denote the stabilization of the 5-pointed curve $(C,(p_1,\dots,p_5))$.
	Since $\mathcal M^d(\beta)_W=\Phi^{-1}(\widetilde{\Delta}\times W^d)$ and $\widetilde{\Delta}=\tau^{-1}_{\widebar{\mathcal M}_{0,5}}(\Delta)$, we have $\tau_{\widebar{\mathcal M}_{0,5}}(\st(C))\in\Delta$.
	Let $\Gamma^s$ be the convex hull of $v_1,\dots,v_4$ in $\Gamma$.
	By \cref{lem:components_of_the_domain_curve}(\ref{item:components:stabilization}), $\Gamma^s$ is a contraction of $\tau_{\widebar{\mathcal M}_{0,5}}(\st(C))$.
	So by the definition of $\Delta$, the path connecting $v_1,v_3$ and the path connecting $v_2,v_4$ in $\Gamma^s$ intersect, and the vertex $v_5$ lies in the intersection.
	Combining with the equality $h(v_5)=h^d(v^d)$ shown in the last paragraph, we deduce that
	\[\tau_{\mathcal M^d}(\mathcal M^d(\beta)_W)\subset\mathcal M^d_{4+1}(B_f),\]
	where $\mathcal M^d_{4+1}(B_f)$ is defined in \cref{const:tropical_moduli}.
	
	By \cref{prop:tropical_rigidity}, the subset $T^d_f\subset M^d_{4+1}(B_f)$ is a union of connected components.
	Therefore, the subspace $\mathcal M^d(\beta,T)_W\subset\mathcal M^d(\beta)_W$ is a union of connected components.
	Since the algebraic stack $\mathcal M^d(\beta)$ is proper over $k$, by \cite[Proposition 6.4]{Porta_Yu_Higher_analytic_stacks_2014}, its analytification $\mathcal M^d(\beta)^\mathrm{an}$ is a proper $k$-analytic\xspace stack.
	So the map
	\[\Phi\colon\mathcal M^d(\beta)^\mathrm{an}\to\widebar{\mathcal M}^\mathrm{an}_{0,5}\times(Y')^\mathrm{an}\]
	is proper.
	By base change, the map
	\[\Phi|_{\mathcal M^d(\beta)_W}\colon \mathcal M^d(\beta)_W\to\widetilde{\Delta}\times W^d\]
	is proper.
	Since the subspace $\mathcal M^d(\beta,T)_W\subset\mathcal M^d(\beta)_W$ is a union of connected components, we deduce that the map
	\[\Phi|_{\mathcal M^d(\beta,T)_W} \colon \mathcal M^d(\beta,T)_W \to\widetilde{\Delta}\times W^d\]
	is also proper, completing the proof.
\end{proof}

\section{Smoothness of moduli spaces}\label{sec:smoothness}

\begin{prop}\label{prop:smoothness}
	Let $\mathcal M(L^0,\beta)_0$ denote the subspace of $\mathcal M(L^0,\beta)$ consisting of stable maps $\big(C,(s_1,s_2,s_3),f\colon C\to Y'\big)$ satisfying the following conditions:
	\begin{enumerate}
		\item The domain curve $C$ is irreducible.
		\item The preimage $f^{-1}(\partial Y')$ is a Cartier divisor supported at the two marked points $s_1$ and $s_2$.
	\end{enumerate}
	Then there exists a nonempty Zariski open subset $V\subset Y'$ over which the evaluation map
	\[\mathit{ev}_3\colon\mathcal M(L^0,\beta)_0\to Y'\]
	is smooth.
	
	Similarly, we define the subspace $\mathcal M^p(L^0,\beta)_0\subset\mathcal M^p(L^0,\beta)$.
	Then there exists a nonempty Zariski open subset $V\subset\widetilde Y$ over which the evaluation map
	\[\mathit{ev}_3\colon\mathcal M^p(L^0,\beta)_0\to\widetilde Y\]
	is smooth.
\end{prop}
\begin{proof}
	Let us prove the statement for the stack $\mathcal M(L^0,\beta)$.
	The same arguments work for the stack $\mathcal M^p(L^0,\beta)$.
	Let $x$ be a closed point in $\mathcal M(L^0,\beta)_0$ and let $\big(C,(s_1,s_2,s_3),f\colon C\to Y'\big)$ be the corresponding stable map.
	Let $E$ denote the vector bundle $f^*T_{Y'}(-\log\partial Y')$.
	The derivative $\mathrm d\mathit{ev}_3$ of the evaluation map $\mathit{ev}_3$ at $x$ is given by the map
	\[ H^0(C,E)\longrightarrow f^*(T_{Y'})_{s_3}\simeq E_{s_3}.\]
	Assume that the derivative is surjective.
	Then the vector bundle $E$ is globally generated at the point $s_3$.
	Since $C$ is a projective line, the vector bundle $E$ is semi-positive, i.e.\ it is isomorphic to a direct sum of line bundles $\mathcal O(i)$ with $i\ge 0$.
	Therefore, the first cohomology $H^1(C,E)$ is zero.
	So by the dimension estimate in \cite[Proposition 5.3]{Keel_Rational_curves_1999}, the moduli space $\mathcal M(L^0,\beta)_0$ is smooth at $x$.
	By the surjectivity of the derivative $\mathrm d\mathit{ev}_3$ again, we deduce that the evaluation map $\mathit{ev}_3$ is smooth at $x$.
	Now let $\mathcal M'$ be the set of closed points in $\mathcal M(L^0,\beta)_0$ where the derivative $\mathrm d \mathit{ev}_3$ is not surjective.
	By \cite[Proposition 10.6]{Hartshorne_Algebraic_geometry_1977}, the Zariski closure of the image $\mathit{ev}_3(\mathcal M')$ has dimension less than or equal to one.
	So we can take $V$ to be the complement, completing the proof of the proposition.
\end{proof}

\begin{lem}\label{lem:trivial_bundle}
	Let $C$ be a nodal curve of arithmetic genus 0.
	Let $E$ be a vector bundle on $C$ such that $c_1(E)\cdot C'=0$ for every irreducible component $C'$ of $C$.
	Then $E$ is globally generated at a point $p\in C$ if and only if $E$ is a trivial vector bundle.
\end{lem}
\begin{proof}
	Note that $C$ is a tree of projective lines.
	Let $C'\subset C$ be an irreducible component of $C$ and let $p\in C'$ be a point.
	Assume that $E$ is globally generated at $p$.
	Then $E|_{C'}$ is a direct sum of line bundles $\mathcal O(i)$ with $i\ge 0$.
	Since $c_1(E)\cdot C'=0$, the vector bundle $E|_{C'}$ is trivial.
	Thus $H^0(C',E|_{C'})\to E_q$ is an isomorphism for all $q\in C'$.
	So the sections in $H^0(C,E)$ which generate $E_p$ also generate $E_q$ for all $q\in C'$, in particular for any nodal point of $C$ contained in $C'$.
	Now we can propagate the argument over the full tree and deduce that $E$ is a trivial vector bundle.
	The proof of the other direction is obvious.
\end{proof}

\begin{prop}\label{prop:smoothness_d}
	Let $\mathcal M^d(\beta)_0$ denote the subspace of $\mathcal M^d(\beta)$ consisting of stable maps $\big(C,(s_1,s_2,s_3,s_4,s_5),f\colon C\to Y'\big)$ satisfying the following conditions:
	\begin{enumerate}
		\item The domain curve $\big(C,(s_1,s_2,s_3,s_4,s_5)\big)$ is a stable 5-pointed curve.
		\item The preimage $f^{-1}(\partial Y')$ is a Cartier divisor supported at the four marked points $s_1,s_2,s_3$ and $s_4$.
	\end{enumerate}
	Then there is a nonempty Zariski open subset $V\subset\widebar{\mathcal M}_{0,5}\times Y'$ over which the map
	\[\Phi\coloneqq(\mathrm{st},\mathit{ev}_5)\colon\mathcal M^d(\beta)_0\longrightarrow\widebar{\mathcal M}_{0,5}\times Y'\]
	is smooth.
	Moreover, we can require that the projection from $V$ to $\widebar{\mathcal M}_{0,5}$ is surjective.
\end{prop}
\begin{proof}
	Consider the projection $\widebar{\mathcal M}_{0,5}\times Y'\to\widebar{\mathcal M}_{0,5}$.
	For every closed point $m\in\widebar{\mathcal M}_{0,5}$, let
	\[\Phi_m\colon\mathcal M^d(\beta)_{0,m}\to Y'\]
	denote the restriction of the map $\Phi$ to the fibers over $m$.
	Let $\mathcal M'_m$ denote the set of closed points of $\mathcal M^d(\beta)_{0,m}$ where the derivative $\mathrm d\Phi_m$ is not surjective.
	By \cite[Proposition 10.6]{Hartshorne_Algebraic_geometry_1977}, the Zariski closure of the image $\Phi_m(\mathcal M'_m)$ has dimension less than the dimension of $Y'$.
	Let $\mathcal M'\subset\mathcal M^d(\beta)_0$ be the union of $\mathcal M'_m$ over all closed points $m\in\widebar{\mathcal M}_{0,5}$.
	Let $V$ be the complement of the Zariski closure of the image $\Phi(\mathcal M')$ in $\widebar{\mathcal M}_{0,5}\times Y'$.
	Note that the projection from $V$ to $\widebar{\mathcal M}_{0,5}$ is surjective.
	
	Now let $m$ be a closed point in $\widebar{\mathcal M}_{0,5}$.
	Let $x$ be a closed point in $\mathcal M^d(\beta)_{0,m}$ outside the set $\mathcal M'_m$.
	Let $\big(C,(s_1,s_2,s_3,s_4,s_5),f\colon C\to Y'\big)$ be the corresponding stable map.
	Let $E$ denote the vector bundle $f^*\bigl(T_{Y'}(-\log\partial Y')\bigr)$.
	The derivative $\mathrm d\Phi_m$ at the point $x$ is given by the map
	\[H^0(C,E)\to f^*(T_{Y'})_{s_5}\simeq E_{s_5}.\]
	Since the point $x$ does not lie in the set $\mathcal M'_m$, the derivative $\mathrm d\Phi_m$ is surjective.
	In other words, the vector bundle $E$ is globally generated at the point $s_5$.
	Note that the boundary $\partial Y'$ represents the anti-canonical class $-K_{Y'}$ of $Y'$.
	By \cref{lem:trivial_bundle}, the vector bundle $E$ is trivial.
	Therefore, the first cohomology $H^1(C,E)$ vanishes.
	
	By \cite[Chapter II Theorem 1.7]{Kollar_Rational_curves_1996}, the dimension of $\mathcal M^d(\beta)_0$ at the point $x$ is at least
	\[h^0(C,E)-h^1(C,E)+\dim\widebar{\mathcal M}_{0,5}=h^0(C,E)+\dim\widebar{\mathcal M}_{0,5}.\]
	Note that the dimension of the Zariski tangent space of $\mathcal M^d(\beta)_{0,m}$ at $x$ is at most $h^0(C,E)$.
	Moreover, the dimension of the Zariski tangent space of $\mathcal M^d(\beta)_0$ at $x$ is at most the dimension of the Zariski tangent space of $\mathcal M^d(\beta)_{0,m}$ at $x$ plus the dimension of the Zariski tangent space of $\widebar{\mathcal M}_{0,5}$ at $m$.
	Therefore, the dimension of the Zariski tangent space of $\mathcal M^d(\beta)_0$ at $x$ equals the dimension of the space $\mathcal M^d(\beta)_0$ itself at $x$.
	So $\mathcal M^d(\beta)_0$ is smooth at $x$.
	Furthermore, the surjectivity of the derivative $\mathrm d\Phi_m$ at $x$ implies the surjectivity of the derivative $\mathrm d\Phi$ at $x$.
	Thus the map $\Phi$ is smooth at $x$.
	To conclude, the Zariski open subset $V\subset\widebar{\mathcal M}_{0,5}\times Y'$ we constructed above satisfies all the conditions in the proposition.
\end{proof}

\begin{prop}\label{prop:deformation}
	Given any Looijenga pair $(Y,D)$, there is a deformation $\mathcal Y$ of $Y$ preserving $D$ such that $\mathcal Y$ does not contain any proper curve disjoint from $D$.
\end{prop}
\begin{proof}
	Denote
	\[D^\perp\coloneqq\Set{\alpha\in\Pic(Y) | \alpha\cdot[D']=0\text{ for all irreducible component } D' \text{ of } D}.\]
	Let $\Pic^0(D)\subset\Pic(D)$ denote the subset consisting of line bundles on $D$ of degree 0 on every irreducible component of $D$.
	Fix a cyclic ordering of the irreducible components of $D$.
	By \cite[Lemma 2.1(1)]{Gross_Moduli_of_surfaces_2015}, it induces an identification $\Pic^0(D)=\mathbb G_{\mathrm m/\mathbb C}$.
	
	Let $\mathcal Y$ be a deformation of $Y$ preserving $D$.
	Restriction of line bundles gives a homomorphism
	\[\widetilde{\phi}_{\mathcal Y}\colon\Pic(\mathcal Y)\to\Pic(D).\]
	The lattice $\Pic(\mathcal Y)$ can be canonically identified with $\Pic(Y)$, together with the intersection form and the classes of the irreducible components of $D$.
	So $\widetilde{\phi}_{\mathcal Y}$ induces a homomorphism
	\[\phi_{\mathcal Y}\colon D^\perp\to\Pic^0(D)=\mathbb G_{\mathrm m/\mathbb C}.\]
	
	Let $\operatorname{Def}(Y,D)$ denote the versal deformation space of $Y$ preserving $D$.
	The construction above gives a local period mapping
	\[\phi\colon\operatorname{Def}(Y,D)\to\Hom(D^\perp,\mathbb G_{\mathrm m/\mathbb C}),\]
	which is a local analytic isomorphism (cf.\ \cite[Proposition 4.1]{Gross_Moduli_of_surfaces_2015} and \cite[II.2.5]{Looijenga_Rational_1981}).
	
	For each $\alpha\in D^\perp$, let $T_\alpha\subset\Hom(D^\perp,\mathbb G_{\mathrm m/\mathbb C})$ be the subtorus consisting of $\psi\in\Hom(D^\perp,\mathbb G_{\mathrm m/\mathbb C})$ such that $\psi(\alpha)=1$.
	Let $\mathcal Y$ be a deformation of $Y$ in the preimage
	\[\phi^{-1}\Biggl(\Hom(D^\perp,\mathbb G_{\mathrm m/\mathbb C})\setminus\biggl(\bigcup_{\alpha\in D^\perp} T_\alpha\biggr)\Biggr).\]
	By construction, there is no line bundle $\alpha$ on $\mathcal Y$ in $D^\perp$ whose restriction to $D$ is trivial.
	In particular, there are no proper curves in $\mathcal Y$ disjoint from $D$.
\end{proof}

\begin{assumption}
	Note that the enumeration of holomorphic cylinders for a Looijenga pair $(Y,D)$ is invariant under deformations of $Y$ preserving $D$.
	In virtue of \cref{prop:deformation}, we will assume from now on that $Y$ does not contain any proper curve disjoint from $D$.
\end{assumption}

Under the assumption above, \cref{lem:components_of_the_domain_curve} implies the following:

\begin{lem}\label{lem:stable_domain}
	Let $\mathcal M(L^0,\beta)_0$ and $\mathcal M^d(\beta)_0$ be as in Propositions \ref{prop:smoothness} and \ref{prop:smoothness_d} respectively.
	We have $\mathcal M(L^0,\beta,T)\subset\mathcal M(L^0,\beta)^\mathrm{an}_0$ and $\mathcal M^d(\beta,T)\subset\mathcal M^d(\beta)^\mathrm{an}_0$.
\end{lem}

Similarly, we have the following:

\begin{lem}\label{lem:stable_domain_p}
	Let $p_{Y,1}\colon\widetilde Y\to\mathbb P^1_k$ denote the projection map induced by the map of simplicial cone complexes $\widetilde B'\to\mathbb R=\mathbb R_{<0}\cup\{0\}\cup\mathbb R_{>0}$.
	Consider the composite map
	\[(p^\mathrm{an}_{Y,1}\circ\mathit{ev}_3)\colon\mathcal M^p(L^0,\beta,T)\to(\mathbb P^1_k)^\mathrm{an}.\]
	Let $\mathcal M^p(L^0,\beta,T)_1\coloneqq(p^\mathrm{an}_{Y,1}\circ\mathit{ev}_3)^{-1}(\mathbb G_{\mathrm m/k}^\mathrm{an})$.
	Let $\mathcal M^p(L^0,\beta)_0$ be as in \cref{prop:smoothness}.
	Then we have $\mathcal M^p(L^0,\beta,T)_1\subset\mathcal M^p(L^0,\beta)^\mathrm{an}_0$.
\end{lem}

\begin{lem} \label{lem:non-stacky}
	The $k$-analytic\xspace stacks $\mathcal M(L^0,\beta,T)$, $\mathcal M^p(L^0,\beta,T)_1$ and $\mathcal M^d(\beta,T)$ are $k$-analytic\xspace spaces.
\end{lem}
\begin{proof}
	The stack $\mathcal M(L^0,\beta)$ is an algebraic Deligne-Mumford\xspace stack over $k$, so it is a quotient of an étale groupoid in $k$-schemes of finite type.
	Then its analytification $\mathcal M(L^0,\beta)^\mathrm{an}$ is a quotient of an étale groupoid in $k$-analytic\xspace spaces, so is the analytic domain $\mathcal M(L^0,\beta,T)$ in $\mathcal M(L^0,\beta)^\mathrm{an}$.
	By \cref{lem:stable_domain}, the points in $\mathcal M(L^0,\beta,T)$ do not have non-trivial automorphisms.
	So we can write $\mathcal M(L^0,\beta,T)$ as a quotient of an étale equivalence relation in $k$-analytic\xspace spaces.
	Since the $k$-analytic\xspace stack $\mathcal M(L^0,\beta,T)$ is separated, it follows from \cite[Theorem 1.2.2]{Conrad_Non-archimedean_analytification_2009} that it is isomorphic to a $k$-analytic\xspace space.
	Using \cref{lem:stable_domain_p} and \cref{lem:stable_domain}, the same argument shows that the $k$-analytic\xspace stacks $\mathcal M^p(L^0,\beta,T)_1$ and $\mathcal M^d(\beta,T)$ are also $k$-analytic\xspace spaces.
\end{proof}

We recall that a map of $k$-analytic\xspace spaces $\phi\colon X'\to X$ is said to be \emph{finite} if there is an affinoid G-covering $\{V_i\}$ of $X$ such that every $\phi^{-1}(V_i)\to V_i$ is a finite map of $k$-affinoid spaces, i.e.\ the corresponding homomorphism of $k$-affinoid algebras is finite.

We refer to \cite{Berkovich_Etale_1993,Ducros_Families_2011} for the notion of étale map of $k$-analytic\xspace spaces.
For a finite étale map of $k$-analytic\xspace spaces $\phi\colon X'\to X$, we have an affinoid G-covering $\{V_i\}$ of $X$ such that every $\phi^{-1}(V_i)\to V_i$ is a finite étale map of $k$-affinoid spaces, i.e.\ the corresponding homomorphism of $k$-affinoid algebras is finite étale.
Therefore, $\phi_*\mathcal O_{X'}$ is a finite locally free $\mathcal O_X$-module.
We define the \emph{degree} of the finite étale map $\phi$ to be the rank of $\phi_*\mathcal O_{X'}$ viewed as a finite locally free $\mathcal O_X$-module.

By \cref{lem:non-stacky}, all the moduli stacks involved in the following proposition and the following theorem are $k$-analytic\xspace spaces.

\begin{prop}\label{prop:finite_etale}
	There exists three nonempty Zariski open subsets
	$V^0\subset W^0$, $V^p\subset W^p$ and $V^d\subset\widetilde{\Delta}\times W^d$, such that the three maps
	\begin{align*}
	&\mathit{ev}_3\colon\mathcal M(L^0,\beta,T)_W\to W^0\\
	&\mathit{ev}_3\colon\mathcal M^p(L^0,\beta,T)_W\to W^p\\
	&\Phi=(\mathrm{st},\mathit{ev}_5)\colon\mathcal M^d(\beta,T)_W\to\widetilde{\Delta}\times W^d
	\end{align*}
	considered in \cref{sec:analytic_constructions} are finite étale over $V^0$, $V^p$ and $V^d$ respectively.
	Moreover, we can assume that the projection $V^d\to\widetilde{\Delta}$ is surjective.
	We will denote respectively by $\mathcal M(L^0,\beta,T)_V$, $\mathcal M^p(L^0,\beta,T)_V$ and $\mathcal M^d(\beta,T)_V$ the preimages of $V^0, V^p$ and $V^d$ of the three maps considered above.
\end{prop}
\begin{proof}
	Let us prove for the first map.
	\cref{prop:smoothness} and \cref{lem:stable_domain} imply that there exists a nonempty Zariski open subset $V^0\subset W^0$ such that the first map is smooth over $V^0$.
	Using the notations in the proof of \cref{prop:smoothness}, the dimension of the space $\mathcal M(L^0,\beta,T)_W$ is equal to the dimension of $H^0(C,E)$.
	Using the Riemann-Roch formula, we compute that
	\[\dim(H^0(C,E))=\chi(C,E)=\rank E + \deg E = 2+0 =2.\]
	So the dimension of $\mathcal M(L^0,\beta,T)_W$ equals the dimension of $W^0$.
	Thus the map $\mathit{ev}_3\colon\mathcal M(L^0,\beta,T)_W\to W^0$ is étale over $V^0$.
	Moreover, the map $\mathit{ev}_3\colon \mathcal M(L^0,\beta,T)_W \to W^0$ is proper by \cref{prop:properness}.
	So it is finite over $V^0$ by \cite[Corollary 3.3.8]{Berkovich_Spectral_1990}.
	To conclude, the map $\mathit{ev}_3\colon\mathcal M(L^0,\beta,T)_W\to W^0$ is finite étale over $V^0$.
	The same reasoning applies also to the second map and the third map, using Propositions \ref{prop:smoothness}, \ref{prop:smoothness_d}, Lemmas \ref{lem:stable_domain}, \ref{lem:stable_domain_p}, and Propositions \ref{prop:properness}, \ref{prop:properness_d}.
\end{proof}

\begin{thm}\label{thm:degree}
	Let $\beta'$ denote the curve class associated to the extension from $L^0$ to $\widehat L^0$ (cf.\ \cite[\S 4,5]{Yu_Enumeration_cylinders_2015}).
	Let $\beta^0\coloneqq\beta-\beta'$.
	The finite étale maps
	\begin{align*}
	&\mathit{ev}_3\colon\mathcal M(L^0,\beta,T)_V\to V^0, \text{ and}\\
	&\mathit{ev}_3\colon\mathcal M^p(L^0,\beta,T)_V\to V^p
	\end{align*}
	have the same degree.
	The degree is equal to the number $N(L^0,\beta^0)$ of holomorphic cylinders associated to the spine $L^0$ and the curve class $\beta^0$.
	As a consequence, the number $N(L^0,\beta^0)$ is a nonnegative integer.
\end{thm}
\begin{proof}
	Let $\mathcal M(L^0,\beta)_0$ and $\mathcal M^p(L^0,\beta)_0$ be as in \cref{prop:smoothness}.
	Recall that we have two projections $p_{Y,1}\colon\widetilde Y\to\mathbb P^1_k$ and $p_{Y,2}\colon\widetilde Y\to Y'$.
	Composing the evaluation map of the third marked point with the first projection, we get a natural map
	\[p_{Y,1}\circ\mathit{ev}_3\colon \mathcal M^p(L^0,\beta)_0\to\mathbb P^1_k.\]
	Composing the stable maps with the second projection, we get a natural map
	\[\pi_2\colon \mathcal M^p(L^0,\beta)_0\to\mathcal M(L^0,\beta)_0.\]
	Combining the two, we obtain a natural map
	\[\Psi\coloneqq(p_{Y,1}\circ\mathit{ev}_3,\pi_2)\colon\mathcal M^p(L^0,\beta)_0\to\mathbb P^1_k\times\mathcal M(L^0,\beta)_0.\]
	By construction, we see that $\Psi$ is an isomorphism over $\mathbb G_{\mathrm m/k}\times\mathcal M(L^0,\beta)_0$.
	It follows from Lemmas \ref{lem:stable_domain} and \ref{lem:stable_domain_p} that the finite étale maps
	\begin{align*}
	&\mathit{ev}_3\colon\mathcal M(L^0,\beta,T)_V\to V^0, \text{ and}\\
	&\mathit{ev}_3\colon\mathcal M^p(L^0,\beta,T)_V\to V^p
	\end{align*}
	have the same degree.
	The construction of the number $N(L^0,\beta^0)$ in \cite{Yu_Enumeration_cylinders_2015}, as reviewed in \cref{sec:review_of_cylinder_counts}, involves a virtual fundamental class.
	Here in our situation, it follows from étaleness that the virtual fundamental class is equal to the fundamental class.
	Therefore, the number $N(L^0,\beta^0)$ is equal to the degree of the finite étale maps above.
	As a consequence, the number $N(L^0,\beta^0)$ is a nonnegative integer.
\end{proof}

\begin{rem} \label{rem:symmetry}
	Recall that we have the extended spine \[\widehat L^0=(\widehat\Gamma^0,(u^0_1,u^0_2),\widehat h^0\colon(\widehat\Gamma^0)^\circ\to B)\]
	associated to the spine $L^0=(\Gamma^0,(v^0_1,v^0_2),h^0\colon\Gamma^0\to B)$.
	Let $r\in\widehat\Gamma^0$ be any point in the interior of an edge of $\widehat\Gamma^0$, or any bounded vertex where the $\mathbb Z$-affine\xspace map $\widehat h^0$ is balanced.
	Fix a point $v\in V^0\subset X^\mathrm{an}_k$.
	Let $v'$ be a general point in the fiber of $\tau\colon X^\mathrm{an}_k\to B$ over $\widehat h^0(r)\in B$.
	Let $\mathcal M(L^0,\beta,T)_v$ and $\mathcal M(L^0,\beta,T)_{v'}$ denote respectively the fibers of the evaluation map
	\[\mathit{ev}_3\colon\mathcal M(L^0,\beta,T)\to (Y')^\mathrm{an}\]
	over the points $v$ and $v'$ in $(Y')^\mathrm{an}$.
	The symmetry property of \cite[Theorem 6.3]{Yu_Enumeration_cylinders_2015} implies that
	\[\deg\mathcal M(L^0,\beta,T)_v=\deg\mathcal M(L^0,\beta,T)_{v'}\]
	when $r$ is the vertex $v^0_2\in\widehat\Gamma^0$.
	In fact, the same proof of \cite[Theorem 6.3]{Yu_Enumeration_cylinders_2015} shows that the equality above always holds.
\end{rem}

\section{The gluing formula}\label{sec:gluing}

With the preparations in the previous sections, we will prove the gluing formula in this section.

Consider the moduli space $\widebar{\mathcal M}_{0,5}$ of 5-pointed rational stable curves over $k$.
We label the 5 marked points by $s^1_1, s^1_2, s^2_1, s^2_2$ and $s_5$.
The graph $G$ (resp.\ $G'$) and the labeling of its legs in \cref{const:graphs} give rise to a 0-dimensional stratum in $\widebar{\mathcal M}_{0,5}$ which we denote by $m$ (resp.\ $m'$).

Let $V^d$ be as in \cref{prop:finite_etale} and consider the projection $V^d\to\widetilde{\Delta}$.
Let $w$ be a point in the fiber over $m$ and let $w'$ be a point in the fiber over $m'$.
Let $\widebar w$ and $\widebar w'$ be respectively the images of $w$ and $w'$ under the projection $V^d\to W^d$.

Consider the map
\[\Phi=(\mathrm{st},\mathit{ev}_5)\colon\mathcal M^d(\beta,T)_V\to V^d.\]
Let $\mathcal M^d(\beta,T)_{w}$ and $\mathcal M^d(\beta,T)_{w'}$ be the two fibers over the points $w$ and $w'$ respectively.

\begin{prop}\label{prop:point}
	Let $\big(C,(s^1_1, s^1_2,s^2_1,s^2_2,s_5),f\colon C\to (Y')^\mathrm{an}\big)$ be a stable map in $\mathcal M^d(\beta,T)_{w}$.
	Let $C^5$ be the irreducible component of $C$ containing the marked point $s_5$.
	Then we have $f(C^5)=\widebar w$.
	The same applies to $w'$.
\end{prop}
\begin{proof}
	Since $w\in V^d$ lies in the fiber over $m\in\widebar{\mathcal M}_{0,5}$, the irreducible component $C^5$ does not contain the other marked points $s^1_1,s^1_2,s^2_1,s^2_2$.
	By \cref{lem:components_of_the_domain_curve}(\ref{item:components:marked_points}), the image $f(C^5)$ lies in the interior $(Y'\setminus\partial Y')^\mathrm{an}\simeq X^\mathrm{an}_k$.
	The map $f|_{C^5}\colon C^5\to X^\mathrm{an}_k$ gives rise to a tropical curve $h\colon\Gamma\to B$, where $\Gamma$ is a $\mathbb Z$-affine\xspace tree and $h$ is a $\mathbb Z$-affine\xspace immersion that is balanced everywhere outside of $h^{-1}(O)$.
	
	Since $f(s_5)=\widebar w$, the image $h(\Gamma)$ contains the point $\tau(\widebar w)\in B$.
	By the balancing condition, we must have $h(\Gamma)=\tau(\widebar w)$.
	Since the preimage $\tau^{-1}(\tau(\widebar w))$ is affinoid, it cannot contain any proper curve.
	So we must have $f(C^5)=\widebar w$, completing the proof.
	The same argument applies to $w'$.
\end{proof}

Consider the evaluation map of the third marked point
\[\mathit{ev}_3\colon\mathcal M(L^1,\beta,T)\to(Y')^\mathrm{an}.\]
Let $\mathcal M(L^1,\beta,T)_{\widebar w'}$ be the fiber over the point $\widebar w'\in W^d$.
Similarly, we define $\mathcal M(L^2,\beta,T)_{\widebar w'}$, $\mathcal M(L^3,\beta,T)_{\widebar w}$ and $\mathcal M(L^4,\beta,T)_{\widebar w}$.

By the construction of the subset $V^d\subset\widetilde{\Delta}\times W^d$ in \cref{prop:finite_etale}, the space $\mathcal M(L^2,\beta,T)_{\widebar w'}$ (resp. $\mathcal M(L^3,\beta,T)_{\widebar w}$, $\mathcal M(L^4,\beta,T)_{\widebar w}$) is finite étale over the point $\widebar w'$ (resp.\ $\widebar w, \widebar w$).

For $i=1,\dots,3$, let $\beta^i$ denote the curve class associated to the extension of the spine from $L^i$ to $\widehat L^i$ (cf.\ \cite[\S 4,5]{Yu_Enumeration_cylinders_2015}).

\begin{prop}\label{prop:degree}
	We have the following equalities:
	\begin{align*}
		& \deg\mathcal M(L^1,\beta,T)_{\widebar w'} = N(L^1,\beta-(\beta^1)'),\\
		& \deg\mathcal M(L^2,\beta,T)_{\widebar w'} = N(L^2,\beta-(\beta^2)'),\\
		& \deg\mathcal M(L^3,\beta,T)_{\widebar w} = N(L^3,\beta-(\beta^3)').
	\end{align*}
\end{prop}
\begin{proof}
	Let $v$ be a general point in the fiber of the map $\tau\colon X^\mathrm{an}_k\to B$ over $h^1(v^1_1)\in B$.
	Let $\mathcal M(L^1,\beta,T)_{v}$ (resp.\ $\mathcal M(L^3,\beta,T)_{v}$) be the fiber of the evaluation map
	\[\mathit{ev}_3\colon\mathcal M(L^1,\beta,T)\to(Y')^\mathrm{an} \qquad \text{(resp.\ $\mathit{ev}_3\colon\mathcal M(L^3,\beta,T)\to(Y')^\mathrm{an}$)}\]
	over the point $v$.
	From \cref{thm:degree}, replacing $L^0$ with $L^1, L^2, L^3$ respectively, we deduce the following equalities
	\begin{align*}
	& \deg\mathcal M(L^1,\beta,T)_{v} = N(L^1,\beta-(\beta^1)'),\\
	& \deg\mathcal M(L^2,\beta,T)_{\widebar w'} = N(L^2,\beta-(\beta^2)'),\\
	& \deg\mathcal M(L^3,\beta,T)_{v} = N(L^3,\beta-(\beta^3)').
	\end{align*}
	By the symmetry property in \cite[\S 6]{Yu_Enumeration_cylinders_2015}, as we recalled in \cref{rem:symmetry}, we have
	\begin{align*}
	&\deg\mathcal M(L^1,\beta,T)_{v} = \deg\mathcal M(L^1,\beta,T)_{\widebar w'},\\
	& \deg\mathcal M(L^3,\beta,T)_{v} = \deg\mathcal M(L^3,\beta,T)_{\widebar w}.
	\end{align*}
	We conclude the proof by combining all the equalities above.
\end{proof}

\begin{lem} \label{lem:automorphism1}
	Let $\mathbb G_{\mathrm m/k}^n\coloneqq\Spec k[X_1^{\pm 1},\dots,X_n^{\pm 1}]$.
	Let $\sigma\colon(\mathbb G_{\mathrm m/k}^n)^\mathrm{an}\to\mathbb R^n$ be the continuous map given by taking coordinate-wise valuations.
	Let $\Omega\subset\mathbb R^n$ be a rational convex polyhedron, i.e., it is given by finitely many linear inequalities with rational coefficients and is compact.
	Assume that $\Omega$  has nonempty interior.
	Let $T_\Omega$ denote the affinoid algebra of the affinoid space $\sigma^{-1}(\Omega)$.
	Let $\phi$ be an automorphism of $\sigma^{-1}(\Omega)$ preserving the map $\sigma$.
	Then for any $\gamma\in\mathbb Z^n$, we have $\phi^*(X^\gamma)=c_\gamma\cdot X^\gamma (1+f_\gamma)$, where $c_\gamma$ is an element in $k$ of norm 1, and $f_\gamma$ is an element in $T_\Omega$ of spectral norm less than 1.
\end{lem}
\begin{proof}
	Write $\phi^*(X^\gamma)=\sum_{\nu\in\mathbb Z^n}c_\nu X^\nu$ with $c_\nu\in k$.
	Since $\phi$ preserves the map $\sigma$, $\phi^*(X^\gamma)$ has no zeros in $\sigma^{-1}(\Omega)$.
	We claim that there exists $\nu_0\in\mathbb Z^n$ such that $\abs{(c_{\nu_0} X^{\nu_0})(x)}>\abs{(c_\nu X^\nu)(x)}$ for all $\nu\neq\nu_0$ and all rigid points $x\in\sigma^{-1}(\Omega)$.
	Otherwise, there is a rigid point $x\in\sigma^{-1}(\Omega)$, $\nu_1,\nu_2\in\mathbb Z^n$ such that $\abs{(c_{\nu_1} X^{\nu_1})(x)}=\abs{(c_{\nu_2} X^{\nu_2})(x)}\ge\abs{(c_\nu X^\nu)(x)}$ for all $\nu\in\mathbb Z^n$.
	Fixing the first $(n-1)$ coordinates of $x$ and varying the last one, by \cite[Lemma 9.7.1/1]{Bosch_Non-archimedean_1984}, we see that $\phi^*(X^\gamma)$ is not invertible, which is a contradiction.
	So we have justified our claim.
	Using again the assumption that $\phi$ preserves the map $\sigma$, we see that $\nu_0=\gamma$ and $\abs{c_\gamma}=1$, completing the proof.
\end{proof}

\begin{lem} \label{lem:automorphism2}
	Let $\mathbb A_k^n\coloneqq\Spec[X_1,\dots,X_n]$.
	Let $\widebar\sigma\colon(\mathbb A_k^n)^\mathrm{an}\to(-\infty,+\infty]^n$ be the continuous map given by taking coordinate-wise valuations.
	Let $\widebar\Omega\subset(-\infty,+\infty]^n$ be a rational convex polyhedron, i.e., it is given by finitely many linear inequalities with rational coefficients and is compact.
	Assume that $\widebar\Omega$  has nonempty interior.
	Let $T_{\widebar\Omega}$ be the affinoid algebra of the affinoid space $\widebar\sigma^{-1}(\widebar\Omega)$.
	Let $f_1,\dots,f_n\in T_{\widebar\Omega}$ be $n$ elements of spectral norm less than 1.
	Let $\varphi$ be the endomorphism of $T_{\widebar\Omega}$ given by $X_i\mapsto X_i(1+f_i)$.
	Then $\varphi$ is an automorphism.
	It induces an automorphism of $\widebar\sigma^{-1}(\widebar\Omega)$ preserving the map $\widebar\sigma$.
\end{lem}
\begin{proof}
	Decompose $\varphi=\mathrm{id}+B$ as an operator on the Banach space $T_{\widebar\Omega}$.
	Since $f_i$ has spectral norm less than 1, we see that $B$ has operator norm less than 1.
	Therefore, the operator $\varphi$ has an inverse $\varphi^{-1}=\sum_{j=0}^\infty (-1)^j B^j$.
	Since $\varphi$ preserves the multiplication on $T_{\widebar\Omega}$, so does $\varphi^{-1}$.
	We conclude that $\varphi$ is an automorphism of the affinoid algebra $T_{\widebar\Omega}$ and it induces an automorphism of the affinoid space $\widebar\sigma^{-1}(\widebar\Omega)$ preserving the map $\widebar\sigma$.
\end{proof}

\begin{prop}\label{prop:glue_annuli}
	Let $n\in\mathbb Z_{\ge 0}$, $r_1,\dots,r_n,r'_1,\dots,r'_n,p,q,s,t\in\sqrt{\abs{k}}\cup\{+\infty\}$.
	Assume $0<r'_i<r_i<+\infty$, $0\le p<s<t<q\le+\infty$.
	Let $R\coloneqq\prod_{i=1}^n[r'_i,r_i]\subset\mathbb R^n$.
	Let $X$ be a $k$-analytic\xspace space and $\rho\colon X\to R\times[p,q]$ a continuous map.
	Let $\pi\colon(\Spec k[T_1^{\pm 1},\dots,T_n^{\pm 1},S^{\pm 1}])^\mathrm{an}\to(0,+\infty)^{n+1}$ be the continuous map given by taking coordinate-wise norms.
	Let $\widebar\pi\colon(((\mathbb P^1_k)^\mathrm{an}))^{n+1}\to[0,+\infty]^{n+1}$ be the continuous extension of $\pi$.
	Assume that we have isomorphisms
	\[\begin{tikzcd}[column sep=small]
	\rho^{-1}(R\times[p,t])\arrow{rr}{\alpha}[swap]{\sim} \arrow{rd}[swap]{\rho} && \widebar\pi^{-1}(R\times[p,t])\arrow{ld}{\widebar\pi}\\
	& R\times[p,t]
	\end{tikzcd}\]
	and
	\[\begin{tikzcd}[column sep=small]
	\rho^{-1}(R\times[s,q])\arrow{rr}{\beta}[swap]{\sim} \arrow{rd}[swap]{\rho} && \widebar\pi^{-1}(R\times[s,q])\arrow{ld}{\widebar\pi}\\
	& R\times[s,q]
	\end{tikzcd}.\]
	Then we have an isomorphism
	\[\begin{tikzcd}[column sep=small]
	X\arrow{rr}{\sim} \arrow{rd}[swap]{\rho} && \widebar\pi^{-1}(R\times[p,q])\arrow{ld}{\widebar\pi}\\
	& R\times[p,q]
	\end{tikzcd}.\]
\end{prop}
\begin{proof}
	Let $\mathcal A,\mathcal B,\mathcal C$ be affinoid algebras such that
	\begin{gather*}
	\rho^{-1}(R\times[s,t])=\Sp\mathcal A,\\
	\rho^{-1}(R\times[p,t])=\Sp\mathcal B,\\
	\rho^{-1}(R\times[s,q])=\Sp\mathcal C.
	\end{gather*}
	Let $\norm{\cdot}_\mathcal A$, $\norm{\cdot}_\mathcal B$, $\norm{\cdot}_\mathcal C$ denote the spectral norms on $\mathcal A,\mathcal B,\mathcal C$ respectively.
	Assume that the isomorphisms $\alpha$ and $\beta$ are given by the following isomorphisms of affinoid algebras:
	\begin{gather*}
	k\langle r_1^{-1} T_1,r'_1 T_1^{-1},\dots,r_n^{-1} T_n,r'_n T_n^{-1},t^{-1} S,pS^{-1}\rangle\xrightarrow{\ \phi\ }\mathcal B,\quad T_i\mapsto f_i,\ S\mapsto f,\\
	k\langle r_1^{-1} T_1,r'_1 T_1^{-1},\dots,r_n^{-1} T_n,r'_n T_n^{-1},s S',q^{-1} (S')^{-1}\rangle\xrightarrow{\ \psi\ }\mathcal C,\quad T_i\mapsto g_i,\ S'\mapsto g.
	\end{gather*}
	In the case $p=0$, we remove the term $p S^{-1}$ from the expression above.
	In the case $q=+\infty$, we remove the term $q^{-1} (S')^{-1}$ from the expression above.
	Consider the isomorphism
	\[\mathcal B\langle s f^{-1}\rangle\to\mathcal C\langle t^{-1} g^{-1}\rangle,\quad f_i\mapsto g_i,\  f\mapsto g^{-1}.\]
	Up to multiplying $g_1,\dots,g_n$ and $g$ by elements in $k$ of norm 1, it follows from \cref{lem:automorphism1} that we can assume that $\norm{f_i-g_i}_\mathcal A<\norm{f_i}_\mathcal A$ and $\norm{f-g^{-1}}_\mathcal A<\norm{f}_\mathcal A$.
	Now we proceed as in the proof of \cite[Lemma 3.2]{Temkin_Local_2000}.
	Let $\mathcal B_+$ and $\mathcal C_+$ be the subspaces of $\mathcal B$ and $\mathcal C$ consisting of elements of the form $\sum_{\nu\in\mathbb Z^n,j\ge 0}\lambda_{\nu,j}f_1^{\nu_1}\cdots f_n^{\nu_n} f^j$ and $\sum_{\nu\in\mathbb Z^n,j\ge 0}\mu_{\nu,j}g_1^{\nu_1}\cdots g_n^{\nu_n} g^j$ respectively.
	It is shown in the proof of \cite[Lemma 3.2]{Temkin_Local_2000} that each element $a\in\mathcal A$ can be decomposed as $a=b+c$ with $b\in\mathcal B_+$, $c\in\mathcal C_+$, and $\norm{b}_\mathcal B,\norm{c}_\mathcal C\le\norm{a}_\mathcal A$.
	So we have $f_i-g_i=b_i+c_i$ and $f-g^{-1}=b+c$, where $b_i,b\in\mathcal B_+$, $c_i,c\in\mathcal C_+$, $\norm{b_i}_\mathcal B,\norm{c_i}_\mathcal C\le\norm{f_i-g_i}_\mathcal A$ and $\norm{b}_\mathcal B,\norm{c}_\mathcal C\le\norm{f-g^{-1}}_\mathcal A$.
	By \cref{lem:automorphism2}, the homomorphisms
	\[
	k\langle r_1^{-1} T_1,r'_1 T_1^{-1},\dots,r_n^{-1} T_n,r'_n T_n^{-1},t^{-1} S,pS^{-1}\rangle\xrightarrow{\ \phi\ }\mathcal B,\quad T_i\mapsto f_i-b_i,\ S\mapsto f-b,\]
	\begin{multline*}
	k\langle r_1^{-1} T_1,r'_1 T_1^{-1},\dots,r_n^{-1} T_n,r'_n T_n^{-1},s S',q^{-1} (S')^{-1}\rangle\xrightarrow{\ \psi\ }\mathcal C,\\ T_i\mapsto g_i+c_i,\ S'\mapsto (g^{-1}+c)^{-1}=g(1+gc)^{-1}
	\end{multline*}
	are isomorphisms.
	So we deduce the isomorphism claimed in the proposition.
\end{proof}

\begin{prop}\label{prop:straight_spine}
	Let $\beta^4=(\beta^1)'+(\beta^2)'-(\beta^3)'$.
	We have
	\[\deg\mathcal M(L^4,\beta,T)_{\widebar w}=
	\begin{cases}
		1 & \text{for } \beta=\beta^4,\\
		0 & \text{otherwise.}
	\end{cases}\]
\end{prop}
\begin{proof}
	For any rigid point $w^4\in\widetilde Y^\mathrm{an}$, let $\mathcal M^p(L^4,\beta,T)_{w^4}$ be the fiber of the evaluation map
	\[\mathit{ev}_3\colon\mathcal M^p(L^4,\beta,T)\to\widetilde Y^\mathrm{an}\]
	over $w^4$.
	By \cref{prop:finite_etale} and \cref{thm:degree}, replacing $L^0$ with $L^4$, there exists a rigid point $w^4\in\mathbb G_{\mathrm m/k}^\mathrm{an}\times W^d\subset\widetilde Y^\mathrm{an}$ such that $\mathcal M^p(L^4,\beta,T)_{w^4}$ is finite étale over $w^4$ and its degree equals the degree of $\mathcal M(L^4,\beta,T)_{\widebar w}$.
	Since the extended spine $\widehat L^4$ is straight with respect to the $\mathbb Z$-affine\xspace structure on $B\setminus O$, by \cref{prop:glue_annuli}, there exists an analytic domain $\widetilde U\subset\widetilde Y^\mathrm{an}$ satisfying the following properties:
	\begin{enumerate}
		\item The analytic domain $\widetilde U$ is isomorphic to the product of a projective line $(\mathbb P^1_k)^\mathrm{an}$ with a 2-dimensional affinoid space.
		\item Any stable map in $\mathcal M^p(L^4,\beta,T)_{w^4}$ lies in $\widetilde U$.
	\end{enumerate}
	Therefore, any stable map in $\mathcal M^p(L^4,\beta,T)_{w^4}$ must have curve class in $s^p(L^4,\beta^4)$.
	If $\mathcal M^p(L^4,\beta,T)_{w^4}\neq\emptyset$, its degree over $w^4$ must be 1.
	So the proof is complete.
\end{proof}

Let $\widebar{\mathcal M}_{0,3}(\widebar w)$ denote the stack of 3-pointed rational stable maps into the point $\widebar w$.
The stack $\widebar{\mathcal M}_{0,3}(\widebar w)$ is just a point.
Similarly, we denote $\widebar{\mathcal M}_{0,3}(\widebar w')$ for the point $\widebar w'$.
Let $\beta^d\coloneqq\beta^3+(\beta^1)'+(\beta^2)'$.
It follows from \cref{prop:point} that we have two isomorphisms
\begin{align}
\label{eq:isom_w'}
&\mathcal M^d(\beta^d,T)_{w'}\simeq\coprod_{\widehat\beta^1+\widehat\beta^2=\beta^d}\mathcal M(L^1,\widehat\beta^1,T)_{\widebar w'}\times\widebar{\mathcal M}_{0,3}(\widebar w')\times\mathcal M(L^2,\widehat\beta^2,T)_{\widebar w'},\\
\label{eq:isom_w}
&\mathcal M^d(\beta^d,T)_{w}\simeq\coprod_{\widehat\beta^3+\widehat\beta^4=\beta^d}\mathcal M(L^3,\widehat\beta^3,T)_{\widebar w}\times\widebar{\mathcal M}_{0,3}(\widebar w)\times\mathcal M(L^4,\widehat\beta^4,T)_{\widebar w}.
\end{align}

By Propositions \ref{prop:degree} and \ref{prop:straight_spine}, we deduce from \eqref{eq:isom_w'} and \eqref{eq:isom_w} the following equalities:
\begin{align}
\deg\mathcal M^d(\beta^d,T)_{w'} & = \sum_{\widehat\beta^1+\widehat\beta^2=\beta^d} \deg\mathcal M(L^1,\widehat\beta^1,T)_{\widebar w'}\cdot \deg\mathcal M(L^2,\widehat\beta^2,T)_{\widebar w'}\nonumber\\
& = \sum_{\widehat\beta^1+\widehat\beta^2=\beta^d} N(L^1,\widehat\beta^1-(\beta^1)') \cdot N(L^2,\widehat\beta^2-(\beta^2)')\nonumber\\
& = \sum_{\beta^1+\beta^2=\beta^3} N(L^1,\beta^1)\cdot N(L^2,\beta^2), \label{eq:equality_w'}\\
\deg\mathcal M^d(\beta^d,T)_w & = \sum_{\widehat\beta^3+\widehat\beta^4=\beta^d} \deg\mathcal M(L^3,\widehat\beta^3,T)_{\widebar w}\cdot\deg\mathcal M(L^4,\widehat\beta^4,T)_{\widebar w}\nonumber\\
& = \deg\mathcal M(L^3,\beta^3+(\beta^3)'),T)_{\widebar w}\nonumber\\
& = N(L^3,\beta^3). \label{eq:equality_w}
\end{align}

By \cref{prop:finite_etale} and the connectedness of $V^d$, we have $\deg\mathcal M^d(\beta^d,T)_w=\deg\mathcal M^d(\beta^d,T)_{w'}$.
Combining \eqref{eq:equality_w'} and \eqref{eq:equality_w}, we conclude the proof of \cref{thm:gluing_formula}.


\bibliographystyle{plain}

