Congruence modules in higher codimensions]Congruence modules and the Wiles-Lenstra-Diamond numerical criterion
in higher codimensions

S. B. Iyengar]Srikanth B. Iyengar
Department of Mathematics,
University of Utah, Salt Lake City, UT 84112, U.S.A.

C. B. Khare]Chandrashekhar  B. Khare
Department of Mathematics,
University of California, Los Angeles, CA 90095, U.S.A.

J. Manning]Jeffrey Manning
Max Planck Institute for Mathematics,
Vivatsgasse 7, 53111 Bonn, Germany

[2020] 11F80 (primary); 13C10, 13D02  (secondary)

to Andrew Wiles

We define a congruence module  $\Psi_A(M)$ associated to  a  surjective $\mco$-algebra morphism $\lambda\colon A \to \mco$, with $\mco$ a discrete valuation ring,  $A$ a complete noetherian local $\mco$-algebra regular at $\mathfrak{p}$, the kernel of $\lambda$, and  $M$ a finitely generated $A$-module.  We establish a numerical criterion for $M$ to have a free direct  summand  over $A$ of positive rank. It is in terms of the lengths of $\Psi_A(M)$ and the torsion part of $\mathfrak{p}/\mathfrak{p}^2$. It generalizes results of Wiles, Lenstra, and Diamond, that deal with the case when the codimension  of $\mathfrak{p}$ is zero.

Number theoretic applications include integral  (non-minimal) $R=\mathbb T$ theorems in situations of positive defect  conditional on certain standard conjectures. Here $R$ is a deformation ring parametrizing certain Galois representations and $\mathbb T$ is a Hecke algebra.  An example of a positive defect situation is that of proving modularity lifting for 2-dimensional $\ell$-adic  Galois representations over an imaginary quadratic field. The proofs combine our  commutative algebra results with   a generalization  due to Calegari and Geraghty  of the patching method of Wiles and Taylor–Wiles   and level raising arguments that go back to Ribet. The results  provide new evidence in favor of the  intriguing, and  as yet fledgling,   torsion  analog of the classical Langlands correspondence.

§ INTRODUCTION

The raison d'etre of this paper is to develop new commutative algebra inspired by number theoretic applications. The main contribution of our work is a generalization of the theory of congruence modules and the numerical criteria of Wiles, Lenstra, and Diamond to higher codimension. As a demonstration of the utility of our work, we prove a new (integral) $R={\TT}$ theorem at non-minimal level in  certain  positive defect situations that  arise for instance when proving modularity of elliptic curves over imaginary quadratic fields.   Another motivation is to define congruence modules attached to  augmentations of (big) ordinary deformation rings arising from cohomological cuspidal automorphic representations. These number-theoretic  applications provided  the intuition  that  guided us to our  commutative algebra results.

To set the stage to present our work, we fix a prime number $\ell$, and $\mco$ the ring of integers of a finite extension of $\mathbb Q_\ell$ with residue field $k$ uniformizer $\varpi$ and fraction field $E$.  We consider the category $\CNL_\mco$ of complete noetherian local $\mco$-algebras with residue field $k$, with morphisms the  maps of local $\mco$-algebra maps inducing the identity on $k$.

The patching method introduced  in the work of Wiles <cit.>  and Taylor–Wiles <cit.>  on modularity lifting theorems, and instrumental in Wiles' proof of Fermat's Theorem, has undergone intense development. In the original approach of Wiles, patching was combined with level raising results, and a numerical criterion <cit.>,   extended by Lenstra <cit.>,  for surjective maps between rings  $R \to {\TT}$, with ${\TT}$ finite flat over $\mco$, to be isomorphisms of complete intersections. In applications in <cit.>,  the ring $R$ is a deformation ring for Galois representations and ${\TT}$ a Hecke algebra.  Diamond <cit.> developed the results of Wiles and Lenstra by proving a numerical criterion for freeness of $R$-modules $M$ finite flat over $\mco$,  in terms of an augmentation $\lambda\colon R \to \mco$ supported on $M$, that is to say, $M_{\fp} \neq 0$ for  $\fp$ the kernel of $\lambda$. The work of Wiles and Lenstra corresponded to the case when $M$ was a cyclic $A$-module.  Diamond’s criterion is in terms of the cotangent module $\fp/\fp^2$ of $\lambda$, assumed to be a finite abelian group,   and the congruence module  for $M$ at $\lambda$, defined to be:

\[
\frac{M}{M[\fp] \oplus M[\ann \fp]}.
\]

In <cit.>, Diamond applies this in the case where $R$ is a  suitable deformation  ring, acting on $M\colonequals \hh_1(X_0(N),\mco)_{\fm}$ with $\fm$ a maximal ideal corresponding to the Galois representation $\rhobar_{\fm}$ whose deformations are parametrized by $R$. The  action of $R$  on $M$ factors through the corresponding Hecke algebra $\TT$ that acts faithfully on $M$. Thus if $M$ is free over $R$, the map $R\to \TT$ is injective, and hence an isomorphism. In this way Diamond recovers the results of <cit.>.

The patching method has been  extended   by Calegari and Geraghty <cit.> to situations of positive defect in which one patches complexes rather than modules: this is the situation one finds oneself   in  when  proving   modularity of elliptic curves over number fields which are not totally real, such as imaginary quadratic fields.

The positive defect case presents a number of additional complications compared to situation of Wiles, which have prevented the numerical criterion from being generalized in the same way as the patching method. First, in the positive defect case the rings $R$ and ${\TT}$ are no longer expected to be complete intersections in general.  Secondly, while $R$ and ${\TT}$ are expected to be finite flat over $\mco$ in the defect zero case, they will typically have torsion in the positive defect case. Moreover, the torsion plays an important role in the theory (and a careful understanding of the torsion is necessary for generalizing the patching method). This is an issue as the numerical criterion cannot easily account for torsion in ${\TT}$ or $M$. To make things even more complicated,  $R$ and ${\TT}$ can be entirely torsion which would mean that the map $\lambda\colon R\to \mco$ used in the numerical criterion may not even exist. Lastly, replacing the module $M$ with a complex makes it somewhat unclear how to correctly generalize Diamond's criterion.

The main contribution of our work is to give a generalization of the numerical criterion to the positive defect case. The key idea is to combine the numerical criterion with patching by applying the numerical criterion directly to the patched objects rather than to the rings $R$ and ${\TT}$, rather than using the two approaches independently. This sidesteps the issues raised above, as the patched version, $R_\infty$, of the ring $R$ will automatically be a complete intersection and flat over $\mco$, and the patched version, $M_\infty$, of the complex will be a (maximal Cohen–Macaulay) $R_\infty$-module rather than a complex.

The complication that arises in this approach is that $\Ker(R_\infty\to \mco)$ will no longer be a minimal prime of $R_\infty$ and $M_\infty$ will no longer be finite over $\mco$.  We thus consider a larger families of rings $R$ in $\CNL_\mco$ than those discussed above, placing no restrictions on the height (also known as codimension) of $\Ker(R\to \mco)$, and requiring only that $M$ is finitely generated and has sufficient depth. For such $R$ and $M$, we establish a criterion for $M$ to have a non-zero finite free summand and $R$ to be a complete intersection. Applying this to the patched objects $R_\infty$ and $M_\infty$, we show that $M_\infty$ has a free direct summand, which in turn implies that the ring $R$ acts faithfully on the original complex, giving $R={\TT}$. We elaborate on this  later.

This proof of the new numerical criterion takes up the first part of this paper, and involves only commutative algebra.  This is applied in the third part to prove modularity lifting theorems. The second part of the paper establishes a result concerning the compatibility of patching and duality.

In the remainder of the introduction we present the results in commutative algebra and modularity lifting, and explain in greater detail how  they  fit in the line of development  of modularity lifting theorems pioneered  by Wiles, and continued in the work  of Taylor–Wiles,  Diamond, Kisin, and Calegari–Geraghty.

§.§ Commutative algebra results

Consider  pairs $(A, \lambda)$, with $A$ a complete local noetherian $\mco$-algebra and $\lambda\colon A \to \mco$  a surjective map of $\mco$-algebras   with kernel $\fp_A$; we treat a somewhat larger class of rings in part of the text. The category consisting of pairs $(A,\lambda)$ for which the local ring  $A_{\fp_A}$ is regular, of dimension $c$, is denoted  $\acat(c)$. The regularity hypothesis is tantamount to the condition that the conormal module $\fp_A/\fp_A^2$ of $\lambda$, viewed as an $\mco$-module, has rank equal to $\dim A_{\fp_A}$. In what follows its torsion-submodule

\[
\con A\colonequals \tors{(\fp_A/\fp_A^2)}\,,
\]

also plays a key role. Here $\tors(U)$ denotes the torsion-submodule of any finitely generated $\mco$-module $U$.  We also need to consider the torsion-free quotient of $U$, namely $\tfree U \colonequals U/\tors(U)$.

The natural map
$M \lra  M/\fp_AM$ induces a map

\[
\tfree{\Ext^c_A(\mco, M)} \lra \tfree{\Ext^c_A(\mco, M/\fp_AM)}
\]

of finitely generated  torsion-free  $\mco$-modules.  We define the congruence module of $M$, denoted $\cmod A(M)$, to be the cokernel of this map. When $c=0$ this coincides with Diamond's definition recalled above; see Proposition <ref>. The definition is reminiscent of the evaluation map in rational homotopy theory and local algebra defined in exactly the same way for the augmentation $A\to k$ to the residue field of $A$, and with $M\colonequals A$. In particular, the localization of the map above (again for $M=A$) at $\fp_A$ is the evaluation map of the local ring $A_{\fp_A}$, and the fact this map is non-zero precisely when $A_{\fp_A}$ is regular—this is a result of Lescot <cit.>—is critical to all that follows. It implies  that the $\mco$-module $\cmod A(M)$ is torsion, and hence of finite length.  The Wiles defect of $M$ is the integer

\[
\delta_A(M)\colonequals (\rank_{A_{\fp_A}}\! M_{\fp_A}) \length_{\mco}{\con A} - \length_{\mco}{\cmod A(M)}\,.
\]

We view this definition of the congruence module and Wiles defect, which extends  to all $c\ge 0$ the usual definition for $c=0$, as one of the key contributions of this work. We expect these  will play a role in number theoretic applications, like  analyzing  the structure of  deformation rings or eigenvarieties at classical points. One piece of evidence in support of their utility is that one has the following freeness criterion for modules, extending the result of Wiles, Lenstra, and Diamond.

Guided by the intended number theoretic applications, for $A$ in $\acat(c)$, we consider finitely generated $A$-modules $M$ with

\[
\depth_A M\ge c+1 \quad\text{and}\quad  M_{\fp_A}\ne 0\,.
\]

Some of our results require weaker hypothesis on the depth of $M$; see Section <ref>, and in particular <ref>, for a discussion of these various conditions. By the Auslander-Buchsbaum criterion, the properties above imply that the  $A_{\fp_A}$-module $M_{\fp_A}$ is free.

With $A$ and $M$ as above, set $\mu \colonequals \rank_{A_{\fp_A}}(M_{\fp_A})$.  The following statements hold.

* One has $\delta_A(M) \geq 0$, with equality iff $A$ is complete intersection and there is an isomorphism of $A$-modules  $M \cong A^\mu\oplus W$, where  $W_{\fp_A}=0$.

* If  $\delta_A(M)=0$  and $e_A(M)\le \mu \cdot e(A)$, then $M\cong A^\mu$.

The invariant $e_A(M)$ is the multiplicity of $M$; see <cit.>. The non-negativity of the defect, which is essentially due to Tate when $c=0$ and $M\colonequals A$, is proved in Corollary <ref>; the remaining assertions are contained in Theorems <ref> and <ref>. One way to think about our result is that the vanishing of the Wiles defect allows one to propagate the local  freeness (of rank $\mu$) of $M$ at $\fp_A$  to  the  global property that $M$ has a free direct summand $A^\mu$.

As in the proof of <cit.> the first step in the proof of Theorem <ref> is to deduce that $A$ is complete intersection. This involves a “defect formula" that relates the defect of $M$ to that of $A$; see Lemma <ref>.
At this stage, one has the following more general criterion for detecting free summands in $M$, without the complete intersection property as a consequence.

Let $A$ be a Gorenstein local ring in $\acat$ and $M$ a maximal Cohen–Macaulay $A$-module with $\mu\colonequals \rank_{\fp_A}(M_{\fp_A})\ne 0$. One has $\delta_A(M)=  \mu \cdot \delta_A(A)$, if and only if

\[
M\cong A^\mu \oplus W \qquad\text{where $W_{\fp_A}=0$.}
\]

If moreover $e_A(M)\le \mu \cdot e(A)$, then $M$ is free.

This is the content of Theorem <ref>. We prove Theorems <ref> and <ref> by a reduction to the case $c=0$. For this a key result, recorded below and contained in Theorem <ref>, is that the Wiles defect remains invariant on going modulo certain $M$-regular sequences. Here $\fp_A^{(2)}$ denotes the second symbolic power of $\fp_A$.

Let $A$ be  in $\acat(c)$ and $M$ a finitely generated $A$-module such that $\depth_AM\ge c+1$. Let $f$ in $\fp_A\setminus \fp_A^{(2)}$ be such that it is not a zero-divisor on $M$. Then the ring $B\colonequals A/fA$ is in  $\acat(c-1)$, and

\[
\delta_A(M) = \delta_{B}(M/fM)\,.
\]

In the passage from $A$ to $B$,  the lengths of both the cotangent module and the congruence module change; the crux is that they change by the same amount. Tracking the change in the cotangent module  is relatively straightforward. The other, more subtle problem, is to control the change in the congruence module of $M$. A key result that permits this is a structure theorem for the torsion-free quotient of Yoneda Ext-algebra $\Ext^*_{A}(\mco,\mco)$. While the Ext-algebra itself can be quite complicated, and typically non-commutative, its torsion-free quotient turns out to be the exterior algebra on $\Ext_A^1(\mco,\mco)$, the dual of the cotangent module of $\lambda$; see Proposition <ref>. The proof of this result uses techniques that grew out of Tate's work <cit.>, which introduced methods of differential graded algebras into commutative algebra.

Another noteworthy feature of  congruence modules, is an “invariance of domain" property, Theorem <ref>, extending <cit.> which is the case $c=0$. It too is an important ingredient in the proof of Theorem <ref>.

Let $\vf\colon A\to B$ be a surjective map of local rings in $\acat(c)$. For any finitely generated $B$-module $M$ with $\depth_BM\ge c$, one has

\[
\cmod B(M)\cong \cmod A(M)\,.
\]

Thus $\delta_B(M)\ge \delta_A(M)$ with equality if and only if $\length_{\mco}\con A =\length_{\mco}\con B$.

These results above, especially the invariance of domain property, and the fact that the element $f$ in Theorem <ref> need only be $M$-regular and not $A$-regular, convinces us that the definition of Wiles defect we have is the correct one.

§.§ Torsion Langlands correspondence and integral $R=\TT$ theorems

Our applications to modularity lifting  assume Conjectures <ref>, <ref>, <ref> and <ref> listed in Section <ref>.  These conjectures are similar to conjectures in <cit.>.  Conjectures <ref>, <ref>  are about existence of Galois representations attached to Hecke eigenclasses arising from the cohomology of symmetric manifolds  and resulting maps $R \to \TT$.  Conjecture <ref>  is about  concentration of integral cohomology of these manifolds in a certain range $\ell_0$, and Conjecture <ref>  is a version of Ihara’s lemma.

We restrict ourselves to considering 2-dimensional representations of $G_F$ with $F$ a number field. The relevant cohomology groups arise from complexes which are conjectured to be of length $\ell_0$ where $\ell_0=r_2$ is the defect  (see Conjecture <ref>). Here $[F:\mbb Q]=r_1+2r_2$ with $r_1$ and $r_2$ the number of real and complex places of $F$, respectively. The strategy to use our commutative algebra results  for proving  (integral, non-minimal)  modularity  lifting theorems  in positive defect  is to  apply  them for suitable augmented rings and modules that arise  after carrying out patching.  Thus we prove that in a   patched non-minimal situation a module $M_\infty$  over a ring $R_\infty$ has a free direct summand $R_\infty^\mu$ for a positive integer $\mu$,  and $R_\infty$ is a complete intersection.

Patching methods of <cit.>   can be  used   in principle to  prove  that a certain patched module $M_\infty$ is maximal Cohen–Macaulay as a module over a patched deformation ring $R_\infty$. Using Taylor's  Ihara avoidance <cit.> one   may in principle  deduce (even when  considering non-minimal deformations, so $R_\infty$ need not be a domain) that $M_\infty$ is faithful as a $R_\infty$-module and $M_\infty[1/\ell]$ is free over $R_\infty[1/\ell]$. After passing to a quotient ring by a sequence that may not be regular when $\ell_0>0$,  one gets a deformation ring $R$ acting on  the homology module $M$ in lowest degree $q_0=r_1+r_2$ of an arithmetic manifold,  and one may  deduce that $M[1/\ell]$ is  a free $R[1/\ell]$-module.   It does not seem possible to get by these methods (that rely primarily on patching) that $M$ itself is a faithful $R$-module.

Our work  is an integral refinement of such results (conditional on the conjectures referred to above)  and when applied  in the situation of 2-dimensional Galois representations over imaginary quadratic fields $K$, and with $X$ a Bianchi 3-manifold, yields that   $M\colonequals \HH 1{X,\mco}_{\fm}$ has a free  direct summand  $R^\mu$ for some $\mu \geq 1$ for a suitable  (possibly non-minimal) deformation ring $R$ that acts on $M$.  Here $\fm$ is the maximal ideal of a Hecke algebra $\TT$ that acts faithfully on $M$ with associated residual Galois representation $\rhobar_{\fm}\colon G_K \to \GL_2(\TT/{\fm})$. (In the statement of Theorem <ref>  below  the non-minimality of the deformation ring $R_\Sigma$ which acts on  the homology of an arithmetic manifold $Y_0(\mcn_\Sigma)$  via Conjectures   <ref>, <ref>  is reflected in the fact that the level $\mcn_\Sigma$ might be strictly divisible by the conductor of the residual representation $\rhobar_{\fm}$.) The  resulting integral  $R=\TT$ theorems that follow  produce new evidence towards an  emerging  torsion Langlands correspondence. This addresses torsion  Galois representations $\rho\colon G_K \to \GL_2(\mco/\omega^n)$   that may not lift to characteristic 0. Our results show that such a $\rho$ is automorphic in the sense that it  arises from specialising the universal modular Galois deformation $\rho_\TT\colon G_K \to \GL_2(\TT)$ lifting $\rhobar_{\fm}$, arising  thus from torsion Hecke eigenclasses in  $\HH{1}{X,\mco}_{\fm}$.

With $\rhobar_\fm$, $\Sigma$ and $\mcn_\Sigma$ as in Section <ref>, our main number theory application, Theorem <ref>,  is the following result. (Note that in the main text we define $Y_0(\mcn_\Sigma)$ to have additional level structure at an auxiliary prime $t\nmid \mcn_\Sigma$, in order to make the subgroups neat.)

Assume Conjectures <ref>, <ref>, <ref> and <ref> hold. Let $\fm$ be a non-Eisenstein maximal ideal of ${\TT}(K_0(\mcn_\es))$ such that $N(\rhobar_\fm) = \mcn_\es$ and $\rhobar_\fm|_{G_{F(\zeta_\ell)}}$ is absolutely irreducible. Then there exists an integer $\mu\ge 1$ such that for all $\Sigma$  there is an isomorphism of $R_\Sigma$-modules

\[
\hh_{r_1+r_2}(Y_0(\mcn_\Sigma),\mco)_{\fm_\Sigma}\cong R_\Sigma^\mu \oplus W_\Sigma
\]

for some $R_\Sigma$-module $W_\Sigma$. In particular, $R_\Sigma$ acts faithfully on $\hh_{r_1+r_2}(Y_0(\mcn_\Sigma),\mco)_{\fm_\Sigma}$ and so the map $R_\Sigma\onto {\TT}_\Sigma$ from Conjecture <ref> is an isomorphism for all $\Sigma$.

In analogy with <cit.>, one might expect our method to produce the stronger result that $\hh_{r_1+r_2}(Y_0(\mcn_\Sigma),\mco)_{\fm_\Sigma}\cong R_\Sigma$ (that is,  one would expect that $\mu=1$ and   $W_\Sigma =0$). The reason for our slightly weaker result is that one cannot control the generic rank of the patched module $M_\infty$ unless the ring $R$ has enough characteristic $0$ points (in order to appeal to classical multiplicity one results for automorphic forms), which is not guaranteed in the positive defect case. Fortunately the weaker statement above is still enough to deduce $R={\TT}$.

The residual representations $\rhobar_{\fm}$ and non-minimal levels $\mcn_\Sigma$   that we allow in the theorem are somewhat restrictive,  in particular they are square-free and divisible by primes  $v$ with restricted behavior  of $\rhobar_{\fm}(\Frob_v)$; see  Proposition <ref>. This is mainly for convenience, and we expect that the methods of this paper could be used to prove analogues of Theorem <ref> at more general levels, with  little added difficulty.

In the specific case when the number field $F$ is an imaginary quadratic field, Conjectures <ref> and <ref>   are known (see the discussions   after their  statements), as are parts of Conjectures <ref> and <ref>  (see <cit.>, and discussion before their statements), and so Theorem <ref> is closer to holding unconditionally.

§.§ Wiles defects of  cohomology groups of modular curves  and Shimura curves

The deformation invariance proved in Theorem <ref>  has applications to reproving and generalizing, by a different method, the results of <cit.>. Specifically an easy corollary of Theorem <ref> is the following:

Let $R_\infty$ be a complete local noetherian $\mco$-algebra and  $\lambda\colon R_\infty\to\mco$ a surjective map with kernel $\fp$, such that $(R_\infty)_{\fp}$ is regular of dimension $c$. Let $M_\infty$ be an $R_\infty$-module with $\depth_{R_\infty}M_\infty \ge c+1$ and $(M_\infty)_{\fp}\ne 0$.

Let $(\bs y,\varpi)$ be an $M_\infty$-regular sequence, where ${\bs y} = \{y_1,\ldots,y_c\}\subseteq \fp$ and let $R_{\bs y} = R_\infty/(\bs y)$, $M_{\bs y} = M_\infty/(\bs y)$ and $\fp_{\bs y} = \fp/(\bs y)\subseteq R_{\bs y}$, so  $M_{\bs y}$ is flat over $\mco$.

Provided that $\fp_{\bs y}/\fp^2_{\bs y}$ has finite length, the Wiles defect $\delta_{R_{\bs y}}(M_{\bs y})$ depends only on $R_\infty$, $M_\infty$ and $\lambda\colon R_\infty\to\mco$, and not on the choice of $\bs y$.

In the case when $M_\infty = R_\infty$ (and hence $R_\infty$ is Cohen–Macaulay) this recovers <cit.>. Theorem <ref> represents a significant generalization of this result, as it does not require that $R_\infty$ is Cohen–Macaulay.

Removing the requirement that $R_\infty$ is Cohen–Macaulay is particularly significant for number theoretic applications. In the context considered in <cit.>, the ring $R_\infty$ would be a power series ring over a completed tensor product of certain local Galois deformation rings, $M_\infty$ would be a `patched' module arising from the cohomology of certain Shimura curves and the augmentation $\lambda\colon R_\infty\to\mco$ would arise from a certain cuspidal Hilbert modular form (this is still a special case, the same commutative algebra setup would occur in any patching situation with defect $\ell_0=0$). Crucially, while the ring $R_\infty$ is only known to be Cohen–Macaulay in some rather restrictive cases, the module $M_\infty$ would automatically satisfy $\depth_{R_\infty}M_\infty = c+1$ in all cases, as a consequence of the patching argument.

The primary objects of number theoretic interest would be a Galois deformation ring $R$ and a cohomology module $M$, which would have the form $R = R_{\bs y}$ and $M = M_{\bs y}$ for some sequence ${\bs y}$ as above. Theorem <ref> would thus imply that $\delta_R(M)$ (which was referred to as the cohomological Wiles defect in <cit.> and <cit.>) depends only $R_\infty$, $M_\infty$ and $\lambda\colon R_\infty\to\mco$, and not on $R$ and $M$ directly.

As in <cit.>, both $R_\infty$ and $\lambda\colon R_\infty\to\mco$ are determined entirely by local Galois theoretic information. The module $M_\infty$ is not always known to be determined by local information, but it is reasonable to expect that it is. In fact it is plausible that one can prove that it is in some circumstances where $R_\infty$ cannot be proven to be Cohen–Macaulay. This would then imply that the cohomological Wiles defect, $\delta_R(M)$, is determined entirely by local information without requiring the assumption that $R_\infty$ is Cohen–Macaulay, allowing one to generalize <cit.>.

§.§ Links between the commutative algebra and modularity lifting

We outline where our results  fit in  the evolution of modularity lifting results.

The original papers of Wiles and Taylor–Wiles, <cit.> and <cit.>, deduced modularity lifting from an $R={\TT}$ result which they first proved in the minimal level case via a patching argument, and then proved in non-minimal levels via an induction argument using the numerical criterion. The innovation of Diamond in <cit.> reformulated the patching and numerical criterion for modules rather than rings, which allowed the argument to prove freeness results for certain cohomology groups (rather than requiring these results as inputs to the argument).

Kisin's work in <cit.> gave the patching method far greater flexibility and applicability by patching global deformation rings and Hecke  modules relative to local deformation rings. The work of Kisin almost erases the distinction between minimal and non-minimal cases, and removes the need for the numerical criterion. This comes at the expense of only proving $R[1/\ell] = {\TT}[1/\ell]$, rather than $R={\TT}$, which does not matter for proving modularity of $\ell$-adic Galois representations.

These works were in the case when the (global) defect $\ell_0$ is 0. The  insight of Calegari and Geraghty in  <cit.> generalized the patching method to positive defect (subject to certain conjectures, which we must also assume for our work). Following the approach of Kisin, this gives modularity lifting results for $\ell$-adic representations in both minimal and non-minimal levels. However in non-minimal levels it again can only prove that $R[1/\ell] = {\TT}[1/\ell]$, or even only that $R^{\mathrm{red}} = {\TT}^{\mathrm{red}}$. In the $\ell_0>0$ case one typically expects $R$ and ${\TT}$ to have torsion, and so not having an approach to proving $R={\TT}$ is a noticeable shortcoming to the patching method.

Our work generalizes the numerical criterion to positive defect, and thus gives us $R={\TT}$ results in non-minimal level by an inductive argument similar to the one in <cit.>. Unlike in the $\ell_0=0$ case, when the patching and numerical criterion arguments were treated fairly independently of each other, when $\ell_0>0$ we are compelled to work at a patched level to apply our numerical criterion. This is one of the key insights of this paper: patching is a necessary prelude to using our numerical criterion for applications to modularity lifting in positive defect.

In the positive defect case patching is much more intrinsic to deducing  non-minimal $R={\TT}$ theorems from their minimal analogs than in the defect 0 case. In both the defect $0$ case and the positive defect case the augmentation $\lambda\colon R_\infty \to \mco$ is crucial for formulating the numerical criterion. In the positive defect case the augmentation which we consider does not need to factor though the global deformation ring $R_\infty\onto R$, and indeed may not have any relation to Galois representations or modular forms. This is necessary, as $R$  may not have any characteristic 0 points if the residual representation $\rhobar_{\fm}$ has no appropriate characteristic 0 lifts, and so the augmentation $\lambda$ may only exist after patching.

As an important step in our proof of Theorem <ref> we have to  generalize the  classical change of congruence modules arguments of Ribet <cit.>  (in codimension $c=0$ setting) to the present higher ($c>0$) codimension  setting to deduce that  the Wiles defect  $\delta_{R_\infty’}(M_\infty’)$ vanishes, for patched rings $R_\infty’$  and modules $M_\infty’$ in non-minimal situations,  from  $\delta_{R_\infty}(M_\infty)=0$, for patched rings $R_\infty$  and modules $M_\infty$ in minimal situations. For this one uses the following results  in concert:

* patching in Theorem <ref>;

* Theorem <ref>  which gives a self-duality statement for a patched module that arises from patching complexes with self-duality properties;

* a version of Ihara’s lemma for surjectivity of maps between patched modules of different levels  in <ref>;

* change of congruence module arguments for our congruence modules in higher codimensions which  is inspired by <cit.> and uses in addition the commutative algebra  results Lemma <ref>  and Proposition <ref>, as well as Theorem <ref>.

§.§ Earlier work

As noted before, our work is inspired by work of Wiles, Lenstra, and Diamond.  The result of Wiles and Lenstra has been extended by Huneke and Ulrich <cit.>, and Zarzuela <cit.>, to cover more general surjective maps of rings $A\to B$, where $B$ need not be a discrete valuation ring.  The direct  precursors  to  the  commutative algebra developed in this paper are  <cit.>,   <cit.>, <cit.> (and its appendix),   <cit.>, as well as the work of Tilouine and Urban in <cit.>.    We describe briefly the previous work, to provide historical  context.

The results of <cit.> and <cit.>  generalized results of Wiles, Lenstra and Diamond   in Wiles:1995, Lenstra, Diamond:1997 so that rather than asking that the  ring $A$ or the module $M$ be finite and  flat over $\mco$, it is only required that  $M$ has positive depth. Theorem <ref> in this paper  also requires that $M$ have sufficient depth.

The papers   Bockle/Khare/Manning:2021b, Bockle/Khare/Manning:2021a, TiUr, introduced the  notion of Wiles defect of rings, and showed that it has arithmetic significance. The appendix  to  <cit.>  (written by N. Fakhruddin and the second  author) established a formula for the Wiles defect proposed  by Venkatesh for $\mco$-algebras $A\in \acat(0)$ with $\dim A=1$. This involves the André–Quillen cohomology module $\mathrm{D}^1(A/\mco,E/\mco)$, where $E$ is the fraction  field of $\mco$, and another invariant that  he  defined using suitable complete intersections that map onto $A$.  The main article   <cit.>  extended  the definition of Venkatesh  invariants, and Wiles defect, to higher dimensional rings $A$ that are Cohen–Macaulay and flat over $\mco$ and with an augmentation $\lambda\colon A \to \mco$ such that $A$ is smooth at $\lambda$, basically by proving that the invariants  remain unchanged on going modulo regular sequences, so that one can reduce to dimension one.

The paper <cit.> considered Wiles defect for $A \in \acat(0)$, and $M$ a finitely generated $A$-module. One of the main observations of that paper, <cit.>,  is a formula  relating the Wiles defects of the module $M$ and ring $A$. This is generalized in our paper Lemma <ref>  and plays an important role in the proof of Theorem <ref>.

The present paper defines the Wiles defect for all rings $A$ in $\acat (c)$ for arbitrary $c$. This uses our  invariants $\con A$ and $\cmod A$ that are more direct generalizations of the invariants of  Wiles; their definition does not use André–Quillen homology of rings.
They do not remain invariant individually on going modulo regular sequences, but the Wiles defect $\delta_A$ defined using them remains invariant; see  Theorem <ref> and the discussion around it. Our invariants are defined in a way that is more intrinsic to $A$ than the ones introduced by Venkatesh which use as a crutch complete intersections mapping to $A$.

§.§ Future work

We indicate some further number theoretic applications of congruence modules and the commutative algebra developed here which we intend to pursue, beyond the $R=\TT$ theorems in the non-minimal case carried out in Part <ref>.

§.§.§ Applications to $p$-adic $L$-functions and Bloch–Kato type conjecture for  classical points on eigenvarieties

This application seeks to provide an  analytic interpretation for  lengths of our congruence modules attached to newforms $f$ of weight $k \geq 2$  in terms of special  values of $p$-adic $L$-functions  attached to the adjoint motive of $f$. This would generalize  Hida’s interpretation <cit.>  of lengths of (codimension 0) congruence modules  in terms of special values   $L(1,{\rm Ad}(\rho_f))$ of classical $L$-functions. For this we  consider a map $R\to {\TT}$, where $R$ is a deformation ring and ${\TT}$ is a Hecke algebra and an augmentation $\lambda_f\colon R\to {\TT}\to \mco$, arising from a newform $f$. The cotangent module $\con R$ is related to a Selmer group, and Hida's work relates the length of the congruence module $\cmod {\TT}$ to $L(1,{\rm Ad}(\rho_f))$.  In
many situations the work of Wiles <cit.> shows that  the map $R \to \TT$  is  an isomorphism of complete intersections finite flat over $\mco$. Wiles' numerical criterion then shows that $\length_{\mco}\con R = \length_{\mco}\cmod {\TT}$, which gives  a special case of the Bloch–Kato conjecture.

Our work suggests an avenue for generalizing this argument to higher dimensions. In the simplest non-trivial case, one may replace $R$ and ${\TT}$ with the ordinary deformation ring and Hecke algebra, $R^{\rm ord}$ and ${\TT}^{\rm ord}$, respectively.  An ordinary  newform $f$ induces an augmentation $\lambda_f\colon R^{\rm ord}\to{\TT}^{\rm ord}\to \mco$. One  again  has in many situations that $R^{\rm ord}\to {\TT}^{\rm ord}$ is an isomorphism of complete intersections.   Here however $R^{\rm ord}$ and ${\TT}^{\rm ord}$ are finite flat over the Iwasawa algebra $\Lambda=\mco\pos{T}$, and hence $\Ker \lambda_f$ has codimension $1$.    As it is known that $\TT^{\rm ord}$ is smooth at $\lambda_f$, our work allows us to again consider the congruence module $\cmod{{\TT}^{\rm ord}}$ which is of finite length as an $\mco$-module. It is natural to ask whether this congruence module also has an interpretation in terms of a special value of  a $p$-adic $L$-function. (For this paragraph we denote the prime considered by $p$ rather than $\ell$.)  More specifically, the relation between  $\cmod {{\TT}^{\rm ord}}$ and $L_p'(1,{\rm Ad}(\rho_f))$ is intriguing, and invites further work, which  could be viewed as the natural analog of Hida's result in <cit.>.  We also view such a (conjectural)  interpretation as the analog in the $q=p$ case of the work in <cit.> which uses  Wiles’s methods and Ribet’s level raising techniques to  relate imprimitive $p$-adic  Selmer groups and  $p$-parts of $L$-values arising from the adjoint motive of $f$ when one relaxes the ramification conditions at $q$ for $q \neq p$. In this situation, the  $\mco$-rank of the cotangent space of $\TT^{\rm ord}$ at  the augmentation $\lambda_f$ is 1,
the congruence module $\cmod {{\TT}^{\rm ord}}$ of $\lambda_f\colon \TT^{\rm ord} \to \mco$ is finite, and $L_p(1,{\rm Ad}(\rho_f))$ vanishes.   It is conjectured but not known that $L_p’(1,{\rm Ad}(\rho_f))$ is non-zero. If a suitable interpretation of $\cmod {{\TT}^{\rm ord}}$ in term of $L$-functions could be found (for which the interpretation of our congruence modules in terms of duality given  in Proposition <ref> should be useful), Theorem <ref> would  relate this to $\length_\mco\con{R^{\rm ord}}$, which is the order of the cotorsion part of a Selmer group.

§.§.§ Modularity lifting without Taylor–Wiles primes

The results in this paper might be useful when trying to generalize the work in <cit.> to use the numerical criterion  even in defect 0 cases to prove modularity lifting theorems when
one may not be able to kill dual Selmer groups using Taylor–Wiles primes. Thorne has used in <cit.>  the approach of <cit.> to modularity lifting using a method of $\ell$-adic approximations in combination with patching to prove modularity of $\ell$-adic Galois representations in cases  when the residual representation is irreducible but  its restriction to $F(\zeta_\ell)$ is reducible (Taylor–Wiles  primes do not exist in this case). There is a manuscript of the second author and Thorne which generalized <cit.>,  when
one may not be able to kill dual Selmer groups using Taylor–Wiles primes, but still in the context of deformation rings and Hecke algebras which were expected to be complete intersections.  This involves imposing that the restricted  local deformation rings considered (especially at primes above $\ell$, parametrizing Barsotti–Tate representations)    are complete intersections. This gives modularity for $\ell$-adic representations that are very restrictive.  The idea would be  to use our results to prove a $R={\TT}$ theorem with relaxed conditions at $\ell$ (the corresponding unrestricted local deformation rings at primes above $\ell$ are often complete intersections)  by combining patching and the method of <cit.> to prove pro-modularity of $\ell$-adic representations (and then possibly deduce classicality from that). This will need the full strength of  our main commutative algebra result Theorem <ref>. In the present paper,  for our main modularity lifting result
Theorem <ref> we could make do with  a restricted version  of  Theorem <ref>  for rings $A$ in $\acat(0)$. This is because we  use the patching construction at minimal and non-minimal levels and the patched rings that arise are a priori known to be Gorenstein or even complete intersections (unlike what is done in  <cit.> and <cit.>).

§.§.§ Smoothness of the eigenvariety at classical points

Another (more speculative)  possible application of our work is to generalize to positive defect a method of Wiles <cit.> to show finiteness of the (Bloch–Kato)  dual Selmer group $\hh^1_{\mathcal L}(S,{\rm Ad}(\rho_f) (1) \otimes E/\mco)$ arising from a classical newform $f$ of weight $k \geq 2$.  This is equivalent to the vanishing of  $\hh^1_{\mathcal L}(S,{\rm Ad}(\rho_f) (1) \otimes E)$ and hence to the smoothness of a certain deformation ring at the point corresponding to $f$. Wiles  reduces this to showing that for certain auxiliary primes $q$ the cokernel of a certain map

\[
\hh^1_{f,\rm relaxed}(S \cup \{q\}, {\rm Ad}(\rho_f) \otimes  E/\mco) \lra \hh^1_s(G_q, {\rm Ad}(\rho_f) \otimes E/\mco)
\]

is bounded independently of $q$, where the Selmer group on the left has a relaxed condition at $q$.  The term on the right is the singular part of the cohomology at $q$.   A key step in Wiles' proof  is an argument with congruence modules that shows that the above map has large image.

One might hope to generalize this argument to prove smoothness of eigenvarieties in higher dimension at classical points. Consider a cohomological form $\pi$ on $\GL_2(\mbb{A}_K)$ with $K$  an imaginary quadratic field (the Bianchi case). One may consider the map

\[
\hh^1_{\rm ord, \rm relaxed}(S \cup \{\fq\}, {\rm Ad}(\rho_\pi) \otimes E/\mco) \to \hh^1_s(G_\fq, {\rm Ad}(\rho_\pi) \otimes E/\mco)
\]

for an auxiliary prime $\fq$, and we would like to show that the cokernel of this map has order bounded independently of $\fq$. Conjectures of Calegari–Emeron <cit.> on completed cohomology imply that this situation behaves analogously to the positive defect patching situation considered in Sections <ref> and <ref>, so one might hope to emulate Wiles' argument using the new definition of congruence modules. While this direction is the most exploratory, it was a key motivation to seek a definition of congruence modules in higher codimensions.

§.§ Comparison to the literature

The question of what might be the right generalization of Wiles numerical criterion to positive defect has been considered before us. For example in <cit.> Calegari  proves some non-minimal modularity lifting theorems in the case of weight one forms. There he combines known multiplicity one theorems for the relevant Hecke modules with the patching argument from <cit.>. He remarks in the introduction to the paper that in the weight one case he considers,  as the relevant Hecke rings  ${\TT}^1$ are not complete intersections in general, and  may  not be flat over  $\mco$, the arguments  of Wiles in <cit.>  seem not to be applicable. The work of this paper offers a work around such an obstruction. Our methods should be applicable, unconditionally, to  prove the non-minimal $R={\TT}$ theorems of <cit.>   without a priori using any multiplicity one theorems.

The work of Calegari and Venkatesh in <cit.> considers level raising in the positive defect case—for example in the Bianchi case—and remarks that a form of Ihara’s lemma is true for homology in degree one of Bianchi manifolds. In our work we apply Ihara’s lemma at a patched level: as the patched complexes are then quasi-isomorphic to a self-dual module, Ihara’s lemma  gives that the growth of the congruence module we define is given by an Euler factor.

Commutative algebra of congruence modules

In this part we introduce congruence modules for a suitable class of local rings, and establish some of their fundamental properties. Although the focus is on the pure commutative algebraic aspects of congruence modules, the results we prove, and even their formulations, are dictated by applications to number theory, and indeed our intuition about congruence modules comes from that realm. Nevertheless, many of the statements are interesting in their own right, so with an eye towards possible applications, also to commutative algebra, the setting is more general and the development is more in-depth than is strictly needed for the number theory applications presented in this work.

§ CONGRUENCE MODULES AND COTANGENT MODULES

Throughout  $\mco$ is a discrete valuation ring, with uniformizer $\varpi$.

We write $\tors(U)$ for the torsion submodule of an $\mco$-module $U$. The torsion-free quotient of $U$, denoted $\tfree U$,  is the cokernel of the inclusion $\tors(U)\subseteq U$. There is thus an exact sequence of $\mco$-modules

\[
0\lra \tors(U) \lra U \lra \tfree{U} \lra 0\,,
\]

functorial in $U$. When $U$ is finitely generated, so is $\tfree U$ and hence it is a free $\mco$-module. In particular, the sequence above splits. Though there is no  functorial splitting, the existence of a splitting does mean that for any additive functor, say $E(-)$, on finitely generated $\mco$-modules, the induced map

\[
E(U) \lra E(\tfree{U})
\]

remains surjective. This remark will be used often, as will be the following ones: Consider  a map of $\mco$-modules

\[
\alpha \colon U\lra V
\]

and  the  map $\tfree \alpha\colon \tfree{U}\to \tfree{V}$. The induced map $\Coker\alpha \to \Coker (\tfree{\alpha})$ is surjective;  in particular, when $\alpha$ is onto, so is $\tfree{\alpha}$.  If $\Ker \alpha$ is torsion, then the induced map $\tfree{\alpha}$ is injective.

Throughout this manuscript  $A$ is a noetherian local ring and $\lambda_A\colon A\to \mco$ a surjective local homomorphism. We set

\[
\fp_A\colonequals \Ker(\lambda_A)\qquad \text{and}\qquad c \colonequals \height \fp_A\,.
\]

Thus $\fp_A$ is a prime ideal in $A$ and $c$ is its height, also known as the codimension, whence the choice of notation. It is also the Krull dimension of the local ring $A_{\fp_A}$. Our focus will be on rings for which  $c$ is the rank of the cotangent module of $\lambda_A$; see Lemma <ref>. One has that

\[
\dim A \ge \height \fp_A + \dim(A/\fp_A) = c+1\,;
\]

we place no restrictions on $\dim A$.

§.§ Torsion-free quotients of Ext

We write $\dcat A$ for the derived category of all $A$-modules; the suspension (also known as shift) functor is denoted $[-]$. As usual, a module is viewed as complex concentrated in degree $0$.   Although the focus of our work is on finitely generated modules, some of the basic definitions extend, and it is helpful in some arguments to do so, to complexes with finite homology. We write $\rmod A$ for the category of finitely generated $A$-modules.  Let $\dbcat A$ denote the full subcategory of $\dcat A$ consisting of $A$-complexes $M$ with $\HH iM$ finitely generated for each $i$ and equal to zero for $|i|\gg 0$. For each such  $M$ the $\mco$-modules $\Tor^A_i(\mco,M)$ and $\Ext^i_A(\mco,M)$ are finitely generated  for each integer $i$, and equal to $0$ for $i\ll 0$.
For $M$ in $\dbcat A$ consider the $\mco$-module

\[
\ecoh^i_A(M) \colonequals \tfree{\Ext^i_A(\mco,M)}\,,
\]

namely, the torsion-free quotient of $\Ext^i_A(\mco, M)$. Evidently $\ecoh^n_A(-)$ is a functor from $\dbcat A$, the derived category of $A$-modules, to $\mco$-modules.

§.§ Congruence modules

Let $M$ be a finitely generated $A$-module. The map

\[
\lambda_A(M)\colon M \lra \mco \otimes_A M = M/\fp_AM
\]

induces a map of $\mco$-modules

\[
\ecoh^c_A(\lambda_A(M)) \colon   \ecoh^c_A(M) \lra \ecoh^c_A(M/\fp_AM)\,;
\]

recall $c=\height\fp_A$.  The cokernel of this map is the congruence module of $M$:

\[
\cmod A(M) \colonequals \Coker \ecoh^c_A(\lambda_A(M))\,.
\]

We write $\cmod A$, instead of $\cmod A(A)$, for the congruence module of $A$. See the discussion around Proposition <ref> and  <ref> for connections to other notions of congruence modules  in the literature. It is easy to check that the assignment $M\mapsto \cmod A(M)$ is a functor from $\rmod A$ to $\rmod \mco$; see <ref>.

Here is a simple but useful observation.

For any finitely generated $\mco$-module $U$, viewed as an $A$-module via $\lambda_A$, the surjection $U\to \tfree U$ is split with torsion kernel as an $\mco$-map, and hence also as an $A$-map—see <ref>—and so it induces the first isomorphism below:

\[
\ecoh^c_A(U)\xra{\ \cong\ }\ecoh^c_A(\tfree U) \cong \ecoh^c_A(\mco)\otimes_\mco \tfree U\,.
\]

The second one holds because the $\mco$-module $\tfree U$ is finite free. In particular, for any finitely generated $A$-module $M$, there is a natural isomorphism:

\begin{equation}
\label{eq:ecoh-MO}
\ecoh^c_A(M/\fp_AM)\cong \ecoh^c_A(\mco)\otimes_\mco \tfree {(M/\fp_AM)}
\end{equation}

§.§ Regularity

Given a prime ideal $\fp$ in  $A$, we say $A$ is regular at $\fp$ to mean that the local ring $A_\fp$ is regular.  The result below is the starting point of our work.

In the context of <ref>,  the ring $A$ is regular at $\fp_A$ if and only if the $\mco$-module $\cmod A$ is torsion. When this holds, so do the following statements:

* The $\mco$-modules $\ecoh^c(A)$ and $\ecoh^c(\mco)$ are of rank one;

* The map $\ecoh^c(\lambda_A) \colon \ecoh^c(A) \to \ecoh^c(\mco)$ is injective;

* The $\mco$-module $\cmod A$ is torsion and cyclic;

Write $\fp$ instead of $\fp_A$ and let $k(\fp)$ be the field of fractions of $\mco$; it is also the residue field of the local ring $A_\fp$. For any integer $i$ there is an isomorphism

\[
\Ext_A^i(\mco,\mco)_\fp\cong \Ext_{A_\fp}^i(k(\fp),k(\fp))
\]

of $k(\fp)$-vector spaces. It is well-known that the vector space on the right is nonzero for each $0\le i\le c$, hence the $\mco$-module $\Ext_A^i(\mco,\mco)$ has nonzero rank for the same range of $i$; see, for instance, <cit.>. This observation will be used in what follows.

It helps to introduce one more property equivalent to the regularity of $A$ at $\fp$, and prove that the following conditions are equivalent:

* $A$ is regular at $\fp$;

* The rank of map $\Ext^c_A(\mco,\lambda_A)$ is nonzero;

* $\cmod A$ is torsion as an $\mco$-module.

(i)$\Leftrightarrow$(ii): Condition (ii) holds if and only if the localization of the map $\Ext^c_A(\mco,\lambda_A)$ at $\fp$ is nonzero; namely the map

\[
\Ext^c_{A_{\fp}}(k(\fp),A_{\fp}) \lra \Ext^c_{A_{\fp}}(k(\fp),k(\fp))
\]

induced by the surjection $A_\fp\to k(\fp)$  is nonzero. It remains to recall Lescot's result <cit.> that the map above is nonzero if and only if the local ring $A_\fp$ is regular; see also <cit.>.

(i)$\Rightarrow$(iii): Since $A_\fp$ is regular of Krull dimension $c$ one has

\begin{align*}
&\Ext^c_{A}(\mco,A)_\fp \cong \Ext^c_{A_{\fp}}(k(\fp),A_{\fp}) \cong k(\fp)  \\
&\Ext^c_{A}(\mco,\mco)_\fp \cong \Ext^c_{A_{\fp}}(k(\fp),k(\fp)) \cong k(\fp)\,.
\end{align*}

Thus the source and target of the map $\Ext^c_A(\mco,\lambda_A)$ have rank one, and the rank of the map is nonzero, since we already know that (i)$\Rightarrow$(ii). It follows that its cokernel is torsion, justifying (iii).

(iii)$\Rightarrow$(ii):  The rank of the $\mco$-module $\Ext^c_A(\mco,\mco)$ is nonzero, and $\cmod A$ is the cokernel of  $\ecoh^c_A(\lambda_A)$, so (ii) follows.

This completes the proof of the equivalences of conditions (i), (ii), and (iii). As to remaining claims, (1) and (2) were implicitly verified in that proof that (i)$\Rightarrow$(iii), whilst (3) is a consequence of (1).

Let $\lambda_A\colon A\to \mco$ be as in <ref> with $A$ is regular at $\fp_A$, and $M$ a finitely generated $A$-module. Then for each integer $n\ge \height\fp_A+1$ one has $\ecoh^n_A(M)=0$, and  the $\mco$-module $\cmod A(M)$ is torsion.

As before we write $\fp$ instead of $\fp_A$ and $k(\fp)$ for the fraction field of $\mco$. For each $i$ there is an isomorphism of $k(\fp)$-vector spaces

\[
\Ext^i_{A}(\mco,M)_{\fp} \cong \Ext^i_{A_\fp}(k(\fp),M_\fp)\,.
\]

As $A_\fp$ is regular of dimension $c\colonequals \height \fp$,  for $i\ge c+1$ one has   $\Ext^i_{A_\fp}(k(\fp),M_\fp)=0$. Thus  the $\mco$-module $\Ext^i_A(\mco,M)$ is torsion, and hence $\ecoh^i_A(M)=0$ for $i \geq c+1$.

It remains to verify that $\cmod A(M)$ is torsion; equivalently, with $\pi\colon M\to M/\fp M$ the natural surjection, the cokernel of $\Ext^c_A(\mco, \pi)$ is torsion; equivalently that

\[
\Ext^c_{A_\fp}(k(\fp), \pi_\fp)\colon  \Ext^c_{A_\fp}(k(\fp),M_\fp) \lra \Ext^c_{A_\fp}(k(\fp),  M_\fp/\fp M_\fp)
\]

is onto. Replacing $A_\fp$ by $R$ and $M_\fp$ by $N$, we find ourselves in the situation where $R$ is a regular local ring, with residue field $k(\fp)$ and Krull dimension $c$, and $N$ is an $R$-module. The desired result is that the map $\Ext^c_R(k(\fp),\lambda)$ is onto, where $\lambda\colon N\to N/\fm N$ is the natural map with $\fm$ the maximal ideal of $R$.

Since $R$ is regular, the $R$-module $k(\fp)$ has a finite free resolution, for any $R$-module $N$ the natural map

\[
\RHom_R(k(\fp), R)\lotimes_R N \lra \RHom_R(k(\fp), N)
\]

is a quasi-isomorphism. Again because $R$ is regular $\RHom_R(k(\fp),R)\simeq k(\fp)[-c]$; this fact yields a natural isomorphism

\[
k(\fp) \otimes_R N \xra{\ \cong\ } \Ext^c_R(k(\fp),N)\,.
\]

We apply this also for the $R$-module $N/\fm N$.  Then the map $N\to N/\fm N$ induces a commutative diagram

\[
\begin{tikzcd}
k(\fp)\otimes_R N  \arrow{d}[swap]{\cong}  \arrow{r} &  k(\fp)\otimes_R (N/\fm N)  \arrow{d}{\cong} \\
\Ext^c_R(k(\fp) ,N) \arrow{r} & \Ext^c_R(k(\fp),N/\fm N)
\end{tikzcd}
\]

It remains to note that the map in the top row, and hence in the bottom row, is even an isomorphism.

§.§ Cotangent modules

We are also interested in the cotangent module $\fp_A/\fp_A^2$ of the map $\lambda_A$. This module too detects when $A$ is in the category $\acat$.

For $\lambda_A\colon A\to \mco$ as in <ref> there is an equality

\[
\rank_{\mco}(\fp_A/\fp_A^2) = \edim A_{\fp_A}\,.
\]

Thus $\height \fp_A \le \rank_{\mco}(\fp_A/\fp_A^2)$ and equality holds if and if $A$ is regular at $\fp_A$.

We write $\fp$ instead of $\fp_A$, and let $e\colonequals \rank_{\mco}(\fp_A/\fp_A^2)$.   With $\fm$ the maximal ideal $\fp A_{\fp}$ of the local ring $A_{\fp}$, one has an isomorphism

\[
\fm/\fm^2 = (\fp/\fp^2)_{\fp} \cong k(\fp)^e
\]

of $k(\fp)$-vector spaces,  where $k(\fp)$ is field of fractions of $\mco$, which is also the residue field of $A_{\fp}$. This justifies the first part of the statement. This also yields inequality $\height {\fp} \le e$. Since $\height {\fp}=e$ if and only if $A$  is regular at $\fp$, by definition <cit.>, the second part of the result follows as well.

The preceding result has to do with the torsion-free quotient of the cotangent module of $\lambda_A$. In the sequel, its torsion submodule plays the major role. Set

\begin{equation}
\label{eq:conormal}
\con A\colonequals \tors{(\fp_A/\fp_A^2)}\,.
\end{equation}

When $c=0$ this is all of the cotangent module for the latter is torsion when $A$ is regular at $\fp_A$, by Lemma <ref>.

§.§ Wiles defect

Let $\acat$ be the category of pairs $(A,\lambda_A)$ where $A$ is a complete noetherian local ring and $\lambda_A\colon A\to \mco$ is a surjective local homomorphism with $A$ regular at $\fp_A\colonequals \Ker(\lambda_A)$.  The morphisms in $\acat$ are the obvious ones. We impose the hypothesis that $A$ is complete only for ease of exposition, especially in Section <ref> and beyond. Often we speak of the ring $A$ being in the category, rather than the pair $(A,\lambda_A)$.  Let $\acat(c)$ be the subcategory of $\acat$  of rings $A$ with $\height \fp_A=c$; equivalently $\rank_{\mco}(\fp_A/\fp_A^2)=c$; see Lemma <ref>.

Fix $A$ in $\acat(c)$. The Wiles defect of finitely generated $A$-module $M$ is the integer

\begin{equation}
\label{eq:defect}
\delta_A(M)\colonequals (\rank_{A_{\fp_A}}\! M_{\fp_A}) \length_{\mco}{\con A} - \length_{\mco}{\cmod A(M)}\,.
\end{equation}

For $c=0$ this invariant has been studied in Bockle/Khare/Manning:2021b, Brochard/Iyengar/Khare:2021b; see the result below. For general $c$ but only for $M=A$ and Cohen–Macaulay,  an analogous invariant was introduced in <cit.>; see <ref> and <ref>. We will have a lot more to say about this invariant from Section <ref> onwards.

The result below reconciles the definition of congruence modules introduced in this work with the one when  $c=0$ that has been discussed in the literature.

Suppose $A$ is in $\acat(0)$ and set $I_A\colonequals A[\fp_A]$. For any $A$-module $M$ there is a natural surjection of $\mco$-modules

\[
\frac M{M[\fp_A] + M[I_A]}\twoheadrightarrow \cmod A(M)\,.
\]

with kernel a torsion $\mco$-module. This map is an isomorphism if $\depth_AM\ge 1$.

Given the equality

\[
\Hom_A(\mco, M/\fp_A M) = M/\fp_A M
\]

the congruence module of the $M$ is the cokernel of the composition

\[
M[\fp_A] \lra M/\fp_A M \to \tfree{(M/{\fp_A M})}\,.
\]

Consider the exact sequence of $\mco$-modules

\[
0\lra \frac{M[I_A]}{\fp_A M} \lra \frac{M}{\fp_A M} \lra  \frac{M}{M[I_A]} \lra 0
\]

The term on the left is always $\mco$-torsion for it is annihilated by $\fp_A$ and $I_A$, and so a module over the ring $\cmod A$.  Thus there are natural surjections

\[
M/\fp_A M \twoheadrightarrow M/M[I_A] \twoheadrightarrow \tfree{(M/{\fp_A M})}
\]

and the map on the right is bijective when $\depth_AM\ge 1$, for then the  term in the middle is torsion-free. This gives the desired result. Along the way we get that when $\depth_AM\ge 1$, one has

\[
M/M[I_A]  = \tfree{\left(M/\fp_A M\right)}
\]

so one can recover the module on the left without recourse to $I_A$.

Here is an example that shows that the map in the preceding proposition is not always an isomorphism.

Let $A\colonequals \mco\pos{t}/(\varpi^2 t)$ and $M\colonequals A/(\varpi^3)$. Then $M$ is $\mco$-torsion so $\cmod A(M)=0$, whereas, in the notation of Proposition <ref> one has $I_A=(\varpi^2)$, so

\[
M[\fp_A] = (\varpi^2)M \quad\text{and}\quad M[I_A]= (t)M\,,
\]

and hence $M/(M[\fp_A]+M[I_A]) = \mco/(\varpi^2)$.

§ DEPTH CONDITIONS

Two invariants of a finitely generated $A$-module $M$ play a key role in what follows: its depth as an $A$-module, denoted $\depth_AM$, and the length of the longest $M$-regular sequence in $\fp_A$, denoted $\grade(\fp_A,M)$. Their value is closely connected to the property that $M$ is free at $\fp_A$. These interdependencies are clarified in the next two results; see also <ref>.

Let $A$ be in $\acat(c)$ and $M\in \rmod A$.

* If $M_{\fp_A}\ne 0$, then $\grade(\fp_A,M)\le c$ and $\depth_AM\le c+1$.

* If $\grade(\fp_A,M)\le c$ and $\depth_AM\ge c+1$, then in fact $\grade(\fp_A,M)=c$ and $\depth_AM= c+1$.

* If $\grade(\fp_A,M)\ge c$, then $M$ is free at $\fp_A$.

In particular, $\depth A \le c + 1 \le \dim A$.

(1) When $M_{\fp_A}$ is nonzero, its depth as an $A_\fp$-module is at most $\dim A_\fp$; this justifies the second inequality below:

\[
\grade(\fp_A,M) \le \depth_{A_{\fp_A}}M_{\fp_A} \le c\,.
\]

The first one is clear. This justifies the first inequality in (1). The second one follows, because for any $A$-module $M$ there in an inequality

\[
\depth_AM \le \grade(\fp_A,M) + 1\,.
\]

This holds by  <cit.>, since $\dim (A/\fp_A)=\dim\mco=1$.

(2) The hypotheses gives inequalities

\[
c+1\le \depth_AM \le \grade(\fp_A,M) + 1 \le c+1\,.
\]

Thus one has equalities everywhere.

(3) The hypothesis implies that the depth of $M_{\fp_A}$ as a module over $A_{\fp_A}$  is at least $c$. Since  $A_{\fp_A}$ is a regular local ring of dimension $c$, the equality of Auslander and Buchsbaum <cit.> implies that $M$ is free at $\fp_A$.

Finally, the inequality $\depth A\le c+1$ follows from (1), as  $A_{\fp_A}\ne 0$, whereas the upper bound on $\dim A$ is the special case $\fp\colonequals \fp_A$ of the inequality

\[
\dim (A/\fp) + \height\fp \le \dim A
\]

that holds for any prime ideal $\fp$ in $A$.

In what follows the focus will be on the modules whose depth is at least $c+1$.
One reason for this is the following result.

Let $A$ be in $\acat(c)$ and $M\in\rmod A$ with $\depth_AM\ge c+1$.

* If $M$ is supported at $\fp_A$, then $\grade(\fp_A,M)=c$ and $\depth_AM=c+1$.

* If $M$ is not supported at $\fp_A$, then $\grade(\fp_A,M)=\depth_AM$.

* $M$ is free at $\fp_A$.

* $\Ext^c_A(\mco, M)$ is torsion-free as an $\mco$-module.

Part (1) is immediate from parts (1) and (2) of Lemma <ref>.

(2) Since the only prime ideals containing $\fp_A$ are itself and the maximal ideal of $A$, by <cit.> there is an equality

\[
\grade(\fp_A,M) = \min\{\depth_{A_\fp}M_\fp,\depth_AM\}\,.
\]

Thus if $M$ is not supported at $\fp_A$, then the equality above gives

\[
\grade(\fp_A,M)=\depth_AM\,,
\]

since the depth of $0$ is infinity.

(3) Since $\grade(\fp_A,M)\ge c$, by (1) and (2), one can invoke Lemma <ref>(3).

(4) Let $k$ denote the residue field of $\mco$, and consider the exact sequence

\[
0\lra \mco \xra{\ \varpi\ } \mco \lra k\lra 0\,.
\]

It induces the exact sequence of $\mco$-modules

\[
\cdots \lra \Ext^{c}_A(k,M) \lra \Ext^c_A(\mco,M) \xra{\ \varpi\ } \Ext^c_A(\mco,M) \lra \cdots
\]

Since $\depth_AM = c+1$ one has $\Ext^{c}_A(k,M)=0$; see <cit.>. Thus the sequence above implies that $\varpi$ is not a zero-divisor on $\Ext^c_A(\mco,M)$.

Perhaps it is helpful to summarize the results above as follows:

\[
\begin{tikzcd}
\depth_AM\ge c+1 \arrow[Rightarrow]{r} & \grade(\fp_A,M)\ge c \arrow[Rightarrow]{d} \arrow[Rightarrow]{r} &  \depth_AM \ge c \\
&\text{$M$ is free at $\fp_A$}
\end{tikzcd}
\]

The two conditions on the right are vacuous when $c=0$, but not so the left-most one.  This condition comes up in the criteria for freeness and complete intersection presented in Section <ref>.  The condition on grade comes up in arguments involving reduction to the case $c=0$; see Section <ref>. Only the  weaker lower bound on $\depth_AM$ is required for the invariance of domain property discussed in Section <ref>.

We round up this discussion on depth with the following observation that is needed for reductions to $c=0$. In what follows, given a prime ideal $\fp$ in a ring $A$, we write $\fp^{(2)}$ for the ideal $\fp^2A_\fp\cap A$; this is the second symbolic power of $\fp$.

Fix $A$  in $\acat(c)$ for  $c\ge 1$, and an $f\in \fp_A$ nonzero in $A_{\fp_A}$. The local ring $A/fA$ is in $\acat$ if and only if $f\not\in\fp_A^{(2)}$; in that case $A/fA$ is in $\acat(c-1)$.

Set $B\colonequals A/fA$; since $f$ is in $\fp_A$ the map $\lambda_A\colon A\to \mco$ factors through $B$, yielding an augmentation $\lambda_B\colon B\to \mco$. Its kernel, $\fp_B$, equals $\fp_A/f$. Since the local ring $A_{\fp_A}$ is regular the quotient ring $B_{\fp_B}\cong A_{\fp_A}/f A_{\fp_A}$ is regular if and only if the image of $f$  is not in $\fp_A^2A_{\fp_A}$, that is to say, $f$ is not in $\fp^{(2)}$;  see <cit.>.  When this property holds $\dim B_{\fp_B} = \dim A_{\fp_A} - 1$, so $B$ is in $\acat(c-1)$.

Let $A$ be a local ring in $\acat(c)$ and $M$ a finitely generated $A$-module with $\grade(\fp_A,M)\ge c$. Given any integer $1\le n\le c$, there exists a sequence $\bs g\colonequals g_1,\dots,g_n$ in $\fp_A$ such that:

* The ring $A/{\bs g}A$ is in $\acat (c-n)$;

* The sequence $\bs g$ is $M$-regular and $\depth_{A/{\bs g}A}(M/{\bs g}M)=\depth_AM-n$.

When $A$ is Cohen–Macaulay, $\bs g$ can be chosen to be regular on $A$ as well.

It suffices to verify the statement for $n=1$. Given Lemma <ref>, one has to find an element $g$ in $\fp_A$ that avoids the associated primes of $M$ and also $\fp_A^{(2)}$. This can be done by a standard prime avoidance argument; see <cit.>.

We illustrate the use of these conditions by establishing a link between the Wiles defect of a module to that of the underlying ring, and by tracking the change in the congruence modules under certain maps of $A$-modules.

§.§ A defect formula

The natural morphism of complexes

\[
\RHom_A(\mco, A) \lotimes_A M \lra \RHom_A(\mco, M)
\]

and the Künneth map induce the map of $\mco$-modules

\[
\Ext^c_A(\mco,A)\otimes_A M \lra \Ext^c_A(\mco, M)\,,
\]

and hence the map

\[
\eta_M\colon \ecoh^c_A(A)\otimes_{\mco}\tfree{(M/\fp_AM)} \lra \ecoh^c_A(M)\,.
\]

These maps fit into a commutative diagram of $\mco$-modules

\begin{equation}
\label{eq:ecoh-cd}
\begin{tikzcd}[column sep=huge]
\ecoh^c_A(A)\otimes_{\mco}\tfree{(M/\fp_AM)} \arrow{d}[swap]{\eta_M} \arrow{r}{\ecoh^c(\lambda_A)\otimes \textrm{id}}
& \ecoh^c_A(\mco)\otimes_{\mco}\tfree {(M/\fp_AM)}   \arrow[leftarrow]{d}{\cong}\\
\ecoh^{c}_A(M)   \arrow{r}{\ecoh^c{(\lambda_A(M))}}
& \ecoh^{c}_A(M/\fp_AM)
\end{tikzcd}
\end{equation}

The isomorphism on the right is from (<ref>). In fact, one has such a diagram for each  cohomological index $i$. This leads to the following “defect formula" for congruence modules. It generalizes <cit.>, which is the case $c=0$, for then $\Coker(\tau_M)=M[\fp_A]/I_AM$, where $I_A=A[\fp_A]$.

When  $M$ is  free at $\fp_A$, the map $\ecoh^c{(\lambda_A(M))}$ is injective,  and there is an exact sequence of $\mco$-modules

\[
0\lra \Coker(\eta_M) \lra \cmod A\otimes_\mco{\tfree{(M/\fp_AM)}} \lra \cmod A(M)\lra 0
\]

and hence there is an equality

\[
\delta_A(M) = \rank_{A_{\fp_A}}(M_{\fp_A}) \cdot \delta_A(A) + \length_{\mco}\Coker(\eta_M)\,.
\]

Recall that the map $\ecoh^c_A(\lambda_A)\colon \ecoh^c_A(A)\to \ecoh^c_A(\mco)$ is injective.  Since $M$ is free at $\fp_A$,  the map $\ecoh^c_A(\lambda_A(M))$ is injective when localized at $\fp_A$, and hence injective. Given this observation the stated exact sequence is immediate from (<ref>).  Since the $A_\fp$-module $M_{\fp_A}$ is free, its rank is the rank of the $\mco$-module $\tfree{{(M/\fp_AM)}}$. This remark, and the given exact sequence,  yield the desired equality.

Let $A$ be in $\acat(c)$ and $\pi\colon M\to N$ a map of finitely generated $A$-modules. This data induces the commutative diagram

\begin{equation}
\label{eq:change-diagram}
\begin{tikzcd}[column sep=huge]
\ecoh^c_A(M) \arrow{d} \arrow{r}{\ecoh^c_A(\pi)}
& \ecoh^{c}_A(N) \arrow{d} \\
\ecoh^c_A(M/\fp_A M)  \arrow{r}{\ecoh^c_{A}(\overline{\pi})}
& \ecoh^{c}_A(N/\fp_AN)
\end{tikzcd}
\end{equation}

where $\overline{\pi}\colonequals \pi\otimes_A\mco$. This induces a map  $\cmod A(M) \to \cmod A(N)$ of $\mco$-modules. Thus $\cmod A(-)$ is a functor from the category of finitely generated $A$-modules to $\mco$-modules.

Let $A$ be in $\acat(c)$ and $\pi\colon M\to N$ a  map in $\rmod A$ such that $M$ and $N$ are free at $\fp_A$ and of the same rank.

* The free-$\mco$-modules $\ecoh^c_A(M)$ and $\ecoh^c_A(N)$ have the same rank.

* When $\pi$ is surjective, $\ecoh^c_A(\pi)$ is injective and $\ecoh^c_A(\overline{\pi})$ is bijective, and hence

\[
\length_{\mco}\cmod A(M) = \length_{\mco}\cmod A(N)  +  \length_{\mco}\Coker \ecoh^c_A(\pi)\,.
\]

* When $\pi$ is injective with cokernel of depth $c+1$, the map $\ecoh^c_A(\pi)$ is bijective.

(1) This follows from the fact that the rank of an $\mco$-module can be computed after localization at $\fp_A$, and the isomorphisms

\[
\ecoh^c_A(M)_{\fp_A} \cong \Ext^c_A(\mco,M)_{\fp_A} \cong \Ext^c_{A_{\fp_A}}(k(\fp),M_{\fp_A})
\]

where $k(\fp)$ is the residue field of $\mco$.

The following observation will be used below: Since $M$ and $N$ are free of the same rank at $\fp_A$, when $\pi$ is  surjective,  it is an isomorphism at $\fp_A$. The same conclusion holds when $\pi$ injective and $\depth_A\Coker(\pi)\ge c+1$.   In particular, $\Ext^c_A(\mco,\pi)$ is bijective when localized at $\fp_A$ and hence $\ecoh^c_A(\pi)$ is injective.

(2) Since $\pi$ is surjective, so is $\overline{\pi}$, and hence also the induced map

\[
\tfree{(\overline{\pi})}\colon \tfree{(M/\fp_AM)} \xra{\ \cong\ } \tfree{(N/\fp_AN)}\,.
\]

That the map is also injective can be verified by localizing at $\fp_A$, and using the fact $\pi$ is an isomorphism at $\fp_A$. Thus the natural isomorphism <ref> implies that $\ecoh^c_A(\overline{\pi})$ is bijective as claimed. Given that $\ecoh^c_A(\pi)$ is one-to-one and $\ecoh^c_A(\overline{\pi})$ is bijective, the stated formula for the lengths of congruence modules is immediate from the commutative diagram (<ref>). Here we also use the fact that the vertical maps in the diagram are one-to-one, since $M$ and $N$ are free at $\fp_A$; see Lemma <ref>.

(3) We already know that $\ecoh^c_A(\pi)$ is injective, so it remains to verify that it is also surjective.  Complete $\pi$ to an exact sequence

\[
0 \lra M\lra N\lra C\lra  0\,.
\]

Since $M,N$ are free at $\fp_A$ and of the same rank, $C_{\fp_A}=0$, and so the hypothesis that $\depth_AC = c+1$ and Lemma <ref> yield $\grade(\fp_A,C)=c+1$. Thus $\Ext^c_A(\mco,C)=0$, by <cit.>, and  so the exact sequence above induces the exact sequence

\[
\lra \Ext^c_A(\mco,M) \xra{\ \Ext^c_A(\mco,\pi)\ } \Ext^c_A(\mco,N) \lra \Ext^c_A(\mco,C) =0\,.
\]

Therefore the induced map on torsion-free quotients,   $\ecoh^c_A(\pi)$,  is also surjective.

§ COHEN–MACAULAY MODULES

In this section we record results on congruence modules special to Cohen–Macaulay modules, intended for later use. There is also an alternative description of congruence modules which brings up a connection to duality.

§.§ Dualizing complexes

Since each $A$ in $\acat$ is a quotient of a regular ring, namely, a power series ring over $\mco$, it has a dualizing complex, $\ddual A$, unique,up to isomorphism in $\dcat A$, once it is normalized so that $\Ext^i_A(k,\ddual A)\ne 0$ precisely when $i=0$; see <cit.>. Given any $A$-complex $M$ in $\dcat A$, set

\begin{equation}
\label{eq:dagger}
\ddual A(M)\colonequals \RHom_A(M,\ddual A)\,.
\end{equation}

The dualizing complex captures the depth and the dimension of any nonzero finitely generated $A$-module $M$, in that

\begin{equation}
\label{eq:depth-dim}
\begin{aligned}
\depth_AM &= \min\{i\mid \hh_i(\ddual A(M))\ne 0\} \\
\dim M &=  \max\{i\mid \hh_i(\ddual A(M))\ne 0\}\,.
\end{aligned}
\end{equation}

This follows from Grothendieck's  local duality theorem and the fact that depth and dimension are detected by the local cohomology of $M$; see <cit.> and also <cit.>. The assignment $M\mapsto \ddual A(M)$ induces an auto-equivalence

\[
\ddual A(-) \colon {\dbcat A}^{\mathrm{op}} \xra{\ \equiv\ } \dbcat A\,.
\]

Hence the  biduality map $M\iso {\ddual A^2}(M)$ is an isomorphism for $M$ in $\dbcat A$.

§.§ Cohen–Macaulay modules

Fix $A$ in $\acat(c)$.  An $A$-module $M$ is  said to be Cohen–Macaulay if it is finitely generated and satisfies $\depth_AM\ge \dim M$; equality holds when $M\ne 0$.  Thus if $M$ is a Cohen–Macaulay $A$-module $\hh_{i}(\ddual A(M))=0$ for all $i\ne \dim_AM$. When $M$ is a non-zero Cohen-Macaulay module, the $A$-module

\begin{equation}
\label{eq:dual-cm}
M^{\vee}\colonequals \hh_{d}(\ddual A(M)) \quad\text{for $d=\dim_AM$}
\end{equation}

is also Cohen–Macaulay of dimension $d$; this is easy to verify, given $M\iso {\ddual A^2}(M)$. We speak of this as the dual of $M$.

\[
\ddual A(M) \simeq  M^{\vee} [d] \qquad \text{in $\dcat A$.}
\]

the assignment $M\mapsto M^{\vee}$ is an auto-equivalence on the category of Cohen–Macaulay $A$-modules. In what follows, we say a Cohen–Macaulay module $M$ is self-dual to mean that there is an isomorphism of $A$-modules

\[
M\cong M^{\vee}\,.
\]

The result below concerns Cohen–Macaulay modules $M$ supported at $\fp_A$ and having maximal possible depth; namely, $\dim M = c+1 = \depth M$; see Lemma <ref>. Let $\nu_{\mco}$ be the valuation associated to $\mco$.  The determinant of an endomorphism $\alpha\colon U\to U$ of free $\mco$-modules of finite rank is denoted $\det\alpha$.

Let $A$ be a local ring in $\acat(c)$ and $M,N$ Cohen–Macaulay $A$-modules of dimension $c+1$, that are self-dual, and have the same rank at $\fp_A$. If $\pi\colon M\to N$ is a surjective map,  then

\[
\length_{\mco}\cmod A(M) = \length_{\mco}\cmod A(N)+ \nu_{\mco}(\det\alpha)\,,
\]

where $\alpha \colon\ecoh^c_A(M)\to \ecoh^c_A(M)$ is the composition of maps

\[
\ecoh^c_A(M)\xra{\ \ecoh^c_A(\pi)\ } \ecoh^c_A(N) \cong \ecoh^c_A(N^{\vee}) \xra {\ \ecoh^c_A({\pi}^\vee)\ }
\ecoh^c_A(M^\vee)\cong \ecoh^c_A(M)\,.
\]

Since $M$ and $N$ have depth $c+1$, they are free at $\fp_A$, by Lemma <ref>. We can assume their ranks are nonzero, else  each term in the desired equality is zero, and also that $\pi$ is not an isomorphism.  Consider the exact sequence

\[
0 \lra L\lra M\lra N\lra  0
\]

induced by $\pi$. There are (in)equalities

\[
c+1\le \depth_A L \le \dim L \le \dim M = c+1\,,
\]

where the first and last inequality on the left can be verified easily using (<ref>). Thus $L$ too is Cohen–Macaulay of dimension $c+1$. Thus the exact sequence above induces an exact sequence

\[
0\lra N^{\vee} \xra{\ \pi^{\vee}\ } M^{\vee}  \lra L^{\vee} \lra 0\,.
\]

Since  $L^{\vee}$ is also Cohen–Macaulay of dimension $c+1$,  Lemma <ref>(3) yields that $\ecoh^c_A(\pi^{\vee})$ is bijective. Given this, the desired equality is immediate from the definition of $\alpha$ and Lemma <ref>(2).

Let $A$ be in $\acat(c)$ and $M$ a Cohen–Macaulay $A$-module of dimension $c+1$. Then $M^{\vee}$ is also Cohen–Macaulay of dimension $c+1$ and there is a pairing

\[
M \lotimes_A M^{\vee} \simeq M\lotimes_A \ddual A(M)[-c-1] \lra \ddual A[-c-1]\,.
\]

Up to a shift, this is the adjoint of the natural biduality map

\[
M\to \RHom_A(\RHom_A(M,\ddual A),\ddual A)\,;
\]

see, for instance,  <cit.>. This yields a natural pairing

\begin{equation}
\label{eq:pairing}
\langle -,-\rangle \colon \Ext^c_A(\mco,M)\otimes_{\mco} \Ext^c_A(\mco, M^{\vee}) \lra \ecoh^c_A(\mco) \cong \mco\,.
\end{equation}

of $\mco$-modules defined as follows: Given morphisms

\[
\alpha\colon \mco \to  M[c]\quad\text{and}\quad  \beta\colon \mco \to M^{\vee}[c]
\]

in $\dcat A$ consider the morphism

\[
\alpha\otimes \beta \colon \mco \lotimes_A \mco \lra  M[c] \lotimes_A  M^\vee[c] \simeq  (M \lotimes_A M^\vee)[2c] \lra  \ddual A[c-1]
\]

This induces by adjunction a morphism

\[
\gamma\colon \mco\lra \RHom_A(\mco,\ddual A[c-1])\simeq  \mco[c]\,,
\]

where the isomorphism holds as the ring $\mco$ is Gorenstein and $\dim\mco=1$.  Thus $\gamma$ represents an element in $\Ext^c_A(\mco,\mco)$. Set

\[
\langle \alpha,\beta\rangle\colonequals \text{the class of the morphism $\gamma$ in $\ecoh^c_A(\mco)$.}
\]

For the Cohen–Macaulay modules of dimension $c+1$, the pairing above gives another interpretation of the congruence module.

Let $M$ be a Cohen–Macaulay $A$-module of dimension $c+1$. The congruence module $\cmod A(M)$ is the cokernel of the map

\[
\Ext^c_A(\mco,M) \lra \Hom_{\mco}(\Ext^c_A(\mco,M^\vee), \ecoh^c_A(\mco))\,.
\]

adjoint to the pairing (<ref>).

One has natural isomorphisms

\begin{align*}
\Ext^c_A(\mco,M^{\vee})
&\cong \Hom_{\dcat A}(\mco, M^\vee[c]) \\
&\cong \Hom_{\dcat A}(\mco, \ddual A(M)[-1]) \\
& \cong \Hom_{\dcat A}( M[1], \ddual A(\mco)) \\
&\cong \Hom_{\dcat A}( M[1], \mco[1]) \\
&\cong \Hom_A(M,\mco) \\
&\cong \Hom_{\mco}(M/\fp_AM, \mco) \\
&\cong \Hom_{\mco}(\tfree{(M/\fp_AM)},\mco)
\end{align*}

In this chain, the third isomorphism is a composition of two adjunctions. The fourth uses the fact that $\ddual A(\mco)$ is the dualizing complex of $\mco$, and hence equal to $\mco[1]$ since the ring $\mco$ is Gorenstein; see <cit.>. The rest of the isomorphisms are standard. This yields isomorphisms

\begin{align*}
\Hom_{\mco}(\Ext^c_A(\mco,M^\vee),\ecoh^c_A(\mco))
&\cong \Hom_{\mco}(\Hom_{\mco}(\tfree{(M/\fp_AM)},\mco),\ecoh^c_A(\mco)) \\
& \cong \ecoh^c_A(\mco) \otimes_\mco \tfree{(M/\fp_AM)}\,.
\end{align*}

With this on hand, and a diagram chase, one gets that the adjoint map in question is naturally isomorphic to the map

\[
\Ext^c_A(\mco,M) \lra  \ecoh^c_A(\mco) \otimes_\mco \tfree{(M/\fp_AM)}\,,
\]

induced by $M\to M/\fp_AM$. This justifies the claim; see (<ref>).

Let $M$ be a Cohen–Macaulay $A$-module of dimension $c+1$. Suppose there is map $R\to A$ such that $R$ is Gorenstein with $\dim R=c+1$, and $M$ is finitely generated over $R$. Thus $M$ is maximal Cohen–Macaulay as an $R$-module and hence $M^\vee \cong \Hom_R(M,R)$. The pairing (<ref>) is induced by the natural pairing

\[
M\otimes_R \Hom_R(M,R) \lra R
\]

The paring (<ref>) becomes even more concrete when $c=0$, in which case one can take $R=\mco$, and then the pairing is the composite

\[
M[\fp_A] \otimes_\mco \Hom_{\mco}(M,\mco)[\fp_A] \subseteq M\otimes_{\mco} \Hom_{\mco}(M,\mco) \lra \mco\,.
\]

This observation reconciles the definition of congruence modules introduced in this work with that in <cit.>.

§ COMPLETE INTERSECTIONS

From now on we focus on  rings $A$ of the form $P/I$ where  $P\colonequals \mco\pos{t_1,\dots,t_n}$, a ring of formal power series over $\mco$, and $I\subseteq (\varpi)(\bs t)+(\bs t)^2$. Set $\lambda_P\colon P\to \mco$ to be the quotient modulo $(\bs t)$, and $\lambda_A\colon A\to \mco$ the induced map.

Let $\bs f \colonequals f_1,\dots,f_m$ be a minimal generating set for $I$. The cotangent module $\fp_A/\fp_A^2$ depends only on $n$ and the linear part of the $f_i$, in the following sense: By our assumption on $I$,  each $f_i$ has an unique expression of the form

\begin{equation}
\label{eq:A-presentation}
f_i \colonequals \sum_{j=1}^n{u_{ij}}t_j + g_i \qquad\text{with  $u_{ij}\in (\varpi)\mco $ and $g_i\in (\bs t)^2$.}
\end{equation}

Then one has a presentation

\[
\mco^m \xra{\ (u_{ij}) \ } \mco^n \lra \fp_A/\fp_A^2\lra 0\,.
\]

The following observations will be useful in the sequel.

Fix $A$ as in <ref>. Then $A$ is in $\acat(c)$ if and only if $\rank (u_{ij})= n-c$. When this holds $\dim A\ge c+1$ and  $\height I\le n-c$; the latter inequality is an equality if and only if $\dim A=c+1$.

The first part of the statement is immediate from Lemma <ref>, and the lower bound on $\dim A$ has been commented on in <ref>.  As the ring $P$ is regular ring, <cit.> gives the first equality below:

\[
\height I = \dim P - \dim A \le  n+1 - (c+1) = n-c
\]

and the rest of the statement follows.

It also follows from the preceding discussion that when $A$ is in $\acat(c)$ one can put it in the form $P/(\bs f)$, where the relations $\bs f\colonequals f_1,\dots,f_m$ satisfy

\begin{equation}
\label{eq:nice-form}
f_i = \varpi^{d_i}t_i + g_i \qquad\text{with $g_i\in (\bs t)^2$}
\end{equation}

and $d_1\le\cdots\le d_{m}$, where $d_i<\infty$ for $i\le n-c$ and $d_i=\infty$ for $i>n-c$, and then $\varpi^{d_i}=0$. Observe that the $d_i$ are independent of the choice of the presentation for $A$, since one gets an isomorphism

\[
\frac{\fp_A}{\fp_A^2} \cong \mco^{c} \oplus \frac{\mco}{\varpi^{d_1}\mco} \oplus \cdots \oplus \frac{\mco}{\varpi^{d_{n-c}}\mco}
\]

of $\mco$-modules.  In particular the $d_i$ are Fitting invariants of $\mco$-module $\fp_A/\fp_A^2$ Thus

\begin{equation}
\label{eq:con}
\con A \cong \frac{\mco}{\varpi^{d_1}\mco} \oplus \cdots \oplus \frac{\mco}{\varpi^{d_{n-c}}\mco}
\end{equation}

A standard prime-avoidance argument allows us to go further and obtain the result below; see <cit.> for the case $c=0$, and also <cit.>. The hypothesis on $\dim A$ cannot be omitted in the last part of the statement for the complete intersection $C$ satisfies $\dim C=c+1$.

Fix $A$ in $\acat(c)$. In the notation above, let $h\colonequals \height I$. There exists a minimal generating set $\bs f \colonequals f_1,\dots,f_m$ of the ideal $I$ where the $f_i$ have the form in (<ref>) and the sequence $f_1,\dots,f_h$ is regular. In particular, when $\dim A=c+1$, the complete intersection $C\colonequals \mco\pos{\bs t}/(f_1,\dots,f_h)$  is in $\acat(c)$ and the surjective map $C\to A$  induces isomorphisms

\[
\fp_C/\fp_C^2\xra{\ \cong\ } \fp_A/\fp_A^2\quad\text{and}\quad \con C\xra{\ \cong\ } \con A\,.
\]

We start by choosing a minimal generating set $f_1',\dots,f_m'$ for the ideal $I$ where the $f'_i$ are of the form in (<ref>). Since the ring $\mco\pos{\bs t}$ is regular, and hence Cohen–Macaulay, the height of $I$ equals its grade, that is to say, the length of any maximal $\mco\pos{\bs t}$-regular sequence contained in $I$; see <cit.>. We claim that one can find elements $f_1,\dots,f_h$ so that they form a regular sequence and satisfy

\[
f_i\equiv f'_i \mod I^2\,.
\]

It is clear that setting $f_i=f'_i$ for $i=h+1,\dots,m$ gives the desired sequence.  We construct $f_1,\dots,f_h$ by an induction argument.

To start with, set $f_1=f'_1$. Suppose that for some $1\le j<h$ elements $f_1,\dots,f_j$ have been found, with the desired properties.
We can suppose $f'_{j+1}$ is zero-divisor in $\overline{A}\colonequals A/(f_1,\dots,f_j)$; else we can take $f_{j+1}= f'_{j+1}$.  The ideal $I \overline{A}$ contains an element that is not a zerodivisor, because the grade of $I$ is $h$, and $f_1,\dots,f_j$ is a regular sequence in $I$ of length $j<h$. Since the ideal generated by $(f'_{j+1})+ (f'_{j+1},\dots,f'_h)^2$ in $\overline{A}$ agrees with $I \overline{A}$ up to radical, a prime avoidance argument yields an element $f''$ in $(f'_{j+1},\dots,f'_h)^2$ such that $f'_{j+1}+f''$ is a not a zerodivisor in $\overline{A}$; see <cit.>, or <cit.>. Setting $f_{j+1}\colonequals f'_{j+1}+f''$ completes the induction step.

Suppose $\dim A=c+1$, so that $\height I = n-c$, by Lemma <ref>. It is clear by the choice of the sequence $\bs f$  that the ring $C$ is a complete intersection, of dimension $c+1$, that it is  in $\acat(c)$, and that the induced map on cotangent modules has the stated properties.

Consider ring $A\colonequals \mco\pos{s,t}/I$ where $I=(\varpi s, \varpi^2s +st)$. This ring is in $\acat(1)$ and of dimension two. We have at least two choices for a complete intersection in $\acat(1)$ mapping onto $A$:  $\mco\pos{s,t}/(\varpi s)$ or $\mco\pos{s,t}/(\varpi^2s+st)$. The former is the one we want, so choosing any minimal generator for $I$ would not do.

In the same vein, consider $A\colonequals \mco\pos{s,t}/I$ where $I=(\varpi s, \varpi t, st)$. This ring is in $\acat(0)$ and of dimension one. The ring $\mco\pos{s,t}/(\varpi s, \varpi t)$ is in $\acat(0)$, maps onto $A$, and has the same cotangent space, but it is not a complete intersection. What we want is the ideal $(\varpi s, \varpi t + st)$, which is a complete intersection.

Next we record a criteria for detecting isomorphisms in $\acat$ in terms of cotangent modules. To that end, consider a surjective map $\vf\colon A\to B$  in $\acat(c)$. Since $\vf$ is surjective, so is the vertical map in the middle in the commutative diagram:

\begin{equation}
\label{eq:con-diagram}
\begin{tikzcd}
0 \arrow{r} & \con A \arrow[twoheadrightarrow]{d}[swap]{\con{\vf}} \arrow{r} & \fp_A/\fp_A^2 \arrow[twoheadrightarrow]{d} \arrow{r}
& \tfree {(\fp_A/\fp_A^2)} \arrow{r}\arrow{d}{\cong} & 0 \\
0 \arrow{r} & \con B \arrow{r} & \fp_B/\fp_B^2 \arrow{r}
& \tfree {(\fp_B/\fp_B^2)} \arrow{r} & 0
\end{tikzcd}
\end{equation}

Thus the vertical map on the right is also surjective; the source and target of this map are free $\mco$-modules of the same rank, since $A$ and $B$ are in $\acat(c)$, so we deduce that the map is an isomorphism. The Snake Lemma then implies $\con{\vf}$ is surjective.

Here is a criterion for detecting isomorphisms in $\acat$; it generalizes <cit.> that covers the case $c=0$.  The argument below is essentially the one in op. cit., but couched in terms of $\aqh iBA{\mco}$,  the $i$th André–Quillen homology module of the map $A\to B$.

Let $\vf\colon A\to B$ be a surjective a map in $\acat(c)$ with $B$ a complete intersection. If $\length_{\mco}\con A =\length_{\mco}\con B$, then $\vf$ is an isomorphism, and hence $A$ is also a complete intersection.

The crucial point is that $\aqh 2{\mco}B{\mco}=0$,  since $B$ is a complete intersection in $\acat(c)$. To see this, consider a presentation $P\to B$, as in <ref>. Since the augmentation $P\to \mco$ is generated by a regular sequence $\aqh i{\mco}P{\mco}=0$ for all $i\ne 1$, thus the Jacobi-Zariski sequence associated to $P\to B\to \mco$ yields an injection:

\[
0\lra \aqh 2{\mco}B{\mco} \lra \aqh 1BP{\mco} \,.
\]

Since $B_{\fp_B}$ is regular, the $\mco$-module $\aqh 2{\mco}B{\mco}$ is torsion, as can be seen by localizing at $\fp_B$. On the other hand, the $\mco$-module $\aqh 1BP{\mco}$ is free, as the map $P\to B$ is complete intersection. Thus $\aqh 2{\mco}B{\mco}=0$.

Consider the commutative diagram (<ref>). The hypothesis is that the source and target of $\con{\vf}$ have the same length, hence it is a bijection. Then the diagram implies that  the map $\fp_A/\fp_A^2\to \fp_B/\fp_B^2$ is also a bijection.

Set $J\colonequals \Ker(\vf)$. The Jacobi-Zariski sequence associated to $A\to B\to \mco$ reads

\[
0\lra (J/J^2)\otimes_B \mco \lra \fp_A/\fp_A^2 \lra \fp_B/\fp_B^2 \lra 0\,.
\]

The map on the left is one-to-one because  $\aqh 2{\mco}B{\mco}=0$. The map between the cotangent modules is bijective, so we conclude that $(J/J^2)\otimes_B \mco =0$. Hence  $J=0$, by Nakayama's Lemma.

§ TATE CONSTRUCTIONS

Let $A$ be in $\acat(c)$, with presentation as in <ref>. When convenient we can assume that the relations $\bs f$ defining have $A$ the form given in Theorem <ref>. In this section we completely describe the structure of  the torsion-free quotient, $\ecoh^*_A(\mco)$, of the $\mco$-algebra $\Ext_A^*(\mco,\mco)$, which is the target of the map that computes the congruence module of $A$. The key tool used in the proofs are constructions of free resolutions introduced by Tate <cit.>, and developed further in, for instance, Avramov's book <cit.>. We take the latter as our basic reference.

Let $A\la X\ra$ be the exterior algebra over $A$ on indeterminates $X\colonequals \{x_1,\dots,x_n\}$, with $|x_i|=1$ for each $i$.  We make this into a DG (=differential graded) algebra with differential determined by $d(x_i)=t_i$ for $1\le i\le n$. Thus $A\la X\ra$ is the Koszul complex on elements $\bs t$.

Since the $g_i$, from <ref>, are in $(\bs t)^2$ one can write $g_i = \sum_{j} g'_{ij}t_j$ with $g'_{ij}$ in $(\bs t)$.
Evidently, the elements

\[
z_i \colonequals  \sum_{j=1}^n u_{ij}x_i + \sum_{j=1}^n g'_{ij}x_j \qquad\text{for $1\le i\le m$,}
\]

are cycles in $A\la X\ra$ of degree one. Since $\bs f$ is a minimal generating set for the ideal $I$,  the homology classes $z_1,\dots,z_m$  are a minimal generating set for the $\mco$-module $\HH 1{A\la X\ra}$. Following Tate <cit.>, we adjoin divided powers variables $Y\colonequals \{y_1,\dots,y_m\}$, in degree two, to kill these homology classes:

\[
A\la X,Y\ra \colonequals A\la X,Y \mid d(y_i)=  z_i \text{ for $1\le i\le m$}\ra\,.
\]

This is sometimes called the Tate construction of $\mco$ over $A$;  up to an isomorphism of DG algebras with divided powers, it is independent of the choice of a minimal generating set for the ideal $\fp_A$, and the $\mco$-module $\HH 1{A\la X\ra}$.  The surjection $\lambda_A\colon A\to \mco$ extends to a map  $A\la X,Y\ra\to \mco$ of DG algebras over $A$, where $X,Y$ map to $0$, for degree reasons.  By construction $\HH 1{A\la X,Y\ra}=0$. Unless the local ring $A$ is a complete intersection, $A\la X,Y\ra$ will have homology in higher degrees; see Proposition <ref>. Adjoining further exterior variables and divided power variables one can extend $A\la X,Y\ra$ to an acyclic closure

\[
\ve\colon A\la U\ra\xra{\ \simeq\ }\mco\,;
\]

see <cit.> and <cit.>. By construction $U=\{U_i\}_{i\geqslant 1}$ is a graded set of indeterminates, with $U_1 = X$ and $U_2=Y$, and $A\la U\ra$ is the free $A$-algebra with divided powers, on the set $U$.

The differential on $A\la U \ra$ satisfies

\begin{equation}
\label{eq:d-minimal}
d(A\la X\ra) \subseteq (\bs t)A\la X\ra \quad\text{and}\quad d(A\la U\ra) \subseteq (\varpi,\bs t)A\la U\ra
\end{equation}

The first inclusion holds by construction. The second one, which says that the $A\la U\ra$ is a minimal free resolution of $\mco$ over $A$, holds because the map $A\to \mco$ is large, for it has an algebra section, namely the structure map $\mco\to A$; for instance, see <cit.>. The latter observation does not play a role in the sequel.

Since the acyclic closure is a free resolution of $\mco$ over $A$, one has

\[
\Ext^*_A(\mco,\mco) = \hh^*(\End_A(A\la U\ra))\,,
\]

where $\End_A(A\la U\ra) \colonequals \Hom_A(A\la U\ra, A\la U\ra)$. The complex $\End_A(A\la U\ra)$ is a DG $A$-algebra, with composition product, and  induces the product on cohomology. This endows $\Ext^*_A(\mco,\mco)$ with a multiplication, making it into a (typically non-commutative) $\mco$-algebra. In the sequel we view $\Ext^*_A(\mco,\mco)$ as an $\mco$-algebra with this product; it coincides with the Yoneda product, up to a sign.

The quasi-isomorphism $A\la U\ra\xra{\sim} \mco$ induces a quasi-isomorphism

\[
\Hom_A(A\la U\ra, A\la U\ra) \xra{\ \simeq\ } \Hom_A(A\la U\ra, \mco)
\]

so one can also use the complex on the right to compute $\Ext_A^*(\mco,\mco)$ as an $\mco$-module. More generally, for any $A$-module, or complex $M$, one has

\[
\Ext_A^*(\mco, M)\cong \hh^*(\Hom_A(A\la U\ra, M))\,.
\]

This identification is functorial in $M$.

So far we have not used the fact that $A$ is in $\acat(c)$, but now we do, to construct an element in $\Ext^c_A(\mco,\mco)$ that maps to a generator for $\ecoh_A^c(\mco)$. The discussion below is vacuous when $c=0$ so we assume $c\ge 1$.

We can assume the relations $\bs f$ defining $A$ have the form in (<ref>). Thus the residue class of the $t_{n-c+1},\cdots,t_n$ are a basis for  the free $\mco$-module $\tfree{(\fp_A/\fp_A^2)}$. Applying <cit.> yields $A$-linear maps

\[
\theta_i\colon A\la U\ra\to A\la U\ra\,, \quad\text{for $n-c+1\le i\le n$,}
\]

with the following properties. See  <cit.> for the notion of a $\varGamma$-derivation.

* $\theta_i$ is a $\varGamma$-derivation and for each $1\le j\le n$ one has

\[
\theta_i(x_j)=
\begin{cases}
1 & j=i \\
0 &\text{else}
\end{cases}
\]

* $d \theta_i + \theta_i d =0$, where $d$ is the differential on $A\la U\ra$.

Condition (b) states that each $\theta_i$ represents a cycle, of (upper) degree $1$, in the complex $\End_A(A\la U\ra)$ and hence a class in $\Ext^1_A(\mco,\mco)$. Moreover the composition

\begin{equation}
\label{eq:thetaA}
\theta_A \colonequals \ve\circ \theta_n\circ\cdots \circ\theta_{n-c+1}\colon A\la U\ra \lra \mco
\end{equation}

is a chain-map so represents a class in $\Ext^c_A(\mco,\mco)$. Evidently

\[
\theta_A(x_{n-c+1}\cdots x_n)=1
\]

This computation is interesting because of the result below. Recall that by construction <ref> the Koszul complex, $A\la X\ra$, is a DG subalgebra of $A\la U\ra$, so any map from $A\la U\ra$ can be restricted to $A\la X\ra$.

Let $\theta \colon A\la U\ra \to \mco$ be any $A$-linear chain-map,  of upper degree $c$, with $\theta(A\la X\ra)=\mco $. The class $[\theta]$ in $\Ext^c_A(\mco,\mco)$ generates the free $\mco$-module $\ecoh^c_A(\mco)$. This conclusion applies, in particular, to the class  $[\theta_A]$ from (<ref>).

Suppose to the contrary that $\theta$ does not generate the free $\mco$-module  $\ecoh^c_A(\mco)$. Since the latter has rank one, there must exist an $A$-linear chain-map $\alpha\colon A\la U\ra\to \mco$ of upper degree $c$ such that the class of $\theta - \varpi \alpha$ is zero in $\ecoh^c_A(\mco)$; equivalently that, for some integer $s\ge 1$, the class of $\varpi^s(\theta - \varpi\alpha)$ is zero in $\Ext^c_A(\mco,\mco)$. Thus, with $d$ denoting the differential on $A\la U\ra$, there exists a $A$-linear homotopy $\beta\colon A\la U\ra \to \mco$, of upper degree $c-1$, such that

\[
\varpi^s(\theta - \varpi\alpha) = \beta d\,.
\]

By the hypothesis, there exists an element $a$ in $A\la X\ra$ such that $\theta(a)=1$. Then from the equality above we get

\[
\varpi^s = \varpi^s\theta(a) =  \varpi^{s+1}\alpha(a) + \beta d(a) = \varpi^{s+1}\alpha(a)
\]

where the last equality holds as $d(a)$ is in $(\bs t)A\la U\ra$, hence $\beta d(a)=0$; see (<ref>). This is a contradiction.

The preceding result can be upgraded to a complete description of the torsion-free quotient of $\Ext^*_A(\mco,\mco)$. This is discussed below.

Consider $\ecoh_A^*(M)\colonequals \{\ecoh_A^i(M)\}_{i\geqslant 0}$ for any $A$-complex $M$. The graded $\mco$-algebra structure on $\Ext^*_A(\mco,\mco)$ descends to $\ecoh_A^*(\mco)$. Moreover, $\ecoh^*_A(M)$ is a graded module over $\ecoh^*_A(\mco)$ for any $A$-complex $M$.

By construction, $\ecoh^*_A(\mco)$ is a subring of $\Ext^*_R(k(\fp),k(\fp))$ where $R\colonequals A_{\fp_A}$ and $k(\fp)$ is its residue field. Since $R$ is regular, $\Ext^*_R(k(\fp),k(\fp))$ is an exterior algebra on $\Ext^1_R(k(\fp),k(\fp))$, and hence strictly graded-commutative; see <cit.>. Thus $\ecoh^*_A(\mco)$ is also graded-commutative and  so there is a natural map

\begin{equation}
\label{eq:xi-definition}
\xi_A\colon \bigwedge_{\mco} \ecoh^1_A(\mco) \lra \ecoh^*_A(\mco)
\end{equation}

of graded $\mco$-algebras, with $\ecoh^1_A(\mco)$ in degree one.

For any $A$ in $\acat(c)$ with $c\ge 1$ the following statements hold.

* There is an isomorphism of $\mco$-modules

\[
\mco^{c} \cong \Hom_{\mco}(\fp_A/\fp_A^2,\mco)\cong \Ext^1_A(\mco,\mco)\,;
\]

in particular,  the map $\Ext^1_A(\mco,\mco)\to \ecoh^1_A(\mco)$ is bijective.

* The map $\xi_A$ from (<ref>) is bijective.

Since the $\mco$-module $\fp_A/\fp_A^2$ has rank $c$, its $\mco$-dual is a free module of rank $c$; this explains the first isomorphism in (1). As to the other one,  consider the exact sequence of $A$-modules

\[
0\lra \fp_A\lra A \lra \mco \lra 0
\]

Since $\Ext^1_A(A,-)=0$, applying $\Hom_A(-,\mco)$ yields an exact sequence of $\mco$-modules

\[
0\lra \Hom_{A}(\mco,\mco)\xra{\ \cong\ } \Hom_A(A,\mco) \lra \Hom_A(\fp_A,\mco)\lra \Ext^1_A(\mco,\mco)\lra 0\,.
\]

It remains to note that adjunction yields an isomorphism

\[
\Hom_A(\fp_A,\mco) \cong \Hom_{\mco}(\mco \otimes_A\fp_A,\mco)\cong \Hom_{\mco}(\fp_A/\fp_A^2,\mco)\,.
\]

This justifies the isomorphisms in (1).

(2) Set $\Lambda\colonequals  \wedge_{\mco} \ecoh^1_A(\mco)$; thus $\Lambda^1= \Ext^1_A(\mco,\mco)$, by (1).   In the notation of <ref>, the class of the maps

\[
\theta_i\colon A\la U\ra \lra A\la U\ra \quad\text{for $n-c+1\le i\le n$}
\]

form a basis for the $\mco$-module $\Lambda^1$. These generate the $\mco$-algebra $\Lambda$ so Lemma <ref> is equivalent to: $\xi_A(\Lambda^{c}) = \ecoh^c_A(\mco)$. This is the key to the bijectivity of $\xi_A$.

Indeed, the map $\xi_A$ is an isomorphism when localized $\fp_A$. Thus $\xi_A$ is one-to-one, for its source is torsion-free, and its cokernel is $\mco$-torsion. If $\xi_A$ is not surjective, then for some integer $i$  there exists an element $\alpha$ in $\Lambda^i\setminus \varpi \Lambda^i$ such that $\xi_A(\alpha)$ is in $\varpi \ecoh^i_A(\mco)$. Since $\Lambda$ is an exterior algebra on $\Lambda^1$, a free $\mco$-module of rank $c$, one has $\Lambda^{r-i}\alpha = \Lambda^{c}$ so that

\[
\xi_A(\Lambda^{c}) =  \xi_A(\Lambda^{c-i}\alpha) \subseteq \xi_A(\Lambda^{c-i}) \xi_A(\alpha) \subseteq \ecoh_A^{c-i}(\mco) \varpi \ecoh_A^{i}(\mco) \subseteq \varpi \ecoh_A^{c}(\mco)\,.
\]

This is a contradiction. Therefore $\xi_A$ is bijective, as claimed.

It is clear from the construction that the map $\xi_A$ is functorial in $A$. Namely, given a map $\vf\colon A\to B$ in $\acat$, the natural map of $\mco$-algebra $\Ext^*_B(\mco,\mco)\to \Ext^*_A(\mco,\mco)$ induces the commutative diagram

\begin{equation}
\label{eq:xi-naturality}
\begin{tikzcd}
& \bigwedge_{\mco} \ecoh^1_B(\mco) \arrow{d}[swap]{\cong} \arrow{rr}{\wedge_{\mco} \ecoh^1_{\vf}(\mco)}
&& \bigwedge_{\mco} \ecoh^1_A(\mco)  \arrow{d}{\cong}   \\
&  \ecoh^*_B(\mco) \arrow{rr}[swap]{\ecoh^*_{\vf}(\mco)}
&& \ecoh^*_A(\mco)
\end{tikzcd}
\end{equation}

where the isomorphisms are by Proposition <ref>.

Let $\vf\colon A\to B$ be a surjective map in $\acat(c)$. If $\vf$ is an isomorphism at $\fp_A$, then induced map

\[
\ecoh^*_{\vf}(\mco)\colon \ecoh^*_B(\mco)\to \ecoh^*_A(\mco)
\]

of $\mco$-algebras is an isomorphism. In particular, $\ecoh^c_{\vf}(\mco)$ is bijective.

The statements are clear when $c=0$, so we assume $c\ge 1$. Set $I\colonequals \Ker(\vf)$. Since $\vf$ is an isomorphism at $\fp_A$, one has $I_{\fp_A}=0$.  The diagram $A\to B\to\mco$ induces an exact sequence

\[
I/\fp_A I\lra \fp_A/\fp_A^2 \lra \fp_B/\fp_B^2 \lra 0
\]

of $\mco$-modules. Since $I_{\fp_A}=0$ the $\mco$-module $I/\fp_A I$ is torsion, so the exact sequence above induces an isomorphism

\[
\Hom_{\mco}( \fp_B/\fp_B^2,\mco)\xra{\ \cong\ } \Hom_{\mco}( \fp_A/\fp_A^2,\mco)\,.
\]

Thus the map $\ecoh^1_{\vf}(\mco)$ is bijective; see Proposition <ref>(1). It remains to recall the commutative diagram (<ref>).

§.§ Complete intersections

The remainder of the discussion in this section is on complete intersection rings, leading to the statement that the Wiles defect of such rings is zero; see Corollary <ref>. The result below, which is already contained in the literature, leads us to it.

Let $A$ be in $\acat$ and $A\la X,Y\ra$ the Tate construction from <ref>. The following conditions are equivalent:

* The local ring $A$ is complete intersection;

* The map $A\la X,Y\ra \to \mco$ is a quasi-isomorphism;

* The $\mco$-module $\HH 1{A\la X\ra}$ is free and the natural map is bijective:

\[
\bigwedge_{\mco}(\HH 1{A\la X\ra})\xra{\ \cong\ } \HH *{A\la X\ra}
\]

Let $P\colonequals \mco\pos{t_1,\dots,t_n}$ and $A\colonequals P/(\bs f)$, as in <ref>. The kernel of the surjection $\lambda_P\colon P\to \mco$ is generated by the regular sequence $\bs t\colonequals t_1,\dots,t_m$.

(a)$\Rightarrow$(b): Since $A$ is complete intersection,  $\bs f$ is a regular sequence, contained in the ideal $(\bs t)$. Thus <cit.> applies, and yields the stated result.

(b)$\Leftrightarrow$(c): This is a special case of <cit.>; see also <cit.>.

(c)$\Leftrightarrow$(a): Condition  (c) says precisely that the map $\lambda_A\colon A\to\mco$ is a quasi-complete intersection, in the sense of <cit.>. Since $\mco$ is regular, hence a complete intersection, the desired equivalence is contained in <cit.>.

Let $A$ in $\acat(c)$ be a complete intersection. We can assume $A\colonequals P/(\bs f)$, where $\bs f \colonequals f_1,\dots,f_m$ is a regular sequence, and of the form given in (<ref>); see Theorem <ref>. By Proposition <ref>, the Tate construction $A\la X,Y\ra$ is the acyclic closure of  $\mco$ over $A$. Thus there is an isomorphism

\[
\Ext^*_A(\mco,\mco) \cong \hh^*(\Hom_A(A\la X,Y\ra,\mco))\,.
\]

Writing $\mco\la X,Y\ra$ for $\mco\otimes_A A\la X,Y\ra$, standard adjunction yields an isomorphism

\[
\Hom_A(A\la X,Y\ra,\mco)\cong \Hom_{\mco}(\mco\la X,Y\ra,\mco)
\]

Given that the $f_i$ are as in (<ref>), the differential $d$ on $\mco\la X,Y\ra$ satisfies $d(X)=0$ and $d(y_i) = \varpi^{d_i}x_i$ for $1\le i\le m=n-c$. Keeping in mind that the dual of a free algebra with divided powers is a symmetric algebra, one gets an isomorphism of complexes of $\mco$-modules

\[
\Hom_{\mco}(\mco\la X,Y\ra,\mco) \cong \mco[\eta_1,\dots,\eta_n,  \chi_1\,\dots,\chi_m\mid  d(\eta_i) = \varpi^{d_i}\chi_i\,,  d(\chi_j)=0]
\]

where each $ \eta_i$ is exterior variable of (upper) degree one, and  each $\chi_j$ is a polynomial variable of degree two. This yields an isomorphism of $\mco$-modules

\[
\Ext^*_A(\mco,\mco) \cong \frac{\mco[\eta_{m+1},\dots,\eta_n, \chi_1\,\dots,\chi_m]}{(\varpi^{d_1}\chi_1,\dots,\varpi^{d_m}\chi_m )}
\]

Recall that $d_i=\infty$ for $c+1\le i\le n$.  Thus one gets an isomorphism of $\mco$-modules

\[
\Ext^c_A(\mco,\mco)\cong \mco \eta_{m+1}\cdots\eta_{n} \oplus (\text{torsion})
\]

where the torsion part depends on $c$ and $m$. Thus $\ecoh^c_A(\mco)$ is generated by the residue class of $\eta_{m+1}\cdots\eta_{n}$; confer the construction of the class $\theta$ in <ref> and Lemma <ref>.

Since $A$ and $\mco$ are both complete intersections, the map $\lambda_A\colon A\to \mco$ is a quasi-complete intersection map, in the sense of <cit.>. Applying Theorem 2.5(4) from op. cit. yields

\[
\Ext^i_A(\mco,A) =
\begin{cases}
\mco & \text{when $i=c$} \\
0    & \text{else}.
\end{cases}
\]

In fact, one can follow the proof of <cit.> and  deduce that

\[
\cmod A \cong \mco/(\varpi^{d_{1}+\cdots +d_m})
\]

Given this isomorphism and the description of $\con A$ in (<ref>), it follows that when $A$ in $\acat$ is a complete intersection ring,  $\delta_A(A)=0$.  We omit details, for later on we present another proof that goes by a reduction to the case $c=0$; see Theorem <ref>, which also contains a converse.

§ INVARIANCE OF DOMAIN

In this section we establish an “invariance of domains" property for congruence modules; see Theorem <ref>.
The statement takes some preparation.

Let $\vf\colon A\to B$ be a surjective map in $\acat(c)$ and $M$ a finitely generated $B$-module. For each integer $i$,   the natural transformation $\Ext^i_B(\mco, -)\to \Ext^i_A(\mco,-)$ induces a natural map:

\[
\ecoh^i_{\vf}(M) \colon \ecoh^i_B(M) \lra \ecoh^i_A(M)\,.
\]

Noting that $\fp_AM=\fp_BM$, the naturality of the transformation $\ecoh^i_{\vf}(-)$ gives a commutative diagram of $\mco$-modules

\begin{equation}
\label{eq:invariance-diagram}
\begin{tikzcd}[column sep=huge]
\ecoh^i_B(M) \arrow{d} \arrow{r}{\ecoh^i_{\vf}(M)}
& \ecoh^{i}_A(M) \arrow{d} \\
\ecoh^i_B(M/\fp_B M)  \arrow{r}{\ecoh^i_{\vf}(M/\fp_AM)}
& \ecoh^{i}_A(M/\fp_AM)
\end{tikzcd}
\end{equation}

For $i=c$, the diagram above induces a map on the cokernels of the vertical maps:

\begin{equation}
\label{eq:invariance}
\cmod{\vf}(M)\colon \cmod B(M)\lra \cmod A(M)\,.
\end{equation}

This  result below may be viewed as a statement about invariance of domains for congruence modules. The case $c=0$ is covered by <cit.>.

Let $\vf\colon A\to B$ be a surjective map of local rings in $\acat(c)$. For any finitely generated $B$-module $M$ with $\depth_BM\ge c$, the  map of $\mco$-modules in (<ref>) is bijective, and  hence

\[
\length_{\mco}\cmod B(M) = \length_{\mco}\cmod A(M) \,.
\]

Thus $\delta_B(M)\ge \delta_A(M)$ with equality if and only if $\length_{\mco}\con A =\length_{\mco}\con B$.

It suffices to verify that (<ref>) is bijective; the claim about defects is a simple consequence. The map $\vf$ induces the surjective map $\vf_{\fp_A} \colon A_{\fp_A}\to B_{\fp_B}$ of local rings.  Its source and target are regular local rings of dimension $c$ so it is an isomorphism. This remark will be used in the argument below.

Consider the commutative diagram (<ref>). We prove that the horizontal maps are isomorphisms for $i=c$; this implies the desired result.

First we verify that the induced map  $\ecoh^c_{\vf}(M)\colon \ecoh^c_B(M)\to \ecoh^c_A(M)$ is bijective. Indeed since $\vf_{\fp_A}$ is an isomorphism, it is easy to see by localizing at $\fp_A$ that the kernel of the map

\[
\Ext^c_B(\mco, M)\to \Ext^c_A(\mco, M)
\]

is $\mco$-torsion, and hence the map $\ecoh^c_{\vf}(M)$ is one-to-one. This requires no hypotheses on $M$.  The crucial point is that since $\depth_BM\ge c$ the map above is surjective, and hence so is $\ecoh^c_{\vf}(M)$. The argument goes as follows: Since $A$-acts on $M$ through $B$, there is an isomorphism of complexes

\[
\RHom_A(\mco, M)\cong \RHom_B(B\lotimes_A \mco, M)\,,
\]

and the map $\RHom_B(\mco, M)\to \RHom_A(\mco,M)$ is induced by the natural morphism $ B\lotimes_A\mco\to \mco$ in $\dcat B$. Consider the exact triangle in $\dcat B$ that it generates:

\[
J\lra B\lotimes_A\mco \lra \mco \lra J[1]
\]

For the desired statement it suffices that $\Ext^c_B(J,M)=0$. Evidently the map $\HH i{B\lotimes_A\mco}\to \HH i{\mco}$ is surjective for $i\ge 1$ and bijective for $i\le 0$; moreover, it is bijective for all $i$ once we localize at $\fp_B$. It follows that $\HH iJ$ is $0$ for $i\le 0$ and $\mco$-torsion for all $i$; equivalently, $\fm_B$-power torsion, where $\fm_B$ denotes the maximal ideal of $B$, for the $B$ action on $\HH iJ$ factors through $\lambda_B$. Since $\depth_BM \ge c$, any $\fm_B$-power torsion $B$-module $W$ satisfies

\[
\Ext_B^i(W,M)=0 \quad\text{for $i\le c-1$.}
\]

Given that $\HH iJ=0$ for $i\le 0$ and $\fm_B$-power torsion for all $i$, it follows, for example by using a standard spectral sequence argument, that

\[
\Ext_B^i(J,M)=0 \quad\text{for $i\le c$.}
\]

This is as desired.

Next we verify that the following map  is bijective:

\[
\ecoh^c_B(M/\fp_BM)\to \ecoh^c_A(M/\fp_AM)\,.
\]

This part of the proof also does not require that $\depth_BM\ge c$. Given the  isomorphism (<ref>) it is enough to check that  $\ecoh^c_B(\mco)\to \ecoh^c_A(\mco)$ is bijective. This is contained in Proposition <ref>.

The following application of Theorem <ref> will be used often in the sequel.

Let $A$ be in $\acat(c)$ and $M$ a finitely generated $A$-module supported at $\fp_A$ and satisfying $\grade(\fp_A,M)\ge c$. Let $A'$ be the image of the natural map $A\to \End_A(M)$.
The following statements hold.

* $A'$ is in $\acat(c)$ and the surjective map $A\to A'$ is an isomorphism at $\fp_A$;

* $\mathrm{ass}_A A'\subseteq \mathrm{ass}_{A}M$;

* If $f\in A$ is not a zero-divisor on $M$, it is also not a zero-divisor on $A'$.

* There are equalities

\[
\length_{\mco}\cmod {A}(M) =\length_{\mco} \cmod {A'}(M)\quad\text{and}\quad
\length_\mco \con {A}\ge \length_{\mco} \con {A'}\,.
\]

Hence  $\delta_{A}(M)\ge \delta_{A'}(M)$, with equality if and only if $\con{A}\cong\con{A'}$.

The hypothesis on $M$ implies that $\depth_AM\ge c$ and also that $M$ is free at $\fp_A$; see Lemma <ref>. These observations will be used below.

(1) Since $M$ is faithful as an $A'$-module and free at $\fp_A$, it follows that the map $A\to A'$ is an isomorphism at $\fp_A$.

(2) Since $A'$ is an $A$-submodule of $\End_A(M)$, the inclusion below holds:

\[
\mathrm{ass}_A A'\subseteq \mathrm{ass}_A \End_A(M) = \mathrm{ass}_AM\,.
\]

The equality is a direct computation; solve <cit.>.

(3) The zero-divisors of a module over a noetherian ring are the union of its associated primes, so (3) is a consequence of (2).

(4) The action of $A$ on $M$ factors through $A'$ so  $\depth_{A'}M = \depth_AM\ge c$. Hence, given (1), it remains to apply Theorem <ref> to the map $A\to A'$.

§ DEFORMATIONS

The main result of this section, Theorem <ref>,  is that the defect of a module does not change under deformations. Throughout  we fix the following notation.

Fix $A$  in $\acat(c)$, for some $c\ge 1$, and $M$ a finitely generated $A$-module supported at $\fp_A$, and with $\grade(\fp_A,M)=c$; this is the maximum value possible, by Lemma <ref>. Let $f$ in $\fp_A\setminus \fp_A^{(2)}$ be such that it is not a zero-divisor on $M$. Set

\[
B\colonequals A/fA \qquad\text{and}\qquad N \colonequals M/fM\,,
\]

where $N$ is viewed as a $B$-module.

In the context of <ref>, the ring $B$ is in $\acat(c-1)$, and

\[
\delta_A(M) = \delta_{B}(N)\,.
\]

Moreover $N$ is supported at $\fp_B$ and $\grade(\fp_B,N)=\grade(\fp_A,M)-1$.

This result often permits one to reduce questions about defects to the case when $c=0$, which has been studied earlier in the literature. Here is one application; see also Section <ref>.

Let $A$ be a local ring in $\acat(c)$. If $M$ is a finitely generated $A$-module with $\grade(\fp_A,M)\ge c$, then $\delta_A(M)\ge 0$.

Let $\bs g$ be an $M$-regular sequence of length $c$ provided by Lemma <ref>. Set $B\colonequals A/\bs gA$ and $N\colonequals M/\bs g M$. Then a repeated application of Theorem <ref> yields $\delta_A(M) = \delta_B(N)$. After replacing $A$ and $M$ by $B$ and $N$, respectively, one can assume $c=0$. Then given the defect formula  Lemma <ref>, it suffices to verify that $\delta_A(A)\ge 0$, that is to say that

\[
\length_{\mco}\con A \ge \length_{\mco}\cmod A\,.
\]

Since $c=0$, one has $\con A = \fp_A/\fp_A^2$, and so the inequality above is exactly the one proved by Wiles'; see <cit.> and <cit.>.

Theorem <ref> also permits one to reconcile our notion of Wiles defect with the one introduced in <cit.> when $M=A$ is a Cohen–Macaulay ring. Indeed, both invariants  remain unchanged when we go modulo a suitable regular sequence; for the former, this is by Theorem <ref>, and for the latter, this is essentially by definition <cit.>. So it suffices to compare them when $c=0$, in which case they are defined in the same way.

The proof of Theorem <ref> makes repeated appeal to Theorem <ref>, and some observations of independent interest recorded below.

Let $A$ be a local ring in $\acat$, and consider the natural pairing

\[
\langle -, -\rangle \colon \Hom_\mco(\fp_A/\fp_A^2,\mco)\times \tfree{(\fp_A/\fp_A^2)} \lra \mco\,.
\]

Given an element $f\in \fp_A$, let $[f]$ denote its residue class in $\tfree{(\fp_A/\fp_A^2)}$, and consider the induced map

\[
\langle - ,[f]\rangle\colon \tfree{(\fp_A/\fp_A^2)} \lra \mco\,.
\]

Let $O(f)$ denote its image; this is called the order ideal of $[f]$. It is the subset of $\mco$ consisting of elements $\alpha(f)$, as $\alpha$ ranges over $\mco$-linear maps $\fp_A/\fp_A^2\to \mco$.  Set

\[
\nu_A(f) \colonequals \length_{\mco}(\mco/O(f))\,.
\]

Let  $f$ be as in <ref>. The maps $A\to B\to \mco$ give rise to an exact sequence

\[
0\lra \mco \lra \frac{\fp_A}{\fp_A^2}\lra \frac{\fp_B}{\fp_B^2} \lra 0\,,
\]

of $\mco$-modules, where the map on the left sends $1\in\mco$ to the class of $f$ in $\fp_A/\fp_A^2$; it is one-to-one because it is so when it is localized at $\fp_A$. This uses the hypothesis that $f$ is not in $\fp_A^{(2)}$. Applying $\Hom_{\mco}(-,\mco)$ gives an exact sequence

\begin{equation}
\label{eq:order}
0\lra \Hom_B(\fp_B/\fp_B^2,\mco) \lra \Hom_A(\fp_A/\fp_A^2,\mco) \xra{\ \eth^1\ } \mco
\end{equation}

where the map on the right is evaluation on the class of $f$. In particular, the image of $\eth^1$ is $O(f)$, so

\[
\length\Coker(\eth^1) = \nu_A(f)\,.
\]

The relevance of this discussion is manifest from the result below.

In the set-up of <ref>, the ring $B$ is in $\acat(c-1)$ and

\[
\length_{\mco}\con {B} -  \length_{\mco}\con A = \nu_A(f)\,.
\]

Lemma <ref> yields that $B$ is in $\acat(c-1)$. By construction, the exact sequence (<ref>) continues as the exact sequence

\[
\Hom_A(\fp_A/\fp_A^2,\mco) \xra{\ \eth^1\ } \mco \lra \Ext^1_{\mco}(\fp_B/\fp_B^2,\mco)\lra \Ext^1_{\mco}(\fp_A/\fp_A^2,\mco)\lra 0\,.
\]

It is easy to check that the length of $\Ext^1_{\mco}(\fp_B/\fp_B^2,\mco)$ equals that of $\con B$, and similarly for $A$. Therefore the exact sequence above yields

\[
\length_{\mco}\con B - \length_{\mco}\con A = \length\Coker(\eth^1) = \nu_A(f)\,.
\]

This is  the desired equality.

We need one more observation regarding these order ideals.

With $A$ and $f$ as in <ref>, let $\pi\colon A\to A'$ be a surjective map in $\acat(c)$ that is an isomorphism at $\fp_A$.
Then $\pi(f)$ is in $\fp_{A'}\setminus \fp_{A'}^{(2)}$, and $\nu_{A'}(\pi(f))=\nu_A(f)$.

Since $\pi$ is surjective and an isomorphism at $\fp_A$, one has

\[
\fp_A^{(2)}=\pi^{-1}(\fp_{A'}^{(2)}) \quad\text{and}\quad \fp_A^2A_{\fp_A}\cong \fp_{A'}^2A'_{\fp_A'}\,.
\]

Thus $f$ not in $\fp_A^{(2)}$ implies that $\pi(f)$ is not in $\fp_{A'}^{(2)}$. The equality $\nu_{A'}(\pi(f))=\nu_A(f)$ is immediate from the definition of $\nu(-)$, given that $\pi$ induces an isomorphism

\[
\tfree{(\fp_A/\fp_A^2)}\cong \tfree{(\fp_{A'}/\fp_{A'}^2)}\,.
\]

See (<ref>).

The hypothesis is that $A$ is in $\acat(c)$, the $A$-module $M$ has depth at least $c$,  and $f\in \fp_A\setminus \fp_A^{(2)}$ is not a zero-divisor on $M$. We have to verify

\[
\delta_A(M) = \delta_B(N) \quad\text{for $B\colonequals A/fA$ and $N\colonequals M/fM$.}
\]

One has $\depth_A(\fp_A,M)=c$ and $f\in \fp_A$ is not a zero-divisor on $M$. Thus $\depth_B(\fp_B,N)=c-1$. Since $f$ is in $\fp_A$, the surjection $M\to N$ induces an isomorphism $M/\fp_AM \cong N/\fp_B N$, so there is an equality

\begin{equation}
\label{eq:reduction-rank}
\rank_{A_{\fp_A}} (M_{\fp_A}) = \rank_{B_{\fp_B}} (N_{\fp_B})\,.
\end{equation}

We reduce to the case where $f$ is not a zero-divisor also on $A$, as follows:  Let $A'$ be the image of $A$ in $\End_A(M)$ and set $B'\colonequals A'/fA'$. Then $A'$ is in $\acat(c)$ and the map $A\to A'$ is an isomorphism at $\fp_A$, by Lemma <ref>. Thus
image of $f$ in $A'$ is not contained in $\fp_{A'}^{(2)}$ and  $\nu_{A'}(f)=\nu_{A}(f)$, by Lemma <ref>.
Applying  Lemma <ref> to $A$ and $A'$ we deduce that $B$ and $B'$ are in $\acat{(c-1)}$, and

\[
\length_{\mco}\con B - \length_{\mco} \con A = \length_{\mco} \con {B'} - \length_{\mco} \con {A'}\,.
\]

Moreover $\grade(\fp_{A'},M)=\grade(\fp_A,M) \ge c$, since the $A$ action on $M$ factors through $A'$, and similarly $\grade(\fp_{B'},N)\ge c-1$, so Theorem <ref> yields equalities

\begin{align*}
&\length_{\mco}\cmod{A'}(M) = \length_{\mco} \cmod{A}(M) \\
&\length_{\mco} \cmod{B'}(N) = \length_{\mco} \cmod{B}(N)\,.
\end{align*}

The displayed equalities above yield

\[
\delta_A(M) - \delta_{B}(N) = \delta_{A'}(M) - \delta_{B'}(N)
\]

It thus suffices to verify the desired result for the $A'$-module $M$, so replacing $A$ and $A'$, and so $B$ by $B'$, one can assume $f$ is  not a zero-divisor also on $A$, as claimed; see Lemma <ref>.

The next step in the proof is a reduction to the case $M=A$.
The assertion below concerns the map $\eta_M$ from (<ref>).

There is an isomorphism $\Coker(\eta_N)\cong \Coker(\eta_M)$ of $\mco$-modules.

Indeed, since $f$ is not a zero-divisor on $A$, the free resolution of the $A$-module $B$  is $0\to A\xra{f}A\to 0$. In particular, it is finite free, so for any $A$-complex $X$ there is a natural isomorphism

\[
\RHom_A(B,X) \cong \RHom_A(B,A)\lotimes_A X \cong (B\lotimes_A X)[-1]
\]

in $\dcat B$.  This gives rise to isomorphisms

\[
\RHom_A(\mco, X) \cong \RHom_B(\mco, \RHom_A(B,X)) \cong \RHom_B(\mco, (B\lotimes_A X)[-1])\,.
\]

Thus, passing to cohomology and applying $\tfree{(-)}$ yields an isomorphism

\[
\ecoh^i_A(X)  \cong \ecoh_B^{i-1}(B\lotimes_AX)
\]

for each integer $i$, and natural in $X$. Moreover, since $f$ is not a zero-divisor on $M$, the natural map

\[
B\lotimes_AM \to \HH 0{B\lotimes_AM} \cong M/fM = N
\]

is a quasi-isomorphism. Summing up, one gets a commutative diagram

\[
\begin{tikzcd}[column sep=huge]
\ecoh^c_A(A)\otimes_{\mco}\tfree{(M/\fp_AM)} \arrow{d}[swap]{\eta_M} \arrow{r}{\cong}
& \ecoh^{c-1}_B(B)\otimes_{\mco}\tfree {(N/\fp_BN)}   \arrow{d}{\eta_N}\\
\ecoh^{c}_A(M)   \arrow{r}{\cong}
& \ecoh^{c-1}_B(N)
\end{tikzcd}
\]

of $\mco$-modules. This justifies the claim.

Given the preceding claim, (<ref>), and the exact sequence Lemma <ref>, it suffices to establish the desired equality for $M=A$, namely that $\delta_A(A)=\delta_B(B)$. In view of Lemma <ref>, this is equivalent to

\begin{equation}
\label{eq:cmod-equality}
\length_{\mco}\cmod B - \length_{\mco}\cmod A = \nu_A(f)\,.
\end{equation}

To that end, consider the commutative square

\begin{equation}
\label{eq:reduction}
\begin{tikzcd}
\ecoh^c_A(A) \arrow{d}[swap]{\cong}  \arrow{r}
& \ecoh^c_A(\mco) \arrow{d}{\cong} \\
\ecoh^{c-1}_B(B) \arrow{r}
& \ecoh^{c-1}_B(B\lotimes_A \mco) \arrow{r} & \ecoh^{c-1}_B(\mco)
\end{tikzcd}
\end{equation}

The maps in the lower row are induced by canonical maps $B \to B\lotimes_A \mco \to \mco$ whose composition is $\lambda_B$. The key point is this:

The map $\ecoh^{c-1}_B(B\lotimes_A\mco) \to  \ecoh^{c-1}_B(\mco)$ is one-to-one and its cokernel has length equal to $\nu_A(f)$.

Given this claim and the diagram (<ref>) one gets inclusions

\[
\ecoh^{c-1}_B(B) \hookrightarrow \ecoh^{c-1}_B(B\lotimes_A\mco) \hookrightarrow \ecoh^{c-1}_B(\mco)
\]

These and the isomorphisms in (<ref>) yield (<ref>), as desired.

To verify the claim we consider the canonical exact triangle

\[
\mco[1] \lra B\lotimes_A\mco \lra \mco\lra \mco[2]
\]

in $\dcat B$. Applying $\Hom_{\dcat B}(\mco, (-)[{c-1}])$ yields an exact sequence of $\mco$-modules

\[
\Ext^{c}_B(\mco,\mco) \lra \Ext^{c-1}_B(\mco, B\lotimes_A\mco) \lra \Ext^{c-1}_B(\mco,\mco) \xrightarrow{\ \chi\ } \Ext^{c+1}_B(\mco,\mco) \lra
\]

The first part of the claim follows because the $\mco$-module $\Ext^i_B(\mco,\mco)$ is torsion for all $i\ge c$; see Lemma <ref> and  <ref>. As an aside we note that $\chi$ is the cohomology operator of the map $A\to B$,  discovered by Eisenbud and Gulliksen; see <cit.>.

It remains to verify the second part of the claim. In view of the commutative diagram <ref>, this is tantamount to the statement that the cokernel of the map $\ecoh^c_A(\mco) \to \ecoh^{c-1}_B(\mco)$ has length $\nu_A(f)$. This follows from a certain equivariance property of the map. Namely, the connecting map

\[
\Ext^*_A(\mco,\mco) \lra \Ext^{*-1}_B(\mco,\mco)
\]

is $\Ext^*_B(\mco,\mco)$-linear, where the source is viewed as an $\Ext^*_B(\mco,\mco)$-module via the natural map $\Ext^*_B(\mco,\mco)\to \Ext^*_A(\mco,\mco)$.  Thus the induced map

\[
\eth^*\colon \ecoh^*_A(\mco) \lra \ecoh^{*-1}_B(\mco)
\]

is $\ecoh^*_B(\mco)$-linear. The map $\eth^1$ is precisely the one in (<ref>).  In view of Proposition <ref>, the exact sequence (<ref>) implies that the image of $\ecoh^1_B(\mco)$ in $\ecoh^1_A(\mco)$ is a nonzero direct summand, and hence also that $\ecoh^{c-1}_B(\mco)\cdot \ecoh^1_A(\mco)=\ecoh^c_A(\mco)$.  Since the image of $\eth^1$ is the order-ideal of $f$, the equivariance property of $\eth^*$ implies

\[
\eth^{c}(\ecoh^c_A(\mco)) = \eth^{c}(\ecoh^{c-1}_B(\mco)\ecoh^1_A(\mco)) = \ecoh^{c-1}_B(\mco)\eth^{1}(\ecoh^1_A(\mco)) = \varpi^{\nu_A(f)} \ecoh^{c-1}_B(\mco)
\]

Thus the cokernel of $\eth^{c}$ has length $\nu_A(f)$, as claimed.

This completes the proof of the claim and hence of the theorem.

§ CRITERIA FOR FREENESS

In this section we establish numerical criteria, in terms of congruence modules and cotangent modules, for detecting when a module has a free summand, and also for detecting the complete intersection local rings in $\acat$.

§.§ Gorenstein rings

A noetherian local ring $R$ is Gorenstein if $R$, viewed as a module over itself, has finite injective dimension.
Over such a ring $R$, a finitely generated $R$-module $M$ is maximal Cohen–Macaulay if and only if

\begin{equation}
\label{eq:gor-mcm}
\Ext^i_R(M,R)=0\quad \text{for all $i\ge 1$.}
\end{equation}

This follows from (<ref>), keeping in mind that $\ddual R\cong R[\dim R]$ in $\dcat R$; see also <cit.>. The result below is Theorem <ref> from the Introduction. In the statement, $e_A(M)$ denotes the multiplicity of an $A$-module $M$; see <cit.>.

Let $A$ be a Gorenstein local ring in $\acat$ and $M$ a maximal Cohen–Macaulay $A$-module with $\mu\colonequals \rank_{\fp_A}(M_{\fp_A})\ne 0$. Then $\delta_A(M)=  \mu \cdot \delta_A(A)$ holds if and only if

\[
M\cong A^{\mu}\oplus W \qquad\text{where $W_{\fp_A}=0$.}
\]

When this holds and $e_A(M)\le \mu  \cdot e(A)$, then $M$ is free.

A key step in the proof of Theorem <ref> is a criterion for detecting free summands in modules over general Gorenstein local rings, and not special to the category $\acat$. This is explained below.

Let $R$ be a Gorenstein local ring, $M\in\rmod R$ a maximal Cohen–Macaulay module, and $x\in R$ not a zero-divisor on $R$ and on $M$. If the $R/xR$-module $M/xM$ has a free summand of rank $\mu $, then so does the $R$-module $M$.

It suffices to verify that if $R'\colonequals R/xR$ is a direct summand of $M'\colonequals M/xM$, then $R$ is a direct summand of $M$. The latter condition is equivalent to the condition that the trace ideal of $M$ is $R$; that is to say, the natural map is surjective:

\[
\tau_M(R) \colon \Hom_R(M,R)\otimes_R M\lra R\,, \quad\text{given by $f\otimes m\to f(m)$.}
\]

See, for instance, <cit.>. By Nakayama's Lemma, it suffices to prove that $\tau_M(R)$ is surjective after applying $-\otimes_R R'$; equivalently, the horizontal map in the  diagram below is surjective:

\[
\begin{tikzcd}
(\Hom_R(M,R)\otimes_R R') \otimes_{R'} M' \arrow{d}  \arrow{r} & R' \\
\Hom_{R'}(M',R') \otimes_{R'} M'\arrow[bend right=20]{ur}[swap]{\tau_{M'}(R')}
\end{tikzcd}
\]

The vertical map is induced by the map

\[
\Hom_R(M,R) \lra \Hom_R(M,R') \cong \Hom_{R'}(M',R')\,,
\]

where the first map is induced by $R\to R'$, and the isomorphism is standard adjunction.  It is a simple exercise to check that the diagram above is commutative. Moreover,  $\tau_{M'}(R')$ is surjective because $R'$ is a direct summand of $M'$. Thus, it suffices to verify that the vertical map is surjective. Since $M$ is maximal Cohen–Macaulay, $\Ext^1_R(M,R)=0$ by (<ref>), so applying $\Hom_R(M,-)$ to the exact sequence

\[
0\lra R\xra{\ x\ } R \lra R' \lra 0
\]

yields the desired result.

Here is a general result on detecting free summands. The hypothesis on the Ext modules is equivalent to the vanishing of the Tate cohomology module of the pair $(\mco,M)$, in degree $c$; see <cit.>.

Let $R$ be a Gorenstein local ring and $M$ a maximal Cohen–Macaulay $A$-module. Let $\lambda\colon R\to\mco$ be surjective map, set $\fp\colonequals \Ker(\lambda)$ and $c\colonequals \height\fp$. If the induced map $\widetilde{\eta}_M\colon \Ext^c_R(\mco,R)\otimes_RM\to \Ext^c_R(\mco,M)$ is surjective and $M_\fp$ is nonzero, then $M$ has a free $R$-summand.

The argument is by reduction to Krull dimension zero. Choose an element $x$ in $R$ such that $\lambda(x)=\varpi$, the uniformizer for $\mco$, and is not zero-divisor on $R$ or on $M$. Set $S\colonequals R/xR$ and $N\colonequals M/xM$. For any $R$-module, say $U$, on which $x$ is not a zero-divisor, the surjection $U\to U/xU$ induces, for each integer $n$, a map

\[
\Ext^n_R(\mco, U) \lra \Ext^n_R(\mco,U/xU)\cong \Ext^n_S(k,U/xU)
\]

natural in $U$. This isomorphism is by standard adjunction. Specializing $U$ to $R$ and to $M$ gives a commutative diagram:

\[
\begin{tikzcd}
\Ext^c_R(\mco,R)\otimes_R M \arrow{d} \arrow[twoheadrightarrow]{r}{\widetilde{\eta}_M} & \Ext^c_R(\mco,M) \arrow{d}  \\
\Ext^c_S(k,S)\otimes_S N \arrow{r}{\widetilde{\eta}_N} & \Ext^c_S(k,N)
\end{tikzcd}
\]

The vertical map on the right is nonzero, as can be seen by considering the long exact sequence  induced by $\Hom_R(\mco, -)$ to the exact sequence

\[
0\lra M \xra{\ x\ } M \lra N\lra 0
\]

and Nakayama's Lemma. This is where we need the hypothesis that $M_\fp\ne 0$, for it implies $\Ext^c_R(\mco,M)\ne 0$; localize at $\fp$. Thus we conclude that the map $\widetilde{\eta}_N$ in the diagram above is nonzero. It thus suffices to prove following claim, for then $M$ has a free $R$-summand, by Lemma <ref>.

When $\widetilde{\eta}_N$ is nonzero, the $S$-module $N$ has a free summand.

To verify the claim, choose a sequence $\bs x\colonequals x_1,\dots,x_r$ in $\fm_S$ that is regular on $S$ and on $N$; this is possible as both have maximal depth. Set $S'\colonequals S/{\bs x}S$ and $N'\colonequals N/{\bs x}N$.  By <cit.> one gets the isomorphisms in the diagram:

\[
\begin{tikzcd}
&\Ext^c_S(k,S)\otimes_S N \arrow{d}[swap]{\cong} \arrow{r}{\widetilde{\eta}_N} & \Ext^c_S(k,N) \arrow{d}{\cong} \\
\mathrm{Soc}(S')\otimes_{S'} N' \ar{r}{\cong} &\Ext^0_{S'}(k,S')\otimes_{S'}N' \arrow{r}{\widetilde{\eta}_{N'}}
& \Ext^0_{S'}(k,N')\ar{r}{\cong} &\mathrm{Soc}(N')
\end{tikzcd}
\]

The diagram is commutative because of the naturality of the maps.  Since $\widetilde{\eta}_N$ is nonzero so is $\widetilde{\eta}_{N'}$, that is to say, $\mathrm{Soc}(S')\cdot N' \ne 0$. We claim that this property implies  $N'$ has a free $S'$-summand, so then $N$ has a free $S$-summand, by Lemma <ref>, which is as desired. Here is one way to verify the claim.

Choose an element $a \in N'$ such that $\mathrm{Soc}(S')a \ne 0$ and consider the $S'$-linear map $\alpha\colon S'\to N'$ defined by $1\mapsto a$. Since $S'$ is a Gorenstein ring of Krull dimension zero, $\mathrm{Soc}(S')$ is the smallest nonzero ideal in $S'$. Thus the choice of $a$ implies that $\alpha$ is injective. It remains to observe that $S'$ being a Gorenstein ring of Krull dimension zero, it is injective as a module over itself, so $\alpha$ is split-injective.

We can now present a proof of Theorem <ref>. Instead of the argument given below, one could also use Theorem <ref> to reduce to the case $c=0$, as in the proof of Corollary <ref>; then the result is implicit in the proof of <cit.>. The latter statement is contained in Theorem <ref> further below.

Suppose $A$ is in $\acat(c)$.  Since $M$ is maximal Cohen–Macaulay, $\depth_AM\ge c+1$, so it is free at $\fp_A$ and the $\mco$-module $\Ext^c_A(\mco,M)$ is torsion-free, by Lemma <ref>. Thus if $\delta_A(M)=\mu \cdot \delta_A(A)$, then Lemma <ref> yields that the map

\[
\Ext^c_A(\mco,A)\otimes_A M\lra \Ext^c_A(\mco, M)
\]

is surjective. Then a repeated application of Lemma <ref> yields that $M$ has a free summand of rank $\mu $. Thus $M\cong A^{\mu}\oplus W$ for some $A$-module $W$. It remains to observe that since $M$ is free of rank $\mu$ at $\fp_A$, one must have $W_{\fp_A}=0$.

Conversely, if $M\cong A^{\mu} \oplus W$ with $W$ not supported at $\fp_A$, then $\delta_A(W)=0$, by Lemma <ref>, so

\[
\delta_A(M) = \mu  \cdot \delta_A(A) + \delta_A(W)=  \mu  \cdot \delta_A(A)\,.
\]

As to the last part of the statement, write $M\cong A^{\mu } \oplus W$ for some $A$-module $W$. When the stated bound on the multiplicity of $M$ holds, one gets

\[
\mu \cdot e(A) + e_A(W) = e_A(A^{\mu}\oplus W)= e_A(M) \le \mu  \cdot e(A)
\]

Thus $e_A(W)=0$. Since $M$ is maximal Cohen–Macaulay, either $W$ is $0$ or it is also maximal Cohen–Macaulay. The latter case cannot holds,
the multiplicity of a nonzero maximal Cohen–Macaulay module is positive; see <cit.>.

§.§ Complete intersection rings

Next we turn to complete intersections. Any local ring $A$ in $\acat$ is of the form $P/I$, where $P\colonequals\mco\pos{\bs t}$, a ring of formal power series, and in particular, a regular local ring. Such an $A$ is complete intersection if and only if the ideal $I$ can be generated by a regular sequence; see <cit.>.

The result below generalizes a criterion for complete intersection due to Wiles <cit.> and Lenstra <cit.>, as extended in <cit.>, both of which deal with the case $c=0$.

Let $A$ be a local ring in $\acat(c)$ with $\depth A\ge c+1$. The ring $A$ is complete intersection if, and only if, $\delta_A(A)=0$.

One can reduce to the case $c=0$ as in the proof of Corollary <ref>.  At that point, one can invoke <cit.>.

Here is an extension of a result due to Diamond <cit.>.

Let $A$ be a local ring in $\acat(c)$ and $M$ a finitely generated $A$-module with $\depth_AM\ge c+1$ and $\mu\colonequals \rank_{\fp_A}(M_{\fp_A})\ne 0$. Then $\delta_A(M)=0$ if and only if $A$ is complete intersection and

\[
M\cong A^{\mu}\oplus W \qquad\text{where $W_{\fp_A}=0$.}
\]

When this holds and $e_A(M)\le \mu\cdot e(A)$, then $M$ is free.

The “if" direction of the statement is clear, given Theorem <ref>. The proof of “only if" direction uses the observation below.

The desired statement holds for all $A$ in $\acat(c)$ if it holds for all such $A$ with $\depth A\ge 1$.

Indeed, let $A'$ be the image of $A$ in $\End_A(M)$. Since the $A$ action of $M$ factors through the surjection $A\to A'$, the depth of $M$ as an $A'$-module also equals $c+1$. Moreover, Lemma <ref> yields the first inequality below:

\[
0= \delta_A(M) \ge \delta_{A'}(M) \ge 0\,.
\]

The equality is by hypothesis and the second inequality is from Corollary <ref>.  Thus one gets the first equality below:

\[
\delta_{A'}(M)=0 \quad\text{and}\quad \length_{\mco}\con A=\length_{\mco}\con {A'}\,.
\]

The second one is again by Lemma <ref>.  It thus suffices to prove the desired result for $A'$, for when $A'$ is complete intersection Lemma <ref> implies that $A\cong A'$.

This justifies the claim.

We verify the first part of the statement by induction on $c$; the second part then follows as in the proof of Theorem <ref>.

The base case is $c=0$. By the preceding claim, we can assume $A$  has positive depth.   Since $c=0$, one has $\delta_A(A)\ge 0$; see Corollary <ref>. Thus the hypothesis that $\delta_A(M)=0$ and Lemma <ref> implies $\delta_A(A)=0$. Thus $A$ is complete intersection, by Theorem <ref>. At this point, we can invoke Theorem <ref> to conclude that $M$ has a free summand; this is where the hypothesis that the $M_{\fp_A}$ is nonzero is required, so that the rank of $M$ at $\fp_A$ is nonzero; see Lemma <ref>.

This completes the proof when $c=0$.

Suppose that $c\ge 1$.  One again, thanks to the claim above, we can suppose $\depth A\ge 1$.  Pick an element $f$ in $\fp_A\setminus \fp_A^{(2)}$ that is not a zero-divisor on $M$ and on $A$. Set $B\colonequals A/fA$ and $N\colonequals M/fM$. The ring $B$ is in $\acat{(c-1)}$ and $\delta_{B}(N)=0$, by Theorem <ref>. Moreover the rank of $N$ at $\fp_B$ equals $\mu$, as can be easily verified. Thus, by induction, $B$ is a complete intersection and the $B$-module $N$ has a free summand of rank $\mu$. Thus $A$ is complete intersection,  by <cit.>, and that the $A$-module $M$ has a free summand of rank $\mu$, by Lemma <ref>.

This completes the proof.

Here is one corollary, which may be seen as a counterpart to Lemma <ref>. When $c=0$  the result below is <cit.>, and <cit.>, both of which were inspired by Wiles' work in <cit.>.

Let $\vf\colon A\to B$ be a surjective a map in $\acat(c)$ with $B$ a complete intersection. If $\delta_A(B)=0$, then $\vf$ is bijective and $A$ is a complete intersection.

Since $B$ is a complete intersection, $\delta_B(B)=0$, by Theorem <ref>. Thus the hypothesis and Theorem <ref>, applied with $M=B$, imply $\length_{\mco}\con A = \length_{\mco}\con B$. The desired result follows from Lemma <ref>.

Patching and duality
In this part we summarize the commutative algebra needed for the patching construction in the derived setting. Our main purpose is to show that this construction preserves duality; see Theorem <ref>.

§ ABSTRACT PATCHING

This section is mostly a recollection of the patching construction,  following the approach of  Calegari and Geraghty <cit.>, Hansen <cit.>,  <cit.> and Allen et. al. <cit.>.  In particular, the ultrapatching method is due to Scholze <cit.>.

Going forth we assume the residue field $k\colonequals \mco/\varpi\mco$ of $\mco$ is finite, and of positive characteristic $\ell$. We fix a power series ring

\[
\mco\pos{\bs y}\quad\text{where $\bs y\colonequals  y_1,\ldots,y_r$.}
\]

For each integer $n\ge 1$, fix integers $e(1,n),\ldots,e(r,n)\ge n$ and quotient rings

\[
\Lambda_n \colonequals \mco\pos{\bs y}/I_n, \quad\text{where $I_n \colonequals \left((1+y_i)^{\ell^{e(i,n)}}-1\mid 1\le i\le c\right)$}.
\]

These are flat $\mco$-algebras, augmented to $\Lambda_0=\mco$, and complete intersections. For each $n$ pick a $\Lambda_n$-algebra $R_n$ that is finite as a $\Lambda_n$-module, and such that  there is an isomorphism $R_n/(\bs y)R_n = \mco \otimes_{\Lambda_n}R_n \cong R_0$; we  suppress this isomorphism in our notation and write an equality instead.   We assume no other relations between the $R_n$.  Let $\varphi_n\colon \Lambda_n\to R_n$ denote the structure maps.