Published online by Cambridge University Press: 16 August 2021
In his work on modularity theorems, Wiles proved a numerical criterion for a map of rings $R\to T$ to be an isomorphism of complete intersections. He used this to show that certain deformation rings and Hecke algebras associated to a mod $p$ Galois representation at non-minimal level are isomorphic and complete intersections, provided the same is true at minimal level. In this paper we study Hecke algebras acting on cohomology of Shimura curves arising from maximal orders in indefinite quaternion algebras over the rationals localized at a semistable irreducible mod $p$ Galois representation $\bar {\rho }$. If $\bar {\rho }$ is scalar at some primes dividing the discriminant of the quaternion algebra, then the Hecke algebra is still isomorphic to the deformation ring, but is not a complete intersection, or even Gorenstein, so the Wiles numerical criterion cannot apply. We consider a weight-2 newform $f$ which contributes to the cohomology of the Shimura curve and gives rise to an augmentation $\lambda _f$ of the Hecke algebra. We quantify the failure of the Wiles numerical criterion at $\lambda _f$ by computing the associated Wiles defect purely in terms of the local behavior at primes dividing the discriminant of the global Galois representation $\rho _f$ which $f$ gives rise to by the Eichler–Shimura construction. One of the main tools used in the proof is Taylor–Wiles–Kisin patching.