\section{Even classes and triangles of auxiliary places}\label{sec:triangles} Ribet's lemma (\cref{thm:ribet-lemma}) needs, for each character $\mathrm{cyc}^{-e}$ of the string, a triangle cost for the modules of character cocycles. These are cocycles in the Tate twists $(O/\ell^\nu)(-e)$; their \emph{even} parts are controlled by auxiliary places in triangular position, chosen with Kummer maps over the real subfield, and their \emph{odd} parts by a class number. No bound for the even classes themselves is needed: the reciprocity laws of the Kummer maps remove them. \subsection{Even and odd classes}\label{ss:even-classes} Let $E\subset\Omega$ be a CM field containing a primitive $5040$th root of unity, $F$ its maximal real subfield, $O$ a coefficient ring (the integers of a finite Galois extension of $\Q_\ell$ in $\bar\Q_\ell$), and $G_\nu\subseteq G$ the elements fixing the $\ell^\nu$th roots of unity. For a set $S$ of places, the \emph{even classes} of exponent $e$ are the cocycles $c\colon G\to(O/\ell^\nu)(-e)$, unramified outside $\ell$, $S$ and $\bar S$, with $c(g^c)=c(g)$, vanishing on the elements of trivial cyclotomic character in the decomposition groups above $\ell$; the \emph{odd classes} are the cocycles with the same local conditions, unramified off $\ell$, that change sign under $g\mapsto g^c$. A family of places $w_j$ off $\ell$ with the chosen tame generators $\tau_j$ and elements $\varphi_j\in G_\nu$ is a \emph{tame generator family}. A \emph{triangle of primes} for an element $a$ is such a family, indexed by a finite linear order $J$ with monotone exponents $0<\mathrm{ty}(j)0$, $t+2\le y$, $\mathrm{cyc}(\gamma)^a-1\mid\ell^h$ for $00$ some places of level $\ell^\nu$ indexed by $J$ have their Frobenius data in $W$ and form a triangle of primes for $\gamma^{-1}$ with $h$ replaced by $yh$ and $c=y^{22}h$. \end{theorem} \begin{proof} \emph{Test points.} By \cref{thm:B-detecting}(a) for $g_0=\gamma^{-1}$ there is a finite set $s$ of elements of trivial cyclotomic character, with $\#s\le y^{20}$ when $N_E\le y$ and $\ell\le y^2$, such that a cocycle in a Tate twist modulo $\ell^n$ unramified off $\ell$ that vanishes at $\gamma^{-1}$ and on $s$ is zero. \emph{The order.} Let $J$ be the set of the pairs $(e,g)$ with $00$. Since $4\mid\mathrm{cyc}(\gamma)^e-1\mid\ell^h$ for $e>0$ (the cyclotomic character is $\equiv1$ modulo $4$ on $G$), $4(\mathrm{cyc}(\gamma)^e-1)^2$ divides $\ell^{3h}$, and $4\mid\ell^{3h}$ unless $J$ is empty. By well-founded recursion along $J$, choose at each $j=(e,g)$ a map and a place by \cref{lem:next-place}(a), (b) with the test element $g$; by induction the earlier maps of exponent $e$ are independent modulo $\ell$, a family none of whose members lies in the span of the earlier ones being independent. \emph{The triangle.} The places lie above distinct primes of $F$, so they are distinct from each other and from their conjugates, and are $\nu$-split, so their norms are $\equiv1$ modulo $\ell^\nu$: they are Taylor--Wiles places of level $\ell^\nu$, with Frobenius data in $W$. The conditions of a triangle of primes for $\gamma^{-1}$, with $yh$ in place of $h$ and $c=y^{22}h$: the detection is that of the test points; at the place $(e,g)$ the even classes unramified off $\ell$ take twice their value at $g$ (\cref{lem:next-place}(b)); the triangle condition is \cref{lem:next-place}(c); $\prod_{k\ne e}(u^e-u^k)$, $u=\mathrm{cyc}(\gamma)$, divides $\ell^{(t-1)h}\mid\ell^{yh}$, and $4(u^e-1)^2\mid\ell^{3h}\mid\ell^{yh}$; finally $\#J+\#s+1\le t\#s+2y^{20}\le(t+2)y^{20}\le y^{21}$, so $(\#J+\#s+1)\,yh\le y^{22}h$. If $h=0$ the bounds are trivial. \end{proof} \begin{theorem}[Triangle cost of Tate twists]\label{thm:triangle-cost} Let the $w_j$ form a triangle of primes for $g_0$ up to $\ell^h$, $e0$) and let $z\in Z$ vanish on $\Lambda$ and agree at the earlier pairs. By \cref{lem:even-parts}(a) its even part is an even class of exponent $e$ for the places $w_j$; it vanishes at the earlier $\tau_i$ and at the earlier $\varphi_i$ of exponent $e$. By the triangle, $\ell^h$ kills its value at $\tau_j$, so $\ell^hz(\tau_j)=\ell^hz(\tau'_j)$. (b) \emph{The first term.} A cocycle obeying the crystalline relations above $\ell$ vanishes on $\Lambda$: conjugating $g\in\Lambda$ by some $s$ into the decomposition group of the chosen place above its prime, crystalline cocycles vanish at $sgs^{-1}$, and computing $z(s^{-1}\cdot sgs^{-1})=z(gs^{-1})$ in two ways gives $z(g)=0$. Hence the length of $Z$ modulo the functions vanishing on $\Lambda$ is at most its length modulo those obeying the crystalline relations. \emph{The second term.} Let $S'\le Z$ consist of members vanishing on $\Lambda$, at all $\tau_j$, $\tau'_j$, and agreeing at $\varphi_j$, $\varphi'_j$ for $\mathrm{ty}(j)=e$. Its members are unramified off $\ell$ (\cref{lem:even-parts}(b)). If $e=0$ there is no sign condition and $S'$ lies in the odd classes. If $e\ne0$, the map $z\mapsto z\circ(g\mapsto g^c)-z$ sends $S'$ into the odd classes. Its kernel consists of even $z$; for such $z$ the agreement at $\varphi_j$, $\varphi'_j$ gives $2z(\varphi_j)=0$, and for each test point $g$ some $j$ of exponent $e$ has $z(\varphi_j)=2z(g)$, so $4z(g)=0$. With $d=\mathrm{cyc}(g_0)^{-e}-1$, which kills $z(g_0)$, the cocycle $4dz$ vanishes at $g_0$ and at the test points, so it is zero; and $4d$ divides $4d^2$, which divides $\ell^h$. Hence the kernel is killed by $\ell^h$, and the length of $S'$ modulo its $\ell^h$-torsion is at most the length of the odd classes. The two terms add up to at most $b$. \end{proof}