64c3814
==== TABLE OF CONTENTS ====
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//main.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//references.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/00-abstract.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/01-introduction.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/02-preliminaries.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/03-comparisons.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/04-terminal-junctions.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/05-branch-topology.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/06-curve-places.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/07-difficulty.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/08-completion.tex
Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//termination-generalized-lc-kahler-fourfolds.tex
===========================

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//main.tex ====
\documentclass[11pt]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[margin=1.05in]{geometry}
\usepackage{mathtools,amssymb}
\usepackage{tikz-cd}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{hidelinks,pdftitle={Termination of generalized log canonical flips on compact Kahler fourfolds},pdfauthor={OpenAI}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{notation}[theorem]{Notation}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem*{claim}{Claim}
\numberwithin{equation}{section}

\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\M}{\mathbf{M}}
\DeclareMathOperator{\Exc}{Exc}
\DeclareMathOperator{\Supp}{Supp}
\DeclareMathOperator{\Sing}{Sing}
\DeclareMathOperator{\cent}{cent}
\DeclareMathOperator{\ord}{ord}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\rk}{rk}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\coker}{coker}
\DeclareMathOperator{\Pic}{Pic}
\DeclareMathOperator{\Proj}{Proj}
\DeclareMathOperator{\IC}{IC}
\DeclareMathOperator{\Gr}{Gr}
\newcommand{\BM}{\mathrm{BM}}
\allowdisplaybreaks[2]
\setcounter{tocdepth}{1}
\emergencystretch=2em

\title[Generalized log canonical flips on K\"ahler fourfolds]{Termination of generalized log canonical flips\newline on compact K\"ahler fourfolds}
\author{OpenAI}
\date{October 7, 2026}

\begin{document}
\begin{abstract}
\input{sections/00-abstract}
\end{abstract}
\maketitle
\tableofcontents

\input{sections/01-introduction}
\input{sections/02-preliminaries}
\input{sections/03-comparisons}
\input{sections/04-terminal-junctions}
\input{sections/05-branch-topology}
\input{sections/06-curve-places}
\input{sections/07-difficulty}
\input{sections/08-completion}
\input{references}
\end{document}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//main.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//references.tex ====
\begin{thebibliography}{99}
\raggedright

\bibitem{AlexeevHaconKawamata2007}
Valery Alexeev, Christopher Hacon, and Yujiro Kawamata,
\emph{Termination of (many) 4-dimensional log flips},
Invent. Math. \textbf{168} (2007), no.~2, 433--448.
\url{https://doi.org/10.1007/s00222-007-0038-1}.

\bibitem{BierstoneMilman1997}
Edward Bierstone and Pierre D. Milman,
\emph{Canonical desingularization in characteristic zero by blowing up the
maximum strata of a local invariant},
Invent. Math. \textbf{128} (1997), no.~2, 207--302.
\url{https://doi.org/10.1007/s002220050141}.

\bibitem{BirkarZhang2016}
Caucher Birkar and De-Qi Zhang,
\emph{Effectivity of Iitaka fibrations and pluricanonical systems of polarized pairs},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{123} (2016), 283--331.
\url{https://doi.org/10.1007/s10240-016-0080-x}.

\bibitem{ChenTsakanikas2023}
Guodu Chen and Nikolaos Tsakanikas,
\emph{On the termination of flips for log canonical generalized pairs},
Acta Math. Sin. (Engl. Ser.) \textbf{39} (2023), no.~6, 967--994.
\url{https://doi.org/10.1007/s10114-023-0116-3}.

\bibitem{DeligneLefschetz}
Pierre Deligne,
\emph{Th\'eor\`eme de Lefschetz et crit\`eres de d\'eg\'en\'erescence de suites spectrales},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{35} (1968), 107--126.
\url{https://doi.org/10.1007/BF02698925}.

\bibitem{DeligneHodgeII}
Pierre Deligne,
\emph{Th\'eorie de Hodge : II},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{40} (1971), 5--57.
\url{https://doi.org/10.1007/BF02684692}.

\bibitem{DeligneHodgeIII}
Pierre Deligne,
\emph{Th\'eorie de Hodge : III},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{44} (1974), 5--77.
\url{https://doi.org/10.1007/BF02685881}.

\bibitem{ForstnericStein}
Franc Forstneri\v{c},
\emph{Extending holomorphic mappings from subvarieties in Stein manifolds},
Ann. Inst. Fourier (Grenoble) \textbf{55} (2005), no.~3, 733--751.
\url{https://doi.org/10.5802/aif.2112}.

\bibitem{Fujino2005Addendum}
Osamu Fujino,
\emph{Addendum to \textquotedblleft Termination of 4-fold canonical flips\textquotedblright},
Publ. Res. Inst. Math. Sci. \textbf{41} (2005), no.~1, 251--257.
\url{https://doi.org/10.2977/PRIMS/1145475410}.

\bibitem{FujinoAnalyticMMP}
Osamu Fujino,
\emph{Minimal model program for projective morphisms between complex analytic spaces},
arXiv:2201.11315v1 (2022).
\url{https://arxiv.org/abs/2201.11315v1}.

\bibitem{GoreskyMacPhersonIHII}
Mark Goresky and Robert MacPherson,
\emph{Intersection homology II},
Invent. Math. \textbf{72} (1983), no.~1, 77--129.
\url{https://doi.org/10.1007/BF01389130}.

\bibitem{Grauert1962}
Hans Grauert,
\emph{\"Uber Modifikationen und exzeptionelle analytische Mengen},
Math. Ann. \textbf{146} (1962), 331--368.
\url{https://doi.org/10.1007/BF01441136}.

\bibitem{GrothendieckHilbert1961}
Alexander Grothendieck,
\emph{Techniques de construction et th\'eor\`emes d'existence en g\'eom\'etrie
alg\'ebrique IV : les sch\'emas de Hilbert},
in \emph{S\'eminaire Bourbaki : ann\'ees 1960/61, expos\'es 205--222},
S\'eminaire Bourbaki \textbf{6}, Soci\'et\'e Math\'ematique de France,
1961, Expos\'e 221, 249--276; erratum, vol.~7 (1962), p.~302.
\url{https://www.numdam.org/item/SB_1960-1961__6__249_0/}.

\bibitem{HaconMoraga2020}
Christopher Hacon and Joaqu\'in Moraga,
\emph{On weak Zariski decompositions and termination of flips},
Math. Res. Lett. \textbf{27} (2020), no.~5, 1393--1421.
\url{https://doi.org/10.4310/MRL.2020.v27.n5.a6}.

\bibitem{HaconXie2026}
Christopher Hacon and Lingyao Xie,
\emph{On the K\"ahler MMP and the transcendental base-point-free theorem},
arXiv:2607.24986v1 (2026), submitted July 27, 2026.
\url{https://arxiv.org/abs/2607.24986v1}.

\bibitem{HanLiuZhuang2025}
Jingjun Han, Jihao Liu, and Ziquan Zhuang,
\emph{Effective termination of general type MMPs in dimension at most five},
arXiv:2509.01501v1 (2025).
\url{https://arxiv.org/abs/2509.01501v1}.

\bibitem{KawamataMatsudaMatsuki1987}
Yujiro Kawamata, Katsumi Matsuda, and Kenji Matsuki,
\emph{Introduction to the minimal model problem},
in \emph{Algebraic Geometry, Sendai, 1985}, Tadao Oda (ed.),
Advanced Studies in Pure Mathematics \textbf{10},
North-Holland, Amsterdam, 1987, 283--360.
\url{https://doi.org/10.2969/aspm/01010283}.

\bibitem{Moraga2025}
Joaqu\'in Moraga,
\emph{Termination of pseudo-effective 4-fold flips},
Math. Z. \textbf{310} (2025), no.~4, Article 73, 32 pp.
\url{https://doi.org/10.1007/s00209-025-03766-y}.

\bibitem{KahlerAuxiliary}
OpenAI,
\emph{Finite ordinary minimal model programs on compact K\"ahler fourfolds},
OpenAI Math Release preprint
\href{https://github.com/openai/math/blob/main/preprints/Finite-ordinary-minimal-model-programs-on-compact-Kahler-fourfolds-October-6-2026/paper.pdf}{OAI:Finite-ordinary-minimal-model-programs-on-compact-Kahler-fourfolds-October-6-2026},
2026.

\bibitem{ProjectiveLCFourfolds}
OpenAI,
\emph{Termination for projective log canonical fourfolds with rational boundary},
OpenAI Math Release preprint
\href{https://github.com/openai/math/blob/main/preprints/Termination-for-projective-log-canonical-fourfolds-with-rational-boundary-September-24-2026/paper.pdf}{OAI:Termination-for-projective-log-canonical-fourfolds-with-rational-boundary-September-24-2026},
2026.

\bibitem{CanonicalKahler}
OpenAI,
\emph{Termination of generalized-canonical flips on compact K\"ahler fourfolds},
OpenAI Math Release preprint
\href{https://github.com/openai/math/blob/main/preprints/Termination-of-generalized-canonical-flips-on-compact-Kahler-fourfolds-October-6-2026/termination-generalized-terminal-flips-compact-kahler-fourfolds.pdf}{OAI:Termination-of-generalized-canonical-flips-on-compact-Kahler-fourfolds-October-6-2026},
2026.

\bibitem{RaynaudSGA1XII}
Mich\`ele Raynaud,
\emph{G\'eom\'etrie alg\'ebrique et g\'eom\'etrie analytique},
in \emph{Rev\^etements \'etales et groupe fondamental (SGA 1)},
Alexander Grothendieck (ed.), Lecture Notes in Mathematics \textbf{224},
Springer-Verlag, Berlin--Heidelberg, 1971, Expos\'e XII, 311--343.
\url{https://doi.org/10.1007/BFb0058667}.

\bibitem{SaitoMHP}
Morihiko Saito,
\emph{Modules de Hodge polarisables},
Publ. Res. Inst. Math. Sci. \textbf{24} (1988), no.~6, 849--995.
\url{https://doi.org/10.2977/PRIMS/1195173930}.

\bibitem{SerreGAGA}
Jean-Pierre Serre,
\emph{G\'eom\'etrie alg\'ebrique et g\'eom\'etrie analytique},
Ann. Inst. Fourier (Grenoble) \textbf{6} (1956), 1--42.
\url{https://doi.org/10.5802/aif.59}.

\bibitem{ShokurovNonvanishing}
V. V. Shokurov,
\emph{The nonvanishing theorem},
Math. USSR-Izv. \textbf{26} (1986), no.~3, 591--604.
Russian original: Izv. Akad. Nauk SSSR Ser. Mat. \textbf{49} (1985),
no.~3, 635--651.
\url{https://doi.org/10.1070/IM1986v026n03ABEH001160}.

\end{thebibliography}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//references.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/00-abstract.tex ====
Every sequence of generalized log canonical flips on a normal irreducible globally Weil \(\Q\)-factorial compact K\"ahler fourfold terminates, provided the flips are projective small diagrams with the stated opposite ample signs. The boundary is rational, and the nef b-divisor is fixed and represented by an analytically nef \(\Q\)-Cartier divisor on a projective modification. No scaling rule or pseudo-effectivity assumption is required. The theorem concerns existing flip sequences; it does not assert the existence of all contractions or flips.
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/00-abstract.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/01-introduction.tex ====
\section{Introduction}\label{sec:introduction}

Termination of flips rules out an endless sequence of small birational improvements in the minimal model program. Since flips contract no divisors, their number cannot be bounded by counting divisors that disappear. In dimension four, exceptional surfaces bring places centered on surfaces and curves into the argument. On compact K\"ahler spaces, the contractions may be projective even when the ambient fourfold has no ample line bundle.

Shokurov's difficulty counts exceptional divisors with small discrepancy to measure the improvement of singularities \cite[Definition~2.15 and Corollaries~2.16--2.17]{ShokurovNonvanishing}. Kawamata, Matsuda, and Matsuki combined it with the rank of surface cycle classes to prove termination of terminal fourfold flips in the algebraic setting \cite[Theorem~5-1-15]{KawamataMatsudaMatsuki1987}. For boundaries, Fujino's corrected argument for canonical fourfold pairs exhibits the recurring contributions from successive blowups over a codimension-two center \cite[Example~2.1 and Theorems~5.1--5.2]{Fujino2005Addendum}. Alexeev, Hacon, and Kawamata developed a weighted difficulty that subtracts these contributions and tracks cycles on normalized boundary components \cite[Section~2]{AlexeevHaconKawamata2007}. Discrepancy improvement and the behavior of boundary cycles also guide the proof here.

Generalized pairs place part of the adjoint data on a higher birational model: a nef divisor there contributes its trace on the space carrying the boundary \cite[Definitions~1.4 and 4.1]{BirkarZhang2016}. For algebraic generalized pairs, Hacon and Moraga gave a termination reduction using weak Zariski decompositions \cite[Theorem~1]{HaconMoraga2020}. Termination for pseudo-effective generalized log canonical fourfolds with NQC nef data was proved by Chen and Tsakanikas \cite[Theorem~1.1]{ChenTsakanikas2023} and by Moraga \cite[Theorem~4.4]{Moraga2025}. Here NQC means a nonnegative real combination of nef \(\Q\)-Cartier divisors on the higher model. Han, Liu, and Zhuang proved termination of ordinary klt fourfold minimal model programs when the boundary is big over the fixed algebraic base \cite[Corollary~3.2(3)]{HanLiuZhuang2025}.

Hacon and Xie formulate a termination conjecture for generalized klt pairs with higher \((1,1)\)-class data on compact K\"ahler spaces \cite[Conjecture~1.15]{HaconXie2026}. The generalized klt case of the theorem below treats a four-dimensional rational-divisor form of that question under the stated projectivity and global Weil \(\Q\)-factoriality assumptions; the theorem also permits generalized log canonical singularities. Its ambient spaces may be nonprojective, and the prescribed small diagrams may vary their bases and choices under the hypotheses below.

A normal compact complex space \(X\) is \emph{globally Weil \(\Q\)-factorial} if every prime Weil divisor defined on all of \(X\) is \(\Q\)-Cartier and some positive reflexive power of its canonical sheaf is invertible. Projective morphisms of complex spaces are understood in the analytic sense: they admit a relatively ample holomorphic line bundle. A \(\Q\)-Cartier divisor is relatively ample if a positive Cartier multiple is relatively ample.

For a normal compact K\"ahler space \(X\), a rational nef b-divisor \(\M\) in this paper is represented by a \(\Q\)-Cartier divisor \(M'\) on a normal compact K\"ahler space \(X'\) with a projective bimeromorphic map \(\pi:X'\to X\). We require \(c_1(M')\) to lie in the closure of the K\"ahler cone in real Bott--Chern cohomology. On a model dominating \(X'\), the trace \(M_W\) is the pullback of \(M'\); on another model it is the pushforward from a common higher model. The divisor \(M'\) need not be effective.

We use compatible actual canonical divisor representatives on the birational models under consideration. Given an effective rational Weil divisor \(B\) of finite support for which \(D_X=K_X+B+M_X\) is \(\Q\)-Cartier, choose a smooth proper bimeromorphic model \(p:W\to X\) dominating \(X'\) and write
\begin{equation}\label{eq:discrepancy-definition}
 K_W+\Delta_W+M_W=p^*(K_X+B+M_X).
\end{equation}
A \emph{global divisorial place} is a prime divisor on a normal proper bimeromorphic model, with primes identified by strict transform on common higher models. Its log discrepancy is
\[
 a(E;X,B+\M)=1-\operatorname{coeff}_E(\Delta_W)
\]
on a model carrying \(E\). The pair is \emph{generalized log canonical} if this number is nonnegative for every global divisorial place, including the primes on \(X\). These places are defined on birational models; the definition does not depend on a field of global meromorphic functions.

\begin{theorem}\label{thm:main}
Let \(X_0\) be a normal irreducible globally Weil \(\Q\)-factorial compact K\"ahler fourfold. Let \(B_0\) be an effective rational Weil divisor of finite support with coefficients in \([0,1]\). Let \(\M\) be represented by an analytically nef \(\Q\)-Cartier divisor on a projective bimeromorphic normal compact K\"ahler model of \(X_0\). Fix compatible actual canonical divisor representatives on all birational models under consideration. Suppose that \(D_0=K_{X_0}+B_0+M_{X_0}\) is \(\Q\)-Cartier and that \((X_0,B_0+\M)\) is generalized log canonical.

Consider a sequence of normal irreducible globally Weil \(\Q\)-factorial compact K\"ahler fourfolds
\[
 X_0\dashrightarrow X_1\dashrightarrow X_2\dashrightarrow\cdots.
\]
On \(X_i\), let \(B_i\) be the strict transform of \(B_0\), let \(M_i=M_{X_i}\) be the trace of the same b-divisor, and assume that \(D_i=K_{X_i}+B_i+M_i\) is \(\Q\)-Cartier. Transport the canonical representatives under the induced identifications of prime divisors. Suppose that every step is given by a diagram
\begin{equation}\label{eq:flip-diagram}
\begin{tikzcd}[column sep=large]
 X_i \arrow[r,"f_i"] & Z_i & X_{i+1}\arrow[l,"f_i^+"']
\end{tikzcd}
\end{equation}
where \(Z_i\) is normal compact K\"ahler, both maps are projective small bimeromorphic morphisms with connected fibers, neither is an isomorphism, and
\[
 -D_i\text{ is }f_i\text{-ample},\qquad
 D_{i+1}\text{ is }f_i^+\text{-ample}.
\]
Here \emph{small} means that the exceptional locus contains no prime divisor. Then the sequence is finite.
\end{theorem}

We call a diagram satisfying the hypotheses of Theorem~\ref{thm:main} a \emph{flip} for the indicated adjoint. The theorem applies to arbitrary choices of such diagrams. Taking \(\M=0\) gives the ordinary log canonical case.

The proof uses the relative constructions and special termination for generalized pairs in \cite{KahlerAuxiliary}, whose precise forms we recall in Section~\ref{sec:preliminaries}.

\subsection*{Proof strategy}

We first prove termination for generalized klt pairs on models satisfying the stronger factoriality condition specified in Section~\ref{sec:preliminaries}. Discrepancy monotonicity and finiteness for the initial pair make the set of exceptional places of discrepancy at most one constant on a tail. Extracting it gives crepant models \(h_i:Y_i\to X_i\) whose remaining exceptional discrepancies are greater than one; we call them \emph{terminal junctions}. Each downstairs flip connects two junctions by a decrease of the extracted boundary coefficients followed by a finite, possibly empty, program of small steps. This construction adapts the projective argument of \cite[Section~3, Proposition~3.4]{ProjectiveLCFourfolds}.

The extracted coefficients may still vary. When an extracted divisor maps onto a surface, a transverse smooth surface cuts its general fiber into exceptional curves. Adjunction and negative definiteness bound the entries of the grouped intersection matrix. The fixed rational boundary and nef data then confine the discrepancies of extracted places with surface centers to a finite set. A downstairs flip strictly raises the discrepancy of a place whose center lies in its exceptional locus. It follows that, on every junction of a tail, each coefficient that still varies belongs to a divisor mapping onto a curve or a point of \(X_i\).

The branch bound of Theorem~\ref{thm:branch} applies to a reduced union \(Q\) of divisors on a terminal fourfold \(Y\) when a projective bimeromorphic morphism \(Y\to X\) of normal irreducible compact K\"ahler fourfolds sends \(Q\) to a set of dimension at most one. A surface in \(Q\) may have several prime divisors above it in the disjoint normalization of its components. The theorem bounds the total excess of branches by the ranks of surface cycle classes on those normalizations and the number of global ordinary discrepancy-two places centered on singular curves in \(Q\). It is formulated independently of any boundary or crepant equation.

The word \emph{global} is essential. Projective topology over the curve image relates the branch excess to local systems along the singular curves. Saito's projective analytic decomposition theorem and a Hodge-filtration argument on a compact K\"ahler resolution give the needed purity. A Quot parameter argument gives finite monodromy. On a Stein neighborhood of a compact core carrying all loops of the curve, we apply Fujino's local small \(\Q\)-factorialization theorem; fiber degrees and blowups then produce local ordinary discrepancy-two places. A canonical discrepancy comparison shows that they occur as divisors on one global resolution, and the retained loops keep those global divisors distinct. The normalization and parameter methods follow \cite[Sections~5--6]{ProjectiveLCFourfolds}; the analytic purity argument and the passage to distinct global divisors are given here.

Section~\ref{sec:difficulty} constructs the difficulty by counting exceptional places of discrepancy below two with ceiling weights, subtracting generic blowup contributions locally before summation, and adding cycle-rank corrections on normalized boundary components. The branch bound makes it nonnegative at junctions. Across a small step, the cycle-rank change cancels the change in the local subtractions, leaving a sum of nonnegative weight losses. This adapts the locally corrected difficulty in \cite[Section~4]{ProjectiveLCFourfolds}.

A surface in the positive exceptional locus of a downstairs flip forces a drop of at least one in the difficulty between its terminal junctions. Only finitely many flips can do this. Every remaining flip has an exceptional surface only on the negative side, so the rank of analytic surface classes on the ambient \(X_i\) decreases. This proves termination for generalized klt pairs on these auxiliary models. Special termination and deletion of the whole boundary floor reduce elementary generalized dlt programs to that case. We then use relative continuation and this gdlt termination to lift each diagram of Theorem~\ref{thm:main} to a finite program whose endpoint maps crepantly to the next downstairs model. A negative curve downstairs has a negative multisection upstairs, so each lift is nonempty. Their concatenation proves Theorem~\ref{thm:main}.
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/01-introduction.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/02-preliminaries.tex ====
\section{Generalized pairs and auxiliary programs}\label{sec:preliminaries}

The relative constructions used in the proof take place on models with a
stronger global factoriality property than the one in
Theorem~\ref{thm:main}.  We first specify that property and the generalized
pair conventions for those constructions.  We then record the precise
forms of the auxiliary results that will be used.

The auxiliary definitions and statements in this section use reduced,
irreducible, second-countable complex analytic spaces as their ambient
spaces.

\begin{definition}[Global strong factoriality]\label{def:strong-factoriality}
A normal compact complex space \(T\) is \emph{globally strongly
\(\Q\)-factorial} if, for every coherent rank-one reflexive sheaf
\(\mathcal F\) on all of \(T\), some positive reflexive power
\[
 \mathcal F^{[m]}=(\mathcal F^{\otimes m})^{**},\qquad m>0,
\]
is an invertible sheaf.
\end{definition}

This condition implies global Weil \(\Q\)-factoriality: apply it to the
divisorial sheaf of each global prime divisor and to the reflexive canonical
sheaf.  It is a condition on sheaves on the whole space; it makes no assertion
that arbitrary analytic open subsets, or the analytic local rings, are
\(\Q\)-factorial.  We use \emph{strong model} to mean a globally strongly
\(\Q\)-factorial model.

A \emph{rational line bundle} on \(T\) is an element of
\(\Pic(T)\otimes_{\Z}\Q\).  An equality of rational line bundles means an
isomorphism of holomorphic line bundles after taking a positive common
integral multiple.  A rank-one reflexive sheaf is \emph{rationally
invertible} if a positive reflexive power is invertible.  On a projective
morphism \(T\to V\), a rational line bundle is \emph{relatively nef} if
its degree is nonnegative on every compact irreducible curve in a fiber,
and is \emph{relatively ample} if a positive integral multiple is relatively
ample.  For the absolute nef data in this paper, nefness means that the
first Chern class lies in the closure of the K\"ahler cone, as in the
introduction; it implies relative nefness for every morphism under
consideration.

The auxiliary constructions are stated for rational generalized
\emph{b-line data}.  On a normal compact space \(T\), these consist of an
effective rational Weil divisor \(B\) of finite support, a projective
modification \(p:W\to T\), and a rational line bundle \(M_W\) on \(W\)
that is nef absolutely, or nef over the specified base of a relative
argument.  It is pulled back on every higher model; we continue to denote
the resulting b-object by \(\M\).  After clearing a denominator, proper
direct image followed by double dual defines its reflexive trace \(M_T\).
The adjoint \(D_T=K_T+B+M_T\) is required to be rationally invertible.
Here \(K_T\) in the b-line formulation is the reflexive canonical sheaf.
On a smooth log resolution projective over \(T\) and carrying the data, the natural
meromorphic comparison over the isomorphism locus defines the crepant
boundary by
\[
 K_W+B_W+M_W=p^*D_T.
\]
The log discrepancy of a global place \(E\) is
\(a(E;T,B+\M)=1-\operatorname{coeff}_E(B_W)\) on a model carrying it.
All statements about places below concern the global places defined in the
introduction.  A global place is exceptional over \(T\) if its center on
\(T\) has codimension at least two.

We abbreviate \emph{generalized klt}, \emph{generalized lc}, and
\emph{generalized dlt} to gklt, glc, and gdlt.  A pair is gklt if all of
its global log discrepancies are positive, and glc if they are all
nonnegative.  It is \emph{generalized terminal} if it is gklt and
\(a(E;T,B+\M)>1\) for every place exceptional over \(T\).  A
\emph{generalized log canonical center} is the center of a global place of
log discrepancy zero.  A glc pair is gdlt if there is a Zariski-open set
\(T^\circ\subset T\) on which \((T^\circ,B|_{T^\circ})\) is simple normal
crossing and the b-data descend, and which contains the general point of
every generalized log canonical center.  The carrier and subsequent log
resolutions may be chosen isomorphic on this open.  The zero-discrepancy
centers there are strata of the coefficient-one boundary.  These are the
conventions of \cite[Convention~9.1 and Definition~9.2]{KahlerAuxiliary}.

We explain the relation between this formulation and the actual divisors in
Theorem~\ref{thm:main}.  A \(\Q\)-Cartier divisor determines a rational
line bundle.  If \(mM_W\) is integral Cartier, then on the normal target
the reflexive sheaf
\[
 \bigl(p_*\mathcal O_W(mM_W)\bigr)^{**}
\]
agrees with the divisorial sheaf \(\mathcal O_T(mp_*M_W)\): the two agree
at every codimension-one point, where the modification is an isomorphism,
and normality gives uniqueness of the reflexive extension.  The same
comparison on a common higher model is compatible with pullback and with
transport across a small map.  The canonical trace is the canonical
sheaf of the target.  These facts are
\cite[Lemma~9.3(i)--(ii)]{KahlerAuxiliary}.  The natural meromorphic
comparisons therefore agree with the comparisons using the compatible
actual canonical representatives in \eqref{eq:discrepancy-definition}.
In every application below the b-line discrepancies are exactly the
discrepancies of that equation, and a crepant b-line identity is the
corresponding equality of actual rational divisors.  A common projective
carrier for any finite part of our birational constructions carries the
pullback of the original analytically nef divisor, which is relatively nef
over each base used in that part.  A single carrier dominating an infinite
sequence is not required.

Here is the elementary step used in the auxiliary programs.  Suppose that
the source \(T\) and the output \(T_1\) are strong normal compact K\"ahler
spaces, and write \(D_T\) and \(D_{T_1}\) for their rationally invertible
adjoints.  An \emph{elementary negative step} is either a projective
bimeromorphic divisorial contraction \(f:T\to T_1\) for which \(-D_T\)
is \(f\)-ample, or a diagram
\[
 T\xrightarrow{\ f\ }Z\xleftarrow{\ f^+\ }T_1
\]
of projective small bimeromorphic morphisms to a normal compact K\"ahler
space with \(-D_T\) \(f\)-ample and \(D_{T_1}\) \(f^+\)-ample.  The
degree functionals of the curves contracted on the negative side span one
nonzero ray when paired with global rational line bundles on \(T\).
In the small case the positive side is the relative Proj of the actual
adjoint algebra: after choosing a positive multiple of \(D_T\) represented
by a holomorphic line bundle \(\mathcal L\), it is
\[
 T_1=\Proj_Z\bigoplus_{m\geq0} f_*\mathcal L^{\otimes m}.
\]
The boundary is pushed forward in the divisorial case and strictly
transformed in the small case, and the same b-data are used on common higher
models.  With the compatible actual canonical representatives, a divisorial
step satisfies \(D_{T_1}=f_*D_T\).  If the step is \emph{over \(V\)}, all its maps commute with the
given maps to \(V\).  In the constructions used below the contraction maps
have connected fibers, and a small step has nonisomorphic morphisms on both
sides; the latter properties are also verified in
Section~\ref{sec:comparisons}.  This is the form of
\cite[Definition~9.6]{KahlerAuxiliary}.  Its one-ray condition concerns
degrees of global line bundles and imposes no condition on the relative
Bott--Chern dimension.  A diagram in Theorem~\ref{thm:main} need not be
elementary.

\begin{proposition}[Low places and projective realization]\label{prop:low-places}
Let \((T,B+\M)\) be gklt rational generalized data on a normal compact
K\"ahler space, with effective boundary of finite support and an absolutely
nef rational datum carried by a projective modification.  Fix a projective
log resolution carrying the datum.  There is \(\varepsilon>0\) such that
every global place satisfies
\[
 a(E;T,B+\M)\geq\varepsilon,
\]
and only finitely many places exceptional over \(T\) satisfy
\[
 a(E;T,B+\M)<1+\varepsilon.
\]
This finite set can be represented simultaneously by prime divisors on a
smooth model projective over \(T\).  In particular the exceptional places
of discrepancy at most one form a finite set with such a realization.
\end{proposition}

This is the rational nef specialization of
\cite[Lemma~4.2(i)]{KahlerAuxiliary}.  The positive number
\(\varepsilon\) belongs to this one pair; uniformity along a sequence will
follow from discrepancy monotonicity.

\begin{proposition}[Exact extraction]\label{prop:extraction}
Let \((T,B+\M)\) be rational gklt data on a strong normal compact
K\"ahler space, with an absolutely nef rational line bundle on a projective
carrier and rationally invertible adjoint.  For any specified finite set
\(\mathcal E\) of places exceptional over \(T\) with
\(a(E;T,B+\M)\leq1\), there is a projective bimeromorphic morphism
\(h:U\to T\) such that \(U\) is a strong normal compact K\"ahler space,
the \(h\)-exceptional prime divisors are exactly the members of
\(\mathcal E\), and the crepant generalized pair on \(U\) is gklt with
effective boundary.  Thus, writing this boundary as \(B_U\),
\[
 K_U+B_U+M_U=h^*(K_T+B+M_T).
\]
\end{proposition}

This is \cite[Proposition~9.11]{KahlerAuxiliary}.  Terminality is not part
of the extraction assertion.  It will follow when \(\mathcal E\) is chosen
to contain every exceptional place of discrepancy at most one.

\begin{proposition}[Relative programs]\label{prop:relative-program}
Let \(\pi:T\to V\) be a projective bimeromorphic morphism of normal compact
K\"ahler spaces.  Suppose that \(T\) is strong and that \((T,B+\M)\) is
rational gdlt, with effective boundary, a projective carrier on which the
rational line datum is nef over \(V\), and a rationally invertible adjoint
\(D_T\).
\begin{enumerate}
\item If \(D_T\) is not relatively nef over \(V\), there is an elementary
negative step over \(V\).  Its output is projective over \(V\), normal
compact K\"ahler and strong, and is gdlt with the transported boundary and
b-data.  The same construction is available after every finite prefix whose
last adjoint is not relatively nef over \(V\).
\item If the initial pair is gklt, there exists a finite, possibly empty,
sequence of elementary negative steps over this one fixed base \(V\) whose
last adjoint is relatively nef over \(V\).  Its models and transported data
have the properties in the first assertion.
\end{enumerate}
\end{proposition}

The two assertions are respectively
\cite[Propositions~9.7 and 9.9]{KahlerAuxiliary}.  The first is a
continuation assertion for gdlt data.  The second asserts the existence of
one finite run for gklt data; it does not assert termination of every choice
of a relative program.

\begin{proposition}[Crepant gdlt modification]\label{prop:gdlt-modification}
Let \((T,B+\M)\) be rational glc data of dimension at most four on a normal
compact K\"ahler space.  Assume that the higher absolutely nef rational
line datum is carried by a projective modification and that
\(K_T+B+M_T\) is rationally invertible.  There is a projective bimeromorphic
morphism \(h:Y\to T\) such that \(Y\) is a strong normal compact K\"ahler
space, \((Y,B_Y+\M)\) is gdlt with \(B_Y\geq0\), and
\[
 K_Y+B_Y+M_Y=h^*(K_T+B+M_T).
\]
Every \(h\)-exceptional prime has coefficient one in \(B_Y\), equivalently
has generalized log discrepancy zero over \((T,B+\M)\).
\end{proposition}

This is \cite[Proposition~11.4]{KahlerAuxiliary}.  The base \(T\) need not
be strong, and the assertion does not require that every zero-discrepancy
place be extracted.

\begin{theorem}[Special termination]\label{thm:special-termination}
Let \(d\leq4\), and let
\[
 (T_0,B_0+\M)\dashrightarrow(T_1,B_1+\M)
 \dashrightarrow(T_2,B_2+\M)\dashrightarrow\cdots
\]
be a sequence of elementary steps for rational gdlt data on strong normal
compact K\"ahler spaces of dimension \(d\).  The boundaries are transported
as in an elementary program, and the higher absolutely nef b-line datum is fixed and is
carried by projective modifications.  There is an index \(i_0\) such that,
for every \(i\geq i_0\), the exceptional loci on both sides of the step are
disjoint from every generalized log canonical center on their respective
sides.  The contraction bases in this sequence may vary.
\end{theorem}

This is \cite[Theorem~11.3]{KahlerAuxiliary}.  We use it for the elementary
sequences on strong models.  Full termination for four-dimensional gdlt
data will be deduced in Section~\ref{sec:completion}.

\paragraph{Scope of the auxiliary inputs.}
The results recalled above use the projective relative arguments in
\cite[Sections~9--11]{KahlerAuxiliary}, together with its low-place
calculation.  Relative continuation is Proposition~9.7 there; the finite
run over a fixed bimeromorphic base in Proposition~9.9 uses the local
finite-generation argument of Lemma~9.8, and exact extraction in
Proposition~9.11 uses that finite run.  The special-termination and gdlt
modification arguments in Section~11 form an induction on dimension,
using the threefold termination theorem of Section~10.  These proofs do
not invoke the canonical bundle formula or the absolute
supporting-contraction induction of Section~6.  Indeed, Section~6 uses
the threefold termination theorem as an input to its good-model
construction; the dependency is in that direction.  Thus the use of
\cite{KahlerAuxiliary} here does not require its absolute contraction or
minimal-model theorems.

The imports from \cite{CanonicalKahler} are likewise restricted to its
common-model construction (Proposition~2.1), analytic negativity
(Lemma~2.2), and terminal smoothness in codimension two (Lemma~2.3).
Its fourfold termination theorem is not an input.  All relative
constructions above retain their stated strong-factoriality hypotheses;
these are not additional hypotheses on the given sequence in
Theorem~\ref{thm:main}.
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/02-preliminaries.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/03-comparisons.tex ====
\section{Birational comparisons}
\label{sec:comparisons}

We compare the adjoints on the two sides of a small diagram and at the
ends of a finite relative program.  The comparisons locate exactly which
global places acquire larger discrepancies.  They also give a projective
morphism from a nef end to a prescribed ample model, with the nef adjoint
equal to the pullback of the ample adjoint.  We then record the homological
ranks that count contracted divisors and surfaces.
All divisor equalities in this section are equalities of actual rational
divisors, with the compatible canonical representatives and the fixed
b-divisor $\M$ of Section~\ref{sec:preliminaries}.

For a projective morphism, a rational Cartier divisor is called
\emph{relatively nef} here if it has nonnegative degree on every compact
irreducible curve contracted by the morphism.  We use the analytic
negativity lemma in the following precise form
\cite[Lemma~2.2]{CanonicalKahler}: if $r:V\to T$ is a projective
bimeromorphic morphism of normal complex spaces, $H$ is a
$\Q$-Cartier divisor on $V$, $-H$ is relatively nef, and $r_*H\geq0$,
then $H\geq0$.  Neither compactness nor a singularity hypothesis is
part of this input.  A divisor is \emph{exceptional over $T$} if every
prime in its support has image of codimension at least two in $T$.

We will also use two consequences of normality.  An effective
$\Q$-Cartier divisor pulls back effectively under a dominant morphism:
after clearing its index, a local meromorphic equation with no
divisorial poles is holomorphic on a normal space.  Such a divisor has
nonnegative degree on a compact curve not contained in its support,
by restricting its effective section to the normalization of the curve.

\subsection{Common models and the nef part}

The projectivity in the hypotheses permits all comparisons in a finite
part of the argument to be made on one compact K\"ahler resolution.
We give the construction for the diagrams used here; compare the
common-model construction of \cite[Proposition~2.1]{CanonicalKahler}.

\begin{lemma}[Common models with projective maps]\label{lem:common-projective-models}
Let a finite collection of normal irreducible compact K\"ahler spaces
be joined, with compatible bimeromorphic identifications, by finitely
many projective bimeromorphic morphisms and their inverses.  Suppose
that a fixed nef b-divisor is carried by a projective bimeromorphic
morphism $X'\to X$ to one of these spaces, with analytically nef
$\Q$-Cartier trace $M'$ on $X'$.  Then there is a
smooth compact K\"ahler space $W$ with compatible projective
bimeromorphic morphisms to every space in the collection and to $X'$.
The resolution may simultaneously principalize finitely many specified
generically nonzero coherent ideals and resolve finitely many specified divisors.  Its trace
$M_W$ is the pullback of $M'$ and is analytically nef.
\end{lemma}

\begin{proof}
For a diagram $T\to Z\leftarrow T^+$, take the reduced component of
$T\times_ZT^+$ containing the graph over the common isomorphism open.
Its projections are projective, and finite normalization preserves
projectivity.  Adjoin the remaining spaces and the carrier one at a
time by the same construction.  Resolving the resulting dominating
component gives a common smooth model.  Analytic resolution and
principalization allow the stated simultaneous choices by projective
modifications; see \cite[Theorems~1.6, 1.10 and 13.2(1)]{BierstoneMilman1997}.
Base change, restriction to a closed analytic subspace, finite
normalization, and composition preserve projectivity.  For composition
in the present compact setting, one can choose a uniform sufficiently
large twist of a relative ample bundle by the pullback of the next one.
This also proves compatibility with any finite chain of the small
diagrams and divisorial contractions considered below.

A smooth space projective over a compact K\"ahler space is compact
K\"ahler: a relative ample bundle supplies positivity in the fiber
directions, and adding a sufficiently large multiple of a pulled-back
K\"ahler form supplies positivity in all directions.  Finally, choose
K\"ahler classes on $X'$ converging to $c_1(M')$.  Their pullbacks to
$W$ have semipositive representatives.  Adding positive multiples
tending to zero of a fixed K\"ahler class on $W$ gives K\"ahler classes
converging to $c_1(M_W)$.  Thus $M_W$ is analytically nef.
\end{proof}

In particular, $M_W$ has nonnegative degree on every compact curve.
For an arbitrary global place, a further common proper model with a
model carrying that place suffices to compare coefficients.  This last
model need not be projective: projectivity is used to establish an
effective divisor on a common model, after which its pullbacks remain
effective on every higher proper model.

\begin{lemma}[Effective nef defect]\label{lem:nef-defect}
Let $T$ be a normal compact K\"ahler model, and let $r:W\to T$ be a
projective bimeromorphic morphism from a normal compact K\"ahler space
$W$ dominating the fixed projective carrier of $\M$.  Assume that
$M_T$ is $\Q$-Cartier.  Then
\begin{equation}\label{eq:nef-defect}
 J_{W/T}:=r^*M_T-M_W\geq0
\end{equation}
is an exceptional $\Q$-Cartier divisor over $T$.  If $s:W'\to W$ is
a higher normal model, then $J_{W'/T}=s^*J_{W/T}$.
\end{lemma}

\begin{proof}
The trace definition gives $r_*J_{W/T}=0$.  On an $r$-contracted curve,
$-J_{W/T}=M_W-r^*M_T$ has the same degree as $M_W$, hence has
nonnegative degree by projection formula from the nef carrier.
Analytic negativity gives $J_{W/T}\geq0$.
The final identity follows from functoriality of pullback and the fact
that the b-divisor descends on $W$.
\end{proof}

The next lemma explains why hypotheses stated for global generalized
places give the local ordinary singularity conditions needed later.
It is here that effectivity of the boundary and of the nef defect
enters the singularity comparison.  The global Weil and strong
$\Q$-factoriality conventions ensure the Cartier hypotheses below for
the respective models in the proof, since the divisor traces have
finite support.

\begin{lemma}[From global generalized discrepancies to local singularities]
\label{lem:ordinary-singularities}
Let $T$ be a normal compact K\"ahler space, let $B$ be an effective
rational divisor of finite support, and let $\M$ have analytically nef
rational data on a projective carrier.  Assume that $K_T$, $B$, and
$M_T$ are $\Q$-Cartier.
If every global generalized log discrepancy of $(T,B+\M)$ is
nonnegative, respectively positive, then the same condition holds for
local analytic places.  In the positive case, $T$ has ordinary klt
singularities locally.  If the global generalized discrepancies are
positive and every global place exceptional over $T$ has generalized
log discrepancy strictly greater than one,
then $T$ has ordinary terminal singularities locally.  In dimension
four the latter conclusion implies $\dim\Sing T\leq1$.
\end{lemma}

\begin{proof}
Choose a smooth log resolution $r:W\to T$, projective over $T$ and carrying $\M$,
with divisorial exceptional locus and simple normal crossing support
for all divisors in the crepant equation
\[
 K_W+\Delta_W+M_W=r^*(K_T+B+M_T).
\]
Such a simultaneous resolution is available by
Lemma~\ref{lem:common-projective-models}.  The assumed inequalities
give coefficients at most one, respectively strictly below one, for
every global prime of $\Delta_W$.  The same bounds hold on their local
branches.  On any further local model the nef part is pulled back from
$W$, so its generalized discrepancies are the ordinary discrepancies
of the simple normal crossing subpair $(W,\Delta_W)$.  The simple
normal crossing discrepancy criterion proves the asserted local
generalized inequalities, including when some coefficients of
$\Delta_W$ are negative.

Put $J=J_{W/T}$.  The ordinary crepant boundary for $(T,0)$ is
\begin{equation}\label{eq:ordinary-crepant-boundary}
 \Delta_W^{(0)}=\Delta_W-r^*B-J,
 \qquad K_W+\Delta_W^{(0)}=r^*K_T.
\end{equation}
Both $r^*B$ and $J$ are effective.  After resolving their joint support
as above, every coefficient of $\Delta_W^{(0)}$ is therefore strictly
below one in the positive case.  The same local simple normal crossing
criterion gives ordinary klt singularities.

For the terminal assertion, the relative canonical divisor is
exceptional, and at an exceptional prime $R$ of $W$ its coefficient is
\[
 \operatorname{coeff}_R(K_W-r^*K_T)
 =a(R;T,B+\M)-1+\operatorname{coeff}_R(r^*B+J)>0.
\]
These positive coefficients persist on every local branch.  A local
place exceptional over the smooth space $W$ has ordinary log
discrepancy at least two over $W$: the Jacobian determinant of a smooth
model carrying it has positive integral order along an exceptional
divisor.  Its discrepancy over $T$ adds the nonnegative order of
$K_W-r^*K_T$, and hence remains greater than one.  Local exceptional
places already represented by divisors on $W$ satisfy the displayed
strict inequality.  Thus $T$ is locally ordinary terminal.
For a normal complex fourfold with a rational canonical line bundle,
local ordinary terminality implies smoothness in codimension two by
\cite[Lemma~2.3]{CanonicalKahler}, giving the last assertion.
\end{proof}

For later calculations, the same equations give, for every global place
$E$ followed on a common higher model,
\begin{equation}\label{eq:generalized-ordinary-discrepancy}
 a(E;T,B+\M)
 =a(E;T,0)-\ord_E(r^*B)-\ord_E(J_{W/T}).
\end{equation}
The orders on the right mean coefficients after pullback to that model.
They are nonnegative under the hypotheses of
Lemma~\ref{lem:ordinary-singularities}.

\subsection{Small diagrams and finite programs}

We now locate the entire region in which a small step changes
discrepancies.  All exceptional loci and their images in this
subsection are given their reduced structures.  We use the graph method
of \cite[Lemma~2.1]{ProjectiveLCFourfolds} and prove the needed analytic
comparison, with the fixed b-divisor, below.

\begin{lemma}[Comparison for an arbitrary small diagram]
\label{lem:small-comparison}
Let
\[
 T\xrightarrow{\ f\ }Z\xleftarrow{\ f^+\ }T^+
\]
be a diagram of normal irreducible compact K\"ahler fourfolds in which
$f$ and $f^+$ are projective small bimeromorphic morphisms with
connected fibers, and both are nonisomorphisms.  Let $(T,B_T+\M)$ and
$(T^+,B_{T^+}+\M)$ have effective rational boundaries related by
strict transform and the same fixed rational b-divisor.  Transport the
canonical representatives by the identification of prime divisors,
and assume that the actual adjoints $D_T$ and $D_{T^+}$ are
$\Q$-Cartier, with $-D_T$ $f$-ample and $D_{T^+}$ $f^+$-ample.

The exceptional images of $f$ and $f^+$ are equal.  If their common
image is $A$, then
\begin{equation}\label{eq:small-loci}
 L:=\Exc(f)=f^{-1}(A),\qquad
 L^+:=\Exc(f^+)=(f^+)^{-1}(A),
\end{equation}
the complements are isomorphic, and
\begin{equation}\label{eq:small-dimensions}
 \dim L,\dim L^+\leq2,\qquad \dim A\leq1,
 \qquad \dim L+\dim L^+\geq3.
\end{equation}

Let $G$ be the normalization of the main graph, with projections
$p:G\to T$, $q:G\to T^+$ and $h=f\circ p=f^+\circ q$.  Then the
actual $\Q$-Cartier divisor
\begin{equation}\label{eq:small-divisor}
 F:=p^*D_T-q^*D_{T^+}
\end{equation}
is effective and exceptional over both $T$ and $T^+$, and
\begin{equation}\label{eq:small-support}
 \Supp F=h^{-1}(A).
\end{equation}
Moreover, $F\cdot C<0$ for every irreducible curve $C$ contracted by $h$.

For every global place $E$ over these spaces, let $\ord_E(F)$ denote
the coefficient of the pullback of $F$ on any higher proper model
dominating $G$ and carrying $E$.  Then
\begin{equation}\label{eq:small-discrepancies}
 a(E;T^+,B_{T^+}+\M)-a(E;T,B_T+\M)=\ord_E(F)\geq0.
\end{equation}
The inequality is strict exactly when $\cent_T(E)\subset L$, and this
condition is equivalent to $\cent_{T^+}(E)\subset L^+$.  A place is
exceptional over $T$ if and only if it is exceptional over $T^+$.
\end{lemma}

\begin{proof}
We first recall the fiber description for a proper bimeromorphic
morphism $v:V\to S$ of normal spaces.  Its positive-dimensional-fiber
locus is closed analytic.  Over its complement the map is finite
locally on $S$, hence an isomorphism by normality.  Stein factorization
shows that every fiber is connected, because its finite bimeromorphic
factor over the normal space $S$ is an isomorphism.  A reduced compact
connected positive-dimensional fiber has no zero-dimensional
irreducible component: such a component would be a singleton disjoint
from the finitely many other closed components.  Hence no point in
such a fiber is a local isomorphism point.  The exceptional locus of
$v$ is exactly the full inverse image of its positive-dimensional-fiber
locus.

Let $U\subset Z$ be the open set over which $f$ is an isomorphism.
On $U$, $D_T$ defines a $\Q$-Cartier divisor $D_U$.  The actual Weil
coefficients of the two adjoints agree under the identification of
prime divisors.  Since $f^+$ is small, it follows that
$D_{T^+}|_{(f^+)^{-1}U}=(f^+)^*D_U$.  A positive-dimensional projective
fiber over $U$ would contain a curve on which this divisor has degree
zero, contrary to $f^+$-ampleness.  Thus $f^+$ is an isomorphism over
$U$.  Interchanging the two sides and using $f$-ampleness of $-D_T$
gives the reverse inclusion of the isomorphism opens.  This proves
the equality of exceptional images and \eqref{eq:small-loci}.
Smallness gives $\dim L,\dim L^+\leq2$.  Over a general point of each
component of $A$ the fiber has dimension at least one, so the
fiber-dimension theorem gives $\dim A\leq1$.

The graph projections are projective and surjective, and the map from
$G$ to its component in $T\times_ZT^+$ is finite.  A prime divisor of
either side maps to a prime divisor of $Z$ by smallness.  On the graph
it therefore corresponds to the same prime place on the other side,
with the same adjoint coefficient.  Consequently $p_*F=q_*F=0$.
On a $p$-contracted curve, $-F$ has the degree of $q^*D_{T^+}$, which
is nonnegative.  Analytic negativity gives $F\geq0$.

For a curve $C$ contracted by $h$, the projection formula and the two
ample signs give
\[
 -F\cdot C=(-D_T)\cdot p_*C+D_{T^+}\cdot q_*C>0.
\]
Here an image that is a point contributes zero.  At least one image is
a curve, because the finite map to the fiber product cannot contract
$C$ to a point.  Thus at least one summand is strictly positive.

The support of $F$ is contained in $h^{-1}(A)$, since both projections
identify the common isomorphism open and the adjoints agree there.
Conversely, take $x\in h^{-1}(A)$ and write $z=h(x)$.  The map
$h:G\to Z$ is proper bimeromorphic, so its fiber over $z$ is connected.
It is projective and positive-dimensional: its projection to the
positive-dimensional fiber $f^{-1}(z)$ is surjective.  The fiber
description above places $x$ on a positive-dimensional irreducible
component.  Successive projective hyperplane cuts through $x$ give an
irreducible curve $C$ in that fiber through $x$.  If $x$ were outside
$\Supp F$, then $C$ would not be contained in the effective
$\Q$-Cartier divisor $F$, so $F\cdot C\geq0$.  The preceding strict
inequality excludes this.  Hence \eqref{eq:small-support} holds.

Follow a global place $E$ on a common proper model dominating $G$ and
the nef carrier.  Subtracting its two crepant equations cancels the
same trace of $\M$ and gives \eqref{eq:small-discrepancies}.  The order
of an effective $\Q$-Cartier divisor is positive precisely when the
center of the place is contained in its support.  Proper images of
centers give
\[
 \cent_Z(E)=f(\cent_T(E))=f^+(\cent_{T^+}(E))=h(\cent_G(E)).
\]
Together with \eqref{eq:small-loci} and \eqref{eq:small-support}, this
proves both center equivalence and the stated exact strictness
criterion.  If the centers are not contained in these loci, their
general points correspond on the common open and the order is zero.
Finally, a place centered at a divisor on a normal model is that
divisorial place.  Smallness identifies these prime divisors on the
two sides, proving equivalence of exceptionality.

Since both morphisms are nonisomorphisms, $A$ is nonempty, so $F$ has
a prime divisor $R$ in its support.  The graph is a fourfold, hence
$\dim R=3$.  Its finite map to the graph component has image in
$L\times_ZL^+$, whence
\[
 3\leq\dim(L\times_ZL^+)\leq\dim L+\dim L^+.
\]
This is the remaining inequality in \eqref{eq:small-dimensions}.
\end{proof}

The discrepancy statement preserves generalized lc and generalized
klt inequalities along a small step.  It also preserves generalized
terminality, because the same places are exceptional on both sides.
The isomorphism-open argument did not use nontriviality.  In the normal
irreducible compact K\"ahler fourfold setting of
Lemma~\ref{lem:small-comparison}, if an elementary small step is initially specified by a nonisomorphic
negative contraction, a small positive morphism, and the stated Cartier
and ample hypotheses, that argument forces the positive morphism to be
nonisomorphic as well.  Its fibers are connected by normality and Stein
factorization, so Lemma~\ref{lem:small-comparison} applies.
For a finite program we need, in addition, to retain the location of
the accumulated correction at its end.

\begin{lemma}[Comparison along a finite negative program]
\label{lem:program-comparison}
Let $Y_0\dashrightarrow\cdots\dashrightarrow Y_m$, with $m\geq0$, be
a finite sequence of normal irreducible compact K\"ahler fourfolds with
$\Q$-Cartier adjoints $D_j=K_{Y_j}+B_j+M_{Y_j}$.  Suppose the effective
rational boundaries are transported by pushforward, the canonical
representatives are compatible, and the same b-divisor with a projective
carrier is used throughout.  Assume
each step is either a small diagram satisfying
Lemma~\ref{lem:small-comparison}, or a projective bimeromorphic
divisorial contraction $v_j:Y_j\to Y_{j+1}$ such that
$D_{j+1}=(v_j)_*D_j$ and $-D_j$ is $v_j$-ample.  These steps extract
no prime divisors.  On a smooth common model $W$ with projective maps
to every $Y_j$ and to the carrier, write $r_j:W\to Y_j$.  Then
\begin{equation}\label{eq:program-comparison}
 r_0^*D_0-r_m^*D_m=E,\qquad E\geq0,\qquad (r_m)_*E=0.
\end{equation}
Every global discrepancy is nondecreasing along the run.  If a prime
divisor is contracted in a divisorial step, its discrepancy increases
strictly at that step, and its discrepancy at the end is strictly
larger than before that step.
\end{lemma}

\begin{proof}
For a divisorial step put
$E_j=D_j-v_j^*D_{j+1}$.  It is exceptional over $Y_{j+1}$ and has
strictly negative degree on every $v_j$-contracted curve.  Negativity
gives $E_j\geq0$.  Every point of an exceptional fiber lies on a curve
in that fiber, by the connected projective fiber argument in the proof
of Lemma~\ref{lem:small-comparison}.  The negative degree therefore
forces that point into $\Supp E_j$.  In particular the coefficient of
$E_j$ at each contracted prime is positive.  Subtracting crepant
equations gives nondecreasing discrepancies and this strict increase.
For a small step the same assertions, with an effective correction
exceptional over its output, follow from
Lemma~\ref{lem:small-comparison}.

Pull the corrections of all steps to $W$ and add them.  This gives the
effective divisor in \eqref{eq:program-comparison}.  Each prime in a
summand is exceptional over that step's output, and remains exceptional
over every later output.  Indeed, if that place became a prime divisor
on a later normal model, that prime would have a strict-transform prime
on each earlier model, since none of the intervening steps extracts divisors.
This contradicts its earlier exceptionality.  Thus the sum is
exceptional over $Y_m$.  Its nonnegative coefficients also show that
a strict increase from a contracted prime cannot be canceled later.
For $m=0$ the correction is zero and the assertions are immediate.
\end{proof}

\subsection{A nef end and a prescribed ample model}

An effective correction exceptional over the end is the form needed to
compare a finite program with a prescribed positive side of a diagram.
The next argument uses the effective-pushforward form of negativity,
since the two corrections need not have the same exceptional primes;
compare \cite[Lemma~2.5]{ProjectiveLCFourfolds} in the projective setting.

\begin{lemma}[Nef and ample models]\label{lem:nef-ample}
Let $Y_0$, $Y$, and $T_+$ be normal irreducible compact K\"ahler spaces
with projective bimeromorphic morphisms to a normal compact K\"ahler
space $S$.  On a smooth common model $W$ over $S$, projective over these
spaces, let $P_0$, $P$, and $P_+$ be the pullbacks of respective
$\Q$-Cartier divisors $D_0$, $D_Y$, and $D_+$.  Suppose that
\[
 P_0=P+E_Y=P_++E_+,
\]
where $E_Y\geq0$ is exceptional over $Y$ and $E_+\geq0$ is exceptional
over $T_+$.  If $D_Y$ is nef over $S$ and $D_+$ is ample over $S$,
then $P=P_+$ as actual divisors.  The induced bimeromorphic map is a
projective morphism $\varphi:Y\to T_+$ over $S$, and
$D_Y=\varphi^*D_+$.
\end{lemma}

\begin{proof}
Write $r:W\to Y$ and $t:W\to T_+$, and put
$H=P-P_+=E_+-E_Y$.  Then $r_*H=r_*E_+\geq0$.  On an $r$-contracted
curve, $-H$ has the degree of $P_+$, which is nonnegative because
the curve lies over a point of $S$.  Negativity gives $H\geq0$.
Likewise $t_*(-H)=t_*E_Y\geq0$, while $H$ is $t$-nef because $P$ comes
from an $S$-nef divisor.  Negativity applied to $-H$ gives $H\leq0$.
Thus $P=P_+$.

For a curve $C$ in an $r$-fiber, equality gives
$t^*D_+\cdot C=P\cdot C=0$.  The image $t(C)$ lies in an $S$-fiber,
where $D_+$ is ample, so $t(C)$ is a point.  Every $r$-fiber is
projective and connected.  If an irreducible component of one such
fiber had positive-dimensional image under $t$, a curve in that
projective image and projective hyperplane cuts of its inverse image
would supply a curve on which $t$ is nonconstant.  Thus each component
maps to a point, and connectedness makes those points equal.  The map
$t$ is constant on every $r$-fiber.

The reduced image of $(r,t):W\to Y\times_ST_+$ is a proper analytic
graph with one-point fibers over $Y$.  Its projection to $Y$ is
therefore finite and bimeromorphic, hence an isomorphism by normality
of $Y$.  This gives the morphism $\varphi$.  Its graph is a closed
subspace of $Y\times_ST_+$, whose projection to $T_+$ is projective
by base change from $Y\to S$; hence $\varphi$ is projective.  Finally,
pushing the equality $P=P_+$ to $Y$ gives
$D_Y=\varphi^*D_+$ as actual divisors.
\end{proof}

\subsection{Ranks of analytic cycle classes}

The small-diagram comparison forces a surface on at least one side of
every step.  The following ranks count the steps after the positive
side has no exceptional surface.  They also count divisorial steps in
the auxiliary programs.  Their role is the analytic counterpart of the
surface-cycle rank in the terminal fourfold argument of
\cite[Theorem~5-1-15 and Lemma~5-1-17]{KawamataMatsudaMatsuki1987}.

For a compact complex analytic space $V$ and an integer $k\geq0$, put
\[
 \begin{split}
 \mathcal C_k(V)&=\operatorname{span}_{\Q}
 \{[Q]\in H_{2k}(V,\Q):
       Q\subset V\text{ irreducible compact analytic},\ \dim Q=k\},\\
 c_k(V)&=\dim_{\Q}\mathcal C_k(V).
 \end{split}
\]
Fundamental classes use the complex orientation of the regular loci.
Finite compatible triangulations of compact analytic spaces make these
ranks finite.  If $V$ is compact K\"ahler, the class of every such $Q$
is nonzero, including when $V$ or $Q$ is singular: for a K\"ahler form
$\omega$,
\[
 \langle[\omega]^k,[Q]\rangle=\int_{Q_{\mathrm{reg}}}\omega^k>0.
\]
The same observation applies to a closed analytic subspace of a
compact K\"ahler space.  We use ordinary homology on compact spaces
and Borel--Moore homology on open complements.

\begin{lemma}[Loss of analytic cycle classes]\label{lem:cycle-loss}
Let $k\geq0$ be an integer, and let $X\dashrightarrow Y$ be a
bimeromorphic transformation of compact K\"ahler spaces represented by
a proper bimeromorphic diagram.
Suppose it identifies
\[
 U=X\setminus A\simeq Y\setminus B,
\]
where $A$ and $B$ are closed analytic subspaces and $\dim B<k$.
Then restriction to $U$ and strict transform induce a surjection
$\mathcal C_k(X)\to\mathcal C_k(Y)$.  Consequently
$c_k(X)\geq c_k(Y)$, with strict inequality if $A$ contains an
irreducible compact analytic subspace of dimension $k$.

In a sequence of bimeromorphic transformations of normal irreducible $n$-dimensional
compact K\"ahler spaces which extract no prime divisors, only finitely
many transformations can contract a prime divisor; a small
transformation preserves $c_{n-1}$.  In particular, for a small
fourfold diagram of Lemma~\ref{lem:small-comparison}, if $\dim L^+<2$,
then $c_2(T)\geq c_2(T^+)$, strictly if $L$ contains a surface.
\end{lemma}

\begin{proof}
This is the rational-coefficient version of
\cite[Lemma~4.1]{KahlerAuxiliary}; we include its localization argument.
The Borel--Moore localization sequence for $B\subset Y$ contains
\[
 H_{2k}(B,\Q)\longrightarrow H_{2k}(Y,\Q)
 \longrightarrow H_{2k}^{\BM}(U,\Q)
 \longrightarrow H_{2k-1}(B,\Q).
\]
The outside groups vanish by $\dim B<k$ and the real dimension bound
for an analytic triangulation.  Thus restriction from $Y$ is an
isomorphism in degree $2k$.  Compose restriction from $X$ with its
inverse.  An irreducible compact analytic $k$-cycle meeting $U$ is
sent to its strict transform on $Y$; analyticity of that transform
follows by proper mapping through the given diagram.  A cycle
contained in $A$ is sent to zero.  Conversely, no $k$-cycle of $Y$ is
contained in $B$, and its strict transform on $X$ maps to its class.
This proves the surjection on cycle spans.  If $A$ contains a
$k$-dimensional irreducible analytic subspace, its nonzero class is in
the kernel, giving strict inequality.

For a transformation that extracts no prime divisors, choose the
common isomorphism open with target complement of codimension at least
two.  Every contracted source prime lies in the source complement.
The preceding result with $k=n-1$ gives a strict drop at each such
contraction.  The ranks are nonnegative integers, so there can be
only finitely many drops.  For a small transformation both complements
have codimension at least two, and applying the result in both
directions gives equality.  Finally, \eqref{eq:small-loci} gives the
common open for a small fourfold diagram.  Applying the first assertion
with $k=2$, $A=L$ and $B=L^+$ proves the last claim.
\end{proof}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/03-comparisons.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/04-terminal-junctions.tex ====
\section{Terminal junctions and surface centers}\label{sec:junctions}

We now work with a sequence of small diagrams on strong models, and
assume that its initial generalized pair is
generalized klt.  The purpose of this section is to replace the models in
the sequence by crepant generalized terminal models.  Consecutive terminal
models will be joined by a decrease of boundary coefficients followed by a
finite sequence of small elementary steps.  We then show that, after
discarding finitely many diagrams, every coefficient that still changes
belongs to a divisor contracted to a curve or a point.  The terminal-junction
construction follows the method of
\cite[Section~3, Proposition~3.4]{ProjectiveLCFourfolds}; the surface
calculation below supplies the control of coefficient variation needed in
the present analytic setting.

Throughout this section, write the diagrams as
\[
 X_i\xrightarrow{f_i}Z_i\xleftarrow{f_i^+}X_{i+1},
 \qquad D_i=K_{X_i}+B_i+M_{X_i},
\]
and put $a_i(E)=a(E;X_i,B_i+\M)$ for a global place $E$.  We retain all
the hypotheses on the diagrams and on the fixed nef b-divisor from
Theorem~\ref{thm:main}.  In addition, each $X_i$ is strong and
$(X_0,B_0+\M)$ is generalized klt.  The exceptional
loci of $f_i$ and $f_i^+$ are denoted by $L_i$ and $L_i^+$, respectively.
Here the initial boundary and higher nef datum belong to the particular
strong generalized klt sequence under study; a later application may use
the data of a tail obtained after removing a boundary floor.

\begin{proposition}[Crepant terminal junctions]\label{prop:terminal-junctions}
Suppose that the sequence above is infinite.  After passing to a tail,
there are a number $\varepsilon>0$ and a finite set $\mathcal I$ of global
places such that, at every remaining index $i$,
\begin{equation}\label{eq:stable-low-places}
 \begin{gathered}
 a_i(E)\geq\varepsilon\quad\text{for every global place }E,
 \\
 \mathcal I=
 \{E:E\text{ is exceptional over }X_i,\ a_i(E)\leq 1\}.
 \end{gathered}
\end{equation}
There are projective bimeromorphic crepant morphisms
\begin{equation}\label{eq:terminal-junction}
 \begin{gathered}
 h_i:(Y_i,\Theta_i+\M)\longrightarrow (X_i,B_i+\M),
 \\
 K_{Y_i}+\Theta_i+M_{Y_i}=h_i^*D_i,
 \end{gathered}
\end{equation}
with the following properties.
\begin{enumerate}
\item Each $Y_i$ is a strong normal irreducible compact K\"ahler fourfold,
$\Theta_i$ is effective, and
$(Y_i,\Theta_i+\M)$ is generalized terminal.  The exceptional prime
divisors of $h_i$ represent exactly the places in $\mathcal I$.
\item For $E\in\mathcal I$, let $S_{i,E}$ be its prime on $Y_i$.  Define
\begin{equation}\label{eq:junction-coefficient-change}
 \Theta_i'=
 \Theta_i-\sum_{E\in\mathcal I}
       \bigl(a_{i+1}(E)-a_i(E)\bigr)S_{i,E}.
\end{equation}
Starting with $(Y_i,\Theta_i'+\M)$, a finite, possibly empty, sequence
of small elementary steps over $Z_i$ ends at
$(Y_{i+1},\Theta_{i+1}+\M)$.  All its models are strong normal irreducible
compact K\"ahler fourfolds, all its pairs are generalized
terminal, and its boundary and nef data are transported as in an elementary
program.  In particular, every global place is exceptional over one model
of this connecting sequence if and only if it is exceptional over all of
them.
\item There is one finite label set $\mathcal H$ for the primes supplied by
$\mathcal I$ and by the components of $B_0$.  Write $S_h$ for the current
strict transform of a label and $b_h$ for its current coefficient.  Labels
are retained when their coefficient is zero.  On the entire chain of
coefficient changes and small steps,
\[
                    \Theta=\sum_{h\in\mathcal H}b_hS_h,
                    \qquad 0\leq b_h<1,
\]
and every $b_h$ is nonincreasing.  Call a label \emph{varying} if its
coefficient sequence is not eventually constant, and \emph{fixed}
otherwise.  After a further tail is chosen, all fixed coefficients are
constant.  Every varying label comes from $\mathcal I$ and has positive
coefficient at every remaining stage.
\end{enumerate}
\end{proposition}

Figure~\ref{fig:terminal-bridge} records the two kinds of change between
crepant junctions.  The difficulty in Section~\ref{sec:difficulty} will
be compared across both upper moves.
\begin{figure}[ht]
\centering
\begin{tikzcd}[column sep=3.2cm,row sep=large]
 (Y_i,\Theta_i) \arrow[r,Rightarrow,"\Theta_i'\leq\Theta_i"]
   \arrow[d,"h_i"'] &
 (Y_i,\Theta_i') \arrow[r,dashed,"\text{finite small program}"] &
 (Y_{i+1},\Theta_{i+1}) \arrow[d,"h_{i+1}"] \\
 X_i \arrow[r,"f_i"'] & Z_i & X_{i+1}\arrow[l,"f_i^+"]
\end{tikzcd}
\caption{The bridge for one downstairs flip.  The first upper arrow changes
the boundary on the same space; it is not a morphism.  The second denotes a
finite, possibly empty, sequence of small elementary steps over $Z_i$.
The two vertical maps are crepant for the displayed endpoint boundaries,
and the b-divisor $\M$ is fixed throughout.}
\label{fig:terminal-bridge}
\end{figure}

\begin{proof}
By Lemma~\ref{lem:small-comparison}, discrepancies do not decrease, and a
place is exceptional over $X_i$ exactly when it is exceptional over
$X_{i+1}$.  Consequently the sets
\[
 \mathcal I_i=\{E:E\text{ is exceptional over }X_i,\ a_i(E)\leq1\}
\]
form a decreasing sequence.  Proposition~\ref{prop:low-places} makes the
first of them finite and gives a positive lower bound for all initial
discrepancies.  Monotonicity preserves that bound.  A decreasing sequence
of subsets of a finite set stabilizes, which gives
\eqref{eq:stable-low-places}.  We reindex this tail.

If $\mathcal I$ is empty, take the identity as the first junction.
Otherwise apply Proposition~\ref{prop:extraction} at the first index to
extract exactly $\mathcal I$.  Its hypotheses hold: the model is strong,
the pair is generalized klt with rational effective boundary, and the
fixed nef data are carried on a higher model projective over $X_i$.
The resulting morphism is projective bimeromorphic and has a strong normal
irreducible compact K\"ahler source.  Crepancy gives the coefficient
$1-a_i(E)\in[0,1-\varepsilon]$ on an extracted prime; all other boundary
components are strict transforms of $B_i$.  Thus the crepant boundary is
effective.  Notice that a place with $a_i(E)=1$ is extracted with coefficient
zero.

Any place exceptional over this source is exceptional over $X_i$: a prime
on $X_i$ has a strict transform on every proper birational model.  Such a
place is not one of the extracted primes, so its discrepancy is strictly
greater than $1$ by \eqref{eq:stable-low-places}.  Crepancy and the positive
lower bound prove generalized terminality.  This constructs the first
junction.

Suppose the junction over $X_i$ has been constructed.  The coefficient of
$S_{i,E}$ changes in \eqref{eq:junction-coefficient-change} from
$1-a_i(E)$ to $1-a_{i+1}(E)$.  Both are nonnegative because $E$ belongs to
the stabilized set at both indices, and the latter is no larger than the
former.  The divisor subtracted from $\Theta_i$ is effective and
$\Q$-Cartier on the strong model $Y_i$.  Its pullback to a higher model is
effective; hence subtracting it only increases discrepancies.  In
particular, $\Theta_i'$ remains effective and
$(Y_i,\Theta_i'+\M)$ remains generalized terminal.  Set
\[
                    D_i'=K_{Y_i}+\Theta_i'+M_{Y_i}.
\]

We first compare this adjoint with the positive model downstairs.  By
Lemma~\ref{lem:common-projective-models}, choose a smooth common
model $W$, carrying $\M$, with projective maps
$q:W\to Y_i$ and $r:W\to X_{i+1}$, all over $Z_i$, and put
\begin{equation}\label{eq:junction-positive-comparison}
                         F=q^*D_i'-r^*D_{i+1}.
\end{equation}
The coefficient change makes $q_*F=0$.  Indeed, at a prime $S_{i,E}$ with
$E\in\mathcal I$, the coefficient of the crepant boundary computed from
$X_{i+1}$ is $1-a_{i+1}(E)$, the new coefficient in $\Theta_i'$.
Every other prime on $Y_i$ corresponds, by smallness downstairs, to a
prime on $X_{i+1}$ and has its transported boundary coefficient.  The
canonical representatives and the trace of the same b-divisor agree in
this calculation.  On a curve contracted by $q$, the divisor $-F$ has
nonnegative degree: $q^*D_i'$ has degree zero and $r^*D_{i+1}$ is pulled
back from the $f_i^+$-ample divisor $D_{i+1}$.  The negativity
lemma therefore gives $F\geq0$.  Moreover every prime on $X_{i+1}$ is
represented on $Y_i$, where the coefficient of $F$ is zero.  Thus $F$ is
exceptional over $X_{i+1}$.

Use the finite generalized klt part of
Proposition~\ref{prop:relative-program} for $D_i'$ over $Z_i$.  The map
$Y_i\to Z_i$ is projective bimeromorphic to a normal compact K\"ahler
base, the source is strong and generalized klt, and a common higher model
projective over $Y_i$ carries the fixed data with the
required relative nefness.  The proposition supplies a finite elementary
program ending at a model $\overline Y$ whose adjoint $\overline D$ is nef
over $Z_i$.  On a further common model, write again $q$ for the map to
$Y_i$ and $\bar q$ for the map to $\overline Y$.
Lemma~\ref{lem:program-comparison} gives
\[
              q^*D_i'=\bar q^*\overline D+G,
              \qquad G\geq0\text{ exceptional over }\overline Y.
\]
Together with \eqref{eq:junction-positive-comparison}, these are the two
effective comparisons required by Lemma~\ref{lem:nef-ample}.  That lemma
gives a projective morphism $h_{i+1}:\overline Y\to X_{i+1}$ and the
actual crepant identity $\overline D=h_{i+1}^*D_{i+1}$.

This program cannot have lost a marked prime $S_{i,E}$.  Its discrepancy
immediately after the coefficient change is $a_{i+1}(E)$; by the crepant
identity its discrepancy at the end is again $a_{i+1}(E)$.  If a divisorial
step had contracted it, the strict comparison for that step would have
increased this discrepancy, and subsequent comparisons could not decrease
it.  Nor can the program have lost any other prime on $Y_i$.  Such a prime
corresponds to a prime on $X_{i+1}$, and that prime must have a strict
transform on $\overline Y$.  An elementary program extracts no prime, so a
prime once contracted cannot reappear.  We have excluded every divisorial
step.  All connecting steps are therefore small, and their discrepancy
comparisons preserve generalized terminality.  They also preserve the
exceptionality status of every place.  Smallness downstairs keeps each
marked place exceptional over $X_{i+1}$, whereas every other surviving
prime corresponds to a prime on $X_{i+1}$.  Thus the surviving marked
primes are exactly the exceptional primes of $h_{i+1}$, and the end is the
required junction $Y_{i+1}$.  This proves the construction by induction.  The
relative program is allowed to have length zero.

There are finitely many marked primes and finitely many components of
$B_0$.  Smallness transports all of them through every connector.  The
downstairs coefficients are constant, and the marked coefficients are
$1-a_i(E)$ at junctions and are changed only by
\eqref{eq:junction-coefficient-change}.  They are therefore nonincreasing
and lie in $[0,1)$.  For the finitely many coefficient sequences that are
eventually constant, discard a prefix after all have become constant.
Every other sequence stays positive: a nonnegative nonincreasing sequence
that reaches zero is thereafter zero.  Only marked coefficients can be of
this latter type.  This proves the last assertion.
\end{proof}

All the terminal models just constructed are also ordinarily terminal by
Lemma~\ref{lem:ordinary-singularities}.  In particular they are smooth in
codimension two.  To control marked coefficients above a surface, we need
no bound on the number of exceptional curves in a transverse slice.
Grouping the curves by their global marked labels will give a linear
system with at most $|\mathcal I|$ unknowns and an integer matrix whose
columns are linearly independent.  We will bound its entries and clear one denominator for
its right-hand side; a nonsingular minor then gives a uniform lattice for
the marked coefficients.

\begin{proposition}[Finiteness above marked surfaces]\label{prop:surface-finiteness}
In the setting of Proposition~\ref{prop:terminal-junctions}, there is a
finite set
\[
                    \mathcal A_{\mathrm{surf}}
                    \subset [\varepsilon,1]\cap\Q
\]
such that $a_i(E)\in\mathcal A_{\mathrm{surf}}$ whenever
$E\in\mathcal I$ and $\cent_{X_i}(E)$ is a surface.  After passing to a
further tail, the following conclusions hold.
\begin{enumerate}
\item No $E\in\mathcal I$ has a surface center contained in $L_i$ on
$X_i$, or a surface center contained in $L_i^+$ on $X_{i+1}$.
\item Every varying label $S_h\subset Y_i$ satisfies
$\dim h_i(S_h)\leq1$ at every junction.
\item For an irreducible compact analytic surface contained in either $L_i$
or $L_i^+$, the corresponding
junction morphism is an isomorphism near its general point, and the
downstairs model is smooth there.  Blowing up the coherent ideal of that
surface defines a unique global generic blowup place.  It is exceptional
over the corresponding downstairs model and has discrepancy strictly
greater than $1$; in particular it does not belong to $\mathcal I$.
\end{enumerate}
\end{proposition}

\begin{proof}
We first prove the assertion about $\mathcal A_{\mathrm{surf}}$.  If
$\mathcal I$ is empty, choose $\mathcal A_{\mathrm{surf}}=\varnothing$.
For the remaining case, fix a junction $\rho:Y\to X$ and a surface
$V\subset X$ which is the center of at least one marked prime.  We work
near general points of $V$.

\medskip\noindent\emph{A transverse surface and its curves.}
The exceptional image of a proper birational morphism to normal $X$ has
codimension at least two.  We may avoid every other component of that
image and every center properly contained in $V$.  The full inverse image
of $V$ is a proper analytic subset of the irreducible fourfold $Y$, hence
has dimension at most three.  A component supplying a curve over a general
point of $V$ must therefore have dimension three and be a divisor
dominating $V$.  All such divisors are marked.  Components of dimension
at most two cannot supply a curve in a general fiber.  These observations
also show that the general fibers over $V$ have dimension at most one.

The singular locus of terminal $Y$ has dimension at most one, so it misses
the fiber over a general point of $V$.  The singular loci of the marked
divisors, their pairwise intersections, and their intersections with
strict transforms of components of $B_0$ have dimension at most two.
Choose also a projective carrier $\sigma:W\to Y$ for the fixed nef data,
with $W$ smooth.  Its nonisomorphism image has dimension at most two.  None of
these subsets can contain an entire curve over a general point of $V$:
a component that dominates the surface has zero-dimensional general
fiber, and components with smaller image can be avoided.

Here is a precise choice of the slice used below.  Near a general smooth
point of $V$, lift two local coordinates on $V$ to holomorphic functions
on $X$.  Take a general common level set of their pullbacks on $Y$.
Finite analytic stratifications near the proper fiber can be chosen to
respect the divisors and the subsets in the preceding paragraph.  On
every stratum dominating $V$, generic smoothness makes the two pulled-back
functions submersive over general values; the images of all other strata
can be avoided.  It follows, after shrinking about the fiber, that the
level set is a smooth surface $R$.  The restriction of $K_Y$ to $R$ is
$K_R$, because the two slice equations trivialize its normal bundle.

Let $C_1,\ldots,C_q$ be the reduced irreducible curves of the fiber in
$R$.  Each is supplied by exactly one marked divisor, with multiplicity
one in that divisor's slice: at a general point of the curve the divisor
is smooth, the slice is transverse on it, and none of the other listed
subsets contains that curve.  Write $\lambda(j)$ for its label.  The same
label may supply several curves, but each marked divisor with center $V$
supplies at least one.  No $C_j$ is contained in a strict downstairs
boundary component or in the nonisomorphism image of $\sigma$.

The restricted map on the slice is proper near this fiber, contracts the
$C_j$ to a point, and is an isomorphism off that point locally.  No
surface component is mapped to the point, by the fiber dimension bound.
Pass, if necessary, to the normal Stein factor of the local target, or
equivalently to the normalization of the relevant local image.  We then
have a proper modification from the smooth surface whose reduced
exceptional set is the union of these curves.  Grauert's
negative-definiteness criterion
\cite[Section~4, no.~8(e), pp.~366--367]{Grauert1962} therefore applies:
the matrix
\[
                       A=(C_j\cdot C_k)_{1\leq j,k\leq q}
\]
is negative definite.  Put $u_j=-C_j^2\in\Z_{>0}$ and
$m_{jk}=C_j\cdot C_k\in\Z_{\geq0}$ for $j\ne k$.

\medskip\noindent\emph{Uniform bounds for the intersection equations.}
Let $B_Y^{\mathrm{str}}$ denote the strict boundary part coming from
$B_i$.  It has nonnegative intersection with every $C_j$, since it is
effective and contains no such curve.  The same nonnegativity holds for
$M_Y$.  Indeed, the strict transform $C_j'$ on $W$ meets the isomorphism
locus of $\sigma$.  For the effective nef defect of
Lemma~\ref{lem:nef-defect},
\[
                         J=\sigma^*M_Y-M_W\geq0,
\]
the curve $C_j'$ is not contained in $\Supp J$.  The projection formula,
nefness on the carrier, and effectivity then give
\[
                 M_Y\cdot C_j=M_W\cdot C_j'+J\cdot C_j'\geq0.
\]
Intersect the crepant equation
$K_Y+\Theta+M_Y=\rho^*D_X$ with $C_j$.  On $R$ the marked part near the
fiber is $\sum_k b_{\lambda(k)}C_k$.  Adjunction for the reduced
irreducible compact curve $C_j$ gives
$K_R\cdot C_j=2p_a(C_j)-2+u_j$.  We obtain
\begin{align*}
 0={}&2p_a(C_j)-2+(1-b_{\lambda(j)})u_j
       +\sum_{k\ne j}b_{\lambda(k)}m_{jk}
       +(B_Y^{\mathrm{str}}+M_Y)\cdot C_j\\
 \geq{}&2p_a(C_j)-2+(1-b_{\lambda(j)})u_j.
\end{align*}
Since $p_a(C_j)\geq0$ and
$1-b_{\lambda(j)}\geq\varepsilon$, it follows that
\begin{equation}\label{eq:surface-self-intersection-bound}
 (1-b_{\lambda(j)})u_j\leq2-2p_a(C_j)\leq2,
 \qquad u_j\leq U:=\left\lceil\frac2\varepsilon\right\rceil.
\end{equation}

Negative definiteness now bounds each whole row of $A$, even when $q$ is
large.  Fix $j$ and test its quadratic form on the vector whose $j$th
entry is $1$ and whose $k$th entry is $m_{jk}/u_k$ for $k\ne j$.  Its
value is
\[
 -u_j+\sum_{k\ne j}\frac{m_{jk}^2}{u_k}
 +2\sum_{\substack{k<\ell\\k,\ell\ne j}}
   \frac{m_{k\ell}m_{jk}m_{j\ell}}{u_ku_\ell}<0.
\]
The last sum is nonnegative.  Therefore
\begin{equation}\label{eq:surface-row-bound}
 \sum_{k\ne j}\frac{m_{jk}^2}{u_k}<u_j,
 \qquad
 \sum_{k\ne j}m_{jk}\leq\sum_{k\ne j}m_{jk}^2<U^2.
\end{equation}
The second inequality uses $u_k\leq U$ and the integrality and
nonnegativity of every $m_{jk}$.  The absolute sum in each row of $A$ is
thus at most $C_{\mathrm{row}}:=U+U^2$.

\medskip\noindent\emph{Grouping curves by global labels.}
Let $\mathcal H_V$ be the marked labels whose center is $V$, and put
$t=|\mathcal H_V|\leq|\mathcal I|$.  Define the $q$-by-$t$ zero-one
matrix $P$ by
\[
             P_{k,h}=\begin{cases}1,&\lambda(k)=h,\\0,&\lambda(k)\ne h.
                         \end{cases}
\]
Its columns have disjoint nonempty supports, so $P$ has column rank $t$.
Since $A$ is invertible, $AP$ has the same column rank.  Each of its
integer entries is a sum from one row of $A$, and hence has absolute
value at most $C_{\mathrm{row}}$.  The intersection equations take the
form
\begin{equation}\label{eq:grouped-surface-equations}
 \begin{gathered}
                  (AP)(b_h)_{h\in\mathcal H_V}=-(v_j)_{1\leq j\leq q},
 \\
 v_j=K_R\cdot C_j+(B_Y^{\mathrm{str}}+M_Y)\cdot C_j.
 \end{gathered}
\end{equation}
No marked coefficient occurs in the right-hand side.

There is a fixed integer $m_{\mathrm{data}}>0$ such that every
$m_{\mathrm{data}}v_j$ is integral, for every junction and surface in
this calculation.  Choose it to clear the initial boundary coefficients
of this strong generalized klt sequence and to make its chosen higher nef
divisor integral Cartier.  Canonical
degrees on the smooth $R$ are integral.  Each strict boundary prime is
Cartier in the smooth neighborhood of the fiber, so its degree has the
chosen boundary denominator.  Finally, the trace of the integral Cartier
divisor $m_{\mathrm{data}}\M$ on any model is an integral Weil divisor:
compute it by pulling back to a common higher model and pushing forward.
On the smooth neighborhood of the present fiber that trace is Cartier,
so its degree is integral as well.  No assertion about its Cartier index
elsewhere is needed.

Choose $t$ rows of $AP$ giving a nonsingular square matrix.  Its
determinant is a nonzero integer with an absolute value bounded in terms
of $t$ and $C_{\mathrm{row}}$, for example by
$t^{t/2}C_{\mathrm{row}}^t$ by Hadamard's inequality.  Since
$1\leq t\leq|\mathcal I|$, choose one integer $H_{\mathrm{det}}$ bounding
all these absolute values.  Cramer's rule applied to
\eqref{eq:grouped-surface-equations} then gives
\[
 \begin{gathered}
 q_{\mathrm{surf}}=
 m_{\mathrm{data}}\operatorname{lcm}(1,2,\ldots,H_{\mathrm{det}}),
 \\
 b_h\in q_{\mathrm{surf}}^{-1}\Z\qquad(h\in\mathcal H_V).
 \end{gathered}
\]
The denominator is independent of the junction, the surface, and the
number of geometric curves in the slice.  In particular the marked
discrepancies above surfaces belong to the finite set
\begin{equation}\label{eq:marked-surface-discrepancies}
          \mathcal A_{\mathrm{surf}}
          =[\varepsilon,1]\cap q_{\mathrm{surf}}^{-1}\Z.
\end{equation}
This finite set is used only to exclude recurring marked surface centers
contained in the exceptional loci.  The weight denominator in
Section~\ref{sec:difficulty} will be chosen later from the actual fixed
coefficients and the initial rational data; it need not clear every element
of $\mathcal A_{\mathrm{surf}}$.

\medskip\noindent\emph{Removing marked surface centers from the exceptional loci.}
Fix $E\in\mathcal I$.  Suppose its center is a surface in $L_i$ at
infinitely many indices $i_1<i_2<\cdots$.  The strict comparison at
$i_k$ and monotonicity between indices give
\[
                  a_{i_{k+1}}(E)\geq a_{i_k+1}(E)>a_{i_k}(E).
\]
Both $a_{i_k}(E)$ and $a_{i_{k+1}}(E)$ belong to
$\mathcal A_{\mathrm{surf}}$, a contradiction.  If instead its center is
a surface in $L_i^+$ at
infinitely many indices, the corresponding positive-side discrepancies
satisfy
\[
             a_{i_{k+1}+1}(E)>a_{i_{k+1}}(E)\geq a_{i_k+1}(E),
\]
again contradicting membership of $a_{i_k+1}(E)$ and
$a_{i_{k+1}+1}(E)$ in the same finite set.  There are finitely many
$E\in\mathcal I$, so one tail excludes all
such occurrences on both sides.  This proves assertion (1).

On that tail, suppose a marked prime has a surface center $V$ at a
junction over $X_i$.  Assertion (1) says $V$ is not contained in $L_i$.
Its general point is therefore in the common isomorphism open of the
next diagram.  The next center is its strict transform, still a surface,
and Lemma~\ref{lem:small-comparison} gives equality of its two
discrepancies.  Repeating the argument at every subsequent index shows
that its coefficient is constant from this index onward.  A varying label
cannot have such a surface center.  Its center cannot be a divisor
downstairs because it represents an exceptional place.  This proves
assertion (2).

Finally let $V$ be an irreducible compact analytic surface in one of the exceptional loci of a
remaining diagram, and use the junction on that side.  If the junction
were not an isomorphism at the general point of $V$, its general fiber
there would be positive dimensional: a proper birational morphism to a
normal space is an isomorphism wherever it is finite.  A component
supplying those curves over $V$ would be a divisor with center $V$, by
the dimension argument at the start of the proof.  This is excluded by
assertion (1).  Thus the junction is an isomorphism near a general point
of $V$.  The source is ordinarily terminal and smooth in codimension two,
so the downstairs model is smooth at a general point of this surface.

The coherent ideal of the global analytic surface $V$ has a projective
blowup.  Over the dense open where the ambient model and $V$ are smooth,
this is the ordinary codimension-two blowup and has a unique prime
divisor dominating $V$.  Its closure on the normalized blowup defines
a global place with center $V$, hence an exceptional place on the
downstairs model.  If its discrepancy were at most $1$, it would belong
to the stabilized set $\mathcal I$, contradicting assertion (1).
This proves assertion (3).
\end{proof}

At each remaining junction, the reduced union of the varying labels is
contracted by $h_i$ to a set of dimension at most one.  This is the input
for Theorem~\ref{thm:branch}.  Assertion~(3) has a separate later use:
over a surface in the positive exceptional locus of a downstairs diagram,
it supplies the global generic blowup place and the smooth downstairs
neighborhood used by the detector in Section~\ref{sec:completion}.
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/04-terminal-junctions.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/05-branch-topology.tex ====
\section{The branch inequality}
\label{sec:branch}

The terminal junctions constructed in Section~\ref{sec:junctions} have
only finitely many boundary labels, but one label can have several
normalization branches along a surface.  We need to control the total
number of these branches for the labels whose images downstairs are
curves or points.  The estimate in this section applies to an arbitrary
union of exceptional divisors with that image-dimension bound; it does
not use a boundary or a crepant equation.

Let $p\colon Y\to X$ be a projective bimeromorphic morphism of normal
irreducible compact K\"ahler fourfolds, with $Y$ ordinary terminal.  Let
\[
 Q=\bigcup_{j=1}^{m}Q_j\subset Y
\]
be a reduced union of distinct irreducible divisors, with $m\geq0$, and assume that
$\dim p(Q)\leq1$.  Write $\nu_j\colon Q_j^\nu\to Q_j$ for normalization
and $\nu\colon\coprod_jQ_j^\nu\to Q$ for their disjoint union.  For an
irreducible compact analytic surface $V\subset Q$, define
\begin{equation}\label{eq:branch-count-definition}
 \begin{aligned}
 r_V(Q)&=\#\{F:\ F\text{ is a prime divisor of }\coprod_jQ_j^\nu,
                         \ \nu(F)=V\},\\
 \beta(Q)&=\sum_{\substack{V\subset Q\\ \dim V=2}}(r_V(Q)-1).
 \end{aligned}
\end{equation}
The surface $V$ is counted once in the sum, regardless of which $Q_j$
contain it.  A normalization divisor mapping to $V$ with degree greater
than one counts once in $r_V(Q)$; that degree will instead enter a
pushforward map in the proof.  The sum in
\eqref{eq:branch-count-definition} will be shown to have only finitely
many nonzero terms.

Recall that a global place over $Y$ is a prime divisor on a normal proper
bimeromorphic model, with primes identified by strict transform on a
common higher model.  Put
\begin{equation}\label{eq:branch-place-count}
 \tau_Y(Q)=\#\left\{
 \begin{array}{@{}l@{}}
 E\text{ a global place over }Y:\\[-2pt]
 \cent_Y(E)\text{ is an irreducible curve contained in }\Sing Y\cap Q,
 \quad a(E;Y,0)=2
 \end{array}\right\}.
\end{equation}
Here $a(E;Y,0)$ is the ordinary log discrepancy, defined intrinsically
by the natural meromorphic comparisons of rational canonical bundles
on birational models.  Thus
$\tau_Y(Q)$ counts global divisors, rather than divisors visible only
over a neighborhood of a point of a singular curve.

\begin{theorem}[Branch inequality]\label{thm:branch}
Let $p\colon Y\to X$ be a projective bimeromorphic morphism of normal
irreducible compact K\"ahler fourfolds, where $Y$ has ordinary terminal
singularities.  Let $Q=\bigcup_{j=1}^{m}Q_j$ be a reduced union of
distinct irreducible divisors satisfying $\dim p(Q)\leq1$.  Then the
sum defining $\beta(Q)$ and the count defining $\tau_Y(Q)$ are finite,
and
\begin{equation}\label{eq:branch-inequality}
 \beta(Q)\leq\sum_{j=1}^{m}c_2(Q_j^\nu)+\tau_Y(Q).
\end{equation}
The rank $c_2(Q_j^\nu)$ is the rational rank spanned in
$H_4(Q_j^\nu,\Q)$ by the fundamental classes of compact irreducible
analytic surfaces.
\end{theorem}

At a terminal junction, Section~\ref{sec:difficulty} will take $Q$ to
be the union of varying labels and prove that rounding can leave an
integer deficit of at most $r_V(Q)-1$ at each surface $V\subset Q$.
Thus $\beta(Q)$ bounds the total possible deficit.  The same section
shows that the terms from normalization ranks and exceptional weights
together contribute at least the right-hand side of
\eqref{eq:branch-inequality}.

The proof first relates the normalization branches to the weight-four
part of a degree-five cohomology map.  A smooth resolution then confines
that part to degree-two cohomology of punctured neighborhoods along the
singular curves of $Y$.  The remaining argument converts those local classes into the
global places counted by \eqref{eq:branch-place-count}.  The
normalization method follows the projective branch argument of
\cite[Section~5, especially Lemma~5.2]{ProjectiveLCFourfolds}.  Here the
ambient fourfolds may be nonprojective, so we supply the analytic and
Hodge-theoretic steps needed in that setting.

Unless other coefficients are displayed, homology and cohomology in
the rest of this section have rational coefficients and refer to the
complex analytic topology.  We omit $\Q$ from their notation when this
causes no ambiguity.  If $Q$ is empty,
all terms in \eqref{eq:branch-inequality} vanish.  We henceforth assume
$Q\ne\varnothing$.

\subsection{Projectivity over the center and normalization relations}

To compare normalization relations on $Q$ with cohomology that a
resolution can control, enlarge $Q$ to the full inverse image of its
center.  Set
\begin{equation}\label{eq:branch-projective-loci}
 C=p(Q)_{\mathrm{red}},\qquad
 P=(p^{-1}C)_{\mathrm{red}}.
\end{equation}
Properness makes $C$ a compact analytic subset of $X$.  Its components
are compact curves and possibly isolated points.  The comparison will
use $H^5(P)\to H^5(Q)$.  We first show that these spaces over $C$ are
projective even when $X$ and $Y$ are not.

Choose on each curve component of $C$ a smooth point that lies on no
other component.  Their sum is a Cartier divisor on $C$, and its line
bundle has positive degree on every curve component.  The ampleness
criterion for reduced compact analytic curves says that this positivity
is exactly ampleness; isolated point components impose no condition.
One can see why singularities introduce no additional obstruction by
normalizing $C$.  Write $\nu_C\colon C^\nu\to C$ for this map.  Its
source is a disjoint union of compact Riemann surfaces and points, and
\[
 0\longrightarrow\mathcal O_C\longrightarrow
   \nu_{C*}\mathcal O_{C^\nu}\longrightarrow\mathcal F\longrightarrow0
\]
has a quotient $\mathcal F$ supported at finitely many points.  On the
Riemann surfaces, a sufficiently high power of the chosen line bundle
separates points and any fixed finite set of jets by Riemann--Roch.
The conditions for these sections to descend to $C$ are the finitely
many gluing conditions measured by $\mathcal F$.  Applying the same
jet separation to them gives the compact-curve criterion and a
projective embedding of $C$.

We will also use the following form of the relative-embedding
criterion.  Suppose that $q\colon R\to C$ is projective and has a
global relatively ample holomorphic line bundle $H$.  Compactness of
$C$ permits one common power $H^n$ for the relative embeddings on a
finite cover of $C$.  Its relative sections give a closed immersion
\[
 R\hookrightarrow\mathbb P_C(q_*H^n).
\]
Here the direct image is coherent by properness, and the relative
projective space is allowed to come from a coherent sheaf.  If $A$ is
an ample line bundle on $C$, then $q_*H^n\otimes A^k$ is globally
generated for $k$ sufficiently large: algebraize the coherent sheaf
on the projective $C$ by GAGA
\cite[Section~12, Theorems~1--3]{SerreGAGA} and apply the usual global-generation
criterion.  A surjection from a finite free sheaf onto it embeds its
projective space, and hence $R$, in $C\times\mathbb P^N$ for some
$N$.  An embedding of $C$ and the Segre embedding now make $R$
projective.  This reasoning applies to reducible spaces and to
nonreduced closed subspaces as well.  GAGA algebraizes their coherent
ideals, and also algebraizes holomorphic morphisms between the resulting
projective spaces.

Apply this argument to the base change $P\to C$.  It shows that $P$
is projective.  The closed analytic subspaces $Q$ and $Q_j$ are then
projective by GAGA, and the finite normalization $Q_j^\nu\to Q_j$
is projective (as every finite morphism is), so each $Q_j^\nu$ is
projective as well.  In particular,
all these spaces and all the maps between them may now be treated as
algebraic for purposes of mixed Hodge theory.

The normalization comparison requires a pure threefold containing $Q$.
Let $P_1$ be the reduced union of the three-dimensional components of
$P$.  The preimage of the proper analytic subset $C\subset X$ is a
proper analytic subset of the irreducible fourfold $Y$, so its
components have dimension at most three.  Each $Q_j$ has dimension
three and is one of those components.  Thus
\[
 Q\subset P_1\subset P,\qquad \dim(P\setminus P_1)\leq2.
\]
These observations also apply when $C$ consists only of points.

For a projective variety $R$, the mixed Hodge structure on $H_k(R)$
is dual to that on $H^k(R)$.  We write $W_\bullet$ for the weight
filtration on either group.  For a map of such groups,
$\rk\Gr^W_a[\,\cdot\,]$ will mean the rank of its induced map on the
weight-$a$ graded pieces.  If $R$ has dimension at most two, then
$H_4(R)$ has the fundamental classes of its irreducible surface
components as a basis.  It is pure of weight $-4$: these classes are
the pushforwards of the top classes of smooth projective resolutions
of the components, which have that weight; see also
\cite[Theorem~8.2.4(ii)--(iii)]{DeligneHodgeIII}.

\begin{lemma}[Normalization relations]\label{lem:branch-normalization}
For the spaces in \eqref{eq:branch-projective-loci}, the sum defining
$\beta(Q)$ is finite and
\begin{equation}\label{eq:branch-normalization-bound}
 \beta(Q)-\sum_jc_2(Q_j^\nu)
 \leq \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr].
\end{equation}
\end{lemma}

\begin{proof}
For a reduced pure projective threefold $R$, write
$\nu_R\colon N_R\to R$ for normalization.  Choose a closed reduced
subset $A_R\subset R$ of dimension at most two containing the locus
where $\nu_R$ is not an isomorphism, and put
$F_R=(\nu_R^{-1}A_R)_{\mathrm{red}}$.  The square
\[
\begin{tikzcd}
 F_R \arrow[r,hook] \arrow[d] & N_R \arrow[d,"\nu_R"]\\
 A_R \arrow[r,hook] & R
\end{tikzcd}
\]
is a proper excision square.  Indeed $\nu_R$ is finite and proper and
identifies the open complements.  Collapsing the two closed subsets
gives a continuous bijection $N_R/F_R\to R/A_R$ of compact Hausdorff
quotients, hence a homeomorphism.  Comparing the two relative homology
sequences gives the exact sequence
\begin{equation}\label{eq:branch-normalization-excision}
 H_5(R)\xrightarrow{\partial_R}H_4(F_R)
 \longrightarrow H_4(A_R)\oplus H_4(N_R).
\end{equation}
All its maps are compatible with mixed Hodge structures.  This follows
from algebraic functoriality and the exact sequence of relative
cohomology as a sequence of mixed Hodge structures
\cite[Propositions~8.2.2 and 8.3.9]{DeligneHodgeIII}, followed by
duality on these compact spaces.

Take this square first for $P_1$.  For $Q$, take
$A_Q=Q\cap A_{P_1}$.  The normalization
$N_Q=\coprod_jQ_j^\nu$ is a union of entire, disjoint normalization
components of $N_{P_1}$.  Thus these choices give a morphism of the
two squares, with $F_Q$ equal to the part of $F_{P_1}$ in those
selected components.

For a surface component $V$ of $A_Q$, let
$F_{V,1},\ldots,F_{V,r_V(Q)}$ be the surface components of $F_Q$
mapping onto it, and let $d_{V,\alpha}>0$ be their finite degrees over
$V$.  On top homology the corresponding part of the map to $A_Q$ is
\[
 \bigoplus_{\alpha=1}^{r_V(Q)}\Q[F_{V,\alpha}]
 \longrightarrow\Q[V],\qquad
 \sum_\alpha t_\alpha[F_{V,\alpha}]
 \longmapsto\left(\sum_\alpha d_{V,\alpha}t_\alpha\right)[V].
\]
Its kernel has dimension $r_V(Q)-1$.  A surface not contained in
$A_Q$ has exactly one normalization divisor over it, since the
normalization is an isomorphism at its general point.  Conversely,
finiteness and surjectivity of normalization give at least one divisor
over every surface in $Q$.  It follows that
\[
 B_Q:=\ker\bigl[H_4(F_Q)\longrightarrow H_4(A_Q)\bigr],
 \qquad \dim B_Q=\beta(Q).
\]
This also proves finiteness of the sum: the only possible nonzero
terms come from the finitely many surface components of $A_Q$.

The image of $B_Q$ in $H_4(N_Q)$ is spanned by classes of compact
surfaces in its normalization components.  Its rank is therefore at
most $\sum_jc_2(Q_j^\nu)$.  Hence
\[
 U_Q:=\ker\bigl[B_Q\longrightarrow H_4(N_Q)\bigr]
 \quad\text{satisfies}\quad
 \dim U_Q\geq\beta(Q)-\sum_jc_2(Q_j^\nu).
\]
By \eqref{eq:branch-normalization-excision}, $U_Q$ is the image of
$\partial_Q$.

The map $H_4(F_Q)\to H_4(F_{P_1})$ is injective.  Both groups have
surface components as their bases, and the surfaces in $F_Q$ remain
distinct surfaces on the selected normalization components of
$P_1$.  Naturality of the boundary maps therefore sends $U_Q$
injectively into the image of $\partial_{P_1}$ on the image of
$H_5(Q)\to H_5(P_1)$.  The groups $H_4(F_Q)$ and $H_4(F_{P_1})$
are pure of weight $-4$.  Strictness for the weight filtration
\cite[Theorem~2.3.5(iii)--(iv)]{DeligneHodgeII} says that
$\partial_R$ maps $\Gr^W_{-4}H_5(R)$ onto its image in the pure group
$H_4(F_R)$.  Applying this to the naturality square, we obtain
\[
 \dim U_Q\leq
 \rk\Gr^W_{-4}\bigl[H_5(Q)\longrightarrow H_5(P_1)\bigr].
\]
Finally, Borel--Moore localization contains
\[
 H^{\BM}_6(P\setminus P_1)\longrightarrow H_5(P_1)
                         \longrightarrow H_5(P).
\]
The first group vanishes because $P\setminus P_1$ has complex
dimension at most two.  The second arrow is therefore injective,
and remains injective on weight-graded pieces by strictness.  Duality
between rational homology and cohomology reverses the sign of the
weight and turns the last two inequalities into
\eqref{eq:branch-normalization-bound}.
\end{proof}

\subsection{A smooth resolution and purity over the center}

Lemma~\ref{lem:branch-normalization} proves the normalization bound
and finiteness of $\beta(Q)$.  To finish Theorem~\ref{thm:branch}, we
must prove finiteness of $\tau_Y(Q)$ and the remaining estimate
\[
 \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]\leq\tau_Y(Q).
\]
We first show that $W_4H^5(P)$ vanishes after pullback to the resolved
inverse image.  The key purity there comes from compact K\"ahler Hodge
theory on the smooth ambient resolution.

Fix, for the rest of Section~\ref{sec:branch}, one projective
resolution with smooth source
\[
 g\colon\widetilde Y\longrightarrow Y
\]
which is an isomorphism over $Y_{\mathrm{reg}}$, whose exceptional
locus is a divisor with simple normal crossings, and which principalizes
the ideal of $\Sing Y$.  Thus
\[
 \mathcal I_{\Sing Y}\mathcal O_{\widetilde Y}
       =\mathcal O_{\widetilde Y}(-E_{\mathrm{sing}}),
 \qquad
 \Supp E_{\mathrm{sing}}=g^{-1}(\Sing Y).
\]
Smoothness is used for purity here; the conditions on the exceptional
divisor and singular ideal will be used in the curve construction.
If $Y$ is smooth, we take $g$ to be the identity and the displayed
divisor to be zero.  Projective resolution and principalization, chosen
to preserve the already resolved open $Y_{\mathrm{reg}}$, give such a
choice in the analytic category
\cite[Theorems~1.10, 12.2, and 13.2(1)]{BierstoneMilman1997}.  The resolution is compact
K\"ahler, and both $g$ and $pg$ have global relatively ample line
bundles.  For the composite one uses a sufficiently positive twist
of a $g$-ample bundle by the pullback of a $p$-ample bundle; compactness
allows a uniform choice.  Set
\[
 \widetilde P=((pg)^{-1}C)_{\mathrm{red}}.
\]
The projectivity argument over $C$ given above shows that
$\widetilde P$ is projective.

We use intersection complexes in their perverse normalization.  For
an irreducible complex analytic space $Z$ of dimension $z$ and a local
system $\mathcal E$ on a smooth dense open, $\IC_Z(\mathcal E)$
restricts there to $\mathcal E[z]$.  It is the middle extension of
that shifted local system: it has no nonzero perverse subobject or
quotient supported in a proper analytic subset of $Z$.  The stalk
support condition says that on a smooth boundary stratum of dimension
$s$,
\begin{equation}\label{eq:branch-ic-stalk-bound}
 \mathcal H^q(\IC_Z(\mathcal E))|_S=0\qquad(q>-s-1).
\end{equation}
Here $\mathcal H^q$ denotes ordinary cohomology sheaves, not perverse
cohomology.  These conventions and the support condition are the
middle-extension axioms in
\cite[Section~2.3 and Section~3.3, Axiom {\rm[AX1]}(c)]{GoreskyMacPhersonIHII}.
They are local statements on stratified spaces, so they apply to the
analytic stratifications used here.  If a new stratum of dimension $s$
cuts the local-system open, the only stalk degree is $-z$, which is
at most $-s-1$ whenever $s<z$.

\begin{lemma}[Decomposition for the resolution maps]
\label{lem:branch-analytic-decomposition}
For $f=g$ with target $Y$, and for $f=pg$ with target $X$, the rational
complex $Rf_*\Q_{\widetilde Y}[4]$ is a finite direct sum of shifts of
perverse middle extensions with irreducible closed analytic supports.
Its unique full-support summand is the intersection complex of the
target in perverse degree zero.
\end{lemma}

\begin{proof}
Write $B$ for the target of $f$ and
$K_f=Rf_*\Q_{\widetilde Y}[4]$.  Fix an $f$-relatively ample line
bundle and let $\ell$ be its rational first Chern class.  Cup product
defines a global morphism $\ell\colon K_f\to K_f[2]$.

We first obtain relative hard Lefschetz locally on $B$.  Around a
point of $B$, choose a small chart $V$ embedded as a closed analytic
subspace of a complex manifold.  After making the chart smaller,
relative ampleness embeds $f^{-1}V$ in a projective space over $V$;
composing with the closed embedding of $V$ gives a projective map
from the smooth manifold $f^{-1}V$ to the ambient manifold.  On each
connected component of the smooth source, the constant shifted sheaf
underlies the constant polarizable Hodge module with that strict
support.  Saito's projective direct-image theorem
\cite[Theorem~5.3.1]{SaitoMHP} applies to precisely this situation:
its morphisms are projective morphisms of smooth complex analytic
manifolds, its Lefschetz class is the Chern class of a relatively ample
line bundle, and its conclusion includes relative hard Lefschetz and
polarizable perverse direct images.  Passing through the closed
embedding, which is fully faithful and exact for perverse sheaves,
gives on $V$
\[
 \ell^a\colon {}^p\!H^{-a}(K_f)|_V
            \xrightarrow{\ \sim\ }{}^p\!H^a(K_f)|_V
 \qquad(a\geq0).
\]
After forgetting Hodge structures, the Tate twist has the same
underlying rational perverse sheaf.  The operator is the restriction of the single
global $\ell$, and a morphism of perverse sheaves is an isomorphism
if it is so on an open cover.  Thus these are global relative hard
Lefschetz isomorphisms on $B$.

The formal Lefschetz splitting criterion
\cite[Theorem~1.5]{DeligneLefschetz} now gives
\begin{equation}\label{eq:branch-perverse-splitting}
 K_f\simeq\bigoplus_i{}^p\!H^i(K_f)[-i].
\end{equation}
The criterion uses truncation triangles and the induced Lefschetz
isomorphisms; the same argument applies to the bounded perverse
$t$-structure.  This explains why the local analytic theorem gives a
global derived splitting here.

We also need to separate the supports of the perverse terms in
\eqref{eq:branch-perverse-splitting}.  Locally, Saito's pure
direct images decompose by strict support
\cite[Section~5.1 and Theorem~5.3.1]{SaitoMHP}; their underlying
perverse terms are middle extensions from smooth opens of those
supports.  The support decomposition glues without requiring
semisimplicity of local systems on arbitrary analytic opens.  Indeed,
a perverse morphism between middle extensions with different
irreducible supports must be zero: its image would be a subobject or
a quotient with smaller support in at least one of them.  Restriction
to an open preserves the middle-extension property; every resulting
strict support is a local branch of the original support.  The local
system may decompose further without changing that support.  For each
perverse term and each dimension $d$, the sum of the local projectors
onto all $d$-dimensional strict-support summands is intrinsic.
Restriction preserves dimensions of local branches, so these sums
agree on overlaps and glue as perverse morphisms.  The support of each
glued dimension summand is closed analytic in every chart, hence
globally.  For each irreducible component $Z$ of this support, sum all
local projectors whose strict supports are local branches of $Z$.
These sums agree by the same zero-morphism argument and glue to a
global projector whose image has strict support $Z$; the
middle-extension property is local.  Local finiteness and compactness
make the number of these summands finite.

Finally $f$ is an isomorphism over a dense open of its target.  On
that open $K_f$ is $\Q[4]$ in perverse degree zero.  The only
full-support term is consequently the middle extension of this
constant local system, namely $\IC_B$, in degree zero.  This proves
the lemma.
\end{proof}

For each of $g$ and $pg$, choose a splitting as in
Lemma~\ref{lem:branch-analytic-decomposition}.  For $g$, choose the
identification of the full-support summand so that its inclusion and
projection are the identity over $Y_{\mathrm{reg}}$.

\begin{lemma}[Purity on the resolved inverse image]
\label{lem:branch-resolved-purity}
The restriction map
\[
 H^5(\widetilde Y)\longrightarrow H^5(\widetilde P)
\]
is surjective.  The mixed Hodge structure on the projective variety
$\widetilde P$ is pure of weight $5$ in this degree.
\end{lemma}

\begin{proof}
Apply Lemma~\ref{lem:branch-analytic-decomposition} to $f=pg$.
Besides $\IC_X$, write a strict-support summand as
$\mathcal K_{Z,i}[-i]$, where $\mathcal K_{Z,i}$ is perverse with
proper irreducible support $Z\subset X$ of dimension $z$.  Over a
general point $x$ of $Z$, the fiber of $f$ has dimension at most $3-z$:
$f^{-1}(Z)$ is a proper analytic subset of the irreducible fourfold
$\widetilde Y$ and therefore has dimension at most three.  Proper base
change and the topological dimension of a compact analytic fiber give
\[
 \mathcal H^k(K_f)_x=H^{k+4}(f^{-1}(x))=0
               \quad\text{if }k>2(3-z)-4.
\]
The generic nonzero stalk of $\mathcal K_{Z,i}[-i]$ is in degree
$i-z$, because a perverse middle extension on $Z$ has its generic
local system in degree $-z$.  It is a direct summand of this stalk,
so
\begin{equation}\label{eq:branch-support-shift}
 i-z\leq2(3-z)-4,\qquad\text{or equivalently}\qquad i+z\leq2.
\end{equation}

We now restrict the decomposition to $C$.  Suppose first that
$Z\not\subset C$, and stratify $Z\cap C$ compatibly with
$\mathcal K_{Z,i}$.  A stratum $S$ has dimension $s\leq z-1$ and
$s\leq1$.  Its stalk degrees for $\mathcal K_{Z,i}$ are at most
$-s-1$ by \eqref{eq:branch-ic-stalk-bound}.  This remains valid under
the refinement by $C$: a stratum cut out of an old boundary stratum
inherits the stronger bound from that stratum, while a stratum cut
out of the local-system open has only degree $-z\leq-s-1$.
Compactly supported cohomology on the smooth complex $s$-fold $S$
vanishes above degree $2s$.  Thus its contribution to the
hypercohomology of $\mathcal K_{Z,i}[-i]|_C$ vanishes in degrees
greater than
\[
 i-s-1+2s=i+s-1\leq i+z-2\leq0.
\]
Filtering $C$ by its finitely many strata proves that this summand
has no degree-one hypercohomology on $C$.  The full-support summand
$\IC_X$ has the same property: for each stratum of $C$, the upper
bound is $-s-1+2s=s-1\leq0$; on the smooth open its only stalk degree
is $-4$, which is smaller still.

Only summands with $Z\subset C$ can therefore contribute in degree
one.  Such a complex is supported on the closed subset $C$, so its
restriction induces an isomorphism on hypercohomology from $X$ to
$C$.  The chosen global splitting and proper base change now show that
\[
 \mathbb H^1(X,K_f)=H^5(\widetilde Y)
   \longrightarrow
 \mathbb H^1(C,K_f|_C)=H^5(\widetilde P)
\]
is surjective.

It remains to justify what this surjection says about weights.
Compact K\"ahler Hodge theory gives $H^5(\widetilde Y,\Q)$ its pure
Hodge structure of weight $5$.  On the projective $\widetilde P$,
Deligne's mixed Hodge structure has weights at most $5$
\cite[Theorem~8.2.4(iii)]{DeligneHodgeIII}.  We verify directly that
the restriction map preserves its Hodge filtration, because the
ambient $\widetilde Y$ may be nonprojective.

Choose a proper smooth projective hyperresolution
$\epsilon_\bullet\colon Z_\bullet\to\widetilde P$.  Deligne's
construction computes the Hodge filtration on $H^5(\widetilde P)$
from the total simplicial de Rham complex of the $Z_n$, filtered by
holomorphic form degree
\cite[Section~8.1, (8.2.1), and Proposition~8.2.2]{DeligneHodgeIII}.
The terms can be chosen projective because $\widetilde P$ is projective
and the construction can use projective resolutions and modifications.
We may use smooth forms in this complex, with the same filtration:
the Dolbeault resolutions give filtered quasi-isomorphisms from the
holomorphic de Rham complexes on the smooth $Z_n$.
A class in $F^aH^5(\widetilde Y,\C)$ has a closed smooth representative
$\eta$ whose components have holomorphic degree at least $a$, by the
K\"ahler Hodge decomposition.  Pullback along the holomorphic map
$Z_0\to\widetilde P\hookrightarrow\widetilde Y$ preserves these
bidegrees.  Put that pullback in simplicial degree zero of the total
complex.  Its de Rham differential vanishes, and its simplicial
differential is zero because the two face pullbacks to $Z_1$ have the
same composite with the augmentation.  It is therefore a cocycle in
the filtered total de Rham complex.  It represents the ordinary
topological restriction by de Rham
naturality and cohomological descent.  Thus restriction preserves
$F^a$ for every $a$.

The restriction is rational on underlying cohomology.  It also
preserves $W$: the source is pure of weight $5$, and $W_5$ is all of
the target.  It is consequently a morphism of mixed Hodge structures.
Strictness for $W$ \cite[Theorem~2.3.5(iii)]{DeligneHodgeII}, applied
to the surjection just proved, yields
\[
 W_4H^5(\widetilde P)
     =\im\bigl[W_4H^5(\widetilde Y)\to H^5(\widetilde P)\bigr]=0.
\]
Together with the upper weight bound, this proves purity of weight
$5$.  Strictness here concerns mixed Hodge structures themselves and
does not require a rational polarization on the compact K\"ahler
source.
\end{proof}

\subsection{The contribution of singular curves}

Let $j\colon Y_{\mathrm{reg}}\hookrightarrow Y$ be the inclusion.
Ordinary terminal singularities are smooth in codimension two, so
$\Sing Y$ is a finite union of irreducible curves and points.  Analytic
constructibility and a compatible Whitney stratification let us
remove a finite set of points from each singular curve $T$ so that
the remaining connected smooth curve $T^\circ$ carries the local
systems
\begin{equation}\label{eq:branch-local-systems}
 \mathcal V_T=(R^2j_*\Q_{Y_{\mathrm{reg}}})|_{T^\circ},\qquad
 \mathcal W_T=(R^2g_*\Q_{\widetilde Y})|_{T^\circ},\qquad
 b_T=\dim H_c^2(T^\circ,\mathcal V_T).
\end{equation}
Here $\mathcal V_T$ records degree-two cohomology of punctured
neighborhoods, while $\mathcal W_T$ records that of the fixed
resolution fibers and will provide geometric representatives.
We use one finite puncture set on each $T$ for all the following
requirements.  All cohomology sheaves of $Rj_*\Q$ and $Rg_*\Q$ are
locally constant on $T^\circ$, and the fibers of $g$ there have
dimension at most two.  For the latter assertion,
$g^{-1}(T)$ has dimension at most three, so the general fiber has
dimension at most two; remove its exceptional dimension-jump points.
We also remove intersections of singular curves and the finitely
many points of $T\cap Q$ when $T$ is not contained in $Q$.

For later use we impose one further condition on this same finite
puncture set.  Let $E$ be a prime component of $\Exc(g)$ dominating
$T$.  It is smooth because the exceptional divisor has simple normal
crossings.  Its proper map to $T$ has a Stein factorization
\[
 E\longrightarrow\widehat T_E\longrightarrow T,
\]
where the first map has connected fibers and the second is finite.
The intermediate curve is normal and irreducible because $E$ is
normal and irreducible.  Remove from $T$ the branch values of the
finite map and the critical values of the first map, together with
the already excluded singular points.  Properness and generic
smoothness make these sets finite.  Over $T^\circ$ the second map
is then a finite unramified cover; it stays connected because deleting
finitely many points from the irreducible normal curve
$\widehat T_E$ leaves it connected.  The first map is a smooth proper
family with connected fibers.  There are only finitely many
such $E$, so these conditions can be imposed simultaneously.  They
will let us recognize global divisors after restricting to a smaller
curve domain.

The number $b_T$ is unaffected by any further finite puncturing.
Indeed, for $t\in T^\circ$, Poincar\'e duality on the oriented real
surface $T^\circ$ gives
\[
 H_c^2(T^\circ,\mathcal V_T)
 \simeq H^0(T^\circ,\mathcal V_T^\vee)^\vee
 \simeq \bigl((\mathcal V_T)_t\bigr)_{\pi_1(T^\circ,t)},
\]
where the last term is the coinvariant space for monodromy.  A loop
can be perturbed away from finitely many additional points, so the
fundamental group of the further punctured curve surjects onto
$\pi_1(T^\circ,t)$.  The restricted local system has the same
monodromy image, and hence the same coinvariant dimension.

\begin{lemma}[The weight-four contribution]\label{lem:branch-cone}
With the choices in \eqref{eq:branch-local-systems},
\begin{equation}\label{eq:branch-cone-bound}
 \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]
 \leq
 \sum_{\substack{T\text{ irreducible curve}\\T\subset\Sing Y\cap Q}} b_T.
\end{equation}
\end{lemma}

\begin{proof}
Use the full-support projection in the chosen decomposition for $g$
to form the morphism
\[
 \alpha\colon\Q_Y[4]\longrightarrow Rg_*\Q_{\widetilde Y}[4]
                                      \longrightarrow\IC_Y.
\]
The first arrow is the natural pullback map.  Both arrows restrict
to the identity on $Y_{\mathrm{reg}}$.  Let $\mathcal L$ be the cone
of $\alpha$, so that
\begin{equation}\label{eq:branch-comparison-triangle}
 \Q_Y[4]\xrightarrow{\alpha}\IC_Y\longrightarrow\mathcal L
                                      \longrightarrow\Q_Y[5].
\end{equation}
It is supported on $\Sing Y$.
Enlarge the finite puncture sets, if necessary, so that the cohomology
sheaves of $\mathcal L$ are local systems on each $T^\circ$.  Analytic
constructibility permits this enlargement, and the preceding
coinvariant description shows that it does not change $b_T$.

By proper base change, the map induced by $\alpha$ on $P$ factors as
\[
 H^5(P)\longrightarrow H^5(\widetilde P)
           \longrightarrow\mathbb H^1(P,\IC_Y|_P).
\]
The first arrow comes from a holomorphic morphism between the
projective spaces $\widetilde P$ and $P$, and is algebraic by GAGA.
It therefore preserves weights.  Lemma~\ref{lem:branch-resolved-purity}
shows that it kills $W_4H^5(P)$.  Hence the displayed composite kills
that subspace as well; we need no weight statement about the chosen
perverse projection.  The long exact sequence of
\eqref{eq:branch-comparison-triangle} on $P$ gives
\[
 W_4H^5(P)\subset
 \im\bigl[\mathbb H^0(P,\mathcal L|_P)\longrightarrow H^5(P)\bigr].
\]
Restricting the triangle from $P$ to $Q$ shows that the image of this
subspace in $H^5(Q)$ is contained in the image of
$\mathbb H^0(Q,\mathcal L|_Q)$.  Passing to a weight-graded quotient
can only lower rank, and therefore
\begin{equation}\label{eq:branch-cone-rank}
 \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]
        \leq\dim\mathbb H^0(Q,\mathcal L|_Q).
\end{equation}

We estimate the last group by its strata.  On a stratum of $\Sing Y$
of dimension $s\in\{0,1\}$, the bound
\eqref{eq:branch-ic-stalk-bound} and the triangle give
\begin{equation}\label{eq:branch-cone-stalk-bound}
 \mathcal H^q(\mathcal L)|_S=0\qquad(q>-s-1).
\end{equation}
The constant complex in the triangle has its only stalk cohomology
in degree $-4$; its shifted contribution to the cone is in degree
$-5$, so it cannot alter this upper bound.  On a curve $T^\circ$,
the same triangle identifies $\mathcal H^{-2}(\mathcal L)$ with
$\mathcal H^{-2}(\IC_Y)$.  The curve stratum has complex codimension
three in $Y$.  In the middle-extension construction, attaching a
codimension-$c$ stratum retains the unshifted cohomology of $Rj_*\Q$
through degree $c-1$.  For $c=3$ this gives
\begin{equation}\label{eq:branch-cone-link}
 \mathcal H^{-2}(\mathcal L)|_{T^\circ}
   =\mathcal H^{-2}(\IC_Y)|_{T^\circ}
   =(R^2j_*\Q)|_{T^\circ}=\mathcal V_T.
\end{equation}
This is the attaching truncation of
\cite[Section~3.1 and Section~3.3, Axiom {\rm[AX1]}(d)]{GoreskyMacPhersonIHII},
with the shift by four from our perverse normalization.

The restriction $\mathcal L|_Q$ is supported on the closed set
$\Sing Y\cap Q$, so its hypercohomology may be computed on that set.
The complement there of the disjoint opens $T^\circ$
for the curves contained in $Q$ is finite.  A point stratum contributes
nothing to degree-zero hypercohomology by
\eqref{eq:branch-cone-stalk-bound}.  The open--closed cohomology
sequence therefore gives a surjection
\[
 \bigoplus_{T\subset\Sing Y\cap Q}
       \mathbb H_c^0(T^\circ,\mathcal L|_{T^\circ})
       \longrightarrow\mathbb H^0(Q,\mathcal L|_Q).
\]
On a curve, compactly supported cohomology of a local system vanishes
above degree two.  In the spectral sequence
\[
 H_c^a(T^\circ,\mathcal H^b(\mathcal L)|_{T^\circ})
       \ \Longrightarrow\ 
 \mathbb H_c^{a+b}(T^\circ,\mathcal L|_{T^\circ}),
\]
the stalk bound gives $b\leq-2$.  The only term in total degree zero
is consequently $a=2$, $b=-2$, whose dimension is $b_T$ by
\eqref{eq:branch-cone-link}.  The dimension of each degree-zero
abutment is at most $b_T$.  This bound and
\eqref{eq:branch-cone-rank} prove \eqref{eq:branch-cone-bound}.
\end{proof}

Combining Lemmas~\ref{lem:branch-normalization} and
\ref{lem:branch-cone} gives the topological reduction of the theorem:
\begin{equation}\label{eq:branch-topological-bound}
 \begin{aligned}
 \beta(Q)-\sum_jc_2(Q_j^\nu)
 &\leq \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]\\
 &\leq
 \sum_{\substack{T\text{ irreducible curve}\\T\subset\Sing Y\cap Q}} b_T.
 \end{aligned}
\end{equation}
There are finitely many curves in this sum, and the local systems have
finite rank on curves of finite topological type, so its terms are
finite.  It remains to prove that this sum is at most $\tau_Y(Q)$ and
that $\tau_Y(Q)$ is finite.

We finish the topological part by relating the punctured cohomology
in $\mathcal V_T$ to the cohomology of the fixed resolution.  This
identifies the classes that the subsequent geometric construction
will realize.

\begin{lemma}[Resolution cohomology and punctured cohomology]
\label{lem:link-quotient}
For every singular curve $T$ with the choices in
\eqref{eq:branch-local-systems}, restriction from the resolution to
the regular locus induces a surjection of local systems
\begin{equation}\label{eq:branch-link-quotient}
 \mathcal W_T\twoheadrightarrow\mathcal V_T.
\end{equation}
For every $t\in T^\circ$, its map on fibers is equivariant for the
action of $\pi_1(T^\circ,t)$ and is the map induced by restriction
\begin{equation}\label{eq:branch-link-stalk-map}
 \begin{aligned}
 (\mathcal W_T)_t
 &\simeq H^2(g^{-1}(t))
  \simeq\varinjlim_{U\ni t}H^2(g^{-1}U)\\
 &\longrightarrow\varinjlim_{U\ni t}H^2(U\cap Y_{\mathrm{reg}})
  \simeq(\mathcal V_T)_t,
 \end{aligned}
\end{equation}
where $U$ runs through sufficiently small open neighborhoods of $t$
in $Y$ and $g^{-1}(U\cap Y_{\mathrm{reg}})$ is identified with
$U\cap Y_{\mathrm{reg}}$.
\end{lemma}

\begin{proof}
The isomorphism of $g$ over the regular locus and adjunction give a
natural morphism
\[
 \rho\colon Rg_*\Q_{\widetilde Y}[4]
                     \longrightarrow Rj_*\Q_{Y_{\mathrm{reg}}}[4].
\]
By the definition of a higher direct-image stalk and proper base
change for $g$, its degree-$-2$ map at $t$ is precisely
\eqref{eq:branch-link-stalk-map}.  These are the usual sheaf
cohomology groups of constant sheaves, equal to singular cohomology
on the locally contractible analytic spaces in question.

Let $\kappa\colon\IC_Y\to Rg_*\Q_{\widetilde Y}[4]$ be the
full-support inclusion in the chosen decomposition.  Its restriction
to $Y_{\mathrm{reg}}$ is the identity.  The composite
$\rho\kappa\colon\IC_Y\to Rj_*\Q[4]$ is therefore the canonical
comparison morphism: by adjunction a morphism to $Rj_*\Q[4]$ is
determined by its restriction to $Y_{\mathrm{reg}}$.  The
codimension-three attaching construction used in
\eqref{eq:branch-cone-link} says that this comparison is an
isomorphism on ordinary stalk cohomology in degree $-2$ along
$T^\circ$.  Its degree-$-2$ map factors through
\[
 \mathcal H^{-2}(Rg_*\Q[4])|_{T^\circ}=\mathcal W_T.
\]
Thus the degree-$-2$ map induced by $\rho$, namely
\eqref{eq:branch-link-quotient}, is surjective.  It is a morphism of
the local systems in \eqref{eq:branch-local-systems}, which gives
the asserted monodromy equivariance.
\end{proof}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/05-branch-topology.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/06-curve-places.tex ====
\subsection{Curve contributions and global places}
\label{subsec:curve-places}

It remains to bound the contribution \(b_T\) of each singular curve by
global divisors.  We realize the relevant cohomology classes by line
bundles near a compact subset carrying all loops of \(T^\circ\).  Degrees
on the fibers of a small \(\Q\)-factorialization then produce exceptional
surfaces.  Retaining those loops will ensure that their blowup places
remain distinct on the fixed global resolution.

\begin{proposition}[Global places over a singular curve]\label{prop:curve-places}
For every irreducible curve component \(T\) of \(\Sing Y\), with \(b_T\)
as in \eqref{eq:branch-local-systems} and the fixed resolution
\(g:\widetilde Y\to Y\),
\[
 b_T\ \le\
 \#\left\{
 \begin{array}{c}
 E\text{ a prime component of }\Exc(g):\\
 g(E)=T,\quad a(E;Y,0)=2
 \end{array}
 \right\}.
\]
In particular, the divisors counted here represent distinct global
divisorial places.
\end{proposition}

\begin{proof}
Fix \(T\), and write
\[
 q_T:\mathcal W_T\longrightarrow\mathcal V_T
\]
for the natural quotient of Lemma~\ref{lem:link-quotient}.  If \(b_T=0\)
there is nothing to prove, so assume \(b_T>0\).  We may remove finitely
many further points of \(T^\circ\) whenever needed.  The local systems
already defined restrict to the smaller curve, and the induced map on
fundamental groups is surjective.  Thus their monodromy images and the
coinvariant dimension \(b_T\) do not change.

We first construct sections
\[
 \sigma_1,\ldots,\sigma_{b_T}\in H^0(T^\circ,\mathcal W_T)
\]
whose images under \(q_T\) are linearly independent in every fiber of
\(\mathcal V_T\), after the permitted further finite puncturing.

\emph{Step 1. Invariant lifts from finite monodromy.}
First we show that \(\mathcal W_T\), and therefore its quotient
\(\mathcal V_T\), has finite monodromy.  Let
\(\mathcal F=\widetilde Y\times_Y T\), with its full complex-space
structure.  It is projective over the compact projective curve \(T\).
A relative embedding and GAGA identify this morphism with an algebraic
projective family, including its possibly nonreduced scheme fibers.
After deleting finitely many points we may assume that
\(\mathcal F\to T^\circ\) is flat and that all
\((R^kg_*\Q)|_{T^\circ}\) are local systems.

For \(t\in T^\circ\), put \(F_t=\mathcal F_t\).  Every integral class in
\(H^2(F_t,\Z)\) lifts, by proper base change, to
\(H^2(g^{-1}U_t,\Z)\) for a sufficiently small Stein neighborhood
\(U_t\) of \(t\) in \(Y\).  Terminal singularities are rational
\cite[Remark~3.8 and Theorem~3.12]{FujinoAnalyticMMP}.  Hence
\(g_*\mathcal O_{\widetilde Y}=\mathcal O_Y\) and
\(R^kg_*\mathcal O_{\widetilde Y}=0\) for \(k>0\); Leray and Cartan's
Theorem~B give
\[
 H^2(g^{-1}U_t,\mathcal O_{\widetilde Y})=0.
\]
The exponential sequence therefore realizes the lifted integral class
as the first Chern class of a holomorphic line bundle on \(g^{-1}U_t\).
Its restriction to the projective scheme \(F_t\) is algebraic by the
scheme form of GAGA
\cite[Corollary~4.3 and Theorem~4.4]{RaynaudSGA1XII}.  In particular,
\begin{equation}\label{eq:curve-fiber-chern}
 \Pic(F_t)\otimes_{\Z}\Q
 \xrightarrow{\ c_1\ } H^2(F_t,\Q)=(\mathcal W_T)_t
 \quad\text{is surjective}.
\end{equation}
Here and below the cohomology of a scheme fiber means that of its
analytic topological space; nilpotents do not change it.

We use the parameter argument of
\cite[Section~6.1, proof of Lemma~6.4]{ProjectiveLCFourfolds} to show
that a spanning set of fiber classes has finite monodromy orbits.  Fix a
relatively very ample \(\mathcal O_{\mathcal F}(1)\).  Every line bundle on a
fiber is a quotient of some
\(\mathcal O_{F_t}(-n)^{\oplus r}\).  Letting \(n,r\), and the Hilbert
polynomial vary gives countably many relative Quot schemes of finite
type over \(T^\circ\)
\cite[Theorems~3.1--3.2]{GrothendieckHilbert1961}.  In each take the
open set on which the universal quotient is invertible on the whole
pulled-back family.  These open sets still contain a point representing
every fiber line bundle.  Indeed the family and universal quotient are
flat over the Quot scheme, so the local criterion for flatness makes a
fiberwise locally free quotient of rank one locally free near that
fiber; properness removes the image of the complementary closed locus.

There are countably many irreducible components of these parameter
spaces.  Choose \(t\) outside the closures of the images of all
components which do not dominate \(T^\circ\).  Such a point exists,
since each of those closures is a finite set and a complex curve is
uncountable.  Put \(\Gamma=\pi_1(T^\circ,t)\).  By
\eqref{eq:curve-fiber-chern}, choose finitely many
line bundles on \(F_t\) whose Chern classes span
\((\mathcal W_T)_t\).  Each is represented on a dominating
reduced irreducible parameter component \(H\).  The Chern class of the
universal bundle gives a section of the pullback of \(\mathcal W_T\)
to \(H^{\mathrm{an}}\): restrict its class on the total family to
fibers and use proper base change.

Choose a closed point of the generic fiber of \(H\to T^\circ\).
Its residue field is a finite extension of the function field of
\(T\).  Spreading this point, normalizing its closure, and deleting
finitely many base points gives a connected finite \'etale cover of a
dense open of \(T^\circ\), together with a morphism from that cover
to \(H\).  The analytification of an
irreducible complex algebraic variety is path connected.  A path in
\(H^{\mathrm{an}}\) from the original parameter point to a point of
this cover identifies the transported Chern class with the class
there.  The subgroup fixing that sheet has finite index and fixes
this class.  The inclusion of the further punctured curve, with the
projected path for change of basepoint, still surjects on \(\Gamma\).
The image of the finite-index sheet stabilizer is therefore finite
index in \(\Gamma\) and fixes the original class.  Thus each of our
spanning classes has a finite orbit under \(\Gamma\).  The intersection
of their stabilizers has finite index and acts trivially on
\((\mathcal W_T)_t\).  The monodromy group \(G\) of \(\mathcal W_T\)
is therefore finite, as is that of \(\mathcal V_T\).

Poincar\'e duality with local coefficients on the oriented curve gives
\[
 b_T=\dim(\mathcal V_T)_t{}_{\Gamma}.
\]
For a representation of the finite group \(G\) over \(\Q\), averaging
identifies coinvariants with invariants and makes invariants an exact
functor.  The quotient \(q_T\) therefore supplies the asserted sections
\(\sigma_i\) with independent images.

\emph{Step 2. Line bundles near a compact curve core.}
Take \(T^\circ\) noncompact, removing one more point if needed.
Recall the fixed choice made after \eqref{eq:branch-local-systems}:
for every prime component \(E\) of \(\Exc(g)\) dominating \(T\),
its Stein factor restricts to
\begin{equation}\label{eq:global-divisor-family}
 E|_{T^\circ}\longrightarrow \widehat T_E^\circ\longrightarrow T^\circ,
\end{equation}
where the first map is a smooth proper family with connected fibers
and the second is a connected finite \'etale cover.  Further finite
puncturing preserves these properties.  Choose an ambient open
\(Y^\circ\subset Y\) in which \(T^\circ\) is closed: remove the
discarded points of \(T\), the other singular components, and their
intersection points.  These choices will be used when we identify the
local divisors globally.

Let \(h:g^{-1}T^\circ\to T^\circ\) be the restricted resolution.
The curve \(T^\circ\) has the homotopy type of a finite graph, so
cohomology of its local systems vanishes in degrees at least two.
The Leray spectral sequence for \(h\) consequently makes the edge map
\[
 H^2(g^{-1}T^\circ,\Q)
 \longrightarrow H^0(T^\circ,\mathcal W_T)
\]
surjective.  Choose lifts of the \(\sigma_i\).  The algebraic space
\(g^{-1}T^\circ\) has finite triangulation type; after multiplying
each lift by a positive integer, it comes from a class
\(\alpha_i\in H^2(g^{-1}T^\circ,\Z)\).  Replace \(\sigma_i\) by the
same multiple.  Their images are still independent.

To extend the \(\alpha_i\) simultaneously while retaining every loop
of \(T^\circ\), choose a compact curve core as follows.  In the smooth
compactification of \(T^\circ\), remove small open
coordinate discs about its punctures, with disjoint closures, and denote the complement by
\(K_*\).  This is a connected compact semianalytic subset of
\(T^\circ\).  The inclusion of its interior into \(T^\circ\) induces
a surjection on fundamental groups.  The core \(K_*\) is also Runge: every component of
\(T^\circ\setminus K_*\) runs to a missing puncture and is therefore
not relatively compact.  The compact set \(g^{-1}K_*\) is
semianalytic.  Continuity of cohomology on neighborhoods of this
compact set extends the restrictions of the finitely many
\(\alpha_i\) to integral classes on one open neighborhood
\(\widetilde U_0\) of \(g^{-1}K_*\) in \(\widetilde Y\).
One may use \v{C}ech cohomology for this continuity statement;
semianalytic triangulation and local contractibility identify it with
singular cohomology here.  Properness of \(g\) makes
\[
 U_0=Y\setminus g(\widetilde Y\setminus\widetilde U_0)
\]
an open neighborhood of \(K_*\) with \(g^{-1}U_0\subset\widetilde U_0\).

The closed curve \(T^\circ\subset Y^\circ\) is Stein.  Siu's
Stein-neighborhood theorem, in the form
\cite[Theorem~2.1]{ForstnericStein} with empty compact set, gives a
Stein neighborhood \(\Omega\) of this curve in \(Y^\circ\).
The Runge property makes \(K_*\) holomorphically convex in
\(T^\circ\), hence also in \(\Omega\) by the paragraph preceding
that theorem.  The usual holomorphic-polyhedron construction for a
convex compact in a Stein space gives a Stein neighborhood
\[
 K_*\subset U\Subset\Omega\cap U_0.
\]
Take its connected component containing \(K_*\).  It is normal,
being open in \(Y\), and therefore irreducible.  For the local
\(\Q\)-factorialization, Fujino's compact construction
\cite[Section~1.11]{FujinoAnalyticMMP} supplies an ambient semianalytic
Stein compact \(K'\Subset U\), with
\(K_*\subset\operatorname{int}_U(K')\), such that
\[
 K'\cap Z\ \text{has finitely many connected components}
\]
for every analytic subset \(Z\) defined on a neighborhood of
\(K'\).  This is the compact condition (P4) in Fujino's condition
(P); normality of the source and Steinness of the base supply its
other ambient conditions.

The classes just extended to \(g^{-1}U\) are Chern classes of line
bundles \(L_1,\ldots,L_{b_T}\) there, by the same rational-singularity,
Cartan, and exponential-sequence argument used above.  For every
\(t\) in the interior of \(K_*\), their fiber classes are the
\(\sigma_i(t)\); hence their images under \(q_T\) remain independent.
We also need divisor representatives before making any further
modification.  The sheaf \(g_*L_i\) is coherent and has rank one on
the regular open of \(U\).  Cartan's Theorem~A supplies a global
section nonzero at a point of that open.  Its pullback is a nonzero
section of \(L_i\), whose zero divisor is a Cartier divisor \(A_i\)
on \(g^{-1}U\) representing \(L_i\).

\emph{Step 3. Fiber degrees and surface families.}
We will obtain at least \(b_T\) surface families by proving that the
\(b_T\) line bundles constructed below have linearly independent vectors
of fiber degrees.
Apply Fujino's small \(\Q\)-factorialization theorem
\cite[Theorem~1.24]{FujinoAnalyticMMP} to the ordinary pair
\((U,0)\), the identity \(U\to U\), and the full compact \(K'\).
The identity is projective, \(U\) is terminal and therefore klt,
and \(K_U\) is \(\Q\)-Cartier.  The preceding construction supplies
condition (P).  After restricting the base to a neighborhood of
\(K'\), the theorem gives a projective small bimeromorphic morphism
\[
 \ell:Y'\longrightarrow U
\]
with \(Y'\) normal and \(\Q\)-factorial over \(K'\).  We retain the
notation \(U\) after this restriction and restrict \(g,L_i,A_i\)
accordingly.  Compactness and local terminality of \(Y\) give a common
\(m_{\mathrm{can}}>0\) for which \(\omega_Y^{[m_{\mathrm{can}}]}\) is
invertible; its restriction to \(U\) is
\(\omega_U^{[m_{\mathrm{can}}]}\).  Since \(\ell\) is
small, the natural identification on the common codimension-one open
extends by reflexivity to
\[
 \omega_{Y'}^{[m_{\mathrm{can}}]}
 \simeq\ell^*\omega_U^{[m_{\mathrm{can}}]}.
\]
In particular, the left side is invertible and the natural relative
canonical divisor \(K_{Y'/U}\) is zero.  This is canonical crepancy,
expressed using compatible local canonical generators as
\(K_{Y'}=\ell^*K_U\).  A place exceptional over \(Y'\) is exceptional
over \(U\), because \(\ell\) is small.  Crepancy therefore preserves
the terminal discrepancy inequalities, so \(Y'\) is terminal.  Moreover \(\ell\)
is an isomorphism over \(U_{\mathrm{reg}}\).  Indeed, for a relatively
ample line bundle \(\mathcal A\) on \(Y'\), the rank-one reflexive
sheaf \((\ell_*\mathcal A)^{**}\) is locally invertible on the smooth
base.  Its pullback agrees with \(\mathcal A\) off codimension two
and hence everywhere there, by reflexivity on the normal source.
A positive-dimensional fiber over a smooth point would then have
degree zero against \(\mathcal A\), contradicting relative ampleness.

Push \(A_i\) forward to a Weil divisor on \(U\), and let \(D_i'\) be
its strict transform on \(Y'\).  These are actual locally finite
analytic divisors defined on all of the current \(Y'\).  We apply
\(\Q\)-factoriality precisely in the sense of
\cite[Definition~2.38]{FujinoAnalyticMMP}: every prime divisor
defined on a neighborhood of the whole set \(\ell^{-1}(K')\)
is \(\Q\)-Cartier at each point of that set.  Properness makes
\(\ell^{-1}(K')\) compact, and local finiteness leaves only finitely
many prime components of the \(D_i'\) near it.  A finite cover of
this full compact and a common multiple therefore give an integer
\(m_{\mathrm{div}}>0\) and an open neighborhood of \(\ell^{-1}(K')\)
on which every \(m_{\mathrm{div}}D_i'\) is Cartier.  By properness,
choose an open set \(U_1\) with \(K'\subset U_1\subset U\) whose full
inverse image is contained in that neighborhood, and put
\[
 \mathcal N_i=\mathcal O_{Y'}(m_{\mathrm{div}}D_i')|_{\ell^{-1}U_1}.
\]
This completes the use of \(\Q\)-factoriality on the specified full
compact; all later restrictions use these fixed line bundles.
In particular, the change-of-compact issue in
\cite[Remark~2.39]{FujinoAnalyticMMP} does not arise.  On the
regular open, where both \(g\) and \(\ell\) are isomorphisms,
\begin{equation}\label{eq:curve-regular-bundles}
 \mathcal N_i|_{U_{1,\mathrm{reg}}}
 \simeq L_i^{\otimes m_{\mathrm{div}}}|_{U_{1,\mathrm{reg}}}.
\end{equation}

Choose connected curve domains
\[
 B_0\Subset B_1\Subset\operatorname{int}_{T^\circ}(K_*)
\]
such that \(\pi_1(B_0)\to\pi_1(T^\circ)\) is surjective; nested
smaller cores obtained by enlarging the omitted discs have this
property.  The larger domain lets us control finitely many components
near \(\overline B_0\) and make their discrete exceptional sets finite
on that compact.  Work in the ambient open of \(U_1\) obtained by removing
\(T^\circ\setminus B_1\), so that \(B_1\) is closed there.
The inverse image of \(B_1\) is proper over \(B_1\).
Local finiteness of its analytic components, compactness of
\(\ell^{-1}(\overline B_0)\), and properness allow us first to
replace \(B_1\) by a neighborhood of \(\overline B_0\) on whose
inverse image only finitely many components occur.

We claim that deleting finitely many points from \(B_0\) gives a
connected curve domain \(B\) with
\(\pi_1(B)\to\pi_1(T^\circ)\) surjective and the following fiber
description.  All fibers of \(\ell\) over \(B\) have dimension at
most one.  The finitely many irreducible surface components
\(S_1,\ldots,S_s\) of the reduced inverse image of \(B\), counted
after this restriction, all dominate \(B\).  Their normalizations
factor as
\[
 \widehat S_\alpha\xrightarrow{\,h_\alpha\,}C_\alpha
 \longrightarrow B \qquad (1\le\alpha\le s),
\]
where \(C_\alpha\to B\) is a connected finite \'etale cover and
\(h_\alpha\) is a smooth proper family of connected curves.  A cover
that splits on restriction contributes separate components to this
list.  For each fixed \(t\in B\), the pairs \((\alpha,c)\) with
\(c\in C_\alpha\) over \(t\) supply distinct irreducible curves and
exhaust the irreducible curves of \(\ell^{-1}(t)\).  Each smooth
connected normalization fiber maps birationally to the curve it
supplies.

We verify this description by spelling out the finite exclusions.
Smallness gives \(\dim\Exc(\ell)\le2\), so a general fiber above
\(B_1\) has dimension at most one.  The locus of larger fibers is a
proper analytic subset of \(B_1\), by the fiber-dimension theorem
for proper maps.  For each surface component of the reduced inverse
image that dominates \(B_1\), take its normalization and then its Stein factor over the
curve.  The normalization is proper and is a normal surface.
Its singularities are isolated.  Away from the branch values of the
finite Stein factor and the critical values of the map from the
normalization, it is a smooth proper family of connected curves
over a finite unramified cover.  The values at which an intersection
of two components, or the nonisomorphism locus of a normalization,
contains a whole fiber curve also form a discrete analytic subset:
these loci have dimension at most one, and their general fibers
over the base are zero-dimensional.  Finally remove the images of
components lying over a point.  Each of these excluded sets is
discrete on the larger curve domain \(B_1\); there are only finitely
many components, so their union meets \(\overline B_0\) in a finite
set.

Delete those finitely many points from \(B_0\) and call the result
\(B\).  It is connected, and
\(\pi_1(B)\to\pi_1(T^\circ)\) is still surjective: loops in \(B_0\)
may be perturbed away from a finite set.  The exclusions give the
asserted fiber description and families.

For each \(\alpha,i\), let
\[
 d_{\alpha i}
 =\deg\bigl(\mathcal N_i|_{h_\alpha^{-1}(c)}\bigr),
 \qquad c\in C_\alpha,
\]
where pullback to \(\widehat S_\alpha\) is understood.  This integer
is independent of \(c\), by constancy of degree in a smooth proper
family over the connected curve \(C_\alpha\).  Because its fiber
maps birationally to the curve it supplies, this is also the degree
of \(\mathcal N_i\) on that fiber curve of \(\ell\).
We claim that the map
\begin{equation}\label{eq:curve-degree-map}
 \Q^{b_T}\longrightarrow\Q^s,\qquad
 (c_i)_i\longmapsto
 \left(\sum_i c_i d_{\alpha i}\right)_\alpha
\end{equation}
is injective.

Suppose its value is zero, and fix \(t\in B\).  Every irreducible
curve in \(F'_t=\ell^{-1}(t)\) then has degree zero against
\(\sum_i c_i c_1(\mathcal N_i)\).  The fiber has dimension at most
one.  Its rational \(H_2\) is spanned by the fundamental classes of
its irreducible curves, also when the fiber is nonreduced, and
\(H^2(F'_t,\Q)\) is the rational dual of \(H_2(F'_t,\Q)\).
The restricted Chern class is therefore zero.  Proper base change
identifies it with the germ in \((R^2\ell_*\Q)_t\).
Restriction through the isomorphism over the regular open gives
the natural map
\[
 (R^2\ell_*\Q)_t\longrightarrow (R^2j_*\Q)_t
     =(\mathcal V_T)_t,
\]
so the corresponding punctured class is zero as well.  By
\eqref{eq:curve-regular-bundles}, the restrictions of
\(\sum_i c_i c_1(\mathcal N_i)\) and
\(m_{\mathrm{div}}\sum_i c_i c_1(L_i)\) agree on their common regular
open.  Taking their germ in \((R^2j_*\Q)_t\) and applying
\eqref{eq:branch-link-stalk-map} to the latter identifies that zero
class with
\[
 m_{\mathrm{div}}\sum_i c_i\,q_T(\sigma_i(t)).
\]
These vectors are independent; hence every \(c_i=0\).  This proves
\eqref{eq:curve-degree-map}, and in particular
\begin{equation}\label{eq:curve-surface-count}
 s\ge b_T.
\end{equation}

\emph{Step 4. Distinct global discrepancy-two divisors.}
Take an ambient open \(U_B\subset U_1\) whose intersection with
\(T^\circ\) is the closed subspace \(B\), obtained as above by
removing \(T^\circ\setminus B\).  Each \(S_\alpha\) is a closed
analytic surface in \(\ell^{-1}U_B\).  Since \(Y'\) is terminal,
it is smooth in codimension two by
\cite[Lemma~2.3]{CanonicalKahler}.  Thus at a general point of
\(S_\alpha\) both the ambient space and the surface are smooth.
Blow up its coherent ideal and normalize.  The unique divisor
dominating that dense smooth part defines a local place \(v_\alpha\)
of ordinary log discrepancy \(2\) over \(Y'\), the value for a
smooth codimension-two blowup.  Canonical crepancy of \(\ell\)
gives
\[
 a(v_\alpha;U_B,0)=2,\qquad
 \cent_{U_B}(v_\alpha)=B.
\]
The \(v_\alpha\) are distinct because their centers on \(Y'\) are
the distinct \(S_\alpha\).

It remains to represent each \(v_\alpha\) by a prime divisor on
\(g^{-1}U_B\) and show that these local divisors arise from distinct
global components of \(\Exc(g)\).

On the fixed global resolution, the relative canonical divisor is
intrinsic even if the canonical bundle has no global divisor
representative.  Using the fixed \(m_{\mathrm{can}}\), divide by
\(m_{\mathrm{can}}\) the divisor of the
natural meromorphic comparison
\(g^*\omega_Y^{[m_{\mathrm{can}}]}\dashrightarrow
\omega_{\widetilde Y}^{\otimes m_{\mathrm{can}}}\), and denote the
result by \(K_{\widetilde Y/Y}\).  It is exceptional; write
\[
 K_{\widetilde Y/Y}=\sum_E\kappa_EE.
\]
The natural canonical comparisons commute with restriction and
composition, so this divisor supplies the relative discrepancy term
on \(U_B\) as well.
Every \(\kappa_E\) is strictly positive by terminality.  The
principalization of the ideal of \(\Sing Y\) says that
\(g^{-1}(\Sing Y)\) is supported on these exceptional divisors.
Put \(\widetilde U_B=g^{-1}U_B\), and consider \(v_\alpha\) on a
common proper model with \(\widetilde U_B\).  If it were exceptional
over this smooth resolution, then \(a(v_\alpha;\widetilde U_B,0)\ge2\).
Its center on the
resolution maps into \(B\subset\Sing Y\), so it is contained in at
least one of the \(E\), with \(\ord_{v_\alpha}(E)>0\).
The discrepancy formula would give
\[
 a(v_\alpha;U_B,0)
 =a(v_\alpha;\widetilde U_B,0)
    +\sum_E\kappa_E\ord_{v_\alpha}(E)>2,
\]
a contradiction.  Thus \(v_\alpha\) is represented by a prime
divisor on \(g^{-1}U_B\).  Since \(U_B\cap T=B\), this local divisor
is an irreducible component of \(E|_B\) for a global exceptional
divisor \(E\) with \(g(E)=T\).

Such a global divisor cannot split into two components over \(B\).
Indeed the connected finite cover \(\widehat T_E^\circ\to T^\circ\) in
\eqref{eq:global-divisor-family} remains connected over \(B\):
the action of \(\pi_1(T^\circ)\) on a fiber is transitive, and
\(\pi_1(B)\) has the same image.  Over this connected cover the
restriction of \(E\) is a smooth proper family with connected
fibers, so its total space is connected and smooth, hence
irreducible.  Therefore the distinct local divisors representing
the \(v_\alpha\) come from distinct global components \(E\) of
\(\Exc(g)\).  Their global centers are \(T\), and their ordinary
log discrepancies are \(2\), since this equality holds on the
open over \(B\).  Together with \eqref{eq:curve-surface-count},
this proves the proposition.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{thm:branch}]
Every global place of ordinary log discrepancy \(2\) whose center
is a singular curve is represented by a component of \(\Exc(g)\).
Indeed the same discrepancy computation in the last part of
Proposition~\ref{prop:curve-places} would otherwise make its
discrepancy strictly greater than \(2\).  There are only finitely
many such components on the compact resolution, so
\(\tau_Y(Q)\) is finite.  Proposition~\ref{prop:curve-places},
summed over the singular curves contained in \(Q\), gives
\[
 \sum_{T\subset\Sing Y\cap Q} b_T\le\tau_Y(Q).
\]
Combining this with \eqref{eq:branch-topological-bound} yields
\[
 \beta(Q)\le \sum_j c_2(Q_j^\nu)+\tau_Y(Q),
\]
as required.
\end{proof}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/06-curve-places.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/07-difficulty.tex ====
\section{The difficulty on the terminal chain}\label{sec:difficulty}

We now construct an integer that is nonnegative at the crepant terminal
junctions and nonincreasing along the moves between them.  The local
subtraction of surface contributions and the correction by cycle ranks on
boundary normalizations adapt the projective construction in
\cite[Definition~4.2, Lemma~4.3, and Section~7]{ProjectiveLCFourfolds}.
We give the required finiteness and comparison arguments in the analytic
setting.

Use the terminal chain of Proposition~\ref{prop:terminal-junctions}, after
the truncation in Proposition~\ref{prop:surface-finiteness}.  Its finite set
of prime labels is denoted by \(\mathcal H\).  On a current model its
boundary is
\[
 \Theta=\sum_{h\in\mathcal H}b_hS_h,\qquad 0\leq b_h<1.
\]
The labels persist by strict transform, including those of coefficient
zero, and the coefficients are nonincreasing.  The fixed coefficients have
already become constant.  Every varying coefficient is positive; at a
junction \(h_i:Y_i\to X_i\), its label is exceptional for \(h_i\) and has
image of dimension at most one.  Each model of the chain is strong and
compact K\"ahler, the generalized pair is terminal, and the underlying
fourfold is ordinarily terminal.

Choose a positive integer \(N\) that clears the fixed label coefficients,
the coefficients of the initial boundary of the particular strong
generalized klt sequence under study, and its fixed nef datum: on the chosen
higher carrier, \(N\M\) is represented by an integral Cartier divisor.
These are finite rational data.  We impose no denominator condition on a
varying coefficient.  For \(u\in\R\), put
\begin{equation}\label{eq:difficulty-weights}
 \omega(u)=\left\lceil N\max\{u,0\}\right\rceil,
 \qquad
 w(E)=\omega\bigl(2-a(E;Y,\Theta+\M)\bigr),
\end{equation}
where \(E\) is a global divisorial place and the current pair is understood
in \(w(E)\).  Thus \(w(E)>0\) exactly when the discrepancy is less than
two; discrepancy equal to two has weight zero.

For a fixed label, \(\omega(b_h)=Nb_h\), so its contribution incurs no
rounding loss in the local estimate below.  The conditions on the initial
boundary and nef carrier will give the lattice at the positive endpoint in
Lemma~\ref{lem:positive-surface}.  The earlier surface lattice has already
served to choose the tail; \(N\) need not clear every element of
\(\mathcal A_{\mathrm{surf}}\).

\subsection{Echoes and finite local corrections}

The recurring places over a generic codimension-two boundary center are
the echoes of \cite[Example~1.4, Lemma~1.5, and Definition~2.3]{AlexeevHaconKawamata2007}.
The full chain matters: \cite[Example~2.1]{Fujino2005Addendum} shows why
removing only the first blowup does not make a boundary difficulty finite.

First consider an irreducible compact analytic surface \(V\subset S_h\)
whose general point lies in a smooth open of \(Y\) where \(S_h\) is smooth,
no other label occurs, and \(\M\) descends.  The following sequence of
global places records the predictable contribution above such a surface.
Blow up the coherent ideal of \(V\) globally and normalize.  The global
exceptional divisor has a unique irreducible component dominating the dense
smooth open of \(V\); call its place \(E_{V,h,1}\).  On this normalized
blowup, its analytic intersection with the strict transform of \(S_h\)
has a unique irreducible component dominating that same open of \(V\).
Blow up the coherent ideal of this global component, normalize, and take
the unique new exceptional prime over that open.  Repeat this operation on
these normalized blowups, denoting the successive places by
\(E_{V,h,j}\), \(j\geq1\).  The models are smooth at the general points
of the indicated intersections, so each next component exists and is
unique there.  When another higher model is needed for comparison, a common
proper model identifies these same global places by strict transform.  We
call them the \emph{echoes} of \(S_h\) above \(V\).

The first exceptional prime has crepant boundary coefficient
\(-(1-b_h)\).  At stage \(j\) this coefficient is \(-j(1-b_h)\): blowing
up its intersection with the strict label adds one more \(-(1-b_h)\).
Consequently
\begin{equation}\label{eq:echo-discrepancy}
 a(E_{V,h,j};Y,\Theta+\M)=1+j(1-b_h).
\end{equation}
The contributing echoes are precisely those with \(j(1-b_h)<1\).  In
particular there are only finitely many contributing indices for each
\(b_h<1\).  Define the \emph{default contribution} of label \(h\) by the finite sum
\begin{equation}\label{eq:echo-default}
 d_h=\sum_{j\geq1}\omega\bigl(1-j(1-b_h)\bigr).
\end{equation}
Here terms outside the finite set just described are zero.  If \(b_h=0\),
then \(d_h=0\).  If \(b_h>0\), its first term gives
\(d_h\geq\omega(b_h)\geq1\).  Each summand is nonincreasing as \(b_h\)
decreases, and no new positive index can appear.  Hence every \(d_h\) is a
nonincreasing nonnegative integer along the chain.  After discarding
finitely many further junctions, all \(d_h\) are constant, including
throughout each intervening finite string of moves.  Indeed each of the
finitely many integers can drop only finitely often, while coefficients
stay unchanged during the small steps.  We henceforth use this truncated
chain and these constant values \(d_h\).

On a fixed model, the generic echo contribution is the only contribution
that can recur over infinitely many surface centers.  We now justify this
claim.  All places in the following proposition are
global divisorial places.

\begin{proposition}[Finiteness below discrepancy two]
\label{prop:difficulty-finite}
Let \((Y,\Theta+\M)\) be a model of the truncated terminal chain.
Among the places exceptional over \(Y\) with discrepancy less than two,
there are only finitely many whose centers have codimension at least three.
For each fixed irreducible compact analytic surface \(V\subset Y\), there
are only finitely many whose center is \(V\).

There is a finite set \(\mathcal V_Y\) of irreducible compact analytic
surfaces with the following additional property.  If
\(V\notin\mathcal V_Y\), its general point lies in a smooth open where
\(\M\) descends and either no label occurs or exactly one smooth label
\(S_h\) occurs.  There are no positive-weight places centered on \(V\)
in the first case or when \(b_h=0\).  When \(b_h>0\), they are exactly the
echoes \(E_{V,h,j}\) with \(j(1-b_h)<1\).
\end{proposition}

\begin{proof}
Take a projective resolution \(\pi:W\to Y\) with \(W\) smooth and carrying \(\M\),
with divisorial exceptional locus, and resolving all labels.  Further
blowups of intersections in the simple normal crossing divisor make the
strict transforms of the labels smooth and pairwise disjoint, while keeping
the full divisor simple normal crossing.  Write
\[
 K_W+\Theta_W+M_W=\pi^*(K_Y+\Theta+M_Y).
\]
Every \(\pi\)-exceptional component of \(\Theta_W\) has coefficient
\(1-a(E;Y,\Theta+\M)<0\), by generalized terminality.  The only possible
positive components of \(\Theta_W\) are therefore the strict transforms
of the positive labels.  On higher models the nef datum pulls back from \(W\), so the
discrepancy calculation is the ordinary one for the signed boundary
\(\Theta_W\).

Consider a place \(E\) that is also exceptional over \(W\), and let its
center on \(W\) have codimension \(c\geq2\).  At a general smooth point
of this center choose normal parameters \(x_1,\ldots,x_c\).  The Jacobian
formula on a smooth model carrying \(E\) gives
\[
 a(E;W,0)\geq\sum_{i=1}^c\ord_E(x_i),
 \qquad \ord_E(x_i)\geq1.
\]
Indeed, in the pullback of a local volume form at most one differential
factor can lose one order along \(E\); adding one to the Jacobian order
gives the displayed bound.  If the center lies in no positive component of
\(\Theta_W\), the signed boundary can only raise this discrepancy, which
is at least two.  Otherwise it lies in a unique positive smooth label of
coefficient \(b<1\).  Taking \(x_1\) as its local equation and discarding
the negative boundary terms gives
\begin{equation}\label{eq:local-discrepancy-estimate}
 a(E;Y,\Theta+\M)
 \geq (1-b)\ord_E(x_1)+\sum_{i=2}^c\ord_E(x_i).
\end{equation}
A discrepancy less than two thus forces \(c=2\) and containment in a
positive label.  A label of coefficient zero cannot give such a place.

If this codimension-two center is contained in \(\Exc(\pi)\), it is a
component of the intersection of its label with one of the finitely many
exceptional divisors.  There are only finitely many such centers.  If it
meets the isomorphism open, its general point maps isomorphically to a
surface downstairs, and the center is the strict transform of that surface.
Thus a center mapping to codimension at least three belongs to the first
finite list, and for any fixed surface downstairs there are only finitely
many possible centers on \(W\).

There are only finitely many places of discrepancy less than two whose
center on \(W\) equals a fixed one of these codimension-two centers.  To see this, discard the negative
components of \(\Theta_W\); this lowers discrepancies, so it suffices to
work with the single smooth label of coefficient \(b\).  Blow up the center
generically.  The new exceptional coefficient is \(-(1-b)\).  A further
place with discrepancy less than two has its center in that exceptional
divisor; the estimate \eqref{eq:local-discrepancy-estimate} also forces a
codimension-two center in the strict label.  It must therefore follow their
intersection above the general point of the original center.  At stage
\(j\) the most recent exceptional coefficient is \(-j(1-b)\), and the
older exceptional divisors do not meet this generic intersection.  A place
above it that is still exceptional has discrepancy at least
\[
 (1-b)+1+j(1-b)=1+(j+1)(1-b).
\]
This reaches two after finitely many stages.  The same argument shows that,
where no other boundary or nef data enter, the places below two are exactly
the echoes in \eqref{eq:echo-discrepancy}.

This generic computation identifies global places.  At each global blowup
there is a unique irreducible component of its exceptional divisor that
dominates the dense smooth part of the center.  The global analytic
intersection of that prime with the strict label then has a unique
irreducible component dominating the same part.  These global components
have coherent ideals, which define the next global blowups.  Conversely,
one can follow any given global place on common higher models through these
blowups; when its center becomes a divisor on a normal model, that divisor
represents the place.  Thus the computation does not count different local
pieces of one place separately.

Finally include the finitely many divisors on \(W\) that are exceptional
over \(Y\).  The complement of the isomorphism open, and the loci where a
label fails to be smooth and alone or the nef datum fails to descend, are
contained in a proper analytic subset of \(Y\) of codimension at least
two.  Such a subset has only finitely many surface components on the compact
fourfold.  Take these components for \(\mathcal V_Y\), enlarging the set
by the finitely many surface images already encountered if necessary.
Outside them the preceding one-label calculation applies, or there is no
positive label and no place of positive weight.  This proves all assertions.
\end{proof}

For an irreducible compact analytic surface \(V\subset Y\), let
\begin{equation}\label{eq:difficulty-branches}
 r_{V,h}=\#\{D:\ D\text{ is a prime divisor of }S_h^\nu
                         \text{ mapping onto }V\}.
\end{equation}
This number is finite, because normalization is finite and the inverse
image of \(V\) has finitely many components on the compact normalization.
It is zero if \(V\not\subset S_h\).  It counts prime divisors on the
normalization, without counting their possible multiple sheets over \(V\)
as separate divisors.

Every place with center a surface, curve, or point on the normal fourfold
is exceptional over it: a place with a divisor as center is represented by
that divisor.  Hence the two raw sums below involve only exceptional
places.  Proposition~\ref{prop:difficulty-finite} makes the local sum
\(\sum_{\cent_Y(E)=V}w(E)\) finite after zero terms are omitted.  Although
this raw sum is finite at each fixed surface, the same nonzero contribution
\(d_h\) can recur at infinitely many surfaces in a label.  We therefore
subtract the branch contributions at each surface before summing over
surfaces.  Define the integer
\begin{equation}\label{eq:difficulty-bracket}
 q_Y(V)=\sum_{\cent_Y(E)=V}w(E)-\sum_{h\in\mathcal H}r_{V,h}d_h.
\end{equation}
Only finitely many \(q_Y(V)\) are nonzero.  Indeed, outside the finite set
in Proposition~\ref{prop:difficulty-finite}, a surface on a positive label
has raw sum \(d_h\), with \(r_{V,h}=1\) and all other branch counts zero.
A surface generically on a sole zero-coefficient label has both raw sum and
default zero, as does a surface away from all labels.  These cases exhaust
the surfaces outside that finite set.

We may therefore define the difficulty by
\begin{equation}\label{eq:difficulty}
 \begin{aligned}
 \mathfrak D(Y,\Theta+\M)
 ={}&\sum_{\codim_Y\cent_Y(E)\geq3}w(E)
   +\sum_{\substack{V\subset Y\\\dim V=2}}q_Y(V)\\
 &+\sum_{h\in\mathcal H}d_hc_2(S_h^\nu),
 \end{aligned}
\end{equation}
where the surface sum is over irreducible compact analytic surfaces.
The first sum has finitely many nonzero terms by
Proposition~\ref{prop:difficulty-finite}; the second has just been shown
to have finite support; and the last is finite because \(\mathcal H\) is
finite and every analytic cycle rank is finite.  Thus \(\mathfrak D\) is
an integer.  The subtraction in \eqref{eq:difficulty-bracket} is performed
at each surface before the second sum is taken.  Both a local bracket and
the difficulty on an intermediate model are at this point allowed to be
negative.

\subsection{The lower bound at the junctions}

The possible negative part of a surface bracket comes only from rounding
the contributions of varying labels.  For a surface \(V\), put
\[
 r_V^{\mathrm{var}}=\sum_{h\text{ varying}}r_{V,h}.
\]
We first prove, on every current terminal model, that
\begin{equation}\label{eq:difficulty-local-bound}
 q_Y(V)\geq-\max\{r_V^{\mathrm{var}}-1,0\}.
\end{equation}

The underlying fourfold is ordinarily terminal by
Lemma~\ref{lem:ordinary-singularities}, hence smooth at general points of
\(V\).  Blow up \(V\) generically to obtain a global exceptional
place \(E_V\).  For each label let \(m_h\) be its multiplicity transverse
to \(V\) at a general point, taking \(m_h=0\) if it does not contain
\(V\).  The ordinary log discrepancy of \(E_V\) is two.  On a common
carrier \(\pi:W\to Y\) carrying this place, the nef defect
\(J=\pi^*M_Y-M_W\) is effective by Lemma~\ref{lem:nef-defect}.  If \(j_V\) is its coefficient at
\(E_V\), the discrepancy formula and generalized terminality give
\begin{equation}\label{eq:difficulty-first-blowup}
 a(E_V;Y,\Theta+\M)=2-\sum_hm_hb_h-j_V>1,
 \qquad j_V\geq0.
\end{equation}
In particular \(\sum_hm_hb_h<1\).

We also have \(r_{V,h}\leq m_h\).  To see this analytically, work at a
general smooth point of \(V\).  Each prime divisor of \(S_h^\nu\) counted
by \(r_{V,h}\) gives at least one point of the finite normalization over
that point of \(V\); the points supplied by distinct prime divisors can be
taken distinct after avoiding their special loci.  They correspond to
distinct local analytic branches of \(S_h\), each containing the germ of
\(V\).  Each branch contributes at least one to the transverse multiplicity
\(m_h\).  A normalization divisor with several sheets may supply more
than one local branch, which preserves the stated inequality.

Let \(t=r_V^{\mathrm{var}}\), and list the numbers \(Nb_h\) for varying
labels, repeating each one \(r_{V,h}\) times, as
\(x_1,\ldots,x_t\).  The fixed contribution
\(k=N\sum_{h\text{ fixed}}r_{V,h}b_h\) is a nonnegative integer.  For
\(t\geq1\), the ceiling inequality gives
\[
 \left\lceil k+\sum_{\ell=1}^t x_\ell\right\rceil
 \geq k+\sum_{\ell=1}^t\lceil x_\ell\rceil-(t-1).
\]
For \(t=0\) the left side is \(k\).  Using effectivity,
\(m_h\geq r_{V,h}\), and \eqref{eq:difficulty-first-blowup}, we obtain in
both cases
\begin{equation}\label{eq:difficulty-first-weight}
 w(E_V)\geq\sum_h r_{V,h}\omega(b_h)
              -\max\{r_V^{\mathrm{var}}-1,0\}.
\end{equation}
No rounding loss is needed for a fixed label because \(Nb_h\) is integral.

It remains to supply the terms of \(d_h\) with \(j\geq2\).  Such a term
is positive only if \(b_h>1/2\); when \(b_h=1/2\), the second echo has
discrepancy exactly two and weight zero.  The strict inequality
\(\sum_hm_hb_h<1\) implies that at most one label through \(V\) has
coefficient greater than \(1/2\), and its multiplicity is one.  This label
is smooth at general points of \(V\) and has \(r_{V,h}=1\).  Use its
successive generic blowups above \(V\).  For each \(j\geq2\) with a
positive default, the resulting global place is distinct from \(E_V\) and
from all the others.  With this label alone its discrepancy is
\(1+j(1-b_h)\).  The other effective boundary components and the effective
nef defect only lower the discrepancy.  Its actual weight is therefore at
least \(\omega(1-j(1-b_h))\).  These places supply every remaining
default.  Adding their weights to \eqref{eq:difficulty-first-weight}
proves \eqref{eq:difficulty-local-bound}, including the cases with no
varying label or with zero coefficients.

\begin{proposition}[Lower bound at crepant junctions]
\label{prop:difficulty-lower}
At every crepant junction \(h_i:(Y_i,\Theta_i+\M)\to(X_i,B_i+\M)\) of
the truncated chain,
\[
 \mathfrak D(Y_i,\Theta_i+\M)\geq0.
\]
\end{proposition}

\begin{proof}
Write \(Y=Y_i\) and let
\(Q=\bigcup_{h\text{ varying}}S_h\) with its reduced structure.  If
\(Q\) is empty, \eqref{eq:difficulty-local-bound} makes every surface
bracket nonnegative, and the other terms of \eqref{eq:difficulty} are
nonnegative.  Suppose \(Q\ne\varnothing\).  At this junction the map
\(h_i\) is projective bimeromorphic from an ordinarily terminal compact
K\"ahler fourfold, and \(\dim h_i(Q)\leq1\) by
Proposition~\ref{prop:surface-finiteness}.  Thus Theorem~\ref{thm:branch}
applies.  For a surface \(V\subset Q\), its branch count in that theorem
is \(r_V(Q)=r_V^{\mathrm{var}}\geq1\); the last inequality follows from
the finite surjective normalizations.  Surfaces outside \(Q\) have
\(r_V^{\mathrm{var}}=0\).  The total possible deficit in
\eqref{eq:difficulty-local-bound} is consequently \(\beta(Q)\).

Every varying label has \(d_h\geq1\).  The places counted by
\(\tau_Y(Q)\) in Theorem~\ref{thm:branch} also each supply a weight of at
least one in the first sum of \eqref{eq:difficulty}.  In fact such a place
\(E\) has ordinary log discrepancy two and center a singular curve in
\(Q\).  It is exceptional over \(Y\).  Its center is contained in a
varying label of positive coefficient, and that effective label is
\(\Q\)-Cartier on the strong model.  Its order at \(E\) is therefore
strictly positive.  On a common carrier the discrepancy formula reads
\[
 a(E;Y,\Theta+\M)
 =2-\ord_E(\Theta)-\operatorname{coeff}_E(J)<2,
 \qquad J\geq0.
\]
The count \(\tau_Y(Q)\) uses distinct global places.  They occur as
distinct terms of the codimension-at-least-three sum, and none is a place
in a surface bracket.  Theorem~\ref{thm:branch} now gives
\[
 \beta(Q)
 \leq\sum_{h\text{ varying}}c_2(S_h^\nu)+\tau_Y(Q)
 \leq\sum_{h\in\mathcal H}d_hc_2(S_h^\nu)
       +\sum_{\codim_Y\cent_Y(E)\geq3}w(E).
\]
Summing \eqref{eq:difficulty-local-bound} and substituting this inequality
in \eqref{eq:difficulty} proves the assertion.  The branch inequality and
this lower bound have been used only at the junctions.
\end{proof}

\subsection{Exact change along the chain}

For a small step, the change in the normalization cycle ranks will cancel
the change in the surface defaults.  We establish this equality before
comparing the difficulties.

\begin{lemma}[Normalization cycle ranks]\label{lem:difficulty-ranks}
Consider a small step of the terminal chain, with exceptional loci
\(L,L^+\),
\[
 Y\xrightarrow{f}Z\xleftarrow{f^+}Y^+.
\]
For each label \(h\), let \(e_h\) and \(e_h^+\) be the numbers of prime
divisors in \(S_h^\nu\) and \((S_h^+)^\nu\) lying over \(L\) and
\(L^+\), respectively.  Then these numbers are finite and
\begin{equation}\label{eq:difficulty-rank-change}
 \begin{gathered}
 e_h=\sum_{\substack{V\subset L\\\dim V=2}}r_{V,h},\qquad
 e_h^+=\sum_{\substack{V^+\subset L^+\\\dim V^+=2}}r_{V^+,h}^+,\\
 c_2(S_h^\nu)-c_2((S_h^+)^\nu)=e_h-e_h^+.
 \end{gathered}
\end{equation}
The surface sums run over irreducible compact analytic surfaces.
\end{lemma}

\begin{proof}
Let \(T_h\) be the normalization of the common image of the two labels in
\(Z\).  Restricting the projective maps, composing with finite
normalization, and factoring through \(T_h\) gives projective
bimeromorphic maps of normal compact threefolds
\[
 S_h^\nu\longrightarrow T_h\longleftarrow (S_h^+)^\nu.
\]
They identify over the common isomorphism open.  By
Lemma~\ref{lem:small-comparison}, the common exceptional image
\(A=f(L)=f^+(L^+)\) has dimension at most one.  A normalization divisor
lying over \(L\) has a surface as its image in \(S_h\), because
normalization is finite, and its image in \(T_h\) lies over \(A\).
It is therefore contracted by the displayed map.  Conversely, the map is
an isomorphism off the preimage of \(A\), so every contracted prime divisor
lies over \(L\).  These are exactly the primes counted in the first sum
in \eqref{eq:difficulty-rank-change}.  The same reasoning holds on the
positive side.  The exceptional loci have finitely many surface components,
which also proves finiteness.

We use the following independence fact.  For a projective bimeromorphic
map \(g:S\to T\) of normal compact threefolds, the classes in
\(H_4(S,\Q)\) of the prime divisors contracted by \(g\) are linearly
independent.  Take a resolution \(r:\widetilde S\to S\) that is projective,
has smooth source, and is an isomorphism over \(U=S_{\mathrm{reg}}\).  Put
\(R=r^{-1}(S\setminus U)\).  Normality gives \(\dim(S\setminus U)\leq1\),
and \(\dim R\leq2\).  If a rational combination of the contracted divisor
classes vanished on \(S\), the corresponding combination of strict
transforms would restrict to zero in \(H_4^{\BM}(U,\Q)\).  The localization
sequence
\[
 H_4(R,\Q)\longrightarrow H_4(\widetilde S,\Q)
                  \longrightarrow H_4^{\BM}(U,\Q)
\]
then shows that its class is a rational combination of the classes of the
surface components of \(R\); those classes span \(H_4(R,\Q)\).  Subtract
that combination.  We obtain a homologically trivial rational Cartier
divisor on \(\widetilde S\), all of whose components are exceptional over
\(T\).  For the components of \(R\), this follows since their images in
\(S\), hence in \(T\), have dimension at most one.  On the smooth compact
resolution, homological triviality makes this divisor numerically trivial
on every curve by the ordinary class pairing.  Analytic negativity in both
signs, in the form of \cite[Lemma~2.2]{CanonicalKahler}, makes the
divisor zero.  The strict transforms of the original divisors are distinct
from the resolution-exceptional ones, so all original coefficients vanish.
This proves independence without any factoriality assumption on \(S\).

For either label normalization, restrict its span of compact analytic
surface classes to the common open over \(T_h\setminus\nu^{-1}(A)\),
where \(\nu:T_h\to f(S_h)\) is normalization.  The complement of this
open in either normalization has dimension at most two.  Localization shows that the kernel of this
restriction is spanned by its surface components, precisely the contracted
prime divisors just counted.  Their independence makes the kernel dimension
\(e_h\) on one side and \(e_h^+\) on the other.  The two images agree:
any compact analytic prime surface not removed has a strict transform on
the other normalization through their proper graph over \(T_h\), and the
two classes restrict to the same class on the common open.  The same holds
in the reverse direction.  Subtracting the dimensions of these two cycle
spans proves the last equality in \eqref{eq:difficulty-rank-change}.
\end{proof}

\begin{proposition}[Change of the difficulty]\label{prop:difficulty-change}
The difficulty is nonincreasing under every coefficient change and every
small step of the truncated terminal chain.  More precisely:
\begin{enumerate}
\item Suppose \(\Theta'\leq\Theta\) is a coefficient change on the same
model \(Y\), and write \(w(E)\) and \(w'(E)\) for its old and new weights.
The set
\[
 \mathcal C=\{E:\ E\text{ exceptional over }Y,\ w(E)\ne w'(E)\}
\]
is finite, and
\begin{equation}\label{eq:difficulty-coefficient-change}
 \mathfrak D(Y,\Theta+\M)-\mathfrak D(Y,\Theta'+\M)
 =\sum_{E\in\mathcal C}\bigl(w(E)-w'(E)\bigr)\geq0.
\end{equation}
\item For a small step \(Y\to Z\leftarrow Y^+\) with exceptional loci
\(L,L^+\), write \(w(E),w^+(E)\) for the two weights.  The set
\[
 \mathcal P=\{E:\ E\text{ exceptional over }Y,\
       \cent_Y(E)\subset L,\ w(E)+w^+(E)>0\}
\]
is finite.  Its center condition is equivalently
\(\cent_{Y^+}(E)\subset L^+\), and
\begin{equation}\label{eq:difficulty-small-change}
 \mathfrak D(Y,\Theta+\M)-\mathfrak D(Y^+,\Theta^++\M)
 =\sum_{E\in\mathcal P}\bigl(w(E)-w^+(E)\bigr)\geq0.
\end{equation}
\end{enumerate}
In either move, a strict decrease in the weight of any exceptional place
forces a strict decrease in the difficulty.
\end{proposition}

\begin{proof}
For a coefficient change, the removed boundary \(\Theta-\Theta'\) is
effective and \(\Q\)-Cartier on the strong model.  For every place,
\[
 a(E;Y,\Theta'+\M)-a(E;Y,\Theta+\M)
 =\ord_E(\Theta-\Theta')\geq0.
\]
Thus \(w(E)\geq w'(E)\).  The model, centers, branch counts, and
normalization ranks are unchanged, and the defaults \(d_h\) are constant
by the choice of the tail.  At a fixed surface the two raw sums are finite,
and therefore
\[
 q_Y(V)-q'_Y(V)=\sum_{\cent_Y(E)=V}\bigl(w(E)-w'(E)\bigr).
\]
Let \(\Sigma\) be the finite union of the supports of the two functions
\(q_Y\) and \(q'_Y\) on surfaces.  Outside \(\Sigma\) the displayed
sum is zero.  Every summand is nonnegative, so no exceptional place with
such a surface center can lose weight.  At each surface of \(\Sigma\)
only finitely many places have positive old or new weight, and there are
only finitely many positive weights at centers of codimension at least
three.  This proves that \(\mathcal C\) is finite.  Summing the displayed
identity over \(\Sigma\), adding the finite comparison in codimension at
least three, and canceling the unchanged rank term gives
\eqref{eq:difficulty-coefficient-change}.

For a small step, Lemma~\ref{lem:small-comparison} says that exceptionality
of a global place is the same on the two sides, that the two center
containment conditions in the statement are equivalent, and that
\(w(E)\geq w^+(E)\).  If a center is not contained in the exceptional
locus, its general point corresponds on the common isomorphism open and its
discrepancy is unchanged.  The set \(\mathcal P\) is finite: each
exceptional locus has dimension at most two and has finitely many surface
components; a surface center contained in it is one of these components.
Proposition~\ref{prop:difficulty-finite} gives finiteness above each such
surface and finiteness of all positive-weight places with lower-dimensional
centers, on both sides.

Surface centers not contained in \(L\) correspond by proper strict
transform to those not contained in \(L^+\).  At their general points the
places, discrepancies, and normalization primes over the surfaces
correspond, so the two local brackets agree.  The analogous correspondence
holds for the raw terms at lower-dimensional centers outside the exceptional
loci.  In the exceptional loci, every contributing place is counted exactly
once in the raw part on each side of \eqref{eq:difficulty}.  This remains
true if its center changes from a surface to a curve or point, or conversely.
The finite comparison of those raw parts is therefore
\(\sum_{E\in\mathcal P}(w(E)-w^+(E))\).  The subtracted defaults on the
exceptional surfaces have difference \(-\sum_h d_h(e_h-e_h^+)\).  Hence
\begin{align*}
 &\mathfrak D(Y,\Theta+\M)-\mathfrak D(Y^+,\Theta^++\M)\\
 &\quad=\sum_{E\in\mathcal P}\bigl(w(E)-w^+(E)\bigr)
       -\sum_h d_h(e_h-e_h^+)
       +\sum_h d_h\bigl(c_2(S_h^\nu)-c_2((S_h^+)^\nu)\bigr)\\
 &\quad=\sum_{E\in\mathcal P}\bigl(w(E)-w^+(E)\bigr),
\end{align*}
where the last equality is Lemma~\ref{lem:difficulty-ranks}.  This is
\eqref{eq:difficulty-small-change}.  Every summand is nonnegative.  A
strictly decreasing exceptional weight must have its center in the
exceptional loci, since weights agree off them, and is in \(\mathcal P\).
A positive weight that becomes zero is included by the definition of
\(\mathcal P\).  The same positivity is immediate in
\eqref{eq:difficulty-coefficient-change}; this proves strictness in both
cases.
\end{proof}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/07-difficulty.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/08-completion.tex ====
\section{Termination and the log canonical reduction}\label{sec:completion}

We first show that a surface in the positive exceptional locus of a
downstairs diagram is detected by the integer difficulty.  The calculation
uses the weight denominator \(N\) chosen for the particular strong gklt
sequence under consideration.  We then prove
termination for strong gklt models, pass to elementary gdlt programs, and
lift the arbitrary diagrams of Theorem~\ref{thm:main} to those programs.

\begin{lemma}[A positive exceptional surface]\label{lem:positive-surface}
Use the truncated terminal chain of
Propositions~\ref{prop:terminal-junctions} and
\ref{prop:surface-finiteness}, with the integer \(N\), weights, and constant
defaults chosen in Section~\ref{sec:difficulty}.  If an irreducible compact
analytic surface \(V\) is contained in \(L_i^+\subset X_{i+1}\), there is
a global place \(E\), exceptional over both junctions and every model of
their connector, such that
\[
 a_{i+1}(E)\in(1,2]\cap N^{-1}\Z,
 \qquad w_i(E)\geq w_{i+1}(E)+1.
\]
Here \(w_i\) and \(w_{i+1}\) are the weights at the two crepant junctions.
Consequently
\[
 \mathfrak D(Y_i,\Theta_i+\M)
 >\mathfrak D(Y_{i+1},\Theta_{i+1}+\M).
\]
\end{lemma}

\begin{proof}
By Proposition~\ref{prop:surface-finiteness}, the model \(X_{i+1}\) is
smooth near the general point of \(V\), the junction morphism is an
isomorphism there, and the generic blowup of \(V\) gives a unique global
place \(E\) with
\[
 a^+:=a_{i+1}(E)>1.
\]
This place is exceptional over \(X_{i+1}\) and does not belong to the
stabilized extracted set \(\mathcal I\).  The blowup of the coherent ideal
of \(V\) is projective, so Lemma~\ref{lem:common-projective-models} gives a
smooth common model \(W\) carrying both \(E\) and the fixed nef datum,
with a projective morphism \(r:W\to X_{i+1}\).  By Lemma~\ref{lem:nef-defect},
\[
 J=r^*M_{i+1}-M_W\geq0.
\]
At the generic smooth codimension-two center, the ordinary log discrepancy
of the blowup is two.  The discrepancy formula is therefore
\begin{equation}\label{eq:positive-detector-discrepancy}
 a^+=2-\ord_E(B_{i+1})-\operatorname{coeff}_E(J).
\end{equation}
Both subtracted terms are nonnegative.  Thus \(a^+\leq2\).

We verify the denominator in this calculation.  By the choice in
Section~\ref{sec:difficulty}, \(N\) clears the coefficients of the initial
boundary and the Cartier denominator of the higher nef divisor of this
strong gklt sequence.  Since the downstairs boundaries are strict
transforms, \(NB_{i+1}\) is an integral Weil divisor.  Also \(NM_{i+1}\)
is an integral Weil divisor: it is the pushforward of the integral Cartier
divisor \(NM_W\) from a common carrier.  On the smooth open neighborhood of
the general point of \(V\), these two integral Weil divisors are Cartier.
Their orders at \(E\) are consequently integral after multiplication by
\(N\).  In particular,
\[
 N\ord_E(B_{i+1})\in\Z,
 \qquad
 N\operatorname{coeff}_E(J)
 =\ord_E(Nr^*M_{i+1})-\operatorname{coeff}_E(NM_W)\in\Z.
\]
Only Cartierness on this smooth open has been used.  Equation
\eqref{eq:positive-detector-discrepancy} gives
\(a^+\in(1,2]\cap N^{-1}\Z\).

Put \(a^-=a_i(E)\).  The strict part of
Lemma~\ref{lem:small-comparison} applies because
\(\cent_{X_{i+1}}(E)=V\subset L_i^+\), and gives \(a^-<a^+\).  The same
lemma says that \(E\) is exceptional over both downstairs models.  Since
it does not belong to \(\mathcal I\), it is not an extracted prime on either
junction; it is therefore exceptional over both.  All the intervening
steps are small, so it stays exceptional on every model of the connector.

Crepancy identifies the discrepancies at the junctions with \(a^-\) and
\(a^+\).  Write \(k=N(2-a^+)\), a nonnegative integer.  Since
\(a^-<a^+\leq2\), the ceiling weights satisfy
\[
 w_i(E)=\left\lceil N(2-a^-)\right\rceil
 \geq k+1,
 \qquad
 w_{i+1}(E)=\left\lceil N(2-a^+)\right\rceil=k.
\]
This includes \(a^+=2\), when \(k=0\).  No denominator assertion for
\(a^-\) is needed.  The connector consists of one coefficient change and
a finite, possibly empty, string of small steps.  Its weights are
nonincreasing, so the strict decrease between its ends occurs in at least
one move.  The place \(E\) is exceptional throughout that move.
Proposition~\ref{prop:difficulty-change} makes the difficulty decrease
strictly there and nonincrease in every other move, proving the claim.
\end{proof}

\begin{theorem}[Termination on strong gklt models]\label{thm:strong-gklt}
Every sequence satisfying the hypotheses of Theorem~\ref{thm:main} for
which all the models \(X_i\) are globally strongly \(\Q\)-factorial and
the initial pair \((X_0,B_0+\M)\) is gklt is finite.  The small diagrams
may be chosen arbitrarily subject to the hypotheses of that theorem.
\end{theorem}

\begin{proof}
Suppose such a sequence were infinite.  Apply
Proposition~\ref{prop:terminal-junctions}, then
Proposition~\ref{prop:surface-finiteness}, and use the further truncation
and denominator choice of Section~\ref{sec:difficulty}.  At every junction
the difficulty is a nonnegative integer by
Proposition~\ref{prop:difficulty-lower}.  It is nonincreasing from one
junction to the next by Proposition~\ref{prop:difficulty-change}.  By
Lemma~\ref{lem:positive-surface}, it drops by at least one whenever the
positive exceptional locus contains a surface.  There can be only finitely
many such indices.  This argument uses the lower bound only at junctions;
it requires no lower bound on the intermediate models.

Pass to the remaining tail.  There \(\dim L_i^+<2\).  The dimension
inequality in Lemma~\ref{lem:small-comparison} forces \(\dim L_i=2\), so
\(L_i\) contains an irreducible compact analytic surface.  By
Lemma~\ref{lem:cycle-loss},
\[
 c_2(X_i)>c_2(X_{i+1})
\]
at every step of this tail.  These are nonnegative integers, a
contradiction.
\end{proof}

\begin{theorem}[Termination of elementary gdlt programs]\label{thm:gdlt}
Let
\[
 (T_0,B_0+\M)\dashrightarrow(T_1,B_1+\M)
 \dashrightarrow(T_2,B_2+\M)\dashrightarrow\cdots
\]
be a sequence of elementary steps for rational gdlt pairs on strong normal irreducible
compact K\"ahler fourfolds.  Assume that the boundaries are effective
rational divisors of finite support transported by the steps, that the
fixed b-divisor is represented by an analytically nef \(\Q\)-Cartier divisor
on a projective bimeromorphic normal compact K\"ahler model of \(T_0\), and
that the actual adjoints are \(\Q\)-Cartier with compatible canonical
representatives.  Then the sequence is finite.  The contraction bases and
the choices of elementary steps may vary.
\end{theorem}

\begin{proof}
An elementary program extracts no prime divisors.  Lemma~\ref{lem:cycle-loss} with \(k=3\)
therefore permits only finitely many divisorial steps.  If the sequence were
infinite, we could discard a finite prefix containing them and work on a
tail of small steps.
The rational b-line realization described in
Section~\ref{sec:preliminaries} has the same discrepancies and fixed higher
nef data; common projective carriers for finite portions carry their
analytically nef pullbacks.  Thus Theorem~\ref{thm:special-termination}
applies.  After a further tail, both exceptional loci of every step avoid
every generalized log canonical center on their respective sides.

Set \(H_i=\lfloor B_i\rfloor\).  Since the pair is glc and \(B_i\) is
effective, its coefficients belong to \([0,1]\), so \(H_i\) is the reduced
sum of its coefficient-one components.  Each such component is itself a
generalized log canonical center.  Hence \(\Supp H_i\) is disjoint from
the exceptional loci adjacent to \(T_i\) on this tail.  The divisors
\(H_i\) are effective and \(\Q\)-Cartier on the strong models, and they
are strict transforms of each other across the small steps.

Remove the whole floor and write
\[
 \widehat B_i=B_i-H_i,
 \qquad \widehat D_i=K_{T_i}+\widehat B_i+M_{T_i}=D_i-H_i.
\]
The new boundary is effective.  For every global place \(E\), comparison
of the two crepant equations gives
\begin{equation}\label{eq:full-floor-deletion}
 a(E;T_i,\widehat B_i+\M)
 =a(E;T_i,B_i+\M)+\ord_E(H_i).
\end{equation}
The added order is nonnegative.  If the old discrepancy is zero, the gdlt
definition says that the general point of its center is a stratum of the
coefficient-one boundary.  Taking its closure places the entire center in
\(\Supp H_i\).  The order of an effective \(\Q\)-Cartier divisor at a
place whose center lies in its support is strictly positive.  Thus every
former zero discrepancy becomes positive, and every former positive
discrepancy stays positive.  The pairs \((T_i,\widehat B_i+\M)\) are gklt.

We check the two ample signs after this full deletion.  For a step write
\[
 T_i\xrightarrow{f}Z\xleftarrow{f^+}T_{i+1},
 \qquad L=\Exc(f),\quad L^+=\Exc(f^+).
\]
Lemma~\ref{lem:small-comparison} gives a common exceptional image \(A\)
with \(L=f^{-1}(A)\), \(L^+=(f^+)^{-1}(A)\), and both maps isomorphisms
off \(A\).  Properness makes \(f(\Supp H_i)\) closed.  It is disjoint from
\(A\), because \(\Supp H_i\cap L=\varnothing\).  On the base open
\(Z\setminus f(\Supp H_i)\), which contains \(A\), the divisor \(H_i\)
vanishes, so \(-\widehat D_i=-D_i+H_i\) has the original relative ample
sign.  On \(Z\setminus A\) the map \(f\) is an isomorphism, and every line
bundle is relatively ample for an isomorphism.  These two opens cover
\(Z\).  After clearing a common Cartier multiple, relative ampleness is
local on the base, so \(-\widehat D_i\) is \(f\)-ample.  The identical
argument with \(f^+\) and \(H_{i+1}\) proves that
\(\widehat D_{i+1}=D_{i+1}-H_{i+1}\) is \(f^+\)-ample.

Reindex this floor-deleted tail at its first model and regard it as a
sequence of the arbitrary small diagrams in Theorem~\ref{thm:strong-gklt}.
The model and diagram hypotheses are inherited; the new boundaries are
effective and related by strict transform, the actual adjoints are
\(\Q\)-Cartier, and the two ample signs have just been checked.  A common
carrier for the finite preceding portion, projective over the new first
model, supplies the fixed analytically nef divisor.  In this application
the detector integer is chosen afresh for the new initial boundary and
nef carrier.  The theorem makes the tail finite, contradicting its
construction.
\end{proof}

To lift a prescribed downstairs diagram, we run gdlt continuation over
its base.  Theorem~\ref{thm:gdlt} forces the chosen run to reach a nef
adjoint, and Lemma~\ref{lem:nef-ample} gives a projective crepant morphism
from that endpoint to the prescribed positive model.  A negative
multisection ensures that the run contains a step.

\begin{lemma}[A nonempty gdlt lift]\label{lem:nonempty-lift}
Let
\[
 X\xrightarrow{\ f\ }Z\xleftarrow{\ f^+\ }X^+
\]
be any one of the small diagrams allowed in Theorem~\ref{thm:main}, with
normal globally Weil \(\Q\)-factorial compact K\"ahler fourfolds on the two
sides, effective rational boundaries \(B,B^+\) related by strict transform,
the same rational nef b-divisor, and the compatible actual adjoints
\(D_X,D_{X^+}\).  Assume \((X,B+\M)\) is glc, and represent the b-divisor
by an analytically nef \(\Q\)-Cartier divisor on a projective carrier over
\(X\).  Suppose
\[
 h:(Y,\Theta+\M)\longrightarrow(X,B+\M)
\]
is a projective crepant gdlt modification as in
Proposition~\ref{prop:gdlt-modification}; in particular \(Y\) is strong,
\(\Theta\geq0\), and every \(h\)-exceptional prime has coefficient one.
Then there is a finite sequence of elementary negative gdlt steps over
\(Z\), of length \(m\geq1\),
\[
 (Y,\Theta+\M)=(Y_0,\Theta_0+\M)
 \dashrightarrow\cdots\dashrightarrow(Y_m,\Theta_m+\M),
\]
and a projective bimeromorphic morphism \(h^+:Y_m\to X^+\) such that
\[
 K_{Y_m}+\Theta_m+M_{Y_m}=(h^+)^*D_{X^+}.
\]
The end is a strong normal compact K\"ahler gdlt model with effective
boundary, and every \(h^+\)-exceptional prime has coefficient one in
\(\Theta_m\).  Thus it is again a crepant gdlt modification of the same
type.
\end{lemma}

\begin{proof}
The composite \(Y\to Z\) is projective bimeromorphic to a normal compact
K\"ahler base.  On a projective common carrier, the fixed analytically nef
divisor is nef over \(Z\).  Thus the continuation assertion of
Proposition~\ref{prop:relative-program} applies to this gdlt pair and to
every non-nef finite prefix produced from it.

The initial adjoint \(D_Y=h^*D_X\) is not nef over \(Z\).  Indeed, the
nonisomorphic projective contraction \(f\) has a positive-dimensional
fiber, and projective hyperplane cuts give a compact irreducible curve
\(C\) in that fiber.  The negative ample sign gives \(D_X\cdot C<0\).
There is a compact irreducible curve \(C'\subset Y\) mapping onto \(C\).
For completeness, normalize \(C\), take an irreducible component of its
base change under \(h\) which dominates that normalization, and write
\(r\) for its generic fiber dimension.  The normalization of \(C\) is a
projective compact curve, so this component, being projective over it, is
projective.  A sufficiently high very ample system on the component has
\(r\) general members whose intersection with a generic fiber is a
nonempty zero-dimensional cycle.  Their intersection therefore has a
compact curve component dominating the base.  Its image in \(Y\) is such
a \(C'\).  The induced map of normalized curves has a positive finite
degree.  The projection formula now gives
\[
 D_Y\cdot C'=\deg(C'/C)\,D_X\cdot C<0.
\]
In particular, any run reaching nefness must contain at least one step.

Choose an elementary negative step whenever the current adjoint is not
nef over \(Z\).  The relative continuation assertion keeps all outputs
projective over \(Z\), strong normal compact K\"ahler, and gdlt with the
transported data.  All models in the run are irreducible: \(Y\) is
bimeromorphic to the irreducible \(X\), and every elementary step is
bimeromorphic.  If this process never reached a nef adjoint, it would
give an infinite elementary gdlt sequence with the fixed analytically nef
b-divisor.  This contradicts Theorem~\ref{thm:gdlt}.  We obtain a finite
run of length \(m\geq1\) with end adjoint \(D_{Y_m}\) nef over \(Z\).

Take a smooth common model \(W\) with projective maps to the models in the
run, to \(X^+\), and to the nef carrier, all over \(Z\).  Write \(P_0,P,P_+\) for the pullbacks
of \(D_Y,D_{Y_m},D_{X^+}\), respectively.  By
Lemma~\ref{lem:program-comparison}, the finite run gives
\[
 P_0=P+G,\qquad G\geq0\text{ exceptional over }Y_m.
\]
Initial crepancy identifies \(P_0\) with the pullback of \(D_X\).
Lemma~\ref{lem:small-comparison}, pulled to \(W\), gives the second
comparison
\[
 P_0=P_++F,\qquad F\geq0\text{ exceptional over }X^+.
\]
The first end is nef over \(Z\), and \(D_{X^+}\) is ample over \(Z\).
Lemma~\ref{lem:nef-ample} therefore gives an actual equality \(P=P_+\)
and a projective morphism \(h^+:Y_m\to X^+\) over \(Z\) with
\(D_{Y_m}=(h^+)^*D_{X^+}\).

The end is strong, gdlt, and has effective boundary by the relative
program.  It remains to check its exceptional primes.  Every prime on
\(Y_m\) has a strict-transform prime on \(Y\), because an elementary
program extracts no prime divisors.  Let \(R\) be exceptional for
\(h^+\), and let \(R_0\) be its prime on \(Y\).  If \(R_0\) were not
exceptional for \(h\), it would represent a prime on \(X\).  Smallness
downstairs identifies that prime with a prime on \(X^+\).  The place of
\(R\) would then have a divisorial center on \(X^+\), contradicting its
exceptionality.  Hence \(R_0\) is \(h\)-exceptional and has coefficient
one in \(\Theta\).  Boundary coefficients of surviving primes are
unchanged by an elementary program, so \(R\) has coefficient one in
\(\Theta_m\).  The displayed crepant equality also identifies its
discrepancy over \(X^+\) as zero.  This proves the lemma.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{thm:main}]
Assume that the sequence in the theorem is infinite.  By
Lemma~\ref{lem:small-comparison}, every global discrepancy is nondecreasing
along it.  Hence every \((X_i,B_i+\M)\) is glc.  The rational b-line
realization of the initial data satisfies
Proposition~\ref{prop:gdlt-modification}: \(X_0\) is a normal compact
K\"ahler fourfold, the boundary is effective and rational, the nef datum
has a projective carrier, and the adjoint is rationally invertible.  The
proposition gives a projective crepant gdlt modification
\[
 h_0:(Y_0,\Theta_0+\M)\longrightarrow(X_0,B_0+\M)
\]
with a strong normal compact K\"ahler source and only coefficient-one
exceptional primes.  It requires no strong factoriality of \(X_0\).

Apply Lemma~\ref{lem:nonempty-lift} to the first downstairs diagram and
\(h_0\).  Its endpoint is a crepant gdlt modification of the same type over
\(X_1\), so it is the input for the next application.  At every finite
stage a common projective carrier supplies the fixed analytically nef
data over the current downstairs model.  Induction therefore lifts every
downstairs diagram.  Each lifted string is finite and contains at least one
elementary step, and its endpoint is used as the literal starting model of
the next string.  Their concatenation is an infinite sequence of elementary
gdlt steps on strong normal irreducible compact K\"ahler fourfolds, with the same
b-divisor throughout.  Theorem~\ref{thm:gdlt} allows the bases to vary and
rules out this sequence.  The contradiction proves
Theorem~\ref{thm:main}.
\end{proof}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//sections/08-completion.tex ====

==== BEGIN Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//termination-generalized-lc-kahler-fourfolds.tex ====
\documentclass[11pt]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[margin=1.05in]{geometry}
\usepackage{mathtools,amssymb}
\usepackage{tikz-cd}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{hidelinks,pdftitle={Termination of generalized log canonical flips on compact Kahler fourfolds},pdfauthor={OpenAI}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{notation}[theorem]{Notation}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem*{claim}{Claim}
\numberwithin{equation}{section}

\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\M}{\mathbf{M}}
\DeclareMathOperator{\Exc}{Exc}
\DeclareMathOperator{\Supp}{Supp}
\DeclareMathOperator{\Sing}{Sing}
\DeclareMathOperator{\cent}{cent}
\DeclareMathOperator{\ord}{ord}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\rk}{rk}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\coker}{coker}
\DeclareMathOperator{\Pic}{Pic}
\DeclareMathOperator{\Proj}{Proj}
\DeclareMathOperator{\IC}{IC}
\DeclareMathOperator{\Gr}{Gr}
\newcommand{\BM}{\mathrm{BM}}
\allowdisplaybreaks[2]
\setcounter{tocdepth}{1}
\emergencystretch=2em

\title[Generalized log canonical flips on K\"ahler fourfolds]{Termination of generalized log canonical flips\newline on compact K\"ahler fourfolds}
\author{OpenAI}
\date{October 7, 2026}

\begin{document}
\begin{abstract}
Every sequence of generalized log canonical flips on a normal irreducible globally Weil \(\Q\)-factorial compact K\"ahler fourfold terminates, provided the flips are projective small diagrams with the stated opposite ample signs. The boundary is rational, and the nef b-divisor is fixed and represented by an analytically nef \(\Q\)-Cartier divisor on a projective modification. No scaling rule or pseudo-effectivity assumption is required. The theorem concerns existing flip sequences; it does not assert the existence of all contractions or flips.

\end{abstract}
\maketitle
\tableofcontents

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

Termination of flips rules out an endless sequence of small birational improvements in the minimal model program. Since flips contract no divisors, their number cannot be bounded by counting divisors that disappear. In dimension four, exceptional surfaces bring places centered on surfaces and curves into the argument. On compact K\"ahler spaces, the contractions may be projective even when the ambient fourfold has no ample line bundle.

Shokurov's difficulty counts exceptional divisors with small discrepancy to measure the improvement of singularities \cite[Definition~2.15 and Corollaries~2.16--2.17]{ShokurovNonvanishing}. Kawamata, Matsuda, and Matsuki combined it with the rank of surface cycle classes to prove termination of terminal fourfold flips in the algebraic setting \cite[Theorem~5-1-15]{KawamataMatsudaMatsuki1987}. For boundaries, Fujino's corrected argument for canonical fourfold pairs exhibits the recurring contributions from successive blowups over a codimension-two center \cite[Example~2.1 and Theorems~5.1--5.2]{Fujino2005Addendum}. Alexeev, Hacon, and Kawamata developed a weighted difficulty that subtracts these contributions and tracks cycles on normalized boundary components \cite[Section~2]{AlexeevHaconKawamata2007}. Discrepancy improvement and the behavior of boundary cycles also guide the proof here.

Generalized pairs place part of the adjoint data on a higher birational model: a nef divisor there contributes its trace on the space carrying the boundary \cite[Definitions~1.4 and 4.1]{BirkarZhang2016}. For algebraic generalized pairs, Hacon and Moraga gave a termination reduction using weak Zariski decompositions \cite[Theorem~1]{HaconMoraga2020}. Termination for pseudo-effective generalized log canonical fourfolds with NQC nef data was proved by Chen and Tsakanikas \cite[Theorem~1.1]{ChenTsakanikas2023} and by Moraga \cite[Theorem~4.4]{Moraga2025}. Here NQC means a nonnegative real combination of nef \(\Q\)-Cartier divisors on the higher model. Han, Liu, and Zhuang proved termination of ordinary klt fourfold minimal model programs when the boundary is big over the fixed algebraic base \cite[Corollary~3.2(3)]{HanLiuZhuang2025}.

Hacon and Xie formulate a termination conjecture for generalized klt pairs with higher \((1,1)\)-class data on compact K\"ahler spaces \cite[Conjecture~1.15]{HaconXie2026}. The generalized klt case of the theorem below treats a four-dimensional rational-divisor form of that question under the stated projectivity and global Weil \(\Q\)-factoriality assumptions; the theorem also permits generalized log canonical singularities. Its ambient spaces may be nonprojective, and the prescribed small diagrams may vary their bases and choices under the hypotheses below.

A normal compact complex space \(X\) is \emph{globally Weil \(\Q\)-factorial} if every prime Weil divisor defined on all of \(X\) is \(\Q\)-Cartier and some positive reflexive power of its canonical sheaf is invertible. Projective morphisms of complex spaces are understood in the analytic sense: they admit a relatively ample holomorphic line bundle. A \(\Q\)-Cartier divisor is relatively ample if a positive Cartier multiple is relatively ample.

For a normal compact K\"ahler space \(X\), a rational nef b-divisor \(\M\) in this paper is represented by a \(\Q\)-Cartier divisor \(M'\) on a normal compact K\"ahler space \(X'\) with a projective bimeromorphic map \(\pi:X'\to X\). We require \(c_1(M')\) to lie in the closure of the K\"ahler cone in real Bott--Chern cohomology. On a model dominating \(X'\), the trace \(M_W\) is the pullback of \(M'\); on another model it is the pushforward from a common higher model. The divisor \(M'\) need not be effective.

We use compatible actual canonical divisor representatives on the birational models under consideration. Given an effective rational Weil divisor \(B\) of finite support for which \(D_X=K_X+B+M_X\) is \(\Q\)-Cartier, choose a smooth proper bimeromorphic model \(p:W\to X\) dominating \(X'\) and write
\begin{equation}\label{eq:discrepancy-definition}
 K_W+\Delta_W+M_W=p^*(K_X+B+M_X).
\end{equation}
A \emph{global divisorial place} is a prime divisor on a normal proper bimeromorphic model, with primes identified by strict transform on common higher models. Its log discrepancy is
\[
 a(E;X,B+\M)=1-\operatorname{coeff}_E(\Delta_W)
\]
on a model carrying \(E\). The pair is \emph{generalized log canonical} if this number is nonnegative for every global divisorial place, including the primes on \(X\). These places are defined on birational models; the definition does not depend on a field of global meromorphic functions.

\begin{theorem}\label{thm:main}
Let \(X_0\) be a normal irreducible globally Weil \(\Q\)-factorial compact K\"ahler fourfold. Let \(B_0\) be an effective rational Weil divisor of finite support with coefficients in \([0,1]\). Let \(\M\) be represented by an analytically nef \(\Q\)-Cartier divisor on a projective bimeromorphic normal compact K\"ahler model of \(X_0\). Fix compatible actual canonical divisor representatives on all birational models under consideration. Suppose that \(D_0=K_{X_0}+B_0+M_{X_0}\) is \(\Q\)-Cartier and that \((X_0,B_0+\M)\) is generalized log canonical.

Consider a sequence of normal irreducible globally Weil \(\Q\)-factorial compact K\"ahler fourfolds
\[
 X_0\dashrightarrow X_1\dashrightarrow X_2\dashrightarrow\cdots.
\]
On \(X_i\), let \(B_i\) be the strict transform of \(B_0\), let \(M_i=M_{X_i}\) be the trace of the same b-divisor, and assume that \(D_i=K_{X_i}+B_i+M_i\) is \(\Q\)-Cartier. Transport the canonical representatives under the induced identifications of prime divisors. Suppose that every step is given by a diagram
\begin{equation}\label{eq:flip-diagram}
\begin{tikzcd}[column sep=large]
 X_i \arrow[r,"f_i"] & Z_i & X_{i+1}\arrow[l,"f_i^+"']
\end{tikzcd}
\end{equation}
where \(Z_i\) is normal compact K\"ahler, both maps are projective small bimeromorphic morphisms with connected fibers, neither is an isomorphism, and
\[
 -D_i\text{ is }f_i\text{-ample},\qquad
 D_{i+1}\text{ is }f_i^+\text{-ample}.
\]
Here \emph{small} means that the exceptional locus contains no prime divisor. Then the sequence is finite.
\end{theorem}

We call a diagram satisfying the hypotheses of Theorem~\ref{thm:main} a \emph{flip} for the indicated adjoint. The theorem applies to arbitrary choices of such diagrams. Taking \(\M=0\) gives the ordinary log canonical case.

The proof uses the relative constructions and special termination for generalized pairs in \cite{KahlerAuxiliary}, whose precise forms we recall in Section~\ref{sec:preliminaries}.

\subsection*{Proof strategy}

We first prove termination for generalized klt pairs on models satisfying the stronger factoriality condition specified in Section~\ref{sec:preliminaries}. Discrepancy monotonicity and finiteness for the initial pair make the set of exceptional places of discrepancy at most one constant on a tail. Extracting it gives crepant models \(h_i:Y_i\to X_i\) whose remaining exceptional discrepancies are greater than one; we call them \emph{terminal junctions}. Each downstairs flip connects two junctions by a decrease of the extracted boundary coefficients followed by a finite, possibly empty, program of small steps. This construction adapts the projective argument of \cite[Section~3, Proposition~3.4]{ProjectiveLCFourfolds}.

The extracted coefficients may still vary. When an extracted divisor maps onto a surface, a transverse smooth surface cuts its general fiber into exceptional curves. Adjunction and negative definiteness bound the entries of the grouped intersection matrix. The fixed rational boundary and nef data then confine the discrepancies of extracted places with surface centers to a finite set. A downstairs flip strictly raises the discrepancy of a place whose center lies in its exceptional locus. It follows that, on every junction of a tail, each coefficient that still varies belongs to a divisor mapping onto a curve or a point of \(X_i\).

The branch bound of Theorem~\ref{thm:branch} applies to a reduced union \(Q\) of divisors on a terminal fourfold \(Y\) when a projective bimeromorphic morphism \(Y\to X\) of normal irreducible compact K\"ahler fourfolds sends \(Q\) to a set of dimension at most one. A surface in \(Q\) may have several prime divisors above it in the disjoint normalization of its components. The theorem bounds the total excess of branches by the ranks of surface cycle classes on those normalizations and the number of global ordinary discrepancy-two places centered on singular curves in \(Q\). It is formulated independently of any boundary or crepant equation.

The word \emph{global} is essential. Projective topology over the curve image relates the branch excess to local systems along the singular curves. Saito's projective analytic decomposition theorem and a Hodge-filtration argument on a compact K\"ahler resolution give the needed purity. A Quot parameter argument gives finite monodromy. On a Stein neighborhood of a compact core carrying all loops of the curve, we apply Fujino's local small \(\Q\)-factorialization theorem; fiber degrees and blowups then produce local ordinary discrepancy-two places. A canonical discrepancy comparison shows that they occur as divisors on one global resolution, and the retained loops keep those global divisors distinct. The normalization and parameter methods follow \cite[Sections~5--6]{ProjectiveLCFourfolds}; the analytic purity argument and the passage to distinct global divisors are given here.

Section~\ref{sec:difficulty} constructs the difficulty by counting exceptional places of discrepancy below two with ceiling weights, subtracting generic blowup contributions locally before summation, and adding cycle-rank corrections on normalized boundary components. The branch bound makes it nonnegative at junctions. Across a small step, the cycle-rank change cancels the change in the local subtractions, leaving a sum of nonnegative weight losses. This adapts the locally corrected difficulty in \cite[Section~4]{ProjectiveLCFourfolds}.

A surface in the positive exceptional locus of a downstairs flip forces a drop of at least one in the difficulty between its terminal junctions. Only finitely many flips can do this. Every remaining flip has an exceptional surface only on the negative side, so the rank of analytic surface classes on the ambient \(X_i\) decreases. This proves termination for generalized klt pairs on these auxiliary models. Special termination and deletion of the whole boundary floor reduce elementary generalized dlt programs to that case. We then use relative continuation and this gdlt termination to lift each diagram of Theorem~\ref{thm:main} to a finite program whose endpoint maps crepantly to the next downstairs model. A negative curve downstairs has a negative multisection upstairs, so each lift is nonempty. Their concatenation proves Theorem~\ref{thm:main}.

\section{Generalized pairs and auxiliary programs}\label{sec:preliminaries}

The relative constructions used in the proof take place on models with a
stronger global factoriality property than the one in
Theorem~\ref{thm:main}.  We first specify that property and the generalized
pair conventions for those constructions.  We then record the precise
forms of the auxiliary results that will be used.

The auxiliary definitions and statements in this section use reduced,
irreducible, second-countable complex analytic spaces as their ambient
spaces.

\begin{definition}[Global strong factoriality]\label{def:strong-factoriality}
A normal compact complex space \(T\) is \emph{globally strongly
\(\Q\)-factorial} if, for every coherent rank-one reflexive sheaf
\(\mathcal F\) on all of \(T\), some positive reflexive power
\[
 \mathcal F^{[m]}=(\mathcal F^{\otimes m})^{**},\qquad m>0,
\]
is an invertible sheaf.
\end{definition}

This condition implies global Weil \(\Q\)-factoriality: apply it to the
divisorial sheaf of each global prime divisor and to the reflexive canonical
sheaf.  It is a condition on sheaves on the whole space; it makes no assertion
that arbitrary analytic open subsets, or the analytic local rings, are
\(\Q\)-factorial.  We use \emph{strong model} to mean a globally strongly
\(\Q\)-factorial model.

A \emph{rational line bundle} on \(T\) is an element of
\(\Pic(T)\otimes_{\Z}\Q\).  An equality of rational line bundles means an
isomorphism of holomorphic line bundles after taking a positive common
integral multiple.  A rank-one reflexive sheaf is \emph{rationally
invertible} if a positive reflexive power is invertible.  On a projective
morphism \(T\to V\), a rational line bundle is \emph{relatively nef} if
its degree is nonnegative on every compact irreducible curve in a fiber,
and is \emph{relatively ample} if a positive integral multiple is relatively
ample.  For the absolute nef data in this paper, nefness means that the
first Chern class lies in the closure of the K\"ahler cone, as in the
introduction; it implies relative nefness for every morphism under
consideration.

The auxiliary constructions are stated for rational generalized
\emph{b-line data}.  On a normal compact space \(T\), these consist of an
effective rational Weil divisor \(B\) of finite support, a projective
modification \(p:W\to T\), and a rational line bundle \(M_W\) on \(W\)
that is nef absolutely, or nef over the specified base of a relative
argument.  It is pulled back on every higher model; we continue to denote
the resulting b-object by \(\M\).  After clearing a denominator, proper
direct image followed by double dual defines its reflexive trace \(M_T\).
The adjoint \(D_T=K_T+B+M_T\) is required to be rationally invertible.
Here \(K_T\) in the b-line formulation is the reflexive canonical sheaf.
On a smooth log resolution projective over \(T\) and carrying the data, the natural
meromorphic comparison over the isomorphism locus defines the crepant
boundary by
\[
 K_W+B_W+M_W=p^*D_T.
\]
The log discrepancy of a global place \(E\) is
\(a(E;T,B+\M)=1-\operatorname{coeff}_E(B_W)\) on a model carrying it.
All statements about places below concern the global places defined in the
introduction.  A global place is exceptional over \(T\) if its center on
\(T\) has codimension at least two.

We abbreviate \emph{generalized klt}, \emph{generalized lc}, and
\emph{generalized dlt} to gklt, glc, and gdlt.  A pair is gklt if all of
its global log discrepancies are positive, and glc if they are all
nonnegative.  It is \emph{generalized terminal} if it is gklt and
\(a(E;T,B+\M)>1\) for every place exceptional over \(T\).  A
\emph{generalized log canonical center} is the center of a global place of
log discrepancy zero.  A glc pair is gdlt if there is a Zariski-open set
\(T^\circ\subset T\) on which \((T^\circ,B|_{T^\circ})\) is simple normal
crossing and the b-data descend, and which contains the general point of
every generalized log canonical center.  The carrier and subsequent log
resolutions may be chosen isomorphic on this open.  The zero-discrepancy
centers there are strata of the coefficient-one boundary.  These are the
conventions of \cite[Convention~9.1 and Definition~9.2]{KahlerAuxiliary}.

We explain the relation between this formulation and the actual divisors in
Theorem~\ref{thm:main}.  A \(\Q\)-Cartier divisor determines a rational
line bundle.  If \(mM_W\) is integral Cartier, then on the normal target
the reflexive sheaf
\[
 \bigl(p_*\mathcal O_W(mM_W)\bigr)^{**}
\]
agrees with the divisorial sheaf \(\mathcal O_T(mp_*M_W)\): the two agree
at every codimension-one point, where the modification is an isomorphism,
and normality gives uniqueness of the reflexive extension.  The same
comparison on a common higher model is compatible with pullback and with
transport across a small map.  The canonical trace is the canonical
sheaf of the target.  These facts are
\cite[Lemma~9.3(i)--(ii)]{KahlerAuxiliary}.  The natural meromorphic
comparisons therefore agree with the comparisons using the compatible
actual canonical representatives in \eqref{eq:discrepancy-definition}.
In every application below the b-line discrepancies are exactly the
discrepancies of that equation, and a crepant b-line identity is the
corresponding equality of actual rational divisors.  A common projective
carrier for any finite part of our birational constructions carries the
pullback of the original analytically nef divisor, which is relatively nef
over each base used in that part.  A single carrier dominating an infinite
sequence is not required.

Here is the elementary step used in the auxiliary programs.  Suppose that
the source \(T\) and the output \(T_1\) are strong normal compact K\"ahler
spaces, and write \(D_T\) and \(D_{T_1}\) for their rationally invertible
adjoints.  An \emph{elementary negative step} is either a projective
bimeromorphic divisorial contraction \(f:T\to T_1\) for which \(-D_T\)
is \(f\)-ample, or a diagram
\[
 T\xrightarrow{\ f\ }Z\xleftarrow{\ f^+\ }T_1
\]
of projective small bimeromorphic morphisms to a normal compact K\"ahler
space with \(-D_T\) \(f\)-ample and \(D_{T_1}\) \(f^+\)-ample.  The
degree functionals of the curves contracted on the negative side span one
nonzero ray when paired with global rational line bundles on \(T\).
In the small case the positive side is the relative Proj of the actual
adjoint algebra: after choosing a positive multiple of \(D_T\) represented
by a holomorphic line bundle \(\mathcal L\), it is
\[
 T_1=\Proj_Z\bigoplus_{m\geq0} f_*\mathcal L^{\otimes m}.
\]
The boundary is pushed forward in the divisorial case and strictly
transformed in the small case, and the same b-data are used on common higher
models.  With the compatible actual canonical representatives, a divisorial
step satisfies \(D_{T_1}=f_*D_T\).  If the step is \emph{over \(V\)}, all its maps commute with the
given maps to \(V\).  In the constructions used below the contraction maps
have connected fibers, and a small step has nonisomorphic morphisms on both
sides; the latter properties are also verified in
Section~\ref{sec:comparisons}.  This is the form of
\cite[Definition~9.6]{KahlerAuxiliary}.  Its one-ray condition concerns
degrees of global line bundles and imposes no condition on the relative
Bott--Chern dimension.  A diagram in Theorem~\ref{thm:main} need not be
elementary.

\begin{proposition}[Low places and projective realization]\label{prop:low-places}
Let \((T,B+\M)\) be gklt rational generalized data on a normal compact
K\"ahler space, with effective boundary of finite support and an absolutely
nef rational datum carried by a projective modification.  Fix a projective
log resolution carrying the datum.  There is \(\varepsilon>0\) such that
every global place satisfies
\[
 a(E;T,B+\M)\geq\varepsilon,
\]
and only finitely many places exceptional over \(T\) satisfy
\[
 a(E;T,B+\M)<1+\varepsilon.
\]
This finite set can be represented simultaneously by prime divisors on a
smooth model projective over \(T\).  In particular the exceptional places
of discrepancy at most one form a finite set with such a realization.
\end{proposition}

This is the rational nef specialization of
\cite[Lemma~4.2(i)]{KahlerAuxiliary}.  The positive number
\(\varepsilon\) belongs to this one pair; uniformity along a sequence will
follow from discrepancy monotonicity.

\begin{proposition}[Exact extraction]\label{prop:extraction}
Let \((T,B+\M)\) be rational gklt data on a strong normal compact
K\"ahler space, with an absolutely nef rational line bundle on a projective
carrier and rationally invertible adjoint.  For any specified finite set
\(\mathcal E\) of places exceptional over \(T\) with
\(a(E;T,B+\M)\leq1\), there is a projective bimeromorphic morphism
\(h:U\to T\) such that \(U\) is a strong normal compact K\"ahler space,
the \(h\)-exceptional prime divisors are exactly the members of
\(\mathcal E\), and the crepant generalized pair on \(U\) is gklt with
effective boundary.  Thus, writing this boundary as \(B_U\),
\[
 K_U+B_U+M_U=h^*(K_T+B+M_T).
\]
\end{proposition}

This is \cite[Proposition~9.11]{KahlerAuxiliary}.  Terminality is not part
of the extraction assertion.  It will follow when \(\mathcal E\) is chosen
to contain every exceptional place of discrepancy at most one.

\begin{proposition}[Relative programs]\label{prop:relative-program}
Let \(\pi:T\to V\) be a projective bimeromorphic morphism of normal compact
K\"ahler spaces.  Suppose that \(T\) is strong and that \((T,B+\M)\) is
rational gdlt, with effective boundary, a projective carrier on which the
rational line datum is nef over \(V\), and a rationally invertible adjoint
\(D_T\).
\begin{enumerate}
\item If \(D_T\) is not relatively nef over \(V\), there is an elementary
negative step over \(V\).  Its output is projective over \(V\), normal
compact K\"ahler and strong, and is gdlt with the transported boundary and
b-data.  The same construction is available after every finite prefix whose
last adjoint is not relatively nef over \(V\).
\item If the initial pair is gklt, there exists a finite, possibly empty,
sequence of elementary negative steps over this one fixed base \(V\) whose
last adjoint is relatively nef over \(V\).  Its models and transported data
have the properties in the first assertion.
\end{enumerate}
\end{proposition}

The two assertions are respectively
\cite[Propositions~9.7 and 9.9]{KahlerAuxiliary}.  The first is a
continuation assertion for gdlt data.  The second asserts the existence of
one finite run for gklt data; it does not assert termination of every choice
of a relative program.

\begin{proposition}[Crepant gdlt modification]\label{prop:gdlt-modification}
Let \((T,B+\M)\) be rational glc data of dimension at most four on a normal
compact K\"ahler space.  Assume that the higher absolutely nef rational
line datum is carried by a projective modification and that
\(K_T+B+M_T\) is rationally invertible.  There is a projective bimeromorphic
morphism \(h:Y\to T\) such that \(Y\) is a strong normal compact K\"ahler
space, \((Y,B_Y+\M)\) is gdlt with \(B_Y\geq0\), and
\[
 K_Y+B_Y+M_Y=h^*(K_T+B+M_T).
\]
Every \(h\)-exceptional prime has coefficient one in \(B_Y\), equivalently
has generalized log discrepancy zero over \((T,B+\M)\).
\end{proposition}

This is \cite[Proposition~11.4]{KahlerAuxiliary}.  The base \(T\) need not
be strong, and the assertion does not require that every zero-discrepancy
place be extracted.

\begin{theorem}[Special termination]\label{thm:special-termination}
Let \(d\leq4\), and let
\[
 (T_0,B_0+\M)\dashrightarrow(T_1,B_1+\M)
 \dashrightarrow(T_2,B_2+\M)\dashrightarrow\cdots
\]
be a sequence of elementary steps for rational gdlt data on strong normal
compact K\"ahler spaces of dimension \(d\).  The boundaries are transported
as in an elementary program, and the higher absolutely nef b-line datum is fixed and is
carried by projective modifications.  There is an index \(i_0\) such that,
for every \(i\geq i_0\), the exceptional loci on both sides of the step are
disjoint from every generalized log canonical center on their respective
sides.  The contraction bases in this sequence may vary.
\end{theorem}

This is \cite[Theorem~11.3]{KahlerAuxiliary}.  We use it for the elementary
sequences on strong models.  Full termination for four-dimensional gdlt
data will be deduced in Section~\ref{sec:completion}.

\paragraph{Scope of the auxiliary inputs.}
The results recalled above use the projective relative arguments in
\cite[Sections~9--11]{KahlerAuxiliary}, together with its low-place
calculation.  Relative continuation is Proposition~9.7 there; the finite
run over a fixed bimeromorphic base in Proposition~9.9 uses the local
finite-generation argument of Lemma~9.8, and exact extraction in
Proposition~9.11 uses that finite run.  The special-termination and gdlt
modification arguments in Section~11 form an induction on dimension,
using the threefold termination theorem of Section~10.  These proofs do
not invoke the canonical bundle formula or the absolute
supporting-contraction induction of Section~6.  Indeed, Section~6 uses
the threefold termination theorem as an input to its good-model
construction; the dependency is in that direction.  Thus the use of
\cite{KahlerAuxiliary} here does not require its absolute contraction or
minimal-model theorems.

The imports from \cite{CanonicalKahler} are likewise restricted to its
common-model construction (Proposition~2.1), analytic negativity
(Lemma~2.2), and terminal smoothness in codimension two (Lemma~2.3).
Its fourfold termination theorem is not an input.  All relative
constructions above retain their stated strong-factoriality hypotheses;
these are not additional hypotheses on the given sequence in
Theorem~\ref{thm:main}.

\section{Birational comparisons}
\label{sec:comparisons}

We compare the adjoints on the two sides of a small diagram and at the
ends of a finite relative program.  The comparisons locate exactly which
global places acquire larger discrepancies.  They also give a projective
morphism from a nef end to a prescribed ample model, with the nef adjoint
equal to the pullback of the ample adjoint.  We then record the homological
ranks that count contracted divisors and surfaces.
All divisor equalities in this section are equalities of actual rational
divisors, with the compatible canonical representatives and the fixed
b-divisor $\M$ of Section~\ref{sec:preliminaries}.

For a projective morphism, a rational Cartier divisor is called
\emph{relatively nef} here if it has nonnegative degree on every compact
irreducible curve contracted by the morphism.  We use the analytic
negativity lemma in the following precise form
\cite[Lemma~2.2]{CanonicalKahler}: if $r:V\to T$ is a projective
bimeromorphic morphism of normal complex spaces, $H$ is a
$\Q$-Cartier divisor on $V$, $-H$ is relatively nef, and $r_*H\geq0$,
then $H\geq0$.  Neither compactness nor a singularity hypothesis is
part of this input.  A divisor is \emph{exceptional over $T$} if every
prime in its support has image of codimension at least two in $T$.

We will also use two consequences of normality.  An effective
$\Q$-Cartier divisor pulls back effectively under a dominant morphism:
after clearing its index, a local meromorphic equation with no
divisorial poles is holomorphic on a normal space.  Such a divisor has
nonnegative degree on a compact curve not contained in its support,
by restricting its effective section to the normalization of the curve.

\subsection{Common models and the nef part}

The projectivity in the hypotheses permits all comparisons in a finite
part of the argument to be made on one compact K\"ahler resolution.
We give the construction for the diagrams used here; compare the
common-model construction of \cite[Proposition~2.1]{CanonicalKahler}.

\begin{lemma}[Common models with projective maps]\label{lem:common-projective-models}
Let a finite collection of normal irreducible compact K\"ahler spaces
be joined, with compatible bimeromorphic identifications, by finitely
many projective bimeromorphic morphisms and their inverses.  Suppose
that a fixed nef b-divisor is carried by a projective bimeromorphic
morphism $X'\to X$ to one of these spaces, with analytically nef
$\Q$-Cartier trace $M'$ on $X'$.  Then there is a
smooth compact K\"ahler space $W$ with compatible projective
bimeromorphic morphisms to every space in the collection and to $X'$.
The resolution may simultaneously principalize finitely many specified
generically nonzero coherent ideals and resolve finitely many specified divisors.  Its trace
$M_W$ is the pullback of $M'$ and is analytically nef.
\end{lemma}

\begin{proof}
For a diagram $T\to Z\leftarrow T^+$, take the reduced component of
$T\times_ZT^+$ containing the graph over the common isomorphism open.
Its projections are projective, and finite normalization preserves
projectivity.  Adjoin the remaining spaces and the carrier one at a
time by the same construction.  Resolving the resulting dominating
component gives a common smooth model.  Analytic resolution and
principalization allow the stated simultaneous choices by projective
modifications; see \cite[Theorems~1.6, 1.10 and 13.2(1)]{BierstoneMilman1997}.
Base change, restriction to a closed analytic subspace, finite
normalization, and composition preserve projectivity.  For composition
in the present compact setting, one can choose a uniform sufficiently
large twist of a relative ample bundle by the pullback of the next one.
This also proves compatibility with any finite chain of the small
diagrams and divisorial contractions considered below.

A smooth space projective over a compact K\"ahler space is compact
K\"ahler: a relative ample bundle supplies positivity in the fiber
directions, and adding a sufficiently large multiple of a pulled-back
K\"ahler form supplies positivity in all directions.  Finally, choose
K\"ahler classes on $X'$ converging to $c_1(M')$.  Their pullbacks to
$W$ have semipositive representatives.  Adding positive multiples
tending to zero of a fixed K\"ahler class on $W$ gives K\"ahler classes
converging to $c_1(M_W)$.  Thus $M_W$ is analytically nef.
\end{proof}

In particular, $M_W$ has nonnegative degree on every compact curve.
For an arbitrary global place, a further common proper model with a
model carrying that place suffices to compare coefficients.  This last
model need not be projective: projectivity is used to establish an
effective divisor on a common model, after which its pullbacks remain
effective on every higher proper model.

\begin{lemma}[Effective nef defect]\label{lem:nef-defect}
Let $T$ be a normal compact K\"ahler model, and let $r:W\to T$ be a
projective bimeromorphic morphism from a normal compact K\"ahler space
$W$ dominating the fixed projective carrier of $\M$.  Assume that
$M_T$ is $\Q$-Cartier.  Then
\begin{equation}\label{eq:nef-defect}
 J_{W/T}:=r^*M_T-M_W\geq0
\end{equation}
is an exceptional $\Q$-Cartier divisor over $T$.  If $s:W'\to W$ is
a higher normal model, then $J_{W'/T}=s^*J_{W/T}$.
\end{lemma}

\begin{proof}
The trace definition gives $r_*J_{W/T}=0$.  On an $r$-contracted curve,
$-J_{W/T}=M_W-r^*M_T$ has the same degree as $M_W$, hence has
nonnegative degree by projection formula from the nef carrier.
Analytic negativity gives $J_{W/T}\geq0$.
The final identity follows from functoriality of pullback and the fact
that the b-divisor descends on $W$.
\end{proof}

The next lemma explains why hypotheses stated for global generalized
places give the local ordinary singularity conditions needed later.
It is here that effectivity of the boundary and of the nef defect
enters the singularity comparison.  The global Weil and strong
$\Q$-factoriality conventions ensure the Cartier hypotheses below for
the respective models in the proof, since the divisor traces have
finite support.

\begin{lemma}[From global generalized discrepancies to local singularities]
\label{lem:ordinary-singularities}
Let $T$ be a normal compact K\"ahler space, let $B$ be an effective
rational divisor of finite support, and let $\M$ have analytically nef
rational data on a projective carrier.  Assume that $K_T$, $B$, and
$M_T$ are $\Q$-Cartier.
If every global generalized log discrepancy of $(T,B+\M)$ is
nonnegative, respectively positive, then the same condition holds for
local analytic places.  In the positive case, $T$ has ordinary klt
singularities locally.  If the global generalized discrepancies are
positive and every global place exceptional over $T$ has generalized
log discrepancy strictly greater than one,
then $T$ has ordinary terminal singularities locally.  In dimension
four the latter conclusion implies $\dim\Sing T\leq1$.
\end{lemma}

\begin{proof}
Choose a smooth log resolution $r:W\to T$, projective over $T$ and carrying $\M$,
with divisorial exceptional locus and simple normal crossing support
for all divisors in the crepant equation
\[
 K_W+\Delta_W+M_W=r^*(K_T+B+M_T).
\]
Such a simultaneous resolution is available by
Lemma~\ref{lem:common-projective-models}.  The assumed inequalities
give coefficients at most one, respectively strictly below one, for
every global prime of $\Delta_W$.  The same bounds hold on their local
branches.  On any further local model the nef part is pulled back from
$W$, so its generalized discrepancies are the ordinary discrepancies
of the simple normal crossing subpair $(W,\Delta_W)$.  The simple
normal crossing discrepancy criterion proves the asserted local
generalized inequalities, including when some coefficients of
$\Delta_W$ are negative.

Put $J=J_{W/T}$.  The ordinary crepant boundary for $(T,0)$ is
\begin{equation}\label{eq:ordinary-crepant-boundary}
 \Delta_W^{(0)}=\Delta_W-r^*B-J,
 \qquad K_W+\Delta_W^{(0)}=r^*K_T.
\end{equation}
Both $r^*B$ and $J$ are effective.  After resolving their joint support
as above, every coefficient of $\Delta_W^{(0)}$ is therefore strictly
below one in the positive case.  The same local simple normal crossing
criterion gives ordinary klt singularities.

For the terminal assertion, the relative canonical divisor is
exceptional, and at an exceptional prime $R$ of $W$ its coefficient is
\[
 \operatorname{coeff}_R(K_W-r^*K_T)
 =a(R;T,B+\M)-1+\operatorname{coeff}_R(r^*B+J)>0.
\]
These positive coefficients persist on every local branch.  A local
place exceptional over the smooth space $W$ has ordinary log
discrepancy at least two over $W$: the Jacobian determinant of a smooth
model carrying it has positive integral order along an exceptional
divisor.  Its discrepancy over $T$ adds the nonnegative order of
$K_W-r^*K_T$, and hence remains greater than one.  Local exceptional
places already represented by divisors on $W$ satisfy the displayed
strict inequality.  Thus $T$ is locally ordinary terminal.
For a normal complex fourfold with a rational canonical line bundle,
local ordinary terminality implies smoothness in codimension two by
\cite[Lemma~2.3]{CanonicalKahler}, giving the last assertion.
\end{proof}

For later calculations, the same equations give, for every global place
$E$ followed on a common higher model,
\begin{equation}\label{eq:generalized-ordinary-discrepancy}
 a(E;T,B+\M)
 =a(E;T,0)-\ord_E(r^*B)-\ord_E(J_{W/T}).
\end{equation}
The orders on the right mean coefficients after pullback to that model.
They are nonnegative under the hypotheses of
Lemma~\ref{lem:ordinary-singularities}.

\subsection{Small diagrams and finite programs}

We now locate the entire region in which a small step changes
discrepancies.  All exceptional loci and their images in this
subsection are given their reduced structures.  We use the graph method
of \cite[Lemma~2.1]{ProjectiveLCFourfolds} and prove the needed analytic
comparison, with the fixed b-divisor, below.

\begin{lemma}[Comparison for an arbitrary small diagram]
\label{lem:small-comparison}
Let
\[
 T\xrightarrow{\ f\ }Z\xleftarrow{\ f^+\ }T^+
\]
be a diagram of normal irreducible compact K\"ahler fourfolds in which
$f$ and $f^+$ are projective small bimeromorphic morphisms with
connected fibers, and both are nonisomorphisms.  Let $(T,B_T+\M)$ and
$(T^+,B_{T^+}+\M)$ have effective rational boundaries related by
strict transform and the same fixed rational b-divisor.  Transport the
canonical representatives by the identification of prime divisors,
and assume that the actual adjoints $D_T$ and $D_{T^+}$ are
$\Q$-Cartier, with $-D_T$ $f$-ample and $D_{T^+}$ $f^+$-ample.

The exceptional images of $f$ and $f^+$ are equal.  If their common
image is $A$, then
\begin{equation}\label{eq:small-loci}
 L:=\Exc(f)=f^{-1}(A),\qquad
 L^+:=\Exc(f^+)=(f^+)^{-1}(A),
\end{equation}
the complements are isomorphic, and
\begin{equation}\label{eq:small-dimensions}
 \dim L,\dim L^+\leq2,\qquad \dim A\leq1,
 \qquad \dim L+\dim L^+\geq3.
\end{equation}

Let $G$ be the normalization of the main graph, with projections
$p:G\to T$, $q:G\to T^+$ and $h=f\circ p=f^+\circ q$.  Then the
actual $\Q$-Cartier divisor
\begin{equation}\label{eq:small-divisor}
 F:=p^*D_T-q^*D_{T^+}
\end{equation}
is effective and exceptional over both $T$ and $T^+$, and
\begin{equation}\label{eq:small-support}
 \Supp F=h^{-1}(A).
\end{equation}
Moreover, $F\cdot C<0$ for every irreducible curve $C$ contracted by $h$.

For every global place $E$ over these spaces, let $\ord_E(F)$ denote
the coefficient of the pullback of $F$ on any higher proper model
dominating $G$ and carrying $E$.  Then
\begin{equation}\label{eq:small-discrepancies}
 a(E;T^+,B_{T^+}+\M)-a(E;T,B_T+\M)=\ord_E(F)\geq0.
\end{equation}
The inequality is strict exactly when $\cent_T(E)\subset L$, and this
condition is equivalent to $\cent_{T^+}(E)\subset L^+$.  A place is
exceptional over $T$ if and only if it is exceptional over $T^+$.
\end{lemma}

\begin{proof}
We first recall the fiber description for a proper bimeromorphic
morphism $v:V\to S$ of normal spaces.  Its positive-dimensional-fiber
locus is closed analytic.  Over its complement the map is finite
locally on $S$, hence an isomorphism by normality.  Stein factorization
shows that every fiber is connected, because its finite bimeromorphic
factor over the normal space $S$ is an isomorphism.  A reduced compact
connected positive-dimensional fiber has no zero-dimensional
irreducible component: such a component would be a singleton disjoint
from the finitely many other closed components.  Hence no point in
such a fiber is a local isomorphism point.  The exceptional locus of
$v$ is exactly the full inverse image of its positive-dimensional-fiber
locus.

Let $U\subset Z$ be the open set over which $f$ is an isomorphism.
On $U$, $D_T$ defines a $\Q$-Cartier divisor $D_U$.  The actual Weil
coefficients of the two adjoints agree under the identification of
prime divisors.  Since $f^+$ is small, it follows that
$D_{T^+}|_{(f^+)^{-1}U}=(f^+)^*D_U$.  A positive-dimensional projective
fiber over $U$ would contain a curve on which this divisor has degree
zero, contrary to $f^+$-ampleness.  Thus $f^+$ is an isomorphism over
$U$.  Interchanging the two sides and using $f$-ampleness of $-D_T$
gives the reverse inclusion of the isomorphism opens.  This proves
the equality of exceptional images and \eqref{eq:small-loci}.
Smallness gives $\dim L,\dim L^+\leq2$.  Over a general point of each
component of $A$ the fiber has dimension at least one, so the
fiber-dimension theorem gives $\dim A\leq1$.

The graph projections are projective and surjective, and the map from
$G$ to its component in $T\times_ZT^+$ is finite.  A prime divisor of
either side maps to a prime divisor of $Z$ by smallness.  On the graph
it therefore corresponds to the same prime place on the other side,
with the same adjoint coefficient.  Consequently $p_*F=q_*F=0$.
On a $p$-contracted curve, $-F$ has the degree of $q^*D_{T^+}$, which
is nonnegative.  Analytic negativity gives $F\geq0$.

For a curve $C$ contracted by $h$, the projection formula and the two
ample signs give
\[
 -F\cdot C=(-D_T)\cdot p_*C+D_{T^+}\cdot q_*C>0.
\]
Here an image that is a point contributes zero.  At least one image is
a curve, because the finite map to the fiber product cannot contract
$C$ to a point.  Thus at least one summand is strictly positive.

The support of $F$ is contained in $h^{-1}(A)$, since both projections
identify the common isomorphism open and the adjoints agree there.
Conversely, take $x\in h^{-1}(A)$ and write $z=h(x)$.  The map
$h:G\to Z$ is proper bimeromorphic, so its fiber over $z$ is connected.
It is projective and positive-dimensional: its projection to the
positive-dimensional fiber $f^{-1}(z)$ is surjective.  The fiber
description above places $x$ on a positive-dimensional irreducible
component.  Successive projective hyperplane cuts through $x$ give an
irreducible curve $C$ in that fiber through $x$.  If $x$ were outside
$\Supp F$, then $C$ would not be contained in the effective
$\Q$-Cartier divisor $F$, so $F\cdot C\geq0$.  The preceding strict
inequality excludes this.  Hence \eqref{eq:small-support} holds.

Follow a global place $E$ on a common proper model dominating $G$ and
the nef carrier.  Subtracting its two crepant equations cancels the
same trace of $\M$ and gives \eqref{eq:small-discrepancies}.  The order
of an effective $\Q$-Cartier divisor is positive precisely when the
center of the place is contained in its support.  Proper images of
centers give
\[
 \cent_Z(E)=f(\cent_T(E))=f^+(\cent_{T^+}(E))=h(\cent_G(E)).
\]
Together with \eqref{eq:small-loci} and \eqref{eq:small-support}, this
proves both center equivalence and the stated exact strictness
criterion.  If the centers are not contained in these loci, their
general points correspond on the common open and the order is zero.
Finally, a place centered at a divisor on a normal model is that
divisorial place.  Smallness identifies these prime divisors on the
two sides, proving equivalence of exceptionality.

Since both morphisms are nonisomorphisms, $A$ is nonempty, so $F$ has
a prime divisor $R$ in its support.  The graph is a fourfold, hence
$\dim R=3$.  Its finite map to the graph component has image in
$L\times_ZL^+$, whence
\[
 3\leq\dim(L\times_ZL^+)\leq\dim L+\dim L^+.
\]
This is the remaining inequality in \eqref{eq:small-dimensions}.
\end{proof}

The discrepancy statement preserves generalized lc and generalized
klt inequalities along a small step.  It also preserves generalized
terminality, because the same places are exceptional on both sides.
The isomorphism-open argument did not use nontriviality.  In the normal
irreducible compact K\"ahler fourfold setting of
Lemma~\ref{lem:small-comparison}, if an elementary small step is initially specified by a nonisomorphic
negative contraction, a small positive morphism, and the stated Cartier
and ample hypotheses, that argument forces the positive morphism to be
nonisomorphic as well.  Its fibers are connected by normality and Stein
factorization, so Lemma~\ref{lem:small-comparison} applies.
For a finite program we need, in addition, to retain the location of
the accumulated correction at its end.

\begin{lemma}[Comparison along a finite negative program]
\label{lem:program-comparison}
Let $Y_0\dashrightarrow\cdots\dashrightarrow Y_m$, with $m\geq0$, be
a finite sequence of normal irreducible compact K\"ahler fourfolds with
$\Q$-Cartier adjoints $D_j=K_{Y_j}+B_j+M_{Y_j}$.  Suppose the effective
rational boundaries are transported by pushforward, the canonical
representatives are compatible, and the same b-divisor with a projective
carrier is used throughout.  Assume
each step is either a small diagram satisfying
Lemma~\ref{lem:small-comparison}, or a projective bimeromorphic
divisorial contraction $v_j:Y_j\to Y_{j+1}$ such that
$D_{j+1}=(v_j)_*D_j$ and $-D_j$ is $v_j$-ample.  These steps extract
no prime divisors.  On a smooth common model $W$ with projective maps
to every $Y_j$ and to the carrier, write $r_j:W\to Y_j$.  Then
\begin{equation}\label{eq:program-comparison}
 r_0^*D_0-r_m^*D_m=E,\qquad E\geq0,\qquad (r_m)_*E=0.
\end{equation}
Every global discrepancy is nondecreasing along the run.  If a prime
divisor is contracted in a divisorial step, its discrepancy increases
strictly at that step, and its discrepancy at the end is strictly
larger than before that step.
\end{lemma}

\begin{proof}
For a divisorial step put
$E_j=D_j-v_j^*D_{j+1}$.  It is exceptional over $Y_{j+1}$ and has
strictly negative degree on every $v_j$-contracted curve.  Negativity
gives $E_j\geq0$.  Every point of an exceptional fiber lies on a curve
in that fiber, by the connected projective fiber argument in the proof
of Lemma~\ref{lem:small-comparison}.  The negative degree therefore
forces that point into $\Supp E_j$.  In particular the coefficient of
$E_j$ at each contracted prime is positive.  Subtracting crepant
equations gives nondecreasing discrepancies and this strict increase.
For a small step the same assertions, with an effective correction
exceptional over its output, follow from
Lemma~\ref{lem:small-comparison}.

Pull the corrections of all steps to $W$ and add them.  This gives the
effective divisor in \eqref{eq:program-comparison}.  Each prime in a
summand is exceptional over that step's output, and remains exceptional
over every later output.  Indeed, if that place became a prime divisor
on a later normal model, that prime would have a strict-transform prime
on each earlier model, since none of the intervening steps extracts divisors.
This contradicts its earlier exceptionality.  Thus the sum is
exceptional over $Y_m$.  Its nonnegative coefficients also show that
a strict increase from a contracted prime cannot be canceled later.
For $m=0$ the correction is zero and the assertions are immediate.
\end{proof}

\subsection{A nef end and a prescribed ample model}

An effective correction exceptional over the end is the form needed to
compare a finite program with a prescribed positive side of a diagram.
The next argument uses the effective-pushforward form of negativity,
since the two corrections need not have the same exceptional primes;
compare \cite[Lemma~2.5]{ProjectiveLCFourfolds} in the projective setting.

\begin{lemma}[Nef and ample models]\label{lem:nef-ample}
Let $Y_0$, $Y$, and $T_+$ be normal irreducible compact K\"ahler spaces
with projective bimeromorphic morphisms to a normal compact K\"ahler
space $S$.  On a smooth common model $W$ over $S$, projective over these
spaces, let $P_0$, $P$, and $P_+$ be the pullbacks of respective
$\Q$-Cartier divisors $D_0$, $D_Y$, and $D_+$.  Suppose that
\[
 P_0=P+E_Y=P_++E_+,
\]
where $E_Y\geq0$ is exceptional over $Y$ and $E_+\geq0$ is exceptional
over $T_+$.  If $D_Y$ is nef over $S$ and $D_+$ is ample over $S$,
then $P=P_+$ as actual divisors.  The induced bimeromorphic map is a
projective morphism $\varphi:Y\to T_+$ over $S$, and
$D_Y=\varphi^*D_+$.
\end{lemma}

\begin{proof}
Write $r:W\to Y$ and $t:W\to T_+$, and put
$H=P-P_+=E_+-E_Y$.  Then $r_*H=r_*E_+\geq0$.  On an $r$-contracted
curve, $-H$ has the degree of $P_+$, which is nonnegative because
the curve lies over a point of $S$.  Negativity gives $H\geq0$.
Likewise $t_*(-H)=t_*E_Y\geq0$, while $H$ is $t$-nef because $P$ comes
from an $S$-nef divisor.  Negativity applied to $-H$ gives $H\leq0$.
Thus $P=P_+$.

For a curve $C$ in an $r$-fiber, equality gives
$t^*D_+\cdot C=P\cdot C=0$.  The image $t(C)$ lies in an $S$-fiber,
where $D_+$ is ample, so $t(C)$ is a point.  Every $r$-fiber is
projective and connected.  If an irreducible component of one such
fiber had positive-dimensional image under $t$, a curve in that
projective image and projective hyperplane cuts of its inverse image
would supply a curve on which $t$ is nonconstant.  Thus each component
maps to a point, and connectedness makes those points equal.  The map
$t$ is constant on every $r$-fiber.

The reduced image of $(r,t):W\to Y\times_ST_+$ is a proper analytic
graph with one-point fibers over $Y$.  Its projection to $Y$ is
therefore finite and bimeromorphic, hence an isomorphism by normality
of $Y$.  This gives the morphism $\varphi$.  Its graph is a closed
subspace of $Y\times_ST_+$, whose projection to $T_+$ is projective
by base change from $Y\to S$; hence $\varphi$ is projective.  Finally,
pushing the equality $P=P_+$ to $Y$ gives
$D_Y=\varphi^*D_+$ as actual divisors.
\end{proof}

\subsection{Ranks of analytic cycle classes}

The small-diagram comparison forces a surface on at least one side of
every step.  The following ranks count the steps after the positive
side has no exceptional surface.  They also count divisorial steps in
the auxiliary programs.  Their role is the analytic counterpart of the
surface-cycle rank in the terminal fourfold argument of
\cite[Theorem~5-1-15 and Lemma~5-1-17]{KawamataMatsudaMatsuki1987}.

For a compact complex analytic space $V$ and an integer $k\geq0$, put
\[
 \begin{split}
 \mathcal C_k(V)&=\operatorname{span}_{\Q}
 \{[Q]\in H_{2k}(V,\Q):
       Q\subset V\text{ irreducible compact analytic},\ \dim Q=k\},\\
 c_k(V)&=\dim_{\Q}\mathcal C_k(V).
 \end{split}
\]
Fundamental classes use the complex orientation of the regular loci.
Finite compatible triangulations of compact analytic spaces make these
ranks finite.  If $V$ is compact K\"ahler, the class of every such $Q$
is nonzero, including when $V$ or $Q$ is singular: for a K\"ahler form
$\omega$,
\[
 \langle[\omega]^k,[Q]\rangle=\int_{Q_{\mathrm{reg}}}\omega^k>0.
\]
The same observation applies to a closed analytic subspace of a
compact K\"ahler space.  We use ordinary homology on compact spaces
and Borel--Moore homology on open complements.

\begin{lemma}[Loss of analytic cycle classes]\label{lem:cycle-loss}
Let $k\geq0$ be an integer, and let $X\dashrightarrow Y$ be a
bimeromorphic transformation of compact K\"ahler spaces represented by
a proper bimeromorphic diagram.
Suppose it identifies
\[
 U=X\setminus A\simeq Y\setminus B,
\]
where $A$ and $B$ are closed analytic subspaces and $\dim B<k$.
Then restriction to $U$ and strict transform induce a surjection
$\mathcal C_k(X)\to\mathcal C_k(Y)$.  Consequently
$c_k(X)\geq c_k(Y)$, with strict inequality if $A$ contains an
irreducible compact analytic subspace of dimension $k$.

In a sequence of bimeromorphic transformations of normal irreducible $n$-dimensional
compact K\"ahler spaces which extract no prime divisors, only finitely
many transformations can contract a prime divisor; a small
transformation preserves $c_{n-1}$.  In particular, for a small
fourfold diagram of Lemma~\ref{lem:small-comparison}, if $\dim L^+<2$,
then $c_2(T)\geq c_2(T^+)$, strictly if $L$ contains a surface.
\end{lemma}

\begin{proof}
This is the rational-coefficient version of
\cite[Lemma~4.1]{KahlerAuxiliary}; we include its localization argument.
The Borel--Moore localization sequence for $B\subset Y$ contains
\[
 H_{2k}(B,\Q)\longrightarrow H_{2k}(Y,\Q)
 \longrightarrow H_{2k}^{\BM}(U,\Q)
 \longrightarrow H_{2k-1}(B,\Q).
\]
The outside groups vanish by $\dim B<k$ and the real dimension bound
for an analytic triangulation.  Thus restriction from $Y$ is an
isomorphism in degree $2k$.  Compose restriction from $X$ with its
inverse.  An irreducible compact analytic $k$-cycle meeting $U$ is
sent to its strict transform on $Y$; analyticity of that transform
follows by proper mapping through the given diagram.  A cycle
contained in $A$ is sent to zero.  Conversely, no $k$-cycle of $Y$ is
contained in $B$, and its strict transform on $X$ maps to its class.
This proves the surjection on cycle spans.  If $A$ contains a
$k$-dimensional irreducible analytic subspace, its nonzero class is in
the kernel, giving strict inequality.

For a transformation that extracts no prime divisors, choose the
common isomorphism open with target complement of codimension at least
two.  Every contracted source prime lies in the source complement.
The preceding result with $k=n-1$ gives a strict drop at each such
contraction.  The ranks are nonnegative integers, so there can be
only finitely many drops.  For a small transformation both complements
have codimension at least two, and applying the result in both
directions gives equality.  Finally, \eqref{eq:small-loci} gives the
common open for a small fourfold diagram.  Applying the first assertion
with $k=2$, $A=L$ and $B=L^+$ proves the last claim.
\end{proof}

\section{Terminal junctions and surface centers}\label{sec:junctions}

We now work with a sequence of small diagrams on strong models, and
assume that its initial generalized pair is
generalized klt.  The purpose of this section is to replace the models in
the sequence by crepant generalized terminal models.  Consecutive terminal
models will be joined by a decrease of boundary coefficients followed by a
finite sequence of small elementary steps.  We then show that, after
discarding finitely many diagrams, every coefficient that still changes
belongs to a divisor contracted to a curve or a point.  The terminal-junction
construction follows the method of
\cite[Section~3, Proposition~3.4]{ProjectiveLCFourfolds}; the surface
calculation below supplies the control of coefficient variation needed in
the present analytic setting.

Throughout this section, write the diagrams as
\[
 X_i\xrightarrow{f_i}Z_i\xleftarrow{f_i^+}X_{i+1},
 \qquad D_i=K_{X_i}+B_i+M_{X_i},
\]
and put $a_i(E)=a(E;X_i,B_i+\M)$ for a global place $E$.  We retain all
the hypotheses on the diagrams and on the fixed nef b-divisor from
Theorem~\ref{thm:main}.  In addition, each $X_i$ is strong and
$(X_0,B_0+\M)$ is generalized klt.  The exceptional
loci of $f_i$ and $f_i^+$ are denoted by $L_i$ and $L_i^+$, respectively.
Here the initial boundary and higher nef datum belong to the particular
strong generalized klt sequence under study; a later application may use
the data of a tail obtained after removing a boundary floor.

\begin{proposition}[Crepant terminal junctions]\label{prop:terminal-junctions}
Suppose that the sequence above is infinite.  After passing to a tail,
there are a number $\varepsilon>0$ and a finite set $\mathcal I$ of global
places such that, at every remaining index $i$,
\begin{equation}\label{eq:stable-low-places}
 \begin{gathered}
 a_i(E)\geq\varepsilon\quad\text{for every global place }E,
 \\
 \mathcal I=
 \{E:E\text{ is exceptional over }X_i,\ a_i(E)\leq 1\}.
 \end{gathered}
\end{equation}
There are projective bimeromorphic crepant morphisms
\begin{equation}\label{eq:terminal-junction}
 \begin{gathered}
 h_i:(Y_i,\Theta_i+\M)\longrightarrow (X_i,B_i+\M),
 \\
 K_{Y_i}+\Theta_i+M_{Y_i}=h_i^*D_i,
 \end{gathered}
\end{equation}
with the following properties.
\begin{enumerate}
\item Each $Y_i$ is a strong normal irreducible compact K\"ahler fourfold,
$\Theta_i$ is effective, and
$(Y_i,\Theta_i+\M)$ is generalized terminal.  The exceptional prime
divisors of $h_i$ represent exactly the places in $\mathcal I$.
\item For $E\in\mathcal I$, let $S_{i,E}$ be its prime on $Y_i$.  Define
\begin{equation}\label{eq:junction-coefficient-change}
 \Theta_i'=
 \Theta_i-\sum_{E\in\mathcal I}
       \bigl(a_{i+1}(E)-a_i(E)\bigr)S_{i,E}.
\end{equation}
Starting with $(Y_i,\Theta_i'+\M)$, a finite, possibly empty, sequence
of small elementary steps over $Z_i$ ends at
$(Y_{i+1},\Theta_{i+1}+\M)$.  All its models are strong normal irreducible
compact K\"ahler fourfolds, all its pairs are generalized
terminal, and its boundary and nef data are transported as in an elementary
program.  In particular, every global place is exceptional over one model
of this connecting sequence if and only if it is exceptional over all of
them.
\item There is one finite label set $\mathcal H$ for the primes supplied by
$\mathcal I$ and by the components of $B_0$.  Write $S_h$ for the current
strict transform of a label and $b_h$ for its current coefficient.  Labels
are retained when their coefficient is zero.  On the entire chain of
coefficient changes and small steps,
\[
                    \Theta=\sum_{h\in\mathcal H}b_hS_h,
                    \qquad 0\leq b_h<1,
\]
and every $b_h$ is nonincreasing.  Call a label \emph{varying} if its
coefficient sequence is not eventually constant, and \emph{fixed}
otherwise.  After a further tail is chosen, all fixed coefficients are
constant.  Every varying label comes from $\mathcal I$ and has positive
coefficient at every remaining stage.
\end{enumerate}
\end{proposition}

Figure~\ref{fig:terminal-bridge} records the two kinds of change between
crepant junctions.  The difficulty in Section~\ref{sec:difficulty} will
be compared across both upper moves.
\begin{figure}[ht]
\centering
\begin{tikzcd}[column sep=3.2cm,row sep=large]
 (Y_i,\Theta_i) \arrow[r,Rightarrow,"\Theta_i'\leq\Theta_i"]
   \arrow[d,"h_i"'] &
 (Y_i,\Theta_i') \arrow[r,dashed,"\text{finite small program}"] &
 (Y_{i+1},\Theta_{i+1}) \arrow[d,"h_{i+1}"] \\
 X_i \arrow[r,"f_i"'] & Z_i & X_{i+1}\arrow[l,"f_i^+"]
\end{tikzcd}
\caption{The bridge for one downstairs flip.  The first upper arrow changes
the boundary on the same space; it is not a morphism.  The second denotes a
finite, possibly empty, sequence of small elementary steps over $Z_i$.
The two vertical maps are crepant for the displayed endpoint boundaries,
and the b-divisor $\M$ is fixed throughout.}
\label{fig:terminal-bridge}
\end{figure}

\begin{proof}
By Lemma~\ref{lem:small-comparison}, discrepancies do not decrease, and a
place is exceptional over $X_i$ exactly when it is exceptional over
$X_{i+1}$.  Consequently the sets
\[
 \mathcal I_i=\{E:E\text{ is exceptional over }X_i,\ a_i(E)\leq1\}
\]
form a decreasing sequence.  Proposition~\ref{prop:low-places} makes the
first of them finite and gives a positive lower bound for all initial
discrepancies.  Monotonicity preserves that bound.  A decreasing sequence
of subsets of a finite set stabilizes, which gives
\eqref{eq:stable-low-places}.  We reindex this tail.

If $\mathcal I$ is empty, take the identity as the first junction.
Otherwise apply Proposition~\ref{prop:extraction} at the first index to
extract exactly $\mathcal I$.  Its hypotheses hold: the model is strong,
the pair is generalized klt with rational effective boundary, and the
fixed nef data are carried on a higher model projective over $X_i$.
The resulting morphism is projective bimeromorphic and has a strong normal
irreducible compact K\"ahler source.  Crepancy gives the coefficient
$1-a_i(E)\in[0,1-\varepsilon]$ on an extracted prime; all other boundary
components are strict transforms of $B_i$.  Thus the crepant boundary is
effective.  Notice that a place with $a_i(E)=1$ is extracted with coefficient
zero.

Any place exceptional over this source is exceptional over $X_i$: a prime
on $X_i$ has a strict transform on every proper birational model.  Such a
place is not one of the extracted primes, so its discrepancy is strictly
greater than $1$ by \eqref{eq:stable-low-places}.  Crepancy and the positive
lower bound prove generalized terminality.  This constructs the first
junction.

Suppose the junction over $X_i$ has been constructed.  The coefficient of
$S_{i,E}$ changes in \eqref{eq:junction-coefficient-change} from
$1-a_i(E)$ to $1-a_{i+1}(E)$.  Both are nonnegative because $E$ belongs to
the stabilized set at both indices, and the latter is no larger than the
former.  The divisor subtracted from $\Theta_i$ is effective and
$\Q$-Cartier on the strong model $Y_i$.  Its pullback to a higher model is
effective; hence subtracting it only increases discrepancies.  In
particular, $\Theta_i'$ remains effective and
$(Y_i,\Theta_i'+\M)$ remains generalized terminal.  Set
\[
                    D_i'=K_{Y_i}+\Theta_i'+M_{Y_i}.
\]

We first compare this adjoint with the positive model downstairs.  By
Lemma~\ref{lem:common-projective-models}, choose a smooth common
model $W$, carrying $\M$, with projective maps
$q:W\to Y_i$ and $r:W\to X_{i+1}$, all over $Z_i$, and put
\begin{equation}\label{eq:junction-positive-comparison}
                         F=q^*D_i'-r^*D_{i+1}.
\end{equation}
The coefficient change makes $q_*F=0$.  Indeed, at a prime $S_{i,E}$ with
$E\in\mathcal I$, the coefficient of the crepant boundary computed from
$X_{i+1}$ is $1-a_{i+1}(E)$, the new coefficient in $\Theta_i'$.
Every other prime on $Y_i$ corresponds, by smallness downstairs, to a
prime on $X_{i+1}$ and has its transported boundary coefficient.  The
canonical representatives and the trace of the same b-divisor agree in
this calculation.  On a curve contracted by $q$, the divisor $-F$ has
nonnegative degree: $q^*D_i'$ has degree zero and $r^*D_{i+1}$ is pulled
back from the $f_i^+$-ample divisor $D_{i+1}$.  The negativity
lemma therefore gives $F\geq0$.  Moreover every prime on $X_{i+1}$ is
represented on $Y_i$, where the coefficient of $F$ is zero.  Thus $F$ is
exceptional over $X_{i+1}$.

Use the finite generalized klt part of
Proposition~\ref{prop:relative-program} for $D_i'$ over $Z_i$.  The map
$Y_i\to Z_i$ is projective bimeromorphic to a normal compact K\"ahler
base, the source is strong and generalized klt, and a common higher model
projective over $Y_i$ carries the fixed data with the
required relative nefness.  The proposition supplies a finite elementary
program ending at a model $\overline Y$ whose adjoint $\overline D$ is nef
over $Z_i$.  On a further common model, write again $q$ for the map to
$Y_i$ and $\bar q$ for the map to $\overline Y$.
Lemma~\ref{lem:program-comparison} gives
\[
              q^*D_i'=\bar q^*\overline D+G,
              \qquad G\geq0\text{ exceptional over }\overline Y.
\]
Together with \eqref{eq:junction-positive-comparison}, these are the two
effective comparisons required by Lemma~\ref{lem:nef-ample}.  That lemma
gives a projective morphism $h_{i+1}:\overline Y\to X_{i+1}$ and the
actual crepant identity $\overline D=h_{i+1}^*D_{i+1}$.

This program cannot have lost a marked prime $S_{i,E}$.  Its discrepancy
immediately after the coefficient change is $a_{i+1}(E)$; by the crepant
identity its discrepancy at the end is again $a_{i+1}(E)$.  If a divisorial
step had contracted it, the strict comparison for that step would have
increased this discrepancy, and subsequent comparisons could not decrease
it.  Nor can the program have lost any other prime on $Y_i$.  Such a prime
corresponds to a prime on $X_{i+1}$, and that prime must have a strict
transform on $\overline Y$.  An elementary program extracts no prime, so a
prime once contracted cannot reappear.  We have excluded every divisorial
step.  All connecting steps are therefore small, and their discrepancy
comparisons preserve generalized terminality.  They also preserve the
exceptionality status of every place.  Smallness downstairs keeps each
marked place exceptional over $X_{i+1}$, whereas every other surviving
prime corresponds to a prime on $X_{i+1}$.  Thus the surviving marked
primes are exactly the exceptional primes of $h_{i+1}$, and the end is the
required junction $Y_{i+1}$.  This proves the construction by induction.  The
relative program is allowed to have length zero.

There are finitely many marked primes and finitely many components of
$B_0$.  Smallness transports all of them through every connector.  The
downstairs coefficients are constant, and the marked coefficients are
$1-a_i(E)$ at junctions and are changed only by
\eqref{eq:junction-coefficient-change}.  They are therefore nonincreasing
and lie in $[0,1)$.  For the finitely many coefficient sequences that are
eventually constant, discard a prefix after all have become constant.
Every other sequence stays positive: a nonnegative nonincreasing sequence
that reaches zero is thereafter zero.  Only marked coefficients can be of
this latter type.  This proves the last assertion.
\end{proof}

All the terminal models just constructed are also ordinarily terminal by
Lemma~\ref{lem:ordinary-singularities}.  In particular they are smooth in
codimension two.  To control marked coefficients above a surface, we need
no bound on the number of exceptional curves in a transverse slice.
Grouping the curves by their global marked labels will give a linear
system with at most $|\mathcal I|$ unknowns and an integer matrix whose
columns are linearly independent.  We will bound its entries and clear one denominator for
its right-hand side; a nonsingular minor then gives a uniform lattice for
the marked coefficients.

\begin{proposition}[Finiteness above marked surfaces]\label{prop:surface-finiteness}
In the setting of Proposition~\ref{prop:terminal-junctions}, there is a
finite set
\[
                    \mathcal A_{\mathrm{surf}}
                    \subset [\varepsilon,1]\cap\Q
\]
such that $a_i(E)\in\mathcal A_{\mathrm{surf}}$ whenever
$E\in\mathcal I$ and $\cent_{X_i}(E)$ is a surface.  After passing to a
further tail, the following conclusions hold.
\begin{enumerate}
\item No $E\in\mathcal I$ has a surface center contained in $L_i$ on
$X_i$, or a surface center contained in $L_i^+$ on $X_{i+1}$.
\item Every varying label $S_h\subset Y_i$ satisfies
$\dim h_i(S_h)\leq1$ at every junction.
\item For an irreducible compact analytic surface contained in either $L_i$
or $L_i^+$, the corresponding
junction morphism is an isomorphism near its general point, and the
downstairs model is smooth there.  Blowing up the coherent ideal of that
surface defines a unique global generic blowup place.  It is exceptional
over the corresponding downstairs model and has discrepancy strictly
greater than $1$; in particular it does not belong to $\mathcal I$.
\end{enumerate}
\end{proposition}

\begin{proof}
We first prove the assertion about $\mathcal A_{\mathrm{surf}}$.  If
$\mathcal I$ is empty, choose $\mathcal A_{\mathrm{surf}}=\varnothing$.
For the remaining case, fix a junction $\rho:Y\to X$ and a surface
$V\subset X$ which is the center of at least one marked prime.  We work
near general points of $V$.

\medskip\noindent\emph{A transverse surface and its curves.}
The exceptional image of a proper birational morphism to normal $X$ has
codimension at least two.  We may avoid every other component of that
image and every center properly contained in $V$.  The full inverse image
of $V$ is a proper analytic subset of the irreducible fourfold $Y$, hence
has dimension at most three.  A component supplying a curve over a general
point of $V$ must therefore have dimension three and be a divisor
dominating $V$.  All such divisors are marked.  Components of dimension
at most two cannot supply a curve in a general fiber.  These observations
also show that the general fibers over $V$ have dimension at most one.

The singular locus of terminal $Y$ has dimension at most one, so it misses
the fiber over a general point of $V$.  The singular loci of the marked
divisors, their pairwise intersections, and their intersections with
strict transforms of components of $B_0$ have dimension at most two.
Choose also a projective carrier $\sigma:W\to Y$ for the fixed nef data,
with $W$ smooth.  Its nonisomorphism image has dimension at most two.  None of
these subsets can contain an entire curve over a general point of $V$:
a component that dominates the surface has zero-dimensional general
fiber, and components with smaller image can be avoided.

Here is a precise choice of the slice used below.  Near a general smooth
point of $V$, lift two local coordinates on $V$ to holomorphic functions
on $X$.  Take a general common level set of their pullbacks on $Y$.
Finite analytic stratifications near the proper fiber can be chosen to
respect the divisors and the subsets in the preceding paragraph.  On
every stratum dominating $V$, generic smoothness makes the two pulled-back
functions submersive over general values; the images of all other strata
can be avoided.  It follows, after shrinking about the fiber, that the
level set is a smooth surface $R$.  The restriction of $K_Y$ to $R$ is
$K_R$, because the two slice equations trivialize its normal bundle.

Let $C_1,\ldots,C_q$ be the reduced irreducible curves of the fiber in
$R$.  Each is supplied by exactly one marked divisor, with multiplicity
one in that divisor's slice: at a general point of the curve the divisor
is smooth, the slice is transverse on it, and none of the other listed
subsets contains that curve.  Write $\lambda(j)$ for its label.  The same
label may supply several curves, but each marked divisor with center $V$
supplies at least one.  No $C_j$ is contained in a strict downstairs
boundary component or in the nonisomorphism image of $\sigma$.

The restricted map on the slice is proper near this fiber, contracts the
$C_j$ to a point, and is an isomorphism off that point locally.  No
surface component is mapped to the point, by the fiber dimension bound.
Pass, if necessary, to the normal Stein factor of the local target, or
equivalently to the normalization of the relevant local image.  We then
have a proper modification from the smooth surface whose reduced
exceptional set is the union of these curves.  Grauert's
negative-definiteness criterion
\cite[Section~4, no.~8(e), pp.~366--367]{Grauert1962} therefore applies:
the matrix
\[
                       A=(C_j\cdot C_k)_{1\leq j,k\leq q}
\]
is negative definite.  Put $u_j=-C_j^2\in\Z_{>0}$ and
$m_{jk}=C_j\cdot C_k\in\Z_{\geq0}$ for $j\ne k$.

\medskip\noindent\emph{Uniform bounds for the intersection equations.}
Let $B_Y^{\mathrm{str}}$ denote the strict boundary part coming from
$B_i$.  It has nonnegative intersection with every $C_j$, since it is
effective and contains no such curve.  The same nonnegativity holds for
$M_Y$.  Indeed, the strict transform $C_j'$ on $W$ meets the isomorphism
locus of $\sigma$.  For the effective nef defect of
Lemma~\ref{lem:nef-defect},
\[
                         J=\sigma^*M_Y-M_W\geq0,
\]
the curve $C_j'$ is not contained in $\Supp J$.  The projection formula,
nefness on the carrier, and effectivity then give
\[
                 M_Y\cdot C_j=M_W\cdot C_j'+J\cdot C_j'\geq0.
\]
Intersect the crepant equation
$K_Y+\Theta+M_Y=\rho^*D_X$ with $C_j$.  On $R$ the marked part near the
fiber is $\sum_k b_{\lambda(k)}C_k$.  Adjunction for the reduced
irreducible compact curve $C_j$ gives
$K_R\cdot C_j=2p_a(C_j)-2+u_j$.  We obtain
\begin{align*}
 0={}&2p_a(C_j)-2+(1-b_{\lambda(j)})u_j
       +\sum_{k\ne j}b_{\lambda(k)}m_{jk}
       +(B_Y^{\mathrm{str}}+M_Y)\cdot C_j\\
 \geq{}&2p_a(C_j)-2+(1-b_{\lambda(j)})u_j.
\end{align*}
Since $p_a(C_j)\geq0$ and
$1-b_{\lambda(j)}\geq\varepsilon$, it follows that
\begin{equation}\label{eq:surface-self-intersection-bound}
 (1-b_{\lambda(j)})u_j\leq2-2p_a(C_j)\leq2,
 \qquad u_j\leq U:=\left\lceil\frac2\varepsilon\right\rceil.
\end{equation}

Negative definiteness now bounds each whole row of $A$, even when $q$ is
large.  Fix $j$ and test its quadratic form on the vector whose $j$th
entry is $1$ and whose $k$th entry is $m_{jk}/u_k$ for $k\ne j$.  Its
value is
\[
 -u_j+\sum_{k\ne j}\frac{m_{jk}^2}{u_k}
 +2\sum_{\substack{k<\ell\\k,\ell\ne j}}
   \frac{m_{k\ell}m_{jk}m_{j\ell}}{u_ku_\ell}<0.
\]
The last sum is nonnegative.  Therefore
\begin{equation}\label{eq:surface-row-bound}
 \sum_{k\ne j}\frac{m_{jk}^2}{u_k}<u_j,
 \qquad
 \sum_{k\ne j}m_{jk}\leq\sum_{k\ne j}m_{jk}^2<U^2.
\end{equation}
The second inequality uses $u_k\leq U$ and the integrality and
nonnegativity of every $m_{jk}$.  The absolute sum in each row of $A$ is
thus at most $C_{\mathrm{row}}:=U+U^2$.

\medskip\noindent\emph{Grouping curves by global labels.}
Let $\mathcal H_V$ be the marked labels whose center is $V$, and put
$t=|\mathcal H_V|\leq|\mathcal I|$.  Define the $q$-by-$t$ zero-one
matrix $P$ by
\[
             P_{k,h}=\begin{cases}1,&\lambda(k)=h,\\0,&\lambda(k)\ne h.
                         \end{cases}
\]
Its columns have disjoint nonempty supports, so $P$ has column rank $t$.
Since $A$ is invertible, $AP$ has the same column rank.  Each of its
integer entries is a sum from one row of $A$, and hence has absolute
value at most $C_{\mathrm{row}}$.  The intersection equations take the
form
\begin{equation}\label{eq:grouped-surface-equations}
 \begin{gathered}
                  (AP)(b_h)_{h\in\mathcal H_V}=-(v_j)_{1\leq j\leq q},
 \\
 v_j=K_R\cdot C_j+(B_Y^{\mathrm{str}}+M_Y)\cdot C_j.
 \end{gathered}
\end{equation}
No marked coefficient occurs in the right-hand side.

There is a fixed integer $m_{\mathrm{data}}>0$ such that every
$m_{\mathrm{data}}v_j$ is integral, for every junction and surface in
this calculation.  Choose it to clear the initial boundary coefficients
of this strong generalized klt sequence and to make its chosen higher nef
divisor integral Cartier.  Canonical
degrees on the smooth $R$ are integral.  Each strict boundary prime is
Cartier in the smooth neighborhood of the fiber, so its degree has the
chosen boundary denominator.  Finally, the trace of the integral Cartier
divisor $m_{\mathrm{data}}\M$ on any model is an integral Weil divisor:
compute it by pulling back to a common higher model and pushing forward.
On the smooth neighborhood of the present fiber that trace is Cartier,
so its degree is integral as well.  No assertion about its Cartier index
elsewhere is needed.

Choose $t$ rows of $AP$ giving a nonsingular square matrix.  Its
determinant is a nonzero integer with an absolute value bounded in terms
of $t$ and $C_{\mathrm{row}}$, for example by
$t^{t/2}C_{\mathrm{row}}^t$ by Hadamard's inequality.  Since
$1\leq t\leq|\mathcal I|$, choose one integer $H_{\mathrm{det}}$ bounding
all these absolute values.  Cramer's rule applied to
\eqref{eq:grouped-surface-equations} then gives
\[
 \begin{gathered}
 q_{\mathrm{surf}}=
 m_{\mathrm{data}}\operatorname{lcm}(1,2,\ldots,H_{\mathrm{det}}),
 \\
 b_h\in q_{\mathrm{surf}}^{-1}\Z\qquad(h\in\mathcal H_V).
 \end{gathered}
\]
The denominator is independent of the junction, the surface, and the
number of geometric curves in the slice.  In particular the marked
discrepancies above surfaces belong to the finite set
\begin{equation}\label{eq:marked-surface-discrepancies}
          \mathcal A_{\mathrm{surf}}
          =[\varepsilon,1]\cap q_{\mathrm{surf}}^{-1}\Z.
\end{equation}
This finite set is used only to exclude recurring marked surface centers
contained in the exceptional loci.  The weight denominator in
Section~\ref{sec:difficulty} will be chosen later from the actual fixed
coefficients and the initial rational data; it need not clear every element
of $\mathcal A_{\mathrm{surf}}$.

\medskip\noindent\emph{Removing marked surface centers from the exceptional loci.}
Fix $E\in\mathcal I$.  Suppose its center is a surface in $L_i$ at
infinitely many indices $i_1<i_2<\cdots$.  The strict comparison at
$i_k$ and monotonicity between indices give
\[
                  a_{i_{k+1}}(E)\geq a_{i_k+1}(E)>a_{i_k}(E).
\]
Both $a_{i_k}(E)$ and $a_{i_{k+1}}(E)$ belong to
$\mathcal A_{\mathrm{surf}}$, a contradiction.  If instead its center is
a surface in $L_i^+$ at
infinitely many indices, the corresponding positive-side discrepancies
satisfy
\[
             a_{i_{k+1}+1}(E)>a_{i_{k+1}}(E)\geq a_{i_k+1}(E),
\]
again contradicting membership of $a_{i_k+1}(E)$ and
$a_{i_{k+1}+1}(E)$ in the same finite set.  There are finitely many
$E\in\mathcal I$, so one tail excludes all
such occurrences on both sides.  This proves assertion (1).

On that tail, suppose a marked prime has a surface center $V$ at a
junction over $X_i$.  Assertion (1) says $V$ is not contained in $L_i$.
Its general point is therefore in the common isomorphism open of the
next diagram.  The next center is its strict transform, still a surface,
and Lemma~\ref{lem:small-comparison} gives equality of its two
discrepancies.  Repeating the argument at every subsequent index shows
that its coefficient is constant from this index onward.  A varying label
cannot have such a surface center.  Its center cannot be a divisor
downstairs because it represents an exceptional place.  This proves
assertion (2).

Finally let $V$ be an irreducible compact analytic surface in one of the exceptional loci of a
remaining diagram, and use the junction on that side.  If the junction
were not an isomorphism at the general point of $V$, its general fiber
there would be positive dimensional: a proper birational morphism to a
normal space is an isomorphism wherever it is finite.  A component
supplying those curves over $V$ would be a divisor with center $V$, by
the dimension argument at the start of the proof.  This is excluded by
assertion (1).  Thus the junction is an isomorphism near a general point
of $V$.  The source is ordinarily terminal and smooth in codimension two,
so the downstairs model is smooth at a general point of this surface.

The coherent ideal of the global analytic surface $V$ has a projective
blowup.  Over the dense open where the ambient model and $V$ are smooth,
this is the ordinary codimension-two blowup and has a unique prime
divisor dominating $V$.  Its closure on the normalized blowup defines
a global place with center $V$, hence an exceptional place on the
downstairs model.  If its discrepancy were at most $1$, it would belong
to the stabilized set $\mathcal I$, contradicting assertion (1).
This proves assertion (3).
\end{proof}

At each remaining junction, the reduced union of the varying labels is
contracted by $h_i$ to a set of dimension at most one.  This is the input
for Theorem~\ref{thm:branch}.  Assertion~(3) has a separate later use:
over a surface in the positive exceptional locus of a downstairs diagram,
it supplies the global generic blowup place and the smooth downstairs
neighborhood used by the detector in Section~\ref{sec:completion}.

\section{The branch inequality}
\label{sec:branch}

The terminal junctions constructed in Section~\ref{sec:junctions} have
only finitely many boundary labels, but one label can have several
normalization branches along a surface.  We need to control the total
number of these branches for the labels whose images downstairs are
curves or points.  The estimate in this section applies to an arbitrary
union of exceptional divisors with that image-dimension bound; it does
not use a boundary or a crepant equation.

Let $p\colon Y\to X$ be a projective bimeromorphic morphism of normal
irreducible compact K\"ahler fourfolds, with $Y$ ordinary terminal.  Let
\[
 Q=\bigcup_{j=1}^{m}Q_j\subset Y
\]
be a reduced union of distinct irreducible divisors, with $m\geq0$, and assume that
$\dim p(Q)\leq1$.  Write $\nu_j\colon Q_j^\nu\to Q_j$ for normalization
and $\nu\colon\coprod_jQ_j^\nu\to Q$ for their disjoint union.  For an
irreducible compact analytic surface $V\subset Q$, define
\begin{equation}\label{eq:branch-count-definition}
 \begin{aligned}
 r_V(Q)&=\#\{F:\ F\text{ is a prime divisor of }\coprod_jQ_j^\nu,
                         \ \nu(F)=V\},\\
 \beta(Q)&=\sum_{\substack{V\subset Q\\ \dim V=2}}(r_V(Q)-1).
 \end{aligned}
\end{equation}
The surface $V$ is counted once in the sum, regardless of which $Q_j$
contain it.  A normalization divisor mapping to $V$ with degree greater
than one counts once in $r_V(Q)$; that degree will instead enter a
pushforward map in the proof.  The sum in
\eqref{eq:branch-count-definition} will be shown to have only finitely
many nonzero terms.

Recall that a global place over $Y$ is a prime divisor on a normal proper
bimeromorphic model, with primes identified by strict transform on a
common higher model.  Put
\begin{equation}\label{eq:branch-place-count}
 \tau_Y(Q)=\#\left\{
 \begin{array}{@{}l@{}}
 E\text{ a global place over }Y:\\[-2pt]
 \cent_Y(E)\text{ is an irreducible curve contained in }\Sing Y\cap Q,
 \quad a(E;Y,0)=2
 \end{array}\right\}.
\end{equation}
Here $a(E;Y,0)$ is the ordinary log discrepancy, defined intrinsically
by the natural meromorphic comparisons of rational canonical bundles
on birational models.  Thus
$\tau_Y(Q)$ counts global divisors, rather than divisors visible only
over a neighborhood of a point of a singular curve.

\begin{theorem}[Branch inequality]\label{thm:branch}
Let $p\colon Y\to X$ be a projective bimeromorphic morphism of normal
irreducible compact K\"ahler fourfolds, where $Y$ has ordinary terminal
singularities.  Let $Q=\bigcup_{j=1}^{m}Q_j$ be a reduced union of
distinct irreducible divisors satisfying $\dim p(Q)\leq1$.  Then the
sum defining $\beta(Q)$ and the count defining $\tau_Y(Q)$ are finite,
and
\begin{equation}\label{eq:branch-inequality}
 \beta(Q)\leq\sum_{j=1}^{m}c_2(Q_j^\nu)+\tau_Y(Q).
\end{equation}
The rank $c_2(Q_j^\nu)$ is the rational rank spanned in
$H_4(Q_j^\nu,\Q)$ by the fundamental classes of compact irreducible
analytic surfaces.
\end{theorem}

At a terminal junction, Section~\ref{sec:difficulty} will take $Q$ to
be the union of varying labels and prove that rounding can leave an
integer deficit of at most $r_V(Q)-1$ at each surface $V\subset Q$.
Thus $\beta(Q)$ bounds the total possible deficit.  The same section
shows that the terms from normalization ranks and exceptional weights
together contribute at least the right-hand side of
\eqref{eq:branch-inequality}.

The proof first relates the normalization branches to the weight-four
part of a degree-five cohomology map.  A smooth resolution then confines
that part to degree-two cohomology of punctured neighborhoods along the
singular curves of $Y$.  The remaining argument converts those local classes into the
global places counted by \eqref{eq:branch-place-count}.  The
normalization method follows the projective branch argument of
\cite[Section~5, especially Lemma~5.2]{ProjectiveLCFourfolds}.  Here the
ambient fourfolds may be nonprojective, so we supply the analytic and
Hodge-theoretic steps needed in that setting.

Unless other coefficients are displayed, homology and cohomology in
the rest of this section have rational coefficients and refer to the
complex analytic topology.  We omit $\Q$ from their notation when this
causes no ambiguity.  If $Q$ is empty,
all terms in \eqref{eq:branch-inequality} vanish.  We henceforth assume
$Q\ne\varnothing$.

\subsection{Projectivity over the center and normalization relations}

To compare normalization relations on $Q$ with cohomology that a
resolution can control, enlarge $Q$ to the full inverse image of its
center.  Set
\begin{equation}\label{eq:branch-projective-loci}
 C=p(Q)_{\mathrm{red}},\qquad
 P=(p^{-1}C)_{\mathrm{red}}.
\end{equation}
Properness makes $C$ a compact analytic subset of $X$.  Its components
are compact curves and possibly isolated points.  The comparison will
use $H^5(P)\to H^5(Q)$.  We first show that these spaces over $C$ are
projective even when $X$ and $Y$ are not.

Choose on each curve component of $C$ a smooth point that lies on no
other component.  Their sum is a Cartier divisor on $C$, and its line
bundle has positive degree on every curve component.  The ampleness
criterion for reduced compact analytic curves says that this positivity
is exactly ampleness; isolated point components impose no condition.
One can see why singularities introduce no additional obstruction by
normalizing $C$.  Write $\nu_C\colon C^\nu\to C$ for this map.  Its
source is a disjoint union of compact Riemann surfaces and points, and
\[
 0\longrightarrow\mathcal O_C\longrightarrow
   \nu_{C*}\mathcal O_{C^\nu}\longrightarrow\mathcal F\longrightarrow0
\]
has a quotient $\mathcal F$ supported at finitely many points.  On the
Riemann surfaces, a sufficiently high power of the chosen line bundle
separates points and any fixed finite set of jets by Riemann--Roch.
The conditions for these sections to descend to $C$ are the finitely
many gluing conditions measured by $\mathcal F$.  Applying the same
jet separation to them gives the compact-curve criterion and a
projective embedding of $C$.

We will also use the following form of the relative-embedding
criterion.  Suppose that $q\colon R\to C$ is projective and has a
global relatively ample holomorphic line bundle $H$.  Compactness of
$C$ permits one common power $H^n$ for the relative embeddings on a
finite cover of $C$.  Its relative sections give a closed immersion
\[
 R\hookrightarrow\mathbb P_C(q_*H^n).
\]
Here the direct image is coherent by properness, and the relative
projective space is allowed to come from a coherent sheaf.  If $A$ is
an ample line bundle on $C$, then $q_*H^n\otimes A^k$ is globally
generated for $k$ sufficiently large: algebraize the coherent sheaf
on the projective $C$ by GAGA
\cite[Section~12, Theorems~1--3]{SerreGAGA} and apply the usual global-generation
criterion.  A surjection from a finite free sheaf onto it embeds its
projective space, and hence $R$, in $C\times\mathbb P^N$ for some
$N$.  An embedding of $C$ and the Segre embedding now make $R$
projective.  This reasoning applies to reducible spaces and to
nonreduced closed subspaces as well.  GAGA algebraizes their coherent
ideals, and also algebraizes holomorphic morphisms between the resulting
projective spaces.

Apply this argument to the base change $P\to C$.  It shows that $P$
is projective.  The closed analytic subspaces $Q$ and $Q_j$ are then
projective by GAGA, and the finite normalization $Q_j^\nu\to Q_j$
is projective (as every finite morphism is), so each $Q_j^\nu$ is
projective as well.  In particular,
all these spaces and all the maps between them may now be treated as
algebraic for purposes of mixed Hodge theory.

The normalization comparison requires a pure threefold containing $Q$.
Let $P_1$ be the reduced union of the three-dimensional components of
$P$.  The preimage of the proper analytic subset $C\subset X$ is a
proper analytic subset of the irreducible fourfold $Y$, so its
components have dimension at most three.  Each $Q_j$ has dimension
three and is one of those components.  Thus
\[
 Q\subset P_1\subset P,\qquad \dim(P\setminus P_1)\leq2.
\]
These observations also apply when $C$ consists only of points.

For a projective variety $R$, the mixed Hodge structure on $H_k(R)$
is dual to that on $H^k(R)$.  We write $W_\bullet$ for the weight
filtration on either group.  For a map of such groups,
$\rk\Gr^W_a[\,\cdot\,]$ will mean the rank of its induced map on the
weight-$a$ graded pieces.  If $R$ has dimension at most two, then
$H_4(R)$ has the fundamental classes of its irreducible surface
components as a basis.  It is pure of weight $-4$: these classes are
the pushforwards of the top classes of smooth projective resolutions
of the components, which have that weight; see also
\cite[Theorem~8.2.4(ii)--(iii)]{DeligneHodgeIII}.

\begin{lemma}[Normalization relations]\label{lem:branch-normalization}
For the spaces in \eqref{eq:branch-projective-loci}, the sum defining
$\beta(Q)$ is finite and
\begin{equation}\label{eq:branch-normalization-bound}
 \beta(Q)-\sum_jc_2(Q_j^\nu)
 \leq \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr].
\end{equation}
\end{lemma}

\begin{proof}
For a reduced pure projective threefold $R$, write
$\nu_R\colon N_R\to R$ for normalization.  Choose a closed reduced
subset $A_R\subset R$ of dimension at most two containing the locus
where $\nu_R$ is not an isomorphism, and put
$F_R=(\nu_R^{-1}A_R)_{\mathrm{red}}$.  The square
\[
\begin{tikzcd}
 F_R \arrow[r,hook] \arrow[d] & N_R \arrow[d,"\nu_R"]\\
 A_R \arrow[r,hook] & R
\end{tikzcd}
\]
is a proper excision square.  Indeed $\nu_R$ is finite and proper and
identifies the open complements.  Collapsing the two closed subsets
gives a continuous bijection $N_R/F_R\to R/A_R$ of compact Hausdorff
quotients, hence a homeomorphism.  Comparing the two relative homology
sequences gives the exact sequence
\begin{equation}\label{eq:branch-normalization-excision}
 H_5(R)\xrightarrow{\partial_R}H_4(F_R)
 \longrightarrow H_4(A_R)\oplus H_4(N_R).
\end{equation}
All its maps are compatible with mixed Hodge structures.  This follows
from algebraic functoriality and the exact sequence of relative
cohomology as a sequence of mixed Hodge structures
\cite[Propositions~8.2.2 and 8.3.9]{DeligneHodgeIII}, followed by
duality on these compact spaces.

Take this square first for $P_1$.  For $Q$, take
$A_Q=Q\cap A_{P_1}$.  The normalization
$N_Q=\coprod_jQ_j^\nu$ is a union of entire, disjoint normalization
components of $N_{P_1}$.  Thus these choices give a morphism of the
two squares, with $F_Q$ equal to the part of $F_{P_1}$ in those
selected components.

For a surface component $V$ of $A_Q$, let
$F_{V,1},\ldots,F_{V,r_V(Q)}$ be the surface components of $F_Q$
mapping onto it, and let $d_{V,\alpha}>0$ be their finite degrees over
$V$.  On top homology the corresponding part of the map to $A_Q$ is
\[
 \bigoplus_{\alpha=1}^{r_V(Q)}\Q[F_{V,\alpha}]
 \longrightarrow\Q[V],\qquad
 \sum_\alpha t_\alpha[F_{V,\alpha}]
 \longmapsto\left(\sum_\alpha d_{V,\alpha}t_\alpha\right)[V].
\]
Its kernel has dimension $r_V(Q)-1$.  A surface not contained in
$A_Q$ has exactly one normalization divisor over it, since the
normalization is an isomorphism at its general point.  Conversely,
finiteness and surjectivity of normalization give at least one divisor
over every surface in $Q$.  It follows that
\[
 B_Q:=\ker\bigl[H_4(F_Q)\longrightarrow H_4(A_Q)\bigr],
 \qquad \dim B_Q=\beta(Q).
\]
This also proves finiteness of the sum: the only possible nonzero
terms come from the finitely many surface components of $A_Q$.

The image of $B_Q$ in $H_4(N_Q)$ is spanned by classes of compact
surfaces in its normalization components.  Its rank is therefore at
most $\sum_jc_2(Q_j^\nu)$.  Hence
\[
 U_Q:=\ker\bigl[B_Q\longrightarrow H_4(N_Q)\bigr]
 \quad\text{satisfies}\quad
 \dim U_Q\geq\beta(Q)-\sum_jc_2(Q_j^\nu).
\]
By \eqref{eq:branch-normalization-excision}, $U_Q$ is the image of
$\partial_Q$.

The map $H_4(F_Q)\to H_4(F_{P_1})$ is injective.  Both groups have
surface components as their bases, and the surfaces in $F_Q$ remain
distinct surfaces on the selected normalization components of
$P_1$.  Naturality of the boundary maps therefore sends $U_Q$
injectively into the image of $\partial_{P_1}$ on the image of
$H_5(Q)\to H_5(P_1)$.  The groups $H_4(F_Q)$ and $H_4(F_{P_1})$
are pure of weight $-4$.  Strictness for the weight filtration
\cite[Theorem~2.3.5(iii)--(iv)]{DeligneHodgeII} says that
$\partial_R$ maps $\Gr^W_{-4}H_5(R)$ onto its image in the pure group
$H_4(F_R)$.  Applying this to the naturality square, we obtain
\[
 \dim U_Q\leq
 \rk\Gr^W_{-4}\bigl[H_5(Q)\longrightarrow H_5(P_1)\bigr].
\]
Finally, Borel--Moore localization contains
\[
 H^{\BM}_6(P\setminus P_1)\longrightarrow H_5(P_1)
                         \longrightarrow H_5(P).
\]
The first group vanishes because $P\setminus P_1$ has complex
dimension at most two.  The second arrow is therefore injective,
and remains injective on weight-graded pieces by strictness.  Duality
between rational homology and cohomology reverses the sign of the
weight and turns the last two inequalities into
\eqref{eq:branch-normalization-bound}.
\end{proof}

\subsection{A smooth resolution and purity over the center}

Lemma~\ref{lem:branch-normalization} proves the normalization bound
and finiteness of $\beta(Q)$.  To finish Theorem~\ref{thm:branch}, we
must prove finiteness of $\tau_Y(Q)$ and the remaining estimate
\[
 \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]\leq\tau_Y(Q).
\]
We first show that $W_4H^5(P)$ vanishes after pullback to the resolved
inverse image.  The key purity there comes from compact K\"ahler Hodge
theory on the smooth ambient resolution.

Fix, for the rest of Section~\ref{sec:branch}, one projective
resolution with smooth source
\[
 g\colon\widetilde Y\longrightarrow Y
\]
which is an isomorphism over $Y_{\mathrm{reg}}$, whose exceptional
locus is a divisor with simple normal crossings, and which principalizes
the ideal of $\Sing Y$.  Thus
\[
 \mathcal I_{\Sing Y}\mathcal O_{\widetilde Y}
       =\mathcal O_{\widetilde Y}(-E_{\mathrm{sing}}),
 \qquad
 \Supp E_{\mathrm{sing}}=g^{-1}(\Sing Y).
\]
Smoothness is used for purity here; the conditions on the exceptional
divisor and singular ideal will be used in the curve construction.
If $Y$ is smooth, we take $g$ to be the identity and the displayed
divisor to be zero.  Projective resolution and principalization, chosen
to preserve the already resolved open $Y_{\mathrm{reg}}$, give such a
choice in the analytic category
\cite[Theorems~1.10, 12.2, and 13.2(1)]{BierstoneMilman1997}.  The resolution is compact
K\"ahler, and both $g$ and $pg$ have global relatively ample line
bundles.  For the composite one uses a sufficiently positive twist
of a $g$-ample bundle by the pullback of a $p$-ample bundle; compactness
allows a uniform choice.  Set
\[
 \widetilde P=((pg)^{-1}C)_{\mathrm{red}}.
\]
The projectivity argument over $C$ given above shows that
$\widetilde P$ is projective.

We use intersection complexes in their perverse normalization.  For
an irreducible complex analytic space $Z$ of dimension $z$ and a local
system $\mathcal E$ on a smooth dense open, $\IC_Z(\mathcal E)$
restricts there to $\mathcal E[z]$.  It is the middle extension of
that shifted local system: it has no nonzero perverse subobject or
quotient supported in a proper analytic subset of $Z$.  The stalk
support condition says that on a smooth boundary stratum of dimension
$s$,
\begin{equation}\label{eq:branch-ic-stalk-bound}
 \mathcal H^q(\IC_Z(\mathcal E))|_S=0\qquad(q>-s-1).
\end{equation}
Here $\mathcal H^q$ denotes ordinary cohomology sheaves, not perverse
cohomology.  These conventions and the support condition are the
middle-extension axioms in
\cite[Section~2.3 and Section~3.3, Axiom {\rm[AX1]}(c)]{GoreskyMacPhersonIHII}.
They are local statements on stratified spaces, so they apply to the
analytic stratifications used here.  If a new stratum of dimension $s$
cuts the local-system open, the only stalk degree is $-z$, which is
at most $-s-1$ whenever $s<z$.

\begin{lemma}[Decomposition for the resolution maps]
\label{lem:branch-analytic-decomposition}
For $f=g$ with target $Y$, and for $f=pg$ with target $X$, the rational
complex $Rf_*\Q_{\widetilde Y}[4]$ is a finite direct sum of shifts of
perverse middle extensions with irreducible closed analytic supports.
Its unique full-support summand is the intersection complex of the
target in perverse degree zero.
\end{lemma}

\begin{proof}
Write $B$ for the target of $f$ and
$K_f=Rf_*\Q_{\widetilde Y}[4]$.  Fix an $f$-relatively ample line
bundle and let $\ell$ be its rational first Chern class.  Cup product
defines a global morphism $\ell\colon K_f\to K_f[2]$.

We first obtain relative hard Lefschetz locally on $B$.  Around a
point of $B$, choose a small chart $V$ embedded as a closed analytic
subspace of a complex manifold.  After making the chart smaller,
relative ampleness embeds $f^{-1}V$ in a projective space over $V$;
composing with the closed embedding of $V$ gives a projective map
from the smooth manifold $f^{-1}V$ to the ambient manifold.  On each
connected component of the smooth source, the constant shifted sheaf
underlies the constant polarizable Hodge module with that strict
support.  Saito's projective direct-image theorem
\cite[Theorem~5.3.1]{SaitoMHP} applies to precisely this situation:
its morphisms are projective morphisms of smooth complex analytic
manifolds, its Lefschetz class is the Chern class of a relatively ample
line bundle, and its conclusion includes relative hard Lefschetz and
polarizable perverse direct images.  Passing through the closed
embedding, which is fully faithful and exact for perverse sheaves,
gives on $V$
\[
 \ell^a\colon {}^p\!H^{-a}(K_f)|_V
            \xrightarrow{\ \sim\ }{}^p\!H^a(K_f)|_V
 \qquad(a\geq0).
\]
After forgetting Hodge structures, the Tate twist has the same
underlying rational perverse sheaf.  The operator is the restriction of the single
global $\ell$, and a morphism of perverse sheaves is an isomorphism
if it is so on an open cover.  Thus these are global relative hard
Lefschetz isomorphisms on $B$.

The formal Lefschetz splitting criterion
\cite[Theorem~1.5]{DeligneLefschetz} now gives
\begin{equation}\label{eq:branch-perverse-splitting}
 K_f\simeq\bigoplus_i{}^p\!H^i(K_f)[-i].
\end{equation}
The criterion uses truncation triangles and the induced Lefschetz
isomorphisms; the same argument applies to the bounded perverse
$t$-structure.  This explains why the local analytic theorem gives a
global derived splitting here.

We also need to separate the supports of the perverse terms in
\eqref{eq:branch-perverse-splitting}.  Locally, Saito's pure
direct images decompose by strict support
\cite[Section~5.1 and Theorem~5.3.1]{SaitoMHP}; their underlying
perverse terms are middle extensions from smooth opens of those
supports.  The support decomposition glues without requiring
semisimplicity of local systems on arbitrary analytic opens.  Indeed,
a perverse morphism between middle extensions with different
irreducible supports must be zero: its image would be a subobject or
a quotient with smaller support in at least one of them.  Restriction
to an open preserves the middle-extension property; every resulting
strict support is a local branch of the original support.  The local
system may decompose further without changing that support.  For each
perverse term and each dimension $d$, the sum of the local projectors
onto all $d$-dimensional strict-support summands is intrinsic.
Restriction preserves dimensions of local branches, so these sums
agree on overlaps and glue as perverse morphisms.  The support of each
glued dimension summand is closed analytic in every chart, hence
globally.  For each irreducible component $Z$ of this support, sum all
local projectors whose strict supports are local branches of $Z$.
These sums agree by the same zero-morphism argument and glue to a
global projector whose image has strict support $Z$; the
middle-extension property is local.  Local finiteness and compactness
make the number of these summands finite.

Finally $f$ is an isomorphism over a dense open of its target.  On
that open $K_f$ is $\Q[4]$ in perverse degree zero.  The only
full-support term is consequently the middle extension of this
constant local system, namely $\IC_B$, in degree zero.  This proves
the lemma.
\end{proof}

For each of $g$ and $pg$, choose a splitting as in
Lemma~\ref{lem:branch-analytic-decomposition}.  For $g$, choose the
identification of the full-support summand so that its inclusion and
projection are the identity over $Y_{\mathrm{reg}}$.

\begin{lemma}[Purity on the resolved inverse image]
\label{lem:branch-resolved-purity}
The restriction map
\[
 H^5(\widetilde Y)\longrightarrow H^5(\widetilde P)
\]
is surjective.  The mixed Hodge structure on the projective variety
$\widetilde P$ is pure of weight $5$ in this degree.
\end{lemma}

\begin{proof}
Apply Lemma~\ref{lem:branch-analytic-decomposition} to $f=pg$.
Besides $\IC_X$, write a strict-support summand as
$\mathcal K_{Z,i}[-i]$, where $\mathcal K_{Z,i}$ is perverse with
proper irreducible support $Z\subset X$ of dimension $z$.  Over a
general point $x$ of $Z$, the fiber of $f$ has dimension at most $3-z$:
$f^{-1}(Z)$ is a proper analytic subset of the irreducible fourfold
$\widetilde Y$ and therefore has dimension at most three.  Proper base
change and the topological dimension of a compact analytic fiber give
\[
 \mathcal H^k(K_f)_x=H^{k+4}(f^{-1}(x))=0
               \quad\text{if }k>2(3-z)-4.
\]
The generic nonzero stalk of $\mathcal K_{Z,i}[-i]$ is in degree
$i-z$, because a perverse middle extension on $Z$ has its generic
local system in degree $-z$.  It is a direct summand of this stalk,
so
\begin{equation}\label{eq:branch-support-shift}
 i-z\leq2(3-z)-4,\qquad\text{or equivalently}\qquad i+z\leq2.
\end{equation}

We now restrict the decomposition to $C$.  Suppose first that
$Z\not\subset C$, and stratify $Z\cap C$ compatibly with
$\mathcal K_{Z,i}$.  A stratum $S$ has dimension $s\leq z-1$ and
$s\leq1$.  Its stalk degrees for $\mathcal K_{Z,i}$ are at most
$-s-1$ by \eqref{eq:branch-ic-stalk-bound}.  This remains valid under
the refinement by $C$: a stratum cut out of an old boundary stratum
inherits the stronger bound from that stratum, while a stratum cut
out of the local-system open has only degree $-z\leq-s-1$.
Compactly supported cohomology on the smooth complex $s$-fold $S$
vanishes above degree $2s$.  Thus its contribution to the
hypercohomology of $\mathcal K_{Z,i}[-i]|_C$ vanishes in degrees
greater than
\[
 i-s-1+2s=i+s-1\leq i+z-2\leq0.
\]
Filtering $C$ by its finitely many strata proves that this summand
has no degree-one hypercohomology on $C$.  The full-support summand
$\IC_X$ has the same property: for each stratum of $C$, the upper
bound is $-s-1+2s=s-1\leq0$; on the smooth open its only stalk degree
is $-4$, which is smaller still.

Only summands with $Z\subset C$ can therefore contribute in degree
one.  Such a complex is supported on the closed subset $C$, so its
restriction induces an isomorphism on hypercohomology from $X$ to
$C$.  The chosen global splitting and proper base change now show that
\[
 \mathbb H^1(X,K_f)=H^5(\widetilde Y)
   \longrightarrow
 \mathbb H^1(C,K_f|_C)=H^5(\widetilde P)
\]
is surjective.

It remains to justify what this surjection says about weights.
Compact K\"ahler Hodge theory gives $H^5(\widetilde Y,\Q)$ its pure
Hodge structure of weight $5$.  On the projective $\widetilde P$,
Deligne's mixed Hodge structure has weights at most $5$
\cite[Theorem~8.2.4(iii)]{DeligneHodgeIII}.  We verify directly that
the restriction map preserves its Hodge filtration, because the
ambient $\widetilde Y$ may be nonprojective.

Choose a proper smooth projective hyperresolution
$\epsilon_\bullet\colon Z_\bullet\to\widetilde P$.  Deligne's
construction computes the Hodge filtration on $H^5(\widetilde P)$
from the total simplicial de Rham complex of the $Z_n$, filtered by
holomorphic form degree
\cite[Section~8.1, (8.2.1), and Proposition~8.2.2]{DeligneHodgeIII}.
The terms can be chosen projective because $\widetilde P$ is projective
and the construction can use projective resolutions and modifications.
We may use smooth forms in this complex, with the same filtration:
the Dolbeault resolutions give filtered quasi-isomorphisms from the
holomorphic de Rham complexes on the smooth $Z_n$.
A class in $F^aH^5(\widetilde Y,\C)$ has a closed smooth representative
$\eta$ whose components have holomorphic degree at least $a$, by the
K\"ahler Hodge decomposition.  Pullback along the holomorphic map
$Z_0\to\widetilde P\hookrightarrow\widetilde Y$ preserves these
bidegrees.  Put that pullback in simplicial degree zero of the total
complex.  Its de Rham differential vanishes, and its simplicial
differential is zero because the two face pullbacks to $Z_1$ have the
same composite with the augmentation.  It is therefore a cocycle in
the filtered total de Rham complex.  It represents the ordinary
topological restriction by de Rham
naturality and cohomological descent.  Thus restriction preserves
$F^a$ for every $a$.

The restriction is rational on underlying cohomology.  It also
preserves $W$: the source is pure of weight $5$, and $W_5$ is all of
the target.  It is consequently a morphism of mixed Hodge structures.
Strictness for $W$ \cite[Theorem~2.3.5(iii)]{DeligneHodgeII}, applied
to the surjection just proved, yields
\[
 W_4H^5(\widetilde P)
     =\im\bigl[W_4H^5(\widetilde Y)\to H^5(\widetilde P)\bigr]=0.
\]
Together with the upper weight bound, this proves purity of weight
$5$.  Strictness here concerns mixed Hodge structures themselves and
does not require a rational polarization on the compact K\"ahler
source.
\end{proof}

\subsection{The contribution of singular curves}

Let $j\colon Y_{\mathrm{reg}}\hookrightarrow Y$ be the inclusion.
Ordinary terminal singularities are smooth in codimension two, so
$\Sing Y$ is a finite union of irreducible curves and points.  Analytic
constructibility and a compatible Whitney stratification let us
remove a finite set of points from each singular curve $T$ so that
the remaining connected smooth curve $T^\circ$ carries the local
systems
\begin{equation}\label{eq:branch-local-systems}
 \mathcal V_T=(R^2j_*\Q_{Y_{\mathrm{reg}}})|_{T^\circ},\qquad
 \mathcal W_T=(R^2g_*\Q_{\widetilde Y})|_{T^\circ},\qquad
 b_T=\dim H_c^2(T^\circ,\mathcal V_T).
\end{equation}
Here $\mathcal V_T$ records degree-two cohomology of punctured
neighborhoods, while $\mathcal W_T$ records that of the fixed
resolution fibers and will provide geometric representatives.
We use one finite puncture set on each $T$ for all the following
requirements.  All cohomology sheaves of $Rj_*\Q$ and $Rg_*\Q$ are
locally constant on $T^\circ$, and the fibers of $g$ there have
dimension at most two.  For the latter assertion,
$g^{-1}(T)$ has dimension at most three, so the general fiber has
dimension at most two; remove its exceptional dimension-jump points.
We also remove intersections of singular curves and the finitely
many points of $T\cap Q$ when $T$ is not contained in $Q$.

For later use we impose one further condition on this same finite
puncture set.  Let $E$ be a prime component of $\Exc(g)$ dominating
$T$.  It is smooth because the exceptional divisor has simple normal
crossings.  Its proper map to $T$ has a Stein factorization
\[
 E\longrightarrow\widehat T_E\longrightarrow T,
\]
where the first map has connected fibers and the second is finite.
The intermediate curve is normal and irreducible because $E$ is
normal and irreducible.  Remove from $T$ the branch values of the
finite map and the critical values of the first map, together with
the already excluded singular points.  Properness and generic
smoothness make these sets finite.  Over $T^\circ$ the second map
is then a finite unramified cover; it stays connected because deleting
finitely many points from the irreducible normal curve
$\widehat T_E$ leaves it connected.  The first map is a smooth proper
family with connected fibers.  There are only finitely many
such $E$, so these conditions can be imposed simultaneously.  They
will let us recognize global divisors after restricting to a smaller
curve domain.

The number $b_T$ is unaffected by any further finite puncturing.
Indeed, for $t\in T^\circ$, Poincar\'e duality on the oriented real
surface $T^\circ$ gives
\[
 H_c^2(T^\circ,\mathcal V_T)
 \simeq H^0(T^\circ,\mathcal V_T^\vee)^\vee
 \simeq \bigl((\mathcal V_T)_t\bigr)_{\pi_1(T^\circ,t)},
\]
where the last term is the coinvariant space for monodromy.  A loop
can be perturbed away from finitely many additional points, so the
fundamental group of the further punctured curve surjects onto
$\pi_1(T^\circ,t)$.  The restricted local system has the same
monodromy image, and hence the same coinvariant dimension.

\begin{lemma}[The weight-four contribution]\label{lem:branch-cone}
With the choices in \eqref{eq:branch-local-systems},
\begin{equation}\label{eq:branch-cone-bound}
 \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]
 \leq
 \sum_{\substack{T\text{ irreducible curve}\\T\subset\Sing Y\cap Q}} b_T.
\end{equation}
\end{lemma}

\begin{proof}
Use the full-support projection in the chosen decomposition for $g$
to form the morphism
\[
 \alpha\colon\Q_Y[4]\longrightarrow Rg_*\Q_{\widetilde Y}[4]
                                      \longrightarrow\IC_Y.
\]
The first arrow is the natural pullback map.  Both arrows restrict
to the identity on $Y_{\mathrm{reg}}$.  Let $\mathcal L$ be the cone
of $\alpha$, so that
\begin{equation}\label{eq:branch-comparison-triangle}
 \Q_Y[4]\xrightarrow{\alpha}\IC_Y\longrightarrow\mathcal L
                                      \longrightarrow\Q_Y[5].
\end{equation}
It is supported on $\Sing Y$.
Enlarge the finite puncture sets, if necessary, so that the cohomology
sheaves of $\mathcal L$ are local systems on each $T^\circ$.  Analytic
constructibility permits this enlargement, and the preceding
coinvariant description shows that it does not change $b_T$.

By proper base change, the map induced by $\alpha$ on $P$ factors as
\[
 H^5(P)\longrightarrow H^5(\widetilde P)
           \longrightarrow\mathbb H^1(P,\IC_Y|_P).
\]
The first arrow comes from a holomorphic morphism between the
projective spaces $\widetilde P$ and $P$, and is algebraic by GAGA.
It therefore preserves weights.  Lemma~\ref{lem:branch-resolved-purity}
shows that it kills $W_4H^5(P)$.  Hence the displayed composite kills
that subspace as well; we need no weight statement about the chosen
perverse projection.  The long exact sequence of
\eqref{eq:branch-comparison-triangle} on $P$ gives
\[
 W_4H^5(P)\subset
 \im\bigl[\mathbb H^0(P,\mathcal L|_P)\longrightarrow H^5(P)\bigr].
\]
Restricting the triangle from $P$ to $Q$ shows that the image of this
subspace in $H^5(Q)$ is contained in the image of
$\mathbb H^0(Q,\mathcal L|_Q)$.  Passing to a weight-graded quotient
can only lower rank, and therefore
\begin{equation}\label{eq:branch-cone-rank}
 \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]
        \leq\dim\mathbb H^0(Q,\mathcal L|_Q).
\end{equation}

We estimate the last group by its strata.  On a stratum of $\Sing Y$
of dimension $s\in\{0,1\}$, the bound
\eqref{eq:branch-ic-stalk-bound} and the triangle give
\begin{equation}\label{eq:branch-cone-stalk-bound}
 \mathcal H^q(\mathcal L)|_S=0\qquad(q>-s-1).
\end{equation}
The constant complex in the triangle has its only stalk cohomology
in degree $-4$; its shifted contribution to the cone is in degree
$-5$, so it cannot alter this upper bound.  On a curve $T^\circ$,
the same triangle identifies $\mathcal H^{-2}(\mathcal L)$ with
$\mathcal H^{-2}(\IC_Y)$.  The curve stratum has complex codimension
three in $Y$.  In the middle-extension construction, attaching a
codimension-$c$ stratum retains the unshifted cohomology of $Rj_*\Q$
through degree $c-1$.  For $c=3$ this gives
\begin{equation}\label{eq:branch-cone-link}
 \mathcal H^{-2}(\mathcal L)|_{T^\circ}
   =\mathcal H^{-2}(\IC_Y)|_{T^\circ}
   =(R^2j_*\Q)|_{T^\circ}=\mathcal V_T.
\end{equation}
This is the attaching truncation of
\cite[Section~3.1 and Section~3.3, Axiom {\rm[AX1]}(d)]{GoreskyMacPhersonIHII},
with the shift by four from our perverse normalization.

The restriction $\mathcal L|_Q$ is supported on the closed set
$\Sing Y\cap Q$, so its hypercohomology may be computed on that set.
The complement there of the disjoint opens $T^\circ$
for the curves contained in $Q$ is finite.  A point stratum contributes
nothing to degree-zero hypercohomology by
\eqref{eq:branch-cone-stalk-bound}.  The open--closed cohomology
sequence therefore gives a surjection
\[
 \bigoplus_{T\subset\Sing Y\cap Q}
       \mathbb H_c^0(T^\circ,\mathcal L|_{T^\circ})
       \longrightarrow\mathbb H^0(Q,\mathcal L|_Q).
\]
On a curve, compactly supported cohomology of a local system vanishes
above degree two.  In the spectral sequence
\[
 H_c^a(T^\circ,\mathcal H^b(\mathcal L)|_{T^\circ})
       \ \Longrightarrow\ 
 \mathbb H_c^{a+b}(T^\circ,\mathcal L|_{T^\circ}),
\]
the stalk bound gives $b\leq-2$.  The only term in total degree zero
is consequently $a=2$, $b=-2$, whose dimension is $b_T$ by
\eqref{eq:branch-cone-link}.  The dimension of each degree-zero
abutment is at most $b_T$.  This bound and
\eqref{eq:branch-cone-rank} prove \eqref{eq:branch-cone-bound}.
\end{proof}

Combining Lemmas~\ref{lem:branch-normalization} and
\ref{lem:branch-cone} gives the topological reduction of the theorem:
\begin{equation}\label{eq:branch-topological-bound}
 \begin{aligned}
 \beta(Q)-\sum_jc_2(Q_j^\nu)
 &\leq \rk\Gr^W_4\bigl[H^5(P)\longrightarrow H^5(Q)\bigr]\\
 &\leq
 \sum_{\substack{T\text{ irreducible curve}\\T\subset\Sing Y\cap Q}} b_T.
 \end{aligned}
\end{equation}
There are finitely many curves in this sum, and the local systems have
finite rank on curves of finite topological type, so its terms are
finite.  It remains to prove that this sum is at most $\tau_Y(Q)$ and
that $\tau_Y(Q)$ is finite.

We finish the topological part by relating the punctured cohomology
in $\mathcal V_T$ to the cohomology of the fixed resolution.  This
identifies the classes that the subsequent geometric construction
will realize.

\begin{lemma}[Resolution cohomology and punctured cohomology]
\label{lem:link-quotient}
For every singular curve $T$ with the choices in
\eqref{eq:branch-local-systems}, restriction from the resolution to
the regular locus induces a surjection of local systems
\begin{equation}\label{eq:branch-link-quotient}
 \mathcal W_T\twoheadrightarrow\mathcal V_T.
\end{equation}
For every $t\in T^\circ$, its map on fibers is equivariant for the
action of $\pi_1(T^\circ,t)$ and is the map induced by restriction
\begin{equation}\label{eq:branch-link-stalk-map}
 \begin{aligned}
 (\mathcal W_T)_t
 &\simeq H^2(g^{-1}(t))
  \simeq\varinjlim_{U\ni t}H^2(g^{-1}U)\\
 &\longrightarrow\varinjlim_{U\ni t}H^2(U\cap Y_{\mathrm{reg}})
  \simeq(\mathcal V_T)_t,
 \end{aligned}
\end{equation}
where $U$ runs through sufficiently small open neighborhoods of $t$
in $Y$ and $g^{-1}(U\cap Y_{\mathrm{reg}})$ is identified with
$U\cap Y_{\mathrm{reg}}$.
\end{lemma}

\begin{proof}
The isomorphism of $g$ over the regular locus and adjunction give a
natural morphism
\[
 \rho\colon Rg_*\Q_{\widetilde Y}[4]
                     \longrightarrow Rj_*\Q_{Y_{\mathrm{reg}}}[4].
\]
By the definition of a higher direct-image stalk and proper base
change for $g$, its degree-$-2$ map at $t$ is precisely
\eqref{eq:branch-link-stalk-map}.  These are the usual sheaf
cohomology groups of constant sheaves, equal to singular cohomology
on the locally contractible analytic spaces in question.

Let $\kappa\colon\IC_Y\to Rg_*\Q_{\widetilde Y}[4]$ be the
full-support inclusion in the chosen decomposition.  Its restriction
to $Y_{\mathrm{reg}}$ is the identity.  The composite
$\rho\kappa\colon\IC_Y\to Rj_*\Q[4]$ is therefore the canonical
comparison morphism: by adjunction a morphism to $Rj_*\Q[4]$ is
determined by its restriction to $Y_{\mathrm{reg}}$.  The
codimension-three attaching construction used in
\eqref{eq:branch-cone-link} says that this comparison is an
isomorphism on ordinary stalk cohomology in degree $-2$ along
$T^\circ$.  Its degree-$-2$ map factors through
\[
 \mathcal H^{-2}(Rg_*\Q[4])|_{T^\circ}=\mathcal W_T.
\]
Thus the degree-$-2$ map induced by $\rho$, namely
\eqref{eq:branch-link-quotient}, is surjective.  It is a morphism of
the local systems in \eqref{eq:branch-local-systems}, which gives
the asserted monodromy equivariance.
\end{proof}

\subsection{Curve contributions and global places}
\label{subsec:curve-places}

It remains to bound the contribution \(b_T\) of each singular curve by
global divisors.  We realize the relevant cohomology classes by line
bundles near a compact subset carrying all loops of \(T^\circ\).  Degrees
on the fibers of a small \(\Q\)-factorialization then produce exceptional
surfaces.  Retaining those loops will ensure that their blowup places
remain distinct on the fixed global resolution.

\begin{proposition}[Global places over a singular curve]\label{prop:curve-places}
For every irreducible curve component \(T\) of \(\Sing Y\), with \(b_T\)
as in \eqref{eq:branch-local-systems} and the fixed resolution
\(g:\widetilde Y\to Y\),
\[
 b_T\ \le\
 \#\left\{
 \begin{array}{c}
 E\text{ a prime component of }\Exc(g):\\
 g(E)=T,\quad a(E;Y,0)=2
 \end{array}
 \right\}.
\]
In particular, the divisors counted here represent distinct global
divisorial places.
\end{proposition}

\begin{proof}
Fix \(T\), and write
\[
 q_T:\mathcal W_T\longrightarrow\mathcal V_T
\]
for the natural quotient of Lemma~\ref{lem:link-quotient}.  If \(b_T=0\)
there is nothing to prove, so assume \(b_T>0\).  We may remove finitely
many further points of \(T^\circ\) whenever needed.  The local systems
already defined restrict to the smaller curve, and the induced map on
fundamental groups is surjective.  Thus their monodromy images and the
coinvariant dimension \(b_T\) do not change.

We first construct sections
\[
 \sigma_1,\ldots,\sigma_{b_T}\in H^0(T^\circ,\mathcal W_T)
\]
whose images under \(q_T\) are linearly independent in every fiber of
\(\mathcal V_T\), after the permitted further finite puncturing.

\emph{Step 1. Invariant lifts from finite monodromy.}
First we show that \(\mathcal W_T\), and therefore its quotient
\(\mathcal V_T\), has finite monodromy.  Let
\(\mathcal F=\widetilde Y\times_Y T\), with its full complex-space
structure.  It is projective over the compact projective curve \(T\).
A relative embedding and GAGA identify this morphism with an algebraic
projective family, including its possibly nonreduced scheme fibers.
After deleting finitely many points we may assume that
\(\mathcal F\to T^\circ\) is flat and that all
\((R^kg_*\Q)|_{T^\circ}\) are local systems.

For \(t\in T^\circ\), put \(F_t=\mathcal F_t\).  Every integral class in
\(H^2(F_t,\Z)\) lifts, by proper base change, to
\(H^2(g^{-1}U_t,\Z)\) for a sufficiently small Stein neighborhood
\(U_t\) of \(t\) in \(Y\).  Terminal singularities are rational
\cite[Remark~3.8 and Theorem~3.12]{FujinoAnalyticMMP}.  Hence
\(g_*\mathcal O_{\widetilde Y}=\mathcal O_Y\) and
\(R^kg_*\mathcal O_{\widetilde Y}=0\) for \(k>0\); Leray and Cartan's
Theorem~B give
\[
 H^2(g^{-1}U_t,\mathcal O_{\widetilde Y})=0.
\]
The exponential sequence therefore realizes the lifted integral class
as the first Chern class of a holomorphic line bundle on \(g^{-1}U_t\).
Its restriction to the projective scheme \(F_t\) is algebraic by the
scheme form of GAGA
\cite[Corollary~4.3 and Theorem~4.4]{RaynaudSGA1XII}.  In particular,
\begin{equation}\label{eq:curve-fiber-chern}
 \Pic(F_t)\otimes_{\Z}\Q
 \xrightarrow{\ c_1\ } H^2(F_t,\Q)=(\mathcal W_T)_t
 \quad\text{is surjective}.
\end{equation}
Here and below the cohomology of a scheme fiber means that of its
analytic topological space; nilpotents do not change it.

We use the parameter argument of
\cite[Section~6.1, proof of Lemma~6.4]{ProjectiveLCFourfolds} to show
that a spanning set of fiber classes has finite monodromy orbits.  Fix a
relatively very ample \(\mathcal O_{\mathcal F}(1)\).  Every line bundle on a
fiber is a quotient of some
\(\mathcal O_{F_t}(-n)^{\oplus r}\).  Letting \(n,r\), and the Hilbert
polynomial vary gives countably many relative Quot schemes of finite
type over \(T^\circ\)
\cite[Theorems~3.1--3.2]{GrothendieckHilbert1961}.  In each take the
open set on which the universal quotient is invertible on the whole
pulled-back family.  These open sets still contain a point representing
every fiber line bundle.  Indeed the family and universal quotient are
flat over the Quot scheme, so the local criterion for flatness makes a
fiberwise locally free quotient of rank one locally free near that
fiber; properness removes the image of the complementary closed locus.

There are countably many irreducible components of these parameter
spaces.  Choose \(t\) outside the closures of the images of all
components which do not dominate \(T^\circ\).  Such a point exists,
since each of those closures is a finite set and a complex curve is
uncountable.  Put \(\Gamma=\pi_1(T^\circ,t)\).  By
\eqref{eq:curve-fiber-chern}, choose finitely many
line bundles on \(F_t\) whose Chern classes span
\((\mathcal W_T)_t\).  Each is represented on a dominating
reduced irreducible parameter component \(H\).  The Chern class of the
universal bundle gives a section of the pullback of \(\mathcal W_T\)
to \(H^{\mathrm{an}}\): restrict its class on the total family to
fibers and use proper base change.

Choose a closed point of the generic fiber of \(H\to T^\circ\).
Its residue field is a finite extension of the function field of
\(T\).  Spreading this point, normalizing its closure, and deleting
finitely many base points gives a connected finite \'etale cover of a
dense open of \(T^\circ\), together with a morphism from that cover
to \(H\).  The analytification of an
irreducible complex algebraic variety is path connected.  A path in
\(H^{\mathrm{an}}\) from the original parameter point to a point of
this cover identifies the transported Chern class with the class
there.  The subgroup fixing that sheet has finite index and fixes
this class.  The inclusion of the further punctured curve, with the
projected path for change of basepoint, still surjects on \(\Gamma\).
The image of the finite-index sheet stabilizer is therefore finite
index in \(\Gamma\) and fixes the original class.  Thus each of our
spanning classes has a finite orbit under \(\Gamma\).  The intersection
of their stabilizers has finite index and acts trivially on
\((\mathcal W_T)_t\).  The monodromy group \(G\) of \(\mathcal W_T\)
is therefore finite, as is that of \(\mathcal V_T\).

Poincar\'e duality with local coefficients on the oriented curve gives
\[
 b_T=\dim(\mathcal V_T)_t{}_{\Gamma}.
\]
For a representation of the finite group \(G\) over \(\Q\), averaging
identifies coinvariants with invariants and makes invariants an exact
functor.  The quotient \(q_T\) therefore supplies the asserted sections
\(\sigma_i\) with independent images.

\emph{Step 2. Line bundles near a compact curve core.}
Take \(T^\circ\) noncompact, removing one more point if needed.
Recall the fixed choice made after \eqref{eq:branch-local-systems}:
for every prime component \(E\) of \(\Exc(g)\) dominating \(T\),
its Stein factor restricts to
\begin{equation}\label{eq:global-divisor-family}
 E|_{T^\circ}\longrightarrow \widehat T_E^\circ\longrightarrow T^\circ,
\end{equation}
where the first map is a smooth proper family with connected fibers
and the second is a connected finite \'etale cover.  Further finite
puncturing preserves these properties.  Choose an ambient open
\(Y^\circ\subset Y\) in which \(T^\circ\) is closed: remove the
discarded points of \(T\), the other singular components, and their
intersection points.  These choices will be used when we identify the
local divisors globally.

Let \(h:g^{-1}T^\circ\to T^\circ\) be the restricted resolution.
The curve \(T^\circ\) has the homotopy type of a finite graph, so
cohomology of its local systems vanishes in degrees at least two.
The Leray spectral sequence for \(h\) consequently makes the edge map
\[
 H^2(g^{-1}T^\circ,\Q)
 \longrightarrow H^0(T^\circ,\mathcal W_T)
\]
surjective.  Choose lifts of the \(\sigma_i\).  The algebraic space
\(g^{-1}T^\circ\) has finite triangulation type; after multiplying
each lift by a positive integer, it comes from a class
\(\alpha_i\in H^2(g^{-1}T^\circ,\Z)\).  Replace \(\sigma_i\) by the
same multiple.  Their images are still independent.

To extend the \(\alpha_i\) simultaneously while retaining every loop
of \(T^\circ\), choose a compact curve core as follows.  In the smooth
compactification of \(T^\circ\), remove small open
coordinate discs about its punctures, with disjoint closures, and denote the complement by
\(K_*\).  This is a connected compact semianalytic subset of
\(T^\circ\).  The inclusion of its interior into \(T^\circ\) induces
a surjection on fundamental groups.  The core \(K_*\) is also Runge: every component of
\(T^\circ\setminus K_*\) runs to a missing puncture and is therefore
not relatively compact.  The compact set \(g^{-1}K_*\) is
semianalytic.  Continuity of cohomology on neighborhoods of this
compact set extends the restrictions of the finitely many
\(\alpha_i\) to integral classes on one open neighborhood
\(\widetilde U_0\) of \(g^{-1}K_*\) in \(\widetilde Y\).
One may use \v{C}ech cohomology for this continuity statement;
semianalytic triangulation and local contractibility identify it with
singular cohomology here.  Properness of \(g\) makes
\[
 U_0=Y\setminus g(\widetilde Y\setminus\widetilde U_0)
\]
an open neighborhood of \(K_*\) with \(g^{-1}U_0\subset\widetilde U_0\).

The closed curve \(T^\circ\subset Y^\circ\) is Stein.  Siu's
Stein-neighborhood theorem, in the form
\cite[Theorem~2.1]{ForstnericStein} with empty compact set, gives a
Stein neighborhood \(\Omega\) of this curve in \(Y^\circ\).
The Runge property makes \(K_*\) holomorphically convex in
\(T^\circ\), hence also in \(\Omega\) by the paragraph preceding
that theorem.  The usual holomorphic-polyhedron construction for a
convex compact in a Stein space gives a Stein neighborhood
\[
 K_*\subset U\Subset\Omega\cap U_0.
\]
Take its connected component containing \(K_*\).  It is normal,
being open in \(Y\), and therefore irreducible.  For the local
\(\Q\)-factorialization, Fujino's compact construction
\cite[Section~1.11]{FujinoAnalyticMMP} supplies an ambient semianalytic
Stein compact \(K'\Subset U\), with
\(K_*\subset\operatorname{int}_U(K')\), such that
\[
 K'\cap Z\ \text{has finitely many connected components}
\]
for every analytic subset \(Z\) defined on a neighborhood of
\(K'\).  This is the compact condition (P4) in Fujino's condition
(P); normality of the source and Steinness of the base supply its
other ambient conditions.

The classes just extended to \(g^{-1}U\) are Chern classes of line
bundles \(L_1,\ldots,L_{b_T}\) there, by the same rational-singularity,
Cartan, and exponential-sequence argument used above.  For every
\(t\) in the interior of \(K_*\), their fiber classes are the
\(\sigma_i(t)\); hence their images under \(q_T\) remain independent.
We also need divisor representatives before making any further
modification.  The sheaf \(g_*L_i\) is coherent and has rank one on
the regular open of \(U\).  Cartan's Theorem~A supplies a global
section nonzero at a point of that open.  Its pullback is a nonzero
section of \(L_i\), whose zero divisor is a Cartier divisor \(A_i\)
on \(g^{-1}U\) representing \(L_i\).

\emph{Step 3. Fiber degrees and surface families.}
We will obtain at least \(b_T\) surface families by proving that the
\(b_T\) line bundles constructed below have linearly independent vectors
of fiber degrees.
Apply Fujino's small \(\Q\)-factorialization theorem
\cite[Theorem~1.24]{FujinoAnalyticMMP} to the ordinary pair
\((U,0)\), the identity \(U\to U\), and the full compact \(K'\).
The identity is projective, \(U\) is terminal and therefore klt,
and \(K_U\) is \(\Q\)-Cartier.  The preceding construction supplies
condition (P).  After restricting the base to a neighborhood of
\(K'\), the theorem gives a projective small bimeromorphic morphism
\[
 \ell:Y'\longrightarrow U
\]
with \(Y'\) normal and \(\Q\)-factorial over \(K'\).  We retain the
notation \(U\) after this restriction and restrict \(g,L_i,A_i\)
accordingly.  Compactness and local terminality of \(Y\) give a common
\(m_{\mathrm{can}}>0\) for which \(\omega_Y^{[m_{\mathrm{can}}]}\) is
invertible; its restriction to \(U\) is
\(\omega_U^{[m_{\mathrm{can}}]}\).  Since \(\ell\) is
small, the natural identification on the common codimension-one open
extends by reflexivity to
\[
 \omega_{Y'}^{[m_{\mathrm{can}}]}
 \simeq\ell^*\omega_U^{[m_{\mathrm{can}}]}.
\]
In particular, the left side is invertible and the natural relative
canonical divisor \(K_{Y'/U}\) is zero.  This is canonical crepancy,
expressed using compatible local canonical generators as
\(K_{Y'}=\ell^*K_U\).  A place exceptional over \(Y'\) is exceptional
over \(U\), because \(\ell\) is small.  Crepancy therefore preserves
the terminal discrepancy inequalities, so \(Y'\) is terminal.  Moreover \(\ell\)
is an isomorphism over \(U_{\mathrm{reg}}\).  Indeed, for a relatively
ample line bundle \(\mathcal A\) on \(Y'\), the rank-one reflexive
sheaf \((\ell_*\mathcal A)^{**}\) is locally invertible on the smooth
base.  Its pullback agrees with \(\mathcal A\) off codimension two
and hence everywhere there, by reflexivity on the normal source.
A positive-dimensional fiber over a smooth point would then have
degree zero against \(\mathcal A\), contradicting relative ampleness.

Push \(A_i\) forward to a Weil divisor on \(U\), and let \(D_i'\) be
its strict transform on \(Y'\).  These are actual locally finite
analytic divisors defined on all of the current \(Y'\).  We apply
\(\Q\)-factoriality precisely in the sense of
\cite[Definition~2.38]{FujinoAnalyticMMP}: every prime divisor
defined on a neighborhood of the whole set \(\ell^{-1}(K')\)
is \(\Q\)-Cartier at each point of that set.  Properness makes
\(\ell^{-1}(K')\) compact, and local finiteness leaves only finitely
many prime components of the \(D_i'\) near it.  A finite cover of
this full compact and a common multiple therefore give an integer
\(m_{\mathrm{div}}>0\) and an open neighborhood of \(\ell^{-1}(K')\)
on which every \(m_{\mathrm{div}}D_i'\) is Cartier.  By properness,
choose an open set \(U_1\) with \(K'\subset U_1\subset U\) whose full
inverse image is contained in that neighborhood, and put
\[
 \mathcal N_i=\mathcal O_{Y'}(m_{\mathrm{div}}D_i')|_{\ell^{-1}U_1}.
\]
This completes the use of \(\Q\)-factoriality on the specified full
compact; all later restrictions use these fixed line bundles.
In particular, the change-of-compact issue in
\cite[Remark~2.39]{FujinoAnalyticMMP} does not arise.  On the
regular open, where both \(g\) and \(\ell\) are isomorphisms,
\begin{equation}\label{eq:curve-regular-bundles}
 \mathcal N_i|_{U_{1,\mathrm{reg}}}
 \simeq L_i^{\otimes m_{\mathrm{div}}}|_{U_{1,\mathrm{reg}}}.
\end{equation}

Choose connected curve domains
\[
 B_0\Subset B_1\Subset\operatorname{int}_{T^\circ}(K_*)
\]
such that \(\pi_1(B_0)\to\pi_1(T^\circ)\) is surjective; nested
smaller cores obtained by enlarging the omitted discs have this
property.  The larger domain lets us control finitely many components
near \(\overline B_0\) and make their discrete exceptional sets finite
on that compact.  Work in the ambient open of \(U_1\) obtained by removing
\(T^\circ\setminus B_1\), so that \(B_1\) is closed there.
The inverse image of \(B_1\) is proper over \(B_1\).
Local finiteness of its analytic components, compactness of
\(\ell^{-1}(\overline B_0)\), and properness allow us first to
replace \(B_1\) by a neighborhood of \(\overline B_0\) on whose
inverse image only finitely many components occur.

We claim that deleting finitely many points from \(B_0\) gives a
connected curve domain \(B\) with
\(\pi_1(B)\to\pi_1(T^\circ)\) surjective and the following fiber
description.  All fibers of \(\ell\) over \(B\) have dimension at
most one.  The finitely many irreducible surface components
\(S_1,\ldots,S_s\) of the reduced inverse image of \(B\), counted
after this restriction, all dominate \(B\).  Their normalizations
factor as
\[
 \widehat S_\alpha\xrightarrow{\,h_\alpha\,}C_\alpha
 \longrightarrow B \qquad (1\le\alpha\le s),
\]
where \(C_\alpha\to B\) is a connected finite \'etale cover and
\(h_\alpha\) is a smooth proper family of connected curves.  A cover
that splits on restriction contributes separate components to this
list.  For each fixed \(t\in B\), the pairs \((\alpha,c)\) with
\(c\in C_\alpha\) over \(t\) supply distinct irreducible curves and
exhaust the irreducible curves of \(\ell^{-1}(t)\).  Each smooth
connected normalization fiber maps birationally to the curve it
supplies.

We verify this description by spelling out the finite exclusions.
Smallness gives \(\dim\Exc(\ell)\le2\), so a general fiber above
\(B_1\) has dimension at most one.  The locus of larger fibers is a
proper analytic subset of \(B_1\), by the fiber-dimension theorem
for proper maps.  For each surface component of the reduced inverse
image that dominates \(B_1\), take its normalization and then its Stein factor over the
curve.  The normalization is proper and is a normal surface.
Its singularities are isolated.  Away from the branch values of the
finite Stein factor and the critical values of the map from the
normalization, it is a smooth proper family of connected curves
over a finite unramified cover.  The values at which an intersection
of two components, or the nonisomorphism locus of a normalization,
contains a whole fiber curve also form a discrete analytic subset:
these loci have dimension at most one, and their general fibers
over the base are zero-dimensional.  Finally remove the images of
components lying over a point.  Each of these excluded sets is
discrete on the larger curve domain \(B_1\); there are only finitely
many components, so their union meets \(\overline B_0\) in a finite
set.

Delete those finitely many points from \(B_0\) and call the result
\(B\).  It is connected, and
\(\pi_1(B)\to\pi_1(T^\circ)\) is still surjective: loops in \(B_0\)
may be perturbed away from a finite set.  The exclusions give the
asserted fiber description and families.

For each \(\alpha,i\), let
\[
 d_{\alpha i}
 =\deg\bigl(\mathcal N_i|_{h_\alpha^{-1}(c)}\bigr),
 \qquad c\in C_\alpha,
\]
where pullback to \(\widehat S_\alpha\) is understood.  This integer
is independent of \(c\), by constancy of degree in a smooth proper
family over the connected curve \(C_\alpha\).  Because its fiber
maps birationally to the curve it supplies, this is also the degree
of \(\mathcal N_i\) on that fiber curve of \(\ell\).
We claim that the map
\begin{equation}\label{eq:curve-degree-map}
 \Q^{b_T}\longrightarrow\Q^s,\qquad
 (c_i)_i\longmapsto
 \left(\sum_i c_i d_{\alpha i}\right)_\alpha
\end{equation}
is injective.

Suppose its value is zero, and fix \(t\in B\).  Every irreducible
curve in \(F'_t=\ell^{-1}(t)\) then has degree zero against
\(\sum_i c_i c_1(\mathcal N_i)\).  The fiber has dimension at most
one.  Its rational \(H_2\) is spanned by the fundamental classes of
its irreducible curves, also when the fiber is nonreduced, and
\(H^2(F'_t,\Q)\) is the rational dual of \(H_2(F'_t,\Q)\).
The restricted Chern class is therefore zero.  Proper base change
identifies it with the germ in \((R^2\ell_*\Q)_t\).
Restriction through the isomorphism over the regular open gives
the natural map
\[
 (R^2\ell_*\Q)_t\longrightarrow (R^2j_*\Q)_t
     =(\mathcal V_T)_t,
\]
so the corresponding punctured class is zero as well.  By
\eqref{eq:curve-regular-bundles}, the restrictions of
\(\sum_i c_i c_1(\mathcal N_i)\) and
\(m_{\mathrm{div}}\sum_i c_i c_1(L_i)\) agree on their common regular
open.  Taking their germ in \((R^2j_*\Q)_t\) and applying
\eqref{eq:branch-link-stalk-map} to the latter identifies that zero
class with
\[
 m_{\mathrm{div}}\sum_i c_i\,q_T(\sigma_i(t)).
\]
These vectors are independent; hence every \(c_i=0\).  This proves
\eqref{eq:curve-degree-map}, and in particular
\begin{equation}\label{eq:curve-surface-count}
 s\ge b_T.
\end{equation}

\emph{Step 4. Distinct global discrepancy-two divisors.}
Take an ambient open \(U_B\subset U_1\) whose intersection with
\(T^\circ\) is the closed subspace \(B\), obtained as above by
removing \(T^\circ\setminus B\).  Each \(S_\alpha\) is a closed
analytic surface in \(\ell^{-1}U_B\).  Since \(Y'\) is terminal,
it is smooth in codimension two by
\cite[Lemma~2.3]{CanonicalKahler}.  Thus at a general point of
\(S_\alpha\) both the ambient space and the surface are smooth.
Blow up its coherent ideal and normalize.  The unique divisor
dominating that dense smooth part defines a local place \(v_\alpha\)
of ordinary log discrepancy \(2\) over \(Y'\), the value for a
smooth codimension-two blowup.  Canonical crepancy of \(\ell\)
gives
\[
 a(v_\alpha;U_B,0)=2,\qquad
 \cent_{U_B}(v_\alpha)=B.
\]
The \(v_\alpha\) are distinct because their centers on \(Y'\) are
the distinct \(S_\alpha\).

It remains to represent each \(v_\alpha\) by a prime divisor on
\(g^{-1}U_B\) and show that these local divisors arise from distinct
global components of \(\Exc(g)\).

On the fixed global resolution, the relative canonical divisor is
intrinsic even if the canonical bundle has no global divisor
representative.  Using the fixed \(m_{\mathrm{can}}\), divide by
\(m_{\mathrm{can}}\) the divisor of the
natural meromorphic comparison
\(g^*\omega_Y^{[m_{\mathrm{can}}]}\dashrightarrow
\omega_{\widetilde Y}^{\otimes m_{\mathrm{can}}}\), and denote the
result by \(K_{\widetilde Y/Y}\).  It is exceptional; write
\[
 K_{\widetilde Y/Y}=\sum_E\kappa_EE.
\]
The natural canonical comparisons commute with restriction and
composition, so this divisor supplies the relative discrepancy term
on \(U_B\) as well.
Every \(\kappa_E\) is strictly positive by terminality.  The
principalization of the ideal of \(\Sing Y\) says that
\(g^{-1}(\Sing Y)\) is supported on these exceptional divisors.
Put \(\widetilde U_B=g^{-1}U_B\), and consider \(v_\alpha\) on a
common proper model with \(\widetilde U_B\).  If it were exceptional
over this smooth resolution, then \(a(v_\alpha;\widetilde U_B,0)\ge2\).
Its center on the
resolution maps into \(B\subset\Sing Y\), so it is contained in at
least one of the \(E\), with \(\ord_{v_\alpha}(E)>0\).
The discrepancy formula would give
\[
 a(v_\alpha;U_B,0)
 =a(v_\alpha;\widetilde U_B,0)
    +\sum_E\kappa_E\ord_{v_\alpha}(E)>2,
\]
a contradiction.  Thus \(v_\alpha\) is represented by a prime
divisor on \(g^{-1}U_B\).  Since \(U_B\cap T=B\), this local divisor
is an irreducible component of \(E|_B\) for a global exceptional
divisor \(E\) with \(g(E)=T\).

Such a global divisor cannot split into two components over \(B\).
Indeed the connected finite cover \(\widehat T_E^\circ\to T^\circ\) in
\eqref{eq:global-divisor-family} remains connected over \(B\):
the action of \(\pi_1(T^\circ)\) on a fiber is transitive, and
\(\pi_1(B)\) has the same image.  Over this connected cover the
restriction of \(E\) is a smooth proper family with connected
fibers, so its total space is connected and smooth, hence
irreducible.  Therefore the distinct local divisors representing
the \(v_\alpha\) come from distinct global components \(E\) of
\(\Exc(g)\).  Their global centers are \(T\), and their ordinary
log discrepancies are \(2\), since this equality holds on the
open over \(B\).  Together with \eqref{eq:curve-surface-count},
this proves the proposition.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{thm:branch}]
Every global place of ordinary log discrepancy \(2\) whose center
is a singular curve is represented by a component of \(\Exc(g)\).
Indeed the same discrepancy computation in the last part of
Proposition~\ref{prop:curve-places} would otherwise make its
discrepancy strictly greater than \(2\).  There are only finitely
many such components on the compact resolution, so
\(\tau_Y(Q)\) is finite.  Proposition~\ref{prop:curve-places},
summed over the singular curves contained in \(Q\), gives
\[
 \sum_{T\subset\Sing Y\cap Q} b_T\le\tau_Y(Q).
\]
Combining this with \eqref{eq:branch-topological-bound} yields
\[
 \beta(Q)\le \sum_j c_2(Q_j^\nu)+\tau_Y(Q),
\]
as required.
\end{proof}

\section{The difficulty on the terminal chain}\label{sec:difficulty}

We now construct an integer that is nonnegative at the crepant terminal
junctions and nonincreasing along the moves between them.  The local
subtraction of surface contributions and the correction by cycle ranks on
boundary normalizations adapt the projective construction in
\cite[Definition~4.2, Lemma~4.3, and Section~7]{ProjectiveLCFourfolds}.
We give the required finiteness and comparison arguments in the analytic
setting.

Use the terminal chain of Proposition~\ref{prop:terminal-junctions}, after
the truncation in Proposition~\ref{prop:surface-finiteness}.  Its finite set
of prime labels is denoted by \(\mathcal H\).  On a current model its
boundary is
\[
 \Theta=\sum_{h\in\mathcal H}b_hS_h,\qquad 0\leq b_h<1.
\]
The labels persist by strict transform, including those of coefficient
zero, and the coefficients are nonincreasing.  The fixed coefficients have
already become constant.  Every varying coefficient is positive; at a
junction \(h_i:Y_i\to X_i\), its label is exceptional for \(h_i\) and has
image of dimension at most one.  Each model of the chain is strong and
compact K\"ahler, the generalized pair is terminal, and the underlying
fourfold is ordinarily terminal.

Choose a positive integer \(N\) that clears the fixed label coefficients,
the coefficients of the initial boundary of the particular strong
generalized klt sequence under study, and its fixed nef datum: on the chosen
higher carrier, \(N\M\) is represented by an integral Cartier divisor.
These are finite rational data.  We impose no denominator condition on a
varying coefficient.  For \(u\in\R\), put
\begin{equation}\label{eq:difficulty-weights}
 \omega(u)=\left\lceil N\max\{u,0\}\right\rceil,
 \qquad
 w(E)=\omega\bigl(2-a(E;Y,\Theta+\M)\bigr),
\end{equation}
where \(E\) is a global divisorial place and the current pair is understood
in \(w(E)\).  Thus \(w(E)>0\) exactly when the discrepancy is less than
two; discrepancy equal to two has weight zero.

For a fixed label, \(\omega(b_h)=Nb_h\), so its contribution incurs no
rounding loss in the local estimate below.  The conditions on the initial
boundary and nef carrier will give the lattice at the positive endpoint in
Lemma~\ref{lem:positive-surface}.  The earlier surface lattice has already
served to choose the tail; \(N\) need not clear every element of
\(\mathcal A_{\mathrm{surf}}\).

\subsection{Echoes and finite local corrections}

The recurring places over a generic codimension-two boundary center are
the echoes of \cite[Example~1.4, Lemma~1.5, and Definition~2.3]{AlexeevHaconKawamata2007}.
The full chain matters: \cite[Example~2.1]{Fujino2005Addendum} shows why
removing only the first blowup does not make a boundary difficulty finite.

First consider an irreducible compact analytic surface \(V\subset S_h\)
whose general point lies in a smooth open of \(Y\) where \(S_h\) is smooth,
no other label occurs, and \(\M\) descends.  The following sequence of
global places records the predictable contribution above such a surface.
Blow up the coherent ideal of \(V\) globally and normalize.  The global
exceptional divisor has a unique irreducible component dominating the dense
smooth open of \(V\); call its place \(E_{V,h,1}\).  On this normalized
blowup, its analytic intersection with the strict transform of \(S_h\)
has a unique irreducible component dominating that same open of \(V\).
Blow up the coherent ideal of this global component, normalize, and take
the unique new exceptional prime over that open.  Repeat this operation on
these normalized blowups, denoting the successive places by
\(E_{V,h,j}\), \(j\geq1\).  The models are smooth at the general points
of the indicated intersections, so each next component exists and is
unique there.  When another higher model is needed for comparison, a common
proper model identifies these same global places by strict transform.  We
call them the \emph{echoes} of \(S_h\) above \(V\).

The first exceptional prime has crepant boundary coefficient
\(-(1-b_h)\).  At stage \(j\) this coefficient is \(-j(1-b_h)\): blowing
up its intersection with the strict label adds one more \(-(1-b_h)\).
Consequently
\begin{equation}\label{eq:echo-discrepancy}
 a(E_{V,h,j};Y,\Theta+\M)=1+j(1-b_h).
\end{equation}
The contributing echoes are precisely those with \(j(1-b_h)<1\).  In
particular there are only finitely many contributing indices for each
\(b_h<1\).  Define the \emph{default contribution} of label \(h\) by the finite sum
\begin{equation}\label{eq:echo-default}
 d_h=\sum_{j\geq1}\omega\bigl(1-j(1-b_h)\bigr).
\end{equation}
Here terms outside the finite set just described are zero.  If \(b_h=0\),
then \(d_h=0\).  If \(b_h>0\), its first term gives
\(d_h\geq\omega(b_h)\geq1\).  Each summand is nonincreasing as \(b_h\)
decreases, and no new positive index can appear.  Hence every \(d_h\) is a
nonincreasing nonnegative integer along the chain.  After discarding
finitely many further junctions, all \(d_h\) are constant, including
throughout each intervening finite string of moves.  Indeed each of the
finitely many integers can drop only finitely often, while coefficients
stay unchanged during the small steps.  We henceforth use this truncated
chain and these constant values \(d_h\).

On a fixed model, the generic echo contribution is the only contribution
that can recur over infinitely many surface centers.  We now justify this
claim.  All places in the following proposition are
global divisorial places.

\begin{proposition}[Finiteness below discrepancy two]
\label{prop:difficulty-finite}
Let \((Y,\Theta+\M)\) be a model of the truncated terminal chain.
Among the places exceptional over \(Y\) with discrepancy less than two,
there are only finitely many whose centers have codimension at least three.
For each fixed irreducible compact analytic surface \(V\subset Y\), there
are only finitely many whose center is \(V\).

There is a finite set \(\mathcal V_Y\) of irreducible compact analytic
surfaces with the following additional property.  If
\(V\notin\mathcal V_Y\), its general point lies in a smooth open where
\(\M\) descends and either no label occurs or exactly one smooth label
\(S_h\) occurs.  There are no positive-weight places centered on \(V\)
in the first case or when \(b_h=0\).  When \(b_h>0\), they are exactly the
echoes \(E_{V,h,j}\) with \(j(1-b_h)<1\).
\end{proposition}

\begin{proof}
Take a projective resolution \(\pi:W\to Y\) with \(W\) smooth and carrying \(\M\),
with divisorial exceptional locus, and resolving all labels.  Further
blowups of intersections in the simple normal crossing divisor make the
strict transforms of the labels smooth and pairwise disjoint, while keeping
the full divisor simple normal crossing.  Write
\[
 K_W+\Theta_W+M_W=\pi^*(K_Y+\Theta+M_Y).
\]
Every \(\pi\)-exceptional component of \(\Theta_W\) has coefficient
\(1-a(E;Y,\Theta+\M)<0\), by generalized terminality.  The only possible
positive components of \(\Theta_W\) are therefore the strict transforms
of the positive labels.  On higher models the nef datum pulls back from \(W\), so the
discrepancy calculation is the ordinary one for the signed boundary
\(\Theta_W\).

Consider a place \(E\) that is also exceptional over \(W\), and let its
center on \(W\) have codimension \(c\geq2\).  At a general smooth point
of this center choose normal parameters \(x_1,\ldots,x_c\).  The Jacobian
formula on a smooth model carrying \(E\) gives
\[
 a(E;W,0)\geq\sum_{i=1}^c\ord_E(x_i),
 \qquad \ord_E(x_i)\geq1.
\]
Indeed, in the pullback of a local volume form at most one differential
factor can lose one order along \(E\); adding one to the Jacobian order
gives the displayed bound.  If the center lies in no positive component of
\(\Theta_W\), the signed boundary can only raise this discrepancy, which
is at least two.  Otherwise it lies in a unique positive smooth label of
coefficient \(b<1\).  Taking \(x_1\) as its local equation and discarding
the negative boundary terms gives
\begin{equation}\label{eq:local-discrepancy-estimate}
 a(E;Y,\Theta+\M)
 \geq (1-b)\ord_E(x_1)+\sum_{i=2}^c\ord_E(x_i).
\end{equation}
A discrepancy less than two thus forces \(c=2\) and containment in a
positive label.  A label of coefficient zero cannot give such a place.

If this codimension-two center is contained in \(\Exc(\pi)\), it is a
component of the intersection of its label with one of the finitely many
exceptional divisors.  There are only finitely many such centers.  If it
meets the isomorphism open, its general point maps isomorphically to a
surface downstairs, and the center is the strict transform of that surface.
Thus a center mapping to codimension at least three belongs to the first
finite list, and for any fixed surface downstairs there are only finitely
many possible centers on \(W\).

There are only finitely many places of discrepancy less than two whose
center on \(W\) equals a fixed one of these codimension-two centers.  To see this, discard the negative
components of \(\Theta_W\); this lowers discrepancies, so it suffices to
work with the single smooth label of coefficient \(b\).  Blow up the center
generically.  The new exceptional coefficient is \(-(1-b)\).  A further
place with discrepancy less than two has its center in that exceptional
divisor; the estimate \eqref{eq:local-discrepancy-estimate} also forces a
codimension-two center in the strict label.  It must therefore follow their
intersection above the general point of the original center.  At stage
\(j\) the most recent exceptional coefficient is \(-j(1-b)\), and the
older exceptional divisors do not meet this generic intersection.  A place
above it that is still exceptional has discrepancy at least
\[
 (1-b)+1+j(1-b)=1+(j+1)(1-b).
\]
This reaches two after finitely many stages.  The same argument shows that,
where no other boundary or nef data enter, the places below two are exactly
the echoes in \eqref{eq:echo-discrepancy}.

This generic computation identifies global places.  At each global blowup
there is a unique irreducible component of its exceptional divisor that
dominates the dense smooth part of the center.  The global analytic
intersection of that prime with the strict label then has a unique
irreducible component dominating the same part.  These global components
have coherent ideals, which define the next global blowups.  Conversely,
one can follow any given global place on common higher models through these
blowups; when its center becomes a divisor on a normal model, that divisor
represents the place.  Thus the computation does not count different local
pieces of one place separately.

Finally include the finitely many divisors on \(W\) that are exceptional
over \(Y\).  The complement of the isomorphism open, and the loci where a
label fails to be smooth and alone or the nef datum fails to descend, are
contained in a proper analytic subset of \(Y\) of codimension at least
two.  Such a subset has only finitely many surface components on the compact
fourfold.  Take these components for \(\mathcal V_Y\), enlarging the set
by the finitely many surface images already encountered if necessary.
Outside them the preceding one-label calculation applies, or there is no
positive label and no place of positive weight.  This proves all assertions.
\end{proof}

For an irreducible compact analytic surface \(V\subset Y\), let
\begin{equation}\label{eq:difficulty-branches}
 r_{V,h}=\#\{D:\ D\text{ is a prime divisor of }S_h^\nu
                         \text{ mapping onto }V\}.
\end{equation}
This number is finite, because normalization is finite and the inverse
image of \(V\) has finitely many components on the compact normalization.
It is zero if \(V\not\subset S_h\).  It counts prime divisors on the
normalization, without counting their possible multiple sheets over \(V\)
as separate divisors.

Every place with center a surface, curve, or point on the normal fourfold
is exceptional over it: a place with a divisor as center is represented by
that divisor.  Hence the two raw sums below involve only exceptional
places.  Proposition~\ref{prop:difficulty-finite} makes the local sum
\(\sum_{\cent_Y(E)=V}w(E)\) finite after zero terms are omitted.  Although
this raw sum is finite at each fixed surface, the same nonzero contribution
\(d_h\) can recur at infinitely many surfaces in a label.  We therefore
subtract the branch contributions at each surface before summing over
surfaces.  Define the integer
\begin{equation}\label{eq:difficulty-bracket}
 q_Y(V)=\sum_{\cent_Y(E)=V}w(E)-\sum_{h\in\mathcal H}r_{V,h}d_h.
\end{equation}
Only finitely many \(q_Y(V)\) are nonzero.  Indeed, outside the finite set
in Proposition~\ref{prop:difficulty-finite}, a surface on a positive label
has raw sum \(d_h\), with \(r_{V,h}=1\) and all other branch counts zero.
A surface generically on a sole zero-coefficient label has both raw sum and
default zero, as does a surface away from all labels.  These cases exhaust
the surfaces outside that finite set.

We may therefore define the difficulty by
\begin{equation}\label{eq:difficulty}
 \begin{aligned}
 \mathfrak D(Y,\Theta+\M)
 ={}&\sum_{\codim_Y\cent_Y(E)\geq3}w(E)
   +\sum_{\substack{V\subset Y\\\dim V=2}}q_Y(V)\\
 &+\sum_{h\in\mathcal H}d_hc_2(S_h^\nu),
 \end{aligned}
\end{equation}
where the surface sum is over irreducible compact analytic surfaces.
The first sum has finitely many nonzero terms by
Proposition~\ref{prop:difficulty-finite}; the second has just been shown
to have finite support; and the last is finite because \(\mathcal H\) is
finite and every analytic cycle rank is finite.  Thus \(\mathfrak D\) is
an integer.  The subtraction in \eqref{eq:difficulty-bracket} is performed
at each surface before the second sum is taken.  Both a local bracket and
the difficulty on an intermediate model are at this point allowed to be
negative.

\subsection{The lower bound at the junctions}

The possible negative part of a surface bracket comes only from rounding
the contributions of varying labels.  For a surface \(V\), put
\[
 r_V^{\mathrm{var}}=\sum_{h\text{ varying}}r_{V,h}.
\]
We first prove, on every current terminal model, that
\begin{equation}\label{eq:difficulty-local-bound}
 q_Y(V)\geq-\max\{r_V^{\mathrm{var}}-1,0\}.
\end{equation}

The underlying fourfold is ordinarily terminal by
Lemma~\ref{lem:ordinary-singularities}, hence smooth at general points of
\(V\).  Blow up \(V\) generically to obtain a global exceptional
place \(E_V\).  For each label let \(m_h\) be its multiplicity transverse
to \(V\) at a general point, taking \(m_h=0\) if it does not contain
\(V\).  The ordinary log discrepancy of \(E_V\) is two.  On a common
carrier \(\pi:W\to Y\) carrying this place, the nef defect
\(J=\pi^*M_Y-M_W\) is effective by Lemma~\ref{lem:nef-defect}.  If \(j_V\) is its coefficient at
\(E_V\), the discrepancy formula and generalized terminality give
\begin{equation}\label{eq:difficulty-first-blowup}
 a(E_V;Y,\Theta+\M)=2-\sum_hm_hb_h-j_V>1,
 \qquad j_V\geq0.
\end{equation}
In particular \(\sum_hm_hb_h<1\).

We also have \(r_{V,h}\leq m_h\).  To see this analytically, work at a
general smooth point of \(V\).  Each prime divisor of \(S_h^\nu\) counted
by \(r_{V,h}\) gives at least one point of the finite normalization over
that point of \(V\); the points supplied by distinct prime divisors can be
taken distinct after avoiding their special loci.  They correspond to
distinct local analytic branches of \(S_h\), each containing the germ of
\(V\).  Each branch contributes at least one to the transverse multiplicity
\(m_h\).  A normalization divisor with several sheets may supply more
than one local branch, which preserves the stated inequality.

Let \(t=r_V^{\mathrm{var}}\), and list the numbers \(Nb_h\) for varying
labels, repeating each one \(r_{V,h}\) times, as
\(x_1,\ldots,x_t\).  The fixed contribution
\(k=N\sum_{h\text{ fixed}}r_{V,h}b_h\) is a nonnegative integer.  For
\(t\geq1\), the ceiling inequality gives
\[
 \left\lceil k+\sum_{\ell=1}^t x_\ell\right\rceil
 \geq k+\sum_{\ell=1}^t\lceil x_\ell\rceil-(t-1).
\]
For \(t=0\) the left side is \(k\).  Using effectivity,
\(m_h\geq r_{V,h}\), and \eqref{eq:difficulty-first-blowup}, we obtain in
both cases
\begin{equation}\label{eq:difficulty-first-weight}
 w(E_V)\geq\sum_h r_{V,h}\omega(b_h)
              -\max\{r_V^{\mathrm{var}}-1,0\}.
\end{equation}
No rounding loss is needed for a fixed label because \(Nb_h\) is integral.

It remains to supply the terms of \(d_h\) with \(j\geq2\).  Such a term
is positive only if \(b_h>1/2\); when \(b_h=1/2\), the second echo has
discrepancy exactly two and weight zero.  The strict inequality
\(\sum_hm_hb_h<1\) implies that at most one label through \(V\) has
coefficient greater than \(1/2\), and its multiplicity is one.  This label
is smooth at general points of \(V\) and has \(r_{V,h}=1\).  Use its
successive generic blowups above \(V\).  For each \(j\geq2\) with a
positive default, the resulting global place is distinct from \(E_V\) and
from all the others.  With this label alone its discrepancy is
\(1+j(1-b_h)\).  The other effective boundary components and the effective
nef defect only lower the discrepancy.  Its actual weight is therefore at
least \(\omega(1-j(1-b_h))\).  These places supply every remaining
default.  Adding their weights to \eqref{eq:difficulty-first-weight}
proves \eqref{eq:difficulty-local-bound}, including the cases with no
varying label or with zero coefficients.

\begin{proposition}[Lower bound at crepant junctions]
\label{prop:difficulty-lower}
At every crepant junction \(h_i:(Y_i,\Theta_i+\M)\to(X_i,B_i+\M)\) of
the truncated chain,
\[
 \mathfrak D(Y_i,\Theta_i+\M)\geq0.
\]
\end{proposition}

\begin{proof}
Write \(Y=Y_i\) and let
\(Q=\bigcup_{h\text{ varying}}S_h\) with its reduced structure.  If
\(Q\) is empty, \eqref{eq:difficulty-local-bound} makes every surface
bracket nonnegative, and the other terms of \eqref{eq:difficulty} are
nonnegative.  Suppose \(Q\ne\varnothing\).  At this junction the map
\(h_i\) is projective bimeromorphic from an ordinarily terminal compact
K\"ahler fourfold, and \(\dim h_i(Q)\leq1\) by
Proposition~\ref{prop:surface-finiteness}.  Thus Theorem~\ref{thm:branch}
applies.  For a surface \(V\subset Q\), its branch count in that theorem
is \(r_V(Q)=r_V^{\mathrm{var}}\geq1\); the last inequality follows from
the finite surjective normalizations.  Surfaces outside \(Q\) have
\(r_V^{\mathrm{var}}=0\).  The total possible deficit in
\eqref{eq:difficulty-local-bound} is consequently \(\beta(Q)\).

Every varying label has \(d_h\geq1\).  The places counted by
\(\tau_Y(Q)\) in Theorem~\ref{thm:branch} also each supply a weight of at
least one in the first sum of \eqref{eq:difficulty}.  In fact such a place
\(E\) has ordinary log discrepancy two and center a singular curve in
\(Q\).  It is exceptional over \(Y\).  Its center is contained in a
varying label of positive coefficient, and that effective label is
\(\Q\)-Cartier on the strong model.  Its order at \(E\) is therefore
strictly positive.  On a common carrier the discrepancy formula reads
\[
 a(E;Y,\Theta+\M)
 =2-\ord_E(\Theta)-\operatorname{coeff}_E(J)<2,
 \qquad J\geq0.
\]
The count \(\tau_Y(Q)\) uses distinct global places.  They occur as
distinct terms of the codimension-at-least-three sum, and none is a place
in a surface bracket.  Theorem~\ref{thm:branch} now gives
\[
 \beta(Q)
 \leq\sum_{h\text{ varying}}c_2(S_h^\nu)+\tau_Y(Q)
 \leq\sum_{h\in\mathcal H}d_hc_2(S_h^\nu)
       +\sum_{\codim_Y\cent_Y(E)\geq3}w(E).
\]
Summing \eqref{eq:difficulty-local-bound} and substituting this inequality
in \eqref{eq:difficulty} proves the assertion.  The branch inequality and
this lower bound have been used only at the junctions.
\end{proof}

\subsection{Exact change along the chain}

For a small step, the change in the normalization cycle ranks will cancel
the change in the surface defaults.  We establish this equality before
comparing the difficulties.

\begin{lemma}[Normalization cycle ranks]\label{lem:difficulty-ranks}
Consider a small step of the terminal chain, with exceptional loci
\(L,L^+\),
\[
 Y\xrightarrow{f}Z\xleftarrow{f^+}Y^+.
\]
For each label \(h\), let \(e_h\) and \(e_h^+\) be the numbers of prime
divisors in \(S_h^\nu\) and \((S_h^+)^\nu\) lying over \(L\) and
\(L^+\), respectively.  Then these numbers are finite and
\begin{equation}\label{eq:difficulty-rank-change}
 \begin{gathered}
 e_h=\sum_{\substack{V\subset L\\\dim V=2}}r_{V,h},\qquad
 e_h^+=\sum_{\substack{V^+\subset L^+\\\dim V^+=2}}r_{V^+,h}^+,\\
 c_2(S_h^\nu)-c_2((S_h^+)^\nu)=e_h-e_h^+.
 \end{gathered}
\end{equation}
The surface sums run over irreducible compact analytic surfaces.
\end{lemma}

\begin{proof}
Let \(T_h\) be the normalization of the common image of the two labels in
\(Z\).  Restricting the projective maps, composing with finite
normalization, and factoring through \(T_h\) gives projective
bimeromorphic maps of normal compact threefolds
\[
 S_h^\nu\longrightarrow T_h\longleftarrow (S_h^+)^\nu.
\]
They identify over the common isomorphism open.  By
Lemma~\ref{lem:small-comparison}, the common exceptional image
\(A=f(L)=f^+(L^+)\) has dimension at most one.  A normalization divisor
lying over \(L\) has a surface as its image in \(S_h\), because
normalization is finite, and its image in \(T_h\) lies over \(A\).
It is therefore contracted by the displayed map.  Conversely, the map is
an isomorphism off the preimage of \(A\), so every contracted prime divisor
lies over \(L\).  These are exactly the primes counted in the first sum
in \eqref{eq:difficulty-rank-change}.  The same reasoning holds on the
positive side.  The exceptional loci have finitely many surface components,
which also proves finiteness.

We use the following independence fact.  For a projective bimeromorphic
map \(g:S\to T\) of normal compact threefolds, the classes in
\(H_4(S,\Q)\) of the prime divisors contracted by \(g\) are linearly
independent.  Take a resolution \(r:\widetilde S\to S\) that is projective,
has smooth source, and is an isomorphism over \(U=S_{\mathrm{reg}}\).  Put
\(R=r^{-1}(S\setminus U)\).  Normality gives \(\dim(S\setminus U)\leq1\),
and \(\dim R\leq2\).  If a rational combination of the contracted divisor
classes vanished on \(S\), the corresponding combination of strict
transforms would restrict to zero in \(H_4^{\BM}(U,\Q)\).  The localization
sequence
\[
 H_4(R,\Q)\longrightarrow H_4(\widetilde S,\Q)
                  \longrightarrow H_4^{\BM}(U,\Q)
\]
then shows that its class is a rational combination of the classes of the
surface components of \(R\); those classes span \(H_4(R,\Q)\).  Subtract
that combination.  We obtain a homologically trivial rational Cartier
divisor on \(\widetilde S\), all of whose components are exceptional over
\(T\).  For the components of \(R\), this follows since their images in
\(S\), hence in \(T\), have dimension at most one.  On the smooth compact
resolution, homological triviality makes this divisor numerically trivial
on every curve by the ordinary class pairing.  Analytic negativity in both
signs, in the form of \cite[Lemma~2.2]{CanonicalKahler}, makes the
divisor zero.  The strict transforms of the original divisors are distinct
from the resolution-exceptional ones, so all original coefficients vanish.
This proves independence without any factoriality assumption on \(S\).

For either label normalization, restrict its span of compact analytic
surface classes to the common open over \(T_h\setminus\nu^{-1}(A)\),
where \(\nu:T_h\to f(S_h)\) is normalization.  The complement of this
open in either normalization has dimension at most two.  Localization shows that the kernel of this
restriction is spanned by its surface components, precisely the contracted
prime divisors just counted.  Their independence makes the kernel dimension
\(e_h\) on one side and \(e_h^+\) on the other.  The two images agree:
any compact analytic prime surface not removed has a strict transform on
the other normalization through their proper graph over \(T_h\), and the
two classes restrict to the same class on the common open.  The same holds
in the reverse direction.  Subtracting the dimensions of these two cycle
spans proves the last equality in \eqref{eq:difficulty-rank-change}.
\end{proof}

\begin{proposition}[Change of the difficulty]\label{prop:difficulty-change}
The difficulty is nonincreasing under every coefficient change and every
small step of the truncated terminal chain.  More precisely:
\begin{enumerate}
\item Suppose \(\Theta'\leq\Theta\) is a coefficient change on the same
model \(Y\), and write \(w(E)\) and \(w'(E)\) for its old and new weights.
The set
\[
 \mathcal C=\{E:\ E\text{ exceptional over }Y,\ w(E)\ne w'(E)\}
\]
is finite, and
\begin{equation}\label{eq:difficulty-coefficient-change}
 \mathfrak D(Y,\Theta+\M)-\mathfrak D(Y,\Theta'+\M)
 =\sum_{E\in\mathcal C}\bigl(w(E)-w'(E)\bigr)\geq0.
\end{equation}
\item For a small step \(Y\to Z\leftarrow Y^+\) with exceptional loci
\(L,L^+\), write \(w(E),w^+(E)\) for the two weights.  The set
\[
 \mathcal P=\{E:\ E\text{ exceptional over }Y,\
       \cent_Y(E)\subset L,\ w(E)+w^+(E)>0\}
\]
is finite.  Its center condition is equivalently
\(\cent_{Y^+}(E)\subset L^+\), and
\begin{equation}\label{eq:difficulty-small-change}
 \mathfrak D(Y,\Theta+\M)-\mathfrak D(Y^+,\Theta^++\M)
 =\sum_{E\in\mathcal P}\bigl(w(E)-w^+(E)\bigr)\geq0.
\end{equation}
\end{enumerate}
In either move, a strict decrease in the weight of any exceptional place
forces a strict decrease in the difficulty.
\end{proposition}

\begin{proof}
For a coefficient change, the removed boundary \(\Theta-\Theta'\) is
effective and \(\Q\)-Cartier on the strong model.  For every place,
\[
 a(E;Y,\Theta'+\M)-a(E;Y,\Theta+\M)
 =\ord_E(\Theta-\Theta')\geq0.
\]
Thus \(w(E)\geq w'(E)\).  The model, centers, branch counts, and
normalization ranks are unchanged, and the defaults \(d_h\) are constant
by the choice of the tail.  At a fixed surface the two raw sums are finite,
and therefore
\[
 q_Y(V)-q'_Y(V)=\sum_{\cent_Y(E)=V}\bigl(w(E)-w'(E)\bigr).
\]
Let \(\Sigma\) be the finite union of the supports of the two functions
\(q_Y\) and \(q'_Y\) on surfaces.  Outside \(\Sigma\) the displayed
sum is zero.  Every summand is nonnegative, so no exceptional place with
such a surface center can lose weight.  At each surface of \(\Sigma\)
only finitely many places have positive old or new weight, and there are
only finitely many positive weights at centers of codimension at least
three.  This proves that \(\mathcal C\) is finite.  Summing the displayed
identity over \(\Sigma\), adding the finite comparison in codimension at
least three, and canceling the unchanged rank term gives
\eqref{eq:difficulty-coefficient-change}.

For a small step, Lemma~\ref{lem:small-comparison} says that exceptionality
of a global place is the same on the two sides, that the two center
containment conditions in the statement are equivalent, and that
\(w(E)\geq w^+(E)\).  If a center is not contained in the exceptional
locus, its general point corresponds on the common isomorphism open and its
discrepancy is unchanged.  The set \(\mathcal P\) is finite: each
exceptional locus has dimension at most two and has finitely many surface
components; a surface center contained in it is one of these components.
Proposition~\ref{prop:difficulty-finite} gives finiteness above each such
surface and finiteness of all positive-weight places with lower-dimensional
centers, on both sides.

Surface centers not contained in \(L\) correspond by proper strict
transform to those not contained in \(L^+\).  At their general points the
places, discrepancies, and normalization primes over the surfaces
correspond, so the two local brackets agree.  The analogous correspondence
holds for the raw terms at lower-dimensional centers outside the exceptional
loci.  In the exceptional loci, every contributing place is counted exactly
once in the raw part on each side of \eqref{eq:difficulty}.  This remains
true if its center changes from a surface to a curve or point, or conversely.
The finite comparison of those raw parts is therefore
\(\sum_{E\in\mathcal P}(w(E)-w^+(E))\).  The subtracted defaults on the
exceptional surfaces have difference \(-\sum_h d_h(e_h-e_h^+)\).  Hence
\begin{align*}
 &\mathfrak D(Y,\Theta+\M)-\mathfrak D(Y^+,\Theta^++\M)\\
 &\quad=\sum_{E\in\mathcal P}\bigl(w(E)-w^+(E)\bigr)
       -\sum_h d_h(e_h-e_h^+)
       +\sum_h d_h\bigl(c_2(S_h^\nu)-c_2((S_h^+)^\nu)\bigr)\\
 &\quad=\sum_{E\in\mathcal P}\bigl(w(E)-w^+(E)\bigr),
\end{align*}
where the last equality is Lemma~\ref{lem:difficulty-ranks}.  This is
\eqref{eq:difficulty-small-change}.  Every summand is nonnegative.  A
strictly decreasing exceptional weight must have its center in the
exceptional loci, since weights agree off them, and is in \(\mathcal P\).
A positive weight that becomes zero is included by the definition of
\(\mathcal P\).  The same positivity is immediate in
\eqref{eq:difficulty-coefficient-change}; this proves strictness in both
cases.
\end{proof}

\section{Termination and the log canonical reduction}\label{sec:completion}

We first show that a surface in the positive exceptional locus of a
downstairs diagram is detected by the integer difficulty.  The calculation
uses the weight denominator \(N\) chosen for the particular strong gklt
sequence under consideration.  We then prove
termination for strong gklt models, pass to elementary gdlt programs, and
lift the arbitrary diagrams of Theorem~\ref{thm:main} to those programs.

\begin{lemma}[A positive exceptional surface]\label{lem:positive-surface}
Use the truncated terminal chain of
Propositions~\ref{prop:terminal-junctions} and
\ref{prop:surface-finiteness}, with the integer \(N\), weights, and constant
defaults chosen in Section~\ref{sec:difficulty}.  If an irreducible compact
analytic surface \(V\) is contained in \(L_i^+\subset X_{i+1}\), there is
a global place \(E\), exceptional over both junctions and every model of
their connector, such that
\[
 a_{i+1}(E)\in(1,2]\cap N^{-1}\Z,
 \qquad w_i(E)\geq w_{i+1}(E)+1.
\]
Here \(w_i\) and \(w_{i+1}\) are the weights at the two crepant junctions.
Consequently
\[
 \mathfrak D(Y_i,\Theta_i+\M)
 >\mathfrak D(Y_{i+1},\Theta_{i+1}+\M).
\]
\end{lemma}

\begin{proof}
By Proposition~\ref{prop:surface-finiteness}, the model \(X_{i+1}\) is
smooth near the general point of \(V\), the junction morphism is an
isomorphism there, and the generic blowup of \(V\) gives a unique global
place \(E\) with
\[
 a^+:=a_{i+1}(E)>1.
\]
This place is exceptional over \(X_{i+1}\) and does not belong to the
stabilized extracted set \(\mathcal I\).  The blowup of the coherent ideal
of \(V\) is projective, so Lemma~\ref{lem:common-projective-models} gives a
smooth common model \(W\) carrying both \(E\) and the fixed nef datum,
with a projective morphism \(r:W\to X_{i+1}\).  By Lemma~\ref{lem:nef-defect},
\[
 J=r^*M_{i+1}-M_W\geq0.
\]
At the generic smooth codimension-two center, the ordinary log discrepancy
of the blowup is two.  The discrepancy formula is therefore
\begin{equation}\label{eq:positive-detector-discrepancy}
 a^+=2-\ord_E(B_{i+1})-\operatorname{coeff}_E(J).
\end{equation}
Both subtracted terms are nonnegative.  Thus \(a^+\leq2\).

We verify the denominator in this calculation.  By the choice in
Section~\ref{sec:difficulty}, \(N\) clears the coefficients of the initial
boundary and the Cartier denominator of the higher nef divisor of this
strong gklt sequence.  Since the downstairs boundaries are strict
transforms, \(NB_{i+1}\) is an integral Weil divisor.  Also \(NM_{i+1}\)
is an integral Weil divisor: it is the pushforward of the integral Cartier
divisor \(NM_W\) from a common carrier.  On the smooth open neighborhood of
the general point of \(V\), these two integral Weil divisors are Cartier.
Their orders at \(E\) are consequently integral after multiplication by
\(N\).  In particular,
\[
 N\ord_E(B_{i+1})\in\Z,
 \qquad
 N\operatorname{coeff}_E(J)
 =\ord_E(Nr^*M_{i+1})-\operatorname{coeff}_E(NM_W)\in\Z.
\]
Only Cartierness on this smooth open has been used.  Equation
\eqref{eq:positive-detector-discrepancy} gives
\(a^+\in(1,2]\cap N^{-1}\Z\).

Put \(a^-=a_i(E)\).  The strict part of
Lemma~\ref{lem:small-comparison} applies because
\(\cent_{X_{i+1}}(E)=V\subset L_i^+\), and gives \(a^-<a^+\).  The same
lemma says that \(E\) is exceptional over both downstairs models.  Since
it does not belong to \(\mathcal I\), it is not an extracted prime on either
junction; it is therefore exceptional over both.  All the intervening
steps are small, so it stays exceptional on every model of the connector.

Crepancy identifies the discrepancies at the junctions with \(a^-\) and
\(a^+\).  Write \(k=N(2-a^+)\), a nonnegative integer.  Since
\(a^-<a^+\leq2\), the ceiling weights satisfy
\[
 w_i(E)=\left\lceil N(2-a^-)\right\rceil
 \geq k+1,
 \qquad
 w_{i+1}(E)=\left\lceil N(2-a^+)\right\rceil=k.
\]
This includes \(a^+=2\), when \(k=0\).  No denominator assertion for
\(a^-\) is needed.  The connector consists of one coefficient change and
a finite, possibly empty, string of small steps.  Its weights are
nonincreasing, so the strict decrease between its ends occurs in at least
one move.  The place \(E\) is exceptional throughout that move.
Proposition~\ref{prop:difficulty-change} makes the difficulty decrease
strictly there and nonincrease in every other move, proving the claim.
\end{proof}

\begin{theorem}[Termination on strong gklt models]\label{thm:strong-gklt}
Every sequence satisfying the hypotheses of Theorem~\ref{thm:main} for
which all the models \(X_i\) are globally strongly \(\Q\)-factorial and
the initial pair \((X_0,B_0+\M)\) is gklt is finite.  The small diagrams
may be chosen arbitrarily subject to the hypotheses of that theorem.
\end{theorem}

\begin{proof}
Suppose such a sequence were infinite.  Apply
Proposition~\ref{prop:terminal-junctions}, then
Proposition~\ref{prop:surface-finiteness}, and use the further truncation
and denominator choice of Section~\ref{sec:difficulty}.  At every junction
the difficulty is a nonnegative integer by
Proposition~\ref{prop:difficulty-lower}.  It is nonincreasing from one
junction to the next by Proposition~\ref{prop:difficulty-change}.  By
Lemma~\ref{lem:positive-surface}, it drops by at least one whenever the
positive exceptional locus contains a surface.  There can be only finitely
many such indices.  This argument uses the lower bound only at junctions;
it requires no lower bound on the intermediate models.

Pass to the remaining tail.  There \(\dim L_i^+<2\).  The dimension
inequality in Lemma~\ref{lem:small-comparison} forces \(\dim L_i=2\), so
\(L_i\) contains an irreducible compact analytic surface.  By
Lemma~\ref{lem:cycle-loss},
\[
 c_2(X_i)>c_2(X_{i+1})
\]
at every step of this tail.  These are nonnegative integers, a
contradiction.
\end{proof}

\begin{theorem}[Termination of elementary gdlt programs]\label{thm:gdlt}
Let
\[
 (T_0,B_0+\M)\dashrightarrow(T_1,B_1+\M)
 \dashrightarrow(T_2,B_2+\M)\dashrightarrow\cdots
\]
be a sequence of elementary steps for rational gdlt pairs on strong normal irreducible
compact K\"ahler fourfolds.  Assume that the boundaries are effective
rational divisors of finite support transported by the steps, that the
fixed b-divisor is represented by an analytically nef \(\Q\)-Cartier divisor
on a projective bimeromorphic normal compact K\"ahler model of \(T_0\), and
that the actual adjoints are \(\Q\)-Cartier with compatible canonical
representatives.  Then the sequence is finite.  The contraction bases and
the choices of elementary steps may vary.
\end{theorem}

\begin{proof}
An elementary program extracts no prime divisors.  Lemma~\ref{lem:cycle-loss} with \(k=3\)
therefore permits only finitely many divisorial steps.  If the sequence were
infinite, we could discard a finite prefix containing them and work on a
tail of small steps.
The rational b-line realization described in
Section~\ref{sec:preliminaries} has the same discrepancies and fixed higher
nef data; common projective carriers for finite portions carry their
analytically nef pullbacks.  Thus Theorem~\ref{thm:special-termination}
applies.  After a further tail, both exceptional loci of every step avoid
every generalized log canonical center on their respective sides.

Set \(H_i=\lfloor B_i\rfloor\).  Since the pair is glc and \(B_i\) is
effective, its coefficients belong to \([0,1]\), so \(H_i\) is the reduced
sum of its coefficient-one components.  Each such component is itself a
generalized log canonical center.  Hence \(\Supp H_i\) is disjoint from
the exceptional loci adjacent to \(T_i\) on this tail.  The divisors
\(H_i\) are effective and \(\Q\)-Cartier on the strong models, and they
are strict transforms of each other across the small steps.

Remove the whole floor and write
\[
 \widehat B_i=B_i-H_i,
 \qquad \widehat D_i=K_{T_i}+\widehat B_i+M_{T_i}=D_i-H_i.
\]
The new boundary is effective.  For every global place \(E\), comparison
of the two crepant equations gives
\begin{equation}\label{eq:full-floor-deletion}
 a(E;T_i,\widehat B_i+\M)
 =a(E;T_i,B_i+\M)+\ord_E(H_i).
\end{equation}
The added order is nonnegative.  If the old discrepancy is zero, the gdlt
definition says that the general point of its center is a stratum of the
coefficient-one boundary.  Taking its closure places the entire center in
\(\Supp H_i\).  The order of an effective \(\Q\)-Cartier divisor at a
place whose center lies in its support is strictly positive.  Thus every
former zero discrepancy becomes positive, and every former positive
discrepancy stays positive.  The pairs \((T_i,\widehat B_i+\M)\) are gklt.

We check the two ample signs after this full deletion.  For a step write
\[
 T_i\xrightarrow{f}Z\xleftarrow{f^+}T_{i+1},
 \qquad L=\Exc(f),\quad L^+=\Exc(f^+).
\]
Lemma~\ref{lem:small-comparison} gives a common exceptional image \(A\)
with \(L=f^{-1}(A)\), \(L^+=(f^+)^{-1}(A)\), and both maps isomorphisms
off \(A\).  Properness makes \(f(\Supp H_i)\) closed.  It is disjoint from
\(A\), because \(\Supp H_i\cap L=\varnothing\).  On the base open
\(Z\setminus f(\Supp H_i)\), which contains \(A\), the divisor \(H_i\)
vanishes, so \(-\widehat D_i=-D_i+H_i\) has the original relative ample
sign.  On \(Z\setminus A\) the map \(f\) is an isomorphism, and every line
bundle is relatively ample for an isomorphism.  These two opens cover
\(Z\).  After clearing a common Cartier multiple, relative ampleness is
local on the base, so \(-\widehat D_i\) is \(f\)-ample.  The identical
argument with \(f^+\) and \(H_{i+1}\) proves that
\(\widehat D_{i+1}=D_{i+1}-H_{i+1}\) is \(f^+\)-ample.

Reindex this floor-deleted tail at its first model and regard it as a
sequence of the arbitrary small diagrams in Theorem~\ref{thm:strong-gklt}.
The model and diagram hypotheses are inherited; the new boundaries are
effective and related by strict transform, the actual adjoints are
\(\Q\)-Cartier, and the two ample signs have just been checked.  A common
carrier for the finite preceding portion, projective over the new first
model, supplies the fixed analytically nef divisor.  In this application
the detector integer is chosen afresh for the new initial boundary and
nef carrier.  The theorem makes the tail finite, contradicting its
construction.
\end{proof}

To lift a prescribed downstairs diagram, we run gdlt continuation over
its base.  Theorem~\ref{thm:gdlt} forces the chosen run to reach a nef
adjoint, and Lemma~\ref{lem:nef-ample} gives a projective crepant morphism
from that endpoint to the prescribed positive model.  A negative
multisection ensures that the run contains a step.

\begin{lemma}[A nonempty gdlt lift]\label{lem:nonempty-lift}
Let
\[
 X\xrightarrow{\ f\ }Z\xleftarrow{\ f^+\ }X^+
\]
be any one of the small diagrams allowed in Theorem~\ref{thm:main}, with
normal globally Weil \(\Q\)-factorial compact K\"ahler fourfolds on the two
sides, effective rational boundaries \(B,B^+\) related by strict transform,
the same rational nef b-divisor, and the compatible actual adjoints
\(D_X,D_{X^+}\).  Assume \((X,B+\M)\) is glc, and represent the b-divisor
by an analytically nef \(\Q\)-Cartier divisor on a projective carrier over
\(X\).  Suppose
\[
 h:(Y,\Theta+\M)\longrightarrow(X,B+\M)
\]
is a projective crepant gdlt modification as in
Proposition~\ref{prop:gdlt-modification}; in particular \(Y\) is strong,
\(\Theta\geq0\), and every \(h\)-exceptional prime has coefficient one.
Then there is a finite sequence of elementary negative gdlt steps over
\(Z\), of length \(m\geq1\),
\[
 (Y,\Theta+\M)=(Y_0,\Theta_0+\M)
 \dashrightarrow\cdots\dashrightarrow(Y_m,\Theta_m+\M),
\]
and a projective bimeromorphic morphism \(h^+:Y_m\to X^+\) such that
\[
 K_{Y_m}+\Theta_m+M_{Y_m}=(h^+)^*D_{X^+}.
\]
The end is a strong normal compact K\"ahler gdlt model with effective
boundary, and every \(h^+\)-exceptional prime has coefficient one in
\(\Theta_m\).  Thus it is again a crepant gdlt modification of the same
type.
\end{lemma}

\begin{proof}
The composite \(Y\to Z\) is projective bimeromorphic to a normal compact
K\"ahler base.  On a projective common carrier, the fixed analytically nef
divisor is nef over \(Z\).  Thus the continuation assertion of
Proposition~\ref{prop:relative-program} applies to this gdlt pair and to
every non-nef finite prefix produced from it.

The initial adjoint \(D_Y=h^*D_X\) is not nef over \(Z\).  Indeed, the
nonisomorphic projective contraction \(f\) has a positive-dimensional
fiber, and projective hyperplane cuts give a compact irreducible curve
\(C\) in that fiber.  The negative ample sign gives \(D_X\cdot C<0\).
There is a compact irreducible curve \(C'\subset Y\) mapping onto \(C\).
For completeness, normalize \(C\), take an irreducible component of its
base change under \(h\) which dominates that normalization, and write
\(r\) for its generic fiber dimension.  The normalization of \(C\) is a
projective compact curve, so this component, being projective over it, is
projective.  A sufficiently high very ample system on the component has
\(r\) general members whose intersection with a generic fiber is a
nonempty zero-dimensional cycle.  Their intersection therefore has a
compact curve component dominating the base.  Its image in \(Y\) is such
a \(C'\).  The induced map of normalized curves has a positive finite
degree.  The projection formula now gives
\[
 D_Y\cdot C'=\deg(C'/C)\,D_X\cdot C<0.
\]
In particular, any run reaching nefness must contain at least one step.

Choose an elementary negative step whenever the current adjoint is not
nef over \(Z\).  The relative continuation assertion keeps all outputs
projective over \(Z\), strong normal compact K\"ahler, and gdlt with the
transported data.  All models in the run are irreducible: \(Y\) is
bimeromorphic to the irreducible \(X\), and every elementary step is
bimeromorphic.  If this process never reached a nef adjoint, it would
give an infinite elementary gdlt sequence with the fixed analytically nef
b-divisor.  This contradicts Theorem~\ref{thm:gdlt}.  We obtain a finite
run of length \(m\geq1\) with end adjoint \(D_{Y_m}\) nef over \(Z\).

Take a smooth common model \(W\) with projective maps to the models in the
run, to \(X^+\), and to the nef carrier, all over \(Z\).  Write \(P_0,P,P_+\) for the pullbacks
of \(D_Y,D_{Y_m},D_{X^+}\), respectively.  By
Lemma~\ref{lem:program-comparison}, the finite run gives
\[
 P_0=P+G,\qquad G\geq0\text{ exceptional over }Y_m.
\]
Initial crepancy identifies \(P_0\) with the pullback of \(D_X\).
Lemma~\ref{lem:small-comparison}, pulled to \(W\), gives the second
comparison
\[
 P_0=P_++F,\qquad F\geq0\text{ exceptional over }X^+.
\]
The first end is nef over \(Z\), and \(D_{X^+}\) is ample over \(Z\).
Lemma~\ref{lem:nef-ample} therefore gives an actual equality \(P=P_+\)
and a projective morphism \(h^+:Y_m\to X^+\) over \(Z\) with
\(D_{Y_m}=(h^+)^*D_{X^+}\).

The end is strong, gdlt, and has effective boundary by the relative
program.  It remains to check its exceptional primes.  Every prime on
\(Y_m\) has a strict-transform prime on \(Y\), because an elementary
program extracts no prime divisors.  Let \(R\) be exceptional for
\(h^+\), and let \(R_0\) be its prime on \(Y\).  If \(R_0\) were not
exceptional for \(h\), it would represent a prime on \(X\).  Smallness
downstairs identifies that prime with a prime on \(X^+\).  The place of
\(R\) would then have a divisorial center on \(X^+\), contradicting its
exceptionality.  Hence \(R_0\) is \(h\)-exceptional and has coefficient
one in \(\Theta\).  Boundary coefficients of surviving primes are
unchanged by an elementary program, so \(R\) has coefficient one in
\(\Theta_m\).  The displayed crepant equality also identifies its
discrepancy over \(X^+\) as zero.  This proves the lemma.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{thm:main}]
Assume that the sequence in the theorem is infinite.  By
Lemma~\ref{lem:small-comparison}, every global discrepancy is nondecreasing
along it.  Hence every \((X_i,B_i+\M)\) is glc.  The rational b-line
realization of the initial data satisfies
Proposition~\ref{prop:gdlt-modification}: \(X_0\) is a normal compact
K\"ahler fourfold, the boundary is effective and rational, the nef datum
has a projective carrier, and the adjoint is rationally invertible.  The
proposition gives a projective crepant gdlt modification
\[
 h_0:(Y_0,\Theta_0+\M)\longrightarrow(X_0,B_0+\M)
\]
with a strong normal compact K\"ahler source and only coefficient-one
exceptional primes.  It requires no strong factoriality of \(X_0\).

Apply Lemma~\ref{lem:nonempty-lift} to the first downstairs diagram and
\(h_0\).  Its endpoint is a crepant gdlt modification of the same type over
\(X_1\), so it is the input for the next application.  At every finite
stage a common projective carrier supplies the fixed analytically nef
data over the current downstairs model.  Induction therefore lifts every
downstairs diagram.  Each lifted string is finite and contains at least one
elementary step, and its endpoint is used as the literal starting model of
the next string.  Their concatenation is an infinite sequence of elementary
gdlt steps on strong normal irreducible compact K\"ahler fourfolds, with the same
b-divisor throughout.  Theorem~\ref{thm:gdlt} allows the bases to vary and
rules out this sequence.  The contradiction proves
Theorem~\ref{thm:main}.
\end{proof}

\begin{thebibliography}{99}
\raggedright

\bibitem{AlexeevHaconKawamata2007}
Valery Alexeev, Christopher Hacon, and Yujiro Kawamata,
\emph{Termination of (many) 4-dimensional log flips},
Invent. Math. \textbf{168} (2007), no.~2, 433--448.
\url{https://doi.org/10.1007/s00222-007-0038-1}.

\bibitem{BierstoneMilman1997}
Edward Bierstone and Pierre D. Milman,
\emph{Canonical desingularization in characteristic zero by blowing up the
maximum strata of a local invariant},
Invent. Math. \textbf{128} (1997), no.~2, 207--302.
\url{https://doi.org/10.1007/s002220050141}.

\bibitem{BirkarZhang2016}
Caucher Birkar and De-Qi Zhang,
\emph{Effectivity of Iitaka fibrations and pluricanonical systems of polarized pairs},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{123} (2016), 283--331.
\url{https://doi.org/10.1007/s10240-016-0080-x}.

\bibitem{ChenTsakanikas2023}
Guodu Chen and Nikolaos Tsakanikas,
\emph{On the termination of flips for log canonical generalized pairs},
Acta Math. Sin. (Engl. Ser.) \textbf{39} (2023), no.~6, 967--994.
\url{https://doi.org/10.1007/s10114-023-0116-3}.

\bibitem{DeligneLefschetz}
Pierre Deligne,
\emph{Th\'eor\`eme de Lefschetz et crit\`eres de d\'eg\'en\'erescence de suites spectrales},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{35} (1968), 107--126.
\url{https://doi.org/10.1007/BF02698925}.

\bibitem{DeligneHodgeII}
Pierre Deligne,
\emph{Th\'eorie de Hodge : II},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{40} (1971), 5--57.
\url{https://doi.org/10.1007/BF02684692}.

\bibitem{DeligneHodgeIII}
Pierre Deligne,
\emph{Th\'eorie de Hodge : III},
Publ. Math. Inst. Hautes \'{E}tudes Sci. \textbf{44} (1974), 5--77.
\url{https://doi.org/10.1007/BF02685881}.

\bibitem{ForstnericStein}
Franc Forstneri\v{c},
\emph{Extending holomorphic mappings from subvarieties in Stein manifolds},
Ann. Inst. Fourier (Grenoble) \textbf{55} (2005), no.~3, 733--751.
\url{https://doi.org/10.5802/aif.2112}.

\bibitem{Fujino2005Addendum}
Osamu Fujino,
\emph{Addendum to \textquotedblleft Termination of 4-fold canonical flips\textquotedblright},
Publ. Res. Inst. Math. Sci. \textbf{41} (2005), no.~1, 251--257.
\url{https://doi.org/10.2977/PRIMS/1145475410}.

\bibitem{FujinoAnalyticMMP}
Osamu Fujino,
\emph{Minimal model program for projective morphisms between complex analytic spaces},
arXiv:2201.11315v1 (2022).
\url{https://arxiv.org/abs/2201.11315v1}.

\bibitem{GoreskyMacPhersonIHII}
Mark Goresky and Robert MacPherson,
\emph{Intersection homology II},
Invent. Math. \textbf{72} (1983), no.~1, 77--129.
\url{https://doi.org/10.1007/BF01389130}.

\bibitem{Grauert1962}
Hans Grauert,
\emph{\"Uber Modifikationen und exzeptionelle analytische Mengen},
Math. Ann. \textbf{146} (1962), 331--368.
\url{https://doi.org/10.1007/BF01441136}.

\bibitem{GrothendieckHilbert1961}
Alexander Grothendieck,
\emph{Techniques de construction et th\'eor\`emes d'existence en g\'eom\'etrie
alg\'ebrique IV : les sch\'emas de Hilbert},
in \emph{S\'eminaire Bourbaki : ann\'ees 1960/61, expos\'es 205--222},
S\'eminaire Bourbaki \textbf{6}, Soci\'et\'e Math\'ematique de France,
1961, Expos\'e 221, 249--276; erratum, vol.~7 (1962), p.~302.
\url{https://www.numdam.org/item/SB_1960-1961__6__249_0/}.

\bibitem{HaconMoraga2020}
Christopher Hacon and Joaqu\'in Moraga,
\emph{On weak Zariski decompositions and termination of flips},
Math. Res. Lett. \textbf{27} (2020), no.~5, 1393--1421.
\url{https://doi.org/10.4310/MRL.2020.v27.n5.a6}.

\bibitem{HaconXie2026}
Christopher Hacon and Lingyao Xie,
\emph{On the K\"ahler MMP and the transcendental base-point-free theorem},
arXiv:2607.24986v1 (2026), submitted July 27, 2026.
\url{https://arxiv.org/abs/2607.24986v1}.

\bibitem{HanLiuZhuang2025}
Jingjun Han, Jihao Liu, and Ziquan Zhuang,
\emph{Effective termination of general type MMPs in dimension at most five},
arXiv:2509.01501v1 (2025).
\url{https://arxiv.org/abs/2509.01501v1}.

\bibitem{KawamataMatsudaMatsuki1987}
Yujiro Kawamata, Katsumi Matsuda, and Kenji Matsuki,
\emph{Introduction to the minimal model problem},
in \emph{Algebraic Geometry, Sendai, 1985}, Tadao Oda (ed.),
Advanced Studies in Pure Mathematics \textbf{10},
North-Holland, Amsterdam, 1987, 283--360.
\url{https://doi.org/10.2969/aspm/01010283}.

\bibitem{Moraga2025}
Joaqu\'in Moraga,
\emph{Termination of pseudo-effective 4-fold flips},
Math. Z. \textbf{310} (2025), no.~4, Article 73, 32 pp.
\url{https://doi.org/10.1007/s00209-025-03766-y}.

\bibitem{KahlerAuxiliary}
OpenAI,
\emph{Finite ordinary minimal model programs on compact K\"ahler fourfolds},
OpenAI Math Release preprint
\href{https://github.com/openai/math/blob/main/preprints/Finite-ordinary-minimal-model-programs-on-compact-Kahler-fourfolds-October-6-2026/paper.pdf}{OAI:Finite-ordinary-minimal-model-programs-on-compact-Kahler-fourfolds-October-6-2026},
2026.

\bibitem{ProjectiveLCFourfolds}
OpenAI,
\emph{Termination for projective log canonical fourfolds with rational boundary},
OpenAI Math Release preprint
\href{https://github.com/openai/math/blob/main/preprints/Termination-for-projective-log-canonical-fourfolds-with-rational-boundary-September-24-2026/paper.pdf}{OAI:Termination-for-projective-log-canonical-fourfolds-with-rational-boundary-September-24-2026},
2026.

\bibitem{CanonicalKahler}
OpenAI,
\emph{Termination of generalized-canonical flips on compact K\"ahler fourfolds},
OpenAI Math Release preprint
\href{https://github.com/openai/math/blob/main/preprints/Termination-of-generalized-canonical-flips-on-compact-Kahler-fourfolds-October-6-2026/termination-generalized-terminal-flips-compact-kahler-fourfolds.pdf}{OAI:Termination-of-generalized-canonical-flips-on-compact-Kahler-fourfolds-October-6-2026},
2026.

\bibitem{RaynaudSGA1XII}
Mich\`ele Raynaud,
\emph{G\'eom\'etrie alg\'ebrique et g\'eom\'etrie analytique},
in \emph{Rev\^etements \'etales et groupe fondamental (SGA 1)},
Alexander Grothendieck (ed.), Lecture Notes in Mathematics \textbf{224},
Springer-Verlag, Berlin--Heidelberg, 1971, Expos\'e XII, 311--343.
\url{https://doi.org/10.1007/BFb0058667}.

\bibitem{SaitoMHP}
Morihiko Saito,
\emph{Modules de Hodge polarisables},
Publ. Res. Inst. Math. Sci. \textbf{24} (1988), no.~6, 849--995.
\url{https://doi.org/10.2977/PRIMS/1195173930}.

\bibitem{SerreGAGA}
Jean-Pierre Serre,
\emph{G\'eom\'etrie alg\'ebrique et g\'eom\'etrie analytique},
Ann. Inst. Fourier (Grenoble) \textbf{6} (1956), 1--42.
\url{https://doi.org/10.5802/aif.59}.

\bibitem{ShokurovNonvanishing}
V. V. Shokurov,
\emph{The nonvanishing theorem},
Math. USSR-Izv. \textbf{26} (1986), no.~3, 591--604.
Russian original: Izv. Akad. Nauk SSSR Ser. Mat. \textbf{49} (1985),
no.~3, 635--651.
\url{https://doi.org/10.1070/IM1986v026n03ABEH001160}.

\end{thebibliography}

\end{document}
==== END Termination-of-generalized-log-canonical-flips-on-compact-Kahler-fourfolds//termination-generalized-lc-kahler-fourfolds.tex ====