\documentclass[11pt]{amsart} \usepackage{amsmath,amssymb,amsthm} \usepackage[margin=1.15in]{geometry} \usepackage{enumitem} \usepackage[colorlinks=true,linkcolor=blue,citecolor=blue]{hyperref} \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newtheorem{example}[theorem]{Example} \newcommand{\Q}{\mathbb{Q}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\F}{\mathbb{F}} \newcommand{\PP}{\mathbb{P}} \newcommand{\Gal}{\operatorname{Gal}} \newcommand{\GL}{\operatorname{GL}} \newcommand{\Ind}{\operatorname{Ind}} \newcommand{\rbar}{\bar{\rho}} \newcommand{\Favoid}{F^{\mathrm{avoid}}} \title[Some remarks on potential automorphy]{Some remarks on potential automorphy: \texorpdfstring{$S_N$}{S\_N} extensions, compatible systems and deformation rings} \author{Luis Dieulefait} \date{November 2026} \begin{document} \begin{abstract} We observe that in the potential modularity (automorphy) theorems of Taylor and of Barnet-Lamb--Gee--Geraghty--Taylor, the totally real field $K$ over which modularity is obtained can be chosen to be Galois over the base field $F$ with $\Gal(K/F)\cong S_N$, with $N$ arbitrarily large, linearly disjoint from any prescribed finite extension of $F$, and such that every place in a prescribed finite set splits completely in $K$. The only possible loss of residual image after restriction to $K$ comes from the quadratic field $K^{A_N}$. In dimension two this yields: (a) for finitely ramified, totally odd, regular de Rham representations over a totally real field $F$ in which $p$ splits completely, under the residual hypotheses of Section~\ref{sec:dim2} and without assuming potential diagonalisability, potential modularity over an $S_N$ extension in which $p$ still splits completely, via residual modularity over $K$ followed by Kisin's method; and (b) for applications to safe chains, a choice of $K$, made a priori in terms of a bound $C$, which preserves the residual images of all members of the compatible system in characteristic $p\varepsilon_v^{-1}$, each $U_P$ contains exactly one point $Q$ with $f(Q)=t$, and $Q\in T(L_v)$. This produces $N$ distinct points of $f^{-1}(t)$; since $\deg f=N$, these are all the geometric points of the fibre (and $t$ is not a branch value). \emph{Step 4: Hilbert irreducibility.} Since $M$ is regular over $F$ and $\Favoid(f)/F(f)$ is a constant extension, $M\cap\Favoid(f)=F(f)$ and $\Gal(M\Favoid/F(f))\cong S_N\times H$. The set of $t\in F$ at which this Galois extension specialises with full Galois group $S_N\times H$ contains a Hilbert subset of $F$ \cite[Ch.~13, 16]{FJ}. Hilbert subsets of a number field are dense in $\prod_{v\in S}F_v$ (Geyer's lemma; see \cite{Gey78} and \cite[Ch.~13]{FJ}). Choose such $t$ with $|t|_v>\varepsilon_v^{-1}$ for all $v\in S$ and $t\notin f(\bar T\setminus T)$. \emph{Step 5: conclusion.} Since $S_N$ acts transitively on the fibre, $f^{-1}(t)$ is a single closed point $x\in T$ of degree $N$; its residue field is $F_x$ and the specialisation of $M$ is its Galois closure $K$, with $\Gal(K/F)\cong S_N$, proving (a). The specialisation of $M\Favoid$ is $K\Favoid$, of degree $N!\,|H|$ over $F$, proving (b). Step~3 gives (c): the $N$ geometric points of the fibre are the $F$-embeddings of $F_x$, all landing in $L_v$ and in $\Omega_v$, and $K$ is generated by their images. The last assertions follow: if all images of $F_x$ lie in $F_v$ (resp.\ in an unramified $L_v$), the same holds for the compositum $K$ of its conjugates. For real $v$ we have $L_v=\R$, so $K$ is totally real. \end{proof} \begin{remark}\label{rem:N} The integers $N$ produced are degrees of admissible divisors $D$ as in Step~1. Once one such divisor $D_0$ of degree $N_1\geq 2g+3$ is available, the fibres obtained in Step~5 are pairwise disjoint admissible points of degree $N_1$, and sums of $j$ of them are admissible divisors of degree $jN_1$. Hence every multiple $jN_1$, $j\geq 1$, occurs as an $N$. \end{remark} \section{Proof of Theorem~\ref{thm:main}}\label{sec:proof} We go through the proof of \cite[Cor.~4.5.2]{BLGGT}, which is the totally real case of \cite[Thm.~4.5.1]{BLGGT} and rests on \cite[Prop.~3.3.1, Thm.~3.1.2]{BLGGT}, keeping track of the fields involved. (The method goes back to \cite{Tay02,HSBT}.) \emph{Step A: a CM field} \cite[proof of Cor.~4.5.2]{BLGGT}. Let $D$ be the Galois closure over $F$ of $\Favoid\,\bar F^{\ker\rbar}(\zeta_p)$. Choose a totally imaginary quadratic extension $E/F$, split at every place above $p$ and linearly disjoint from $D$. For instance, weak approximation gives a defining square class which is negative at every real place, a square at the places above $p$, and of odd valuation at a further odd prime unramified in $D$. Hence $\zeta_p\notin E$ and the residual image over $E(\zeta_p)$ is the original image over $F(\zeta_p)$. Use the totally odd CM polarisation of $\rho|_{G_E}$ as in the proof of the cited corollary (in the orthogonal case one multiplies the even multiplier by the quadratic character of $E/F$). It suffices to prove that $\rho|_{G_{EF'}}$ is automorphic for a suitable totally real $F'$; then $\rho|_{G_{F'}}$ is automorphic by \cite[Lemma~2.2.2]{BLGGT}. \emph{Step B: a first soluble base change} \cite[proof of Prop.~3.3.1]{BLGGT}. By \cite[Lemma~A.2.1]{BLGGT} one chooses a finite, soluble, Galois, totally real extension $F_a/F$, linearly disjoint from $ED$ over $F$. Prescribe the local extensions in the proof of \cite[Prop.~3.3.1]{BLGGT} at all places above $p$ or where the residual representation or its multiplier ramifies. We may make the multiplier crystalline above $p$, make all the marked places split in $EF_a/F_a$, and arrange the ordinary crystalline local lifts of the specified regular weights. Away from $p$ the local lifts can be taken from $\rho$. Over $F_a$ one then has an ordinary lift $r$ of $\rbar|_{G_{EF_a}}$ \cite[Prop.~3.2.1]{BLGGT}, a suitable character $\psi$ of $G_{EF_a}$, and the residual representation \[ \bar R=\operatorname{Ind}_{G_{EF_a}}^{G_{F_a}}(\rbar\otimes\bar\psi)\colon G_{F_a}\longrightarrow\mathrm{GSp}_{2n}(\bar\F_p), \] which is symplectic with multiplier $\bar\epsilon_p^{\,1-2n}$. The lift $r$ is defined over $EF_a$, even though the existence theorem for $r$ uses a further field of potential automorphy in its proof. Here $\epsilon_p$ denotes the cyclotomic character. As in the cited proof, choose the weights of $\psi$ so that the two summands of the induction at each split place over $p$ are ordinary with separated weights in a consistent order at all embeddings above that place. Ramification of $\bar\psi/\bar\psi^c$ at an auxiliary split place distinguishes the conjugate residual summands over $EF_a(\zeta_p)$, so $\bar R|_{G_{F_a(\zeta_p)}}$ is irreducible. The subgroup generated by its $p$-elements preserves the two $n$-dimensional summands since $p$ is odd. Its irreducible constituents therefore have dimension at most $n$, and \cite[Prop.~2.1.2]{BLGGT} gives adequacy under \textup{(H)}. \emph{Step C: the Dwork family} \cite[proof of Thm.~3.1.2]{BLGGT}, applied to $\bar R$ over $F_a$. Fix a finite Galois extension $B/\Q$ containing $F_aED$ and the field cut out by $\bar R$. Choose the Dwork integer $m$ (denoted $N$ in \cite{BLGGT}) with the congruence and coefficient field conditions of \cite[proof of Thm.~3.1.2]{BLGGT}, taking $m$ prime to the rational primes ramified in $B$. Then $\Q(\zeta_m)$ and $B$ are linearly disjoint over $\Q$, since their intersection would be unramified at every finite prime. Choose the auxiliary prime $\ell$ and the induced symplectic representation $r'$ of $G_\Q$ as in that proof. In particular, $\ell$ splits in $\Q(\zeta_m)$, $\bar r'$ is induced from a character of a cyclic CM field $J$ of degree $2n$, and its image on $G_{F_a(\zeta_{m\ell})}$ agrees with its adequate image on $G_{\Q(\zeta_\ell)}$. In making the auxiliary choices one can require $J$ to be unramified at every prime dividing $m$ as well as at those ramifying in $B$. Choose the inducing character unramified above $m$ and the primes ramifying in $F_a$, and take $\ell$ unramified in $F_a(\zeta_m)$. Put $B_\ell=\bar\Q^{\ker\bar r'}(\zeta_\ell)$. The finite primes ramifying in $B_\ell$ are unramified in the Galois closure of $F_a(\zeta_m)$ over $\Q$, so its intersection with $B_\ell$ is $\Q$. Put \[ F_\ast=F_a(\zeta_m)^+ . \] Let $T_0=\PP^1\setminus(\{\infty\}\cup\mu_m)$, with coordinate $t$, be the parameter space of the Dwork family, and let $T\to T_0$ be the finite cover, defined over $F_\ast$, parametrising points of $T_0$ together with symplectic isomorphisms of the normalised mod $p$ and mod $\ell$ realisations of the corresponding motive with $\bar R$ and $\bar r'$. It is a smooth geometrically irreducible curve over $F_\ast$. Let \[ F^{\mathrm{av}}=B\,J\,\bar\Q^{\ker\bar r'}(\zeta_{m\ell}), \] where $\bar\Q^{\ker\bar r'}$ denotes the field cut out by $\bar r'$ over $\Q$. We work in a common algebraic closure. Moret-Bailly's theorem \cite[Prop.~3.1.1]{BLGGT} is applied to $T$ over $F_\ast$ and produces a field $F'$ and a point $P$ with the following properties: \begin{itemize} \item[(P1)] $F'$ is a finite totally real extension of $F_\ast$; \item[(P2)] $P\in T(F')$; \item[(P3)] $F'$ is linearly disjoint from $F_\ast F^{\mathrm{av}}$ over $F_\ast$; \item[(P4)] $v(t(P))<0$ for every place $v\mid p$ of $F'$, and $v(t(P))>0$ for every place $v\mid\ell$ of $F'$. \end{itemize} \emph{Step D. Automorphy over $F'$.} Suppose that $F'$ and $P$ satisfy \textup{(P1)--(P4)}. Since $F_\ast=F_a\Q(\zeta_m)^+$ and $\Q(\zeta_m)\cap B=\Q$, we have $F_\ast\cap B=F_a$. By \textup{(P3)}, $F'\cap B=F_a$, whence $F'\cap ED=F$. Thus $EF'$ does not contain $\zeta_p$, and the image of $\rbar$ over $EF'(\zeta_p)$ equals its image over $F(\zeta_p)$. Likewise the image of $\bar R$ over $F'(\zeta_p)$ is its image over $F_a(\zeta_p)$. Applying \textup{(P3)} also to the auxiliary residual and cyclotomic fields shows that the image of $\bar r'$ over $F'(\zeta_\ell)$ equals its image over $F_\ast(\zeta_\ell)$ and therefore over $\Q(\zeta_\ell)$. Indeed the image over the intermediate field $F_\ast(\zeta_\ell)$ contains the full image over $F_a(\zeta_{m\ell})$. Both induced images are thus adequate. In particular the characteristic zero inductions are irreducible upon restriction to $G_{F'}$. The point $P$ identifies the two residual realisations. At $\ell$, the inequality $v(t(P))>0$ gives ordinarity of the $\ell$-adic realisation. At $p$, the inequality $v(t(P))<0$ gives a Steinberg Weil--Deligne parameter for that realisation \cite[Lemmas~5.3(3), 5.1(2)]{BLGHT}. By cyclic automorphic induction \cite{AC89}, $r'|_{G_{F'}}$ is ordinarily automorphic. Apply \cite[Thm.~2.4.1]{BLGGT} at $\ell$ to the Dwork realisation. The resulting weight zero automorphic representation is Steinberg above $p$ and is ordinary for the $p$-adic embedding, as in the conclusion of \cite[proof of Thm.~3.1.2]{BLGGT}. Its mod $p$ representation is $\bar R|_{G_{F'}}$. A second application of the ordinary lifting theorem, now at $p$, gives automorphy of the ordinary induction of $r\otimes\psi$ on $G_{F'}$. By \cite[Lemmas~2.2.4 and 2.2.1]{BLGGT} we extract the inducing representation over $EF'$ and remove the character twist. This gives an ordinary automorphic lift of $\rbar|_{G_{EF'}}$ with the required residual polarisation. Consequently \cite[Thm.~4.2.1]{BLGGT} applies to the potentially diagonalisable $\rho|_{G_{EF'}}$. Its irreducibility and Step~A now give automorphy of $\rho|_{G_{F'}}$. The conclusion needed after descent is automorphy. At a place of $F$ that splits in the final field $K$, the local Weil--Deligne representation retains its original inertial type. \emph{Conclusion.} The extension $F_\ast/F$ is finite, soluble, Galois and totally real ($F_a/F$ is soluble and Galois, and $F(\zeta_m)^+/F$ is abelian). Take $N\geq\max(N_0,5)$. The largest soluble quotient of $S_N$ has order two, so a Galois $S_N$ extension of $F$ could contain $F_\ast$ only if $[F_\ast:F]\leq2$. We apply Proposition~\ref{prop:SN} to a curve in a Weil restriction of $T$: Steps~1--5 of the proof of Theorem~\ref{thm:split} below (with $S=\emptyset$) produce a finite, soluble, Galois, totally real extension $F_1/F$ containing $F_\ast$, and a totally real Galois extension $K/F$ with $\Gal(K/F)\cong S_N$, $N\geq N_0$, linearly disjoint over $F$ from $F_1$ and from the Galois closure of $F_\ast F^{\mathrm{av}}$, together with a point of $T$ over $KF_1$, such that $F'=KF_1$ satisfies \textup{(P1)--(P4)}. By Step~D, $\rho|_{G_{KF_1}}$ is automorphic. Since $KF_1/K$ is Galois with soluble group $\Gal(F_1/F)$ and $\rho|_{G_{KF_1}}$ is irreducible, $\rho|_{G_K}$ is automorphic by \cite[Lemma~2.2.2]{BLGGT}. \qed \begin{remark}[Choice of $N$ in prescribed families]\label{rem:Nfamilies} In Theorem~\ref{thm:main} (including (iv)), and in Theorems~\ref{thm:split} and~\ref{thm:safe} below, $N$ can be required to lie in any prescribed set $\mathcal{A}\subset\Z_{>0}$ containing infinitely many multiples of every positive integer, for instance \[ \mathcal{A}=\{x!: x\geq 1\},\qquad \mathcal{A}=\{\operatorname{lcm}(1,\dots,x): x\geq 1\},\qquad \mathcal{A}=\{x^x: x\geq 1\}. \] Indeed, by Remark~\ref{rem:N} the possible values of $N$ include all multiples of some $N_1$ which depends on the curve and on the first admissible divisor, and $\mathcal{A}$ contains such multiples beyond any bound. In particular $\Gal(K/F)$ can be taken to be $S_{x!}$ for some $x$, so that the only non-abelian composition factor is $A_{x!}$, and the reduction of Section~\ref{sec:remarks} is to descent along an extension with group $A_{x!}$. The condition on $\mathcal{A}$ cannot be dropped in general: all admissible points of the curve may have degree divisible by some integer $m>1$ (an ``admissible index''), and then $N$ must be divisible by $m$. Sets such as the primes or the powers of $2$ are therefore not covered by this argument. \end{remark} \begin{remark}[Dimension two, $p=3,5$]\label{rem:p35} For $n=2$ and $p\in\{3,5\}$ the conclusions of Theorem~\ref{thm:main} also hold for every finitely ramified, totally odd, regular, potentially diagonalisable $\rho$ for which $\rbar(G_{F(\zeta_p)})$ is adequate and, if $p=5$, the projective image of $\rbar$ is neither $\mathrm{PSL}_2(\F_5)$ nor $\mathrm{PGL}_2(\F_5)$. We use the argument in the proof of \cite[Thm.~3.6(2)]{DP}. Take $K$ from Theorem~\ref{thm:snowdenSN}. It satisfies the field conditions and $\rbar|_{G_K}$ has a modular lift. Put $D_K=K\bar F^{\ker\rbar}(\zeta_p)$. By Lemma~\ref{lem:solvable} choose a totally real soluble Galois extension $W/K$, disjoint from $D_K$ over $K$, whose completions at $p$ trivialise $\rbar$. The modular lift over $K$ stays irreducible over $W$, so its soluble base change supplies residual modularity there. The residual image over $W(\zeta_p)$ is still adequate, and the local restrictions above $p$ are reducible. By \cite[Thm.~2.1.2(2)]{BLGG13}, $\rbar|_{G_W}$ has an ordinary modular lift. Choose a CM quadratic extension $M/W$, split at $p$, disjoint from $WD_K$ over $W$. Its cyclotomic residual image is unchanged, $\zeta_p\notin M$, and the ordinary lift base changes cuspidally to $M$. The residual polarisations agree, since in dimension two the determinants of both lifts reduce to $\det\rbar$. Hence \cite[Thm.~1]{DG15} gives automorphy of $\rho|_{G_M}$. Apply \cite[Lemma~2.2.2]{BLGGT} successively to $M/W$ and $W/K$, using absolute irreducibility over $M$. This proves the assertion over the original $K$. \end{remark} \section{Forcing \texorpdfstring{$p$}{p} to split}\label{sec:local} \subsection{What Proposition~\ref{prop:SN} gives directly} In the proof of Section~\ref{sec:proof} the point of the Dwork curve $T$ lives over $KF_1$, whose completions above $p$ are the fields $L_v$; these are in general ramified, since they must contain the completions of $F_\ast$ and carry points of $T$ with $v(t)<0$. The field $K$ itself, however, is obtained from Proposition~\ref{prop:SN} applied to a curve over $F$ with local conditions in $F_v$-points, and by Proposition~\ref{prop:SN}(c) it is split at every place where such a condition is imposed. Thus the passage through the soluble extension $F_1$ and the final descent, which the structure of the argument of \cite{BLGGT} forces on us in any case, also make $K$ split above $p$; and the same device allows one to prescribe the splitting of an arbitrary finite set of places. This is the content of Theorem~\ref{thm:split}, whose proof also supplies the construction used in Section~\ref{sec:proof}. \subsection{Two auxiliary lemmas} \begin{lemma}\label{lem:solvable} Let $\Sigma$ be a finite set of places of $F$ containing the archimedean ones; for $v\in\Sigma$ let $L_v/F_v$ be a finite Galois extension, with $L_v=\R$ for $v$ real. Let $M/F$ be finite. There is a finite solvable Galois extension $F_1/F$, totally real, linearly disjoint from $M$, such that $F_{1,w}\cong L_v$ over $F_v$ for every $v\in\Sigma$ and every place $w\mid v$ of $F_1$. \end{lemma} This is \cite[Lemma~A.2.1]{BLGGT}: given $F^{(\mathrm{avoid})}/F$ finite Galois, a finite set $S$ of places and finite Galois $E_v/F_v$ for $v\in S$, there is a finite soluble Galois $E/F$, linearly disjoint from $F^{(\mathrm{avoid})}$, with $E_w/F_v\cong E_v/F_v$ for all $w\mid v\in S$. Taking $E_v=\R$ at the real places makes $E$ totally real. (Replace $M$ by its Galois closure.) The same device of a restriction of scalars along such an extension, to prove potential automorphy over fields with prescribed completions above $p$, appears in \cite[App.~A]{EG14}, attributed there to R.~Taylor, and in \cite[Prop.~8.2.2]{Sno09}. \begin{lemma}\label{lem:bertini} Let $Y/F$ be a smooth, geometrically irreducible, quasi-projective variety of positive dimension and $Z\subset Y$ a finite reduced closed subscheme. There is a smooth geometrically irreducible curve $C\subset Y$, defined over $F$, containing $Z$. \end{lemma} \begin{proof} If $\dim Y=1$ take $C=Y$. Otherwise fix a projective embedding $Y\subset\PP^M$ and let $d=\dim Y\geq 2$. Since we are in characteristic $0$, $Z$ is smooth of dimension $0$, so $\dim Y>2\dim Z$; by the Bertini theorem for hypersurface sections containing a smooth subscheme \cite{KA79} (for an infinite field; see also \cite{Poo08} and the survey in \cite{GK23}), a general hypersurface $H_1$ of large degree containing $Z$ has $Y_1=Y\cap H_1$ smooth of dimension $d-1$ (including at the points of $Z$). For degree large, the linear system of hypersurfaces through $Z$ defines a morphism $Y\setminus Z\to\PP^{N}$ which is an immersion, so its image has dimension $d\geq 2$, and by Jouanolou's Bertini theorem \cite[Thm.~6.3(4)]{Jou83} $Y_1\setminus Z$, hence $Y_1$, is geometrically irreducible for general $H_1$ (as $Y_1$ is smooth of positive dimension, $Z$ lies in the closure of $Y_1\setminus Z$). Both conditions are open and non-empty, so a general $H_1$ satisfying both exists over $F$, which is infinite. Iterating $d-1$ times (each step starts from a smooth geometrically irreducible variety of dimension $\geq 2$ containing $Z$) gives $C$. \end{proof} \subsection{The splitting statement} \begin{theorem}\label{thm:split} In the setting of Theorem~\ref{thm:main}, let $S$ be a finite set of finite places of $F$. Then $K$ can be chosen satisfying \textup{(i)--(iv)}. \end{theorem} \begin{proof} Let $F_\ast$, $T$ and $F^{\mathrm{av}}$ be as in Section~\ref{sec:proof}, and let $\widetilde F$ be the Galois closure over $F$ of $F_\ast F^{\mathrm{av}}\,\bar F^{\ker\rbar}(\zeta_p)$. Let $\Sigma_0$ be the set of places of $F$ above $p\ell\infty$ and $\Sigma=\Sigma_0\cup S$. For each finite $v\in\Sigma$ choose a finite Galois extension $L_v/F_v$ containing the completions of $F_\ast$ at the places above $v$, and so large that for every place $w$ of $F_\ast$ above $v$ the open set \[ \Omega_w\subset T(L_v) \] defined by the condition $v(t)<0$ if $v\mid p$, by $v(t)>0$ if $v\mid\ell$, and equal to $T(L_v)$ otherwise, is non-empty (here $L_v$ is regarded as an extension of $F_{\ast,w}$). For a finite $v$ the required points exist after finite extension. For each completion of $F_\ast$ choose a nonbranch value of $t$ of the indicated valuation (at the other places choose any value in $T_0$), then split the finite fibre. A common Galois closure over $F_v$ works for every embedding, and the resulting valuation conditions are open. For $v$ real put $L_v=\R$ and $\Omega_w=T(\R)$, which is non-empty for each real place $w$ of $F_\ast$ \cite[proof of Thm.~3.1.2]{BLGGT}. \emph{Step 1: absorbing the local conditions.} By Lemma~\ref{lem:solvable} choose $F_1'/F$ finite, solvable, Galois, totally real, linearly disjoint from $\widetilde F$, with $F'_{1,w}\cong L_v$ for all $w\mid v$, $v\in\Sigma$, and put $F_1=F_\ast F_1'$. Then $F_1/F$ is finite, solvable, Galois and totally real, it contains $F_\ast$, and $F_{1,u}\cong L_v$ for every place $u\mid v$ of $F_1$, $v\in\Sigma$. \emph{Step 2: Weil restriction.} Let $Y=\mathrm{Res}_{F_1/F}(T_{F_1})$, a smooth geometrically irreducible variety over $F$, with $Y(F_v)=\prod_{u\mid v}T(F_{1,u})$ for $v\in\Sigma$, the product being over the places $u$ of $F_1$ above $v$. Put $\Omega'_v=\prod_{u\mid v}\Omega_{u|_{F_\ast}}\subset Y(F_v)$, a non-empty open subset. \emph{Step 3: a seed and a curve.} Apply Theorem~\ref{thm:MB} to $Y$ with the places $\Sigma$, local fields $F_v$ (resp.\ $\R$) and open sets $\Omega'_v$: this gives a closed point $y\in Y$ all of whose geometric points lie in $\Omega'_v\subset Y(F_v)$ for every $v\in\Sigma$. By Lemma~\ref{lem:bertini} choose a smooth geometrically irreducible curve $C\subset Y$ over $F$ containing $y$. Then $\Omega''_v:=C(F_v)\cap\Omega'_v$ is a non-empty open subset of $C(F_v)$ for each $v\in\Sigma$. \emph{Step 4: the $S_N$ construction.} Apply Proposition~\ref{prop:SN} to $C$, with places $\Sigma$, local fields $F_v$ (resp.\ $\R$), open sets $\Omega''_v$, avoidance field $F_1\widetilde F\,\Favoid$ and bound $N_0$. We obtain a closed point $x\in C$ of degree $N\geq N_0$, with residue field $F_x$ and Galois closure $K$, such that $\Gal(K/F)\cong S_N$, $K$ is linearly disjoint from $F_1\widetilde F\,\Favoid$ over $F$, every $v\in\Sigma$ (in particular every $v\in S$) splits completely in $K$, $K$ is totally real, and all $F$-embeddings of $F_x$ into $F_v$ send $x$ into $\Omega'_v$. \emph{Step 5: a point of $T$ over $KF_1$.} Since $K$ and $F_1$ are linearly disjoint over $F$, $F_x\otimes_F F_1=F_xF_1$ and $x\in Y(F_x)=T(F_xF_1)\subset T(KF_1)$. We check \textup{(P1)--(P4)} of Section~\ref{sec:proof} for $F'=KF_1$. It is a finite totally real extension of $F_\ast$, Galois over $F$ with group $S_N\times\Gal(F_1/F)$, and it carries a point of $T$. Since $K$ and $F_1'$ are Galois over $F$, linearly disjoint from each other and $KF_1'$ is linearly disjoint from $\widetilde F$ over $F$, the field $KF_1=KF_1'F_\ast$ is linearly disjoint from $\widetilde F\supseteq F_\ast F^{\mathrm{av}}$ over $F_\ast$; this is (P3). For $v\in\Sigma_0$ and a place $u'$ of $KF_1$ above $v$, the completion $(KF_1)_{u'}$ equals $F_{1,u}\cong L_v$, where $u=u'|_{F_1}$, because $K$ is split at $v$; under the corresponding embedding the point of $T$ is the $u$-component of the image of $x$ in $Y(F_v)$, which lies in $\Omega_{u|_{F_\ast}}$ by the definition of $\Omega'_v$. This is (P4). Hence, by Step~D of Section~\ref{sec:proof}, $\rho|_{G_{KF_1}}$ is automorphic. \emph{Step 6: solvable descent.} The extension $KF_1/K$ is Galois with group $\Gal(F_1/F)$, which is solvable, and $\rho|_{G_{KF_1}}$ is irreducible: Step~D applied to $F'=KF_1$ identifies the image over $EF'(\zeta_p)$ with the absolutely irreducible original image over $F(\zeta_p)$. By solvable descent \cite[Lemma~2.2.2]{BLGGT} (for $M/F$ soluble Galois and totally real or CM, and $(r,\mu)$ polarised with $r|_{G_M}$ irreducible, $(r,\mu)$ is automorphic if and only if its restriction to $G_M$ is; in dimension two this is Langlands' base change \cite{Lan80}), $\rho|_{G_K}$ is automorphic. Thus $K$ satisfies (i)--(iv). \end{proof} \begin{remark} The field $KF_1$ over which the moduli point lives is in general ramified above $p$; it is the descent along the solvable extension $KF_1/K$ that produces a modularity field split above $p$. This is exactly Snowden's mechanism \cite[Props.~8.2.1, 8.2.2]{Sno09}, in which the analogue of $K$ is the field $F_2$ produced by Moret-Bailly applied to the Weil restriction; the only new point here is that, by passing through a curve $C\subset Y$ and Proposition~\ref{prop:SN}, this field can be taken with Galois group $S_N$. \end{remark} \begin{remark}[Arbitrary $S$]\label{rem:anyS} The set $S$ in Theorem~\ref{thm:split} is an arbitrary finite set of finite places of $F$: for $v\in S$ one only needs some finite Galois $L_v/F_v$ with $T(L_v)\neq\emptyset$, which always exists, and the behaviour of $\rho$ at $v$ plays no role. In particular $S$ may contain places where $\rho$ ramifies, places above $p$ whether or not $p$ splits in $F$, and places above any finite set of primes. Since $K_w=F_v$ for $w\mid v\in S$, one has $\rho|_{G_{K_w}}=\rho|_{G_{F_v}}$: local types, conductor exponents and residual local behaviour at the places of $S$ are unchanged in $K$. The conditions ``$S$ splits'', ``$K\cap\Favoid=F$'' and ``$N\geq N_0$'' are all imposed simultaneously in Proposition~\ref{prop:SN}. \end{remark} \begin{remark} Under (H) the splitting of $p$ is not needed for the automorphy lifting theorems of \cite{BLGGT} (potential diagonalisability is insensitive to finite extensions). Its interest lies in applications requiring $p$ split in the modularity field, for instance modularity lifting theorems or local-global compatibility results only available when $F_v=\Q_p$ for all $v\mid p$. \end{remark} \section{Adequacy under \texorpdfstring{$S_N$}{S\_N} extensions}\label{sec:adequacy} Let $\rbar\colon G_F\to\GL_n(\bar\F_p)$ be continuous, let $F^{\rbar}=\bar F^{\ker\rbar}(\zeta_p)$, $\Delta=\Gal(F^{\rbar}/F)$, and $\Gamma=\rbar(G_{F(\zeta_p)})$. \begin{lemma}\label{lem:intersection} Let $K/F$ be finite Galois with $\Gal(K/F)\cong S_N$, $N\geq 5$, and assume $S_N$ is not a quotient of $\Delta$ \textup{(}e.g.\ $N!>|\Delta|$\textup{)}. Let $F(\sqrt\delta)=K^{A_N}$. Then $K\cap F^{\rbar}\subseteq F(\sqrt\delta)$, and \[ \rbar(G_{K(\zeta_p)})\ =\ \Gamma':=\rbar(G_{F(\sqrt\delta,\zeta_p)}),\qquad [\Gamma:\Gamma']\leq 2 . \] \end{lemma} \begin{proof} $\Gal(K\cap F^{\rbar}/F)$ is a common quotient of $S_N$ and $\Delta$. The quotients of $S_N$ are $1$, $\Z/2$ and $S_N$, and the last is excluded by hypothesis; so $K\cap F^{\rbar}\subseteq F(\sqrt\delta)$. Write $B=F^{\rbar}$, $C=F(\zeta_p)$, $D=K^{A_N}$ and $I=K\cap B$. Then $I=D\cap B$. Since $K$ and $B$ are Galois and linearly disjoint over $I$, the image of $G_K$ in $\Delta$ is $\Gal(B/I)$. The same holds for $G_D$. Intersecting these images with $\Gal(B/C)$ gives $\Gal(B/IC)$ in both cases, since the cyclotomic character factors through $\Delta$. Projecting to the residual image gives the equality. The index bound follows from $[IC:C]\leq2$. \end{proof} \begin{proposition}\label{prop:adequacy} In the situation of Lemma~\ref{lem:intersection}, assume $\Gamma$ acts absolutely irreducibly. Then one of the following holds: \begin{enumerate}[label=\textup{(\alph*)}] \item $\rbar|_{G_{K(\zeta_p)}}$ is absolutely irreducible; in particular it is adequate if $p\geq 2(n+1)$ \cite{GHTT}; \item $[\Gamma:\Gamma']=2$, $\rbar(G_{K(\zeta_p)})=\Gamma'$, and $\rbar|_{G_{F(\zeta_p)}}\cong\Ind_{G_{F(\sqrt\delta,\zeta_p)}}^{G_{F(\zeta_p)}}\sigma$ for some $\sigma$ of dimension $n/2$. For $n=2$ this means that $\rbar|_{G_{F(\zeta_p)}}$ has dihedral projective image and $F(\sqrt\delta,\zeta_p)$ is a quadratic extension of $F(\zeta_p)$ from which it is induced. \end{enumerate} \end{proposition} \begin{proof} Write $H=\Gamma'=\rbar(G_{K(\zeta_p)})$, using Lemma~\ref{lem:intersection}, and let $V$ be the space of $\Gamma$. If $V|_H$ is reducible then $[\Gamma:H]=2$. Choose a simple $H$-submodule $W$ and $s\in\Gamma\setminus H$. Irreducibility over $\Gamma$ implies $V=W\oplus sW$, since $W+sW$ is $\Gamma$-stable and $W,sW$ are distinct simple submodules. Thus $V\simeq\Ind_H^\Gamma W$. Moreover $W$ and $sW$ are non-isomorphic, since otherwise Frobenius reciprocity would give $\dim\operatorname{End}_\Gamma(V)\geq2$. This also proves the assertion in residual characteristic two. In dimension two $H$ acts by the two distinct characters on its lines and $s$ exchanges them, giving the dihedral description. The adequacy assertion follows from \cite{GHTT}. \end{proof} Thus the $S_N$ structure alone guarantees that the residual image stays irreducible, hence adequate for $p\geq 2(n+1)$, except in the induced case (b), which only involves the single quadratic field $F(\sqrt\delta)=K^{A_N}$. There are finitely many quadratic subextensions of $F^{\rbar}/F$, and case (b) can occur only if $F(\sqrt\delta)$ is one of them. \begin{corollary}\label{cor:avoid} In Theorem~\ref{thm:main} and Proposition~\ref{prop:SN}, by including $F^{\rbar}$ in $\Favoid$ one gets $K\cap F^{\rbar}=F$, hence $\rbar(G_{K(\zeta_p)})=\Gamma$: the residual image over $K(\zeta_p)$ is literally unchanged, and adequacy is preserved with no assumption on $p$. In particular the dihedral case \textup{(b)} is excluded. It suffices in fact to require that $F(\sqrt\delta)$ avoids the finitely many quadratic subextensions of $F^{\rbar}/F$, a condition on the class of the discriminant $\delta=\delta(t)$ modulo squares which is of Hilbert type in $t$. \end{corollary} \begin{remark} For the auxiliary representation $\bar r'$ the same observation applies at $\ell$. In Sections~\ref{sec:proof} and~\ref{sec:local} the avoidance field is enlarged after $\bar r'$ has been chosen, before specialising the curve. \end{remark} \subsection{A uniform version} \begin{lemma}\label{lem:QS} Let $\Sigma$ be a finite set of places of $F$. There are only finitely many quadratic extensions of $F$ unramified outside $\Sigma$. We denote by $Q_\Sigma$ their compositum, a finite multiquadratic extension of $F$. \end{lemma} \begin{proof} A nonarchimedean completion of $F$ has finitely many quadratic extensions, since its square class group is finite. The local discriminant exponents at the finite places in $\Sigma$ are therefore bounded. The relative discriminants have bounded norm, and Hermite--Minkowski gives the assertion. \end{proof} \begin{proposition}\label{prop:uniform} Let $\Sigma$ be a finite set of places of $F$ containing the archimedean places, and let $\mathcal{R}$ be a set \textup{(}possibly infinite\textup{)} of continuous representations $\rbar\colon G_F\to\GL_n(\bar\F_{p})$, with $p=p(\rbar)$ varying, such that each $F^{\rbar}=\bar F^{\ker\rbar}(\zeta_p)$ is unramified outside $\Sigma$ and $S_N$ is not a quotient of $\Gal(F^{\rbar}/F)$. Let $K/F$ be Galois with $\Gal(K/F)\cong S_N$, $N\geq 5$, and $K\cap Q_\Sigma=F$. Then for every $\rbar\in\mathcal{R}$ \[ \rbar(G_{K(\zeta_p)})=\rbar(G_{F(\zeta_p)}). \] \end{proposition} \begin{proof} By Lemma~\ref{lem:intersection}, $K\cap F^{\rbar}\subseteq F(\sqrt\delta)=K^{A_N}$. If $F(\sqrt\delta)\subseteq F^{\rbar}$, then $F(\sqrt\delta)$ is unramified outside $\Sigma$, hence contained in $Q_\Sigma$, contradicting $K\cap Q_\Sigma=F$. So $K\cap F^{\rbar}=F$, and the image of $G_{K(\zeta_p)}$ in $\Gal(F^{\rbar}/F)$ is $\Gal(F^{\rbar}/F(\zeta_p))$. \end{proof} The point is that the field to be avoided, $Q_\Sigma$, depends only on $F$ and $\Sigma$, not on the representations in $\mathcal{R}$, which may be unknown at the moment $K$ is chosen. \section{Dimension two}\label{sec:dim2} \subsection{Uniformity in \texorpdfstring{$p$}{p}} \begin{lemma}\label{lem:dickson} Let $N\geq 6$. For every prime $p$ and every continuous $\rbar\colon G_F\to\GL_2(\bar\F_p)$, the group $S_N$ is not a quotient of $\Gal(F^{\rbar}/F)$. \end{lemma} \begin{proof} Identify $\Gal(F^{\rbar}/F)$ with the image of $(\rbar,\bar\chi_p)$ in $\GL_2(\bar\F_p)\times\F_p^\times$. Its map to the projective image of $\rbar$ has central kernel, consisting of elements with scalar first coordinate. Every surjection to $S_N$ therefore factors through the projective image, since $S_N$ has trivial centre. By Dickson's classification of finite subgroups of $\mathrm{PGL}_2(\bar\F_p)$ \cite{Dic01}, its non-abelian composition factors are of the form $\mathrm{PSL}_2(\F_q)$ or $A_5$. A quotient isomorphic to $S_N$ would give $A_N$ as a composition factor. For $N\geq 7$, $A_N$ is not isomorphic to any $\mathrm{PSL}_2(\F_q)$ (the only coincidences being $A_5\cong\mathrm{PSL}_2(\F_4)\cong\mathrm{PSL}_2(\F_5)$ and $A_6\cong\mathrm{PSL}_2(\F_9)$). For $N=6$, Dickson's list leaves only $\mathrm{PSL}_2(\F_9)$ and $\mathrm{PGL}_2(\F_9)$ as possible projective images with an $A_6$ composition factor. The first has order $360$. The second has order $720$ and contains an element of order $8$, represented by $\operatorname{diag}(a,1)$ with $a$ a generator of $\F_9^\times$. Since $S_6$ has no element of order $8$, neither group surjects onto $S_6$. \end{proof} Consequently, in dimension two the hypothesis on $S_N$ in Lemma~\ref{lem:intersection} and Proposition~\ref{prop:uniform} holds for all $N\geq 6$, uniformly in $p$ and in the coefficient field. For $n=2$ the conclusion of Proposition~\ref{prop:uniform} therefore only requires $N\geq 6$ and $K\cap Q_\Sigma=F$. \subsection{Residual modularity over \texorpdfstring{$S_N$}{S\_N} extensions by Snowden's method}\label{ss:snowden} In this subsection $n=2$ and $p\geq 3$. We use the terminology of \cite{Sno09}: \emph{weight two} representations, the local types $A$, $B$, $C$, and the associated type functions \cite[\S\S2.1, 2.6]{Sno09}. Types $A$ and $B$ are respectively potentially crystalline ordinary and potentially crystalline nonordinary, with the determinant normalised over a finite extension. Type $C$ means that after a finite extension the representation is an extension of $1$ by $\chi_p$. A local representation may have both types $A$ and $C$, denoted $A/C$ by Snowden. We impose the conditions \begin{itemize} \item[(A1)] $\rbar|_{G_{F(\zeta_p)}}$ is absolutely irreducible; \item[(A2)] if $p=5$ and the projective image of $\rbar$ is $\mathrm{PGL}_2(\F_5)$, then $[F(\zeta_5):F]=4$. \end{itemize} In this subsection, modularity means arising from a cuspidal Hilbert eigenform of parallel weight two. \begin{theorem}\label{thm:snowdenSN} Let $\rbar\colon G_F\to\GL_2(\bar\F_p)$ be odd and satisfy \textup{(A1)} and \textup{(A2)}. Let $S$ be a finite set of finite places of $F$, let $\Favoid/F$ be a finite extension and let $N_0\geq 1$. Then there exist $N\geq N_0$ and a totally real Galois extension $K/F$ such that: \begin{enumerate}[label=\textup{(\roman*)}] \item $\Gal(K/F)\cong S_N$; \item $K$ is linearly disjoint from $\Favoid\,\bar F^{\ker\rbar}(\zeta_p)$ over $F$; \item every place of $F$ in $S$ and every place of $F$ above $p$ splits completely in $K$; \item $\rbar|_{G_K}$ is modular. \end{enumerate} \end{theorem} The proof follows \cite[\S5, \S8]{Sno09}, with Proposition~\ref{prop:SN} in place of the theorem of Moret-Bailly. The last step is solvable descent of residual modularity. For $p$-adic representations this is Langlands' base change; for residual representations it is not formal. Khare proved such a descent result \cite{Kha00} over $\Q$, and in the present setting it is \cite[\S8.1]{Sno09}, whose argument we reproduce. The descent is not applied to the residual representation but to a $p$-adic lift $\rho'$ of $\rbar$ which is already defined over $F$: a modularity lifting theorem shows that $\rho'$ is modular over the larger field, Langlands' base change then gives the modularity of $\rho'|_{G_K}$, and reduction modulo $p$ gives that of $\rbar|_{G_K}$ (Steps~0 and~5 below). \begin{proof} \emph{Step 0: a lift over $F$.} By \cite[Prop.~7.10.1]{Sno09} there is a finitely ramified, odd, weight two lift $\rho'\colon G_F\to\GL_2(\bar\Q_p)$ of $\rbar$. Write $\det\rho'=\psi\chi_p$ with $\psi$ of finite order, and let $t$ be a definite type function on the set $\Sigma_p$ of places of $F$ above $p$ with $t\approx t_{\rho'}|_{\Sigma_p}$ in the sense of \cite[\S2.6]{Sno09}. \emph{Step 1: auxiliary data.} Choose an odd prime $\ell\neq p$ and let $\rho_\ell\colon G_F\to\GL_2(\bar\Q_\ell)$ and $M_\ell/F$ be the representation and the finite Galois extension of \cite[Prop.~5.4.1]{Sno09}: for every finite totally real $F''/F$ linearly disjoint from $M_\ell$, $\rho_\ell|_{G_{F''}}$ is modular and $\bar\rho_\ell|_{G_{F''}}$ satisfies (A1) and (A2) (with $\ell$ in place of $p$). Write $\det\rho_\ell=\psi_\ell\chi_\ell$. Let $M'$ be the Galois closure over $F$ of the compositum of $\Favoid$, $\bar F^{\ker\rbar}(\zeta_p)$ and $M_\ell$. \emph{Step 2: making the determinants cyclotomic.} Since $\rbar$ and $\rho_\ell$ are odd and $p,\ell$ are odd, $\psi$ and $\psi_\ell$ are trivial on all complex conjugations. Let $\Sigma_\psi$ be the finite set of finite places of $F$ at which $\psi$ or $\psi_\ell$ is ramified, and for $v\in\Sigma_\psi$ let $E_v/F_v$ be a finite Galois extension on which $\psi$ and $\psi_\ell$ become trivial. By Lemma~\ref{lem:solvable} there is a finite, solvable, Galois, totally real extension $F_1/F$, linearly disjoint from $M'$, with $F_{1,w}\cong E_v$ for all $w\mid v\in\Sigma_\psi$ (and $F_{1,w}=\R$ at the real places). Then $\psi|_{G_{F_1}}$ and $\psi_\ell|_{G_{F_1}}$ are trivial at the places above $\Sigma_\psi$ and at the real places, and unramified elsewhere; an unramified character of finite order of a local Galois group is the square of such a character. Hence both characters are locally squares at all places of $F_1$, and by \cite[Lemma~4.2.1]{Sno09} they are squares: $\psi|_{G_{F_1}}=\psi_1^2$, $\psi_\ell|_{G_{F_1}}=\psi_{\ell,1}^2$ with $\psi_1$, $\psi_{\ell,1}$ of finite order. Put \[ \rbar_{\mathfrak p}=\bar\psi_1^{-1}\cdot\rbar|_{G_{F_1}},\qquad \rbar_{\mathfrak l}=\bar\psi_{\ell,1}^{-1}\cdot\bar\rho_\ell|_{G_{F_1}}, \] which have cyclotomic determinant. Choose a totally real coefficient field $L$ with primes $\mathfrak p\mid p$ and $\mathfrak l\mid\ell$ whose residue fields contain the coefficients of these two twisted representations. For example, take a monic polynomial of degree divisible by both residue degrees, irreducible modulo $p$ and $\ell$ and with distinct real roots, using weak approximation on its coefficients. (In \cite[(5.5)]{Sno09} this step is done with \cite[Cor.~4.2.2]{Sno09}, which gives an extension whose Galois closure is solvable; choosing $F_1/F$ Galois here gives a solvable Galois extension in the final descent.) \emph{Step 3: the moduli space and the local conditions.} Let $X/F_1$ be the scheme of \cite[proof of Prop.~5.3.1]{Sno09}, classifying $\GL_2(L)$-type abelian varieties $A$ with polarisation data and symplectic isomorphisms $A[\mathfrak p]\cong\rbar_{\mathfrak p}$, $A[\mathfrak l]\cong\rbar_{\mathfrak l}$ and an auxiliary level structure at a third prime $\mathfrak r$. It is shown there that $X$ is a separated scheme of finite type over $F_1$, smooth and geometrically connected, hence geometrically irreducible. It is quasi-projective, being a moduli space of polarised abelian varieties with level structure \cite[\S1]{Rap78}; this is only used to apply Lemma~\ref{lem:bertini}, and could be avoided by replacing $X$ by a dense affine open subscheme, since non-empty open subsets of $X(L_v)$ are Zariski dense. For a place $w$ of $F_1$ above $p$ let $\bar\Omega_w\subset X(\bar F_{1,w})$ be the set of points whose abelian variety has good reduction which is ordinary at $\mathfrak p$ (if $t(w|_F)=A$), good reduction which is not ordinary at $\mathfrak p$ (if $t(w|_F)=B$), or positive toric rank after semistable reduction (if $t(w|_F)=C$). Indeed the rational character group of a nonzero torus in the semistable fibre is an $L$-vector space, so its rank is at least $[L:\Q]=\dim A$ and the fibre is totally toric. For $w$ above $\ell$ define $\bar\Omega_w$ in the same way, with $\mathfrak l$ and the type function $t_{\rho_\ell}$. As in \cite[proof of Prop.~5.3.1]{Sno09}, for every sufficiently large finite Galois extension $L_v$ of $F_v$ ($v=w|_F$) containing $F_{1,w}$, the set $\Omega_w:=\bar\Omega_w\cap X(L_v)$ is a non-empty open subset of $X(L_v)$ stable under $\Gal(L_v/F_{1,w})$; and $X(\R)\neq\emptyset$ at each real place of $F_1$. The argument of \cite[(5.5)]{Sno09} proves the following. Let $F''$ be a field and $x$ a point such that: \begin{itemize} \item[(Q1)] $F''$ is a finite totally real extension of $F_1$; \item[(Q2)] $x\in X(F'')$; \item[(Q3)] $F''\cap M'=F$; \item[(Q4)] for every place $u$ of $F''$ above $p\ell$, the image of $x$ in $X(\bar F''_u)$ lies in $\bar\Omega_{u|_{F_1}}$. \end{itemize} Then there is a cuspidal Hilbert eigenform $f$ of parallel weight two over $F''$, with coefficients in $\bar\Q_p$, such that \[ \bar\rho_f\cong\rbar|_{G_{F''}},\qquad \det\rho_f=\psi\chi_p|_{G_{F''}},\qquad t_f|_{\Sigma_p}=t|_{F''}. \] Indeed, let $A/F''$ be the abelian variety attached to $x$. By (Q4) and the definition of the sets $\bar\Omega_w$, which involve only the reduction of $A$ over $\bar F''_u$, the Tate modules $T_{\mathfrak p}A$ and $T_{\mathfrak l}A$ have types $t|_{F''}$ and $t_{\rho_\ell}|_{F''}$ at the places above $p$ and $\ell$. By (Q3) and Step~1, $A[\mathfrak l]\cong\bar\psi_{\ell,1}^{-1}\bar\rho_\ell|_{G_{F''}}$ satisfies (A1) and (A2) and $\psi_{\ell,1}^{-1}\rho_\ell|_{G_{F''}}$ is a modular lift of it of the same type as $T_{\mathfrak l}A$ at the places above $\ell$; so $T_{\mathfrak l}A$ is modular by the modularity lifting theorem \cite[Thm.~4.4.2]{Sno09}, say attached to $f'$. By compatibility $T_{\mathfrak p}A$ is attached to $f'$ as well, and $f=\psi_1\cdot f'$ has the stated properties. These are exactly the properties of the field and of the point used in \cite[(5.5)]{Sno09}; that the field be Galois over $F$ is not used. \emph{Step 4: Weil restriction and the $S_N$ construction.} Let $\Sigma$ be the union of $S$, of the sets of places of $F$ above $p$ and $\ell$, and of the real places. For each finite $v\in\Sigma$ choose a finite Galois extension $L_v/F_v$ containing the completions of $F_1$ above $v$ and so large that $\Omega_w\subset X(L_v)$ is defined and non-empty for all places $w\mid v$ of $F_1$ if $v\mid p\ell$; for the other finite $v\in\Sigma$ choose $L_v$ with $X(L_v)\neq\emptyset$ for all embeddings of $F_1$ and put $\Omega_w=X(L_v)$. For $v$ real put $L_v=\R$, $\Omega_w=X(\R)$. By Lemma~\ref{lem:solvable} choose $F_1'/F$ finite, solvable, Galois, totally real, linearly disjoint from $F_1M'$, with $F'_{1,w'}\cong L_v$ for all $w'\mid v\in\Sigma$, and put $\widetilde F_1=F_1F_1'$. Then $\widetilde F_1/F$ is finite, solvable, Galois, totally real, with $\widetilde F_{1,u}\cong L_v$ for all $u\mid v\in\Sigma$, and $\widetilde F_1\cap M'=F$. Let $Y=\mathrm{Res}_{\widetilde F_1/F}(X_{\widetilde F_1})$. It is a smooth, geometrically irreducible, quasi-projective variety over $F$, and $Y(F_v)=\prod_{u\mid v}X(\widetilde F_{1,u})$ for $v\in\Sigma$. Let $\Omega'_v=\prod_{u\mid v}\Omega_{u|_{F_1}}\subset Y(F_v)$, a non-empty open subset. Theorem~\ref{thm:MB} gives a closed point $y\in Y$ all of whose geometric points lie in $\Omega'_v$ for $v\in\Sigma$; Lemma~\ref{lem:bertini} gives a smooth geometrically irreducible curve $C\subset Y$ over $F$ through $y$; and Proposition~\ref{prop:SN}, applied to $C$ with the places $\Sigma$, the local fields $F_v$, the open sets $C(F_v)\cap\Omega'_v$, the avoidance field $\widetilde F_1M'$ and the bound $N_0$, gives a closed point $x\in C$ of degree $N\geq N_0$ whose residue field $F_x$ has Galois closure $K$ with: $\Gal(K/F)\cong S_N$; $K$ totally real; $K$ linearly disjoint from $\widetilde F_1M'$ over $F$; every $v\in\Sigma$ split completely in $K$; and all $F$-embeddings $F_x\to F_v$ sending $x$ into $\Omega'_v$. This gives (i), (ii) and (iii). Since $K$ and $\widetilde F_1$ are linearly disjoint, $x\in Y(F_x)=X(F_x\widetilde F_1)\subset X(K\widetilde F_1)$. We check \textup{(Q1)--(Q4)} for $F''=K\widetilde F_1$. It is a finite totally real extension of $F_1$ carrying a point of $X$. The fields $F_1$, $F_1'$, $K$ are Galois over $F$, $F_1$ is linearly disjoint from $M'$, $F_1'$ from $F_1M'$ and $K$ from $\widetilde F_1M'$; hence $\Gal(K\widetilde F_1M'/F)$ is the product of the four Galois groups and $K\widetilde F_1\cap M'=F$. For a place $u'$ of $K\widetilde F_1$ above $v\mid p\ell$, the completion $(K\widetilde F_1)_{u'}$ equals $\widetilde F_{1,u}\cong L_v$, $u=u'|_{\widetilde F_1}$, because $K$ is split at $v$, and the image of $x$ there is the $u$-component of the image of $x$ in $Y(F_v)$, which lies in $\Omega_{u|_{F_1}}\subset\bar\Omega_{u|_{F_1}}$. By Step~3 there is a cuspidal eigenform $f$ of parallel weight two over $K\widetilde F_1$ with $\bar\rho_f\cong\rbar|_{G_{K\widetilde F_1}}$ and $t_f|_{\Sigma_p}=t|_{K\widetilde F_1}$. \emph{Step 5: descent to $K$.} Consider $\rho'|_{G_{K\widetilde F_1}}$. It is finitely ramified, odd and of weight two. Its reduction $\rbar|_{G_{K\widetilde F_1}}$ has the same image as $\rbar$, also after restriction to the subgroups fixing $\zeta_p$, and $[K\widetilde F_1(\zeta_p):K\widetilde F_1]=[F(\zeta_p):F]$, because $K\widetilde F_1\cap\bar F^{\ker\rbar}(\zeta_p)=F$; hence it satisfies (A1) and (A2). It is isomorphic to $\bar\rho_f$, and, types being potential notions, $t_{\rho'|_{G_{K\widetilde F_1}}}\approx t|_{K\widetilde F_1}=t_f|_{\Sigma_p}$. By \cite[Thm.~4.4.2]{Sno09}, $\rho'|_{G_{K\widetilde F_1}}$ is modular. The extension $K\widetilde F_1/K$ is Galois with solvable group $\Gal(\widetilde F_1/F)$, both fields are totally real, and $\rho'|_{G_{K\widetilde F_1}}$ is irreducible; by Langlands' solvable base change \cite{Lan80} (see \cite[Lemma~2.2.2]{BLGGT}), $\rho'|_{G_K}$ is modular. Hence $\rbar|_{G_K}$ is modular, which is (iv). \end{proof} \begin{remark} \begin{enumerate}[label=(\arabic*)] \item More generally, if a finitely ramified, totally odd weight two lift of $\rbar$ over $F$ is prescribed, take it for $\rho'$ in Step~0. The same construction makes this particular lift modular over $K$, with (i)--(iii), for arbitrary splitting behaviour of $p$ in $F$. The form over $K$ produced in the proof is attached to $\rho'|_{G_K}$; in particular one may add to the conclusion that $\rbar|_{G_K}$ has a modular lift of determinant $\psi\chi_p$ whose type at the places above $p$ is $t_{\rho'}$. The lift $\rho'$ over $F$ is the device by which residual modularity is descended from $K\widetilde F_1$, where the abelian variety lives and where $p$ is in general ramified, to $K$, where $p$ is split; this is the proof of solvable descent for mod $p$ Hilbert eigenforms in \cite[\S8.1]{Sno09}, and the whole argument has the structure of \cite[\S8.2]{Sno09}, where residual modularity is obtained over a compositum and descended along its solvable part. \item Snowden obtains the initial lift $\rho'$ in \cite[Prop.~7.10.1]{Sno09} using potential modularity over fields supplied by Moret-Bailly. \end{enumerate} \end{remark} \subsection{The potentially diagonalisable case} For potentially diagonalisable representations nothing new is needed in dimension two: the statement is Theorem~\ref{thm:main} with $n=2$, together with Remark~\ref{rem:p35} for the small primes. We record it for comparison with Corollary~\ref{cor:kisin}. \begin{corollary}\label{cor:pd2} Let $p\geq 3$ and let $\rho\colon G_F\to\GL_2(\bar\Q_p)$ be totally odd, unramified outside finitely many places, and potentially diagonalisable with distinct Hodge--Tate weights at every place above $p$. Assume that $\rbar|_{G_{F(\zeta_p)}}$ is irreducible if $p\geq 7$; and, if $p\in\{3,5\}$, that $\rbar(G_{F(\zeta_p)})$ is adequate and, for $p=5$, that the projective image of $\rbar$ is neither $\mathrm{PSL}_2(\F_5)$ nor $\mathrm{PGL}_2(\F_5)$. Then the conclusions \textup{(i)--(iv)} of Theorem~\ref{thm:main} hold for $\rho$. No condition is imposed on the splitting of $p$ in $F$. \end{corollary} \begin{proof} For $p\geq 7$, that is $p\geq 2(n+1)$ with $n=2$, the representation $\rho$ satisfies \textup{(H)} and this is Theorem~\ref{thm:main}. For $p\in\{3,5\}$ it is Remark~\ref{rem:p35}. \end{proof} \subsection{Without potential diagonalisability, when \texorpdfstring{$p$}{p} splits in \texorpdfstring{$F$}{F}} Assume now $n=2$, $\rho\colon G_F\to\GL_2(\bar\Q_p)$ totally odd and unramified outside finitely many places, de Rham with distinct Hodge--Tate weights at each place above $p$, $p\geq 3$, $\rbar$ satisfying \textup{(A1)} and \textup{(A2)}, and that $p$ splits completely in $F/\Q$, so that $F_v=\Q_p$ for all $v\mid p$. For $p=5$, complete splitting already gives $[F(\zeta_5):F]=4$ by completion at any place above $5$, so (A2) is automatic here. Theorem~\ref{thm:snowdenSN} supplies residual modularity over $K$, and the lifting theorem at split primes applies to arbitrary regular de Rham lifts. Throughout this subsection, modularity of such a lift means association with a regular algebraic cuspidal automorphic representation of $\GL_2$ in the corresponding weight normalisation. \begin{corollary}\label{cor:kisin} Under these assumptions, for every $N_0$, every finite $\Favoid/F$ and every finite set $S$ of finite places of $F$ there is a totally real Galois extension $K/F$ with $\Gal(K/F)\cong S_N$, $N\geq N_0$, linearly disjoint from $\Favoid$, such that every place of $F$ in $S$ or above $p$ splits completely in $K/F$ \textup{(}hence $p$ splits completely in $K/\Q$ and $K_w=\Q_p$ for all $w\mid p$\textup{)}, and such that $\rho|_{G_K}$ is modular. \end{corollary} \begin{proof} Let $K$ be given by Theorem~\ref{thm:snowdenSN}. Then $\rbar|_{G_K}$ is modular, and since $K$ is linearly disjoint from $\bar F^{\ker\rbar}(\zeta_p)$, $\rbar|_{G_K}$ satisfies (A1) and (A2). Moreover $K_w=F_v=\Q_p$ for all $w\mid v\mid p$, and $\rho|_{G_K}$ is potentially semistable with distinct Hodge--Tate weights at all $w\mid p$. Building on Kisin, Pa\v{s}k\=unas and Hu--Tan \cite{Kis09,Pas15,HT15}, Tung's global lifting theorem \cite[Thm.~4.7]{Tun21} now gives $\rho|_{G_K}\simeq r_p(f)\otimes\eta$ for a Hilbert eigenform $f$ and a character $\eta$. The character occurs as a line in $r_p(f)^\vee\otimes\rho|_{G_K}$, so it is finitely ramified and de Rham at all places above $p$. By rank one class field theory it is the $p$-adic avatar of an algebraic Hecke character. Indeed, de Rham characters are locally algebraic on the units above $p$, and Dirichlet's unit theorem makes their algebraic exponents parallel over the totally real field $K$. Removing that power of the cyclotomic character leaves a character of finite conductor factoring through a finite ray class group. Twisting the automorphic representation of $f$ by the corresponding Hecke character gives the assertion. \end{proof} \begin{remark} The hypothesis that $p$ splits completely in $F/\Q$ is used only for the lifting theorem. For a rational prime $p$ with some $[F_v:\Q_p]>1$, one can still arrange $K_w=F_v$ at every $v\mid p$. The place of degree greater than one prevents the application of \cite[Thm.~4.7]{Tun21}. It is essential that the lifting theorem is applied over $K$ and not over the field $K\widetilde F_1$ of the proof of Theorem~\ref{thm:snowdenSN}, where $p$ is in general not split. This is the same structure as in \cite[\S8]{Sno09}: residual modularity is first transported to the split field, and the lifting theorem is applied there. Only Snowden's results, valid for all $p\geq 3$ under (A1), (A2), are used in the construction of $K$; neither adequacy nor \cite{DG15} is needed. \end{remark} \section{Application to safe chains}\label{sec:safe} In the method of safe chains one works with a compatible system $\{\rho_\lambda\}$ of two-dimensional representations, deduced from potential modularity (by Brauer induction, or by the gluing argument of Section~\ref{sec:glue}, see Remark~\ref{rem:glue-system}), after a good-dihedral prime $q$ has been introduced in the level; from then on one only uses members in residual characteristics bounded by a constant $C$, which is greater than the largest prime dividing the conductor (in particular $C>q$). At each step one needs the residual images to stay adequate after restriction to the field of potential modularity, and it is often convenient that the relevant primes split there. The field $K$ can be chosen before the other members of the system are known. It suffices to bound the common ramification set and the residual characteristics in the chain. By Lemma~\ref{lem:dickson} and Proposition~\ref{prop:uniform}, these data determine a single finite extension to avoid. \begin{theorem}\label{thm:safe} Let $\rho\colon G_F\to\GL_2(\bar\Q_{p_0})$ satisfy \textup{(H)} \textup{(}or the hypotheses of Corollary~\ref{cor:kisin}\textup{)}, and let $\{\rho_\lambda\}$ be the compatible system attached to $\rho$ by potential modularity. Let $\mathcal N$ consist of all places above $p_0$ and the finite places away from $p_0$ where $\rho$ ramifies. Assume that every $\rho_\lambda$ of residual characteristic $p$ is unramified outside $\mathcal N\cup\{v\mid p\}$. For a strictly compatible system this follows by comparing the Weil--Deligne representations away from $p_0p$ \cite[\S5.1, Thm.~5.5.1]{BLGGT}. Let $C$ be larger than every prime below $\mathcal{N}$ and than $p_0$, and let $\Sigma_C$ be the set of places of $F$ above primes $2$. \end{enumerate} \end{remark} \section{Further remarks}\label{sec:remarks} \subsection{Descent and \texorpdfstring{$L$}{L}-functions} Under \textup{(H)}, choose the avoidance field to contain $\bar F^{\ker\rbar}(\zeta_p)$ and take $N\geq5$. Then $\rho|_{G_K}$ is absolutely irreducible. Brauer induction and soluble descent give meromorphic continuation and the functional equation for the completed $L$-function, with the compatible system and local factors of \cite[\S5.4, Thm.~5.5.1]{BLGGT}. For the two-dimensional argument see \cite{Tay06}. Put $D=K^{A_N}$. If automorphy of $\rho|_{G_D}$ can be deduced from that of $\rho|_{G_K}$, soluble descent for the quadratic extension $D/F$ gives automorphy of $\rho$ by \cite[Lemma~2.2.2]{BLGGT}. \emph{Under \textup{(H)}, the automorphy of $\rho$ over $F$ reduces to descent of automorphy along a single Galois extension with group $A_N$, where $N$ can be taken arbitrarily large \textup{(}and in any set as in Remark~\ref{rem:Nfamilies}\textup{)}.} The unresolved implication is descent of the given Galois representation from $K$ to $D$. Its formulation requires no general base change theorem along $K/D$. \subsection{Composition factors} Relative to $F$, the field $K$ has composition factors $A_N$ and $\Z/2$ only. For instance, for $N$ large, $K$ contains no subfield whose Galois closure over $F$ has a composition factor of the form $\mathrm{PSL}_2(\F_q)$, simultaneously for all $q$, apart from the coincidences $A_5\cong\mathrm{PSL}_2(\F_4)\cong\mathrm{PSL}_2(\F_5)$ and $A_6\cong\mathrm{PSL}_2(\F_9)$, which are excluded once $N\geq 7$. \subsection{Why alternating groups} For a generic complex curve of genus at least four, every indecomposable map to $\PP^1$ has alternating or symmetric monodromy \cite{GS}. The auxiliary curves in Proposition~\ref{prop:SN} can be special. Finding a point over a soluble extension, even with no local conditions, is a separate arithmetic question for curves of large genus \cite{Raw}. In genus one, \cite{CW08} gives a soluble point for an everywhere locally soluble curve over $\Q$ with semistable Jacobian. \section{A direct proof of finiteness of deformation rings}\label{sec:finiteness} In the method of Khare and Wintenberger \cite{KW1,KW2}, existence of lifts with prescribed local properties is obtained from two facts about a global deformation ring $R_F$ of $\rbar$: it has Krull dimension $\geq 1$, and it is finite over $\mathcal{O}$. Finiteness is deduced from potential modularity: over a suitable $K$ the corresponding ring $R_K$ identifies with the finite Hecke algebra of the prescribed weight and level, and one shows that the natural map $R_K\to R_F$ is \emph{finite} by an integrality argument on traces (see e.g.\ \cite[Lemma~6.3.1]{Sno09}; the same scheme is followed in \cite{BLGGT}, where the finiteness of the restriction map is \cite[Lemma~1.2.3]{BLGGT} and the dimension bound is \cite[Prop.~1.5.1]{BLGGT}). We record here that, for $p\nmid n$ and fixed determinant, this map is in fact \emph{surjective}, which gives finiteness at once. The underlying statement on deformation rings is not new: the description by coinvariants for the conditions obtained by restriction to $K$ (Proposition~\ref{prop:coinv}) is Hida's control theorem for deformation rings under base change \cite{Hid96,Hid00a,Hid00b}, established in the context of the Iwasawa theory of adjoint Selmer groups. What we record is its use to obtain finiteness in the method of Khare and Wintenberger, in place of the integrality argument. This observation goes back to \cite[\S3]{Die07}, where the minimal deformation ring over $\Q$ is shown to be a quotient of the one over the field of potential modularity, and the existence of the minimal lift is deduced. There, a preliminary step is used to kill the $p$-Sylow subgroup, that is, to reduce to an extension of degree prime to $p$. As explained in Remark~\ref{rem:hyp}\,(2), that step plays the same role as the condition on the determinant imposed below, and either of them suffices. Throughout this section $F$ is a number field, $p$ is a prime not dividing $n$, $k$ is a finite field of characteristic $p$, $\mathcal{O}$ is the ring of integers of a finite extension of $\Q_p$ with residue field $k$, $\rbar\colon G_F\to\GL_n(k)$ is continuous, and $\psi\colon G_F\to\mathcal{O}^\times$ is a continuous character lifting $\det\rbar$. The field $k$ and the ring $\mathcal{O}$ are fixed once and for all, and are the same over $F$ and over every extension $K$ of $F$: all deformation rings below are complete noetherian local $\mathcal{O}$-algebras with residue field $k$, and all maps between them are maps of $\mathcal{O}$-algebras. In particular, for a finite extension $K/F$ the restriction $\rbar|_{G_K}$ is regarded as a representation over $k$, even if it can be defined over a smaller field. Determinants are fixed over both fields: a deformation of $\rbar$ is required to have determinant $\psi$, and a deformation of $\rbar|_{G_K}$ is required to have determinant $\psi|_{G_K}$. Let $S$ be a finite set of places of $F$ containing those above $p$ and those where $\rbar$ or $\psi$ ramify, and for a finite extension $K/F$ let $S_K$ be the set of places of $K$ above $S$. We allow ramification at archimedean places and all ramification conditions below refer to finite places. If $\rbar$ is absolutely irreducible, $R_{F,S}$ denotes the universal $\mathcal{O}$-algebra for deformations of $\rbar$ to complete noetherian local $\mathcal{O}$-algebras with residue field $k$ which are unramified outside $S$ and have determinant $\psi$. If $\rbar|_{G_K}$ is absolutely irreducible, $R_{K,S_K}$ denotes the universal $\mathcal{O}$-algebra for deformations of $\rbar|_{G_K}$ to such algebras which are unramified outside $S_K$ and have determinant $\psi|_{G_K}$. Restriction to $G_K$ of the universal deformation over $F$ induces a homomorphism of $\mathcal{O}$-algebras $R_{K,S_K}\to R_{F,S}$, the \emph{restriction map}. \begin{theorem}\label{thm:quotient} Let $K/F$ be a finite extension \textup{(}not necessarily Galois\textup{)} with Galois closure $K'$, and assume that $\rbar|_{G_{K'}}$ is absolutely irreducible. With $k$, $\mathcal{O}$ and the determinants fixed as above: \begin{enumerate}[label=\textup{(\alph*)}] \item The restriction map $R_{K,S_K}\to R_{F,S}$ is a surjective homomorphism of $\mathcal{O}$-algebras. \item For $v\in S$ let $R_v^{\dagger}$ be a quotient of the universal framed deformation ring of $\rbar|_{G_{F_v}}$, and for $w\in S_K$ let $R_w^{\ddagger}$ be a quotient of that of $\rbar|_{G_{K_w}}$, both stable under conjugation, and let $R_F^{\dagger}$, $R_K^{\ddagger}$ be the corresponding quotients of $R_{F,S}$, $R_{K,S_K}$. Assume: \begin{itemize} \item[\textup{(C)}] for all $w\mid v$, the restriction to $G_{K_w}$ of any lift of $\rbar|_{G_{F_v}}$ of type $\dagger$ is of type $\ddagger$; that is, the composite of the restriction map on framed rings with the projection to $R_v^{\dagger}$ factors through $R_w^{\ddagger}$. \end{itemize} Then the restriction map induces a surjective homomorphism of $\mathcal{O}$-algebras $R_K^{\ddagger}\to R_F^{\dagger}$. In particular, if $R_K^{\ddagger}$ is finite over $\mathcal{O}$ \textup{(} for instance by an $R=\mathbb{T}$ theorem with a finite Hecke algebra over $K$\textup{)}, then $R_F^{\dagger}$ is finite over $\mathcal{O}$. \end{enumerate} \end{theorem} \begin{proof} (a) A local homomorphism of complete noetherian local $\mathcal{O}$-algebras with the same residue field is surjective as soon as it is surjective on reduced cotangent spaces, i.e.\ as soon as the dual map on tangent spaces is injective. The reduced cotangent space of a ring $R$ is $\mathfrak m_R/(\mathfrak m_R^2+\mathfrak m_{\mathcal O}R)$. Since $p\nmid n$, the trace splits off the scalar summand from $\mathrm{ad}\,\rbar$. Hence the tangent map for the fixed determinant problem is the restriction $H^1(G_{F,S},\mathrm{ad}^0\rbar)\to H^1(G_{K,S_K},\mathrm{ad}^0\rbar)$. (If $K/F$ ramifies outside $S$, $G_{K,S_K}$ is not a subgroup of $G_{F,S}$; the map is the one induced by $G_K\to G_F\to G_{F,S}$, and it suffices to prove injectivity after inflating both sides to $G_F$ and $G_K$, inflation being injective on $H^1$.) The composite of $H^1(G_F,\mathrm{ad}^0\rbar)\to H^1(G_K,\mathrm{ad}^0\rbar)$ with restriction to $G_{K'}$ has kernel $H^1(\Gal(K'/F),(\mathrm{ad}^0\rbar)^{G_{K'}})$ by inflation--restriction. Since $\rbar|_{G_{K'}}$ is absolutely irreducible, its commutant consists of scalars, and since $p\nmid n$ no non-zero scalar has trace zero; hence $(\mathrm{ad}^0\rbar)^{G_{K'}}=0$. (b) $R_F^{\dagger}$ is a quotient of $R_{F,S}$, so by (a) the map $R_{K,S_K}\to R_F^{\dagger}$ is surjective; by (C) it factors through $R_K^{\ddagger}$. \end{proof} \begin{remark}[On condition (C)] Only the implication ``condition over $F$ $\Rightarrow$ condition over $K$'' is required, and for this there is a natural choice at every place, whatever the behaviour of the place in $K/F$: \begin{itemize} \item outside $S$: a deformation unramified at $v$ is unramified at every $w\mid v$, even if $K/F$ ramifies at $v$; \item at $w\mid v$ with $K_w=F_v$: the same condition; \item for Kisin's potentially semistable deformation rings \cite{Kis08} with prescribed inertial type $\tau$ and Hodge--Tate weights at $v$: take at $w$ the ring with type $\tau|_{I_{K_w}}$ and the induced Hodge--Tate weights. Since $R_v^{\dagger}$ is reduced and $\mathcal{O}$-flat, (C) can be checked on $\bar\Q_p$-points, where it is clear. This is the mechanism of \cite[Lemma~6.4.1]{Sno09}, in which $K$ is chosen so that the lifts in question become ``admissible'' over $K_w$. \end{itemize} \end{remark} \begin{remark}[The hypotheses]\label{rem:hyp} \begin{enumerate}[label=(\arabic*)] \item The avoid condition enters Theorem~\ref{thm:quotient} only through its consequence that $\rbar$ remains absolutely irreducible over the Galois closure $K'$ of $K$; this is all that the surjectivity uses, and it is strictly weaker than linear disjointness from $\bar F^{\ker\rbar}$. Disjointness from $\bar F^{\ker\rbar}(\zeta_p)$ also preserves the image on the cyclotomic kernel, hence any adequacy hypothesis used in a separate $R=\mathbb{T}$ theorem. If $K\supseteq\bar F^{\ker\rbar}$, the restricted representation is trivial and the absolute irreducibility hypothesis fails. No condition on $\Gal(K'/F)$ is needed; in particular its order may be divisible by $p$. \item Without fixing the determinant, and retaining absolute irreducibility on $G_{K'}$, the kernel on tangent spaces consists exactly of the scalar classes $g\mapsto c(g)1_n$, where $c:G_F\to(k,+)$ is unramified outside $S$ and vanishes on $G_K$. Indeed, inflation--restriction for $K'/F$ identifies a class trivial on $G_{K'}$ with such a scalar homomorphism on $\Gal(K'/F)$, before the conditions at $S$ and at $K$ are imposed. A scalar class on $G_K$ inflated from $\Gal(K'/K)$ is zero only if the homomorphism itself vanishes, by the same exact sequence. Thus surjectivity is equivalent to the absence in $K$ of a cyclic extension of $F$ of degree $p$ unramified outside $S$. In particular it holds for Galois group $S_N$ and odd $p$, in every dimension. The condition on the determinant, and with it the condition $p\nmid n$, can be replaced by the condition that $[K:F]$ be prime to $p$. Indeed, for deformations with no condition on the determinant the tangent spaces are $H^1(\,\cdot\,,\mathrm{ad}\,\rbar)$, and the restriction $H^1(G_F,\mathrm{ad}\,\rbar)\to H^1(G_K,\mathrm{ad}\,\rbar)$ is injective when $p\nmid[K:F]$, because its composite with corestriction is multiplication by $[K:F]$. Hence the restriction map between the universal deformation rings without fixed determinant is surjective, provided only that $\operatorname{End}_{G_K}(\rbar)=k$, so that the ring over $K$ exists. In the application of \cite{Die07}, one replaces the Galois field of potential modularity $K$ by the fixed field $E$ of a Sylow $p$-subgroup of $\Gal(K/F)$. Then $p\nmid[E:F]$ and $K/E$ is solvable. Solvable descent applies to the characteristic zero representation under its usual irreducibility hypothesis. \item For $p=n=2$, take $F=\Q$, $K=\Q(\sqrt5)$, $S=\{2,3,5\}$, and let $\rbar$ be the natural representation of $S_3\cong\GL_2(\F_2)$ arising from the splitting field of $X^3-2$. The splitting field has unique quadratic subfield $\Q(\sqrt{-3})$, so $\rbar|_{G_K}$ stays absolutely irreducible. If $c:G_F\to\F_2$ cuts out $K$, then $\rbar$ and $(1+\varepsilon c)\rbar$ over $\F_2[\varepsilon]/(\varepsilon^2)$ have determinant one and equal restrictions. Any strict conjugacy between them would centralise $\rbar(G_K)$ and hence be scalar. The deformations are therefore distinct and the fixed determinant restriction map is not surjective. \end{enumerate} \end{remark} For Galois $K/F$, Hida's extension lemma and description of the invariant deformation functor give the following calculation of the kernel \cite[Appendix, Lemma~A.2.1 and Proposition~A.2.1]{Hid96}. For a control theorem with ordinary local conditions see also \cite[Theorem~3.4]{Zha18}. The proof given below, by normalising the determinant, is the same in substance: two extensions of an invariant deformation differ by a character of $\Gal(K/F)$ with values in $1+\mathfrak{m}_R$, which is trivial once the determinant is fixed and $p\nmid n$. \begin{proposition}[The kernel]\label{prop:coinv} Assume in addition that $K/F$ is Galois with group $G$. Then $G$ acts on $R_{K,S_K}$, and restriction induces an isomorphism \[ (R_{K,S_K})_G\ \xrightarrow{\ \sim\ }\ R_{F,S}^{(K)}, \] where $(\ )_G$ denotes the quotient by the ideal generated by the elements $\sigma(x)-x$, and $R_{F,S}^{(K)}$ is the universal fixed determinant ring for deformations of $\rbar$ over $F$ whose restriction to $G_K$ is unramified outside $S_K$. The natural quotient $R_{F,S}^{(K)}\twoheadrightarrow R_{F,S}$ imposes trivial inertia at the finite places $v\notin S$ ramified in $K$. For the deformation problem represented by $R_{F,S}^{(K)}$, every $G$-invariant deformation of $\rbar|_{G_K}$ with determinant $\psi|_{G_K}$ extends uniquely to a deformation of $\rbar$ with determinant $\psi$. \end{proposition} \begin{proof} For $g\in G_F$ choose a matrix $B_g\in\GL_n(\mathcal O)$ lifting $\rbar(g)$. The rule $r(h)\mapsto B_g r(g^{-1}hg) B_g^{-1}$ gives an action on strict equivalence classes. A change of $B_g$ is a strict conjugacy, and every $g\in G_K$ acts trivially. The action therefore factors through $G$. Let $r\colon G_K\to\GL_n(R)$ represent an invariant class with determinant $\psi|_{G_K}$. For $g\in G_F$ there is $A_g\in\GL_n(R)$ lifting $\rbar(g)$ with $r(ghg^{-1})=A_gr(h)A_g^{-1}$ for all $h\in G_K$, unique up to a scalar in $1+\mathfrak{m}_R$ since $\rbar|_{G_K}$ is absolutely irreducible. Indeed the $k$-algebra spanned by $\rbar(G_K)$ is $M_n(k)$, so the $R$-span of $r(G_K)$ is $M_n(R)$ by Nakayama's lemma. As $p\nmid n$, the pro-$p$ group $1+\mathfrak{m}_R$ is uniquely $n$-divisible, so there is a unique such $A_g$ with $\det A_g=\psi(g)$. By uniqueness $A_gA_{g'}=A_{gg'}$ and $A_h=r(h)$ for $h\in G_K$; in particular $g\mapsto A_g$ is continuous, since $A_{gh}=A_gr(h)$ and $G_K$ is open in $G_F$. Thus $g\mapsto A_g$ is the unique extension of $r$ with determinant $\psi$. The statement on rings follows, since $(R_{K,S_K})_G$ represents the functor of $G$-invariant deformations. \end{proof} \begin{remark} \begin{enumerate}[label=(\arabic*)] \item If one does not fix the determinant, the obstruction to extending an invariant deformation lies in $H^2(G,1+\mathfrak{m}_R)$ and the ambiguity in $H^1(G,1+\mathfrak{m}_R)$. Both vanish when $p$ divides neither $|G^{\mathrm{ab}}|$ nor the order of the Schur multiplier $H_2(G,\Z)$; for $G=S_N$ $(N\geq 4)$ or $A_N$ $(N\geq 8)$ these are $2$-groups, so this holds for all odd $p$, even when $p$ divides $|G|$. \item Suppose that every place in $S$ carrying a local condition splits completely in $K$, and put the same condition at every place above it. Suppose also that $p\nmid e(w/v)$ for every finite $v\notin S$. For an extension $r_F$ supplied by Proposition~\ref{prop:coinv}, $r_F(I_v)$ is a quotient of $I_v/I_w$, of order $e(w/v)$, and belongs to the congruence subgroup $1+M_n(\mathfrak m_R)$ since $\rbar$ is unramified at $v$. This subgroup is pro-$p$, so $r_F(I_v)=1$. Consequently $R_F^{\dagger}\cong(R_K^{\dagger})_G$. In general, the relations killing $r_F(I_v)$ at primes outside $S$ must also be imposed. \item Under the assumptions in (2), $\operatorname{Spec}(R_F^{\dagger}[1/p])$ is the scheme of fixed points of $G$ on $\operatorname{Spec}(R_K^{\dagger}[1/p])$. When an $R=\mathbb T$ theorem identifies $R_K^\dagger$ with a finite Hecke algebra, geometric points of this scheme correspond to invariant systems of Hecke eigenvalues in that deformation problem. If $R_F^\dagger$ is finite over $\mathcal O$ and has Krull dimension at least one, then $R_F^\dagger[1/p]\ne0$. Indeed, a finite $\mathcal O$-algebra killed by a power of $p$ is Artinian. Finiteness and the dimension bound together thus give a characteristic zero fixed point. \end{enumerate} \end{remark} \begin{thebibliography}{99} \bibitem{KA79} S.~Kleiman, A.~Altman, \emph{Bertini theorems for hypersurface sections containing a subscheme}, Comm.\ Algebra 7 (1979), 775--790. \bibitem{AC89} J.~Arthur, L.~Clozel, \emph{Simple algebras, base change, and the advanced theory of the trace formula}, Ann.\ of Math.\ Stud.\ 120, Princeton Univ.\ Press, 1989. \bibitem{BLGGT} T.~Barnet-Lamb, T.~Gee, D.~Geraghty, R.~Taylor, \emph{Potential automorphy and change of weight}, Ann.\ of Math.\ 179 (2014), 501--609. \bibitem{BLGHT} T.~Barnet-Lamb, D.~Geraghty, M.~Harris, R.~Taylor, \emph{A family of Calabi--Yau varieties and potential automorphy II}, Publ.\ Res.\ Inst.\ Math.\ Sci.\ 47 (2011), 29--98. \bibitem{Car86} H.~Carayol, \emph{Sur les repr\'esentations $\ell$-adiques associ\'ees aux formes modulaires de Hilbert}, Ann.\ Sci.\ \'Ec.\ Norm.\ Sup.\ (4) 19 (1986), 409--468. \bibitem{CW08} M.~\c{C}iperiani, A.~Wiles, \emph{Solvable points on genus one curves}, Duke Math.\ J.\ 142 (2008), 381--464. \bibitem{DG15} L.~Dieulefait, T.~Gee, \emph{Automorphy lifting for small $l$}, Appendix B to L.~Dieulefait, \emph{Automorphy of $\mathrm{Symm}^5(\mathrm{GL}(2))$ and base change}, J.\ Math.\ Pures Appl.\ 104 (2015), 619--656. \bibitem{DP} L.~Dieulefait, A.~Pacetti, \emph{Serre's conjectures for $\Q(\sqrt{13})$}, arXiv:2610.38884v2. \bibitem{BLGG13} T.~Barnet-Lamb, T.~Gee, D.~Geraghty, \emph{Congruences between Hilbert modular forms: constructing ordinary lifts, II}, Math.\ Res.\ Lett.\ 20 (2013), 67--72. \bibitem{Die04} L.~Dieulefait, \emph{Existence of families of Galois representations and new cases of the Fontaine--Mazur conjecture}, J.\ Reine Angew.\ Math.\ 577 (2004), 147--151. \bibitem{Die07} L.~Dieulefait, \emph{The level $1$ weight $2$ case of Serre's conjecture}, Rev.\ Mat.\ Iberoam.\ 23 (2007), 1115--1124. \bibitem{Dic01} L.~E.~Dickson, \emph{Linear groups, with an exposition of the Galois field theory}, Teubner, Leipzig, 1901. \bibitem{EG14} M.~Emerton, T.~Gee, \emph{A geometric perspective on the Breuil--M\'ezard conjecture}, J.\ Inst.\ Math.\ Jussieu 13 (2014), 183--223. \bibitem{FJ} M.~D.~Fried, M.~Jarden, \emph{Field arithmetic}, 3rd ed., Ergeb.\ Math.\ Grenzgeb.\ 11, Springer, 2008. \bibitem{Gey78} W.-D.~Geyer, \emph{Galois groups of intersections of local fields}, Israel J.\ Math.\ 30 (1978), 382--396. \bibitem{GK23} M.~Ghosh, A.~Krishna, \emph{Bertini theorems revisited}, J. Lond. Math. Soc. (2) 108 (2023), 1163--1192. \bibitem{GHTT} R.~Guralnick, F.~Herzig, R.~Taylor, J.~Thorne, \emph{Adequate subgroups}, appendix to J.~Thorne, \emph{On the automorphy of $l$-adic Galois representations with small residual image}, J.\ Inst.\ Math.\ Jussieu 11 (2012), 855--920. \bibitem{GS} R.~M. Guralnick and J.~Shareshian, \emph{Symmetric and alternating groups as monodromy groups of Riemann surfaces I. Generic covers and covers with many branch points}, Mem. Amer. Math. Soc. 189 (2007), no.~886. \bibitem{Hid96} H.~Hida, \emph{On Selmer groups of adjoint modular Galois representations}, in: Number Theory (Paris, 1993--1994), London Math.\ Soc.\ Lecture Note Ser.\ 235, Cambridge Univ.\ Press, 1996, 89--132. \bibitem{Hid00a} H.~Hida, \emph{Adjoint Selmer groups as Iwasawa modules}, Israel J.\ Math.\ 120 (2000), 361--427. \bibitem{Hid00b} H.~Hida, \emph{Modular forms and Galois cohomology}, Cambridge Studies in Advanced Mathematics 69, Cambridge Univ.\ Press, 2000. \bibitem{HT15} Y.~Hu, F.~Tan, \emph{The Breuil--M\'ezard conjecture for non-scalar split residual representations}, Ann.\ Sci.\ \'Ec.\ Norm.\ Sup\'er.\ 48 (2015), 1383--1421. \bibitem{HSBT} M.~Harris, N.~Shepherd-Barron, R.~Taylor, \emph{A family of Calabi--Yau varieties and potential automorphy}, Ann.\ of Math.\ 171 (2010), 779--813. \bibitem{Jou83} J.-P.~Jouanolou, \emph{Th\'eor\`emes de Bertini et applications}, Progr.\ Math.\ 42, Birkh\"auser, 1983. \bibitem{Kadets} B.~Kadets, \emph{Galois specialization to symmetric points and the inverse Galois problem up to $S_n$}, arXiv:2207.13637, Theorem~1.1. \bibitem{Kha00} C.~Khare, \emph{Mod $p$ descent for Hilbert modular forms}, Math.\ Res.\ Lett.\ 7 (2000), 455--462. \bibitem{KW1} C.~Khare, J.-P.~Wintenberger, \emph{Serre's modularity conjecture (I)}, Invent.\ Math.\ 178 (2009), 485--504. \bibitem{KW2} C.~Khare, J.-P.~Wintenberger, \emph{Serre's modularity conjecture (II)}, Invent.\ Math.\ 178 (2009), 505--586. \bibitem{Kis08} M.~Kisin, \emph{Potentially semi-stable deformation rings}, J.\ Amer.\ Math.\ Soc.\ 21 (2008), 513--546. \bibitem{Kis09} M.~Kisin, \emph{The Fontaine--Mazur conjecture for $\mathrm{GL}_2$}, J.\ Amer.\ Math.\ Soc.\ 22 (2009), 641--690. \bibitem{Lan80} R.~P.~Langlands, \emph{Base change for $\mathrm{GL}(2)$}, Ann.\ of Math.\ Stud.\ 96, Princeton Univ.\ Press, 1980. \bibitem{MB89} L.~Moret-Bailly, \emph{Groupes de Picard et probl\`emes de Skolem II}, Ann.\ Sci.\ \'Ec.\ Norm.\ Sup\'er.\ 22 (1989), 181--194. \bibitem{Pas15} V.~Pa\v{s}k\=unas, \emph{On the Breuil--M\'ezard conjecture}, Duke Math.\ J.\ 164 (2015), 297--359. \bibitem{Poo08} B.~Poonen, \emph{Smooth hypersurface sections containing a given subscheme over a finite field}, Math.\ Res.\ Lett.\ 15 (2008), 265--271. \bibitem{Rap78} M.~Rapoport, \emph{Compactifications de l'espace de modules de Hilbert--Blumenthal}, Compositio Math.\ 36 (1978), 255--335. \bibitem{Raw} J.~Rawson, \emph{Some obstructions to solvable points on higher genus curves}, J. Th\'eor. Nombres Bordeaux 36 (2024), 1009--1019. \bibitem{Ski09} C.~Skinner, \emph{A note on the $p$-adic Galois representations attached to Hilbert modular forms}, Doc.\ Math.\ 14 (2009), 241--258. \bibitem{Sno09} A.~Snowden, \emph{On two dimensional weight two odd representations of totally real fields}, arXiv:0905.4266 (2009). \bibitem{Tun21} S.-N.~Tung, \emph{On the automorphy of $2$-dimensional potentially semistable deformation rings of $G_{\Q_p}$}, Algebra Number Theory 15 (2021), 2173--2194. \bibitem{Tay02} R.~Taylor, \emph{Remarks on a conjecture of Fontaine and Mazur}, J.\ Inst.\ Math.\ Jussieu 1 (2002), 125--143. \bibitem{Tay06} R.~Taylor, \emph{On the meromorphic continuation of degree two $L$-functions}, Doc.\ Math.\ Extra Vol.\ (2006), 729--779. \bibitem{Zha18} X.~Zhang, \emph{Selmer groups of symmetric powers of ordinary modular Galois representations}, Amer. J. Math. 143 (2021), 125--173. \end{thebibliography} \end{document}