Galois representations and coefficient twists
Hypothesis (Galois representations and coefficient twists). Use the fields, primes and ranks of (Family fields and Galois dataDefinition ANT.D111) and the spaces and coefficient field $K$ of (Complex vector spaces and integral spansDefinition THETA.D128). Choose an algebraic closure $\Omega$ of $E$ and a valuation ring of $\Omega$ above each finite place of $E$. Write $G_E=\operatorname{Gal}(\Omega/E)$ and $D_v,I_v$ for the decomposition and inertia groups for these choices. Write $\bar v$ for the complex-conjugate prime and $Nv$ for the residue cardinality. A homomorphism is unramified at $v$ when it is trivial on the inertia group for every valuation of $\Omega$ above $v$. It is ramified exactly at a set $Q$ when, for every finite prime $v$ and every valuation above $v$, its inertia image is nontrivial if and only if $v\in Q$.
For each prime $\ell$, choose the finite set of places above $\ell$, a valuation ring of $\Omega$ above each of them, and the factorization of the cyclotomic character through the Galois group unramified outside those places. Use the localization lengths $\lambda_\ell(E,c)$ defined in (Window condition: a bound on the Tate-Shafarevich groups of the twists Q_l/Z_l(-k) over auxiliary abelian fieldsDefinition GC.D104), with these choices. The nonnegative rational numbers $h_{\ell,c}$ in (Complex vector spaces and integral spansDefinition THETA.D128) satisfy $$\lambda_\ell(E,c)=n<\infty\quad\Longrightarrow\quad h_{\ell,c}=n \qquad(1\le c<t,\ n\in\mathbb Z_{\ge0}).$$
Choose a set of local coefficient indices $i$. Each has a prime $\ell_i$, a stage $1\le j_i\le m$ and a coefficient place $w_i$ of residue characteristic $\ell_i$. Require $\mu_i=\nu_{w_i}$ and $\mu_{w_i}\ne\mu_0$. The sets $I(j,w)=\{i:j_i=j,w_i=w\}$ are finite for every $j\ge0$ and coefficient place $w$. At each $i$, choose a complete DVR $O_i$ finite over $\mathbb Z_{\ell_i}$, a finite nonempty set $X_i$, a local subalgebra $\mathbb T_i\subseteq O_i^{X_i}$ separating the points of $X_i$, a finite free $O_i$-module $M_i$, and an injective $O_i$-algebra homomorphism $\mathbb T_i\to\operatorname{End}_{O_i}(M_i)$. Put $K_i=\operatorname{Frac}(O_i)$ and $V_i=K_i\otimes_{O_i}M_i$. For $x\in X_i$, define $$V_{i,x}=\{z\in V_i:a z=a(x)z\text{ for every }a\in\mathbb T_i\},\qquad m_{i,x}=\dim_{K_i}V_{i,x},\qquad \Lambda_i=\operatorname{im}(M_i\longrightarrow V_i).$$ Require every $V_{i,x}$ to be nonzero. Choose two subsets $Y_i,Z_i\subseteq X_i$.
For an $O_i$-module $M$, let $\operatorname{length}^0_{O_i}(M)$ be its module length when finite, and zero when its length is infinite. Put $$\operatorname{len}_{\ell_i}(M)= \frac{\operatorname{length}^0_{O_i}(M)}{\operatorname{length}^0_{O_i}(O_i/\ell_iO_i)}\in\mathbb Q,$$ with division by zero assigned the value zero. Define $$V_i^Y=\sum_{x\in Y_i}V_{i,x},\qquad V_i^{Y^c}=\sum_{x\in X_i\setminus Y_i}V_{i,x},$$ $$\eta_i=\operatorname{len}_{\ell_i}\!\left( \frac{V_i^Y\cap(\Lambda_i+V_i^{Y^c})}{\Lambda_i\cap V_i^Y}\right).$$ The intersections and quotient are taken as $O_i$-modules. For $x\in X_i$, let $\mathfrak c_{i,x}\subseteq O_i$ be the ideal generated by all $a(x)$ with $a\in\mathbb T_i$ vanishing on $X_i\setminus Z_i$, and put $$c_{i,x}=\operatorname{len}_{\ell_i}(O_i/\mathfrak c_{i,x}).$$
The topology of $O_i$ is its maximal-ideal adic topology. Choose an embedding $\jmath_i:K\hookrightarrow K_i$ satisfying $$\jmath_i(x)\in O_i\quad\Longleftrightarrow\quad v_{w_i}(x)\ge0.$$ There is a $\jmath_i$-semilinear map $$q_i:T^K_{\nu_{w_i},j_i}\longrightarrow K_i\otimes_{O_i}M_i$$ whose $K_i$-span is the whole target. For the finite set $\mathcal G_{\nu_{w_i},j_i}$ of integral generators and the complex realization $j_{\nu_{w_i},j_i}$ in (Complex vector spaces and integral spansDefinition THETA.D128), require $$\operatorname{span}_{O_i}\{q_i(x):j_{\nu_{w_i},j_i}(x)\in\mathcal G_{\nu_{w_i},j_i}\}=\Lambda_i.$$
Continuity of coefficient characters means continuity of their values in the coefficient ring, and continuity of matrix representations means continuity of their entries. Choose continuous characters $\xi_{i,c}:G_E\to O_i^\times$ for all integers $c\ge0$, with $$\xi_{i,c}=\xi_{i,1}\epsilon_{\ell_i}^{-(c-1)}\quad(1\le c\le t),\qquad u_i=\begin{cases}v_2(Q_S),&\ell_i=2,\\\max\{1,v_{\ell_i}(Q_S)\},&\ell_i\ne2.\end{cases}$$ Here $\epsilon_\ell$ is the cyclotomic character, mapped into $O_i^\times$. Choose finite sets $S_i,Q_i$ of places of $E$, with $S_i\cap Q_i=\varnothing$, containing no place above $\ell_i$, and with every member distinct from its complex-conjugate place. Put $$p_{D,i}=\begin{cases}p'_\Delta,&\ell_i=p_\Delta,\\p_\Delta,&\ell_i\ne p_\Delta,\end{cases}\qquad S_i=\{v:v\mid g_0g_1p_{D,i},\ v\nmid\ell_i\}.$$ For every finite place $v$, choose $\gamma_{i,v}\in I_v$; if $v\in S_i\cup Q_i$, its image generates tame inertia topologically. More precisely, inertia is contained in the closure of the subgroup generated by $\gamma_{i,v}$ and the elements $\sigma$ for which $|\sigma y/y-1|_v<1$ for every $y\in\Omega^\times$. At every $v\in Q_i$, $\xi_{i,1}$ is nontrivial on inertia.
Choose Hecke elements $T_{i,v,h}\in\mathbb T_i$ for all finite $v$ and integers $h\ge0$. The elements with $v\ne\bar v$, $v\nmid\ell_i$, $v\notin S_i\cup Q_i$ and $1\le h\le n_V$ generate $\mathbb T_i$ as an $O_i$-algebra. Choose a finite free $O_i$-module $B_i$. The primes $g_0,g_1$ split completely in $E$. For $a=0,1$, choose a set $\mathcal V_a$ of size $f$, monic degree-$r$ polynomials $F_{a,\pi,v}\in\mathbb F_{g_a}[X]$ for every type label $\pi$ and $v\in\mathcal V_a$, and units $\chi_{a,v,j}\in\mathbb F_{g_a}^\times$ for $0\le j<m$. Require $$d_G=\prod_{a=0}^1|\mathrm{GL}_r(\mathbb F_{g_a})|^f.$$
For the character-twist data, take $K$ to be a number field with a specified field involution $x\mapsto\bar x$ and a specified subfield $K_0\subseteq K$. The character-twist data have a separate index set $\mathcal I_{\rm tw}$. Choose an automorphism $c$ of $\Omega$ inducing complex conjugation under some embedding $\Omega\hookrightarrow\mathbb C$ and carrying $E$ into itself. A homomorphism $\psi:G_E\to A$ to a commutative group is called anticyclotomic here when $\psi(cgc^{-1})=\psi(g)^{-1}$ for every $g$.
For $a\in\mathcal I_{\rm tw}$ choose a prime $\ell_a$, a DVR $O_a^0$ finite over $\mathbb Z_{\ell_a}$ with finite residue field and its adic topology, and two embeddings $\jmath_a^+,\jmath_a^-:K_0\hookrightarrow\operatorname{Frac}(O_a^0)$ such that $\jmath_a^-(x)=\jmath_a^+(\bar x)$ whenever $x,\bar x\in K_0$. Choose an injective local extension $O_a^0\to O'_a$ of DVRs, where $O'_a$ is complete with its adic topology, has algebraically closed residue field and has $\ell_a$ in its maximal ideal. For each integer $h\ge0$, choose an injective finite DVR extension $O'_a\to O'_{a,h}$ and a primitive $\ell_a^h$th root $\zeta_{a,h}\in O'_{a,h}$. Require every element of $\operatorname{Frac}(O'_{a,h})$ to be $P(\zeta_{a,h})/d$ for some $P\in O'_a[X]$ and $d\in O'_a\setminus\{0\}$.
Let $D_a$ be all places above $p'_\Delta$ if $\ell_a=p_\Delta$, and all places above $p_\Delta$ otherwise. Choose an anticyclotomic character $\delta_a:G_E\to(O_a^0)^\times$ with open kernel, ramified exactly at $D_a$, whose inertia image at every place of $D_a$ has order $15$. Require $Nv\equiv1\pmod {15}$ at those places. Choose continuous characters $\chi_{a,j,b}:G_E\to(O_a^0)^\times$ for all $j\ge0$, $b\in\{+,-\}$, unramified outside places above $\ell_a,g_0,g_1$ and $D_a$, equal on inertia at $D_a$ to $\delta_a$ for $b=+$ and to $\delta_a^{-1}$ for $b=-$, and satisfying $\chi_{a,j,b}^{g_u-1}=1$ on inertia above $g_u\ne\ell_a$.
Choose a finite set $\mathcal S_a$ of labels, a stage $j(s)\in\{1,\ldots,m\}$ and side $b(s)$ for each label, and continuous representations $\rho_{a,s}:G_E\to\mathrm{GL}_r(O_a^0)$. Choose a finite set $S_{0,a}$ containing all places above $\ell_a,g_0,g_1$ and $D_a$. For every $j\ge0$ and side $b$, choose a finite free $O'_a$-module $B_{a,j,b}$, a submodule $\Theta_{a,j,b}$, $O'_a$-linear endomorphisms $H_{a,j,b,h,v}$ of $B_{a,j,b}$ for every $h\ge0$ and finite $v$, with $H_{a,j,b,0,v}=1$, and scalars $h_{a,s,h,v}\in O'_a$. For every integer $h\ge0$, finite set $Q$ of places of $E$ and group homomorphism $\psi:G_E\to(O'_{a,h})^\times$, choose a submodule $$\Theta_{a,j,b,h,Q,\psi}\subseteq O'_{a,h}\otimes_{O'_a}B_{a,j,b},\qquad \Theta_{a,j,b,h,\varnothing,1}=O'_{a,h}\otimes\Theta_{a,j,b}.$$
Choose another finite label set $\mathcal L_a$. Each $\lambda\in\mathcal L_a$ has a stage $j(\lambda)\in\{1,\ldots,m\}$, a side $b(\lambda)$, an integer $s_\lambda$, a continuous anticyclotomic character $\lambda_a:G_E\to(O'_a)^\times$ unramified outside $S_{0,a}$, values $X_{\lambda,v}\in O'_a$ and $q_{\lambda,v}\in\operatorname{Frac}(O'_a)$. For inertia elements $\sigma$ at $v\in D_a$, require $\lambda_a(\sigma)\delta_a(\sigma)^{-1}$ if $b(\lambda)=+$, or $\lambda_a(\sigma)\delta_a(\sigma)$ if $b(\lambda)=-$, to have order dividing a power of $Nv$. Away from $S_{0,a}$, for every arithmetic Frobenius element at the chosen valuation above $v$, require $$X_{\lambda,v}=\lambda_a(\operatorname{Frob}_v),\qquad q_{\lambda,v}^2=(Nv)^{-s_\lambda}.$$ For every finite place $v$, require $q_{\lambda,v}=q_{\lambda,\bar v}$.
For every finite place set $Q$, choose a finite abelian $\ell_a$-primary group $R_{a,Q}$ and an anticyclotomic surjection $\alpha_{a,Q}:G_E\to R_{a,Q}$ with open kernel, unramified outside $Q$. If $Q$ avoids places above $\ell_a$, every homomorphism $\varphi:G_E\to A$ to a finite abelian $\ell_a$-primary group, with open kernel, anticyclotomic and unramified outside $Q$, factors through $\alpha_{a,Q}$. For $Q'\subseteq Q$, choose a homomorphism $R_{a,Q}\to R_{a,Q'}$ carrying $\alpha_{a,Q}$ to $\alpha_{a,Q'}$. Choose functions $\theta_{a,Q,\lambda}:R_{a,Q}\to\operatorname{Frac}(O'_a)$.
Finally associate to each coefficient index $i$ a twist index $a(i)$ with $\ell_{a(i)}=\ell_i$, a side $b_i$, and a homomorphism $O_{a(i)}^0\to O_i$. If $x\in K_0$ has image $y\in O_{a(i)}^0$ under the embedding selected by $b_i$, require its image in $K_i$ to equal the image of $y$ under this homomorphism. Choose an anticyclotomic character $\psi_i:G_E\to O_i^\times$ with open kernel, every value of $\ell_i$-power order, ramified exactly at $Q_i$, trivial on all decomposition groups above $\ell_i$, and satisfying $$\xi_{i,1}=\chi_{a(i),j_i,b_i}\psi_i$$ after applying $O_{a(i)}^0\to O_i$ to the first factor.