text:
\section{Introduction}

Our motivation in this paper is Hilbert's 12th problem, which asks for an explicit analytic construction of the maximal abelian extension of a number field $F$.  Let $F$ be a totally real number field.  Up to a bounded root of unity, we prove an explicit $p$-adic analytic formula for certain elements (Brumer--Stark $p$-units) that we show generate, along with other easily described elements, the maximal abelian extension of $F$ as we range over all primes $p$ and all conductors $\mathfrak{n} \subset \mathcal{O}_F$.  To demonstrate the simplest possible novel case of these formulas, in \S\ref{s:compute}  we present example computations of narrow Hilbert class fields of real quadratic fields generated by our elements; complete tables of hundreds of such calculations are given in \cite{dasweb}.

The $p$-adic formula for Brumer--Stark units that we prove was conjectured by the first author, collaborators, and others over a series of previous papers (\cite{thesis}, \cite{dd}, \cite{chapthesis}, \cite{chapcomp}, \cite{das}, \cite{ds}).
It was proven in \cite{das} that under a mild assumption denoted $(*)$ below,
 our formula for Brumer--Stark $p$-units is implied by
 the $p$-part of a conjecture of Gross on the relationship between Brumer--Stark $p$-units and the special values of $L$-functions in towers of number fields \cite{gross2}*{Conjecture 7.6}.  Note that the assumption $(*)$ excludes only finitely many primes $p$ for a given totally real field $F$ (a subset of those dividing the discriminant of $F$).
The conjecture of Gross is often referred to as the ``integral Gross--Stark conjecture" or ``Gross's tower of fields conjecture,"
and the proof of the $p$-part of this conjecture takes up the bulk of the paper.

We prove the $p$-part of the integral Gross--Stark conjecture by applying Ribet's method, which was first established in his groundbreaking paper \cite{ribet}.
We apply Ribet's method in the context of group ring valued families of Hilbert modular forms as employed in \cite{wiles} and developed in our previous work \cite{dk}.
Here we generalize and expand the method by introducing a Ritter--Weiss module associated to an analytic ${\mscr L}$-invariant.  We calculate the Fitting ideal of this module using the Galois representations associated to group ring valued modular forms.  The connection between ${\mscr L}$-invariants, families of modular forms, and Galois representations was pioneered by the work of Greenberg and Stevens on the Mazur--Tate--Teitelbaum conjecture \cite{gs}.  The application of these ideas toward the rational Gross--Stark conjecture (\cite{gross}*{Conjecture 2.12}) was introduced in \cite{ddp} and developed in \cite{dkv}.

We now describe our results in greater detail.

\subsection{The Brumer--Stark conjecture}

Let $F$ be a totally real field of degree $n$ over $\mathbf{Q}$.  Let $H$ be a finite abelian extension of $F$ that is a CM field.  Write $G = {\rm Gal}(H/F)$.   Let $S$ and $T$ denote finite nonempty disjoint sets of places of $F$ such that $S$ contains the set $S_{\infty}$ of real places and the set $S_{\text{ram}}$ of finite primes ramifying in $H$.
Associated to any character $\chi \colon G \longrightarrow \mathbf{C}^*$  one has the Artin $L$-function
\begin{equation} \label{e:ls}
L_S(\chi, s) = \prod_{\mathfrak{p} \not \in S} \frac{1}{1 - \chi(\mathfrak{p}) \mathrm{N}\mathfrak{p}^{-s}}, \qquad \real(s) > 1,
\end{equation}
and its ``$T$-smoothed" version
\begin{equation} \label{e:lst}
L_{S,T}(\chi, s) = L_S(\chi, s) \prod_{\mathfrak{p} \in T} (1 - \chi(\mathfrak{p})\mathrm{N}\mathfrak{p}^{1-s}).
\end{equation}
The function $L_{S,T}(\chi, s)$ can be analytically continued to a holomorphic function on the complex plane. These $L$-functions can be packaged together into Stickelberger elements
\[
\Theta_S^{H/F}(s), \quad \Theta_{S,T}^{H/F}(s) \in \mathbf{C}[G]
\]
defined by (we drop the superscript $H/F$ when unambiguous)
\[
\chi(\Theta_S(s)) = L_S(\chi^{-1}, s), \qquad \chi(\Theta_{S,T}) = L_{S,T}(\chi^{-1}, s) \qquad \text{ for all } \chi \in \hat{G}.
\]

A classical  theorem of Siegel \cite{siegel}, Klingen \cite{klingen} and Shintani \cite{shintani} states that  $\Theta_S := \Theta_S(0)$ lies in $\mathbf{Q}[G]$.  This was refined by Deligne--Ribet \cite{dr} and Cassou-Nogu\`es \cite{cn}, who proved that under a certain mild technical condition on $T$ discussed in (\ref{e:drcond}) below, we have
\[\Theta_{S,T}:=\Theta_{S,T}(0) \in \mathbf{Z}[G]. \]

The following conjecture  stated by Tate is known as the Brumer--Stark conjecture. Let $\mathfrak{p} \not\in S \cup T$ be a prime of $F$ that splits completely in $H$.  Let $U_{\mathfrak{p}}^- \subset H^*$ denote the group of elements $u$ satisfying  $|u|_v = 1$ for all places $v$ of $H$ not lying above $\mathfrak{p}$, including the complex places.  Let $U_{\mathfrak{p}, T}^- \subset U_\mathfrak{p}^-$ denote the subgroup of elements such that $u \equiv 1 \pmod{\mathfrak{q} \mathcal{O}_H}$ for all $\mathfrak{q} \in T$.

\begin{conjecture}[Tate--Brumer--Stark, \cite{tate}] \label{c:bs}  Fix a prime $\mathfrak{P}$ of $H$ above $\mathfrak{p}$.  There exists an element  $u_\mathfrak{p} \in U_{\mathfrak{p}, T}^-$ such that
\begin{equation} \label{e:bs}
 \ord_G(u_\mathfrak{p}) := \sum_{\sigma \in G} \ord_{\mathfrak{P}}(\sigma(u_\mathfrak{p})) \sigma^{-1} = \Theta_{S,T}
 \end{equation}
in $\mathbf{Z}[G]$.
\end{conjecture}

In previous work \cite{dk}, we proved this conjecture away from $2$:

\begin{theorem}   \label{t:bs}
 There exists $u_\mathfrak{p} \in U_{\mathfrak{p}, T}^- \otimes \mathbf{Z}[\frac{1}{2}]$ satisfying (\ref{e:bs}) in $\mathbf{Z}[\frac{1}{2}][G]$.
\end{theorem}

\subsection{The Integral Gross--Stark conjecture} \label{s:igs}

Let $\mathfrak{p}$ be as above and write $S_\mathfrak{p} = S \cup \{\mathfrak{p}\}$.
Let $L$ denote a finite abelian CM extension of $F$ containing $H$ that is ramified over $F$ only at the places in $S_\mathfrak{p}$.  Write $\mathfrak{g} = {\rm Gal}(L/F)$ and $\Gamma = {\rm Gal}(L/H)$, so $\mathfrak{g}/\Gamma \cong G$.  Let $I$ denote the relative augmentation ideal associated to $\mathfrak{g}$ and $G$, i.e.\ the kernel of the canonical projection
\[
 \Aug_G^{\mathfrak{g}} \colon \mathbf{Z}[ \mathfrak{g}] \relbar\joinrel\twoheadrightarrow \mathbf{Z}[G].
\]
Then $ \Theta_{S_\mathfrak{p},T}^{L/F}   $ lies in $I$, since its image under $\Aug_G^{\mathfrak{g}}$ is
\begin{equation} \label{e:euler}
 \Theta_{S_\mathfrak{p},T}^{H/F}= \Theta_{S,T}^{H/F} (1 - \Frob(H/F, \mathfrak{p})) = 0, \end{equation}
as $\mathfrak{p}$ splits completely in $H$.  Intuitively, if we view $ \Theta_{S_\mathfrak{p},T}^{L/F}$ as a function on the ideals of $\mathbf{Z}[\mathfrak{g}]$, equation (\ref{e:euler}) states that this function ``has a zero" at the ideal $I$; the value of the ``derivative" of this function at $I$ is simply the image of $ \Theta_{S_\mathfrak{p},T}^{L/F} $ in $I/I^2$.  Gross provided a conjectural algebraic interpretation of this derivative as follows.
Denote by \begin{equation} \label{e:recp}
 \rec_\mathfrak{P} \colon H_\mathfrak{P}^* \longrightarrow \Gamma
 \end{equation} the composition of the inclusion $H_\mathfrak{P}^* \lhook\joinrel\longrightarrow \mathbf{A}_H^*$ with the global Artin reciprocity map \[ \mathbf{A}_H^* \relbar\joinrel\twoheadrightarrow \Gamma. \]
Throughout this article we adopt Serre's convention \cite{serre} for the reciprocity map. Therefore $\rec(\varpi^{-1})$ is a lifting to $G_{\mathfrak{p}}^{\text{ab}}$ of the Frobenius element on the maximal unramified extension of $F_{\mathfrak{p}}$ if $\varpi \in F_{\mathfrak{p}}^*$ is a uniformizer.

\begin{conjecture}[Gross, \cite{gross2}*{Conjecture 7.6}] \label{c:grosstower} Define
\begin{equation} \label{e:recg}
\rec_G(u_\mathfrak{p}) = \sum_{\sigma \in G} (\rec_\mathfrak{P}\sigma(u_\mathfrak{p})-1)  \tilde{\sigma}^{-1} \in I/I^2, \end{equation}
where $\tilde{\sigma} \in \mathfrak{g}$ is any lift of $\sigma \in G$.  Then
\[ \rec_G(u_\mathfrak{p}) \equiv  \Theta_{S_\mathfrak{p},T}^{L/F}  \]
in $I/I^2$.
\end{conjecture}

Let $p$ denote the rational prime below $\mathfrak{p}$, and assume that $p \neq 2$.
Our first main result is  the $p$-part of Gross's conjecture.

\begin{theorem} \label{t:maingross} Let $p$ be an odd prime and suppose that $\mathfrak{p}$ lies above $p$.
Gross's Conjecture~\ref{c:grosstower} holds in $(I/I^2) \otimes \mathbf{Z}_p$.
 \end{theorem}

\subsection{An Exact Formula for Brumer--Stark units}

Building off the $p$-adic Gross--Stark conjecture and applying the methods introduced by Darmon in \cite{darmon}, the
first author proposed an exact formula for Brumer--Stark units in his Ph.D.\ thesis \cite{thesis}, published  jointly with Darmon in \cite{dd}.
The setting for this conjecture was that of a real quadratic ground field $F$, a prime $\mathfrak{p}$ of the form  $\mathfrak{p} = p \mathcal{O}_F$ for a rational prime $p$, and  a ring class field extension $H/F$.
Afterward, a sequence of works generalized and refined this conjecture to the case of arbitrary totally real fields $F$ and finite primes $\mathfrak{p}$ that split completely in a CM abelian extension $H$ (\cite{chapthesis}, \cite{chapcomp}, \cite{das}, \cite{ds}).  Further details on this history are given in \S\ref{s:hilbert}.  See also the analogous works \cite{rs}, \cite{cd} in the archimedean context.

For expositional purposes in this introduction, let us describe the shape of these conjectures in a special case mentioned above: we assume that the rational prime $p$ is inert in $F$ and that $\mathfrak{p} = p\mathcal{O}_F$.  Then for each integral ideal $\mathfrak{a}$ of $F$ relatively prime to the primes in $S$ and $T$,
 one may define a $\mathbf{Z}$-valued measure $\nu_{\mathfrak{a}, S, T}$ on $\mathcal{O}_\mathfrak{p}^*$ in terms of special values of Shintani zeta-functions (or, alternatively, in terms of periods of Eisenstein series).  The following is a special case of \cite{das}*{Conjecture 3.21} or \cite{ds}*{Conjecture 6.1}.

\begin{conjecture}\label{c:thesis} Let $\sigma = \Frob(H/F, \mathfrak{a})$.  We have the following exact analytic formula for the associated conjugate of the Brumer--Stark unit $u_{\mathfrak{p}}$:
\begin{equation} \label{e:thesis}
\sigma(u_\mathfrak{p}) = p^{\zeta_{S,T}(\sigma, 0)} \times\!\!\!\!\!\!\!\int_{\mathcal{O}_\mathfrak{p}^*} x \ d\nu_{\mathfrak{a}, S, T}(x) \quad \text{ in } \quad F_\mathfrak{p}^*. \end{equation}
\end{conjecture}

Here we view $\sigma(u_\mathfrak{p})$ as an element of $F_\mathfrak{p}^*$ via $H \subset H_\mathfrak{P} \cong F_\mathfrak{p}$, where $\mathfrak{P}$ is the prime above $\mathfrak{p}$ appearing in Conjecture~\ref{c:bs}.  Conjecture~\ref{c:thesis} implies not only the algebraicity of the $p$-adic integrals in (\ref{e:thesis}), but a ``Shimura reciprocity law" in which the geometric action of a generalized class group on equivalence classes of ideals $\mathfrak{a}$ is identified with the Galois action of ${\rm Gal}(H/F)$ on the units $u_\mathfrak{p}$ (see \cite{das}*{Conjecture 3.21}).  In this way, Conjecture~\ref{c:thesis} can be viewed as a part of a theory of ``real multiplication" in parallel with the classical theory of complex multiplication that is governed by Shimura's celebrated reciprocity law.

Our second main result, which applies in the general case (i.e.~without assuming $\mathfrak{p}$ is inert over $\mathbf{Q}$), is the following.

\begin{theorem} \label{t:thesis}  Let $p$ denote the rational prime below $\mathfrak{p}$.
Suppose that
\begin{quote} $(*)$ \ \ \ \  $p$ is odd and $H \cap F(\mu_{p^\infty}) \subset H^+$, the maximal totally real subfield of $H$.
\end{quote}
Then equation (\ref{e:thesis}), or more precisely its generalization (\ref{e:genform}) to the general setting,  holds up to multiplication by a root of unity in $F_\mathfrak{p}^*$.
\end{theorem}

Some remarks are in order.  Since $\mathfrak{p}$ splits completely in $H$ while $p$ is totally ramified in $\mathbf{Q}(\mu_{p^n})$ for all $n$, condition $(*)$ can fail for an odd prime $p$ only if $p$ is ramified in $F$.  The condition therefore eliminates only finitely many $p$, a subset of those dividing the discriminant of $F$.
Secondly, since $u_\mathfrak{p}$ is only known to exist in $U_\mathfrak{p}^- \otimes \mathbf{Z}[\frac{1}{2}]$, Theorem~\ref{t:thesis} can be interpreted as stating that (\ref{e:thesis}) holds after raising both sides to the power $2^k \#\mu(F_\mathfrak{p}^*)$, where $k$ is such that $u_\mathfrak{p}^{2^k} \in H$.  Alternatively, since $p$ is odd, we can view $u_\mathfrak{p} \in U_\mathfrak{p}^- \otimes \mathbf{Z}_p$ unconditionally and then Theorem~\ref{t:thesis} states that (\ref{e:thesis}) holds in $F_\mathfrak{p}^* \hat{\otimes} \mathbf{Z}_p$.

An analogue of Conjecture~\ref{c:thesis} where $F$ is replaced by the function field of a smooth projective algebraic curve over $\mathbf{F}_q$---a far simpler setting because of the explicit class field theory afforded by the theory of Drinfeld modules---was proven by the first author and Miller in \cite{dm}.

We conclude this discussion by bringing attention to the beautiful concurrent work of Darmon, Pozzi, and Vonk, who prove a version of Conjecture~\ref{c:thesis} in the setting that $F$ is a real quadratic field and the rational prime $p$ is inert in $F$ \cite{dpv}.  While their work also employs the deformations of $p$-adic modular forms and their associated Galois representations, they work with deformations in ``vertical" $p$-adic towers as opposed to the ``horizontal" tame deformations applied in this paper.

\subsection{Explicit Class Field Theory} \label{s:iecft}

A celebrated theorem of Kronecker and Weber states that the maximal abelian extension of the field $\mathbf{Q}$ of rational numbers is obtained by adjoining all roots of unity.

\begin{theorem}[Kronecker--Weber] We have $\mathbf{Q}^{\text{ab}} = \bigcup_{n \ge 1} \mathbf{Q}(e^{2 \pi i/n}).$
\end{theorem}

The roots of unity can be viewed analytically as the special values of the analytic function $e^{2 \pi i x}$ at rational arguments, or algebraically as the set of torsion points of the group scheme $\mathbf{G}_m$.  The theory of complex multiplication provides a similar description of $F^{\text{ab}}$ when $F$ is a quadratic imaginary field.

\begin{theorem} \label{t:cm}  Let $F$ be a quadratic imaginary field.  Let $E$ denote an elliptic curve with complex multiplication by the ring of integers $\mathcal{O}_F$ and let $w$ denote the Weber function.  We have $F^{\text{ab}} = \bigcup_{n \ge 1} F(j(E), w(E[n])). $
\end{theorem}

See the elegant exposition~\cite{ghate} for the definition of the Weber function $w$ and a proof of Theorem~\ref{t:cm}.  From the analytic perspective, the modular functions $j$ and $w$ take on the role of the exponential function $e^{2 \pi i x}$ in the case $F=\mathbf{Q}$; from the algebraic perspective,  the abelian variety $E$ takes on the role of the group scheme $\mathbf{G}_m$.

At the time of Hilbert's famed address at the Paris ICM in 1900, Theorem~\ref{t:cm} was not  fully proved.  Over the previous decades, the explicit construction of class fields of imaginary quadratic fields using special values of modular functions was the topic of great study, particularly by Kronecker (1823--1891), who called this program his {\em jugendtraum} (``dream of youth").  Nevertheless, it was already clear by 1900 that analytically constructing class fields of ground fields {\em other than} $\mathbf{Q}$ or quadratic imaginary fields represented a substantially more difficult problem.
Hilbert posed this question as the 12th in his list of 23 problems.
The following quotes are  excerpts from a translation of Hilbert's ICM article \cite{hilbert}.
\begin{quote}
``The theorem that every abelian number field arises from the realm of rational numbers by the composition of fields of roots of unity is due to Kronecker."

``Since the realm of the imaginary quadratic number fields is the simplest after the realm of rational numbers, the problem arises, to extend Kronecker's theorem to this case."

``Finally, the extension of Kronecker's theorem to the case that, in the place of the realm of rational numbers or of the imaginary quadratic field, any algebraic field whatever is laid down as the realm of rationality, seems to me of the greatest importance.  I regard this problem as one of the most profound and far-reaching in the theory of numbers and of functions."
\end{quote}

We refer the reader to Schappacher's delightful exposition on Hilbert's 12th problem for further background and historical details \cite{schapp}.

As we now describe, Theorem~\ref{t:thesis} can be viewed as a solution to Hilbert's 12th problem for totally real  fields $F$.
For each nonzero ideal $\mathfrak{n} \subset \mathcal{O}_F$, pick a prime ideal $\mathfrak{p}(\mathfrak{n}) \subset \mathcal{O}_F$ whose image in the narrow ray class group of $F$ of conductor $\mathfrak{n}$ is trivial.  Choose $\mathfrak{p}(\mathfrak{n})$ such that the rational prime $p$ below it satisfies $(*)$.
Let $u_{\mathfrak{p}(\mathfrak{n})}$ denote the Brumer--Stark unit for the narrow ray class field $F(\mathfrak{n})$ of conductor $\mathfrak{n}$.
To make a statement unconditional on Brumer--Stark, choose a nonzero integer $m(\mathfrak{n})$ such that $u_{\mathfrak{p}(\mathfrak{n})}^{m(\mathfrak{n})}$ exists unconditionally in $F(\mathfrak{n})^*$.  By Theorem~\ref{t:bs}, $m(\mathfrak{n})$ can be taken to be a power of 2. Let
\[ S_\mathfrak{n} = \left\{ \sigma(u_{\mathfrak{p}(\mathfrak{n})}^{m(\mathfrak{n})}) \colon \sigma \in {\rm Gal}(F(\mathfrak{n})/F) \right\}. \]
Finally, let $\{\alpha_1, \dotsc, \alpha_{n-1}\}$ denote any elements of $F^*$ whose signs in $\{\pm 1\}^{n}/ (-1, \dotsc, -1)$ under the real embeddings of $F$ form a basis for this $\mathbf{Z}/2\mathbf{Z}$-vector space. In \S\ref{s:hilbert}, we prove the following.

\begin{theorem}  \label{t:h12}
The maximal abelian extension of $F$ is generated by $\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}}$ together with the elements of $S_\mathfrak{n}$ as $\mathfrak{n}$ ranges over all nonzero  ideals $\mathfrak{n} \subset \mathcal{O}_F$:
\[ F^{\text{ab}}  = {\dot{\bigcup}}_{\mathfrak{n}} \ F(S_{\mathfrak{n}}) \ \ \dot\cup \ \ F(\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}}), \]
where $\dot\cup$ denotes compositum of fields.
\end{theorem}

Since Theorem~\ref{t:thesis} gives an exact formula for the elements in $S_\mathfrak{n}$, we obtain via Theorem~\ref{t:h12} an effective method of generating the maximal abelian extension of any totally real field.   One can raise a reasonable objection that the powers of 2 denoted $m(\mathfrak{n})$ are unspecified (conjecturally they can be taken to equal 1), but see Remark~\ref{r:mn} for a discussion of this point.  See Remark~\ref{r:rou} for a discussion regarding the root of unity ambiguity in Theorem~\ref{t:thesis}.

The integrals in (\ref{e:thesis}) are explicitly computable and yield a practical method of generating class fields. In Section~\ref{s:compute}  we provide examples of narrow Hilbert class fields of real quadratic fields generated by this analytic formula.

It is unclear whether Hilbert would have accepted the combination of Theorems~\ref{t:thesis} and~\ref{t:h12} as a solution to his 12th problem for totally real  fields $F$.  Firstly, our solution requires $p$-adic analysis for infinitely many primes $p$, rather than classical complex analysis.  Secondly, our analytic formula requires $p$-adic {\em integration} rather than simply {\em evaluating} an analytic function at special points.

 From the modern perspective, these features appear natural.  In Stark's conjectures one is led to consider places $v$ of $F$ that split completely in $H$.  Indeed, if we let $w$ be a place of $H$ above $v$, then we obtain an inclusion $H \subset
H_w \cong F_v$. This makes it possible to identify elements of $H$ using analysis at $v$ intrinsic only to $F$, without having an {\em a priori} construction of $H$.  Therefore, when $F$ is totally real, it is natural to use a finite place $\mathfrak{p}$ that splits completely in a totally imaginary extension $H$ rather than an infinite place that does not.  Of course nothing precludes the possibility of an alternate purely archimedean construction in this same setting.

With regards to the role of integration, Stark's work again suggests that in general settings one should expect integrals to appear.  Already, the formulas of Hecke and Siegel regarding the special values of $L$-functions of real quadratic fields involve integrals of analytic functions along geodesics in the upper half-plane, whereas the analogous formulae for imaginary quadratic fields involve the evaluation of analytic functions at CM points.  More recently, the conjectural complex analytic formulae of Charollois and Darmon for Stark units over certain ``almost totally real" fields also involve integration \cite{cd}.
  Perhaps the cases $F=\mathbf{Q}$ and $F = $ imaginary quadratic field, where we take special values of analytic functions, should be viewed as degenerate (i.e.\ 0-dimensional) integrals.

As a final note on Hilbert's 12th problem in the introduction, we recall that if $E/F$ is a quadratic CM extension, then ``most" of the field $E^{\text{ab}}$ is obtained by taking the compositum of fields of moduli of appropriate CM-motives with $F^{ab}$.  More precisely, the following result, which combines Corollary 1.5.2, Theorem 2.1, and Corollary 2.3 of \cite{wei}, is known.

\begin{theorem} Let $E$ be a CM field with maximal totally real subfield $F$.  Let $M_E$ be the field generated over $E$ by the fields of moduli of all CM-motives with Hodge cycle structure whose reflex fields are contained in $E$.  Equivalently, $M_E$ is the field obtained by adjoining to $E$ the fields of moduli of all polarised abelian varieties of CM-type, whose reflex fields are contained in $E$, and their torsion points.  Then the compositum $M_E F^{\text{ab}}$ is a subfield of $E^{\text{ab}}$ such that ${\rm Gal}(E^{\text{ab}}/M_E F^{\text{ab}})$ has exponent dividing $2$ (it is an infinite product of $\mathbf{Z}/2\mathbf{Z}$'s unless $F=\mathbf{Q}$, in which case it is trivial).
\end{theorem}

 As a result, we find that the construction of $F^{\text{ab}}$ given in Theorem~\ref{t:h12} together with the field $M_E$ yields a description of most of the maximal abelian extension of $E$.

\subsection{Summary of Proof}

We conclude the introduction by describing the proof of Theorem~\ref{t:maingross}, the $p$-part of the integral Gross--Stark conjecture where $p$ is the prime below $\mathfrak{p}$.  We always assume that $p$ is odd. Recall that we are given a tower of fields $L/H/F$ with $\mathfrak{g} = {\rm Gal}(L/F)$ and $G = {\rm Gal}(H/F)$.
Let
\[ R = \mathbf{Z}_p[\mathfrak{g}]^- = \mathbf{Z}_p[\mathfrak{g}] / (\sigma + 1), \qquad \overline{R} = \mathbf{Z}_p[G]^-, \]
where $\sigma$ is the complex conjugation of $\mathfrak{g}$.
 Let $I = \ker(R \relbar\joinrel\twoheadrightarrow \overline{R})$.

As a first step, we alter the smoothing set $S$ and depletion set $T$ as follows.  Define
\begin{align*}
\Sigma &= \{v \in S \colon v \mid p \infty \}, \\
\Sigma_\mathfrak{p} &= \Sigma \cup \{\mathfrak{p}\}, \\
\Sigma' &= \{v \in S: v  \nmid p\infty \} \cup T.
\end{align*}
There exists an associated modified Stickelberger element $ \Theta_{\Sigma,\Sigma'}^H \in \mathbf{Z}_p[G]$ and  modified Brumer--Stark unit $u_{\mathfrak{p}}^{\Sigma, \Sigma'} \in
U_{\mathfrak{p},T}^-$ such that $\ord_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) = \Theta_{\Sigma,\Sigma'}^H.$  We show in Lemma~\ref{l:equiv} that the modified Gross--Stark congruence
\begin{equation} \label{e:mod}
 \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) \equiv \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L \pmod{I^2}
 \end{equation}
implies the original one.

\bigskip

In order to prove (\ref{e:mod}), we recall the Ritter--Weiss modules $\nabla_{\Sigma}^{\Sigma'}(H)$ and $\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ and the relationship between these modules.  Versions of these modules were originally defined by Ritter and Weiss in the foundational work \cite{rw}.  An alternate approach was studied in \cite{bks} and \cite{burns}.  Here we apply our previous work \cite{dk}, which builds upon the original definition of Ritter--Weiss.

In order to make a connection with the Greenberg--Stevens theory, we introduce an $R$-algebra $R_{\mscr L}$ that is generated over $R$ by an element ${\mscr L}$ that plays the role of the analytic
${\mscr L}$-invariant, i.e. the ``ratio" between $\Theta_L = \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L$ and $\Theta_H = \Theta_{\Sigma, \Sigma'}^H$.  In some sense, $R_{\mscr L}$ is the canonical $R$-algebra in which such a ratio can be considered:
\[ R_{\mscr L} = R[{\mscr L}] / (\Theta_H {\mscr L} - \Theta_L, {\mscr L} I, {\mscr L}^2, I^2). \]
See \S\ref{s:rldef} for an expanded discussion motivating this definition. An important feature of the ring $R_{\mscr L}$ that we prove in \S\ref{s:rldef} is that the canonical $R$-algebra map $R/I^2 \longrightarrow R_{\mscr L}$ is injective.

\bigskip

 We next define a generalized Ritter--Weiss module $\nabla_{\!{\mscr L}}$ over the ring $R_{{\mscr L}}$.
   This module can be viewed as a gluing of the modules $\nabla_{\Sigma}^{\Sigma'}(H)$ and $\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ over $R_{\mscr L}$.  By its defining properties, the module
 $\nabla_{\Sigma}^{\Sigma'}(H)$ ``sees" the modified Brumer-Stark unit  $u_{\mathfrak{p}}^{\Sigma, \Sigma'}$, while the module
 $\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ sees the  image of $u_{\mathfrak{p}}^{\Sigma, \Sigma'}$ under $\rec_G$.  By fiat, the ring $R_{\mscr L}$ sees the Stickelberger elements
$ \Theta_H$ and $\Theta_L$ (or more precisely, a stand-in ${\mscr L}$ for their ``ratio").  The upshot is that $\nabla_{\!{\mscr L}}$ will be large if (\ref{e:mod}) holds, and will be small if (\ref{e:mod}) fails.  This notion of size is made precise via the theory of Fitting ideals.

We  show in \S\ref{s:gcfi} that the Fitting ideal $\Fitt_{R_{\mscr L}}(\nabla_{\!{\mscr L}})$ is generated by the element
\[ \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) -  \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L \in I/I^2.  \]
In view of the injectivity of $R/I^2 \longrightarrow R_{\mscr L}$, in order to prove that (\ref{e:mod}) holds it suffices to prove
\begin{equation} \label{e:ifit}
 \Fitt_{R_{\mscr L}}(\nabla_{\!{\mscr L}}) = 0.
  \end{equation}

We prove (\ref{e:ifit}) and thereby conclude the proof of Theorem~\ref{t:maingross} as follows.
We first give a characterization of $\nabla_{\!{\mscr L}}$  via Galois cohomology as in \cite{dk}*{Lemma A.8}.
Using this characterization, we show that for an $R_{\mscr L}$-module $M$, an $R_{\mscr L}$-module surjection \begin{equation} \label{e:nablam} \nabla_{\!{\mscr L}} \relbar\joinrel\twoheadrightarrow M \end{equation} is equivalent to a Galois cohomology class $\kappa \in H^1(G_F, M)$ satisfying certain local conditions.  For each positive integer $m$, we construct such a Galois cohomology class in an $R_{\mscr L}$-module $M$ satisfying $ \Fitt_{R_{\mscr L}}(M) \subset (p^m)$.  The surjection (\ref{e:nablam}) then implies
\[  \Fitt_{R_{\mscr L}}(\nabla_{\!{\mscr L}}) \subset  \Fitt_{R_{\mscr L}}(M) \subset (p^m). \]  Since this is true for all $m$, we obtain $(\ref{e:ifit})$ as desired.

\bigskip

The $R_{\mscr L}$-module $M$ and cohomology class $\kappa$ are constructed using group ring valued families of Hilbert modular forms.
Write $\mathfrak{n}$ for the conductor of $L/F$.  For simplicity in this introduction we assume that all primes of $F$ above $p$ divide $\mathfrak{n}$ and that there is more than one such prime.
Let $\Lambda$ be a finite free $\mathbf{Z}_p$-module.
For a positive integer $k$,
let $M_k(\mathfrak{n}, \Lambda)$ (respectively $S_k(\mathfrak{n}, \Lambda)$) denote the space of Hilbert modular forms (respectively, cusp forms) over $F$ of level $\Gamma_1(\mathfrak{n})$ over $\Lambda$. The group $S_k(\mathfrak{n}, \Lambda)$ is endowed with the action of a Hecke algebra $\tilde{\mathbf{T}}$ that is generated over $\mathbf{Z}_p$ by the Hecke operators $T_\mathfrak{q}$ for $\mathfrak{q} \nmid \mathfrak{n}$, $U_\mathfrak{q}$ for $\mathfrak{q} \mid p$, and the diamond operators $S(\mathfrak{m})$ for each integral ideal
$\mathfrak{m}$ relatively prime to $\mathfrak{n}$.

The main result of \S\ref{s:cusp} is the definition of an $R$-module $\Lambda$, a submodule $J \subset \Lambda$, and the construction of a  cusp form $f \in S_k(\mathfrak{n}, \Lambda)$ satisfying  the following properties.
\begin{itemize}
\item The weight $k$ is congruent to 1 modulo $(p-1)p^m$.
\item The quotient $\Lambda/J$ has the structure of a faithful $R/(I^2, p^m)$-module.
\item  Let $G_\mathfrak{n}^+$ denote the narrow ray class group of conductor $\mathfrak{n}$, and let \[ \pmb{\psi} \colon G_\mathfrak{n}^+ \relbar\joinrel\twoheadrightarrow \mathfrak{g} \subset R^* \] denote the canonical character.  The form $f$ has nebentypus $\pmb{\psi}$, i.e.\  $S(\mathfrak{m}) f = \pmb{\psi}(\mathfrak{m})f$ for $(\mathfrak{m}, \mathfrak{n}) = 1$.
\item The form $f$ is Eisenstein modulo $J$ in the sense that $T_\mathfrak{q}(f) \equiv (1 + \pmb{\psi}(\mathfrak{q})) f  \pmod{J}$ for  $\mathfrak{q} \nmid \mathfrak{n}$, and
$U_\mathfrak{q}(f) \equiv f  \pmod{J}$ for all $\mathfrak{q} \mid p, \mathfrak{q} \neq \mathfrak{p}$.

\item Modulo $J$, the operator $(1 - U_\mathfrak{p})$ acting on the Hecke span of the form $f$ satisfies the relations governing the element ${\mscr L} \in R_{\mscr L}$, e.g. \[ (1 - U_\mathfrak{p}) \Theta_H f \equiv \Theta_L f \pmod{J}. \]
\end{itemize}

The form $f$ allows for the definition of an $R_{{\mscr L}}/p^m$-algebra $W$ and an $R$-algebra homorphism \[ \varphi\colon \tilde{\mathbf{T}} \longrightarrow W\] such that
\begin{itemize}
\item $\varphi(T_\mathfrak{q}) = 1 + \pmb{\psi}(\mathfrak{q})$ for  $\mathfrak{q} \nmid \mathfrak{n}$
\item  $\varphi(U_\mathfrak{q}) = 1$ for all $\mathfrak{q} \mid p, \mathfrak{q} \neq \mathfrak{p}$, and
\item $\varphi(1 - U_\mathfrak{p}) = {\mscr L}$.
\end{itemize}
  Furthermore the algebra $W$ is large enough that the structure map \begin{equation} \label{e:rslw}
  R_{{\mscr L}}/p^m \longrightarrow W\end{equation} is an injection.

There is a Galois representation $\rho \colon G_F \longrightarrow {\bf GL}_2(\Frac(\tilde{\mathbf{T}}))$ that satisfies the usual conditions; in particular $\rho$ is unramified outside $\mathfrak{n}$ and $\tr(\rho(\sigma_\mathfrak{q})) = T_\mathfrak{q}$ for $\mathfrak{q} \nmid \mathfrak{n}$, where $\sigma_\mathfrak{q}$ denotes a Frobenius at $\mathfrak{q}$.  We choose a basis for $\rho$ such that $\rho(\tau)$ is diagonal for a certain well-chosen $\tau \in G_F$ that restricts to the complex conjugation in $\mathfrak{g}$.  Writing \[ \rho(\sigma) = \begin{pmatrix} a(\sigma) & b(\sigma) \\ c(\sigma) & d(\sigma)\end{pmatrix} \] in this basis,
we let $\tilde{\mathbf{B}}$ denote the $\tilde{\mathbf{T}}$-module generated by $b(\sigma)$ for $\sigma \in G_F$ together with certain other elements $x_\mathfrak{q} \in \Frac(\tilde{\mathbf{T}})$ for $\mathfrak{q} \mid p$.  We then define $\tilde{B} = \tilde{\mathbf{B}}/(p^m, \ker \varphi)\tilde{\mathbf{B}}$.

Standard methods in the theory of pseudorepresentations then allow for the definition of a cohomology class $\kappa \in H^1(G_F, \tilde{B}(\pmb{\psi}^{-1}))$.  We show that the class $\kappa$ satisfies the necessary local conditions to yield a surjection
$ \nabla_{\!{\mscr L}} \relbar\joinrel\twoheadrightarrow \tilde{B}(\pmb{\psi}^{-1})$ as in (\ref{e:nablam}).  These local calculations are based on the fact that the form $f$ is ordinary at primes $\mathfrak{q} \mid p$, and $p$-ordinary forms have Galois representations with prescribed shapes when restricted to decomposition groups at primes dividing $p$.  The elements $x_\mathfrak{q}$ mentioned above arise from this local calculation.

Finally, we use the methods of \cite{dk}*{Theorem 9.10} along with the crucial injection (\ref{e:rslw}) to prove the desired result
\[  \Fitt_{R_{\mscr L}}(\tilde{B}(\pmb{\psi}^{-1})) \subset (p^m). \]
One modification of the description above in the text is that we break $R$ into a product of components $A$ and work over $A_{\mscr L} = A \otimes_R R_{\mscr L}$.  This reduction is useful in our constructions with modular forms.

Also, the case where the prime $\mathfrak{p}$ is the only prime of $F$ above $p$ requires special consideration and is handled in \S\ref{s:onep}.  Let us try to motivate why this case is unique.  In this setting, when $k \equiv 1 \pmod{(p-1)p^m}$, the Eisenstein series $E_k(1, \chi)$ and $E_k(\chi, 1)$ are congruent modulo $p^m$ for any odd character of $G$.  The intersection of the associated Hida families in weight 1 makes the study of deformations of weight 1 Eisenstein series more complicated.
  We are not able to construct a group ring family of modular forms defined over a module endowed with an action of the ring $R_{\mscr L}$ in this case.

   Instead, we provide a different strategy for proving the congruence (\ref{e:mod}) when there is only one prime of $F$ above $p$.  In a sense, the argument is easier in this case, though it relies on previous significant results, some of which were themselves proved using Hilbert modular forms.
   We are able to deform up the cyclotomic tower of $F$ without altering the depletion set $\Sigma_\mathfrak{p} = S_\infty \cup \{\mathfrak{p}\}$ since this tower is ramified only at the prime $\mathfrak{p}$.  Let $F_m$ denote the $m$th layer of the tower, let $\mathfrak{g}_m = {\rm Gal}(LF_m/F)$, and let $R_m = \mathbf{Z}_p[\mathfrak{g}_m]^-$.
   We introduce a ring $R_{X,m}$ analogous to $R_{\mscr L}$, except that $X$ now represents the ratio between $\Theta_L$ and the derivative of the $p$-adic $L$-function of $H/F$ at $s=0$, denoted $\Theta_H'$.  We then define a homomorphism $R_m \longrightarrow R_{X,m}$ and show that in order to prove (\ref{e:mod}), it suffices to prove that
 \begin{equation} \label{e:nxi}
  \Fitt_{R_m} (\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(LF_m)_{R_m} \otimes_{R_m} R_{X,m}) = 0. \end{equation}
This reduction is dependent on the proof of the rational rank 1 Gross--Stark conjecture by the first author with Darmon and Pollack in \cite{ddp} and Ventullo in \cite{v}.  Another ingredient of the reduction proof is the nonvanishing of the first derivatives of $p$-adic $L$-functions at $s=0$ deduced by combining the  rational rank 1 Gross--Stark conjecture with the transcendence result of Brumer--Baker on the nonvanishing of algebraic linear combinations of $p$-adic logarithms of algebraic numbers (see Theorem~\ref{t:nv}).

   We prove that (\ref{e:nxi}) holds and thereby conclude the proof by applying the formula
 \begin{equation} \label{e:dkni}
  \Fitt_{R_m} (\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(LF_m)_{R_m}) = (\Theta_{\Sigma_\mathfrak{p}, \Sigma'}^{LF_m/F}(0))  \end{equation}
    proved in our previous work \cite{dk}.  We deduce (\ref{e:nxi}) from (\ref{e:dkni})
 using the explicit construction of the Deligne--Ribet $p$-adic $L$-function as an integral.

This concludes our summary of the proof of Theorem~\ref{t:maingross}.

\subsection{Acknowledgements}

We would first like to thank Takamichi Sano for very helpful discussions while this research was performed.  Sano explained to us in detail his work with Burns and Kurihara on the link between the Leading Term Conjecture and the integral Gross--Stark conjecture \cite{bks}.  While we do not apply their results directly, the philosophy presented in {\em loc.\ cit.} was very influential in our definition of the module $\nabla_{\!{\mscr L}}$ and the proof of Theorem~\ref{t:mfig} in \S\ref{s:gcfi}.

We would also like to thank Brian Conrad, Henri Darmon, Jesse Silliman, and Jiuya Wang for helpful discussions.  We thank James Milne for pointing out the application to CM fields mentioned in \S\ref{s:iecft} and in particular the article \cite{wei}.

We are extremely grateful to Max Fleischer and Yijia Liu, two undergraduate students of the first author at Duke University, who wrote the code to produce the computations in \S\ref{s:compute}.  Their code and complete tables are given in \cite{dasweb}.

Both authors would like to thank the hospitality of the Mathematical Research Institute of Oberwolfach, where certain aspects of this research were completed.
The first author was supported by grants DMS-1600943 and DMS-1901939 from the National Science Foundation during the completion of this project. The second author was support by SUPRA grant SPR/2019/000422 from the Science \& Engineering Research Board during the completion of this project.

\section{Hilbert's 12th Problem}

\subsection{An Exact Formula for Brumer--Stark units}

In \cite{das}, we proposed a conjectural exact $p$-adic analytic formula for the Brumer--Stark units $u_\mathfrak{p}$.
We briefly recall the shape of this formula. Let $\mathfrak{n} \subset \mathcal{O}_F$ denote a nonzero ideal and let $F(\mathfrak{n})$ denote the narrow ray class field  of $F$ associated to the conductor $\mathfrak{n}$.  Let $H$ be the maximal CM subfield of $F(\mathfrak{n})$ in which the prime $\mathfrak{p}$ splits completely.  Let $f$ denote the order of $\mathfrak{p}$ in the narrow ray class group of conductor $\mathfrak{n}$, and write $\mathfrak{p}^f = (\pi)$ for a totally positive element $\pi \in 1 + \mathfrak{n}$.  We also assume that the set $T$ contains a prime whose norm is a rational prime in $\mathbf{Z}$.

Next we let $\mathscr{D}$ denote a Shintani domain, as defined in \cite{das}*{Proposition 3.7}.  Let $\mathcal{O}_\mathfrak{p}$ denote the completion of $\mathcal{O}_F$ at $\mathfrak{p}$, and let $\mathbf{O} = \mathcal{O}_\mathfrak{p} - \pi \mathcal{O}_\mathfrak{p}$.  Let $\mathfrak{b} \subset \mathcal{O}_F$ denote an integral ideal that is relatively prime to $\mathfrak{n}$.  Associated with all this data, we have:
\begin{itemize}
\item A totally positive unit $\epsilon(\mathfrak{b}, \mathscr{D}, \pi) \in \mathcal{O}_F^*$
 congruent to 1 modulo $\mathfrak{n}$,
defined in \cite{das}*{Definition 3.17}.
\item A $\mathbf{Z}$-valued measure $\nu(\mathfrak{b}, \mathscr{D})$ on $\mathcal{O}_\mathfrak{p}$, defined in \cite{das}*{eqn. (21)} using Shintani's theory of simplicial zeta functions.
\end{itemize}
We then proposed:
\begin{conjecture}[\cite{das}*{Conjecture 3.21}]  \label{c:shin} Let $\sigma_\mathfrak{b} \in {\rm Gal}(H/F)$ denote the Frobenius element associated with $\mathfrak{b}$.  Let $\mathfrak{P}$ and $u_\mathfrak{p}$ be as in Conjecture~\ref{c:bs}, and consider $H$ as a subfield of $F_\mathfrak{p}$ via $H \subset H_\mathfrak{P} \cong F_\mathfrak{p}$.
We then have
\begin{equation} \label{e:genform}
 \sigma_{\mathfrak{b}}(u_\mathfrak{p}) = \epsilon(\mathfrak{b}, \mathcal{D}, \pi) \cdot \pi^{\zeta_{S,T}(F(\mathfrak{n})/F, \mathfrak{b}, 0)} \times\!\!\!\!\!\!\!\int_{\mathbf{O}} x \ d\nu(\mathfrak{b}, \mathscr{D}, x) \in F_\mathfrak{p}^*.
 \end{equation}
\end{conjecture}

We stress that the exponent $\zeta_{S,T}(F(\mathfrak{n})/F, \mathfrak{b}, 0)$ and the measure $\nu(\mathfrak{b}, \mathscr{D})$ may be computed explicitly using
Shintani's formulas.  If we may take $\pi$ to be a rational integer (e.g.\ if $p$ is inert in $F$ and $\pi = p^f$), then the unit $\epsilon(\mathfrak{b}, \mathscr{D}, \pi)$ is equal to 1 and the formula simplifies as described in the introduction (\ref{e:thesis}).
See \cite{comp}*{Proposition 3.2} for an explicit formula for the measure $\nu(\mathfrak{b}, \mathscr{D})$ in this setting when $F$ is real quadratic.
One of the main theorems of \cite{das} is the following:

\begin{theorem}[\cite{das}*{Theorem 5.18}]  Suppose that condition $(*)$ holds. Then the $p$-part of Conjecture~\ref{c:grosstower} implies  Conjecture~\ref{c:shin}
 up to multiplication by a root of unity in $F_\mathfrak{p}^*$. \label{t:maindas}
\end{theorem}

In other words, Theorem~\ref{t:maingross} implies Theorem~\ref{t:thesis}.

\bigskip

We conclude this section by discussing the history of Conjecture~\ref{c:shin} and its various manifestations.  The first conjecture of this form appeared in the 2004 Ph.D.\ thesis of the first author \cite{thesis}, which was published as \cite{dd}.  The setting for this conjecture was that of a real quadratic field $F$ and a prime $p$ that is inert in $F$.  Furthermore $H$ was taken to be a CM ring class field extension of $F$.  In that paper, the measure $\nu$ was defined as a specialization of the {\em Eisenstein cocycle} obtained by integrating Eisenstein series on the complex upper half plane.  The resulting interplay between complex and $p$-adic integration was inspired by Darmon's theory of integration on $\mathcal{H}_p \times \mathcal{H}$ \cite{darmon}.

 This first construction was generalized by Chapdelaine in his 2007 Ph.D. thesis \cite{chapthesis} to the context where $F$ is still a real quadratic field and $p$ is an inert prime, but $H$ is an arbitrary CM abelian extension of $F$ in which $\mathfrak{p} = p \mathcal{O}_F$ splits completely.  Chapedelaine's construction applied integration of more general Eisenstein series than considered in \cite{dd}.  It was published in the form \cite{chapcomp}.

 Next, as described above, the first author applied Shintani's theory of simplicial zeta functions in order to expand the earlier constructions to cover the general case:
 $F$ is any totally real field, $H$ is a CM abelian extension, and $\mathfrak{p}$ is a finite prime of $F$ that splits completely in $H$  \cite{das}.
 The equivalence between the constructions of \cite{dd} and \cite{das} in the setting of the former article was established in \cite{das}*{\S8}, though we note that an error in this argument  was observed and corrected by Chapdelaine in \cite{chapquebec}.  In  Chapdelaine's paper the equivalence between the constructions was generalized to include that of \cite{chapcomp}.

 Notably absent from the article \cite{das}, however, is the cohomological perspective of the earlier works.  More recently, several articles have appeared that have reestablished the cohomological underpinnings of the $p$-adic formula (\ref{e:genform}) in the general case.

In \cite{pcsd}, Charollois and the first author reconsidered the construction of the Eisenstein cocycle by Sczech using conditionally convergent sums, and proved an integrality result yielding another construction of the measure $\nu$ in the general case.  The cohomological approach was applied to Shintani's method independently by Spiess in \cite{spiess} and by the first author in joint work with Charollois and M.~Greenberg in \cite{cdg}.  The application of these constructions to an exact $p$-adic analytic formula for $u_\mathfrak{p}$ was given in joint work of the first author with Spiess \cite{ds}*{\S6}.  The equivalence of the cohomological approach of {\em loc.\ cit.} with the formula (\ref{e:genform}) above is the subject of current work by Honnor, building on the Ph.D.\ thesis of Tsosie \cite{tsosie}.
We hope to prove directly that Theorem~\ref{t:maingross} implies the conjecture of \cite{ds}  (and in fact generalize to the higher rank case) in future joint work with Spiess.

\subsection{Hilbert's 12th problem} \label{s:hilbert}

The goal of this section is to prove Theorem~\ref{t:h12}.

\begin{lemma}  \label{l:ugen}
Let $F$ be a totally real field and suppose that $H/F$ is a cyclic CM extension such that the finite prime $\mathfrak{p} \subset \mathcal{O}_F$ splits completely in $H$.  Let $S = S_\infty \cup S_{\text{ram}}(H/F)$ be minimal for the extension $H/F$.  Let $m \neq 0$ be an integer such that $u_\mathfrak{p}^m \in H$.  Then $H = F(u_\mathfrak{p}^m)$.
\end{lemma}

\begin{remark}  The purpose of the integer $m$ in this lemma is to avoid assuming the Brumer--Stark conjecture, which purports that we may take $m = 1$. By the main theorem of \cite{dk}, $m$ may be taken to be a power of $2$.
\end{remark}

\begin{proof}  Since $H/F$ is cyclic, there exists a {\em faithful} character of $G = {\rm Gal}(H/F)$.
Such a character is necessarily odd, i.e. $\chi(\text{complex conjugation}) = -1$.
 By \cite{tatebook}*{Pg. 25}, we have
\[ \ord_{s=0} L_{S,T}(\chi, 0) = \# \{ v \in S\colon \chi(G_v) = 1 \} = 0 \]
since $\chi$ is faithful and $S$ is minimal (in particular $S$ contains no place $v$ that splits completely in $H$).  Hence $L_{S,T}(\chi,0) \neq 0$.  On the other hand, applying $\chi^{-1}$ to (\ref{e:bs}) yields
\[ m \cdot L_{S,T}(\chi, 0)  = \sum_{\sigma \in G} \ord_{\mathfrak{P}}(\sigma(u_\mathfrak{p}^m)) \chi(\sigma).
\]
If $\tau \in G$ fixes $u_\mathfrak{p}^m$, then
\begin{align*} \chi(\tau) \cdot m \cdot L_{S,T}(\chi, 0)  & = \sum_{\sigma \in G} \ord_{\mathfrak{P}}(\sigma(u_\mathfrak{p}^m)) \chi(\tau\sigma) \\
& = \sum_{\sigma \in G} \ord_{\mathfrak{P}}(\sigma\tau^{-1}(u_\mathfrak{p}^m)) \chi(\sigma) \\
&=  \sum_{\sigma \in G} \ord_{\mathfrak{P}}(\sigma(u_\mathfrak{p}^m)) \chi(\sigma) \\
&=  m \cdot L_{S,T}(\chi, 0).
\end{align*}
Since $m$ and $L_{S,T}(\chi, 0)$ are nonzero, we conclude that $\chi(\tau) = 1$.  Since $\chi$ is faithful, we have $\tau=1$.  By Galois theory, we  have $H = F(u_{\mathfrak{p}}^m)$.
\end{proof}

\begin{lemma} \label{l:cmcyclic} Let $F$ be a totally real field and suppose that $H/F$ is an abelian CM extension.  Then $H$ is the compositum of its CM subfields $H' \subset H$ containing $F$ such that ${\rm Gal}(H'/F)$ is cyclic.
\end{lemma}

\begin{proof} Let $c \in G = {\rm Gal}(H/F)$ denote the unique complex conjugation.
Let $G'$ be a subgroup of $G$. The fixed field $H^{G'}$ is CM if and only iff $c \not \in G'$.  The desired result then follows from the following elementary fact in group theory:  if $G$ is a finite abelian group and $c \in G$ is any nontrivial element, then the intersection of all subgroups $G' \subset G$ such that $G/G'$ is cyclic and $c \not\in G'$ is trivial.  We leave the proof of this fact as an exercise.
\end{proof}

To pass from CM fields to arbitrary abelian extensions, we  consider the sign homomorphism
\[ \mathrm{sgn}\colon F^* \longrightarrow \{\pm 1\}^n, \qquad x \mapsto (\sign(\sigma_1(x)), \dotsc, \sign(\sigma_n(x)). \]
Here the $\sigma_i$ denote the $n$ real embeddings of $F$.
We say that elements $\alpha_1, \dotsc, \alpha_{n}$ are {\em sign spanning} if the images of these elements under $\mathrm{sgn}$
generate the abelian group $\{\pm 1\}^n.$

\begin{lemma}  \label{l:sqrts}
Let $F$ be a totally real field and let $K/F$ be a finite abelian extension. Suppose that $\alpha_1, \dotsc, \alpha_{n}$ are a sign spanning set of elements of $F^*$ such that $\sqrt{\alpha_i} \in K$ for all $i=1, \dotsc, n$.  Let $H$ denote the maximal CM  extension of $F$ contained in $K$.  Then $K = H(\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n}}).$
 \end{lemma}

\begin{proof}  The assumption of the existence of the $\alpha_i$ implies that $K$ contains a CM extension of $F$, e.g.\ $F(\sqrt{\alpha})$ for a product $\alpha$ of the $\alpha_i$ that is totally negative.  Note also that the notion of ``maximal CM extension" is well-defined, since the compositum of CM fields is again CM.

Let $\tau_i \in G = {\rm Gal}(K/F)$ denote the complex conjugation corresponding to any complex place of $K$ above the real place $\sigma_i$ of $F$.  Let $G' \subset G$ denote the exponent 2 subgroup generated by the elements $\tau_i/\tau_j$ for all $i, j = 1, \dotsc, n$.
The fixed field $H = K^{G'}$ has at most one complex conjugation, namely the image of any $\tau_i$ in $G/G'$.  The field $H$ will be CM if this image is nontrivial, and totally real if the image is trivial.  The latter situation happens if and only if there is an equality of the form
\begin{equation} \label{e:tauprod} \prod_{i \in E} \tau_i = 1 \text{ in } G \end{equation}
for some subset $E \subset \{1, \dotsc, n\}$ of odd size.  In fact the assumption of the lemma implies that no such relation can occur for any nonempty $E$.  Indeed, choose an appropriate product $\alpha$ of the $\alpha_i$ such that $\sigma_j(\alpha)< 0 $ for some $j \in E$ and $\sigma_{j'}(\alpha) > 0$ for all $j' \neq j$.  Then $\left(\prod_{i \in E} \tau_i\right)(\sqrt{\alpha}) = - \sqrt{\alpha}$, precluding the possibility that (\ref{e:tauprod}) holds.

It remains to show that $K = H(\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n}}).$  Any element $\tau \in G$ that fixes the subfield $H(\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n}})$ pointwise must in particular fix $H$ pointwise, and hence must lie in $G'$.  Such an element therefore has the form $\tau = \prod_{i \in E} \tau_i$ for some subset $E \subset \{1, \dotsc, n\}$.  Yet we just showed that no such nontrivial product can fix every $\sqrt{\alpha_i}$.  It follows that $\tau = 1$, and the desired result follows from Galois theory.
\end{proof}

We now prove Theorem~\ref{t:h12}, whose statement we recall.
For each nonzero ideal $\mathfrak{n} \subset \mathcal{O}_F$, pick a prime ideal $\mathfrak{p}(\mathfrak{n}) \subset \mathcal{O}_F$ whose image in the narrow ray class group of $F$ of conductor $\mathfrak{n}$ is trivial.  Choose $\mathfrak{p}(\mathfrak{n})$ such that the rational prime $p$ below it satisfies $(*)$.
Let $u_{\mathfrak{p}(\mathfrak{n})} \in U_{\mathfrak{p}(\mathfrak{n}),T}^{-} \otimes \mathbf{Z}[1/2]$ denote the Brumer--Stark element for the narrow ray class field $F(\mathfrak{n})$ of conductor $\mathfrak{n}$, and let $m(\mathfrak{n})$ denote the smallest integer power of 2 such that $u_{\mathfrak{p}(\mathfrak{n})}^{m(\mathfrak{n})} \in F(\mathfrak{n})$.  Conjecturally $m(\mathfrak{n})=1$.
Define
\begin{equation} \label{e:sfndef}
 S_\mathfrak{n} = \left\{ \sigma(u_{\mathfrak{p}(\mathfrak{n})}^{m(\mathfrak{n})}) \colon \sigma \in {\rm Gal}(F(\mathfrak{n})/F) \right\}.
 \end{equation}
Finally, let $\alpha_1, \dotsc, \alpha_{n-1} \in F^*$ such that $-1, \alpha_1, \alpha_2, \dotsc, \alpha_{n-1}$ are sign spanning.

\begin{theorem} \label{t:h12main}
The maximal abelian extension of $F$ is generated by $\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}}$ together with the elements of $S_\mathfrak{n}$ as $\mathfrak{n}$ ranges over all nonzero  ideals $\mathfrak{n} \subset \mathcal{O}_F$:
\begin{equation} \label{e:h12}
 F^{\text{ab}}  = {\dot{\bigcup}}_{\mathfrak{n}} \ F(S_{\mathfrak{n}}) \ \ \dot\cup \ \ F(\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}}),
 \end{equation}
where $\dot\cup$ denotes compositum of fields.
\end{theorem}

\begin{proof}  Let $L$ denote the field on the right side of (\ref{e:h12}).  It is clear that $L$ is an abelian extension of $F$.  We must show that if $K$ is any finite abelian extension of $F$, then $K \subset L$.  After replacing $K$ by $K(\sqrt{-1}, \sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}})$, we may assume that $K$ contains $\sqrt{-1}, \sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}}$.  If $H$ denotes the maximal CM extension of $F$ contained in $K$, then $\sqrt{-1} \in H$ and hence Lemma~\ref{l:sqrts} implies that $K = H(\sqrt{\alpha_1}, \dotsc, \sqrt{\alpha_{n-1}})$.  It therefore suffices to show that $H \subset L$.  By Lemma~\ref{l:cmcyclic} we may assume that $H$ is a cyclic CM extension of $F$.

Let $\mathfrak{n} \subset \mathcal{O}_F$ denote the conductor of $H$.  The minimal set $S$ for the narrow ray class field $F(\mathfrak{n})$ is the same as that for $H \subset F(\mathfrak{n})$, namely the union of $S_\infty$ with the set of primes dividing $\mathfrak{n}$.  We write $\mathfrak{p} = \mathfrak{p}(\mathfrak{n})$ and $m = m(\mathfrak{n})$. By  \cite{tatebook}*{Prop IV.3.5, Pg. 92}, the Brumer--Stark units for the extensions $F(\mathfrak{n})$ and $H$ are related by
\begin{equation} \label{e:normrel}
 u_{\mathfrak{p}}(H) = \mathrm{N}_{F(\mathfrak{n})/H}(u_{\mathfrak{p}}(F(\mathfrak{n}))) = \prod_{\sigma \in {\rm Gal}(F(\mathfrak{n})/H)} \sigma(u_{\mathfrak{p}}(F(\mathfrak{n}))). \end{equation}
It follows from (\ref{e:normrel}) and the definition of $S_\mathfrak{n}$ that $u_{\mathfrak{p}}(H)^{m} \in L$.  Lemma~\ref{l:ugen} implies that
\[ H = F(u_{\mathfrak{p}}(H)^{m}) \] and hence $H \subset L$.  The result follows.
\end{proof}

\begin{remark} \label{r:mn} The unspecified powers of 2 denoted $m(\mathfrak{n})$ in (\ref{e:sfndef}) are an annoyance.  Ideally, one could generalize our earlier work \cite{dk} and prove the Brumer--Stark conjecture at $2$, thereby allowing one to take $m(\mathfrak{n}) = 1$.  This is the topic of current work by the authors in collaboration with Jesse Silliman and Jiuya Wang.  While the general case is a work in progress with significant issues remaining, we have completed the proof of the Brumer--Stark conjecture at 2 in the case where the 2-Sylow subgroup of $G$ is cyclic.   The proof of Theorem~\ref{t:h12main} reveals that it suffices to consider only the Brumer--Stark units for CM extensions $H/F$ that are cyclic.  Therefore, if we replace the definition of $S_\mathfrak{n}$ with
\[ S_\mathfrak{n} = \left\{ \mathrm{N}_{F(\mathfrak{n})/H}(u_{\mathfrak{p}(\mathfrak{n})}) \colon F \subset H \subset F(\mathfrak{n}), H/F \text{ cyclic} \right\},
\]
then we obtain another unconditional version of Theorem~\ref{t:h12main} in which the constants $m(\mathfrak{n})$ do not appear.

Now, it is desirable to address this issue without reference to a result that is not yet published.  We therefore note that a rather blunt upper bound for $m(\mathfrak{n})$ is the size of the 2-primary part of the relative class number of $F(\mathfrak{n})$ (i.e.\ the size of the kernel of the norm map from the class group of $F(\mathfrak{n})$ to the class group of its maximal totally real subfield).  The Brauer--Siegel theorem provides an upper bound on this relative class number in terms of the discriminant of $F(\mathfrak{n})$.  And this discriminant is bounded in terms of the discriminant of $F$, the conductor $\mathfrak{n}$, and the degree $[F(\mathfrak{n}):F]$ by the discriminant-conductor formula.  Therefore, we can provide (an admittedly very weak) upper bound for $m(\mathfrak{n})$ solely in terms of $\mathfrak{n}$, and independently of any knowledge about the field $F(\mathfrak{n})$ itself, using classical results.
\end{remark}

\begin{remark}  \label{r:rou} We should also remark on the root of unity ambiguity in Theorem~\ref{t:maindas} with respect to providing an explicit formula for the elements in $S_{\mathfrak{n}}$ appearing on the right side of (\ref{e:h12}).  Since this root of unity necessarily lies in $F_{\mathfrak{p}(n)}^*$, its order divides $\mathrm{N}\mathfrak{p}(\mathfrak{n}) - 1$.  Therefore we may simply raise our elements $u_{\mathfrak{p}(\mathfrak{n})}$ to the power $\mathrm{N}\mathfrak{p}(\mathfrak{n}) - 1$ and obtain an unconditional exact equality, with elements (by Lemma~\ref{l:ugen}) that still satisfy the necessary properties for Theorem~\ref{t:h12main}.  Alternatively, since roots of unity always generate abelian extensions, we can simply adjoin all roots of unity to the right side of (\ref{e:h12}) and ignore any possible root of unity error in the formula (\ref{e:genform}) for the elements of $S_\mathfrak{n}$.
\end{remark}

\subsection{Computations} \label{s:compute}

In this section we present some computations of the units $u_\mathfrak{p}$ calculated using the formula  (\ref{e:genform}).  We consider the simplest possible  case beyond $F = \mathbf{Q}$: we let $F = \mathbf{Q}(\sqrt{D})$ be a real quadratic field with discriminant $D$, let $p$ be a rational prime that is inert in $F$ (so $\mathfrak{p} = p \mathcal{O}_F$), and let $H$ be the narrow Hilbert class field of $F$.
The set $S$ is taken to equal $S_\infty$, the minimal possible set in this setting.  The set $T$ is taken to contain a single prime $\mathfrak{q}$ such that $\mathrm{N}\mathfrak{q} = \ell$ is a prime not equal to $p$.

The code to perform these computations was written by Max Fleischer and Yijia Liu, two undergraduate students of the first author at Duke University.  Their algorithm  closely follows the paper \cite{comp}.  One important difference is as follows.  In {\em loc.\ cit.}, a formal divisor $\sum_{d \mid N} n_d[d] \in \Div(\mathbf{Z})$ is used to smooth the zeta values. The conditions $\sum_{d \mid N} n_d = 0$ and $\sum_{d \mid N} n_d d = 0$ are imposed.  For this reason, computations are performed with the simplest possible nonzero such divisor, namely $2[1] - 3[2] + [4]$.
In the present paper, we use the set $T$ to smooth our zeta values, which corresponds to setting $N = \ell$ and using the divisor $[\ell]-\ell[1]$.
 Note that this divisor does not satsify the condition $\sum_{d \mid N} n_d = 0$.  It turns out that this condition is unnecessary to apply the general algorithm of {\em loc.\ cit.}; only minor modifications are necessary (see \cite{dasweb}).

In each case, formula (\ref{e:genform}) is used to compute the image of $u_\mathfrak{p}$ and all of its conjugates over $F$ in $F_p^*$ to 100 $p$-adic digits.  The elementary symmetric polynomials of these conjugates are then calculated and, after scaling by the appropriate power of $p$ to achieve integrality, recognized as elements of $\mathcal{O}_F$ using a standard nearest lattice vector algorithm.  This allows for the computation of the minimal polynomial of $u_\mathfrak{p}$ over $F$.  The computed 100 $p$-adic digits were enough to recognize the minimal polynomials in each case.

We stress that the field $H$ itself is never fed into the program; all computations take place within $F$ and its completion $F_p$.  After the fact, it was verified that in each case the minimal polynomials listed split over a CM abelian extension of $F$ unramified at all finite primes, and hence must be contained in the narrow Hilbert class field $H$ of $F$.  The splitting field of the minimal polynomial of $u_\mathfrak{p}$ is in fact precisely $H$, as implied by a suitable modification of Lemma~\ref{l:ugen} (using the fact that $L_{S,T}(\chi, 0) \neq 0$ for every odd character $\chi$ since here $S=S_\infty$ contains no finite primes).

The programs to generate these results were written in SageMath and executed on a Jupyter Notebook using the kernel SageMath 9.0.  The code is available at
\cite{dasweb}.
This web page also describes a typo (sign error) in one equation in \cite{comp} that was discovered by Fleischer and Liu.
Below we give three interesting examples of the computations.

\begin{example} $D = 221, p=3, \ell = 5, G = {\rm Gal}(H/F) \cong \Cl^+(F) \cong \mathbf{Z}/4\mathbf{Z}$.  The values $\ord_\mathfrak{P}(\sigma(u_\mathfrak{p}))$ for $\sigma \in G$, i.e.\ the partial zeta values $\zeta_{S,T}(\sigma, 0)$, are $\pm 3, \pm 15$.  The minimal polynomial of $u_\mathfrak{p}$ over $F$ is computed to be:
\begin{align*}
 X^4 + &  \left (\frac{-423812}{3^{13}} + \frac{71680\sqrt{D}}{3^{15}}\right)X^3 + \left(\frac{76348630}{3^{18}} + \frac{-5218304\sqrt{D}}{3^{16}}\right)X^2  \\
 & + \left(\frac{-423812}{3^{13}} + \frac{71680\sqrt{D}}{3^{15}}\right)X + 1.
 \end{align*}
\end{example}

\begin{example} $D = 321, p=7, \ell = 5, G \cong \mathbf{Z}/6\mathbf{Z}$.  The values $\ord_\mathfrak{P}(\sigma(u_\mathfrak{p}))$ for $\sigma \in G$ are $\pm 1, \pm 3, \pm 7$.  The computed minimal polynomial of $u_\mathfrak{p}$ over $F$ is:
\begin{align*}
X^6 + & \left(\frac{55935}{2 \cdot 7^{7 }} + \frac{-63891\sqrt{D}}{2 \cdot 7^{7 }}\right)X^5 + \left(\frac{1062148509}{2 \cdot 7^{10 }} +
\frac{2960001\sqrt{D}}{2 \cdot 7^{10 }}\right)X^4
\\
+ & \left(\frac{-49244921}{2 \cdot 7^{10 }} + \frac{-279429993\sqrt{D}}{2 \cdot 7^{11}}
\right)X^3 + \cdots + 1.
 \end{align*}
Note that the minimal polynomials of Brumer--Stark units are always palindromic, since $u_\mathfrak{p}^{-1}$ is the complex conjugate of $u_\mathfrak{p}$.  Hence the coefficient of $X^2$ above equals the coefficient of $X^4$ and the coefficient of $X$ equals that of $X^5$.
\end{example}

\begin{example} $D = 897, p=5, \ell=7, G \cong \mathbf{Z}/4\mathbf{Z} \times \mathbf{Z}/2\mathbf{Z}$. The values $\ord_\mathfrak{P}(\sigma(u_\mathfrak{p}))$ are $\pm 7, \pm 9, \pm 11, \pm 21$.  The computed minimal polynomial of $u_\mathfrak{p}$ over $F$ is:
\begin{align*}
X^8  + & \left(\frac{2549757626558363}{2\cdot 5^{21}}+\frac{1416002374557\sqrt{D}}{2\cdot 5^{21}}\right)X^7 \\
+ & \left(\frac{51143699935554731498041}{5^{32}}+\frac{56709030111424864533\sqrt{D}}{5^{31}}\right)X^6 \\
+ & \left(-\frac{11738117897361345671334368371}{2\cdot 5^{41}}+\frac{4935116278645813872967514931\sqrt{D}}{2\cdot 5^{41}}\right)X^5 \\
+ & \left(-\frac{4489586764048071498962140328642159}{5^{48}}+\frac{49988908282076855221482\sqrt{D}}{5^{34}}\right)X^4 \\
+ & \cdots +1
\end{align*}
\end{example}

Complete tables for all fundamental discriminants $D < 1000$ whose associated narrow class field is CM, comprising hundreds of similar examples, are given in \cite{dasweb}.

We conclude this section by noting that in his 2007 undergraduate senior thesis at Harvard University, Kaloyan Slavov computed an example where the ground field $F$ is a totally real cubic field and the conductor $\mathfrak{n}$ is nontrivial.  We refer to \cite{slavov}*{\S8.6.1} for details.

\section{Algebraic preliminaries}

The rest of the paper is concerned with proving Theorem~\ref{t:maingross}.  Let us recall the setup.
We are given a totally real field $F$ and a finite abelian CM extension  $H$.
Let $S$ be a finite set of places of $F$ containing $S_\text{ram}(H/F) \cup S_\infty$. Let
$T$ be a finite set of primes  of $F$ disjoint from $S$ satisfying the following condition of Deligne--Ribet:
\begin{equation}
\label{e:drcond}
  \parbox{\dimexpr\linewidth-5em}{
    \strut
$T$ contains a prime of residue characteristic greater than $[F:\mathbf{Q}]+1$, or two primes of different residue characteristic.
    \strut
  }
  \end{equation}
  This condition is useful because it implies the following:
\[
  \parbox{\dimexpr\linewidth-5em}{
    \strut
Let $T_H$ denote the set of primes of $H$ above those in $T$.  The group of roots of unity $\zeta \in \mu(H)$ such that $\zeta \equiv 1 \!\!\!\!\!\pmod{\mathfrak{q}}$ for all $\mathfrak{q} \in T_H$ is trivial.
    \strut
  }
\]

We fix a prime $\mathfrak{p} \subset \mathcal{O}_F$ not in $S \cup T$ that splits completely in $H$ and write $S_\mathfrak{p} = S \cup \{\mathfrak{p}\}$.
We consider another finite abelian CM extension $L/F$ containing $H$ and unramified outside $S_\mathfrak{p}$. Write  \[ \mathfrak{g} = {\rm Gal}(L/F), \quad \Gamma = {\rm Gal}(L/H), \quad G = {\rm Gal}(H/F) \cong \mathfrak{g}/\Gamma . \]
Let $p$ denote the rational prime contained in $\mathfrak{p}$. We assume that $p$ is odd.
Let \[ R = \mathbf{Z}_p[\mathfrak{g}]^-, \qquad  \overline{R} = \mathbf{Z}_p[G]^-, \qquad I = \ker(R \longrightarrow \overline{R}). \]
By Theorem~\ref{t:bs}, there is a unique $u_{\mathfrak{p}} \in U_{\mathfrak{p},T}^- \otimes \mathbf{Z}_p$ such that \[ \ord_G(u_{\mathfrak{p}}) =  \Theta_{S,T}^H. \]
Our goal is to prove the following congruence, the $p$-part of Gross's conjecture:
\[ \rec_G(u_{\mathfrak{p}}) \equiv \Theta_{S_\mathfrak{p},T}^L \pmod{I^2}. \]

\subsection{Altering Depletion and Smoothing Sets}

Following \cite{dk}, define
\begin{align*}
\Sigma &= \{v \in S  \colon v \mid p \infty \}, \\
\Sigma_\mathfrak{p} &= \Sigma \cup \{\mathfrak{p}\}, \\
\Sigma' &= \{v \in S \colon v  \nmid p\infty \} \cup T.
\end{align*}
It will be very convenient for us to replace the sets $S, S_\mathfrak{p}$, and $T$ by the sets $\Sigma, \Sigma_\mathfrak{p}$, and $\Sigma'$, respectively.  In this section, we make this replacement precise and prove that it suffices to prove the result in this context.

There is a Stickelberger element $\Theta_{\Sigma, \Sigma'}^H \in \mathbf{Q}[G]^-$ defined by the property
\[ \chi(\Theta_{\Sigma, \Sigma'}^H) = L_{\Sigma, \Sigma'}(\chi^{-1}, 0) \] for every odd character $\chi$ of $G$, where
$L_{\Sigma, \Sigma'}(\chi, s)$ is defined by (\ref{e:ls}) and (\ref{e:lst}) along with the convention that $\chi(\mathfrak{q})=0$ if $\chi$ is ramified at $\mathfrak{q}$.  We show in \cite{dk}*{Remark 3.6} that $\Theta_{\Sigma, \Sigma'}^H \in \overline{R}$.

As we explain, the results of \cite{dk} imply that there exists a unique $u_{\mathfrak{p}}^{\Sigma, \Sigma'} \in U_{\mathfrak{p}, T}^- \otimes \mathbf{Z}_p$ such that \[ \ord_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) = \Theta_{\Sigma,\Sigma'}^H. \]
Let $\#$ denote the involution on $\overline{R}$ induced by $g \mapsto g^{-1}$ for $g \in G$.
Remark 3.6 of {\em loc.\,cit.} implies that
\[ \Theta_{\Sigma,\Sigma'}^H \in \KS_p^T(H/F)^\# = \Theta_{\Sigma, T}^H \prod_{v \in S_{\text{ram}}(H/F), v \nmid p} (\mathrm{N} I_v, 1 - \sigma_v^{-1} \mathrm{N} I_v/\#I_v) \subset \overline{R}. \] Equation (35) of {\em loc.\,cit.} then implies that $\Theta_{\Sigma,\Sigma'}^H$ annihilates $\Cl^T(H)_p^-$.  The annihilation of the class represented by $\mathfrak{p}$ is equivalent to the existence of the desired $u_{\mathfrak{p}}^{\Sigma, \Sigma'}$.

\begin{lemma}  \label{l:equiv}
To prove Gross's conjecture, it suffices to show that in each setup as above, we have the ``modified Gross conjecture":
\begin{equation} \label{e:mgc}
 \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) \equiv \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L \pmod{I^2}. \end{equation}
\end{lemma}
\begin{proof}  More generally if $\Sigma \subset J \subset S$ and $J' = \Sigma' \setminus J$, $J_\mathfrak{p} = J \cup \{\mathfrak{p}\}$, then we will show that
\begin{equation} \label{e:uj}
 \rec_G(u_{\mathfrak{p}}^{J, J'}) \equiv \Theta_{J_\mathfrak{p}, J'}^L \pmod{I^2}.
 \end{equation}
 The desired result is the case $J=S$.
We proceed by induction on $\#(J \setminus \Sigma)$.  The base case $J = \Sigma$ is given. For the inductive step, fix $J \supset \Sigma$ and let $v \in S \setminus J$.  Then
$v \nmid p\infty$.  We write \[
J_v = J \cup \{v\}, \qquad
J_{v, \mathfrak{p}} = J \cup \{v, \mathfrak{p}\}, \qquad J'_v = J' - \{v\}. \]
Then \begin{equation} \label{e:theta}
 \Theta_{J_{v, \mathfrak{p}}, J'_v}^L = \Theta_{J_\mathfrak{p}, J'}^L + \frac{\mathrm{N} v - 1}{\#I_v} \sigma_v^{-1} \mathrm{N} I_v \Theta_{J_\mathfrak{p}, J_v'}^L. \end{equation}
Note that $\# I_v \mid \mathrm{N} v - 1 $ in $\mathbf{Z}_p$, since $v \nmid p$.
Both terms on the right side of (\ref{e:theta}) lie in $\text{SKu}_p^T(L/F)^\#$ and hence lie in $\overline{R}$.  By the inductive hypothesis, we have (\ref{e:uj}).
Furthermore, if we write $\overline{I}_v$ for the image of $I_v$ in $G$ and \[ I_G(v) = \ker(\mathbf{Z}_p[\mathfrak{g}/I_v]^- \longrightarrow \mathbf{Z}_p[G/\overline{I}_v]^-), \] then by induction we have
\begin{equation} \label{e:uj2}
 \rec_{G/\overline{I}_v}(u_{\mathfrak{p}}^{J, J_v'}) \equiv \Theta_{J_\mathfrak{p}, J_v'}^{L^{I_v}} \pmod{I_G(v)^2}.
 \end{equation}
Here $u_{\mathfrak{p}}^{J, J_v'} \in U_\mathfrak{p}(H^{\overline{I}_v})^-$
satisfies \[ \ord_{G/\overline{I}_v}(u_{\mathfrak{p}}^{J, J_v'}) =
\Theta_{J, J_v'}^{H^{\overline{I}_v}}. \]
 Now $x \mapsto x \cdot \mathrm{N} I_v$ yields a map $\mathbf{Z}_p[\mathfrak{g}/I_v] \rightarrow \mathbf{Z}_p[\mathfrak{g}]$ sending $I_G(v)^2 \rightarrow I^2$, so from (\ref{e:uj2}) we deduce
 \begin{equation}  \rec_G((u_{\mathfrak{p}}^{J, J_v'})^{\mathrm{N} I_v}) \equiv  \mathrm{N} I_v \Theta_{J_\mathfrak{p}, J_v'}^{L} \pmod{I^2}.  \label{e:uj3}
 \end{equation}
The desired result
\[  \rec_G(u_{\mathfrak{p}}^{J_v, J_v'}) \equiv \Theta_{J_{v,\mathfrak{p}}, J_v'}^L \pmod{I^2}  \]
now follows by combining (\ref{e:uj}) and (\ref{e:uj3}), using (\ref{e:theta}).  We must simply note that
\begin{align}
\Theta_{J_v, J_v'}^H &= \Theta_{J,J'}^H + \frac{\mathrm{N} v - 1}{\#\overline{I}_v} \sigma_v^{-1} \mathrm{N} \overline{I}_v \Theta_{J, J_v'}^H \\
&= \Theta_{J,J'}^H + \frac{\mathrm{N} v - 1}{\#{I_v}} \sigma_v^{-1} \mathrm{N} {I_v} \Theta_{J, J_v'}^H,
  \end{align}
which implies that $u_{\mathfrak{p}}^{J_v, J_v'} = u_{\mathfrak{p}}^{J, J'} \cdot (u_{\mathfrak{p}}^{J, J_v'})^{\frac{\mathrm{N} v - 1}{\#{I_v}} \sigma_v^{-1} \mathrm{N} {I_v}}.$
\end{proof}

\subsection{Removing primes above $p$ from the smoothing set} \label{s:remove}

When working with modular forms in \S\ref{s:cusp}, it will be convenient if the set $\Sigma'$ does not contain any primes above $p$.  Note that any primes above $p$ in $\Sigma'$ necessarily lie in $T$ and hence are unramifed in $L/F$.
We give now the elementary argument, in the spirit of \cite{dk}*{\S4.1}, that shows that we can safely remove these primes.
Let
\[ T_p = \{\mathfrak{q} \in T \colon \mathfrak{p} \mid p\}, \qquad T_0 = T \setminus T_p, \qquad  \Sigma'_0 = \Sigma' \setminus T_p. \]

\begin{lemma} \label{l:tp}  There exists $u_\mathfrak{p}^{\Sigma, \Sigma'_0} \in U_{\mathfrak{p}, T_0}^{-} \otimes {\mathbf{Z}_p}$ such that $ \ord_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'_0}) = \Theta_{\Sigma,\Sigma'_0}^H$.  Furthermore the congruence
\begin{equation} \label{e:rec0}
 \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'_0}) \equiv \Theta_{\Sigma_\mathfrak{p}, \Sigma'_0}^L \pmod{I^2}  \end{equation}
implies the congruence  \[ \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) \equiv \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L \pmod{I^2}.
\]
\end{lemma}

\begin{proof}
For each $\mathfrak{q} \in T_p$, let $\sigma_\mathfrak{q}$ denote the associated Frobenius in $\mathfrak{g}$, and $\overline{\sigma}_\mathfrak{q}$ its image in $G$.
We have \begin{equation} \label{e:tp}
\Theta_{\Sigma,\Sigma'}^H =  \Theta_{\Sigma,\Sigma'_0}^H \prod_{\mathfrak{q} \in T_p} (1 - \overline{\sigma}_\mathfrak{q} \mathrm{N}\mathfrak{q}). \end{equation}
Each term in the product in (\ref{e:tp}) is congruent to 1 modulo $p$ and hence is invertible in $\mathbf{Z}_p[G]$.  Hence we can simply define
\[ u_\mathfrak{p}^{\Sigma, \Sigma'_0} =  \prod_{\mathfrak{p} \in T_p} (1 - \overline{\sigma}_\mathfrak{p} \mathrm{N}\mathfrak{p})^{-1} (u_\mathfrak{p}^{\Sigma, \Sigma'}). \]
The congruence (\ref{e:rec0}) then implies
\begin{align*}
 \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) & \equiv
  \Theta_{\Sigma_\mathfrak{p}, \Sigma'_0}^L  \prod_{\mathfrak{q} \in T_p} (1 - \overline{\sigma}_\mathfrak{q} \mathrm{N}\mathfrak{q}) \pmod{I^2} \\
  & \equiv \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L  \pmod{I^2}
  \end{align*}
  as desired.
\end{proof}

Applying Lemma~\ref{l:tp}, we assume for the remainder of the paper that $T$ contains no primes above $p$.
We will continue to write $T, \Sigma'$ rather than $T_0, \Sigma'_0$.

\begin{remark}  After removing the primes above $p$ from $T$, condition (\ref{e:drcond}) might no longer be satisified.  That condition was used to ensure the integrality of $\Theta_{S,T}$, which was then used to deduce the $p$-integrality of $\Theta_{\Sigma, \Sigma'}$.  As the argument in this section shows, after removing the primes above $p$ from $T$, the $p$-integrality of $\Theta_{\Sigma, \Sigma'}$ still holds.
\end{remark}

\subsection{The ring $R_{\mscr L}$} \label{s:rldef}
In \cite{ddp}, the rank one $p$-adic Gross--Stark conjecture was interpreted as the equality of an algebraic $L$-invariant ${\mscr L}_{{\mathrm{alg}}}$ and
an  analytic $L$-invariant ${\mscr L}_{{\mathrm{an}}}$.  The analytic ${\mscr L}$-invariant is the ratio of the leading term of the $p$-adic $L$-function at $s=0$ to its classical counterpart: \begin{equation} \label{e:lan}
 {\mscr L}_{{\mathrm{an}}} = -\frac{L_p'(\chi\omega, 0)}{L(\chi, 0)}. \end{equation}
   The algebraic $L$-invariant is the ratio of the $p$-adic logarithm and valuation of the $\chi^{-1}$-component of the Brumer--Stark unit:
   \begin{equation} \label{e:lalg}
    {\mscr L}_{{\mathrm{alg}}} = \frac{\log_p \Norm_{H_{\mathfrak{P}}/\mathbf{Q}_p}(u_\mathfrak{p}^{\chi^{-1}}) }{ \ord_\mathfrak{P}(u_\mathfrak{p}^{\chi^{-1}})}.
    \end{equation}

Here and throughout the paper, $\log_p$ denotes the $p$-adic logarithm following Iwasawa's convention $\log_p(p)=0$.
There is no difficulty in defining the ratios (\ref{e:lan}) and (\ref{e:lalg}), since the quantities live in a $p$-adic field and the denominators are non-zero.  The analog of this situation in our present context is more delicate.  As above, let $I$ denote the kernel of the projection
\[
\begin{tikzcd}
R = \mathbf{Z}_p[\mathfrak{g}]^- \ar[r] &  \overline{R} = \mathbf{Z}_p[G]^-.
\end{tikzcd}
\]
The role of the $p$-adic $L$-function is played by the Stickelberger element
$\Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L \in R$, and the analogue of the derivative at 0 is played by the image of $\Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L$ in $I/I^2$.  The role of the classical $L$-function is played by the element $\Theta_{\Sigma, \Sigma'}^H \in \overline{R}$.  It is therefore not clear how to take the ``ratio" of these quantities.  Similarly, the role of the $p$-adic logarithm is played by $\rec_G(u_{\mathfrak{p}}^{\Sigma,\Sigma'}) \in I/I^2$ and the role of the $p$-adic valuation is played by $\ord_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) \in \overline{R}$.

For this reason, we introduce an $R$-algebra $R_{\mscr L}$ that is generated by an element ${\mscr L}$ that plays the role of the analytic
${\mscr L}$-invariant, i.e. the ``ratio" between
\[
\Theta_L = \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L \qquad \text{and} \qquad \Theta_H = \Theta_{\Sigma, \Sigma'}^H.
\]
We define
\begin{equation} \label{e:rldef}
 R_{\mscr L} = R[{\mscr L}] / (\Theta_H {\mscr L} - \Theta_L, {\mscr L} I, {\mscr L}^2, I^2).
 \end{equation}
 A key point is that this ring, in which we have adjoined a ratio ${\mscr L}$ between $\Theta_L$ and $\Theta_H$, is still large enough to see  $R/I^2$.

 \begin{theorem} The kernel of the structure map $R \longrightarrow R_{{\mscr L}}$ is $I^2$. \label{t:ws}
\end{theorem}

Before proving the theorem we establish some intermediate results that are important in their own right.

\begin{theorem} \label{t:gorder} For each prime $v$, let \[ \begin{tikzcd}
I(v) = \ker(R \ar[r] & \mathbf{Z}_p[\mathfrak{g}/\mathfrak{g}_v]^-). \end{tikzcd} \]  We have \[ \Theta_L \in \prod_{v \in \Sigma_\mathfrak{p}} I(v). \]
\end{theorem}

The proof of Theorem~\ref{t:gorder} uses the Ritter--Weiss modules that will be recalled in the next section.  For this reason we postpone the proof until that point.

\begin{lemma}  Suppose that $r \in R$ satisfies $\overline{r} \Theta_H = 0$ in $\overline{R}$.  Then $r \Theta_L \in I^2$. \label{l:rtt}
\end{lemma}
\begin{proof}  Let \[ e_1 = \ \ \ \ \ \  \sum_{\mathclap{L_{\Sigma, \Sigma'}(H/F, \chi, 0) =0}} \ e_\chi \] denote the idempotent of $\Frac(\overline{R})$ corresponding to the set of odd characters of $G$ at which $\Theta_H$ has a trivial zero.  Let $e_2 = 1 - e_1$ the denote the idempotent corresponding to the set of other odd  characters of $G$.
Let $I_\Gamma$ denote the (absolute) augmentation ideal of $\mathbf{Z}_p[\Gamma]$.
Our goal is to prove that the image of $r \Theta_L$ in \[ I/I^2 \cong \overline{R}  \otimes I_\Gamma/I_\Gamma^2 \] vanishes
(see \cite{pcmi}*{5.2.3(b)} for this isomorphism).  Now $\overline{r} \Theta_H = 0$ implies that $\overline{r}e_2 =0$.

 Let
$\Upsilon$ denote the kernel of the projection $\overline{R} \longrightarrow \overline{R}e_1$.  We have a short exact sequence
\begin{equation} \label{e:e1s}
\begin{tikzcd}
\Upsilon \otimes I_\Gamma/I_\Gamma^2 \ar[r, "\varpi"] & \overline{R}  \otimes I_\Gamma/I_\Gamma^2 \ar[r,"e_{1}"] &  \overline{R} e_1  \otimes I_\Gamma/I_\Gamma^2 \ar[r] & 0. \end{tikzcd}
\end{equation}
We claim that the image of $\Theta_L$ under the map denoted $e_{1}$ in (\ref{e:e1s}) vanishes.  Granting this claim for now, let us finish the proof.  The claim implies that $\Theta_L$ lies in the image of $\Upsilon \otimes I_\Gamma / I_\Gamma^2$ under the map $\varpi$ in (\ref{e:e1s}).  But $\overline{r}e_2 = 0$ implies that $\overline{r}$ annihilates $\Upsilon$.  It follows that $\overline{r} \Theta_L$ vanishes in $I/I^2$ as desired.

We now prove the claim, which states that $ \Theta_Le_1$ vanishes in $\overline{R}e_1  \otimes I_\Gamma/I_\Gamma^2$.
By Theorem~\ref{t:gorder}, we have that $\Theta_L \in \prod_{v \in \Sigma_\mathfrak{p}} I(v)$.  Now $\mathfrak{g}_\mathfrak{p} \subset \Gamma$, so $I(\mathfrak{p}) \subset I$.   We may therefore write $\Theta_L$ as a sum of elements of the form $y z$ where $y \in \prod_{v \in \Sigma} I(v)$ and $z \in I$.  Now if $y \in \prod_{v \in \Sigma} I(v)$ and $\overline{y}$ denotes the image of $y$ in $\overline{R}$, then $e_1 \overline{y} = 0$.  Indeed, it suffices to check this character by character: for an odd $\chi \in \hat{G},$ we have  $\chi(e_1) =0$ if $\chi(G_v) \neq 1$ for all $v \in \Sigma$, whereas $\chi(\overline{y}) = 0$ if
$\chi(G_v) = 1$ for some $v \in \Sigma$.  It follows that if $z \in I$, then $e_1(y z)$ vanishes in
$\overline{R}e_1  \otimes I_\Gamma/I_\Gamma^2$.  The desired result for $\Theta_Le_1$ follows.
\end{proof}

We can now establish the injectivity of the map $R/I^2 \longrightarrow R_{{\mscr L}}$.

\begin{proof}[Proof of Theorem~\ref{t:ws}] If the image of $a \in R$ in the polynomial ring $R[x]$ belongs to the ideal generated by $\Theta_Hx - \Theta_L, x^2, xI, I^2$, then considering the constant term implies that $a + \Theta_L r \in I^2$ for some $r \in R$. Considering the linear term implies that $\overline{r} \Theta_H = 0$ in $\overline{R}$, where $\overline{r}$ denotes the image of $r$ in $\overline{R}$.  It then follows from Lemma~\ref{l:rtt} that $a \in I^2$, as desired.
\end{proof}

In view of Theorem \ref{t:ws},
the integral Gross--Stark conjecture can be reinterpreted as an equation between algebraic and analytic ${\mscr L}$-invariants in the ring $R_{\mscr L}$.  We will show
\begin{equation}
 \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'})  = {\mscr L} \ord_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) \text{ in } R_{{\mscr L}}. \label{e:linv} \end{equation}
Since the modified Brumer--Stark unit satsifies $\ord_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) = \Theta_H$, the right side of (\ref{e:linv}) equals $\Theta_L$. The equality $\rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'})  = \Theta_L$ in $R_{{\mscr L}}$ then gives the desired congruence
$\rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'})  \equiv \Theta_L \pmod{I^2}$ in $R$ by the injectivity of $R/I^2 \longrightarrow R_{{\mscr L}}$.

\section{Generalized Ritter--Weiss modules} \label{s:rw}

The Galois modules introduced by Ritter and Weiss to give generalized Tate sequences play a central role in this work. Before delving into the details, we give a road map for \S\ref{s:rwdef}--\S\ref{s:gcfi}.
In  \S\ref{s:rwdef}, we recall the definition of the Ritter--Weiss module $\nabla_{\Sigma}^{\Sigma'}$, following the construction of \cite{dk} that incorporates the smoothing set $\Sigma'$.  To maintain maximal generality, we work over $\mathbf{Z}[\mathfrak{g}]$ rather than over $R =\mathbf{Z}_p[\mathfrak{g}]^-$.  In \S\ref{s:gc} we give an interpretation of $\nabla_{\Sigma}^{\Sigma'}$ in terms of Galois cohomology.  In \S\ref{s:nablal} we define a module $\nabla_{\!{\mscr L}}$ over the ring $R_{{\mscr L}}$ that incorporates the analytic ${\mscr L}$-invariant. In \S\ref{s:gcfi} we interpret the $p$-part of Gross's conjecture as the statement that the Fitting ideal of $\nabla_{\!{\mscr L}}$ over $R_{{\mscr L}}$ vanishes.
\subsection{Definition} \label{s:rwdef}

We recall the definition of $\nabla_{\Sigma}^{\Sigma'}$ from \cite{dk}*{\S A}.
We begin by choosing an auxiliary finite set of primes $S'$ of $F$ that contains $\Sigma_\mathfrak{p}$ and is disjoint from $\Sigma'$. Note that the places in $S' - \Sigma_\mathfrak{p}$ are unramified in $L$.
We furthermore assume that $S'$ is large enough so that $\Cl_{S'}^{\Sigma'}(L) = 1$, $\Cl_{S'}^{\Sigma'}(H) = 1$, and such that the union of the decomposition groups
$\mathfrak{g}_v \subset \mathfrak{g}$ for $v \in S'$ is all of $\mathfrak{g}$.  The construction of $\nabla$ is  independent of the chosen auxiliary set $S'$ (see \cite{dk}*{\S A.2}).

For each place $v$ of $F$, we fix a place $w$ of $L$ above $v$.
  Ritter--Weiss \cite{rw} define $\mathbf{Z}[\mathfrak{g}]$-modules $V_w(L)$ and $W_w(L)$ sitting in  exact sequences:
\begin{equation} \label{e:rwvwdef}
\begin{tikzcd}[row sep=tiny]
 1 \ar[r] &   L_w^* \ar[r] &  V_w(L) \ar[r] & \Delta \mathfrak{g}_v \ar[r] & 1  \\
  1 \ar[r] &   \mathcal{O}_{w}^* \ar[r] & V_w(L) \ar[r] &  W_w(L) \ar[r] &1.
 \end{tikzcd}
\end{equation}
 Here $\mathcal{O}_{w}$ denotes the completion of $\mathcal{O}_L$ at $w$.
Let $U_{w} \subset \mathcal{O}_{w}^*$ denote the subgroup of 1-units.

The modules $V_w(L)$ and $W_w(L)$ are defined as follows.   Let $L_w^{\text{ab}} \supset L_w^{\nr}$ denote the maximal abelian and unramified extensions of $L_w$, respectively.
There  are canonical short exact sequences
\[
\begin{tikzcd}[row sep=tiny]
1  \ar[r] & \WD(L_w^{\text{ab}}/L_w) \cong L_w^*  \ar[r] & \WD(L_w^{\text{ab}}/F_v)  \ar[r,"\pi_V"] & \mathfrak{g}_v  \ar[r] & 1 \\
1  \ar[r] & \WD(L_w^{\nr}/L_w) \cong \mathbf{Z}  \ar[r] & \WD(L_w^{\nr}/F_v)  \ar[r,"\pi_W"] & \mathfrak{g}_v  \ar[r] & 1,
 \end{tikzcd}
\]
where $\WD$ denotes the Weil group.
 Let $I_V$ denote the (absolute) augmentation ideal of $\WD(L_w^{\text{ab}}/F_v)$, and let
$I_{\pi_V}$ denote the relative augmentation ideal corresponding to $\pi_V$.   Define $I_W$ and $I_{\pi_W}$ similarly
from the corresponding terms in the second exact sequence above.
Then \begin{equation} \label{e:vandw}
 V_w(L) = I_V / I_V I_{\pi_V}, \qquad W_w(L) = I_W / I_W I_{\pi_W}. \end{equation}

Following \cite{greither}, given a collection of $\mathfrak{g}_v$-modules $M_w$,
we write   \[ \prod_{v}^\sim M_w = \prod_{v} \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} M_w. \]
Define \[
V = \prod_{v \in S'}^\sim V_w(L) \prod_{v \in \Sigma'}^{\sim} U_{w}
 \prod_{v \not\in S' \cup \Sigma'}^{\sim} \mathcal{O}_{w}^*. \]
 Let \begin{align*}
 J_\Sigma &=  \prod_{v \not\in \Sigma  \cup \Sigma'}^{\sim} \mathcal{O}_{w}^* \prod_{v \in \Sigma}^{\sim} L_w^* \prod_{v \in \Sigma'}^{\sim} U_{w},
   & J_{\Sigma_\mathfrak{p}} & =  \prod_{v \not\in \Sigma_\mathfrak{p}  \cup \Sigma'}^{\sim} \mathcal{O}_{w}^* \prod_{v \in \Sigma_\mathfrak{p}}^{\sim} L_w^* \prod_{v \in \Sigma'}^{\sim} U_{w},
 \\
  W_\Sigma &= \prod_{v \in S' - \Sigma}^{\sim}  W_{w}(L)  \prod_{v \in \Sigma}^{\sim} \Delta \mathfrak{g}_v,
   &  W_{\Sigma_\mathfrak{p}} & =  \prod_{v \in S' - \Sigma_\mathfrak{p}}^{\sim}  W_{w}(L)  \prod_{v \in \Sigma_\mathfrak{p}}^{\sim} \Delta \mathfrak{g}_v.
 \end{align*}

Note that we do not adorn $V$ with a subscript because it does not depend on the choice of $\Sigma$ versus $\Sigma_\mathfrak{p}$.  The fact that the same module $V$ is used in both constructions will be of great importance.

For each set ${\Sigma_{*}} = \Sigma$ or $\Sigma_\mathfrak{p}$, we have a commutative diagram
\begin{equation}  \label{e:rwdiagram}
\begin{gathered}
\begin{tikzcd}
1 \ar[r] & J_{\Sigma_{*}} \ar[r]  \ar[d,"\theta_J"] & V  \ar[r] \ar[d,"\theta"] & W_{\Sigma_{*}}  \ar[r] \ar[d,"\theta_W"] & 1 \\
1 \ar[r] & C_L  \ar[r] & \mathfrak{O}  \ar[r] & \Delta \mathfrak{g}  \ar[r] & 1.
\end{tikzcd}
\end{gathered}
\end{equation}
Here $C_L = \mathbf{A}_L/L^*$ denotes the id\`ele class group of $L$, and $\mathfrak{O}$ denotes the extension of $\Delta \mathfrak{g}$ by $C_L$ associated to the global fundamental class in $H^2(\mathfrak{g}, C_L)$ (see \cite{rw}).
By \cite{dk}*{Lemma A.1}, the map $\theta$ is surjective.
We therefore get a short exact sequence
\begin{equation} \label{e:snake}
\begin{tikzcd}
 0 \ar[r] & \mathcal{O}_{L, {\Sigma_{*}}, \Sigma'}^* \ar[r] & V^\theta \ar[r] & W_{\Sigma_{*}}^\theta \ar[r] & \Cl_{{\Sigma_{*}}}^{\Sigma'}(L) \ar[r] & 0,
 \end{tikzcd}
 \end{equation}
where $V^\theta$ denotes the kernel of $\theta$ and $W_{{\Sigma_{*}}}^{\theta}$ denotes the kernel of $\theta_W$.
Next we define

\[ B_\Sigma =  (\mathbf{Z}[\mathfrak{g}] \oplus \mathbf{Z}[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}]) \oplus \prod_{v \in S' - \{\mathfrak{p}\}} \mathbf{Z}[\mathfrak{g}], \qquad \qquad B_{\Sigma_\mathfrak{p}} =  \prod_{v \in S'} \mathbf{Z}[\mathfrak{g}].  \]
In $B_\Sigma$, the first term $\mathbf{Z}[\mathfrak{g}] \oplus \mathbf{Z}[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}]$  will be referred to as the component at $\mathfrak{p}$.

There are injective maps $j_{\Sigma_{*}} \colon W_{\Sigma_{*}} \longrightarrow B_{\Sigma_{*}} $ that we now describe on each component.
\begin{itemize}
\item Each $v \in S' - \Sigma_\mathfrak{p}$ is unramified in $L$, so we have $W_w(L) \cong \mathbf{Z}[\mathfrak{g}_v]$ (see \cite{rw}*{Lemma 5}).
If $\sigma_v \in \WD(L_w^{\nr}/F_v)$ is the Frobenius element, this isomorphism sends the image of $\sigma_v - 1 \in I_W$ to 1.
We then have  $\Ind_{\mathfrak{g}_v}^{\mathfrak{g}} W_w(L) \cong \mathbf{Z}[\mathfrak{g}]$.  The component of $j_{\Sigma_{*}}$ at $v \in S' - \Sigma_\mathfrak{p}$ is this isomorphism.

\item For $v \in {\Sigma_{*}}$, the inclusion $\Delta \mathfrak{g}_v \subset \mathbf{Z}[\mathfrak{g}_v]$ induces $\Ind_{\mathfrak{g}_v}^{\mathfrak{g}} \Delta {\mathfrak{g}_v} \subset \mathbf{Z}[\mathfrak{g}]$.
The component of $j_{\Sigma_{*}}$ at $v \in {\Sigma_{*}}$  is  this inclusion.

\item To conclude we define, for $w$ the chosen place of $L$ above $\mathfrak{p}$, a map
\begin{equation} \label{e:wpl}
\xymatrix{ j_\mathfrak{p} \colon \Ind_{\mathfrak{g}_\mathfrak{p}}^{\mathfrak{g}} W_w(L) \ar[r] & \mathbf{Z}[\mathfrak{g}] \oplus \mathbf{Z}[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}] } \end{equation}
giving the component of $j_{\Sigma}$ at $\mathfrak{p}$. Consider the composition \begin{equation} \label{e:ordp}
\begin{tikzcd}
 \WD(\overline{F}_\mathfrak{p}/F_\mathfrak{p}) \ar[r] & \WD(F^{\text{ab}}_\mathfrak{p}/F_\mathfrak{p}) \cong F_\mathfrak{p}^* \ar[r,"\ord_\mathfrak{p}"] & \mathbf{Z},
 \end{tikzcd}
 \end{equation}
which we simply denote $\ord_\mathfrak{p}$.  Clearly $\ord_\mathfrak{p}$ factors through $\WD(L_w^{\nr}/F_\mathfrak{p})$.  We then define
\[ \begin{tikzcd}
 W_w(L) \ar[r] &   \mathbf{Z}[\mathfrak{g}_\mathfrak{p}] \oplus \mathbf{Z}
 \end{tikzcd} \]
by
\begin{equation} \label{e:jpdef}
  \sigma -1 \mapsto (  \sigma|_{L_w} -1, \ord_{\mathfrak{p}}(\sigma)), \qquad \sigma \in\WD(L_w^{\nr}/F_\mathfrak{p}).
  \end{equation}
Inducing this map from $\mathfrak{g}_\mathfrak{p}$ to $\mathfrak{g}$ yields the desired map $j_\mathfrak{p}$.
\end{itemize}

The fact that $j_\mathfrak{p}$ is an injection follows from \cite{rw}*{Lemma 5(b)}.
Let $Y_\mathfrak{p}$ denote the cokernel of $j_\mathfrak{p}$.
Let \[ Y_{\Sigma} =  Y_\mathfrak{p} \prod_{v \in \Sigma} \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} \mathbf{Z}, \qquad Y_{\Sigma_\mathfrak{p}} = \prod_{v \in \Sigma_\mathfrak{p}} \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} \mathbf{Z}. \]
For each ${\Sigma_{*}} = \Sigma$ or $\Sigma_\mathfrak{p}$ we have a commutative diagram with   exact rows:
\begin{equation}  \label{e:wbdiagram}
\begin{gathered}
\begin{tikzcd}
0 \ar[r] & W_{\Sigma_{*}} \ar[r]  \ar[d,"\theta_W"] & B_{\Sigma_{*}} \ar[r] \ar[d,"\theta_B"] & Y_{\Sigma_{*}} \ar[r] \ar[d,"\theta_Y"] & 0 \\
0 \ar[r] & \Delta \mathfrak{g}  \ar[r] & \mathbf{Z}[\mathfrak{g}] \ar[r] & \mathbf{Z} \ar[r] & 0.
\end{tikzcd}
\end{gathered}
\end{equation}
The map $\theta_B$ is defined as follows:
\begin{itemize}
\item $\theta_B$ is the identity in the factors corresponding to $v \in \Sigma_*$.
\item $\theta_B$ is multiplication by $\sigma_v - 1$ (where $\sigma_v \in G_v \subset G$ denotes Frobenius at $v$) in the factors corresponding to $v \in S' - \Sigma$ (see \cite{rw}*{Lemma 5}).
\item For $v = \mathfrak{p}$ and ${\Sigma_{*}} = \Sigma$, the map $\theta_B$ on the component at $\mathfrak{p}$ is  projection
onto the first factor.
\end{itemize}
Since $\theta_W$ is surjective, taking kernels in (\ref{e:wbdiagram}) yields a short exact sequence
\begin{equation} \label{e:wbx}
\begin{tikzcd}
 0 \ar[r] & W^\theta_{\Sigma_{*}}  \ar[r] & B^\theta_{\Sigma_{*}}  \ar[r] & Y^\theta_{\Sigma_{*}}  \ar[r] & 0.
 \end{tikzcd}
 \end{equation}
Note that $B^\theta_\Sigma \cong \mathbf{Z}[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}] \oplus \mathbf{Z}[\mathfrak{g}]^{\#S'-1} $ and $B_{\Sigma_\mathfrak{p}}^\theta \cong \mathbf{Z}[\mathfrak{g}]^{\#S' - 1}$.  We define
\begin{equation} \begin{tikzcd}
\tilde{\nabla}_{{\Sigma_{*}}}^{\Sigma'}(L) = \coker(f_{{\Sigma_{*}}} \colon V^\theta \ar[r] &  W^\theta_{{\Sigma_{*}}} \ar[r] & B^\theta_{\Sigma_{*}}).
\end{tikzcd} \label{e:fsigmadef}
\end{equation}
When ${\Sigma_{*}} = \Sigma_\mathfrak{p}$, the module $\tilde{\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ is the same as the module
$\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$  defined in \cite{dk}, and when we speak of it individually we will use the latter notation.  However for ${\Sigma_{*}} = \Sigma$,
the module $\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)$ is a subquotient of the module  ${\nabla}_{\Sigma}^{\Sigma'}(L)$ defined in {\em loc.\,cit.}.  We have introduced the $\tilde{\nabla}$ notation so as to not conflict with the notation of {\em loc.\,cit.}, and so that we may speak of ${\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ and
$\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)$ simultaneously when convenient, using the symbol $\tilde{\nabla}_{{\Sigma_{*}}}^{\Sigma'}(L)$.

In view of (\ref{e:snake}) and (\ref{e:wbx}), we have two exact sequences:
\begin{equation} \label{e:tate}
\begin{tikzcd}
  0   \ar[r] & \mathcal{O}_{L, {\Sigma_{*}}, \Sigma'}^*  \ar[r] & V^\theta  \ar[r] & B^\theta_{\Sigma_{*}}  \ar[r] & \tilde{\nabla}_{{\Sigma_{*}}}^{\Sigma'}(L)  \ar[r] & 0,
  \end{tikzcd}
 \end{equation}
\begin{equation} \label{e:seltr}
\begin{tikzcd}
0  \ar[r] & \Cl_{\Sigma_{*}}^{\Sigma'}(L)  \ar[r] & \tilde{\nabla}_{{\Sigma_{*}}}^{\Sigma'}(L)  \ar[r] & Y^\theta_{\Sigma_{*}}  \ar[r] & 0.
\end{tikzcd}
\end{equation}

In \cite{dk} we proved the following results.  Write
\[ (V^\theta)_R = (V^\theta) \otimes_{\mathbf{Z}[\mathfrak{g}]} R, \]
and similarly with $V^\theta$ replaced by any other $\mathbf{Z}[\mathfrak{g}]$-module.

\begin{lemma}[\cite{dk}*{Lemma A.4}]  \label{l:qp}
The module $(V^\theta)_R$ is free over $R$ of rank equal to the rank of the free module $B_{\Sigma_\mathfrak{p}}^\theta$, namely $\#S' - 1$.  Hence the module
${\nabla}_{\Sigma_{\mathfrak{p}}}^{\Sigma'}(L)_R$ is quadratically presented over $R$.
\end{lemma}

\begin{theorem}[\cite{dk}*{Theorem 3.3}]   \label{t:dkresult} We have \begin{equation} \label{e:ftheta}
   \Fitt_{R}(\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)_R) = (\Theta^L_{\Sigma_\mathfrak{p}, \Sigma'}). \end{equation}
\end{theorem}

We can now give the proof of Theorem~\ref{t:gorder}.
\begin{proof}[Proof of Theorem~\ref{t:gorder}]

If we denote by $\{e_v\colon v \in S' \}$ the standard $R$-basis for \[ (B_{\Sigma_\mathfrak{p}})_R = \prod_{v \in S'} R, \]
then the module $(B_{\Sigma_\mathfrak{p}}^\theta)_R$ has a basis \[ \{b_v = e_v - \theta_B(e_v)e_\infty : v \in S' \setminus \infty\} \] where $\infty \in S_\infty \subset S'$ is any fixed infinite place of $F$.
By Lemma~\ref{l:qp}, the $R$-module $V^\theta_R$ is free of rank $\#S'-1$, and hence
$  \Fitt_{R}(\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)_R)$ is the ideal generated by the determinant of the square matrix $A$
representing the map $f\colon V^\theta_R \longrightarrow (B_{\Sigma_\mathfrak{p}}^\theta)_R$ with respect to any bases.

We choose any basis of $V^\theta_R$ and the basis $\{b_v \colon v \in S', v \neq \infty\}$ for
$(B_{\Sigma_\mathfrak{p}}^\theta)_R$.
  The columns of the associated matrix $A$ are indexed by the basis vectors $b_v$.  For $v \in \Sigma_\mathfrak{p}$, the elements of the corresponding column vector lie, by definition, in the image of $\Ind_{\mathfrak{g}_v}^{\mathfrak{g}} \Delta \mathfrak{g}_v \longrightarrow R$.
  This is exactly the ideal $I(v) = \ker(R \longrightarrow \mathbf{Z}_p[\mathfrak{g}/\mathfrak{g}_v]^-)$.  The determinant of $A$ therefore lies in $\prod_{v \in \Sigma_\mathfrak{p}} I(v)$.  In view of (\ref{e:ftheta}), the result follows.
\end{proof}

\subsection{Interpretation via Galois Cohomology} \label{s:gc}

In \cite{dk}*{\S A.3}, we gave a description of the projection to the minus side of the class in $\Ext_{\mathbf{Z}[G]}^1( Y_{\Sigma_\mathfrak{p}}^\theta, \Cl_{\Sigma_\mathfrak{p}}^{\Sigma'}(L) )$ determined by ${\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ via the exact sequence (\ref{e:seltr}), using  Galois cohomology.  We recall this now and give the generalization that allows for the application to $\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)$.

For each $v \in S'$, let
 \[ G_{F, v} \cong {\rm Gal}(\overline{F}_v/F_v) \subset G_F\] denote the decomposition group at $v$ associated to a place of $\overline{F}$ above $v$ restricting to the chosen place $w$ of $L$.  Let $M$ be a $\mathfrak{g}$-module.
Suppose that we are given a 1-cocycle \[ \kappa \in Z^1(G_{F}, M), \]
where $M$ is endowed with a $G_{F}$-action via the canonical map $G_F \relbar\joinrel\twoheadrightarrow \mathfrak{g}.$ Suppose  that the restriction of $\kappa$ to ${\rm Gal}(\overline{F}_v/L_w^{\nr})$ is trivial.  We may then define a $\mathfrak{g}$-module homomorphism
\[ \begin{tikzcd}
 \varphi_{\kappa}^v \colon W_v^- = (\Ind_{\mathfrak{g}_v}^{\mathfrak{g}} W_w(L))^- \ar[r] & M
 \end{tikzcd} \]
by the rule \begin{equation} \label{e:phidef}
 \varphi_{\kappa}^v(g \otimes (\sigma - 1)) = g \cdot \kappa(\sigma), \qquad g \in G, \ \ \sigma \in \WD(L_w^{\nr}/F_v).
 \end{equation}
The condition on $\kappa$ ensures that $\kappa(\sigma)$ is well-defined  for $\sigma \in \WD(L_w^{\nr}/F_v)$.  It is elementary to check that $\varphi_{\kappa}^v$ is well-defined, as follows.
\begin{itemize}
\item If $g \in \mathfrak{g}_v$, then
\[ \varphi_{\kappa}^v(1 \otimes(g\sigma - g)) = \kappa(g \sigma) - \kappa(g) = g \cdot \kappa(\sigma) = \varphi_{\kappa}^v(g \otimes (\sigma - 1)). \]
\item If $\sigma \in \WD(L_w^{\nr}/F_v)$ and $\tau \in \WD(L_w^{\nr}/L_w)$, then
\[ \varphi_{\kappa}^v(1 \otimes (\tau-1)(\sigma-1)) = \kappa( \tau\sigma) - \kappa(\tau) -\kappa(\sigma)  = 0 \]
since $\tau$ acts trivially on $M$.
\end{itemize}

Write $Z_v = \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} \Delta \mathfrak{g}_v$.  Since $\Delta \mathfrak{g}_v$ is canonically a $\mathfrak{g}_v$-module quotient of $W_w(L)$ (see (\ref{e:rwvwdef})), $Z_v^-$ is canonically a $\mathfrak{g}$-module quotient of $W_v^-$.
If  the restriction of $[\kappa]$ to ${\rm Gal}(\overline{F}_v/L_w)$ is trivial, then $\varphi_\kappa^v$ descends to a homomorphism
\begin{equation} \label{e:phiz}
\begin{tikzcd}
\varphi_{\kappa}^v \colon Z_v^-  \ar[r] & M.
\end{tikzcd}
 \end{equation}

 Now let $M_{\Sigma_{*}} = \Cl_{{\Sigma_{*}}}^{\Sigma'}(L)^-$ for ${\Sigma_{*}} = \Sigma$ or ${\Sigma_{*}} = \Sigma_\mathfrak{p}$.  By class field theory, we may view $M_{\Sigma_{*}}$ as the Galois group of a field extension $\tilde{L}_{\Sigma_{*}}/L$.  The field $\tilde{L}_{\Sigma_{*}}$ is the maximal abelian extension of $L$ of odd order that is unramified outside $\Sigma'$, tamely ramified at $\Sigma'$, such that the primes in ${\Sigma_{*}}$ split completely, and such that the conjugation action of the complex conjugation in $\mathfrak{g}$ is inversion.
Let \[ \xymatrix{ \tilde{\lambda}_{\Sigma_{*}} \colon G_L \ar[r] & {\rm Gal}(\tilde{L}_{{\Sigma_{*}}}/L) \cong M_{\Sigma_{*}}}  \] denote the canonical homomorphism given by the reciprocity map of class field theory.
By \cite{dk}*{Lemma 6.3}, the class $\tilde{\lambda}_{\Sigma_{*}} \in H^1(G_L, M_{\Sigma_{*}})$ is the restriction of a unique class
 \[ [\lambda_{\Sigma_{*}}] \in H^1(G_F, M_{\Sigma_{*}}).\]  An explicit 1-coycle representing this class is given as follows.  Let $\tilde{c}$ denote a lift of the complex conjugation $c \in \mathfrak{g}$ to an element of $\tilde{\mathfrak{g}} = {\rm Gal}(\tilde{L}_{\Sigma_{*}}/F)$.  Then
\begin{equation} \label{e:lambdadef}
 \lambda_{\Sigma_{*}}(\tilde{\sigma}) = \tilde{\lambda}_{\Sigma_{*}}(\tilde{\sigma}\tilde{c} \tilde{\sigma}^{-1} \tilde{c}^{-1})^{1/2}, \qquad \tilde{\sigma} \in G_F.
 \end{equation}

Note that the cocycle $\lambda_{{\Sigma_{*}}} \in Z^1(G_{F}, M_{\Sigma_{*}})$ satisfies the condition described above for $\kappa,$ namely that the restriction to
${\rm Gal}(\overline{F}_v/L_w^{\nr})$ is trivial for each $v \in S'$.  This follows since $\tilde{L}_{\Sigma_{*}} \subset L_w^{\nr}$.
Furthermore if $v \in {\Sigma_{*}}$, then the restriction of  $\lambda_{{\Sigma_{*}}} $ to ${\rm Gal}(\overline{F}_v/L_w)$ is trivial.
Therefore the construction in (\ref{e:phidef}) and (\ref{e:phiz}) yields  elements:
\begin{align*}
 \varphi_{\lambda_{{\Sigma_{*}}}}^{v} & \in \Hom_{\mathbf{Z}[\mathfrak{g}]^-}(W_v^-, M_\Sigma), \qquad v \in S' - {\Sigma_{*}}, \\
 \varphi_{\lambda_{{\Sigma_{*}}}}^v & \in \Hom_{\mathbf{Z}[\mathfrak{g}]^-}(Z_v^-, M_{\Sigma_{*}}), \qquad v \in {\Sigma_{*}}.
\end{align*}

\begin{lemma}  \label{l:gtd}  The ``snake map" $\varphi_{\Sigma_{*}} \colon (W_{\Sigma_{*}}^\theta)^- \longrightarrow M_{\Sigma_{*}}$ given by the minus part of the last nontrivial arrow in $(\ref{e:snake})$ can be described explicitly by the formula
\[ \varphi_{\Sigma_{*}}((a_v)_{v \in S'}) = \sum_{v \in S'} \varphi_{\lambda_{\Sigma_{*}}}^v(a_v). \]
\end{lemma}

\begin{proof}  The proof is nearly identical to \cite{dk}*{Lemma A.3}, but we give it for completeness and because of notational differences.
We use the description of the snake map given by Ritter and Weiss in \cite{rw}*{Theorem 5}.
Write $\tilde{\mathfrak{g}} = {\rm Gal}(\tilde{L}/F)$, where as above $\tilde{L}$ is the extension of $L$ corresponding to $M_\Sigma$ via class field theory.
Write $\Delta \tilde{\mathfrak{g}}$ for the augmentation ideal of $\mathbf{Z}[\tilde{\mathfrak{g}}]$ and let $\Delta(\tilde{\mathfrak{g}}, M_\Sigma)$ denote the kernel of the canonical projection
$\mathbf{Z}[\tilde{\mathfrak{g}}] \longrightarrow \mathbf{Z}[\mathfrak{g}]$.  There is a short exact sequence (see \cite{rw}*{Pg.\ 154})
\begin{equation} \label{e:rw}
\begin{tikzcd}
0  \ar[r] & M_\Sigma \cong   \dfrac{\Delta(\tilde{\mathfrak{g}},M_\Sigma)}{\Delta(\tilde{\mathfrak{g}}, M_\Sigma) \Delta\tilde{\mathfrak{g}}}
 \ar[r] &  \dfrac{\Delta\tilde{\mathfrak{g}}}{\Delta(\tilde{\mathfrak{g}}, M_\Sigma) \Delta\tilde{\mathfrak{g}}}  \ar[r] & \Delta \mathfrak{g} \ar[r] & 0.
 \end{tikzcd}
 \end{equation}

Let $v \in {\Sigma_{*}}$. The extension $\tilde{L}$ is unramifed at $w$ and there is a canonical restriction map $\WD(L_w^{\nr}/F_v) \longrightarrow \tilde{\mathfrak{g}}.$  In view of the definition of $W_w(L)$, this induces a canonical map
\[ \begin{tikzcd} \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} W_w(L)  \ar[r,"f_v"] &  \dfrac{\Delta\tilde{\mathfrak{g}}}{\Delta(\tilde{\mathfrak{g}}, M_\Sigma) \Delta\tilde{\mathfrak{g}}}.
\end{tikzcd} \]

Now let $v \in S' - {\Sigma_{*}}$.  The extension $\tilde{L}/F$ is unramifed at $v$, and we let $\sigma_v$ be the associated Frobenius element.
Then the map $x \mapsto x \cdot (\sigma_v - 1)$ induces a canonical map
\[ \begin{tikzcd}
 \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} \Delta \mathfrak{g}_v \ar[r,"f_v"] & \dfrac{\Delta\tilde{\mathfrak{g}}}{\Delta(\tilde{\mathfrak{g}}, M_\Sigma) \Delta\tilde{\mathfrak{g}}}
 \end{tikzcd}. \]
Ritter--Weiss show that the snake map is realized by \begin{equation} \label{e:rwform}
 \varphi_{\Sigma_{*}}((a_v)_{v \in S'}) = \sum_{v \in S'} f_v(a_v). \end{equation}

Let $a = (a_v)_{v \in S'} \in (W_{\Sigma_{*}}^\theta)^-$.   Choose $v' \in S'$ such that the Frobenius at $v'$ in $\mathfrak{g}$ is equal to the complex conjugation $c$.\footnote{It is permissible to expand $S'$ in order to ensure that such a $v'$ exists, but this is in fact unecessary and only provides a notational simplification here. All that is needed is that $c \in \mathfrak{g}_{v'},$ and the existence of such a $v'$ is guaranteed by the assumptions on $S'$.}  For each $v \in S'$, define $y_v \in W_{\Sigma_{*}}^-$ to have component at $v$ equal to $a_v$, component at $v'$ equal to
$\theta_W(a_v)/2 \in \mathbf{Z}[\mathfrak{g}]^-$, and all other components equal to 0.  Then $a = \sum_{v \in S'} y_v$ since $\theta_W(a) = 0$. Furthermore  each $y_v$ lies in $(W_{\Sigma_{*}}^\theta)^-$ since the component of $\theta_W$ at $v'$ is multiplication by  $c - 1 = -2$ in $\mathbf{Z}[\mathfrak{g}]^-$.
It therefore suffices to prove that $\varphi_{\Sigma_{*}}(y_v) =  \varphi_{\lambda_{\Sigma_{*}}}^v(a_v)$ for each $v \in S'$.  For this, we apply (\ref{e:rwform}) with the tuple $(a_v)_{v \in S'}$ replaced by $y_v$.

Suppose that $v \in S' - {\Sigma_{*}}$.
The module $W_v^-$ is generated over $\mathbf{Z}[\mathfrak{g}]^-$ by elements of the form $a_v= \tilde{\sigma} - 1 \in I_W$ for $\tilde{\sigma} \in \WD(L_w^{\nr}/F_v)$.  Writing $\sigma = \tilde{\sigma}|_{L_w} \in \mathfrak{g}_v$, we have  $\theta_W(a_v) = \sigma - 1$.
Let $\tilde{c} = \sigma_{v'}$, a lift of the complex conjugation in $\mathfrak{g}$ to $\tilde{\mathfrak{g}}$. Then we have
\begin{align*}
f_v(a_v) & = f_v((1 -c)/2 \cdot y)  =(1 -\tilde{c})(\tilde{\sigma}- 1)/2, \\
f_{v'}(\theta_W(a_v)/2) &=  (\tilde{\sigma}- 1)(\tilde{c} - 1)/2,
\end{align*}
and hence
\[ \varphi_{{\Sigma_{*}}}(y_v) =  (\tilde{\sigma}\tilde{c} - \tilde{c}\tilde{\sigma})/2. \]
Under the isomorphism noted in the first nonzero term in (\ref{e:rw}), this correponds to the element
\[ (\tilde{\sigma}\tilde{c} \tilde{\sigma}^{-1} \tilde{c}^{-1})^{1/2} \in {\rm Gal}(\tilde{L}/L) \cong M_\Sigma. \]
By (\ref{e:lambdadef}), this is precisely the value of $\varphi_{\lambda_{{\Sigma_{*}}}}^{v}(\tilde{\sigma} - 1)  = \lambda_{{\Sigma_{*}}}(\tilde{\sigma})$.

For $v \in {\Sigma_{*}}$, the module $Z_v^-$ is generated by elements of the form $a_v = \sigma - 1$ for $\sigma \in \mathfrak{g}_v$,
and the exact same computation as above shows that
$\varphi_{{\Sigma_{*}}}(y_v) =  \varphi_{\lambda_{{\Sigma_{*}}}}^{v}(a_v)$
(in fact, this was precisely the case handled in  \cite{dk}*{Lemma A.3}).  This concludes the proof.
\end{proof}

Recall $R = \mathbf{Z}_p[\mathfrak{g}]^-$ and let $A$ denote an $R$-algebra.
As we now describe, the Galois theoretic description of $\nabla_{\Sigma}^{\Sigma'}(L)^-$ provided by Lemma~\ref{l:gtd} yields an explicit method of constructing homomorphisms \[ \nabla_{\Sigma}^{\Sigma'}(L)_A \longrightarrow B \] for $A$-modules $B$.
Let $[\kappa] \in H^1(G_F, B)$ denote a Galois cohomology class, where $B$ is endowed with a $G_F$-action via the composition $G_F \longrightarrow \mathfrak{g} \longrightarrow A^*$.  Suppose that:
\begin{itemize}
\item The class $[\kappa]$ is unramified outside $\Sigma'$, locally trivial at  $\Sigma$, and tamely ramified at $\Sigma'$.
\item Let $B_0 \subset B$ denote the $A$-submodule generated by the image of the restriction
\[ [\kappa]_{|G_L} \in H^1(G_L, B) = \Hom_{\cont}(G_L, B). \]
 The module
$B/B_0$ is generated over $A$ by the images of elements $x_v \in B$ for $v \in \Sigma$ and elements $x_{\mathfrak{p}}, x_{\mathfrak{p}}' \in B$.  The element $x_{\mathfrak{p}}'$ is fixed by the action of $G_{F,\mathfrak{p}}$ (i.e.\ by the action of $\mathfrak{g}_\mathfrak{p}$).
\item The class $[\kappa]$ is represented by a 1-cocycle $\kappa$ satisfying the following.
\begin{itemize}
\item For $v \in \Sigma$ and $\sigma \in G_{F, v}$, we have $\kappa(\sigma) =(\sigma - 1) x_v.$
\item For $\sigma \in \WD(\overline{F}_\mathfrak{p}/F_\mathfrak{p})$, we have \begin{equation} \label{e:xpdef}
 \kappa(\sigma) =     (\sigma - 1)    x_{\mathfrak{p}} + \ord_\mathfrak{p}(\sigma) x_{\mathfrak{p}}',\end{equation}
where $\ord_\mathfrak{p}$ is as in (\ref{e:ordp}).
\end{itemize}
\end{itemize}

\begin{theorem}  \label{t:nc}  Let $B$ be an $A$-module and $[\kappa] \in H^1(G_F, B)$  a Galois cohomology class satsifying the three bullet points above.
Write $A_\mathfrak{p} = A \otimes_{R} \mathbf{Z}_p[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}]^-$.  There is a surjective $A$-module homomorphism
\begin{equation} \label{e:alpha1} \begin{tikzcd}
 \alpha_1 \colon \tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_A \ar[r,two heads] & B  \end{tikzcd} \end{equation}
induced by the map \[ \begin{tikzcd}
\alpha \colon (B_{\Sigma})_A \cong (A \oplus A_\mathfrak{p}) \oplus A^{\#S-1} \ar[r] & B
\end{tikzcd} \] defined as follows:
\begin{itemize}
\item For $a_v \in A$ in the component at $v \in S' - \Sigma_\mathfrak{p}$, we have $\alpha(a_v) = a_v  \kappa(\sigma_v)$, where $\sigma_v$ denotes the Frobenius element at $v$.
\item For $a_v \in A$ in the component at $v \in \Sigma$, we have $\alpha(a_v) = a_v  x_v$.
\item For $(a_v, b_v) \in A \oplus A_\mathfrak{p}$ in the component at $\mathfrak{p}$, we have $\alpha(a_v, b_v) = a_v x_{\mathfrak{p}} + b_v x_{\mathfrak{p}}'.$
\end{itemize}
\end{theorem}

\begin{proof}
The homomorphism $[\kappa]_{|G_L} \in H^1(G_L, B) = \Hom_{\cont}(G_L, B)$ is unramified outside $\Sigma'$, locally trivial at  $\Sigma$, and tamely ramified at $\Sigma'$.  It follows from class field theory that $[\kappa]_{|G_L}$ factors through \[ M_\Sigma \cong {\rm Gal}(\tilde{L}_\Sigma/L)\] and therefore induces a surjective map
\[ \begin{tikzcd}
(M_\Sigma)_R \ar[r,two heads] & B_0.
\end{tikzcd}
 \]

Next note that we can assume that $\kappa \in Z^1(G_F, B)$ satisfies the formula
\begin{equation} \label{e:nicecocycle}
 \kappa(\sigma)=  [\kappa]|_{G_L}({\sigma}\tilde{c} {\sigma}^{-1} \tilde{c}^{-1})^{1/2} \in B_0, \qquad \sigma \in G_F. \end{equation}
  Indeed,
by \cite{dk}*{Lemma 6.6} there is a {\em unique} class in $H^1(G_F, B)$ restricting to $[\kappa]_{|G_L}$, and the cocycle given by the right side of
 (\ref{e:nicecocycle})
represents this class.  Therefore $\kappa$ equals (\ref{e:nicecocycle}) up to the addition of a coboundary $\kappa_x (\sigma)=  (\sigma - 1)x$.  Replacing $\kappa$ by $\kappa - \kappa_x$ and making the substitutions $x_v \mapsto x_v - x$, $x_{\mathfrak{p}}' \mapsto x_{\mathfrak{p}}' - x$ proves the claim that we may assume that $\kappa$ satisfies (\ref{e:nicecocycle}).  In particular, $\kappa$ takes values in $B_0$.

To prove that $\alpha$ induces a map $\alpha_1$ as in (\ref{e:alpha1}), it suffices to prove that the composition
\[ \begin{tikzcd}
 (W_\Sigma^\theta)_A \ar[r] & (B_\Sigma^\theta)_A \ar[r] & (B_\Sigma)_A \ar[r,"\alpha"] & B
 \end{tikzcd}
 \]
can be factored as
\[ \begin{tikzcd}
(W_\Sigma^\theta)_A \arrow[r, "\varphi_{\lambda_\Sigma}"] & (M_\Sigma)_A \arrow[r, "\kappa|_{G_L}"] & B_0 \arrow[r,hook] & B.
\end{tikzcd}\]
For then the image of $(V^\theta)_A$ in $(W_\Sigma^\theta)_R$ vanishes under $\alpha$.  Note that the composition $\kappa|_{G_L} \circ \varphi_{\lambda_\Sigma}$ equals $\varphi_\kappa := \sum_{v \in S'} \varphi_\kappa^v$, by Lemma~\ref{l:gtd} together with equations (\ref{e:lambdadef}) and (\ref{e:nicecocycle}).

The fact that the restriction of $\alpha$  to $(W_\Sigma^\theta)_A$ equals $\varphi_\kappa$ follows from the assumptions on $\kappa$, as we now check on each component.

\begin{itemize}
\item Any $v \in S' - \Sigma_\mathfrak{p}$ in unramifed in $L$ and hence $(W_v)_A$ is generated over $A$ by
$\sigma_v - 1$, where $\sigma_v$ is the Frobenius element at $v$.
By definition of the map $W_\Sigma \longrightarrow B_\Sigma$, the image of $\sigma_v - 1$ in the component of $B_\Sigma$ at $v$ is simply 1.  Therefore
\[ \alpha(\sigma_v - 1) = \kappa(\sigma_v) = \varphi_\kappa^v(\sigma_v - 1). \]
\item For $v \in \Sigma$, let $\sigma \in \mathfrak{g}_v$, and consider the element $\sigma - 1$ in the $v$-component of $(B_{\Sigma})_A$.  We find:
 \[ \alpha(\sigma - 1) = x_v(\sigma - 1) = \kappa(\sigma) = \varphi_\kappa^v(\sigma - 1). \]
\item  Let $y \in (W_\mathfrak{p})_R$ be represented by $\tilde{\sigma} - 1$ for ${\sigma} \in \WD(L_w^{\nr}/F_\mathfrak{p})$.
Consider $j_\mathfrak{p}(y)$ in the $\mathfrak{p}$-component of $(B_{\Sigma})_R$. We find:
\begin{align*}
 \alpha(j_\mathfrak{p}(y)) &= \alpha(  \sigma|_{L_w} - 1, \ord_\mathfrak{p}({\sigma})) \\
 & =  (\sigma - 1) x_{\mathfrak{p}}  + \ord_\mathfrak{p}({\sigma}) x_{\mathfrak{p}}'   \\
 & = \kappa(\sigma) \\ & = \varphi_\kappa^v(y).
 \end{align*}
\end{itemize}
This concludes the proof that $\alpha$ induces the desired map $\alpha_1$.  In fact, if we let $\alpha_0$ denote the composition
of $\alpha$ with the projection $B \longrightarrow B/B_0$, then we have demonstrated a commutative diagram
\begin{equation}  \label{e:bigd}
\begin{gathered}
\begin{tikzcd}
0  \ar[r] & (M_\Sigma)_A  \ar[r]  \ar[d,two heads,"\kappa_{|G_L}"] & \tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_A  \ar[r]
\ar[d,"\alpha_1"] & (Y^\theta_\Sigma)_A  \ar[r] \ar[d,two heads,"\alpha_0"] & 0 \\
0 \ar[r] & B_0 \ar[r] & B \ar[r] & B/B_0 \ar[r] & 0.
\end{tikzcd}
\end{gathered}
\end{equation}
The surjectivity of $\alpha_0$ follows by the assumption that $B/B_0$ is generated over $R$ by the $x_v$ for $v \in \Sigma$ along with $x_{\mathfrak{p}}, x_{\mathfrak{p}}'$.
The surjectivity of $\alpha_1$ then follows from the Five Lemma.
\end{proof}

\subsection{The module $\nabla_{\!{\mscr L}}$} \label{s:nablal}

As we did with $(B_{\Sigma_\mathfrak{p}}^\theta)_R$ in the proof of Theorem~\ref{t:gorder}, we can write down a generating set for the $R$-module $(B_{\Sigma}^\theta)_R$ as follows.  The module $(B_{\Sigma})_R$ is generated over $R$ by the vectors $e_0 = (1,0)$ and $e_1 = (0,1)$ in the component $R \oplus R_\mathfrak{p}$ at $\mathfrak{p}$ together with the standard basis vectors $e_v$ for $\prod_{v \in S' \setminus \mathfrak{p}} R \subset (B_{\Sigma})_R$.
The module $(B_{\Sigma}^\theta)_R$ is then generated by
\[ \{ b_0 = e_0 - e_\infty, \  b_1 = e_1, \ b_v = e_v - \theta_B(e_v)e_\infty \colon v \in S' \setminus \{\infty, \mathfrak{p}\} \}, \]
where $\infty \in S_\infty \subset S'$ is any fixed infinite place of $F$.

Denote the image of the vectors $b_0$ and $b_1$ in $\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)$ by $\overline{b}_0$ and $\overline{b}_1$, respectively.  Recall  the $R$-algebra  $R_{\mscr L}$  defined in  (\ref{e:rldef}). We define
\begin{equation} \label{e:nablaldef}
 \nabla_{\!{\mscr L}} = \tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_R \otimes_R R_{\mscr L}/(\overline{b}_1 + {\mscr L} \overline{b}_0).
\end{equation}

The following is the analogue of Theorem~\ref{t:nc} for the module $\nabla_{\!{\mscr L}}$.  Again we work over an arbitrary $R$-algebra $A$ and write $A_{\mscr L} = R_{\mscr L} \otimes_R A$, $\nabla_{\!{\mscr L}, A} = \nabla_{\!{\mscr L}} \otimes_R A$.

\begin{theorem}  \label{t:nl} Let $B$ and $[\kappa] \in H^1(G_F, B)$ be as in Theorem~\ref{t:nc}. Suppose that $\tilde{B}$ is an $A_{{\mscr L}}$-module endowed with an $A$-module map $B \longrightarrow \tilde{B}$ such that the image of $B$ generates $\tilde{B}$ over $A_{{\mscr L}}$. Suppose further that the images in $\tilde{B}$ of $x_{\mathfrak{p}}, x_{\mathfrak{p}}' \in B$ defined in (\ref{e:xpdef}) satisfy
$x_{\mathfrak{p}}' + {\mscr L} \cdot x_{\mathfrak{p}} = 0$.  Then the map $\alpha_1$ of $(\ref{e:alpha1})$ induces a surjective $A_{{\mscr L}}$-module homomorphism
\begin{equation} \label{e:nlsurj} \begin{tikzcd}
\alpha_{{\mscr L}} \colon \nabla_{\!{\mscr L}, A} \ar[r, two heads] & \tilde{B}.
\end{tikzcd} \end{equation}
\end{theorem}

\begin{proof}  Since the image of $B$ generates $\tilde{B}$ as an $A_{{\mscr L}}$-module, the surjection $\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_A \relbar\joinrel\twoheadrightarrow B$ induces a surjection
 \begin{equation} \label{e:tildeb}
 \tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_A \otimes_A A_{{\mscr L}}  \relbar\joinrel\twoheadrightarrow \tilde{B}.
 \end{equation}
Since $\alpha_1(\overline{b}_0) = x_{\mathfrak{p}}$ and $\alpha_1(\overline{b}_1) = x_{\mathfrak{p}}'$, the equality $x_{\mathfrak{p}}' + {\mscr L} \cdot x_{\mathfrak{p}} = 0$ implies that the surjection (\ref{e:tildeb}) factors through
\[ \nabla_{\!{\mscr L}, A} = \tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_A \otimes_A A_{{\mscr L}} /(\overline{b}_1 + {\mscr L} \overline{b}_0)
\]
as desired.
\end{proof}

\subsection{Gross's Conjecture via Fitting Ideals} \label{s:gcfi}

In this section we prove the following interpretation of Gross's Conjecture.

\begin{theorem} \label{t:mfig}  The $R_{\mscr L}$-module $\nabla_{\!{\mscr L}}$ is quadratically presented and we have
\[ \Fitt_{R_{\mscr L}}(\nabla_{\!{\mscr L}}) = (\rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) - \Theta_L). \]
Therefore, the equality
\[  \Fitt_{R_{\mscr L}}(\nabla_{\!{\mscr L}}) = 0 \]
implies the $p$-part of the modified Gross conjecture:
\[ \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) \equiv \Theta_L \pmod{I^2}. \]
\end{theorem}

We would like to point out that most of the computations of \S\ref{s:gcfi} are slight variants of the calculations of Burns, Kurihara, and Sano in \S5 of \cite{bks}.   Our approach to relating the Brumer--Stark unit $u_\mathfrak{p}^{\Sigma,\Sigma'}$ to Ritter--Weiss modules and studying its properties is modeled after theirs.  Our innovation is the definition of $R_{\mscr L}$ and $\nabla_{\!{\mscr L}}$ and the application of these techniques to the statement and proof of Theorem~\ref{t:mfig}.

\bigskip

First we note that the same construction used to define $\tilde{\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L) = \nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ above, but working over $H$ rather than $L$, gives rise to modules
$\nabla_{\Sigma}^{\Sigma'}(H)$ and $\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(H)$.
  Since $H/F$ is unramified outside $\Sigma \cup \Sigma'$, these modules
  are the cokernels of maps
  \[ \begin{tikzcd} V^\theta(H) \ar[r, "f_{H, \Sigma}"] & B^\theta(H), \end{tikzcd} \qquad
  \begin{tikzcd} V^\theta(H) \ar[r, "f_{H, \Sigma_\mathfrak{p}}"] & B^\theta(H), \end{tikzcd} \]
respectively,  with the {\em same} domain and codomain.
The modules $\nabla_{\Sigma}^{\Sigma'}(H)_{\overline{R}}$ and $\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(H)_{\overline{R}}$ satisfy properties analogous to those stated in Lemma~\ref{l:qp} and Theorem~\ref{t:bs}.  Specifically, $V^\theta(H)_{\overline{R}}$ is free over $\overline{R}$ with constant rank equal to the rank of the free module $B^\theta(H)_{\overline{R}}$, namely $\#S' - 1$.   Furthermore, as stated in Theorem~\ref{t:dkresult} above,
we have by \cite{dk}*{Theorem 3.3} the equalities
\[ \Fitt_{\overline{R}} \nabla_{\Sigma}^{\Sigma'}(H)_{\overline{R}} = (\Theta_{\Sigma, \Sigma'}^{H}), \qquad
 \Fitt_{\overline{R}} \nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(H)_{\overline{R}} = (\Theta_{\Sigma_\mathfrak{p}, \Sigma'}^{H}) = 0. \]

In \cite{dk}*{Lemmas B.1 and B.2} we prove that there is a commutative diagram
\begin{equation} \begin{gathered}
 \begin{tikzcd}
V^\theta(L)_R \ar[d,"f_{\Sigma_\mathfrak{p}}"] \ar[r, "\mathrm{N}\Gamma", two heads] & V^\theta(L)^\Gamma_{\overline{R}} \ar[r,"\sim"] \ar[d] & V^\theta(H)_{\overline{R}} \ar[d,"f_{H, \Sigma_\mathfrak{p}}"] \\
B_{\Sigma_\mathfrak{p}}^\theta(L)_R \ar[r, "\mathrm{N}\Gamma", two heads] &  B_{\Sigma_\mathfrak{p}}^\theta(L)^{\Gamma}_{\overline{R}} \ar[r, "\sim"] & B^\theta(H)_{\overline{R}}.
\end{tikzcd}
\end{gathered} \label{e:bv}
\end{equation}
To give the analogous diagram for $\Sigma$, we need some additional notation.
Define \[ \overline{B}_{\Sigma}(L) = \mathbf{Z}[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}] \oplus \bigoplus_{v\in S' \setminus \mathfrak{p}} \mathbf{Z}[\mathfrak{g}], \]
and let $\pi \colon {B}_{\Sigma}(L) \longrightarrow \overline{B}_{\Sigma}(L)$ be the projection in which the first component at $\mathfrak{p}$, which is a factor $\mathbf{Z}[\mathfrak{g}]$, has been forgotten.
Recall the map $f_\Sigma \colon V^\theta(L) \longrightarrow B_{\Sigma}^{\theta}(L)$ defined in (\ref{e:fsigmadef}).
 Let
$f_{\Sigma, \pi} = \pi \circ f_{\Sigma}$.  Note that since $\mathfrak{g}_\mathfrak{p} \subset \Gamma$, multiplication by $\mathrm{N}\Gamma$ induces a well-defined map \[ \mathbf{Z}[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}] \longrightarrow \mathrm{N}\Gamma \cdot  \mathbf{Z}[\mathfrak{g}] = \mathbf{Z}[\mathfrak{g}]^{\Gamma} \] and hence a  map $ \overline{B}_{\Sigma}(L) \longrightarrow B_{\Sigma_\mathfrak{p}}(L)^\Gamma$.  By \cite{dk}*{Lemma B.2}, we then have a commutative diagram:
\begin{equation} \begin{gathered}
 \begin{tikzcd}
V^\theta(L)_R \ar[d,"f_{\Sigma, \pi}"] \ar[r, "\mathrm{N}\Gamma", two heads] & V^\theta(L)^\Gamma_{\overline{R}} \ar[r,"\sim"] \ar[d] & V^\theta(H)_{\overline{R}} \ar[d,"f_{H, \Sigma}"] \\
\overline{B}_{\Sigma}^\theta(L)_R \ar[r, "\mathrm{N}\Gamma", two heads] &  B_{\Sigma_\mathfrak{p}}^\theta(L)^{\Gamma}_{\overline{R}} \ar[r, "\sim"] & B^\theta(H)_{\overline{R}}.
\end{tikzcd}
\end{gathered} \label{e:bv2}
\end{equation}

Write $t = \#S' - 1$ and fix an $R$-basis $\{v_1, v_2, \dotsc, v_t \}$ of $V^\theta(L)_R$.
As in the proof of Theorem~\ref{t:gorder}, we choose the following basis for $B_{\Sigma_\mathfrak{p}}^\theta(L)_R$:
\begin{equation} \label{e:bbasis}
 \{b_v = e_v - \theta_B(e_v)e_\infty : v \in S' - \infty\}, \end{equation}
 where $\infty \in S_\infty \subset S'$ is any fixed infinite place of $F$ and $\{e_v\}$ is the standard basis of
\[ B_{\Sigma_\mathfrak{p}}(L)_R = \prod_{v \in S'} R. \]
 Let $\{\overline{v}_1, \dotsc, \overline{v}_t\}$
and $\{\overline{b}_v\}$
denote the $\overline{R}$-bases of $V^\theta(H)_{\overline{R}}$ and
$ B^\theta(H)_{\overline{R}}$, respectively, obtained by applying the horizontal maps in (\ref{e:bv}).

Having fixed these bases, we define:
\begin{itemize}
\item  $\euscr{A}_{\Sigma_\mathfrak{p}} \in M_{t \times t}(R)$ is the matrix for $f_{\Sigma_\mathfrak{p}}$.
\item $\euscr{A}_{\Sigma}$ is the $t \times (t+1)$ matrix representing the map $f_{\Sigma}$, with second column having entries in $R_\mathfrak{p} = \mathbf{Z}_p[\mathfrak{g}/\mathfrak{g}_\mathfrak{p}]^-$ and all other columns having entries in $R$.
\end{itemize}
By the commutative  diagrams (\ref{e:bv}) and (\ref{e:bv2}) we have:
\begin{itemize}
\item The reduction of $\euscr{A}_{\Sigma_\mathfrak{p}}$ modulo $I$,  denoted
$\overline{\euscr{A}}_{\Sigma_\mathfrak{p}} \in M_{t \times t}(\overline{R})$, is the matrix for $f_{H, \Sigma_\mathfrak{p}}$.
\item Let $\overline{\euscr{A}}_{\Sigma}$ denote the matrix in $M_{t\times t}(\overline{R})$ obtained from $\euscr{A}_\Sigma$ by deleting the first column and reducing the other entries modulo $I$.
Then $\overline{\euscr{A}}_{\Sigma}$ is the matrix for $f_{H, \Sigma}$.
\end{itemize}
We furthermore note that:
\begin{itemize}
\item The matrices $\overline{\euscr{A}}_{\Sigma_\mathfrak{p}}$ and $\overline{\euscr{A}}_{\Sigma}$ agree other than their first columns, since the components away from $\mathfrak{p}$ of the maps $f_{H, \Sigma_\mathfrak{p}}, f_{H, \Sigma}$ are the same.
\item The first column of $\overline{\euscr{A}}_{\Sigma_\mathfrak{p}}$ consists of all zeroes, since $\mathfrak{g}_\mathfrak{p} \subset \Gamma$.
\end{itemize}

We now define a square $t \times t$ matrix $\euscr{A}_V$.  The last $t-1$ columns of $\euscr{A}_V$ have entries in
$\overline{R}$ and are equal to the last $t-1$ columns of $\overline{\euscr{A}}_{\Sigma_\mathfrak{p}}$  (equivalently,
$\overline{\euscr{A}}_{\Sigma}$). The first column of $\euscr{A}_V$ is the column vector $(\overline{v}_i)_{i = 1}^{t}$, with entries in $V^\theta(H)_{\overline{R}}$.  It makes sense to consider the determinant of $\euscr{A}_V$ as an element of $V^\theta(H)_{\overline{R}}$.

\begin{lemma} \label{l:detav} We have $\det(\euscr{A}_V) \in \ker(f_{H, \Sigma_\mathfrak{p}}).$
\end{lemma}

\begin{proof} The value $f_{H, \Sigma_\mathfrak{p}}(\det(\euscr{A}_V))$ is the determinant of the matrix in which the first column of $\euscr{A}_V$ has been replaced by column whose elements are $f_{H, \Sigma_\mathfrak{p}}(\overline{v}_i) \in B^\theta(H)_{\overline{R}}.$
With respect to the decomposition of $B^\theta(H)_{\overline{R}}$ as a product over the places $v \in S'$,
each component of $(f_{H, \Sigma_\mathfrak{p}}(\overline{v}_i))_{i=1}^{t}$ corresponding to a place $v \in S' \setminus \mathfrak{p}$ is equal to another column of the matrix, namely the column corresponding to $v$.  Meanwhile the component at $v = \mathfrak{p}$ is the 0 vector, as noted in the last bullet point above regarding $\overline{\euscr{A}}_{\Sigma_\mathfrak{p}}$.  It follows that the determinant is 0 in every component of $B^\theta(H)_{\overline{R}}.$
\end{proof}

From the exact sequence
\begin{equation} \label{e:tateh}
\begin{tikzcd}
 0   \ar[r] & (\mathcal{O}_{H, \Sigma_\mathfrak{p}, \Sigma'}^*)_{\overline{R}}  \ar[r] & V^\theta(H)_{\overline{R}}  \ar[r, "f_{H, \Sigma_\mathfrak{p}}"] & B^\theta(H)_{\overline{R}}  \ar[r] & {\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(H)_{\overline{R}}  \ar[r] & 0,
 \end{tikzcd}
 \end{equation}
it follows from Lemma~\ref{l:detav} that $\det(\euscr{A}_V)  \in V^\theta(H)_{\overline{R}}$ is the image of a unit
\begin{equation} \label{e:epsilondef}
 \epsilon \in  (\mathcal{O}_{H, \Sigma_\mathfrak{p}, \Sigma'}^*)_{\overline{R}}. \end{equation}

\begin{lemma}  We have $\epsilon \in (\mathcal{O}_{H, \mathfrak{p}, \Sigma'}^*)_{\overline{R}}$.
\end{lemma}

\begin{proof} Let $v \in \Sigma$ and let $w$ be the chosen place of $H$ above $v$ in the definition of $V(H)$.
Recall the short exact sequence
\begin{equation} \label{e:vwseq}
 \begin{tikzcd} \Ind_{G_v}^G \mathcal{O}_w^* \ar[r, hook] & V_v(H) = \Ind_{G_v}^G V_w(H_w)  \ar[r, two heads, "\omega_v"] &
W_v(H) = \Ind_{G_v}^{G} W_w(H_w) .
\end{tikzcd}
\end{equation}
To show that $\epsilon \in (\mathcal{O}_{H, \mathfrak{p}, \Sigma'}^*)_{\overline{R}}$, we must show that the component of $\det(\euscr{A}_V)$ in $V_v(H)$ has vanishing image  in $W_v(H)$ under $\omega_v$.
  Now $\omega_v(\det(\euscr{A}_V))$ is the determinant of the matrix $\euscr{A}_{\omega_v}$ in which the first column of $\euscr{A}_V$ has been replaced by $(\omega_v(\overline{v}_{i}))_{i=1}^t$.
We use the description of $W_w(H_w)$ given by Ritter--Weiss in \cite{rw}*{\S3}.  We have \begin{equation} \label{e:wvdef}
 W_w(H_w)  = \{(x,y) \in \Delta G_v \oplus \mathbf{Z}[G_v/I_v] \colon \overline{x} = (\sigma_v - 1)y \}. \end{equation}
 Here $\sigma_v \in G_v/I_v$ denotes  Frobenius.
   If we write \[ \omega_v(\overline{v}_i) = \sum_{\sigma \in G/G_v} \sigma \otimes (x_{\sigma, i}, y_{\sigma,i}), \]
   then $\euscr{A}_{\omega_v}$ has first column equal to these values,
   and another column (the column corresponding to $v$) equal to
    \[ \sum_{\sigma \in G/G_v} \sigma \otimes x_{\sigma,i} \in \Ind_{G_v}^{G} \Delta G_v. \]
Indeed, this is the component of $f_{H, \Sigma}$ at the factor of $B^\theta(H)$ corresponding to $v$.  Because of the relationship between $\overline{x}$ and $y$ in (\ref{e:wvdef}), it is easy to see that the determinant of such a matrix is zero.  This is clear for the first component of the ordered pair, and for the second we note that
\[ y_{\sigma, i}  \cdot \overline{x}_{\tau, j} = (\sigma_v - 1)y_{\sigma, i} \cdot y_{\tau, j} = y_{\tau, j} \cdot \overline{x}_{\sigma, i} \quad \text{ in }\mathbf{Z}[G_v/I_v]. \]
The vanishing of  $\det \euscr{A}_{\omega_v}$ yields the desired result $\epsilon \in (\mathcal{O}_{H, \mathfrak{p}, \Sigma'}^*)_{\overline{R}}$.
\end{proof}

\begin{lemma} \label{l:eord}
Let $\mathfrak{P}$ denote the chosen place of $H$ above $\mathfrak{p}$ used in the definition of $V(H)$.  We have
\[  \ord_G(\epsilon) = \sum_{\sigma \in G} \ord_\mathfrak{P}(\sigma(\epsilon)) \sigma^{-1} = \det(\overline{\euscr{A}}_{\Sigma})
= x \Theta_H \]
for some unit $x \in \overline{R}^*$.
\end{lemma}

\begin{proof}
The proof is similar to the previous calculations.  The key point here is that since $\mathfrak{p}$ splits completely in $H$, we have $H_\mathfrak{P} = F_\mathfrak{p}$, hence $V_\mathfrak{P}(H_\mathfrak{P}) \cong H_\mathfrak{P}^*$ and  $W_\mathfrak{P}(H_\mathfrak{P}) \cong \mathbf{Z}$. The sequence (\ref{e:vwseq})
becomes the canonical sequence
\[
 \begin{tikzcd} \Ind_{1}^G \mathcal{O}_\mathfrak{P}^* \ar[r, hook] & V_\mathfrak{p}(H) = \Ind_{1}^G H_\mathfrak{P}^*  \ar[r, two heads, "\omega_\mathfrak{p}"] &
W_\mathfrak{p}(H) = \Ind_{1}^{G} \mathbf{Z} = \mathbf{Z}[G]
\end{tikzcd}
\]
with $\omega_\mathfrak{p} = 1 \otimes \ord_{\mathfrak{P}}$.
The composition
\[ \begin{tikzcd} \mathcal{O}_{H, \Sigma_\mathfrak{p}, \Sigma'}^* \ar[r] & V_\mathfrak{p}(H) \ar[r, "\omega_\mathfrak{p}"] & \mathbf{Z}[G]
\end{tikzcd} \]
therefore is precisely the map $\ord_G$.  It follows that the value of $ \ord_G(\epsilon)$ is the determinant of the matrix in which the first column of $\euscr{A}_V$ has been replaced by $\omega_\mathfrak{p}(v_i)$.  But this is by definition the matrix $\overline{\euscr{A}}_{\Sigma}$.

To conclude, we note that
\[ (\det(\overline{\euscr{A}}_{\Sigma})) = \Fitt_{\overline{R}} \nabla_{\Sigma}^{\Sigma'}(H) =
(\Theta_H)
\]
by \cite{dk}*{Theorem 3.3 and Corollary 6.5}.
\end{proof}

If follows from Lemma~\ref{l:eord} that \begin{equation} \label{e:eup}
\epsilon = x \cdot u_\mathfrak{p}^{\Sigma, \Sigma'}. \end{equation}
For the next lemma, recall from \S\ref{s:igs} that we have a map
 \[ \rec_G \colon (\mathcal{O}_{H, \Sigma, \Sigma'}^*)_{\overline{R}} \longrightarrow I/I^2, \qquad \epsilon \mapsto
\sum_{\sigma \in G} (\rec_\mathfrak{P}(\sigma(\epsilon)) - 1)\tilde{\sigma}^{-1}, \]
where $\tilde{\sigma}$ is a lift of $\sigma$ in $\mathfrak{g}$.

\begin{lemma}  \label{l:erec}
We have
\[  \rec_G(\epsilon) \equiv \det(\euscr{A}_{\Sigma_\mathfrak{p}}) \text{  in  } I/I^2. \]
\end{lemma}

\begin{proof}
Recall from the proof of Lemma~\ref{l:eord} that $V_\mathfrak{p}(H) = \Ind_1^G H_\mathfrak{P}^*$.  The homomorphism
\[ \rec_{\mathfrak{P}} \colon H_\mathfrak{P}^* \longrightarrow \Gamma \cong I_\Gamma/I_\Gamma^2 \]
therefore induces a map that we again denote $\rec_\mathfrak{P} \colon V_\mathfrak{p}(H) \longrightarrow I/I^2.$
The composition
\[ \begin{tikzcd} \mathcal{O}_{H, \Sigma_\mathfrak{p}, \Sigma'}^* \ar[r] & V_\mathfrak{p}(H) \ar[r, "\rec_\mathfrak{P}"] & I/I^2
\end{tikzcd} \]
 is precisely the map $\rec_G$.  It follows that $\rec_G(\epsilon)$ is the determinant of the matrix $\euscr{A}_{\rec}$ in which the first column of $\euscr{A}_V$ has been replaced by $(\rec_\mathfrak{P}(\overline{v}_i))_{i=1}^t$.
We must prove that \[ \det(\euscr{A}_{\Sigma_\mathfrak{p}}) \equiv \det(\euscr{A}_{\rec}) \pmod{I^2}. \]

To prove this claim, first note that $\overline{\euscr{A}}_{\Sigma_\mathfrak{p}}$ and $\euscr{A}_{\rec}$ have all columns after the first equal in $\overline{R}$.  It therefore suffices to show that the first columns of $\euscr{A}_{\Sigma_\mathfrak{p}}$ and $\euscr{A}_{\rec}$ are equal in $I/I^2$.

This follows from an unwinding of the definitions.  We revisit the definition of $V_\mathfrak{P}(H_\mathfrak{P})$ given in (\ref{e:vandw}).  In this notation, the map \[ \rec_\mathfrak{P} \colon V_\mathfrak{P}(H_\mathfrak{P}) \longrightarrow I_\Gamma/I_\Gamma^2 \] giving the first column of $\euscr{A}_{\rec}$ is simply induced by the canonical restriction map \[ \sigma - 1 \mapsto \sigma|_L - 1, \qquad \sigma \in \WD(H_\mathfrak{P}^{\text{ab}}/F_\mathfrak{p}). \]
Let $w$ denote the chosen place of $L$ above $\mathfrak{P}$ and $\mathfrak{p}$.
By (\ref{e:jpdef}), the map $V_\mathfrak{P}(L_\mathfrak{P}) \longrightarrow I$ giving the first column of $\euscr{A}_{\Sigma_\mathfrak{p}}$
 is also induced by the restriction $\sigma - 1 \mapsto \sigma|_L - 1$ for $\sigma \in \WD(L_w^{\text{ab}}/F_\mathfrak{p})$.

To conclude, we observe that by \cite{dk}*{Lemma B.1}, the composition of the maps
\[ \begin{tikzcd}
 \Ind_{\mathfrak{g}_v}^{\mathfrak{g}} V_w(L_w) \ar[r, "\mathrm{N} \Gamma"] & (\Ind_{\mathfrak{g}_v}^{\mathfrak{g}} V_w(L_w))^{\Gamma} \ar[r, "\sim"] & \Ind_{1}^G V_\mathfrak{P}(H_\mathfrak{P})
 \end{tikzcd}
 \]
 is induced by the map $V_w(L_w) \longrightarrow V_\mathfrak{P}(H_\mathfrak{P})$ given by restriction: $\sigma - 1 \mapsto \sigma|_{H_\mathfrak{P}^{\text{ab}}}-1.$
\end{proof}

We are finally ready for:

\begin{proof}[Proof of Theorem~\ref{t:mfig}]
Define
\[
V_{{\mscr L}}^\theta = V^\theta(L) \otimes_{\mathbf{Z}[\mathfrak{g}]} R_{{\mscr L}}, \qquad B_{{\mscr L}}^\theta = B_{\Sigma}^\theta(L) \otimes_{\mathbf{Z}[\mathfrak{g}]} R_{{\mscr L}} / (b_1 + {\mscr L} b_0) \cong (R_{{\mscr L}})^{t}.
\]
The module $B_{{\mscr L}}^\theta $ has free generators $\overline{b}_0, \overline{b}_2, \overline{b}_3, \dotsc, \overline{b}_t$ over $R_{{\mscr L}}$.  The module $V_{{\mscr L}}^\theta$ has free generators $v_1, \dotsc, v_t$ over $R_{{\mscr L}}$.
Therefore
\[
\nabla_{\!{\mscr L}} = \tilde{\nabla}_{\Sigma}^{\Sigma'}(L) \otimes_{\mathbf{Z}[G]} R_{{\mscr L}}/(\overline{b}_1 + {\mscr L} \overline{b}_0)
\]
 has a quadratic $R_{{\mscr L}}$-module presentation
\[ \begin{tikzcd}
 V_{{\mscr L}}^\theta \ar[r, "f_{{\mscr L}}"] & B_{{\mscr L}}^\theta \ar[r] & \nabla_{\!{\mscr L}} \ar[r] & 0.
\end{tikzcd}
\]
By definition, the matrix $\euscr{A}_{{\mscr L}}$ for $f_{{\mscr L}}$ with respect to our chosen bases is the matrix
$\euscr{A}_{\Sigma_\mathfrak{p}}$ with the first column replaced by the first column of
$\euscr{A}_{\Sigma_\mathfrak{p}} - {\mscr L} \overline{\euscr{A}}_{\Sigma}.$  Note that this first column has entries in the ideal $(I, {\mscr L})  \subset R_{{\mscr L}}$ that is annihilated by $I$.   Furthermore $\overline{\euscr{A}}_{\Sigma_\mathfrak{p}}$ and $\overline{\euscr{A}}_{\Sigma}$ have columns after the first that are equal.  It follows that
\[
\det(\euscr{A}_{{\mscr L}}) = \det(\euscr{A}_{\Sigma_\mathfrak{p}}) - {\mscr L} \det(\overline{\euscr{A}}_\Sigma).
\]
By Lemma~\ref{l:eord}, we have $\det(\overline{\euscr{A}}_{\Sigma}) = x \Theta_H$ for some $x \in \overline{R}^*$. By (\ref{e:eup}) and Lemma~\ref{l:erec}, we have
$\det(\euscr{A}_{\Sigma_\mathfrak{p}}) = x \cdot \rec_{G}(u_\mathfrak{p}^{\Sigma, \Sigma'})$ in $I/I^2$, with the same $x$. Therefore,
 \begin{align*} \label{e:ta}
 \det(\euscr{A}_{{\mscr L}}) & =   \det(\euscr{A}_{\Sigma_\mathfrak{p}}) - {\mscr L} \det(\overline{\euscr{A}}_{\Sigma}) \\
 & = x \cdot \rec_{G}(u_\mathfrak{p}^{\Sigma, \Sigma'}) - x \cdot {\mscr L} \Theta_H \\
 & = x \cdot (\rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) - \Theta_L).
  \end{align*}
Since $x$ is a unit, the equality
 \[ \Fitt_{R_{{\mscr L}}}(\nabla_{\!{\mscr L}}) = (\det(\euscr{A}_{\mscr L})) = (\rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) - \Theta_L) \] follows.
Since \[ \rec_G(u_{\mathfrak{p}}^{\Sigma, \Sigma'}) - \Theta_L \in I/I^2, \] the second statement of the theorem follows from the first by Theorem~\ref{t:ws}.
\end{proof}

\subsection{Working componentwise} \label{s:comp}

The rings $R$ and $\overline{R}$ are not in general connected.
In working with modular forms, it will be convenient to replace these rings with individual components.
  We will also need to extend scalars when working with Galois representations, so we do so already at this point.  Therefore let $E$ denote a finite extension of $\mathbf{Q}_p$ and let $\mathcal{O}$ denote the ring of integers of $E$.  We assume that $E$ contains the image of every character of $\mathfrak{g}$.

Write $\mathfrak{g} = \mathfrak{g}_p \times \mathfrak{g}'$, where $\mathfrak{g}_p$ is the $p$-Sylow subgroup of $\mathfrak{g}$ and $\mathfrak{g}'$ is the subgroup of $\mathfrak{g}$ containing the elements of prime-to-$p$ order.  For each odd character $\psi$ of $\mathfrak{g}'$, let $R_\psi$ denote the group ring $\mathcal{O}[\mathfrak{g}_p]$ endowed with the $\mathfrak{g}$-action in which $g = g_p \cdot g'$ (with $g_p \in \mathfrak{g}_p, g' \in \mathfrak{g}'$) acts by multiplication by $g_p \psi(g')$.
 We then have an isomorphism of $\mathcal{O}[\mathfrak{g}]$-algebras
\[ {R} \otimes_{\mathbf{Z}_p} \mathcal{O} = \mathcal{O}[\mathfrak{g}]^- \cong \prod_{\psi} R_\psi,  \]
where the product ranges over the odd characters $\psi$ of $\mathfrak{g}'$.
We let
\[
R_{{\mscr L}, \psi} = R_{\mscr L} \otimes_R R_\psi, \qquad \qquad \nabla_{\!{\mscr L},\psi}  =  \nabla_{\!{\mscr L}} \otimes_{R_{\mscr L}} R_{{\mscr L}, \psi}.
\]

 We consider the analogous decomposition
$G = G_p \times G'$.  If $\chi$ is an odd character of $G'$,
we let  $\overline{R}_\chi$ denote the group ring $\mathcal{O}[G_p]$ endowed with the $G$-action in which $g = g_p \cdot g'$ acts by multiplication by $g_p \chi(g')$.  Then $\overline{R} \otimes_{\mathbf{Z}_p} \mathcal{O} \cong \prod_{\chi} \overline{R}_\chi$ with the product running over the odd characters $\chi$ of $G'$.

If $\chi$ is an odd character of $G'$, then it may be viewed as a character of $\mathfrak{g}'$ via the canonical projection $\mathfrak{g}' \longrightarrow G'$, and we may consider both $R_\chi$ and $\overline{R}_\chi$.  Furthermore, in this case if we let $I_\chi$ denote the image of the relative augmentation ideal $I$ in $R_\chi$, then we have $R_\chi / I_\chi \cong \overline{R}_\chi$.

\begin{lemma}  \label{l:fittchi} The equality
\begin{equation} \label{e:desiredfittchi} \Fitt_{R_{{\mscr L}, \chi}}(\nabla_{\!{\mscr L}, \chi}) = 0
\end{equation}
for each odd character $\chi$ of $G'$ implies the equality
\begin{equation} \label{e:desiredfitt}
\Fitt_{R_{{\mscr L}}}(\nabla_{\!{\mscr L}}) = 0.
\end{equation}
\end{lemma}

\begin{proof}  As $\mathcal{O}$ is free (and hence faithfully flat) over $\mathbf{Z}_p$, in order to prove (\ref{e:desiredfitt}) it suffices to show that
\[
\Fitt_{R_{{\mscr L}} \otimes_{\mathbf{Z}_p} \mathcal{O}} (\nabla_{\!{\mscr L}} \otimes_{\mathbf{Z}_p} \mathcal{O}) = 0.
\]
As
\[
R_{{\mscr L}} \otimes_{\mathbf{Z}_p} \mathcal{O} \cong \prod_{\psi} R_{{\mscr L}, \psi},
\]
with the product running over all odd characters $\psi$ of $\mathfrak{g}'$, it suffices to prove that
\begin{equation} \label{e:rlpsi}
\Fitt_{R_{{\mscr L}, \psi}}(\nabla_{\!{\mscr L}, \psi}) = 0
\end{equation}
for all such $\psi$.
The assumption (\ref{e:desiredfittchi}) is precisely this result if $\psi$ factors through $G'$.

It therefore remains to show that (\ref{e:rlpsi}) holds if $\psi$ is an odd character of $\mathfrak{g}'$ that does not factor through $G'$. For such $\psi$, there exists $\sigma$ in the kernel of $\mathfrak{g}' \longrightarrow G'$ such that $\psi(\sigma) \neq 1$.  Since $\psi$ has prime-to-$p$ order, the element $1 - \psi(\sigma)$ is a unit in $\mathcal{O}$.  It follows that the image of $1 - \sigma \in I$ in $R_\psi$ is a unit.  Since ${\mscr L} I = 0$ in $R_{{\mscr L}}$, it follows that the image of ${\mscr L}$  in $R_{{\mscr L}, \psi}$ vanishes, and hence that
\begin{equation} \label{e:rlcong}
 R_{{\mscr L}, \psi} \cong R_\psi / (\Theta_L, I^2). \end{equation}
In view of the definition (\ref{e:nablaldef}), and again applying ${\mscr L} =0$ in $R_{{\mscr L}, \psi}$, we find
\begin{align*}
  \nabla_{\!{\mscr L}, \psi} & \cong (\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_{R_{{\mscr L}, \psi}})/(\overline{b}_1)  \\
  & \cong \nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)_{R_{{\mscr L}, \psi}},
\end{align*}
since $\tilde{\nabla}_{\Sigma}^{\Sigma'}(L) / \overline{b}_1 \cong \nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)$ by the definitions of these modules.
Now $\Fitt_R( \nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(L)_R) = (\Theta_L)$ by \cite{dk}*{Theorem 3.3} as stated in Theorem~\ref{t:dkresult} above.
The desired result (\ref{e:rlpsi}) follows since $\Theta_L = 0$ in $R_{{\mscr L}, \psi}$ by (\ref{e:rlcong}).
\end{proof}

\begin{lemma} \label{l:k} Let $\chi$ be an odd character of $G'$ and let $\mathfrak{K} \subset \mathfrak{g}', K \subset G'$ denote the kernels of $\chi$
when viewed as characters of $\mathfrak{g}'$ and $G'$, respectively.  Let $R_{{\mscr L}, \chi}'$ and $\nabla_{\!{\mscr L}, \chi}'$ denote the ring $R_{{\mscr L}, \chi}$ and module  and $\nabla_{\!{\mscr L}, \chi}$, respectively, defined using the fields $L^{\mathfrak{K}}$ and $H^K$ in place of $L$ and $H$.  Then there exist canonical isomorphisms
\[
R_{{\mscr L}, \chi}' \cong R_{{\mscr L}, \chi}, \qquad  \nabla_{\!{\mscr L}, \chi}' \cong  \nabla_{\!{\mscr L}, \chi}.
\]
\end{lemma}

\begin{proof}  There is clearly an $\mathcal{O}[\mathfrak{g}]$-algebra isomorphism $R_\chi' \cong R_\chi$, as these are both the group ring $\mathcal{O}[\mathfrak{g}_p]$ in which $g=g_p g'$ acts via $\chi(g')$.  The elements $\Theta_{L^{\mathfrak{K}}}$ and $\Theta_L$ correspond under this isomorphism.  Similarly we have an isomorphism $\overline{R}_\chi' \cong \overline{R}_\chi$ under which $\Theta_{H^K}$ and $\Theta_H$ correspond.
The $\mathcal{O}[\mathfrak{g}]$-algebra isomorphism $R_{{\mscr L},  \chi}' \cong R_{{\mscr L},  \chi}$ follows immediately from these considerations.

For the second isomorphism of the lemma, we first show that
\begin{equation} \label{e:nablachi}
\tilde{\nabla}_{\Sigma}^{\Sigma'}(L)_{R_\chi} \cong
\tilde{\nabla}_{\Sigma}^{\Sigma'}(L^{\mathfrak{K}})_{R_\chi}.
\end{equation}
For this, we note that by \cite{dk}*{Lemma B.1}, there is an isomorphism
\[
V^\theta(L^{\mathfrak{K}}) \cong (\mathrm{N} {\mathfrak{K}}) V^\theta(L) \subset V^\theta(L),
\]
yielding a commutative diagram
\[
\begin{tikzcd}
V^\theta(L^{\mathfrak{K}}) \ar[r] \ar[d] & B^\theta_{\Sigma}(L^{\mathfrak{K}}) \ar[r] \ar[d, "\mathrm{N} \mathfrak{K}"] & \tilde{\nabla}_{\Sigma}^{\Sigma'}(L^{\mathfrak{K}}) \ar[r] \ar[d] & 0 \\
V^\theta(L) \ar[r] & B^\theta_{\Sigma}(L) \ar[r]  & \tilde{\nabla}_{\Sigma}^{\Sigma'}(L) \ar[r] & 0.
\end{tikzcd}
\]
Upon tensoring with $R_\chi$, the arrow labelled $\mathrm{N} \mathfrak{K}$ becomes an isomorphism.  Indeed, $\mathfrak{K}$ acts trivially on $R_\chi$, whence $\mathrm{N} \mathfrak{K}$ acts as $\#\mathfrak{K}$, which is prime-to-$p$ and hence invertible in $\mathbf{Z}_p$.  The isomorphism (\ref{e:nablachi}) follows.

The desired isomorphism $\nabla_{\!{\mscr L}, \chi}' \cong  \nabla_{\!{\mscr L}, \chi}$ now follows from the definition (\ref{e:nablaldef}).
\end{proof}

In view of Lemma~\ref{l:k}, we may (and do) hereafter replace $(L, H)$ by $(L^{\mathfrak{K}}, H^K)$ and therefore assume that $\mathfrak{g}' = G'$ and that $\chi$ is a faithful character of $G'$.  In particular, $G'$ is cyclic and \[ \Gamma = \ker(\mathfrak{g} \longrightarrow G)\] is a $p$-group.

\section{Group ring valued Hilbert modular forms} \label{s:cusp}

Let $m$ be a positive integer. Let $\chi$ be an odd character of $G'$.
In this section, we use the theory of group ring valued Hilbert modular forms to produce an $R_{{\mscr L}, \chi}$-module
$\tilde{B}_p$  and a cohomology class $\kappa \in H^1(G_F, \tilde{B}_p)$ satisfying the conditions of Theorem~\ref{t:nl}.
At some point, we will have to assume that $\mathfrak{p}$ is not the only prime of $F$ above $p$ (the case of one prime above $p$ will be handled in
\S\ref{s:onep}).
We will calculate that \[  \Fitt_{R_{{\mscr L}, \chi}}(\tilde{B}_p) \subset (p^m), \] which in conjunction with the $R_{{\mscr L}, \chi}$-module surjection
  \[ \nabla_{\!{\mscr L}, \chi} \longrightarrow \tilde{B}_p \] of Theorem~\ref{t:nl} yields
   \[ \Fitt_{R_{{\mscr L}, \chi}}(\nabla_{\!{\mscr L}, \chi}) \subset (p^m). \]
   Since this holds for all $m$, we have $\Fitt_{R_{{\mscr L}, \chi}}(\nabla_{\!{\mscr L}, \chi}) = 0$.   Lemma~\ref{l:fittchi} implies $\Fitt_{R_{{\mscr L}}}(\nabla_{\!{\mscr L}}) = 0$, which by
    Theorem~\ref{t:mfig} completes the proof of the $p$-part of Gross's Conjecture.

   We refer the reader to \cite{dk}*{Section 7} for our definitions on group ring valued Hilbert modular forms, recalling only the essential notation here.  Let $\mathfrak{n} \subset \mathcal{O}_F$ denote an integral ideal and $k \ge 1$ a positive integer. We let $M_k(\mathfrak{n})$ denote the space of Hilbert modular forms of level $\mathfrak{n}$ and weight $k$.  The subgroup of forms whose $q$-expansion coefficients at all unramified cusps lie in $\mathbf{Z}$ is denoted $M_k(\mathfrak{n}, \mathbf{Z})$.  If $A$ is any abelian group, we let $M_k(\mathfrak{n}, A) = M_k(\mathfrak{n}, \mathbf{Z}) \otimes A$.  The space $M_k(\mathfrak{n}, \mathbf{Z})$ is endowed with an action of ``diamond operators" $S(\mathfrak{m})$, indexed by the classes $\mathfrak{m} \in G_\mathfrak{n}^+$, the narrow ray class group of $F$ associated to the conductor $\mathfrak{n}$.
   Suppose now that $R$ is a ring and $\pmb{\psi} \colon G_\mathfrak{n}^+ \longrightarrow R^*$ is a character.  Suppose that the abelian group $A$ has an $R$-module  structure.  Then  we define
   \[ M_k(\mathfrak{n}, A, \pmb{\psi}) = \{ f \in M_k(\mathfrak{n}, A) \colon f_{|S(\mathfrak{m})} = \pmb{\psi}(\mathfrak{m}) f  \text{ for all } \mathfrak{m} \in G_\mathfrak{n}^+ \}. \]
   These are the forms of nebentypus $\pmb{\psi}$.  In our applications below, $R$ is a group ring (or a factor of a group ring), and $\pmb{\psi}$ is the tautological character.  For this reason, we call $M_k(\mathfrak{n}, A, \pmb{\psi})$ the space of {\em group ring valued modular forms}.   We write $S_k(\mathfrak{n}, A, \pmb{\psi}) \subset M_k(\mathfrak{n}, A, \pmb{\psi})$ for the subspace of cusp forms.

\subsection{The modified group ring Eisenstein series}

We begin by recalling the reductions of previous sections.  By the results of \S\ref{s:remove}, we may assume that $T$ (and hence $\Sigma'$) contains no primes above $p$.  By the results of \S\ref{s:comp} we may assume that
 $\mathfrak{g}' = G'$ and that $\chi$ is a faithful odd character of $G'$.  In particular, $G'$ is cyclic and $\Gamma = \ker(\mathfrak{g} \longrightarrow G)$ is a $p$-group.

Let
\begin{equation} \label{e:conds}
 \mathfrak{n}_0 = \cond(L/F),  \qquad \mathfrak{n} = \lcm(\mathfrak{n}_0, \ \prod_{\mathclap{\mathfrak{q} \in \Sigma_\mathfrak{p} \cup \Sigma'}} \mathfrak{q} \, ).
\end{equation}

  Let $\mathfrak{P}$ be the $p$-part of $\mathfrak{n}$.  Note that $\mathfrak{P} \neq 1$ as $\mathfrak{p} \mid \mathfrak{P}$.
 We write
 \[ A = R_\chi = \mathcal{O}[\mathfrak{g}_p]_{\chi}, \qquad \overline{A} = \overline{R}_\chi = \mathcal{O}[G_p]_\chi. \]
  There are canonical $\mathcal{O}[\mathfrak{g}]$-algebra injections with finite cokernel:
  \[ A \hookrightarrow \prod_{\mathclap{\substack{\psi \in \hat{\mathfrak{g}} \\ \psi|_{\mathfrak{g}'} = \chi}}} \mathcal{O}_\psi, \qquad \overline{A} \hookrightarrow \prod_{\mathclap{\substack{\psi \in \hat{G} \\ \psi|_{G'} = \chi}}} \mathcal{O}_\psi, \qquad x \mapsto (\psi(x))_\psi. \]
 Here $\mathcal{O}_\psi$ denotes the ring $\mathcal{O}$ on which $\mathfrak{g}$ acts by the character $\psi$.  We call the characters indexing these products the {\em characters of $A$} and the {\em characters of $\overline{A}$,} respectively.  In particular, a character of $\overline{A}$ is simply a character of $A$ that is trivial on $\Gamma$.

 \begin{lemma} \label{l:psicond}
  Let $\psi$ be any character of $A$, and let $\mathfrak{c}_0 = \cond(\psi)$.  Let $\mathfrak{c} = \lcm(\mathfrak{c}_0, \mathfrak{P})$, and let $\mathfrak{l} = \mathfrak{n}/\mathfrak{c}$.  Then $\mathfrak{l}$ is a square-free product of primes not dividing $p$.
 \end{lemma}

  \begin{proof}  The fact that the primes dividing $\mathfrak{l}$ do not lie above $p$ is clear since $\mathfrak{P}$ is the $p$-part of $\mathfrak{n}$ and $\mathfrak{P} \mid \mathfrak{c}$.  To prove that $\mathfrak{l}$ is square-free, suppose that $\mathfrak{q}$ is a prime not lying above $p$ such that $\mathfrak{q}^m \mid \mathfrak{n}$ with $m \ge 2$.  It suffices to show that $\mathfrak{q}^m \mid \mathfrak{c}$, whence $\mathfrak{q} \nmid \mathfrak{l}$.
  By the definition of $\mathfrak{n}$, we must have $\mathfrak{q}^m \mid \mathfrak{n}_0 = \cond(L/F)$.
  The proof now follows exactly as \cite{dk}*{Lemma 8.13}.
  \end{proof}

  Let $\psi$ be a character of $A$.  Denote by $\psi_\mathfrak{P}$ the character $\psi$ viewed with modulus divisible by all primes dividing $\mathfrak{P}$. In \cite{dk}*{Definition 8.2}, we defined the following linear combination of level-raised Eisenstein series (where $\mathfrak{l}$ is as in Lemma~\ref{l:psicond}):
  \begin{equation} \label{e:wkpsi1def}
{W}_k(\psi_{\mathfrak{P}}, 1) = \sum_{\mathfrak{a} \mid \mathfrak{l}}  \mu(\mathfrak{a})\psi(\mathfrak{a}) \mathrm{N}\mathfrak{a}^k E_k(\psi_{\mathfrak{P}},1)|_{\mathfrak{a}}  \in M_k(\mathfrak{n}, \psi).
\end{equation}
Here $\mu$ is the M\"obius function, which for squarefree ideals $\mathfrak{a}$ with $r$ prime factors
satsifies $\mu(\mathfrak{a})=(-1)^r$.

As we now recall, we showed in \cite{dk}*{\S8} that the forms $W_k(\psi_{\mathfrak{P}}, 1)$ interpolate into a group ring-valued family of modular forms, and we calculated the constant terms of this family at certain cusps.  Let
 \[ \pmb{\psi} \colon \mathfrak{g} \longrightarrow A^*, \qquad g=g_p g' \mapsto g_p \chi(g') \] denote the canonical character.  We recall from \cite{dk}*{\S7.2.3} our notation for the set of cusps of level $\mathfrak{n}$, denoted $\cusps(\mathfrak{n})$.
 A cusp $[\mathcal{A}]$ is represented by a pair $\mathcal{A} =(M, \lambda)$ where $M \in {\bf GL}_2^+(F)$ and $\lambda \in \Cl^+(F)$, the narrow  class group of $F$.  The definition of $M_k(\mathfrak{n})$ involves the choice, for each $\lambda \in \Cl^+(F)$, of a representative ideal $\mathfrak{t}_\lambda$.  Writing $\mathfrak{d}$ for the different of $F$ and letting $M = \mat{a}{b}{c}{d}$, we define the ideals
 \[ \mathfrak{b}_\mathcal{A} = a\mathcal{O}_F + c(\mathfrak{t}_\lambda \mathfrak{d})^{-1}, \quad \mathfrak{c}_{\mathcal{A}} = c(\mathfrak{t}_\lambda \mathfrak{d} \mathfrak{b}_\mathcal{A})^{-1}. \]
 Following \cite{dk}*{\S7.2.5} we define for any integral ideal $\mathfrak{b} \mid \mathfrak{n}$:
 \begin{align*}
C_\infty(\mathfrak{b}, \mathfrak{n}) &= \{ [\mathcal{A}] \in \cusps(\mathfrak{n})\colon \mathfrak{b} \mid \mathfrak{b}_\mathcal{A}\} \\
C_0(\mathfrak{b}, \mathfrak{n}) &= \{ [\mathcal{A}] \in \cusps(\mathfrak{n})\colon \gcd(\mathfrak{b}, \mathfrak{b}_\mathcal{A})=1\}.
 \end{align*}
 If $\mathfrak{b} = \mathfrak{n}$, we simply write $C_\infty(\mathfrak{n})$ and $C_0(\mathfrak{n})$.  The notion of {\em normalized constant term} of a modular form at a cusp is defined in \cite{dk}*{\S7.2.3}.
In the remainder of the paper, we write for simplicity $\Theta_H = \Theta_{\Sigma, \Sigma'}^H$ and  $\Theta_L= \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^L$   as in \S\ref{s:rw} above.

 \begin{prop}  \label{p:wconstantterms}  There exists  a group ring valued form
\begin{equation} \label{e:wbpsi}
W_1(\pmb{\psi}, 1) \in M_1(\mathfrak{n},A, \pmb{\psi})
\end{equation}
such that the specialization of $W_1(\pmb{\psi}, 1)$ at character $\psi$ of $A$ is the form
$W_1(\psi_{\mathfrak{P}}, 1)$.
The normalized constant term of $W_1(\pmb{\psi}, 1)$ at a cusp $\mathcal{A}$ such that $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n})$
is
 \begin{equation} \label{e:wkconst}
C_1^L(\mathcal{A}) = \begin{cases}
\mathrm{sgn}(\mathrm{N} a) \pmb{\psi}^{-1}(a \mathfrak{b}_\mathcal{A}^{-1})\Theta_L^\#/2^n  & \text{if } [\mathcal{A}] \in C_\infty(\mathfrak{n}) \\
0 &  \text{if } [\mathcal{A}] \in C_\infty(\mathfrak{P},\mathfrak{n})  \setminus C_\infty(\mathfrak{n}).
\end{cases}
\end{equation}
\end{prop}

Recall here that $\#$ denotes the involution on $R$ induced by $g \mapsto g^{-1}$ for $g \in \mathfrak{g}$.

\begin{proof}  For any odd $k \ge 1$,
a group ring valued form $W_k(\pmb{\psi}, 1) \in M_k(\mathfrak{n}, \Frac(A), \pmb{\psi})$ is defined in \cite{dk}*{Proposition 8.14, eqn.~(102)}, with notation from \emph{loc.\,cit.}, by
 \[
 W_k(\pmb{\psi}, 1) = \sum_{\mathfrak{m} \mid \mathfrak{l}} \mathrm{N} I_{\mathfrak{m}} \cdot \tilde{E}_k(\pmb{\psi}^{\mathfrak{m}}, 1)|_{\mathfrak{m}} \pmb{\psi}^{\mathfrak{m}}(\mathfrak{m}) \frac{1}{\# I_{\mathfrak{m}}} \prod_{v \mid \mathfrak{m}} (1- \mathrm{N} v^k).
 \]
Note that this definition and the proof that $W_k(\pmb{\psi},1)$ specializes under a character $\psi$ of $A$ to $W_k(\psi_\mathfrak{P}, 1)$ uses the result of Lemma~\ref{l:psicond}.  All the normalized Fourier coefficients of $W_k(\pmb{\psi},1)$ lie in $A$, except for possibly the constant terms, which lie in $\Frac(A)$.

By \cite{dk}*{Proposition 8.7}, the constant term of $W_1(\psi_\mathfrak{P}, 1)$ at a cusp $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n}) \setminus C_\infty(\mathfrak{n})$ vanishes, and at a cusp $[\mathcal{A}] \in C_\infty(\mathfrak{n})$ equals
\[
\mathrm{sgn}(\mathrm{N} a) \psi^{-1}(a \mathfrak{b}_\mathcal{A}^{-1})\frac{L_{\Sigma_\mathfrak{p}, \Sigma'}(\psi, 0)}{2^n}.
\]
The element of $A$ interpolating these specializations is the element $C^L_1(\mathcal{A})$ defined in (\ref{e:wkconst}).  Since $C_1^L(\mathcal{A}) \in A$, we obtain $W_1(\pmb{\psi}, 1) \in M_1(\mathfrak{n},A, \pmb{\psi})$.
\end{proof}

We have an analogous construction of group ring forms over $G$.  We write \[ \overline{A} = \overline{R}_\chi = \mathcal{O}[G_p]_\chi. \]  Let
\[ \overline{\pmb{\psi}} \colon \mathfrak{g} \longrightarrow \overline{A}^* \]
denote the reduction of $\pmb{\psi}$.  Note that $\overline{\pmb{\psi}}$ factors through $\mathfrak{g} \longrightarrow G$.
As in (\ref{e:conds}), we let
\[ \mathfrak{m}_0 = \cond(H/F), \qquad \mathfrak{m} = \lcm(\mathfrak{m}_0, \ \prod_{\mathclap{\mathfrak{q} \in \Sigma \cup \Sigma'}} \mathfrak{q} \, ). \]
Note that here, $\mathfrak{p}$ does not divide the level $\mathfrak{m}$.  Since we have $\mathfrak{g}' = G'$, however, the levels $\mathfrak{n}$ and $\mathfrak{m}$ agree away from $p$, i.e. if $\mathfrak{P}_0$ denotes the $p$-part of $\mathfrak{m}$, then $\mathfrak{n}/\mathfrak{P} = \mathfrak{m}/\mathfrak{P}_0$.
(This fact implies that Propositions~\ref{p:wct1b} and~\ref{p:wct2} below, which {\em a priori} would apply to the cusps in $C_\infty(\mathfrak{P}_0, \mathfrak{m})$, also apply to the cusps in $C_\infty(\mathfrak{P}, \mathfrak{n})$.)

We use  \cite{dk}*{Proposition 8.14, eqn.~(102)} again to define, for odd $k \ge 1$,  a group ring valued modular form
\begin{equation} \label{e:fraca}
 W_k(\overline{\pmb{\psi}}, 1) \in  M_k(\mathfrak{m}, \Frac(\overline{A}), \overline{\pmb{\psi}}) \subset M_k(\mathfrak{n}, \Frac(\overline{A}), \overline{\pmb{\psi}}).
 \end{equation}
Again, the $q$-expansion coefficients of $W_k(\overline{\pmb{\psi}}, 1)$ other than possibly the constant terms lie in $\overline{A}$.
The specialization of $W_k(\overline{\pmb{\psi}}, 1)$ at a character $\psi$ of $\overline{A}$ is ${W}_k(\psi_{\mathfrak{P}_0}, 1)$, defined as in (\ref{e:wkpsi1def}) with $\mathfrak{P}$ replaced by $\mathfrak{P}_0$.

We now discuss the constant terms of $W_k(\overline{\pmb{\psi}}, 1)$ for odd $k \ge 1$.
The following result  follows directly from  \cite{dk}*{Proposition 8.7}.
 \begin{prop} \label{p:wct1b}
If $\Sigma \setminus S_\infty$ is nonempty, the normalized constant term of $W_1(\overline{\pmb{\psi}},1)$ at a cusp $\mathcal{A}$ such that $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n})$ is
\[
C^H_1(\mathcal{A}) =
\begin{cases}
\mathrm{sgn}(\mathrm{N} a) {\overline{\pmb{\psi}}}^{-1}(a \mathfrak{b}_{\mathcal{A}}^{-1})\Theta_H^\#/2^n & \text{if } [\mathcal{A}] \in C_\infty(\mathfrak{n}) \\
0 &  \text{if } [\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n}) \setminus C_\infty(\mathfrak{n}).
\end{cases}
\]
 In particular, if $\Sigma \setminus S_\infty$ is nonempty we have $W_1(\overline{\pmb{\psi}},1) \in M_1(\mathfrak{n}, \overline{A}, \overline{\pmb{\psi}})$.
\end{prop}

If $\Sigma = S_\infty$ (in which case $\mathfrak{P}_0 = 1$) the situation is more complicated for $W_1(\overline{\pmb{\psi}},1)$.
Furthermore in this case we  require the constant terms of the forms $W_k(\overline{\pmb{\psi}},1)$ for odd $k\ge 3$.

For each character $\psi$ of $\overline{A}$, let $\mathfrak{b}_0 = \cond(\psi)$, $\mathfrak{b} = \lcm(\mathfrak{b}_0, \mathfrak{P}_0)$, and $\mathfrak{l} = \mathfrak{m}/\mathfrak{b}$.
If $[\mathcal{A}]$ is a cusp, we follow \cite{dk}*{Definition 8.3} and define two sets of primes:
\[ J_\mathfrak{l} = \{ \mathfrak{q} \mid \mathfrak{l} \colon [\mathcal{A}] \in C_0(\mathfrak{q}, \mathfrak{n}) \}, \qquad  J_\mathfrak{l}^c =  \{ \mathfrak{q} \mid \mathfrak{l} \colon [\mathcal{A}] \in C_\infty(\mathfrak{q}, \mathfrak{n}) \}. \]
Define $C_k'(\mathcal{A})$ to be the unique element of
 $\Frac(\overline{A})$
 such that for each character $\psi$ of $\overline{A}$, we have
\begin{equation} \label{e:cpdef}
 \psi(C_k'(\mathcal{A})) =  \frac{\tau(\psi)}{\mathrm{N}\mathfrak{b}_0^k} \psi(\mathfrak{c}_{\mathcal{A}}) \mathrm{sgn}(\mathrm{N}(-c)) \frac{L_{S_{\infty}, \emptyset}(\psi^{-1}, 1-k)}{2^n}
 \prod_{\mathfrak{q} \in J_{\mathfrak{l}}^c}(1 - \mathrm{N} \mathfrak{q}^k) \prod_{\mathfrak{q} \in J_{\mathfrak{l}}}(1- \psi(\mathfrak{q}))
 \end{equation}
if $[\mathcal{A}] \in C_0(\mathfrak{b}_0, \mathfrak{n})$, and \[  \psi(C_k'(\mathcal{A})) = 0 \] if $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n}) \setminus C_0(\mathfrak{b}_0, \mathfrak{n})$.  Here $\tau(\psi)$ denotes the Gauss sum defined in \cite{dka}*{Definition 4.1}.  The following proposition follows directly from \cite{dk}*{Proposition 8.7}.

\begin{prop} \label{p:wct2}  Suppose that $\Sigma = S_\infty$. The normalized constant term of $W_k(\overline{\pmb{\psi}}, 1)$ at a cusp $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n})$ is equal to $C^H_1(\mathcal{A}) + C_1'(\mathcal{A})$ if $k = 1$, and is equal to $C_k'(\mathcal{A})$ if $k > 1$.
\end{prop}

\subsection{Construction of a cusp form} \label{s:ccf}

In this section we construct the cusp form required in our proof. The construction will need to be split into several cases.
Recall that $\mathfrak{P}$ is the $p$-part of $\mathfrak{n}$.  The ideal $\mathfrak{P}$ is divisible precisely by the primes in $\Sigma_\mathfrak{p} =\Sigma \cup \{ \mathfrak{p} \}$.
Define $\mathfrak{P}'$ to be the product of all other primes above $p$, i.e.
\[
\mathfrak{P}' = \prod_{\mathclap{\mathfrak{q} \mid p, \ \mathfrak{q} \nmid \mathfrak{P}}} \mathfrak{q}.
\]

\begin{itemize}
\item Case 1: the set $\Sigma \setminus S_\infty$ is non-empty, i.e. $\mathfrak{p}$ is not the only prime dividing $\mathfrak{P}$.
\end{itemize}
In Case 2, we have $\Sigma = S_\infty$.
Note that the eigenvalues of the form $W_1(\pmb{\psi}, 1)$ for the operator $U_\mathfrak{q}$, $\mathfrak{q} \mid \mathfrak{P}'$, are $\pmb{\psi}(\mathfrak{q})$ and $1$.  If $\chi(\mathfrak{q}) \neq 1$, then these are not congruent modulo the maximal ideal of $A$.  To ensure that the Hecke algebras we work with are local, it will be convenient to project to the eigenspace with eigenvalue $1$.
Let
\[
\mathfrak{P}'_0  =\prod_{\mathclap{\substack{\mathfrak{q} \mid \mathfrak{P}' \\ \chi(\mathfrak{q}) \neq 1}}} \mathfrak{q}, \qquad
\mathfrak{P}'_1  =\prod_{\mathclap{\substack{\mathfrak{q} \mid \mathfrak{P}' \\ \chi(\mathfrak{q}) = 1}}} \mathfrak{q}.
\]
We subdivide Case 2 into three cases:
\begin{itemize} \item Case 2(a): $\mathfrak{P}'_0 \neq 1$.
\item Case 2(b): $\mathfrak{P}'_0 = 1, \mathfrak{P}'_1 \neq 1$.
\item Case 2(c): $\mathfrak{P}'_0 = \mathfrak{P}'_1 = 1$, i.e.\ $\mathfrak{p}$ is the only prime above $p$ in $F$.
\end{itemize}

We consider the module \[ \Lambda = A \oplus \overline{A},\]
endowed with the canonical diagonal $A$-action.
  We view $A = A \oplus 0$ as a submodule of $\Lambda$ and denote the vector $(0,1) \in \Lambda$ by $\lambda$, so elements of $\Lambda$ will be written $a + \lambda b$ with $a \in A, b \in \overline{A}.$

 As in the previous section, we have the canonical characters  \[
\pmb{\psi}\colon \mathfrak{g} \longrightarrow A^*, \qquad \overline{\pmb{\psi}}  \colon \mathfrak{g} \longrightarrow G \longrightarrow \overline{A}^*.
 \]
 We denote the image of $I$ in $A$ (i.e.\ the kernel of the canonical projection $A \longrightarrow \overline{A}$) by $I_A$.
Recall the following result of Silliman \cite{silliman}*{Theorem 10.7}, a  generalization of a result of Hida.
\begin{theorem} \label{t:hida}  Fix a positive integer $m$.  For positive integers $k \equiv 0 \pmod{(p-1)p^{N}}$ with $N$ sufficiently large depending on $m$,
there is a modular form $V_{k} \in M_k(1, \mathbf{Z}_p, 1)$ such that
$c(\mathfrak{m}, V_{k})  \equiv 0 \pmod{p^m}$ for all integral ideals $\mathfrak{m}$, and such that the normalized constant term  $c_{\mathcal{A}}(0,V_k)$
 for each cusp $[\mathcal{A}]$ is congruent to $1 \pmod{p^m}$.
\end{theorem}

To apply this result, we hereafter assume that $m$ is fixed and $k \equiv 1 \pmod{(p-1)p^{N})}$ with $N$ sufficiently large that the conclusion of Theorem~\ref{t:hida} holds.  In  subsequent arguments we will make $N$ larger still if necessary to obtain other properties of our modular forms.

In Case 1, we define
\[
  f = (W_1( \pmb{\psi},1) - \lambda W_1(\overline{\pmb{\psi}},1)) V_{k-1} \in M_k(\mathfrak{n}, \Lambda, \pmb{\psi}).
\]
Note here that $W_1( \pmb{\psi},1) \in M_k(\mathfrak{n}, A, \pmb{\psi})$ and $W_1(\overline{\pmb{\psi}},1) \in  M_k(\mathfrak{n}, \overline{A}, \overline{\pmb{\psi}})$ by
Propositions~\ref{p:wconstantterms} and~\ref{p:wct1b}, respectively.

In Case 2 we
recall the non-zerodivisor
 \begin{equation} \label{e:xdef}
 x = x(k) = \frac{\Theta^{H/F}_{S_{\infty}, \emptyset}(1-k)}{\Theta^{H/F}_{S_{\infty}, \emptyset}} \in \Frac(\overline{A}) \end{equation}
 considered in \cite{dk}*{Theorem 8.16}.
 The elements $\Theta^{H/F}_{S_{\infty}, \emptyset}(1-k)$ and $\Theta^{H/F}_{S_{\infty}, \emptyset}$ belong to $\Frac(\overline{A})$ and interpolate the nonzero algebraic numbers
$L_{S_\infty, \emptyset}(\psi^{-1}, 1-k)$ and $L_{S_{\infty}, \emptyset}(\psi^{-1}, 0)$, respectively, as $\psi$ ranges over the characters of $A$. For $k>1$ and $k \equiv 1 \pmod{(p-1)p^N)}$ with $N$ sufficiently large, the ratio $x$ belongs to $\overline{A}$ by {\em loc.\,cit.}  We hereafter assume that $N$ is chosen so that this holds.
 Let \begin{equation} \label{e:tx}
 \tilde{x} = \text{ any non-zerodivisor lift of }x \text{ to }A.
 \end{equation}
We define in Case 2:
\begin{equation} \label{e:fdef2ab}
 f = \tilde{x}  \left(W_1( \pmb{\psi},1) - \lambda W_1(\overline{\pmb{\psi}},1)\right) V_{k-1} + \lambda W_k(\overline{\pmb{\psi}}, 1).
\end{equation}

{\em A priori}, in Case 2 the form $f$ lies in $M_k(\mathfrak{n}, \Lambda \otimes_{\mathbf{Z}_p} \mathbf{Q}_p, \pmb{\psi})$ since we have only shown that the constant terms of the forms $W_1(\overline{\pmb{\psi}}, 1)$ and $W_k(\overline{\pmb{\psi}},1)$ lie in $\Frac(\overline{A}) = \overline{A} \otimes_{\mathbf{Z}_p} \mathbf{Q}_p$.  However, the proposition below shows that in fact $f \in M_k(\mathfrak{n}, \Lambda, \pmb{\psi})$.
In order to state results in all cases simultaneously, we set $\tilde{x} = 1$ in Case 1 for the remainder of the paper.

\begin{prop} \label{p:fcusp} With $N$ and $k$ as above, we have in all cases $f \in M_k(\mathfrak{n}, \Lambda, \pmb{\psi})$.  Furthermore the form $f$ has constant terms at cusps $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n})$
lying in the submodule $ J \subset \Lambda$, where
\begin{equation}  \label{e:jdef}
J =   \tilde{x}J_0, \qquad J_0 = \left(I_A^2, \Theta_L^\# - \Theta_H^\# \lambda, \  p^m\Lambda\right).
\end{equation}
\end{prop}

\begin{proof} We give the proof in Case 2, as Case 1 is similar and in fact easier.

We first note that the non-constant term $q$-expansion coefficients of $f$ lie in $\Lambda$.
Indeed, all the forms appearing in the definition of $f$ have non-constant term $q$-expansion coefficients lying in $\Lambda$,
 so any failure of integrality of non-constant terms can  arise only from multiplying the constant terms of $W_1(1, \overline{\pmb{\psi}})$ by the non-constant terms of $V_{k-1}$. For $k \equiv 1 \pmod{(p-1)p^{N}}$ and $N$ sufficiently large, the non-constant terms of $V_{k-1}$ are divisible by any desired power of $p$, and this product will be integral.

We will prove the integrality of the constant terms of $f$ and the statement about constant terms simultaneously.
By Propositions~\ref{p:wconstantterms} and \ref{p:wct2}, the constant term of $f$ at a cusp $[\mathcal{A}] \in C_\infty(\mathfrak{P}, \mathfrak{n})$ is equal to
\begin{align*}
 & \left( C^L_1(\mathcal{A}) - \lambda C^H_1(\mathcal{A})- \lambda C_1'(\mathcal{A})\right) \tilde{x} y + \lambda  C_k'(\mathcal{A})  \\
 \equiv \ &  \left( \tilde{x}C_1^L(\mathcal{A}) - \tilde{x} \lambda C_1^H(\mathcal{A})\right) -
\lambda \left(C_1'(\mathcal{A}) \tilde{x}y - C_k'(\mathcal{A})\right),
\end{align*}
where $y = c_{\mathcal{A}}(0, V_{k-1}) \equiv 1 \pmod{p^m}$ and the congruence is modulo $\tilde{x} p^m \Lambda \subset J$. For the first term, we have
\[
 \left( \tilde{x} C_1^L(\mathcal{A}) - \tilde{x} \lambda C_1^H(\mathcal{A}) \right) =  \frac{\mathrm{sgn}(\mathrm{N} a) \pmb{\psi}^{-1}(a \mathfrak{b}_{\mathcal{A}}^{-1})}{2^n}\left(\tilde{x}\Theta_L^\# - \tilde{x}\Theta_H^\# \lambda \right) \in J. \]
It remains to show that $x y C_1'(\mathcal{A}) -   C_k'(\mathcal{A})$ lies in $\overline{A}$ and  is divisible by $x p^m$. Now
$C_1'(\mathcal{A})$ is some fixed element of $\Frac(\overline{A})$ and $x \in \overline{A}$, so for $y$ sufficiently close to 1 $p$-adically, $(y - 1) C_1'(\mathcal{A})$ will lie in $p^m \overline{A}$.  Therefore it suffices to show that $x C_1'(\mathcal{A}) -  C_k'(\mathcal{A})$ lies in $\overline{A}$ and  is divisible by $x p^m$, i.e.\ that $C_1'(\mathcal{A}) -  x^{-1} C_k'(\mathcal{A})$ lies in $p^m\overline{A}$.

For this, we note that by the definition (\ref{e:xdef}), multiplying by the factor $x^{-1}$ exactly replaces the $L$-value in the definition (\ref{e:cpdef}) of $C_k'(\mathcal{A})$ with that appearing in $C_1'(\mathcal{A})$, hence
\[
 C_1'(\mathcal{A}) -  x^{-1}\Theta_H C_k'(\mathcal{A}) = C_1'(\mathcal{A}) \left( 1 - \mathrm{N}\mathfrak{b}_0^{1-k} \prod_{\mathfrak{q} \in J_{\mathfrak{l}}^c}\frac{1-\mathrm{N}\mathfrak{l}_i^k}{1 - \mathrm{N}\mathfrak{l}_i} \right).
\]
For  $k \equiv 1 \pmod{(p-1)p^{N}}$ and $N$ sufficiently large, the term in parentheses can be made divisible by arbitrarily large powers of $p$. (Note we are in Case 2, whence $\mathfrak{b}_0$ is prime to $p$.)
The result follows.
\end{proof}

\begin{corollary} \label{c:gdef}
There exists a $p$-ordinary cusp form $g \in S_k(\mathfrak{n}\mathfrak{P}', \Lambda, \pmb{\psi})^{p\text{-ord}}$ such that in Cases 1 and 2(a) we have
\[
g \equiv W_1( \pmb{\psi}_{\mathfrak{P}_0'},1) - \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{P}_0'},1) \pmod{J_0},
\]
while in Cases 2(b) and 2(c) we have
\[
g \equiv \tilde{x} \big( W_1(\pmb{\psi}, 1) -\lambda W_1( \overline{\pmb{\psi}}, 1) \big) + \lambda W_k(1, \overline{\pmb{\psi}}_p) \pmod{J}.
\]
These congruences are understood to mean that the $q$-expansion coefficients $c(\mathfrak{a}, g)$ for nonzero ideals $\mathfrak{a} \subset \mathcal{O}_F$ are congruent modulo $J_0$ or $J$ to the coefficients of the expressions on the right.
\end{corollary}

\begin{proof}
Silliman's result \cite{silliman}*{Theorem 10.8}
 implies that there is an element $f' \in M_k(\mathfrak{n}, J, \pmb{\psi})$ whose constant terms at $C_\infty(\mathfrak{P}, \mathfrak{n})$ agree with those of $f$.  Therefore $f - f'$ has constant terms that vanish on $C_\infty(\mathfrak{P}, \mathfrak{n})$.
 Let $e_\mathfrak{P}^{\ord}, e_p^{\ord}$ denote the ordinary operators of Hida (see \cite{dk}*{\S7.2.9}).
By
 \cite{dka}*{Theorem 5.1}, the form $g_0 = e_\mathfrak{P}^{\ord}(f - f')$ is cuspidal,
 whence \[ g = e_p^{\ord}(f -f') = e_{\mathfrak{P}'}^{\ord} g_0\] is cuspidal as well. Now the ordinary operator $e_p^{\ord}$ fixes the forms $W_1(\pmb{\psi},1)$ and $W_1(\overline{\pmb{\psi}}, 1)$, whereas it sends $W_k(\overline{\pmb{\psi}}, 1)$ to its ordinary $p$-stabilization $W_k(\overline{\pmb{\psi}}, 1_p)$.  Furthermore, $V_{k-1} \equiv 1 \pmod{p^m}$ and $p^m \in J_0$. The result follows in Cases 2(b) and 2(c).

To complete the proof in Cases 1 and 2(a), we apply the operator $\prod_{\mathfrak{q} \mid \mathfrak{P}'_0} (U_\mathfrak{q} - \pmb{\psi}(\mathfrak{q}))$.  This operator sends $W_1(\pmb{\psi}, 1)$ and $W_1(\overline{\pmb{\psi}}, 1)$ to $W_1(\pmb{\psi}_{\mathfrak{P}'_0}, 1)$ and $W_1(\overline{\pmb{\psi}}_{\mathfrak{P}'_0}, 1)$, respectively, while it annihilates $W_k(\overline{\pmb{\psi}}, 1_p).$  This gives the result in Case 1.  In Case 2(a), we obtain a cusp form $g$ satisfying
 \[ g \equiv  \tilde{x}  \left(W_1( \pmb{\psi}_{\mathfrak{P}'_0},1) - \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{P}_0'},1)\right)
\pmod{\tilde{x}J_0}. \]
This congruence in particular implies that the Fourier coefficients of $g$ are divisible by $\tilde{x}$.  Since $\tilde{x}$ is a non-zerodivisor, we may divide by it and obtain a cusp form satsifying the same congruence as in Case 1.
\end{proof}

\subsection{Homomorphism from the Hecke algebra} \label{s:hha}

We now define certain Hecke algebras acting on $S_k(\mathfrak{n}\mathfrak{P}', A, \pmb{\psi})$.
We define $\mathbf{T}$ to be the $A$-subalgebra of $\End_A(S_k(\mathfrak{n}\mathfrak{P}', A, \pmb{\psi}))$ generated over $A$ by the following operators:
\begin{itemize}
\item $T_\mathfrak{l}$ for $\mathfrak{l} \nmid \mathfrak{n}\mathfrak{P}'$,
\item $S(\mathfrak{a})$ for $(\mathfrak{a}, \mathfrak{n}\mathfrak{P}') = 1$,
\item  $U_\mathfrak{q}$ for $\mathfrak{q} \in \Sigma \setminus S_\infty$ (i.e.\ for prime $\mathfrak{q} \mid \mathfrak{P}$, $\mathfrak{q} \neq \mathfrak{p}$),
\item $(U_\mathfrak{p} - 1)^2$, and
\item $(U_\mathfrak{p} - 1)t$ for $t \in I$.
\end{itemize}

 Let $\tilde{\mathbf{T}}= \mathbf{T}[U_\mathfrak{p}]$.
Finally let $\mathbf{T}^\dagger = \tilde{\mathbf{T}}[U_\mathfrak{q}, \mathfrak{q} \mid \mathfrak{P}']$.\\

Due to the presence of the involution $\#$ in Proposition~\ref{p:fcusp}, we  consider an ``involuted" version of the ring $A_{\mscr L}$.  Define
\[
A_{{\mscr L}}^\# = A[{\mscr L}]/({\mscr L} (\Theta_H)^\# - (\Theta_L)^\#, {\mscr L} I_A, {\mscr L}^2, I_A^2).
\]

At this point, we must momentarily abandon case 2(c), when $\mathfrak{p}$ is the only prime of $F$ above $p$.  In this case, the last bullet point of the theorem below---which in some sense is the most important---does not hold.  In case 2(c), $\mathfrak{P}' = 1$, and this last bullet point then reads $\Ann_{A_{\mscr L}^\#}(W) \subset (p^m)$, which does not hold in this case.  The algebra $W$ constructed in Theorem~\ref{t:heckehom} using the form $g$ is not large enough for our purposes.  In \S\ref{s:onep} we will therefore provide a different approach to proving the congruence (\ref{e:mgc}) that only applies when there is exactly one prime of $F$ above $p$.
 For the remainder of \S\ref{s:cusp} we assume that there is at least one prime of $F$ above $p$ other than $\mathfrak{p}$.

\begin{theorem}  \label{t:heckehom} Suppose we are in Cases 1, 2(a), or 2(b), i.e.\ there exists a prime of $F$ above $p$ other than $\mathfrak{p}$.  There exists an $A_{{\mscr L}}^\#$-algebra $W$
 and a surjective $A$-algebra homomorphism \[ \varphi \colon \mathbf{T}^\dagger \longrightarrow W \] such that:
\begin{itemize}
\item $T_\mathfrak{l} \mapsto \mathrm{N}\mathfrak{l}^{k-1} + \pmb{\psi}(\mathfrak{l})$ for prime $\mathfrak{l} \nmid \mathfrak{n}\mathfrak{P}'$.
\item $S(\mathfrak{a}) \mapsto \pmb{\psi}(\mathfrak{a})$ for $(\mathfrak{a}, \mathfrak{n}\mathfrak{P}') = 1$.
\item $U_\mathfrak{q} \mapsto 1$ for prime $\mathfrak{q} \in \Sigma \setminus S_\infty$.
\item $U_\mathfrak{p} \mapsto 1 - {\mscr L}$.
\item $U_\mathfrak{q} \mapsto 1$ for prime $\mathfrak{q} \mid \mathfrak{P}_0'$.
\end{itemize}
For prime $\mathfrak{q} \mid \mathfrak{P}'$, write $\epsilon_\mathfrak{q} = \varphi(U_\mathfrak{q} - \pmb{\psi}(\mathfrak{q})) \in W$.  Then:
\begin{itemize}
\item $\epsilon_\mathfrak{q}(\epsilon_\mathfrak{q} -1 + \pmb{\psi}(\mathfrak{q})) = 0$.
\item $\Ann_{A_{{\mscr L}}^\#}\Big(\prod_{\mathfrak{q} \mid \mathfrak{P}'} \epsilon_\mathfrak{q}\Big) \subset (p^m)$.
\end{itemize}
\end{theorem}

\begin{proof} We recall from (\ref{e:jdef}) the definition
\[
J_0 = \left(I_A^2, \Theta_L^\# - \Theta_H^\# \lambda, \  p^m\Lambda\right).
\]
To streamline the notation for all cases, write
\[ X = \begin{cases} 1 & \text{Cases 1/2(a)} \\
\tilde{x} & \text{Case 2(b),}
\end{cases} \qquad K = XJ_0, \]
and recall $\mathfrak{P}_0' = 1$ in Case 2(b).
Define
\[
\mathcal{C} = \prod_{\mathfrak{a} \subset \mathcal{O}_F} \Lambda/{K},
\] with the product indexed by the nonzero ideals $\mathfrak{a} \subset \mathcal{O}_F$. There is an $A$-module map
\[
c: S_k(\mathfrak{n}\mathfrak{P}', \Lambda, \pmb{\psi}) \longrightarrow \mathcal{C}
\]
that associates to each cusp form $h$ its collection of normalized $q$-expansion coefficients $c(\mathfrak{a}, h)$ reduced modulo ${K}$. Note that if we let the operators $T_\mathfrak{l}$, $U_\mathfrak{l}$ act by the usual formulae on Fourier coefficients (see~\cite{dk}*{eqn. (97)}) and we let $S(\mathfrak{a})$ act by $\pmb{\psi}(\mathfrak{a})$, then the map $c$ is equivariant for these operators.

Let ${\cal F}$ denote the image of the $\mathbf{T}^{\dagger}$-span of the cusp form $g$ defined in Corollary~\ref{c:gdef} under the map $c$. This is an $A$-module of finite type. Define $W$ be the image of the canonical $A$-algebra homomorphism
\[
\mathbf{T}^{\dagger} \longrightarrow \End_{A}({\cal F}).
\]
This construction yields a canonical surjective $A$-algebra map
\[
\varphi: \mathbf{T}^{\dagger} \longrightarrow W
\]
that sends a Hecke operator to its action on the Hecke span of $g$ under the map $c$.

We will show in a moment that $W$ has the structure of an $A_{{\mscr L}}^\#$-algebra.  First we calculate the action of Hecke operators on $g$ using the congruence of Corollary~\ref{c:gdef}:
\begin{equation} \label{e:gcong}
 g \equiv  \begin{cases}
  W_1( \pmb{\psi}_{\mathfrak{P}_0'},1) - \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{P}_0'},1) & \text{Cases 1/2(a)} \\
 X \left(W_1( \pmb{\psi},1) - \lambda W_1(\overline{\pmb{\psi}},1)\right) + \lambda W_k(\overline{\pmb{\psi}}, 1_p)
 & \text{Case 2(b)}
\end{cases} \pmod{K}.
\end{equation}

The fact that $\varphi(S(\mathfrak{a})) = \pmb{\psi}(\mathfrak{a})$ is clear since all our forms have nebentypus $\pmb{\psi}$.
The operator $T_{\mathfrak{l}}$ acts by multiplication by $1 + \pmb{\psi}(\mathfrak{l})$ on $W_1(\pmb{\psi}, 1)$ and $W_1(\overline{\pmb{\psi}}, 1)$, and it acts by multiplication by $\mathrm{N}\mathfrak{l}^{k-1} + \pmb{\psi}(\mathfrak{l})$ on $W_{k-1}(\pmb{\psi}, 1_p)$.  Since $\mathrm{N}\mathfrak{l}^{k-1} \equiv 1 \pmod{p^m}$ and $Xp^m \in K$, we have
\[ T_\mathfrak{l}(g) \equiv (\mathrm{N}\mathfrak{l}^{k-1} + \pmb{\psi}(\mathfrak{l})) g \pmod{K}. \]

 Similarly $\varphi(U_\mathfrak{q}) = 1$ for prime $\mathfrak{q} \in \Sigma \setminus S_\infty$, since all the forms $W_1(\pmb{\psi}, 1)$, $W_1(\overline{\pmb{\psi}}, 1), W_k(\overline{\pmb{\psi}}, 1_p)$ have $U_\mathfrak{q}$-eigenvalue 1.

The most interesting action is that of $U_\mathfrak{p}$.  This operator fixes $W_1(\pmb{\psi}, 1)$, since $\mathfrak{p} \mid \mathfrak{P}$.  It also acts as $\overline{\pmb{\psi}}(\mathfrak{p}) = 1$ on $W_k(\overline{\pmb{\psi}}, 1_p)$ because of the $p$-stabilization.  Yet $U_\mathfrak{p}$ does not act as a scalar on $W_1(\overline{\pmb{\psi}}, 1)$, as it is not stabilized.  Instead $U_\mathfrak{p} - 1$ sends $W_1(\overline{\pmb{\psi}}, 1)$ to its $\mathfrak{p}$-stabilization $W_1(\overline{\pmb{\psi}}, 1_\mathfrak{p}) = W_1(\overline{\pmb{\psi}}_\mathfrak{p}, 1)$, where the equality follows since $\overline{\pmb{\psi}}(\mathfrak{p}) = 1$ and we are in weight 1.  The conclusion of these considerations is that
\begin{equation} \label{e:cc}
 (U_\mathfrak{p} - 1)g \equiv
 - \lambda X W_1(\overline{\pmb{\psi}}_{\mathfrak{p}\mathfrak{P}_0'},1)
 \pmod{K}. \end{equation}

We can now give $W$ the structure of an $A_{\mscr L}^\#$-algebra by letting ${\mscr L}$ act by $\varphi(1 - U_\mathfrak{p})$.  To prove that this is well-defined, we must show that the relations in $A_{{\mscr L}}^\#$ are satisfied in $W$, namely ${\mscr L}(\Theta^H)^\#- (\Theta^L)^\# = {\mscr L} I_A = {\mscr L}^2 = I_A^2 = 0$.  The most interesting of these is the first.  From (\ref{e:cc}), we find the following congruences mod
$K$:
\begin{align*}
 (\Theta^H)^\# (1 - U_\mathfrak{p})g & \equiv  (\Theta^H)^\# X \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{p}\mathfrak{P}_0'},1)   \\
 & \equiv  (\Theta^L)^\# XW_1(\overline{\pmb{\psi}}_{\mathfrak{p}  \mathfrak{P}_0'},1)  \\
 & \equiv  (\Theta^L)^\# g.
 \end{align*}
The second congruence follows from the definition of $K$ and the third from (\ref{e:gcong}), in view of the fact that $(\Theta_L)^\# \in I_A$
annihilates $\lambda$ while $W_1(\pmb{\psi}_{\mathfrak{P}_0'}, 1) \equiv W_1(\overline{\pmb{\psi}}_{\mathfrak{p}\mathfrak{P}_0'}, 1) \pmod{I_A}$ and
$X (\Theta^L)^\# I_A \in X I_A^2 \subset K$.  This proves that the first relation holds, while the others are similar but easier.

 Next we study the action of $U_\mathfrak{q} - \pmb{\psi}(\mathfrak{q})$ for $\mathfrak{q} \mid \mathfrak{P}'$.  This operator sends $W_1(\pmb{\psi}, 1)$ to $W_1(\pmb{\psi}_\mathfrak{q}, 1)$, sends $W_1(\overline{\pmb{\psi}}, 1)$ to $W_1(\overline{\pmb{\psi}}_\mathfrak{q}, 1)$, and annihilates
$W_k(\pmb{\psi}, 1_p)$.  For $\mathfrak{q} \mid \mathfrak{P}_1'$, we therefore have
\begin{equation}
\label{e:uq}
 (U_\mathfrak{q} - \pmb{\psi}(\mathfrak{q}))g \equiv X\left(W_1(\pmb{\psi}_{\mathfrak{q} \mathfrak{P}_0'}, 1) - \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{q} \mathfrak{P}_0'}, 1)\right)
\pmod{K}. \end{equation}
Note that $U_\mathfrak{q}$ acts as 1 on the form on the right.  This yields the equation
\begin{equation} \label{e:eqeq}
\epsilon_\mathfrak{q}(\epsilon_\mathfrak{q} -1 + \pmb{\psi}(\mathfrak{q})) = 0,
\end{equation}
where $\epsilon_\mathfrak{q} = \varphi(U_\mathfrak{q} - \pmb{\psi}(\mathfrak{q}))$.  Meanwhile if $\mathfrak{q} \mid \mathfrak{P}_0'$, then in particular we are in case 1/2(a) and $U_\mathfrak{q}$ acts as 1 on $g \pmod{K}$ by (\ref{e:gcong}).  For such $\mathfrak{q}$ we have
\begin{equation} \label{e:eqeq2}
\epsilon_\mathfrak{q} = 1 - \pmb{\psi}(\mathfrak{q})
\end{equation} and (\ref{e:eqeq}) holds trivially.

To prove the last item note that by (\ref{e:uq}) and (\ref{e:eqeq2}) we have
\begin{equation} \label{e:alleqs}
\prod_{\mathfrak{q} \mid \mathfrak{P}'} (U_{\mathfrak{q}} - \pmb{\psi}(\mathfrak{q})) g \equiv  X \left( W_1(\pmb{\psi}_{\mathfrak{P}'}, 1) - \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{P}'},1) \right) \prod_{\mathfrak{q} \mid \mathfrak{P}_0'} (1 - \pmb{\psi}(\mathfrak{q})) \pmod{K}.
\end{equation}
In case 2(c), this congruence does not hold as there is a contribution from the term $W_k(\overline{\pmb{\psi}}, 1_p)$.  This term does not appear in (\ref{e:gcong}) in cases 1/2(a), and is annihilated by the single application of an $\epsilon_\mathfrak{q}$ for $\mathfrak{q} \mid \mathfrak{P}'_1$ in case 2(b).  This is why case 2(c) must be removed from the present analysis.

Returning to (\ref{e:alleqs}), suppose this form is annihilated by an element $a + b {\mscr L} \in A_{{\mscr L}}^{\#}$, with $a, b \in A$. By definition, such an element acts by $a + b (1- U_{\mathfrak{p}})$ and hence, noting that $\prod_{\mathfrak{q} \mid \mathfrak{P}_0'} (1 - \pmb{\psi}(\mathfrak{q}))$ is a unit, we obtain
\[
a X \left( W_1(\pmb{\psi}_{\mathfrak{P}'},1) - \lambda W(\overline{\pmb{\psi}}_{\mathfrak{P}'}, 1)\right) + b X \lambda W_1(\overline{\pmb{\psi}}_{\mathfrak{P}'}, 1_\mathfrak{p}) \equiv 0 \pmod{K}.
\]

Analyzing the $q$-expansion coefficients $c(1, *)$ and $c(\mathfrak{p}, *)$ of this congruence, respectively, we obtain
\begin{align*}
X(a - \lambda a + \lambda b)  & \equiv 0 \pmod{K} \\
X(a - 2 \lambda a + \lambda b) & \equiv 0 \pmod{K}.
\end{align*}
From these, we deduce $X(a+\lambda b) \in K$, and since $X$ is a non-zerodivisor it follows that $a + \lambda b \in J_0 = ( \Theta_H^{\#} \lambda - \Theta_L^{\#}, I_A^2 \Lambda, p^m \Lambda)$. It follows that in $A_{{\mscr L}}^{\#}$, we have
\[
a+ b {\mscr L} \in (\Theta_H^{\#} {\mscr L} - \Theta_L^{\#}, I_A^2, p^m) = (p^m)
\]
as desired.
\end{proof}

\subsection{Galois Representation}  \label{s:galoisrep}

In this section we recall the formalism of \cite{dk}*{\S9.1--9.2} regarding the Galois representation associated to the Hecke algebra $\mathbf{T}^\dagger$.
As explained in \cite{dk}*{\S8.5} the Hecke algebra ${\mathbf{T}}^{\dagger}$ is reduced.
The kernel of $\varphi$ is contained in a unique maximal ideal $\mathfrak{m} \subset \mathbf{T}^\dagger$.  This maximal ideal is generated by the maximal ideal $(\mathfrak{m}_{\mathcal{O}}, I)$ of $A$ together with the elements $T_\mathfrak{l} - (1+ \chi(\mathfrak{l}))$ for $\mathfrak{l} \nmid \mathfrak{n}\mathfrak{P}'$, $S(\mathfrak{a}) - \chi(\mathfrak{a})$ for $(\mathfrak{a}, \mathfrak{n}\mathfrak{P}') = 1$, $U_\mathfrak{q} - 1$ for all $\mathfrak{q} \mid p$.

Let $\mathbf{T}_{\mathfrak{m}}^\dagger$ denote the completion of $\mathbf{T}^\dagger$ with respect to $\mathfrak{m}$ (and similarly $\mathbf{T}_{\mathfrak{m}}$, $\tilde{\mathbf{T}}_\mathfrak{m}$  the completions of $\mathbf{T}$ and $\tilde{\mathbf{T}}$ with respect to their maximal ideals $\mathfrak{m} \cap \mathbf{T}$, $\mathfrak{m} \cap \tilde{\mathbf{T}}$, respectively).  Set
\[
K = \Frac(\mathbf{T}_{\mathfrak{m}}^{\dagger}).
\]
As in \cite{dk}*{\S9.2}, there is a Galois representation
\[
\rho: G_F \longrightarrow {\bf GL}_2(K)
\]
such that
\begin{itemize}
\item[(1)] $\rho$ is unramified outside $\mathfrak{n} p$.
\item[(2)] For all primes $\mathfrak{l} \nmid \mathfrak{n} p$, the characteristic polynomial of $\rho(\Frob_{\mathfrak{l}})$ is given by
\begin{equation} \label{e:chartl}
{\rm char}(\rho(\Frob_{\mathfrak{l}}))(x) = x^2 - T_{\mathfrak{l}} x + \pmb{\psi}(\mathfrak{l}) \mathrm{N}\mathfrak{l}^{k-1}.
\end{equation}
\item[(3)] For  $\mathfrak{q} \mid p$, let $G_{F,\mathfrak{q}} \subset G_F$ denote a decomposition group at $\mathfrak{q}$.  We have
\begin{equation} \label{e:repord}
\rho|_{G_{F,\mathfrak{q}}} \sim \begin{pmatrix} \pmb{\psi} \varepsilon_{\cyc}^{k-1}\eta_\mathfrak{q}^{-1} & * \\ 0 & \eta_{\mathfrak{q}} \end{pmatrix},
\end{equation}
where $\eta_{\mathfrak{p}}\colon G_{F,\mathfrak{q}} \longrightarrow (\mathbf{T}_\mathfrak{m}^\dagger)^*$ is the unramified character given by $\eta_{\mathfrak{p}}(\rec(\varpi^{-1})) = U_{\mathfrak{p}}$.  Here $\varpi$ denotes a uniformizer of $F_\mathfrak{q}^*$ and $\rec\colon F_\mathfrak{q}^* \longrightarrow G_{F,\mathfrak{q}}^{\text{ab}}$ is the local Artin reciprocity map.  Also, $\varepsilon_{\cyc} \colon G_F \longrightarrow \mathbf{Z}_p^*$ denotes the $p$-adic cyclotomic character.
\end{itemize}

For each $\mathfrak{q} \mid p$, let $V_{\mathfrak{q}}$ be the eigenspace of $\rho|_{G_{\mathfrak{q}}}$ i.e. the span of the vector $\binom{1}{0}$ in the basis for which (\ref{e:repord}) holds.
We choose an element $\tau \in G_F$ as in \cite{dk}*{Proposition 9.3} such that its restriction to $\mathfrak{g}$ is complex conjugation and such that for all $\mathfrak{q} \mid p$, the subspace $V_{\mathfrak{q}}$ projected to each factor of $K$ is not stable under $\rho(\tau)$. As in \emph{loc.\,cit.,} fix a basis such that $\rho(\tau) =
\begin{pmatrix} \lambda_1 & 0 \\ 0 & \lambda_2\end{pmatrix}$ where $\lambda_1 \equiv 1 \pmod{\mathfrak{m}}$ and $\lambda_2 \equiv -1 \pmod{\mathfrak{m}}$.
 For a general $\sigma$, we write
\[
\rho(\sigma) = \begin{pmatrix} a(\sigma) & b(\sigma) \\ c(\sigma) & d(\sigma) \end{pmatrix}.
\]
For each $\mathfrak{q} \mid p$, there is a change of basis matrix $M_\mathfrak{q} = \begin{pmatrix} A_\mathfrak{q} & B_\mathfrak{q} \\ C_\mathfrak{q} & D_\mathfrak{q} \end{pmatrix} \in {\bf GL}_2(K)$ such that
\begin{equation} \label{e:matrixeqn}
\begin{pmatrix} a(\sigma) & b(\sigma) \\ c(\sigma) & d(\sigma)\end{pmatrix} M_{\mathfrak{q}} = M_{\mathfrak{q}} \begin{pmatrix} \pmb{\psi} \varepsilon_{\cyc}^{k-1} \eta_{\mathfrak{q}}^{-1} & * \\ 0 & \eta_{\mathfrak{q}} \end{pmatrix}.
\end{equation}
The choice of $\tau$ ensures that $A_\mathfrak{q}$ and $C_\mathfrak{q}$ are invertible in $K$. Furthermore, equating the upper left hand entries in (\ref{e:matrixeqn}) yields:
\begin{equation} \label{e:bequation}
b(\sigma) = x_\mathfrak{q} (a(\sigma) -  \pmb{\psi} \varepsilon_{\cyc}^{k-1} \eta_{\mathfrak{q}}^{-1}(\sigma))  \text{ for all }\sigma \in G_{F,\mathfrak{q}}, \text{ where }
x_\mathfrak{q} = -\frac{A_\mathfrak{q}}{C_\mathfrak{q}}.
\end{equation}

\subsection{Cohomology Class} \label{s:cc}

Let $\varphi_{\mathfrak{m}} \colon \mathbf{T}_\mathfrak{m}^\dagger \longrightarrow W$ denote the extension of the homomorphism $\varphi$ to the completion of $\mathbf{T}^\dagger$.
Let \[ \mathbf{I}^\dagger = \ker(\varphi_{\mathfrak{m}}), \quad \tilde{\mathbf{I}} = \ker({\varphi}_{\mathfrak{m}}|_{\tilde{\mathbf{T}}_{\mathfrak{m}}}), \quad \mathbf{I} = \ker(\varphi_{\mathfrak{m}}|_{\mathbf{T}_\mathfrak{m}}). \]
 As in \cite{dk}*{\S9.3}, the choice of basis for $\rho$ implies that $a(\sigma), d(\sigma) \in \mathbf{T}_\mathfrak{m}$ with
\begin{equation} \label{e:adcong}
a(\sigma) \equiv \varepsilon_{\cyc}^{k-1}(\sigma) \pmod{\mathbf{I}}, \qquad d(\sigma) \equiv \pmb{\psi}(\sigma) \pmod{\mathbf{I}}.
\end{equation}

Recall that  $K=\Frac(\mathbf{T}_{\mathfrak{m}}^\dagger)$.
Recall the elements $x_\mathfrak{q} \in K$ for $\mathfrak{q} \mid p$ defined in (\ref{e:bequation}), including the distinguished prime $\mathfrak{p}$.
Define $x_{\mathfrak{p}}' = x_{\mathfrak{p}}(U_\mathfrak{p} - 1)$.  Let:
\begin{align}
\tilde{\mathbf{B}} & = \tilde{\mathbf{T}}_{\mathfrak{m}} \text{-submodule of } K \text{ generated by } b(\sigma)  \text{ for all } \sigma \in G_F \text{ along with } \label{e:btbdef} \\
& \ \ \ \ \  x_{\mathfrak{p}}, x_{\mathfrak{p}}', \text{ and } x_\mathfrak{q} \text{ for all } \mathfrak{q} \in \Sigma. \nonumber \\
\tilde{\mathbf{B}}' & = \tilde{\mathbf{T}}_{\mathfrak{m}} \text{-submodule of } \tilde{\mathbf{B}} \text{ generated by } \tilde{\mathbf{I}} \tilde{\mathbf{B}}, p^m \tilde{\mathbf{B}}, \text{ and}  \nonumber \\
& \ \ \ \ \  b(\sigma) \text { for all } \sigma \in I_{\mathfrak{q}}, \mathfrak{q} \mid \mathfrak{P}'. \nonumber \\
\tilde{B} & = \tilde{\mathbf{B}}/\tilde{\mathbf{B}}'. \label{e:tbdef}
 \end{align}
 By construction, $\tilde{B}$ naturally has the structure of an  $A_{{\mscr L}}^\#$-algebra in which ${\mscr L}$ acts by multiplication by $(1 - U_\mathfrak{p})$.

Denote by $\overline{b}(\sigma)$ the image of $b(\sigma)$ in $\overline{B}$.
Since $\rho$ is a Galois representation, we have
\[ b(\sigma \sigma') = a(\sigma) b(\sigma') + b(\sigma)d(\sigma') \qquad \text{ for all } \sigma, \sigma' \in G_F. \]
The congruences (\ref{e:adcong}) therefore imply that the function
\[ \kappa(\sigma) =  \overline{b}(\sigma)\pmb{\psi}^{-1}(\sigma) \]
is a 1-cocycle defining a cohomology class $[\kappa] \in H^1(G_F, \tilde{B}(\pmb{\psi}^{-1}))$.  Note here that since $p^m \tilde{\mathbf{B}} = 0$ in $\tilde{B}$ and $\varepsilon_{\cyc}^{k-1} \equiv 1 \pmod{p^m}$, the character $\varepsilon_{\cyc}^{k-1}$ acts trivially on $\tilde{B}$.
Let: \begin{align}
{B}_0 &=  \mathbf{T}_\mathfrak{m}\text{-submodule of } \tilde{B} \text{ generated by the image of } b(\sigma) \text{ for all } \sigma \in G_F.  \nonumber \\
\begin{split}
B & =  \mathbf{T}_\mathfrak{m}\text{-submodule of } \tilde{B} \text{ generated by } B_0 \text{ along with }  \label{e:bmoddef} \\
& \ \ \ \ \  x_{\mathfrak{p}}, x_{\mathfrak{p}}', \text{ and } x_\mathfrak{q} \text{ for all } \mathfrak{q} \in \Sigma.
\end{split}
\end{align}
Note that $\tilde{\mathbf{I}}\tilde{\mathbf{B}} = 0$ in $\tilde{B}$ and every element of $\mathbf{T}_\mathfrak{m}$ is equivalent to an element of $A$ modulo $\mathbf{I}$ (see the first three bullet points of Theorem~\ref{t:heckehom}). Therefore, in the definition of $B_0$ and $B$, it is equivalent to replace $\mathbf{T}_\mathfrak{m}$ by $A$.

The $A$-module structure of $\tilde{B}(\pmb{\psi}^{-1})$ is by definition the composition of the involution $\#$ with the natural $A$-module structure of $\tilde{B}$.  The canonical $A_{{\mscr L}}^\#$-module structure of $\tilde{B}$ can therefore be viewed as an $A_{{\mscr L}}$-module structure on $\tilde{B}(\pmb{\psi}^{-1})$.

We now verify that our construction verifies all the properties required to apply Theorems~\ref{t:nc} and~\ref{t:nl}.
First we describe the class $\kappa$ locally at primes in $\Sigma_\mathfrak{p} \setminus S_\infty$ using (\ref{e:bequation}).

\begin{lemma} \label{l:kappaloc} For $\mathfrak{q} \in \Sigma \setminus S_\infty$, we have
\[ \kappa(\sigma) = ( \pmb{\psi}^{-1}(\sigma) -1 )x_{\mathfrak{q}}, \qquad \sigma \in G_{F, \mathfrak{q}}. \]
Meanwhile
\[ \kappa(\sigma) = (\pmb{\psi}^{-1}(\sigma)-1)x_{\mathfrak{p}} + \ord_{\mathfrak{p}}(\sigma)x_{\mathfrak{p}}', \qquad \sigma \in G_{F, \mathfrak{p}},\]
where $\ord_\mathfrak{p}$ is as in (\ref{e:ordp}).
\end{lemma}

\begin{proof}
Note  that \begin{equation} \label{e:aeq}
a(\sigma) \equiv \varepsilon_{\cyc}^{k-1}(\sigma) \equiv 1 \pmod{(\mathbf{I}, p^m)} \end{equation}
for $k \equiv 1 \pmod{(p-1)p^N}$ and $N \ge m$.
If $\mathfrak{q} \in \Sigma \setminus S_\infty,$ then $U_\mathfrak{q} \equiv 1 \pmod{\mathbf{I}}$, and hence by the definition of  $\eta_\mathfrak{q}$ following (\ref{e:repord}),
$\eta_\mathfrak{q}$ acts trivially on $\tilde{B}(\pmb{\psi}^{-1})$.  Therefore (\ref{e:bequation}) becomes
\[ \kappa(\sigma) = \overline{b}(\sigma) \pmb{\psi}^{-1}(\sigma)= ( \pmb{\psi}^{-1}(\sigma) -1 )x_{\mathfrak{q}}, \qquad \sigma \in G_{F, \mathfrak{q}}. \]

For $\mathfrak{q} = \mathfrak{p}$, this applies except that $U_\mathfrak{p} \not\equiv 1 \pmod{\mathbf{I}}$.
Since $(U_\mathfrak{p}-1)^2 \in \mathbf{I}$, we have \[ U_\mathfrak{p}^n \equiv 1 + n(U_\mathfrak{p} - 1) \pmod{\mathbf{I}}. \]  It follows that
\[ \kappa(\sigma) = (\pmb{\psi}^{-1}(\sigma)-1)x_{\mathfrak{p}} + \ord_{\mathfrak{p}}(\sigma)x_{\mathfrak{p}}', \qquad \sigma \in G_{F, \mathfrak{p}},\]
where \[ x_{\mathfrak{p}}' = ( U_\mathfrak{p}-1) x_{\mathfrak{p}} = -{\mscr L} x_{\mathfrak{p}}.  \qedhere \]
\end{proof}

\begin{theorem}  \label{t:properties}
The $G$-module $\tilde{B}(\pmb{\psi}^{-1})$ and the cohomology class $[\kappa] \in H^1(G_F, \tilde{B}(\pmb{\psi}^{-1}))$ satisfy the following properties.
\begin{itemize}
\item The $A$-module $B$ generates $\tilde{B}(\pmb{\psi}^{-1})$ as an $A_{{\mscr L}}$-module.
\item The class $[\kappa]$ is unramified outside $\Sigma'$, locally trivial at  $\Sigma$, and tamely ramified at $\Sigma'$.
\item The image of the restriction
\[ [\kappa]_{|G_L} \in H^1(G_L, \tilde{B}) = \Hom_{\cont}(G_L, \tilde{B}) \]
 is equal to ${B}_0$.
\item The quotient
${B}/{B}_0$ is generated over $A$ by $x_\mathfrak{q}$ for $\mathfrak{q} \in \Sigma$ and the elements $x_{\mathfrak{p}}, x_{\mathfrak{p}}'$.  The element $x_{\mathfrak{p}}'$ is fixed by the action of $G_{F,\mathfrak{p}}$.
\item The 1-cocycle $\kappa$ satisfies the following.
\begin{itemize}
\item For $\mathfrak{q} \in \Sigma$ finite and $\sigma \in G_{F, \mathfrak{q}}$, we have
$\kappa(\sigma) = (\pmb{\psi}^{-1}(\sigma)-1)x_\mathfrak{q}.$
\item For $\sigma \in \WD(\overline{F}_\mathfrak{p}/F_\mathfrak{p})$, we have \begin{equation} \label{e:ksp}
 \kappa(\sigma) =     (\pmb{\psi}^{-1}(\sigma)-1)    x_{\mathfrak{p}} + \ord_\mathfrak{p}(\sigma) x_{\mathfrak{p}}'. \end{equation}
\end{itemize}
\item With respect to the $A_{{\mscr L}}$-structure on $\tilde{B}(\pmb{\psi}^{-1})$, we have  $x_{\mathfrak{p}}' + {\mscr L} x_\mathfrak{p} = 0.$
\end{itemize}
\end{theorem}

\begin{proof}
Recall that $\tilde{\mathbf{T}}_\mathfrak{m}$ is generated over $\mathbf{T}_\mathfrak{m}$ by $1 - U_\mathfrak{p}$, which gives the action of ${\mscr L}$ on $\tilde{B}(\pmb{\psi}^{-1})$.
Comparing (\ref{e:btbdef}) and (\ref{e:bmoddef}), it then follows that $B$ generates $\tilde{B}(\pmb{\psi}^{-1})$ as an $A_{{\mscr L}}$-module. This proves the first bullet point.

The Galois representation $\rho$, and hence the cohomology class $[\kappa]$, is unramified outside $\Sigma \cup \Sigma'$ and the primes dividing $p$.  There are three types of primes above $p$: those in $\Sigma$, the distinguished prime $\mathfrak{p}$, and the primes dividing $\mathfrak{P}'$.

Since in the definition of $\tilde{B}$ we have taken the quotient by the $\tilde{\mathbf{T}}_{\mathfrak{m}}$-module spanned by $b(\sigma)$  for $\sigma \in I_\mathfrak{q}, \mathfrak{q} \mid \mathfrak{P}'$, it follows that $[\kappa]$ is unramified at the primes dividing $\mathfrak{P}'$.
 For $\mathfrak{q} \in \Sigma \setminus S_\infty$, Lemma~\ref{l:kappaloc}
  expresses $\kappa_{| G_{F, \mathfrak{q}}}$ as a coboundary and demonstrates that $[\kappa]$ is locally trivial at $\mathfrak{q} \in \Sigma$.  At $\mathfrak{p}$, note that since $ \ord_{\mathfrak{p}}(\sigma) = 0 $  for $\sigma \in I_{\mathfrak{p}}$, Lemma~\ref{l:kappaloc} shows that $[\kappa]$ is unramified at $\mathfrak{p}$.  To conclude the proof of the second item, note that $\Sigma'$ contains no primes above $p$, and all our modules are pro-$p$.  Therefore $[\kappa]$ is tamely ramified at all primes in $\Sigma'$.

For the third bullet point, let $B_L \subset B_0$ denote the image of $[\kappa]_{| G_L}$.  Then of course the image of $[\kappa]_{| G_L}$ in $H^1(G_L, (B_0/B_L)(\pmb{\psi}^{-1}))$ vanishes, and hence by \cite{dk}*{Lemma 6.3}, the image of $[\kappa]$ in $H^1(G_F, (B_0/B_L)(\pmb{\psi}^{-1}))$ vanishes.  Writing $\overline{\kappa}$ for the image of $\kappa$ in $B_0/B_L$, we may then write $\overline{\kappa}(\sigma) = z(\pmb{\psi}^{-1}(\sigma) - 1)$ for some $z \in B_0/B_L$.  Yet by construction $\kappa(\tau) = 0$ and $\pmb{\psi}^{-1}(\tau) = -1$, where $\tau$ is the special element used in \S\ref{s:galoisrep} to fix the chosen basis of $\rho$.  We therefore obtain $z=0$.  Hence $\overline{\kappa} = 0$ as a cocycle.  But by definition of $\kappa$ and $B_0$, the image of the cocycle $\kappa$ generates $B_0$ and hence the image of $\overline{\kappa}$ generates $B_0/B_L$.  It follows that $B_0/B_L = 0$, i.e.\ $B_0 = B_L$ as desired.

The remaining bullet points follow directly from the definitions or have already been established.
\end{proof}

In view of Theorems~\ref{t:nc} and~\ref{t:nl}, we deduce from Theorem~\ref{t:properties}:
\begin{corollary}  \label{c:fit}
We have an $A_{{\mscr L}}$-module surjection
 \[ \nabla_{\!{\mscr L}, A} \relbar\joinrel\twoheadrightarrow \tilde{B}(\pmb{\psi}^{-1}) \] and hence an inclusion
 $\Fitt_{A_{{\mscr L}}}(\nabla_{\!{\mscr L}, A}) \subset \Fitt_{A_{{\mscr L}}}(\tilde{B}(\pmb{\psi}^{-1}))$.
\end{corollary}

\subsection{Calculation of the Fitting ideal}

It remains to prove that \[  \Fitt_{A_{{\mscr L}}}(\tilde{B}(\pmb{\psi}^{-1})) \subset (p^m). \]
Applying the involution $\#$, this is equivalent to
\[
\Fitt_{A_{{\mscr L}}^\#}(\tilde{B}) \subset (p^m) = p^m A_{{\mscr L}}^\#.
\]
 Removal of the twist by $\pmb{\psi}^{-1}$ will be convenient so that the usual $\mathfrak{g}$-module structure on $\tilde{B}$ via $\pmb{\psi}$ is compatible with the $\tilde{\mathbf{T}}_\mathfrak{m}$-module structure on $\tilde{B}$ and the homomorphism $\varphi_\mathfrak{m}$, which satsifies $\varphi_\mathfrak{m}(S(\mathfrak{a})) = \pmb{\psi}(\mathfrak{a})$.

  We first recall the following lemma from  \cite{dk}*{Lemma 9.9}.
\begin{lemma} \label{l:bgen} Let $\mathbf{B}_0 \subset \tilde{\mathbf{B}}$ denote the $\tilde{\mathbf{T}}_{\mathfrak{m}}$-submodule generated by the elements $b(\sigma)$ for $\sigma \in G_F$.
 There are finitely many elements $b_1, \ldots, b_m \in {\mathbf{B}}_0$ that are non-zerodivisors in $K$, which  generate $\mathbf{B}_0$ as an $A$-module.
 \end{lemma}

 \begin{theorem} \label{t:mainfit2}  With notation as in Theorem \ref{t:heckehom}, we have \[ \Fitt_{A_{{\mscr L}}^\#}(\tilde{B}) \subset
  \bigg(p^m, \Ann_{A_{{\mscr L}}^\#}\Big( \prod_{\mathfrak{q} \mid \mathfrak{P}'} \epsilon_\mathfrak{q} \cdot W\Big) \bigg), \]
 and hence by the last item of that theorem we have
 \[  \Fitt_{A_{{\mscr L}}^\#}(\tilde{B}) \subset (p^m).
 \]
\end{theorem}

\begin{proof}
The proof proceeds closely along the lines of that in \cite{dk}*{Theorem 9.10}. Let  $\mathfrak{q}_1, \dotsc, \mathfrak{q}_r$ denote the primes dividing $\mathfrak{P}'$. For each $\mathfrak{q}_i$, choose an element $\sigma_i \in G_{F,\mathfrak{q}_i} \subset G_F$ that lifts $\rec(\varpi_i) \in G_{F,\mathfrak{q}_i}^{\text{ab}}$, where
$\varpi_i$ is a uniformizer for $F_{\mathfrak{q}_i}$.  Define
\[ c_i := -b(\sigma_i)\pmb{\psi}(\mathfrak{q}_i) \varepsilon_{\cyc}^{1-k}(\sigma_i) = x_{\mathfrak{q}_i}(U_{\mathfrak{q}_i} - \pmb{\psi}(\mathfrak{q}_i) + \mathbf{I}) \in \tilde{\mathbf{B}}. \]
Here and throughout this proof, we use the notation $a = b + \mathbf{I}$ to mean $a = b + z$ for some $z \in \mathbf{I}$ to avoid needing to add distinct variable names for each such $z$ that appears.

By choosing the elements $b_1, \dots, b_m$ from Lemma~\ref{l:bgen} together with $x_\mathfrak{q}$ for all $\mathfrak{q} \in \Sigma_\mathfrak{p}$, we get elements $b_1, \dotsc, b_n$ ($n = m + \#\Sigma_\mathfrak{p}$) of $\tilde{\mathbf{B}}$ that are non-zerodivisors in $K=\Frac(\mathbf{T}_{\mathfrak{m}})$ and generate this module over $\tilde{\mathbf{T}}_\mathfrak{m}$.  The images of these elements in $\tilde{B}$ are therefore $A_{{\mscr L}}^\#$-module generators.

To calculate $\Fitt_{A_{{\mscr L}}^\#}(\tilde{B}) $ we use the generating set $c_1, \dotsc, c_r, b_1, \dotsc, b_n$ for $\tilde{B}$ over $A_{{\mscr L}}^\#$.  Of course, these first $r$ generators are not necessary, but including them will aid us in proving the theorem.  Suppose we have a matrix
\[
M \in M_{(n+r) \times (n+r)}(A_{{\mscr L}}^\#)
\]
such that each row of $M$ represents a relation amongst our generators, i.e.\ such that
\[
M(c_1, \dotsc, c_r, b_1, \dotsc, b_n)^T \equiv 0 \text{ in } \tilde{B}^{n+r}.
\]
We need to show that $\det(M) \in A_{{\mscr L}}^\#$ satisfies $(\det(M) + p^m z) \prod_{\mathfrak{q} \mid \mathfrak{P}'} \epsilon_\mathfrak{q} = 0$ in $W$ for some $z \in A_{{\mscr L}}^\#$.

Write $M   = (Y | Z)$ in block matrix form, where
\[
Y = (y_{ij}) \in M_{(n+r)\times r}(A_{{\mscr L}}^\#), \qquad
Z = (z_{ij}) \in M_{(n+r)\times n}(A_{{\mscr L}}^\#).
\]
Since $\pmb{\psi}$ and $\eta_{\mathfrak{q}_i}$ are unramified at $\mathfrak{q}_i$ and $a(\sigma) \equiv \varepsilon_{\cyc}^{k-1} \pmod{\mathbf{I}}$, we have by (\ref{e:bequation}):
\[ b(I_{\mathfrak{q}_i}) \subset x_{\mathfrak{q}_i} \mathbf{I}. \]
Also, since the $b_i$ generate $\tilde{\mathbf{B}}$ over $\tilde{\mathbf{T}}_\mathfrak{m}$, every element of $\tilde{\mathbf{I}} \tilde{\mathbf{B}}$ can be written as a sum of elements of the form   $ t_i b_i$ with $t_i \in \tilde{\mathbf{I}} \subset \mathbf{I}^\dagger$.
Therefore each relation \[ \sum_{j=1}^r y_{ij} c_j + \sum_{j=1}^n z_{ij} b_j \equiv  0 \text{ in } \tilde{B} \] can be expressed as in equality in $K$ as
\begin{equation} \label{e:xyzsum}
  \sum_{j=1}^r  x_{\mathfrak{q}_j}(\tilde{y}_{ij}(U_{\mathfrak{q}_j} - \pmb{\psi}(\mathfrak{q}_j)) + {\mathbf{I}}^\dagger) +\sum_{j=1}^n (\tilde{z}_{ij} + {\mathbf{I}}^\dagger + p^m {\mathbf{T}}^\dagger_\mathfrak{m}) b_j  = 0. \end{equation}
  We reiterate that here and in what follows, the symbols $\mathbf{I}^\dagger$ (twice) and ${\mathbf{T}}^\dagger_\mathfrak{m}$ represent elements of those sets for which we do not, for notational reasons, introduce separate variable names. We have denoted by $\tilde{y}_{ij}$ and $\tilde{z}_{ij}$ elements of ${\mathbf{T}}^\dagger_{\mathfrak{m}}$ such that $\varphi(\tilde{y}_{ij}) = y_{ij}$, $\varphi(\tilde{z}_{ij}) = z_{ij}$.
It  follows from (\ref{e:xyzsum}) that if we define a matrix $M' \in M_{(n+r) \times (n+r)}(K)$  in block form by
\[
M' = \left( x_{\mathfrak{q}_j}(\tilde{y}_{ij}( U_{\mathfrak{q}_j} - \pmb{\psi}(\mathfrak{q}_j) ) + {\mathbf{I}}^\dagger) \ \ \ \ |  \ \ \ \ (\tilde{z}_{ij} + {\mathbf{I}}^\dagger + p^m {\mathbf{T}}_\mathfrak{m}^\dagger) b_j \right),
\]
then $\det(M') = 0$ in $K$ since it has rows that sum to 0.  We can cancel the factors $x_{\mathfrak{q}_i}$ and $b_j$ scaling the columns of $M'$, since these are non-zerodivisors in $K$.  We obtain that $\det(M'') = 0$ where
\[
M'' = \left( (\tilde{y}_{ij}(U_{\mathfrak{q}_j} - \pmb{\psi}(\mathfrak{q}_j)) + {\mathbf{I}}^\dagger) \ \ \ \ |  \ \ \ \ (\tilde{z}_{ij} +{\mathbf{I}}^\dagger + p^m {\mathbf{T}}_\mathfrak{m}^\dagger)  \right) \in M_{(n+r)\times (n+r)}(\mathbf{T}^\dagger).
\]
Taking the determinant of $M''$ and applying $\varphi$, we obtain
\[
0 = \varphi( \det(M''))= (\det(M) + p^m A_{{\mscr L}}^\#) \prod_{\mathfrak{q} \mid \mathfrak{P}'} \epsilon_\mathfrak{q} \text{ in } W.
\]
Therefore,  \[ \det(M) \in \bigg(p^m, \Ann_{A_{{\mscr L}}^\#}\Big( \prod_{\mathfrak{q} \mid \mathfrak{P}'} \epsilon_\mathfrak{q} \cdot W\Big) \bigg), \]
yielding the first statement of the theorem.
The second statement then follows immediately from  the last bullet point in Theorem~\ref{t:heckehom}.
\end{proof}

We immediately find:

\begin{theorem}  \label{t:fittal}  Suppose we are in cases 1, 2(a), or 2(b).
We have
\[ \Fitt_{A_{{\mscr L}}}(\nabla_{\!{\mscr L}, A}) = 0.\]
\end{theorem}
\begin{proof}

Corollary~\ref{c:fit} and Theorem~\ref{t:mainfit2} combine to yield
\[
\Fitt_{A_{{\mscr L}}}(\nabla_{\!{\mscr L}, A}) \subset \Fitt_{A_{{\mscr L}}}(\tilde{B}(\pmb{\psi}^{-1})) \subset (p^{m}).
\]
Since this holds for all $m$, we have $\Fitt_{A_{{\mscr L}}}(\nabla_{\!{\mscr L}, A}) = 0$ as desired.
\end{proof}

Combining our results yields the $p$-part of Gross's conjecture.
\begin{proof}[Proof of Theorem~\ref{t:maingross}]  For now we assume there is more than one prime above $p$ in $F$, leaving the case of one prime for the next section.
Theorem~\ref{t:fittal} and Lemma~\ref{l:fittchi} imply that
$\Fitt_{R_{{\mscr L}}}(\nabla_{\!{\mscr L}}) = 0.$  Theorem~\ref{t:mfig} then yields
the $p$-part of the modified Gross conjecture:
\[ \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) \equiv \Theta_L \pmod{I^2}. \]
Lemma~\ref{l:equiv} now gives the $p$-part of Gross's conjecture for the Brumer--Stark unit $u_\mathfrak{p}$:
\[ \rec_G(u_\mathfrak{p}) \equiv  \Theta_{S_\mathfrak{p},T}^{L/F} \pmod{I^2}. \qedhere \]
\end{proof}

\section{The case of one prime above $p$ in $F$} \label{s:onep}

In this section we handle Case 2(c), where $\mathfrak{p}$ is the only prime of $F$ lying above $p$.  We impose this condition for the remainder of the paper.
Rather than calculating the Fitting ideal of $\nabla_{\!{\mscr L}}$, we prove the $p$-part of the modified Gross Conjecture (the congruence (\ref{e:mgc})) by taking advantage of two features that present themselves when there is only one prime above $\mathfrak{p}$: (1) the cyclotomic tower is ramified only at $\mathfrak{p}$, hence we may deform up this tower without altering the depletion set $\Sigma_\mathfrak{p}$; (2) The rank one rational Gross--Stark conjecture, proven in \cite{ddp} and \cite{v}, is known.  In essence, our argument  is to show that the rational conjecture (for the cyclotomic tower) implies the integral conjecture (for arbitrary $L/F$).  The key input in this reduction is the strong version of the Brumer--Stark conjecture giving the Fitting ideal of $\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}$, conjectured by Burns and Kurihara and proven in \cite{dk}.  This result was stated in Theorem~\ref{t:dkresult} above, and we apply it in this section to the compositum of $L$ with cyclotomic extensions of $F$.  Another important result applied is the nonvanishing of the derivative of $p$-adic $L$-functions at $s=0$, which follows by combining the result of the rational Gross--Stark conjecture with the spectacular transcendence theorem of Brumer--Baker on the linear independence of $p$-adic logarithms of algebraic numbers.  This again takes advantage of the fact that we are in a rank 1 situation since there is only one prime above $p$ in $F$.

We begin by recalling the necessary results and notation concerning $p$-adic $L$-functions.

\subsection{$p$-adic $L$-functions}

In our current setting we have
$\Sigma = S_\infty$, $\Sigma_\mathfrak{p} = S_\infty \cup \{\mathfrak{p}\}$, and $\mathfrak{p}$ is the only prime of $F$ above $p$.
For each odd character $\chi$ of $G$, Deligne--Ribet and Cassou-Nogues construct a $p$-adic meromorphic function
\[ L_p(\chi\omega, s) \colon \mathbf{Z}_p \longrightarrow \mathbf{Q}_p(\chi) \]
satisfying the interpolation property
\[ L_p(\chi\omega, n) = L_{\Sigma_\mathfrak{p}, \emptyset}(\chi \omega^n, n) \]
for all integers $n \le 0$. Here $\omega \colon G_F \longrightarrow \mu_{p-1}$ denotes the  Teichm\"uller character and $\mathbf{Q}_p(\chi)$ denotes the extension of $\mathbf{Q}_p$ obtained by adjoining the values of $\chi$.  Analyticity and integrality are achieved if we incorporate the smoothing set $\Sigma'$, i.e. we have a $p$-adic analytic function
\[ L_{p, \Sigma'}(\chi\omega, s) \colon \mathbf{Z}_p \longrightarrow \mathbf{Z}_p(\chi) \] satisfying
\[ L_{p, \Sigma'}(\chi\omega, n) = L_{\Sigma_\mathfrak{p}, \Sigma'}(\chi \omega^n, n) \]
for all integers $n \le 0$. Moreover, these $p$-adic $L$-functions interpolate to a group ring valued Stickelberger function.
There exists a $p$-adic analytic function
\[ \Theta_{p, \Sigma'}^H(s) \colon \mathbf{Z}_p \longrightarrow \mathbf{Z}_p[G]^- \] satisfying the interpolation property
\[ \Theta_{p,\Sigma'}^H(1-k) = \Theta_{\Sigma_\mathfrak{p}, \Sigma'}(1-k)
 \]
for all positive integers $k \equiv 1\pmod{p-1}$.  As we now describe, $\Theta_{p, \Sigma'}^H(s)$ can be constructed as a certain $p$-adic integral.
Let $F_\infty/F$ denote the cyclotomic $\mathbf{Z}_p$-extension of $F$ and let $\mathfrak{h}_\infty = {\rm Gal}(HF_\infty/F)$.
For each integer $m \ge 0$ we let $F_m \subset F_\infty$ denote the $m$th layer of the tower and let $\mathfrak{h}_m = {\rm Gal}(HF_\infty/HF_m)$.
Then $\mathfrak{h}_m$ is an open subgroup of $\mathfrak{h}_\infty$ and its cosets provide a cover of $\mathfrak{h}_\infty$ by disjoint opens.
For $\sigma \in G_m = \mathfrak{h}_\infty/\mathfrak{h}_m \cong {\rm Gal}(HF_m/F)$ we define
\[ \mu(\sigma + \mathfrak{h}_m) = \zeta_{\Sigma_\mathfrak{p}, \Sigma'}(\sigma, 0), \quad \text{where }
 \Theta_{\Sigma_\mathfrak{p}, \Sigma'}^{HF_m/F}(0) = \sum_{\tau \in G_m} \zeta_{\Sigma_\mathfrak{p}, \Sigma'}(\tau, 0)\tau^{-1}. \]
For $\sigma \in G$ define
\begin{equation} \label{e:zetaint}
 \zeta_{p, \Sigma'}(\sigma, s) = \int_{\sigma + \mathfrak{h}_0} \langle \varepsilon_{\cyc}(\tau) \rangle^{-s} d \mu(\tau).
 \end{equation}
Here $\mathfrak{h}_0 = {\rm Gal}(HF_\infty/H)$.  We then have
\[ \Theta_{p, \Sigma'}^H(s) = \sum_{\sigma \in G} \zeta_{p, \Sigma'}(\sigma, s) \sigma^{-1}. \]
 Taking the derivative of (\ref{e:zetaint}) with respect to $s$ and evaluating at 0, we obtain
\begin{equation}
 \zeta_{p, \Sigma'}'(\sigma, 0) = -\int_{\sigma + \mathfrak{h}_0} \log_p \varepsilon_{\cyc}(\tau) d \mu(\tau).
 \end{equation}
To evaluate this modulo $p^m$, we may take the Riemann sum over the cosets of $\mathfrak{h}_m$.  We obtain:
\begin{lemma}  \label{l:derivative}
For every integer $m \ge 0$, we have \[
(\Theta_{p, \Sigma'}^H)'(0) \equiv - \sum_{\sigma \in G_m}  \zeta_{\Sigma_\mathfrak{p}, \Sigma'}(\sigma, 0) \log_p\varepsilon_{\cyc}(\sigma)\overline{\sigma}^{-1} \pmod{p^m}. \]
Here $\overline{\sigma}$ denotes the image of $\sigma$ in $G$.
\end{lemma}

For notational simplicity, we will simply write $\Theta_H'$ for $(\Theta_{p, \Sigma'}^H)'(0)$ in the sequel.

\subsection{The rational Gross--Stark conjecture}

The following result, which we refer to as the rank 1 rational Gross--Stark conjecture, was proven in \cite{ddp} and \cite{v}.  The latter paper removed two assumptions from the former, making the result unconditional.

\begin{theorem}[\cite{gross}*{Conjecture 2.12}] \label{t:ddp}
Let $u \in U_\mathfrak{p}^-$ such that
\begin{equation} \label{e:ordnz}
 \chi(\ord_G(u)) = \sum_{\sigma \in G}  \chi(\sigma)^{-1} \ord_{\mathfrak{P}}(\sigma(u_\mathfrak{p})) \neq 0.
\end{equation}
  Then
\begin{equation} \label{e:lddp}
 \frac{\sum_{\sigma \in G} \chi(\sigma)^{-1} \log_p(\Norm_{F_{\mathfrak{p}}/\mathbf{Q}_p}(\sigma(u)))}{ \chi(\ord_G(u)) } = - \frac{L_p'(\chi^{-1}\omega,0)}{L(\chi^{-1},0)}. \end{equation}
\end{theorem}

When applied to the Brumer--Stark unit $u_{\mathfrak{p}}^{\Sigma,\Sigma'}$, this result can be interpreted as follows:

\begin{corollary} \label{c:ddp}
We have
\begin{equation} \label{e:ddp}
\Theta_H' = - \sum_{\sigma \in G} \overline{\pmb{\psi}}(\sigma)^{-1}  \log_p(\Norm_{F_{\mathfrak{p}}/\mathbf{Q}_p}(\sigma(u_{\mathfrak{p}}^{\Sigma, \Sigma'}))).
\end{equation}
\end{corollary}
\begin{proof} It is enough to show that the two sides agree after the application of $\chi$ for every odd character $\chi$ of $G$, i.e.\ that
\begin{equation} \label{e:lddp2}
 L_{p, \Sigma'}'(\chi^{-1} \omega, 0) =
-\sum_{\sigma \in G} \chi(\sigma)^{-1} \log_p(\Norm_{F_{\mathfrak{p}}/\mathbf{Q}_p}(\sigma(u_{\mathfrak{p}}^{\Sigma, \Sigma'}))).
\end{equation}
Noting that
\[ \frac{L_p'(\chi^{-1}\omega,0)}{L(\chi^{-1},0)} = \frac{L_{p, \Sigma'}'(\chi^{-1}\omega,0)}{L_{\Sigma,\Sigma'}(\chi^{-1},0)}
\]
since the smoothing factors $\prod_{\mathfrak{q} \mid \Sigma'} (1 - \chi^{-1}(\sigma_\mathfrak{q}) \mathrm{N}\mathfrak{q})$ cancel, and recalling that
\[ \chi(\ord_G(u_{\mathfrak{p}}^{\Sigma,\Sigma'})) = L_{\Sigma,\Sigma'}(\chi^{-1},0) \] by the definition of $u_{\mathfrak{p}}^{\Sigma,\Sigma'},$ the desired result (\ref{e:lddp2}) follows directly from (\ref{e:lddp}).
\end{proof}

The following result is known to the experts and has at its heart two deep facts---Theorem~\ref{t:ddp} above and the celebrated transcendence result of Brumer--Baker on the linear independence of logarithms of algebraic numbers over $\overline{\mathbf{Q}}$.
\begin{theorem} \label{t:nv}
Let $\chi$ be an odd character of $G$.  We have $L_p'(\chi\omega, 0) \neq 0$.
\end{theorem}

\begin{proof}
In view of Theorem~\ref{t:ddp}, it suffices to prove that
\[ \sum_{\sigma \in G} \chi(\sigma)^{-1} \log_p(\Norm_{F_{\mathfrak{p}}/\mathbf{Q}_p}(\sigma(u))) \neq 0 \] for any $u \in U_\mathfrak{p}^-$ such that $\chi(\ord_G(u)) \neq 0$.  This follows from the theorem of Brumer--Baker \cite{bb} as explained by Gross in \cite{gross}*{Proposition 2.13}.
\end{proof}

We interpret this result in terms of the group-ring element $\Theta_H'$ as follows.

\begin{corollary}  The element $\Theta_H' \in \overline{R} = \mathbf{Z}_p[G]^-$ is a non-zerodivisor.
\end{corollary}

\subsection{The ring $R_{X,m}$ and module $\nabla_{X,m}$}

Recall $R = \mathbf{Z}_p[\mathfrak{g}]^-$. For any nonnegative integer $m$, define the ring
\begin{equation} R_{X,m} = R[X]/(\Theta_L - \Theta_H' X, X^2, I X, I^2, p^mX). \label{e:rxdef} \end{equation}

\begin{lemma} For $m$ sufficiently large, the canonical map $R/I^2 \longrightarrow R_{X,m}$ is injective. \label{l:nxi}
\end{lemma}

\begin{proof}
The proof is easier than Theorem~\ref{t:ws} since $\Theta_H'$ is a non-zerodivisor in $\overline{R}$.
 Let $a \in R$ have image in $R_{X,m}$ that vanishes.  Writing down the fact that $a$ lies in the ideal defining $R_{X,m}$ shows that $a \equiv r\Theta_L \pmod{I^2}$ for some $r \in R$ such that $\overline{r} \Theta_H' \equiv 0 \pmod{p^m}$ in $\overline{R}$.  Yet since $\Theta_H'$ is a non-zerodivisor,
there exists a nonnegative integer $h$ such that $\Theta_H'$ divides $p^h$ in $\overline{R}$. We therefore find $p^h \overline{r} \equiv 0 \pmod{p^m}$, whence $\overline{r} \equiv 0 \pmod{p^{m-h}}$ for $m \ge h$.  Therefore $r \in (I, p^{m-h})$ so $a \in (I^2, p^{m-h}I)$.  But $\#\Gamma$ annihilates $I/I^2$ (recall $\Gamma = {\rm Gal}(L/H)$) so for $m$ large enough $p^{m-h}I \subset I^2$, and we have $a \in I^2$ as desired.
\end{proof}

Recall that for an integer $m \ge 0$, $F_m$ denotes the $m$th layer of the cyclotomic $\mathbf{Z}_p$-extension of $F$.
Let $\mathfrak{g}_m = {\rm Gal}(LF_m/F)$ and $\Gamma_m = {\rm Gal}(LF_m/H)$.  Let $R_m = \mathbf{Z}_p[\mathfrak{g}_m]^-$ and
let \[ \pmb{\psi}_m \colon \mathfrak{g}_m \longrightarrow R_m^* \] denote the canonical character.  We define a ring homomorphism
\begin{equation} \label{e:betadef} \beta_m \colon R_m \longrightarrow R_{X,m}, \qquad \sigma \mapsto \sigma|_L  + \sigma|_H \cdot \log_p(\varepsilon_{\cyc}(\sigma)) X.
\end{equation}
This is well-defined since the image of $\sigma \in \mathfrak{g}_m$ determines the value of $\log_p(\varepsilon_{\cyc}(\sigma))$ modulo $p^m$.

Define
\begin{equation} \label{e:nablaxdef}
 \nabla_{X, m} = {\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L F_m)_{R_m} \otimes_{R_m} R_{X,m},
 \end{equation}
where the $R_m$-action on the right factor is given by $\beta_m$.

\begin{lemma} \label{l:fittnx}
The $R_{X,m}$-module $ \nabla_{X, m}$ is quadratically presented and
\[ \Fitt_{R_{X,m}}(\nabla_{X,m})= (\rec_G(u_\mathfrak{p}^{\Sigma,\Sigma'}) - \Theta_L). \]
\end{lemma}

To prepare for the proof of Lemma~\ref{l:fittnx},
define $I_m = \ker(\mathbf{Z}_p[\mathfrak{g}_m]^- \longrightarrow \mathbf{Z}_p[G]^-)$. We have $I_m/I_m^2 \cong \mathbf{Z}_p[G]^- \otimes \Gamma_m$. We lift the map $\rec_G$ defined in (\ref{e:recg}) by defining
\[
\rec_{G,m} \colon (\mathcal{O}_{H, \Sigma, \Sigma'}^*)_{\overline{R}} \longrightarrow I_m/I_m^2, \qquad \epsilon \mapsto \sum_{\sigma \in G} (\rec_{\mathfrak{P},m}(\sigma(\epsilon)) - 1)\tilde{\sigma}_m^{-1},
\]
where $\rec_{\mathfrak{P}, m}\colon H_{\mathfrak{P}}^* \longrightarrow \Gamma_m$ is the reciprocity map and $\tilde{\sigma}_m$ is a lift of $\sigma$ in $\mathfrak{g}_m$. Under the projection $\mathfrak{g}_m \longrightarrow \mathfrak{g}$, the element $\rec_{\mathfrak{P}, m}(\epsilon)$ is mapped to $\rec_{\mathfrak{P}}(\epsilon)$. Furthermore, \[ \varepsilon_{\cyc}(\rec_{\mathfrak{P},m}(\epsilon)) \equiv  \Norm_{H_{\mathfrak{P}}/\mathbf{Q}_p}(\epsilon) \text{ in } (\mathbf{Z}/p^m\mathbf{Z})^*. \] Therefore, under the map $\beta_m$ defined in (\ref{e:betadef}), we have
\begin{equation} \label{e:recn}
\beta_m(\rec_{G,m}(\epsilon)) = \rec_G(\epsilon) + X \sum_{\sigma \in G}\overline{\pmb{\psi}}(\sigma)^{-1} \log_p  \Norm_{H_{\mathfrak{P}}/\mathbf{Q}_p}(\sigma(\epsilon)).
\end{equation}

\begin{proof}[Proof of Lemma~\ref{l:fittnx}] Lemmas~\ref{l:qp} and \ref{l:erec} (applied to $LF_m$ in place of $L$) imply that
${\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L F_m)_{R_m}$ is  quadratically presented over $R_m$ and that
\[ \Fitt_{R_m} ({\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L F_m)_{R_m}) = ( \rec_{G,m}(u_\mathfrak{p}^{\Sigma, \Sigma'})). \]
Applying (\ref{e:recn}), we then calculate
\begin{align}
\beta_m(\rec_{G,m}(u_\mathfrak{p}^{\Sigma, \Sigma'})) &= \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) + X \sum_{\sigma \in G}\overline{\pmb{\psi}}(\sigma)^{-1} \log_p  \Norm_{H_{\mathfrak{P}}/\mathbf{Q}_p}(\sigma(u_\mathfrak{p}^{\Sigma, \Sigma'}))  \nonumber \\
& =  \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) - \Theta_H' X  \label{e:applygs} \\
& =  \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) - \Theta_L. \label{e:applyref}
 \end{align}
Equation (\ref{e:applygs}) follows from Corollary~\ref{c:ddp} and equation (\ref{e:applyref}) is one of the defining relations of $R_{X, m}$ in (\ref{e:rxdef}). The lemma follows.
\end{proof}

On the other hand, in our previous work \cite{dk} we we calculated the Fitting ideal of ${\nabla}_{\Sigma_\mathfrak{p}}^{\Sigma'}(L F_m)$ exactly, yielding the following result:

\begin{theorem}  We have $\Fitt_{R_{X,m}}(\nabla_{X,m}) = 0$. \label{t:fittxz}
\end{theorem}

\begin{proof} Theorem 3.3 of \cite{dk}, recalled in Theorem~\ref{t:dkresult} above,
implies that
\[    \Fitt_{R_m}(\nabla_{\Sigma_\mathfrak{p}}^{\Sigma'}(LF_m)_{R_m}) = (\Theta^{LF_m}_{\Sigma_\mathfrak{p}, \Sigma'}). \]
Passing to $R_{X,m}$ by applying $\beta_m$, we find
\begin{align}
\beta_m(\Theta^{LF_m}_{\Sigma_\mathfrak{p}, \Sigma'}) &= \Theta_L + X \sum_{\sigma \in \mathfrak{g}_m} \zeta_{\Sigma_\mathfrak{p}, \Sigma'}(\sigma, 0) \log_p\varepsilon_{\cyc}(\sigma)\overline{\sigma}^{-1} \nonumber \\
&= \Theta_L + X \sum_{\sigma \in G_m} \zeta_{\Sigma_\mathfrak{p}, \Sigma'}(\sigma, 0) \log_p\varepsilon_{\cyc}(\sigma)\overline{\sigma}^{-1}  \label{e:gtog} \\
&= \Theta_L - X \Theta_H'  \label{e:applyth} \\
&= 0.  \label{e:final} \end{align}
Here $\overline{\sigma}$ denotes the image of $\sigma$ in  $G$.  Equation (\ref{e:gtog}) follows from the distribution property of partial zeta functions since $\log_p \varepsilon_{\cyc}(\sigma) \overline{\sigma}^{-1}$ depends only on the image of $\sigma$ in $G_m$. Equation (\ref{e:applyth}) follows from Lemma~\ref{l:derivative}.  Equation (\ref{e:final}) is a defining relation of $R_{X,m}$.  The result follows.
\end{proof}

Combining Lemma~\ref{l:fittnx} with Theorem~\ref{t:fittxz}, we obtain \begin{equation} \label{e:recutrx}
 \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) - \Theta_L =0 \text{ in } R_{X,m}. \end{equation}
   By Lemma~\ref{l:nxi},  equation (\ref{e:recutrx}) for $m$ large enough yields
\[ \rec_G(u_\mathfrak{p}^{\Sigma, \Sigma'}) \equiv \Theta_L \pmod{I^2} \]
in $R$.  This  completes the proof of the $p$-part of the modified Gross conjecture (\ref{e:mgc}) in Case 2(c).
Lemma~\ref{l:equiv} then yields the $p$-part of Gross's conjecture for the Brumer--Stark unit $u_\mathfrak{p}$:
\[ \rec_G(u_\mathfrak{p}) \equiv  \Theta_{S_\mathfrak{p},T}^{L/F} \pmod{I^2}. \]
This completes the proof of Theorem~\ref{t:maingross}.

redpajama_set_name: RedPajamaArXiv