Ihara’s Lemma for Shimura curves over totally real fields via patching

We prove Ihara’s lemma for the mod l cohomology of Shimura curves, localized at a maximal ideal of the Hecke algebra, under a large image hypothesis on the associated Galois representation. This was proved by Diamond and Taylor, for Shimura curves over Q\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {Q}$$\end{document}, under various assumptions on l. Our method is totally different and can avoid these assumptions, at the cost of imposing the large image hypothesis. It uses the Taylor–Wiles method, as improved by Diamond and Kisin, and the geometry of integral models of Shimura curves at an auxiliary prime.


Introduction
Let Γ = Γ 0 (N ) be the usual congruence subgroup of SL 2 (Z), for some N ≥ 1, and let p be a prime not dividing N .Write Γ ′ = Γ ∩ Γ 0 (p).If X Γ and X Γ ′ are the compactified modular curves of levels Γ and Γ ′ , then there are two degeneracy maps π 1 , π 2 : X Γ ′ → X Γ induced by the inclusions Γ ′ ֒→ Γ and p 0 0 1 Γ ′ p 0 0 1 −1 ֒→ Γ.If l is another prime, then we have a map As a consequence of a result of Ihara -[Iha75] Lemma 3.2, and see also the proof of [Rib84] Theorem 4.1 -the kernel of π * may be determined.In particular: Theorem (Ihara's Lemma).If m is a non-Eisenstein maximal ideal of the Hecke algebra acting on these cohomology groups (that is, m corresponds to an irreducible Galois representation), then the map π * is injective after localizing at m. 1This was used by Ribet in [Rib84] to prove a level-raising result for modular forms: if f ∈ S 2 (Γ) is a cuspidal eigenform such that ρ f is irreducible and the Fourier coefficient a p satisfies a p ≡ ±(1 + p) (mod l), then there is a cuspidal eigenform g ∈ S 2 (Γ ′ ) p-new such that ρ f ∼ = ρ g .Now suppose that F is a totally real number field and that D is a quaternion division algebra over F ramified at all but one infinite place.For K ⊂ (D ⊗ A F,f ) × a compact open subgroup, p a finite place of F at which K and D are unramified, and l a prime, there is an obvious (conjectural) generalisation of Theorem 1 with X Γ replaced by the Shimura curve X K .We refer to this as "Ihara's Lemma at p for X K , localized at m"; it depends on K and on a maximal ideal m of the Hecke algebra acting on H 1 (X K , F l ), to which is associated a Galois representation ρ m : G F → GL 2 (F l ).The purpose of this paper is to prove: Theorem 1.1.Suppose that l > 2 and that the image of ρ m contains a subgroup of GL 2 (F l ) conjugate to SL 2 (F l ) (and satisfies an additional Taylor-Wiles hypothesis if l = 5 and √ 5 ∈ F ). Then Ihara's Lemma at p for X K , localized at m, is true.
Ihara's method of proof does not generalise, since it relies on the "congruence subgroup property of SL 2 (Z[ 1 p ])", the analogue of which is a longstanding conjecture of Serre in the quaternionic case.In [DT94b], Diamond and Taylor overcame this difficulty for Shimura curves over Q using the good reduction of Shimura curves at l and comparison of mod l de Rham and étale cohomology.This necessitates various conditions on l: • p does not divide l; • D and K must be unramified at l; • if the result is formulated with coefficients Sym k−2 F l , then the weight k satisfies k ≤ l − 1. 2 It seems likely that the approach of [DT94b] can be adapted to the totally real case with similar conditions on l, as in Cheng's draft [Che] (which the author tells us is not complete), but this has not yet been carried out in full detail.
Our method of proof is entirely different, and requires no such conditions on l.On the other hand, we have to impose a more stringent condition on ρ m -rather than merely being irreducible, its image must contain the subgroup SL 2 (F l ).
Our starting point is that Ihara's Lemma is known (and easy) for the "Shimura sets" associated to definite quaternion algebras.Following a strategy introduced by Ribet in [Rib90a] we introduce an auxiliary prime q, at which both K and D are unramified.Then there is a totally definite quaternion algebra D ramified at the same finite places as D, together with q, and a compact open subgroup K q ⊂ (D ⊗ A F,f ) × agreeing with K at all places besides q and maximal at q.Our goal will then be to reduce the statement of Ihara's Lemma for X K at m to the corresponding (known) statement for the Shimura set Y K q corresponding to K q .
The link between X K and Y K q is given by the geometry of integral models of the Shimura curve X K0(q) , with Γ 0 (q)-level structure.Specifically, the special fibre of X K0(q) at q consists of two components, both of which are isomorphic to the special fibre of X K , and has singularities at a finite set of points which are in bijection with Y K q .This results in a filtration of H 1 (X K0(q) , F l ) whose graded pieces are two copies of H 0 (Y K q , F l ) and one copy of H 1 (X K , F l ) ⊕2 .This idea has been extensively studied by Mazur, Ribet [Rib90a], Jarvis [Jar99] and others.
Unfortunately, the existence of this filtration does not directly imply any relation between the Hecke module structures of H 1 (X K , F l ) and H 0 (Y K q , F l ).For example, the filtration could be split (in the sense that as Hecke modules) which would not impose any relations between H 1 (X K , F l ) and H 0 (Y K q , F l ).So in order to deduce anything about H 1 (X K , F l ) and H 0 (Y K q , F l ), 2 See the end of [DT94a] for k = l − 1.
we need to have additional information about the Hecke module structure of H 1 (X K0(q) , F l ) and its interaction with the filtration.
The novelty of this paper, then, is to obtain this extra information.It takes the form of a certain "flatness" statement, which we formulate and prove by using the Taylor-Wiles-Kisin patching method.To our knowledge, this is the first time that patching has been combined with the geometry of integral models in this way.
Briefly, the Taylor-Wiles-Kisin method considers a ring R ∞ , which is a power series ring over the completed tensor product of various local Galois deformation rings, and relates the Hecke modules H 1 (X K , F l ), H 0 (Y K q , F l ) and H 1 (X K0(q) , F l ) to certain maximal Cohen-Macaulay "patched" modules over R ∞ .Our method proves that the "patched" module corresponding to H 1 (X K0(q) , F l ) is flat3 over some specific local deformation ring at the prime q.Using this and some commutative algebra we are able to deduce Ihara's Lemma for X K from the corresponding result for Y K q .
Our strategy for proving this flatness is inspired by Taylor's "Ihara avoidance" argument, used in the proof of the Sato-Tate conjecture [Tay08].We impose the condition that our auxiliary prime q satisfies Nm(q) ≡ 1 (mod l), and consider a certain tamely ramified principal series deformation ring, R ps q = R ps ρ m |G Fq ,O , which is a quotient of the universal local deformation ring R q = R ρ m |G Fq ,O .The standard map4 from R q to the mod l Hecke algebra acting on H 1 (X K0(q) , F l ) then factors through the quotient R ps q , even though the map from R q to the integral Hecke algebra acting on H 1 (X K0(q) , Z l ) does not.
In our situation, the assumption on the image of ρ m allows us to choose the auxiliary prime q so that ρ m (Frob q ) = 1 1 0 1 .
In this case, the ring R ps q is a regular local ring5 (a calculation carried out in [Sho16]).This is what enables us to gain a foothold -it is a standard principle going back to Diamond [Dia97] that regular local deformation rings give rise to important structural results about Hecke modules.We apply a version of the miracle flatness criterion to prove that a particular patched module is flat over R ps q , which is the key fact needed to make our argument work.
The advantage of this argument, as opposed to that of [DT94b], is that we do not need to make any assumptions about the structure of the local deformation rings at primes dividing l, or indeed at any primes besides q, beyond knowing that they have the correct dimension (a fact which certainly holds in the generality we need).This is the reason we do not need to impose any of the restrictions on the prime l appearing in earlier results.
1.1.Applications.We briefly survey some of the applications of Ihara's Lemma (for modular or Shimura curves, or Shimura sets) that are in the literature.
where the limit runs over compact open subgroups K p ⊂ GL 2 (F p ). Then V is a smooth admissible representation of GL 2 (F p ). Suppose that m is a maximal ideal of the Hecke algebra acting on V .Then we have: a compact open subgroup, Ihara's Lemma is true for X K at m. Then the representation V m of GL 2 (F p ) has no one-dimensional subrepresentations.
Remark 1.3.If l = p then there is a notion of genericity for smooth representations of GL n (F p ) (see, for instance, [EH14]); when n = 2, the non-generic smooth irreducible representations are precisely the one-dimensional ones.It is this "no non-generic subrepresentations" property that conjecturally generalises to higher rank (see [CHT08]).
1.1.2.Freeness results.If T is the algebra of Hecke operators acting on H = H 1 (X K , O) m , including those at primes at which K ramifies, then we can ask whether H is free as a T-module.For modular curves results along these lines were proved by Mazur, Ribet and others (see, for instance, [Edi92] Theorem 9.2 and [CG18] Theorem 4.8).In the case of Shimura curves, there are results starting with [Rib90b].Note that it is not always the case that H is free; in many cases this can be explained by the geometry of local deformation rings, as in work of the first author [Man19].
In [Dia97] section 3.2, it is explained how the Taylor-Wiles method and a 'numerical criterion' may be used to prove freeness results at minimal and non-minimal level for modular curves (some limited freeness results for Shimura curves are also given in [Dia97] section 3.3).At non-minimal level, this relies crucially on Ihara's Lemma, and so using our result we can extend these freeness results.For instance, we have the following, in which Σ denotes the set of places where we are allowing non-minimal level.
Theorem 1.4.Let F be a totally real number field, D be a quaternion algebra over F ramified at exactly one infinite place, Σ a finite set of finite places of F , and l > 2 be a prime. Let , and let T K be the Hecke algebra acting on H generated by the T v and S v for v ∤ l at which K v is maximal compact and D is split, and the U v for each v ∈ Σ.
Let m be a maximal ideal of T K containing l. Suppose that the Galois representation ρ attached to m has non-exceptional image, and that the following conditions hold.
(1) For all finite places v | l of F , F v /Q l is unramified and D is split at v.
(2) For all finite places v ∈ Σ not dividing l, D is split and ρ is unramified at v. (3) For all finite places v ∤ l of F , ρ| GF v has minimal Artin conductor n v among all its twists by characters of G Fv .(4) For all finite places v ∤ l of F at which D splits, either: (5) For all finite places v of F at which D ramifies, K v is the group of units in a maximal order of D ⊗ F v , and if ρ is unramified at v then either: • Nm(v) ≡ ±1 (mod l); • Nm(v) ≡ 1 (mod l) and ρ(Frob v ) is not scalar; or • Nm(v) ≡ −1 (mod l), and tr(ρ(Frob v )) = 0. (6) If v ∤ l is a place of F at which D splits and Nm(v) ≡ −1 (mod l), then either ρ| GF v is reducible or ρ(I Fv ) has order divisible by l. (7) One of the following holds.
• (the Fontaine-Laffaille case) 2 The numbered conditions were chosen to ensure that all the relevant local deformation rings corresponding to forms of level K min are formally smooth.Thus the Taylor-Wiles method gives a result analogous to [Dia97] Theorem 3.1 at level K min .The result at level K now follows exactly as in the proof of [Dia97] Theorem 3.4, using Ihara's Lemma at each prime in Σ. See also [Tay06] Theorem 3.2 for a similar result in the definite case.
(1) In the 'Fontaine-Laffaille case', at least if (k − 1)[F : Q] ≤ l − 2, the version of Ihara's lemma required would presumably follow from the method of [DT94b], as in [Che], and so the condition on the image of ρ could be relaxed to a Taylor-Wiles hypothesis.In the 'ordinary case' we require Ihara's lemma at places of Σ dividing l, which is apparently not accessible by the method of [DT94b].
(2) Without a condition such as (5) where D ramifies, the module may genuinely not be free, see [Man19].
(3) Conditions (3) and (6) could probably be omitted, and the set Σ of nonminimal places could probably be allowed to contain places where ρ ramifies.(4) The requirement that the weights are parallel is for convenience.The restriction to the Fontaine-Laffaille range is not required for our version of Ihara's lemma, but is required to prove minimal freeness results using the method of [Dia97].Nevertheless, in other situations where the multiplicity at minimal level can be determined (even if this multiplicity is not one), it seems plausible that Ihara's Lemma could be used to deduce information about the multiplicity at non-minimal levels.[CH15] and Wang [Wan15], and our work may be able to weaken some of their hypotheses.
1.1.5.Level raising.The works [Rib84] and [DT94b] apply Ihara's Lemma to the problem of level-raising for modular forms -that is, of determining at which non-minimal levels there is a newform with a given residual Galois representation.Nowadays, there is an argument of Gee [Gee11] using the Taylor-Wiles-Kisin method and a lifting technique of Khare-Wintenberger.Combined with the results of [GLS15] and of [BLGGT14], this gives (under a Taylor-Wiles hypothesis) level raising theorems for Hilbert modular forms in arbitrary weight.We thank Toby Gee for explaining this point to us.Since we also require the Taylor-Wiles hypothesis, it is unlikely that our theorem gives substantial new level raising results.
1.2.Outline of the paper.In section 2 we recall the definitions of Shimura curves and Hecke operators.We also define the Shimura sets we will need, and recall the necessary results on integral models.Most of section 3 is taken up with the calculation of local deformation rings at the auxiliary prime q.We also precisely define lattices in certain inertial types (representations of GL 2 (O F,q )).
Section 4 carries out the Taylor-Wiles-Kisin patching method.We use the formalism of patching functors, introduced in [EGS15].This is mostly standard, and we include it because we don't know a reference for the fact that the filtrations of homology coming from integral models may be patched.
Section 5 contains calculations in commutative algebra over the local deformation rings at q that are at the technical heart of the proof.
Section 6 contains the precise statement and proof of our theorem.
A sensible order to read this article in would be to skim section 2, to fix notation, and then turn to section 6, referring back to the other sections as needed.
1.3.Acknowledgments.Firstly, we thank Matthew Emerton for suggesting that we collaborate on this project and for many enlightening conversations.We also thank Chuangxun Cheng, Fred Diamond, Toby Gee, Yongquan Hu, David Loeffler, Matteo Longo, and Matteo Tamiozzo for useful comments or discussions.Part of this work was written up while the second author was at the Max Planck Institute for Mathematics, and he thanks them for their support.
1.4.Notation.If k is a local or global field, then G k will denote its absolute Galois group.If l is a prime distinct from the characteristic of k, then we write ǫ : G k → Z l for the l-adic cyclotomic character and ǫ for its reduction modulo l.
If l is a prime and M is a Z l -module, then we write M ∨ for its Pontrjagin dual.If M is a finite free Z l -module (resp.an F l -vector space, resp.a Q l -vector space), then we write M * = Hom Z l (M, Z l ) (resp.Hom F l (M, F l ), resp.Hom Q l (M, Q l )).

Shimura curves
2.1.Let F be a totally real number field of degree d and let O F be the ring of integers of F .We write A F,f for the finite adeles of F .If v is a place of F then we write k v for its residue field, ̟ v for a fixed choice of uniformizer in F v , and for the finite adeles of F with the factor F v dropped.If l is a rational prime then we write Σ l for the set of places of F above l; we write Σ ∞ for the set of infinite places of F .2.2.Let D be a quaternion division algebra over F split at either no infinite places (the definite case) or exactly one infinite place, τ (the indefinite case), and let O D be a maximal order in D. We write ∆ for the set of finite places of F at which D ramifies.We assume that if F = Q and we are in the indefinite case then ∆ is nonempty.
We write G for the algebraic group over O F associated to O × D , and Z for its centre.
For every place v at which D splits we fix an isomorphism ).We also denote by κ v the various isomorphisms, such as 2.3.We fix a rational prime l and a finite place p of F such that p ∈ ∆; we do allow the possibility that p | l.

Let K be a compact open subgroup of G(A F,f
).If v is a finite place of F then when it is possible to do so we will write ) for some K v , and that it is ramified otherwise.We let If v ∈ ∆ is a finite place of F , and n ≥ 1, then we define U 0 (v n ) to be the subgroup of G(O F,v ), and If K is unramified at v then we write 2.5.Suppose that we are in the indefinite case.Letting H = C \ R be acted on by GL 2 (R) in the usual way, via κ τ we get an action of G(F τ ) ∼ = GL 2 (R) on H.We say that K is sufficiently small if the action of G(F ) ∩ gKg −1 /Z(F ) ∩ gKg −1 on H is free for every g ∈ G(A F,f ).We will assume throughout that all our compact open subgroups are sufficiently small.We let a compact Riemann surface.By the theory of Shimura varieties, there is a smooth projective curve X K over F such that, when F is considered as a subfield of C via τ , the C-points of X K are given by the above formula.For F a sheaf of abelian groups on X K (C) we write ) are compact open subgroups then there is a map The maps ρ g define a right action of G(A F,f ) on the inverse system (X K ) K ; if g −1 Kg ⊂ K ′ then we will also write ρ g for the composite map 2.7.Let M be an abelian group.Suppose that K 1 , K 2 ⊂ G(A F,f ) are sufficiently small and that g ∈ G(A F,f ).Then, as in [BDJ10] section 4, there are double coset operators ∪ Σ ∞ then we define the Hecke operators T v and S v to be the double coset operators If A is a ring and S is a finite set of places containing ∆ ∪ Σ ∞ then we write a polynomial ring in infinitely many variables which acts on H i (X K , M ) for any K for which Σ(K) ⊂ S and any A-module M .If v ∈ ∆, then we define the Hecke operator U v to be the double coset operator 2.8.Now suppose that we are in the definite case.A compact open subgroup K ⊂ G(A F,f ) is sufficiently small if, for every g ∈ G(A F,f ), we have Again, we will always assume that our compact open subgroups are sufficiently small.We define )/K which is a finite set.Exactly as in the indefinite case, we define an action of G(A F,f ) on the inverse system (Y K ) K , and actions of double coset operators [K 1 gK 2 ] and Hecke operators T v , S v and U v on the groups H 0 (Y K , M ), for any abelian group M .In particular, we obtain an action of T S A on H 0 (Y K , M ) for any finite set of places S containing Σ(K), ring A, and A-module M .
2.9.Suppose that we are in the definite or indefinite case, and that A is a finite Z l -algebra, so that the residue field of any maximal ideal of A is a finite extension of A then there is an associated semisimple representation

absolutely irreducible, and Eisenstein otherwise. A T S
A -module is Eisenstein if every maximal ideal in its support is Eisenstein.
It is non-exceptional if ρ m (G F ) contains a subgroup of GL 2 (F l ) conjugate to SL 2 (F l ); equivalently if it is non-Eisenstein and the image of ρ m contains an element of order l.Otherwise, it is exceptional.
Proposition 2.3.Suppose that we are in the indefinite case.The T S A -modules H 0 (X K , A) and H 2 (X K , A) are Eisenstein.
Proof.Let ν : G → G m,F be the reduced norm.There is (see [Car86] where we write [g] for the basis element of A on H 0 (X K , A) is Eisenstein.
The statement for H 2 follows from Poincaré duality for the adjoints of T v and S v .2.10.Let A be a finite Z l -algebra.There is an exact functor M → L M from the category of A[K]-modules on which K ∩ Z(F ) acts trivially, to the category of local systems of A-modules on X K (C) or Y K .If S is a finite set of places of F containing Σ(K)∪Σ l ∪∆∪Σ ∞ , and such that the action of K on M factors through v∈S K v , then we obtain an action of the Hecke algebra T S A on each cohomology group Proposition 2.4.Suppose that we are in the indefinite case.For any A, M and S as above, the Proof.This is proved just as in Proposition 2.3.2.11.Suppose that K is unramified at p. Let ω = ̟ p 0 0 1 .Then since ωK 0 (p)ω −1 ⊂ K, we have two degeneracy maps π 1 , π 2 defined (in the notation of 2.6) by (with similar formulae in the definite case).If A is an abelian group then we obtain maps , A) with, again, similar formulae in the definite case.We write and S are as in 2.10 and if p ∈ Σ(K) ∪ Σ ∞ is such that the action of K on M factors through K p , then we can similarly define , L M ) (and analogous maps in the definite case).
2.12.Define the finite abelian (class) group Γ K by It acts freely on X K and Y K by our assumption that K is sufficiently small.Suppose that A is a finite Z l -algebra and that ψ is a character ), so that we may consider ψ as a character of Γ K .For M any A for the largest submodule of M on which Γ K acts as ψ and M ψ for the largest quotient module of M on which Γ K acts as ψ.
Lemma 2.5.Let A be as above, and let m be a non-Eisenstein maximal ideal of Proof.In the indefinite case, we use the Hochschild-Serre sequence and fact that m is non-Eisenstein.Let V be an A[Γ K ]-module and let L ∨ V be the local system on X K /Γ K associated to V ∨ .The action of the Hecke operators away from ramified primes descends to an action on is Eisenstein by Proposition 2.4, and the same is true for and the latter is an exact functor of V as m is non-Eisenstein.In the definite case the proof is similar but easier (and the assumption on m is not actually necessary).
2.13.For the rest of this section we suppose that we are in the indefinite case, and fix a finite place q ∈ ∆ ∪ Σ l of F , let O (q) be the localization of O F at q, let k be the residue field of q, and let k be an algebraic closure of k.By a model of X K we will mean a proper flat O (q) -scheme X K equipped with an isomorphism X K ⊗ O (q) F ∼ − → X K .We will consider K that are (sufficiently small and) of the form K q GL 2 (O F,q ) or K q U 0 (q).For such K, there are models X K of X K constructed by Morita [Mor81] (in the first case) and by Jarvis [Jar99], following Carayol [Car86] (in the second).They have the following properties: Theorem 2.6.Suppose that K is unramified at q.
(1) The curve X K is smooth over O (q) .
(2) The curve X K0(q) is regular and X K0(q) ⊗ O (q) k is the union of two curves, each isomorphic to X K ⊗ O (q) k, that intersect transversely at a finite set of points.
Remark 2.7.We will use implicitly the functoriality of these models.For instance, if K ⊂ K ′ are as above then the morphism X K → X K ′ extends uniquely to a finite flat morphism between the models.If K q is fixed, then the action of G(A q F,f ) on the inverse system (X K q Kq ) K q extends uniquely to the inverse system of models.This action is compatible with varying K q , and with the maps 2.14.Suppose that K is unramified at q. Definition 2.8.The set of points where the two components of X K0(q) ⊗k intersect maps injectively to X K ⊗ k under the natural map X K0(q) → X K .The image is a finite set of points called the supersingular points and is denoted X ss K .
There is an adelic description of this set that we now explain.Let D be a quaternion algebra over F ramified at ∆ ∪ {q, τ } and let G be the algebraic group over F associated to D × .We fix a continuous isomorphism q be the unique maximal order of D ⊗ F F q .Then we write Remark 2.9.It follows from the Jacquet-Langlands correspondence that, if K is unramified at q and m is in the support of H 0 (Y K q , A), then m is in the support of H 1 (X K0(q) , A).
2.15.Suppose that K is unramified at q and that F is a finite extension of F l .The geometry of X K0(q) and the theory of vanishing cycles allow us to relate H 1 (X K0(q) , F), H 1 (X K , F) and H 0 (Y K q , F).In the case at hand, this is worked out in [Jar99], sections 14-18.We recall the result in our notation: Theorem 2.11.Suppose that K is unramified at q. Let S be a finite set of places containing Σ(K) ∪ {q} ∪ Σ ∞ ∪ ∆ and let m be a non-Eisenstein maximal ideal of T S K .Then there is a filtration The filtration, and isomorphisms, are compatible with the transition morphisms for varying K q and with the action of the Hecke operators Proof.As mentioned, this is proved in [Jar99]: we give references to that paper.The key diagram is that at the end of section 14, which relates Heckemodules X(H), Y (H), X(H), Ỹ (H), M (H), and R(H).In particular, there is a filtration of M (H) with graded pieces X(H), R(H), and Ỹ (H).Choosing the group H in that paper appropriately, taking the sheaf there called F to be the constant sheaf F, and after localizing at m, we have that M (H) m is our [Jar99] Corollary 16.3).A choice of ordering of the irreducible components of each connected component of the special fibre of X K0(q) gives, by Theorem 2.10, an isomorphism between Y (H) m and H 0 (Y K q , F) m .By Proposition 2.3, or [Jar99] Lemma 18.1, we have Y (H) m ∼ = Ỹ (H) m .By [Jar99] Proposition 17.4 and Lemma 18.2, we have (Heckeequivariant) isomorphisms X(H) m ∼ = X(H) m ∼ = Y (H) m .The result follows.
It follows from Lemma 2.5 that we can take ψ-parts in the filtration of Theorem 2.11 to obtain a filtration of for any non-Eisenstein maximal ideal m of T S F .

Types and local deformation rings
For this section, let L be a local field of characteristic 0, with residue field k of order q.Let Γ be the absolute Galois group of L, I its inertia subgroup, and P its wild inertia subgroup.Let σ ∈ I be a lift of a topological generator of I/P , and let φ ∈ Γ be a lift of arithmetic Frobenius.Then we have the well-known relation φσφ −1 = σ q in Γ/P .By a coefficient system we will mean a triple (E, O, F) where: E/Q l be a finite extension, with ring of integers O, uniformizer ̟, and residue field F = O/̟.For now, we will take an arbitrary coefficient system; later we will impose further conditions on E/Q l .
Let C O (resp.C ∧ O ) be the category of Artinian (resp.complete Noetherian) local O-algebras with residue field F. We say that a functor F : The primary goal of this section is to introduce various deformation rings of ρ.Many treatments of this material assume that the coefficient ring O is sufficiently ramified.For our purposes, it will be necessary to precisely control the ramification of O, and so a little more care will be needed in certain parts.
Consider the (framed) deformation functor C O → Set defined on objects A by It is well-known that this functor is pro-representable by some R ρ,O ∈ C ∧ O .Furthermore, ρ admits a universal lift ρ : Γ → GL 2 (R ρ,O ).
For any continuous homomorphism, x : R ρ,O → E, we obtain a Galois repre- For any character ψ : ρ,O is the ring pro-representing the functor of lifts of ρ with determinant ψǫ −1 .
As l > 2, we have an isomorphism where R det(ρ),O is the universal deformation ring of the character det(ρ).
3.1.Deformation rings when l ∤ q.For this subsection, we assume that l ∤ q.
In this case, the O-algebras R ,ψ ρ,O and R ρ,O are flat of relative dimensions 3 and 4, respectively.The second statement follows from [Sho18] Theorem 2.5.The first statement follows from the second, the isomorphism (1), and the flatness of the deformation ring of a character (see for example [Sho17] Lemma 2.5).Shortly, we will analyse these rings in more detail in a particular case.
3.2.Deformation rings when l|q.Now assume that l|q, so that l is the residue characteristic of L. If L ′ /L is any finite extension, then by [Kis08] there is a quotient if and only if ρ x | G L ′ is semistable with parallel Hodge-Tate weights {0, 1}.For ψ a finite order character of Γ that factors through Gal(L ′ /L), there is a quotient on which we additionally impose the condition det(ρ) = ψǫ −1 .We have that Spec R ,ψ,L ′ -st 3.3.Deformation rings at the auxiliary prime q.In this subsection, we study the specific local deformation ring R q = R ρ m |F q ,O that will occur at the auxiliary prime q in our argument, and define and compute certain quotients of it.
We will now impose a hypothesis on our coefficient system: Under this hypothesis, we write W = W (F) be the ring of Witt vectors and let E 0 = W [1/l], so that E 0 is an unramified extension of Q l with residue field F. We fix ζ ∈ E 0 a primitive lth root of unity.We also let and note that this is a uniformizer of O.
Remark 3.2.The relation "q tr(φ) 2 = (q + 1) 2 det(φ)" should be thought of as saying that the eigenvalues of ρ(φ) are in the ratio q : 1, which is the case for all characteristic zero lifts of ρ for which the image of inertia is non-trivial and unipotent.
Remark 3.3.It is important for us that R ps ρ,O be defined over O and not just O[ζ].Fix an unramified character ψ : Γ → O × lifting the trivial character det(ρ)ǫ.Note that, on each of these quotients, we have that det(ρ ) is unramified, and so agrees with ψǫ −1 on I.For ? ∈ {N, nr, unip, ps}, we make the following definitions: ρ,O ⊗ O F. 3.4.We will need somewhat explicit descriptions of these rings, which were obtained in Proposition 5.8 of [Sho16] and its proof.Let We will choose more convenient coordinates.We may replace B by X = B 1+R , Q by T = tr(ρ (φ)) − 2, and S by δ = det(ρ (φ)) − 1.By this we mean that the natural map O is surjective, which follows from the formulae B = (1 + R)X, Q = T − P , and Then we may replace T by either or Y 2 = (tr ρ (φ)) 2 q − (q + 1) 2 det ρ (φ), by which we mean that the natural maps are surjections.This follows from the equation T = √ 4 + Y 1 + 4δ − 2 in the first case -where the square root is defined by a convergent Taylor series, as l > 2and a similar expression in the second.We have maps Then the maps α i descend to maps, also denoted α i , In the proofs of all of the following propositions we work without fixing determinants.For each ?∈ {N, nr, unip, ps} we already have that det(ρ ) is unramified on the quotient R ?O,ρ .This means that to get the fixed determinant versions in the statements, we simply quotient by δ − γ.
In particular, it is regular.
Proof.This follows from the proof of [Sho16] Proposition 5.8 part 2. The quantity denoted y in the proof of that proposition is here equal to 1.The variables X 1 , . . .X 5 in that proof are our variables X, Y 1 , P, R, 2P − T , but by the above remarks we can replace 2P − T with δ and obtain that α 1 defines an isomorphism The result with fixed determinant follows.
Proposition 3.6.The ring R unip,ψ In particular, these last two deformation rings are formally smooth.
Proof.This is not quite in [Sho16] Proposition 5.8, as the quotient R unip ρ,O is not considered there, but the method of proof extends easily -we will be brief.The proof shows that, if we write ] by the following equations: Here ⋆ denotes each of A, X, C, D, so that the third line is really four equations.Note that the third line can be rewritten as ⋆Y 2 = 0.The first, fourth and sixth lines show that A, C and D may be written in terms of X, T, S and U .Making these substitutions we see that this set of equations is equivalent to the single equation Proof.That the images of Y 1 and Y 2 are equal is immediate from q ≡ 1 (mod l).
Remark 3.8.In [Sho16] it is assumed that ζ ∈ O, which is not the case for ushowever, this assumption is not used (only the assumption that ζ + ζ −1 ∈ O, which is required to even define R ps O,ρ ).
Remark 3.9.The proofs above show that each of our deformation rings R ?
ρ,O turns out to be reduced and l-torsion free, and therefore is one of the fixed-type deformation rings defined by a Zariski closure operation in [Sho16].
3.5.Next we define various representations of GL 2 (O L ) over W (or extensions of W ). Let G = GL 2 (k) and B be its subgroup of upper triangular matrices.We will always regard representations of G as representations of GL 2 (O L ) by inflation.If A is a ring, then we will write ½ A for A with the trivial action of any group under consideration. Since splits, and so we define St W by the formula E1 is isomorphic to its conjugate under the nontrivial element of Gal(E 1 /E), which switches χ and χ −1 .It therefore has a model σ ps E over E, by the calculation of the Schur index of a character of a finite general linear group in [Gow81] Theorem 2a -see also Lemma 3.1.1 of [EGS15].By [EGS15] Lemma 4.1.1,there is a unique O-lattice σ ps O in σ ps E such that there is a nonsplit short exact sequence (4) If π(ρ)| GL2(OL) contains σ ps E , then x factors through R ps ρ,O .Now suppose that we are in the setting of section 3.2.Suppose that D L is a quaternion algebra over L and K is a compact open subgroup of D L .If π is an irreducible admissible representation of D L over E, then by the local Langlands and Jacquet-Langlands correspondences there is an associated Weil-Deligne representation (r π , N π ).We may and do choose a finite extension L K /L such that, for all π having a K-fixed vector, the restriction r π | GL K is unramified.It follows that, if π has a K-fixed vector and ρ : G L → GL 2 (E) is a de Rham representation of parallel Hodge-Tate weights {0, 1} such that W D(ρ) ss ∼ = (r π , N π ), then ρ| GL K is semistable and so corresponds to a point of R ,LK-st ρ,O .We write .
We will say that a lift ρ .

Patching
The goal of this section is to summarize the Taylor-Wiles-Kisin patching construction, and to prove the results about it that will be needed for the proof of Theorem 6.5.We choose a coefficient system (E, O, F), which we will eventually require to satisfy Hypothesis 3.1.4.1.Ultrapatching.In this section we summarize the commutative algebra behind the patching method.For convenience we will use the "ultrapatching" construction introduced by Scholze in [Sch18]; we follow closely the exposition of [Man19] section 4.
From now on, fix a nonprincipal ultrafilter F on the natural numbers N (it is well known that such an F must exist, provided we assume the axiom of choice).For convenience, we will say that a property P(n) holds for F-many i if there is some I ∈ F such that P(i) holds for all i ∈ I.
For any sequence of sets A = {A n } n≥1 , we define their ultraproduct to be the quotient If the A n 's are sets with an algebraic structure (eg.groups, rings, R-modules, R-algebras, etc.) then U(A ) naturally inherits the same structure.
If each A n is a finite set, and the cardinalities of the A n 's are bounded (this is the only situation we will consider in this paper), then U(A ) is also a finite set and there are bijections U(A ) ∼ − → A i for F-many i. Moreover if the A n 's are sets with an algebraic structure, such that there are only finitely many distinct isomorphism classes appearing in {A n } n≥1 (which happens automatically if the structure is defined by finitely many operations, eg.groups, rings or R-modules or R-algebras over a finite ring R) then these bijections may be taken to be isomorphisms.This is merely because our conditions imply that there is some A such that A ∼ = A i for F-many i and hence U(A ) is isomorphic to the "constant" ultraproduct U({A} n≥1 ) which is easily seen to be isomorphic to A if A is a finite set.
Lastly, in the case when each A n is a module over a finite local ring R, there is a simple algebraic description of U(A ).Specifically, the ring as R-modules.This shows that U(−) is a particularly well-behaved functor in our situation.In particular, it is exact.
For the rest of this section, fix a power series ring S ∞ = O[[z 1 , . . ., z d ]] and consider the ideal n = (z 1 , . . ., z d ).Fix a sequence of ideals I n ⊆ S ∞ such that for any open ideal a ⊆ S ∞ we have I n ⊆ a for all but finitely many n.Also define For any finitely generated S ∞ -module M , we will say that the S ∞ -rank of M , denoted by rank S∞ M , is the cardinality of a minimal generating set for M as an S ∞ -module.
We can now make our main definitions: Definition 4.1.Let M = {M n } n≥1 be a sequence of finitely generated S ∞modules with I n ⊆ Ann S∞ M n for all but finitely many n.
• We say that M is a weak patching system if the S ∞ -ranks of the M n 's are uniformly bounded.If we further have ̟M n = 0 for all but finitely many n, we say that M is a residual weak patching system • We say that M is a patching system if it is a weak patching system, and we have Ann S∞ (M n ) = I n for all but finitely many n.• We say that M is a residual patching system if it is a residual weak patching system, and we have Ann S∞ (M n ) = I n for all but finitely many n.• We say that M is MCM (resp.MCM residual) if M is a patching system (resp.residual patching system) and M n is free over S ∞ /I n (resp.S ∞ /I n ) for all but finitely many n.Furthermore, assume that R = {R n } n≥1 is a sequence of finite local S ∞ -algebras.
• We say that R = {R n } n≥1 is a (weak, residual) patching algebra, if it is a (weak, residual) patching system.• If M n is an R n -module (viewed as an S ∞ -module via the S ∞ -algebra structure on R n ) for all n we say that M = {M n } n≥1 is a (weak, residual) patching R-module if it is a (weak, residual) patching system.Let wP be the category of weak patching systems, with the obvious notion of morphism.Note that this is naturally an abelian category.Now for any weak-patching system M , we define its patched module to be the S ∞ -module where the inverse limit is taken over all open ideals of S ∞ .We may treat P is as functor from wP to the category of S ∞ -modules.
If R is a weak patching algebra and M is a weak patching R-module, then P(R) inherits a natural S ∞ -algebra structure, and P(M ) inherits a natural P(R)-module structure.
In the above definition, the ultraproduct essentially plays the role of the pigeonhole principal in the classical Taylor-Wiles-Kisin construction, with the simplification that it is not necessary to explicitly define a "patching datum" before making the construction.Indeed, if one were to define patching data for the M n /a's (essentially, imposing extra structure on each of the modules M n /a) then the machinery of ultraproducts would ensure that the patching data for U(M /a) would agree with that of M n /a for infinitely many n.It is thus easy to see that our definition agrees with the classical construction (cf.[Sch18]).
Thus the standard patching Lemmas (cf.[Kis09], Proposition 3.3.1)can be rephrased as follows: Proposition 4.2.Let R be a weak patching algebra, and let M be an MCM patching R-module.Then: (1) P(R) is a finite type S ∞ -algebra, and P(M ) is a finitely generated free S ∞ -module.
Proposition 4.3.Let R be a weak patching algebra, and let M be an MCM residual patching R-module.Then: (1) P(R)/(̟) is a finite type S ∞ -algebra, and P(M ) is a finitely generated free S ∞ -module.From the set up of Proposition 4.2 there is very little we can directly conclude about the ring P(R).However in practice one generally takes the rings R n to be quotients of a fixed ring R ∞ of the same dimension as S ∞ (and thus as P(R)).Thus we define a cover of a weak patching algebra R = {R n } n≥1 to be a pair (R ∞ , {ϕ n } n≥1 ), where R ∞ is a complete, topologically finitely generated O-algebra of Krull dimension dim S ∞ and ϕ n : R ∞ → R n is a surjective O-algebra homomorphism for each n.It is straightforward to show the following (cf.[Man19]) Proposition 4.5.If (R ∞ , {ϕ n }) is a cover of a weak patching algebra R, then the ϕ n 's induce a natural continuous surjection ϕ ∞ : R ∞ ։ P(R).
Combining this with Propositions 4.2 and 4.3 we get the following (using the fact [Sta17, Lemma 0AAD] that if f : A ։ B is a surjection of noetherian local rings, then a B-module M is Cohen-Macaulay as an A-module if and only if it is Cohen-Macaulay as a B-module): Corollary 4.6.Let R be a weak patching algebra and let (R ∞ , {ϕ n }) be a cover of R. If M is an MCM patching R-module, then P(M ) is a maximal Cohen-Macaulay R ∞ -module.If M is an MCM residual patching R-module, then P(M ) is a maximal Cohen-Macaulay R ∞ /(̟)-module.
In our arguments, it will be necessary to patch the filtration from Theorem 2.11.This would certainly be possible if P were an exact functor.However, this is not true in general 6 , but we can prove a weaker statement which suffices for our purposes: Lemma 4.7.The functor P(−) is right-exact.Moreover, if is an exact sequence of weak patching systems then 0 → P(A ) → P(B) → P(C ) → 0 is exact, provided that either: • C is MCM, or • A , B and C are all residual weak patching systems, and C is MCM residual.
Proof.Let Ab be the category of abelian groups.For any countable directed set I, let finAb I be the category of inverse systems of finite abelian groups indexed by I. Now note that any (A i , f ji : A j → A i ) ∈ finAb I clearly satisfies the Mittag-Leffler condition: For any i ∈ I there is a j ≥ i for which im(f ki ) = im(f ji ) for all k ≥ j (since A i is finite, and {im(f ji )} j≥i is a decreasing sequence of subgroups).Now assume that one of the further conditions of the lemma holds.Write A = {A n } n≥1 , B = {B n } n≥1 and C = {C n } n≥1 .Then letting I n = Ann S∞ C n (so that either I n = I n or I n for all n ≫ 0), we get that for all n ≫ 0, is an exact sequence of S ∞ /I n -modules, and C n is a free S ∞ /I n -module (this is true regardless of which case we are in).It follows that for all a ⊆ S ∞ , and so is exact for all n ≫ 0. The same argument as above now shows that 0 → P(A ) → P(B) → P(C ) → 0 is exact.This now implies that P preserves filtrations in the cases that will be relevant to us: Corollary 4.8.Let V be a residual weak patching system with a filtration Assume that the M k 's are all MCM residual.Then P(V ) has a filtration with P(V k )/P(V k−1 ) ∼ = P(M k ) for all k = 1, . . ., r.
One can also make an analogous statement about filtrations of weak patching systems, instead of residual weak patching systems, but we will not need that result.
Proof.For any k ≥ 1 we have an exact sequence As M k is MCM residual, Lemma 4.7 implies that the map P(V k−1 ) → P(V k ) is an inclusion, and that P(V k )/P(V k−1 ) ∼ = P(M k ).The result follows.

Global deformation rings. We fix the following data:
• a quaternion division algebra D over F split at exactly one infinite place, as in section 2; • a coefficient system (E, O, F) satisfying Hypothesis 3.1; • a non-Eisenstein maximal ideal m ⊆ T S O (for some set S, which we will not fix yet) which is G-automorphic; • a finite order character ψ : G F → O × for which ψ ≡ det ρǫ (mod ̟).We also write ψ for the character ψ • Art, where Art : Enlarging F if necessary, we assume that the residue field of m is F. By definition, m is G-automorphic of some level K m ⊂ G(A F,f ), which we fix temporarily.Now we fix, for the rest of this section: • a finite place q ∈ Σ l ∪ Σ(K m ) of F at which ρ is unramified; • a finite set Σ of finite places of F that contains Σ l ∪ {q} ∪ Σ(K m ) (which means that we can, and will, regard m as a maximal ideal of T Σ O rather than T S O ); ).We will use S to denote a finite set of places of F .In the following, S and K will sometimes vary but we will always impose the following hypotheses on the pair (S, K): Hypotheses 4.9.
• m is G-automorphic of level K; and note that ρ is absolutely irreducible and unramified outside of S. For any place v of F , let ρ v = ρ| GF v .By taking a quadratic extension of F if necessary, we will assume that for each g ∈ G F , all of the eigenvalues of ρ(g) lie in F × .
As in [Kis09, section 3.2], define R F,S (ρ) ∈ C ∧ O to be the O-algebra pro-representing the functor D F,S (ρ) : C O → Set which sends A to the set of equivalence classes of tuples where: ) (we think of this as basis for A 2 lifting the standard basis of F 2 ); : C O → Set be the subfunctor of D F,S (ρ) consisting of the tuples (ρ, (β v ) v∈Σ ) with det ρ = ψǫ −1 , and let R ,ψ F,S (ρ) ∈ C ∧ O be the O-algebra pro-representing D ,ψ F,S (ρ).Also define the unframed deformation ring R F,S (ρ) to be the O-algebra prorepresenting the functor C O → Set which sends A to the set of equivalence classes of lifts ρ : G F,S → GL 2 (A) such that ρ| GF v is K 0 v -semistable for all v | l, two such lifts being equivalent if they are conjugate by an element of 1 + M 2 (m A ). Finally, define R ψ F,S (ρ) to be the quotient of R F,S (ρ) on which det ρ(g) = ψ(g) for all g ∈ G F,S .The unframed deformation rings R F,S (ρ) and R ψ F,S (ρ) exist because ρ is absolutely irreducible.We will let ρ univ S : G F,S → GL 2 (R F,S (ρ)) be a representative for the universal equivalence class of lifts of ρ, which induces a homomorphism ρ univ S,ψ : , which by [Kis09,(3.4.11)] is formally smooth of dimension j = 4|Σ| − 1, and so we may identify The Taylor-Wiles-Kisin patching construction relies on carefully picking sets of auxiliary primes to add to the level, using the following lemma (see [Kis09] Proposition 3.2.5).
(2) If l = 5 and the image of the projective representation proj ρ m : . (This condition holds automatically whenever √ 5 ∈ F .) Suppose that S = Σ ∪ Σ ∞ .Then there exist integers r, g ≥ 0 such that for each n ≥ 1, there is a finite set Q n of primes of F for which: F,S∪Qn (ρ).Moreover, we have dim R loc = r + j − g + 1.
From now on, fix integers r, g and a sequence Q = {Q n } n≥1 of sets of primes satisfying the conclusions of Lemma 4.10.Define 4.3.Patched modules over Shimura curves and sets.As before, we use S to denote a finite set of places of F containing Σ ∪ Σ ∞ , and K to denote a compact open subgroup of G(A F,f ), such that S and K satisfy Hypotheses 4.9.In particular, there is a maximal ideal ).Then T(K, S) is a finite rank free O-algebra which is local with maximal ideal m.Note that T(K, S) depends on the choices of m and ψ but we suppress these from the notation.
As in section 6 of [EGS15] we have the following: Lemma 4.11.For any compact open K and set S as above, there exists a natural surjection R ψ F,S (ρ) ։ T(K, S) with the property that ρ univ S,ψ (tr(Frob v )) → T v and ρ univ S,ψ (det(Frob v )) → Nm(v)S v for any v ∈ S.These maps are compatible with the restriction maps T(K ′ , S ′ ) → T(K, S) for K ′ ⊆ K and S ⊂ S ′ .
If S ⊂ S ′ are sets as above, then by Lemma 4.11 and the definitions we have a where the left hand vertical map and the horizontal maps are surjections.It follows that the right hand vertical map, injective by definition, is an isomorphism.We therefore drop S from the notation and write for any K and S satisfying Hypotheses 4.9.
These Hecke algebras also act on the spaces H 0 (Y K q , O) m [ψ], by the following lemma.
Lemma 4.12.For any compact open K and set S as above such that K is unramified at q, the map is torsion-free, we may check this after inverting l.It is then a consequence of the Jacquet-Langlands correspondence and the semisimplicity of H 0 (Y K q , O) m [ψ] as a module over T S O,m .We now fix S to be the union of Σ ∪ Σ ∞ , and let Q = {Q n } n≥1 be the sequence of sets of places provided by Lemma 4.10.For any n ≥ 1, let ∆ n be the maximal l-power quotient of v∈Qn k × v .Consider the ring Λ n = O[∆ n ], and note that: . ., y r ]] (1 + y 1 ) l e(n,1) − 1, . . ., (1 + y r ) l e(n,r) − 1 where l e(n,i) is the l-part of Nm(v) − 1 = #k × v , so that e(n, i) ≥ n by assumption.Let a n = (y 1 , . . ., y r ) ⊆ Λ n be the augmentation ideal.Also define y l e(n,1) 1 , . . ., y l e(n,r) r Now let Finally, for any K (satisfying 4.9 for the set S), let K n be the preimage of We also let K 0 = K, and remark that for n ≥ 1, K n and S ∪ Q n satisfy 4.9; in particular, K n = K q n K q .For any n ≥ 0, let T n,K = T Kn .Now for any n ≥ 1 consider the O-algebra eigenvalue for ρ(Frob v ) (recall that by assumption, for each v ∈ Q n ρ(Frob v ) has two distinct eigenvalues in F × , and so there are 2 |Qn| ways to pick the system (α v ) v∈Qn ).Now define the ideal . Also define T 0,K = T 0,K and m 0 = m.
As in [Tay06, section 2] we have: Lemma 4.13.The ring T n,K is a finite T n,K -algebra and m n is a maximal ideal of it lying over m.The composite map is surjective.Moreover, there exist O-algebra maps Λ n → R n and Λ n → T n,K making the above map a surjection of Λ n -algebras.
By definition, . So now for any n ≥ 0 we can define and The reason for dualizing is that the patching argument works more naturally with homology rather than cohomology.
Note that M n,K and M n,K are naturally T n,K -modules and, if K is unramified at q, then N n,K q and N n,K q are naturally T n,K0(q) -modules by Lemma 4.12.In particular we may regard them all as R n -modules.
We now have the following result, a standard ingredient in the patching argument (see for instance [Kis09], [BD14], and [EGS15]): Proposition 4.14.For any n ≥ 1 and any K, the map Λ n → R n from Lemma 4.13 makes M n,K and N n,K q into finite rank free Λ n -modules.In particular, the maps Λ n → R n and Λ n → T n,K are injective.Moreover, the natural maps define an isomorphism R n /a n ∼ = R 0 and isomorphisms M n,K /a n ∼ = M 0,K and N n,K q /a n ∼ = N 0,K q of R 0 -modules.
Similarly M n,K and N n,K q are finite rank free Λ n -modules and we have M n,K /a n ∼ = M 0,K and N n,K q /a n ∼ = N 0,K q .
In particular, rank Λn R n = rank O R 0 , and rank Λn N n,K q = rank Λn N n,K q = rank F N 0,K q for all n ≥ 1, and so these ranks are independent of n.

Note that:
Lemma 4.15.For any open ideal a ⊆ S ∞ , we have I n ⊆ a for all but finitely many n.
Proof.As S ∞ /a is finite, and the group 1 + m S∞ is pro-l, the group (1 + m S∞ )/a = im(1 + m S∞ ֒→ S ∞ ։ S ∞ /a) is a finite l-group.Since 1 + y i ∈ 1 + m S∞ for all i, there is an integer k ≥ 0 such that (1 + y i ) ℓ k ≡ 1 (mod a) for all i = 1, . . ., r.Then for any n ≥ k, e(n, i) ≥ n ≥ k for all i, and so indeed I n ⊆ a by definition.
Thus we may apply the results of section 4.1 with this ring S ∞ and these ideals I n .Note that dim S ∞ = 1 + r + j = dim R ∞ .Let n = (y 1 , . . ., y r , w 1 , . . ., w j ) ⊆ S ∞ , and identify Λ n with S ∞ /I n via the above isomorphism.
Tensoring everything in Proposition 4.14 with Λ n , we get that M n,K is free of rank rank O M 0,K over Λ n for all n with M n,K /n ∼ = M n,K /a n ∼ = M 0,K .Similar statements hold for M n,K , N n,K q , and N n,K q .
Summarizing the results of this section in the language of section 4.1, we have: Proposition 4.16.The sequence R = {R n } n≥1 is a patching algebra and R ∞ is a cover of R .The sequences are MCM patching R -modules, and the sequences are MCM residual patching R -modules.For all n ≥ 1 we have R n /n ∼ = R 0 and M n,K /n ∼ = M 0,K , M n,K /n ∼ = M 0,K , N n,K q /n ∼ = N 0,K q and N n,K q /n ∼ = N 0,K q as R 0 -modules.
We note that where the direct limit is taken over all compact open subgroups K q ⊆ G(O F,q ).Note that this carries a continuous action of G(O F,q ) ∼ = GL 2 (O F,q ).As the action of T S m on H 1 (X K q Kq , O) m [ψ] factors through T K q Kq , the action of T S m on Π K q factors through Note that by Lemma 4.11 we have natural surjections R ψ F,S (ρ) ։ T K q Kq for all K q , and so we have a surjection R ψ F,S (ρ) ։ T K q n .Now following [EGS15], let C be the category of finitely generated O-modules with a continuous action of G(O F,q ).Let ψ = (det ρ| Iq ǫ)•Art : O × F,q → F × be the character corresponding to det ρ| Iq : F,q and let C Z be the subcategory of C consisting of those σ ∈ C possessing a central character which lifts ψ and agrees with ψ on I q (in other words, is unramified).Also let C fin Z be the subcategory of finite length objects of C Z .
Remark 4.18.In [EGS15], the condition that the central character of σ agrees with ψ is not imposed; this necessitates a 'twisting' argument.We only need to patch σ with unramified central character, so we avoid this technicality.Now for any σ ∈ C Z and any n ≥ 0, define For any σ, this is a T K q n -module, and hence an R n Thus we may define the R n -module: Now as in section 6 of [EGS15], if σ ∈ C fin Z , M K q (σ) = {M n,K q (σ)} n≥1 is a weak patching R -module and thus we may define M ∞,K q (σ) = P(M K q (σ)).We can extend this definition to all of C Z by setting This definition agrees with the "patching functor" constructed in section 6.4 of [EGS15], up to a technicality: the construction in [EGS15] factors out the Galois representation in the indefinite case, whereas we have not done so.In the notation of [EGS15] the module M ∞,K q (σ) we have constructed is ρ(σ) m .However, this is simply isomorphic to M ∞ (σ) ⊕2 as a T(σ) m -module (again in the notation of [EGS15]) and so this does not present an issue.We therefore have: ). M ∞,K q (σ) satisfies the following properties: (1) The functor σ → M ∞,K q (σ), from C Z to the category of finitely generated R ∞ -modules, is exact.
From now on assume that q satisfies the assumptions of section 3.3.That is, Nm(q) ≡ 1 (mod l), ρ is unramified at q and ρ(Frob q ) = 1 1 0 1 .Thus the computations of section 3.3 will apply to R q .Under the map R q ֒→ R loc ֒→ R ∞ , we may view any R ∞ -module as being a R q -module.
In addition to the results listed in Theorem 4.19, [EGS15] also describes the supports of ∞,K q (σ) as R q -modules, for certain σ's corresponding to inertial types of F q .In order to avoid having to give a formal treatment of inertial types, we will simply state their results for the specific modules σ = ½ A , St A and σ ps A , for A = O, F, defined in section 3.5 (noting that we have assumed that ) is supported on R ps q (resp.R ps q ).Proof.Follows from Proposition 3.10 and the fact that M ∞,K q (−) is a patching functor in the sense of [EGS15].
We also record the support of the modules N ∞,K q and N ∞,K q from section 4.3 here.
Proposition 4.21.As R q -modules, N ∞,K q is supported on R N q and N ∞,K q is supported on R By the definition of N ∞,K q it suffices to prove that, for any n ≥ 1, the map factors through R q ։ R N q .We will prove this using Proposition 3.10.Let T N n,K be the image of . ., w j ]]; thus γ n defines a map R q → T N, n,K .Since T N n,K is reduced and l-torsion free, it suffices to show that, for every O-algebra homomorphism x : T N, n,K → E, the composition x • γ n factors through R N q .To x we have an associated homomorphism In particular, the isomorphism class of ρ x is the Galois representation associated to x| Tn,K .
The composition x • γ n is the homomorphism R q → E corresponding to ρ x | GF q .By local-global compatibility and properties of the Jacquet-Langlands correspondence, ρ| GF q is an inertially unipotent representation corresponding to a discrete series representation under the local Langlands correspondence.It follows that ρ| IF q is a non-trivial unipotent representation, and therefore that x • γ n : R q → E factors through R q ։ R N q by Proposition 3.10.The result follows.We finish this section by relating the patching functors of this section to the patched modules M ∞,K considered in section 4.3.Proposition 4.22.For any compact open subgroup K q ⊆ G(O F,q ) we have In particular, letting Proof.By the fact that m is non-Eisenstein, we have It follows that M n,K q Ind G(OF,q) Kq ½ F ∼ = M n,K q Kq and so The last two statements follow from Ind G(OF,q) G(OF,q) ½ F = ½ F and Ind G(OF,q) U0(q) Corollary 4.23.The R ∞ -module Proof.By Proposition 4.22 this is just a rephrasing of Theorem 4.17.

Commutative algebra lemmas
The following is a mild generalisation of the "miracle flatness criterion", for which see [Mat89] Theorem 23.1 or [Sta17, Lemma 00R4].A similar generalisation, in the setting of noncommutative completed group rings, also appears in [GN16].
Lemma 5.1.Let A → R be a local homomorphism of noetherian local rings, and let M be a finite R-module.Let m be the maximal ideal of A. Suppose that: (1) A is regular; (2) (Y ) ⊂ ann B (N ) and N is flat over B/(Y ); (3) there is an isomorphism of R-modules L ∼ − → M/XM ; (4) there is an isomorphism of R-modules α : (5) there is a filtration 0 ⊂ P 1 ⊂ P 2 ⊂ P by R-modules and isomorphisms of R-modules P 1 ∼ − → N , P 2 /P 1 ∼ − → L ⊕ L, and P/P 2 ∼ − → N .Then there is a short exact sequence of R-modules Proof.Since L is flat over B/X by points (1) and (3), it has no Y -torsion, and so α induces an isomorphism P From the other short exact sequence 0 → P 2 → P → N → 0 of point (5), we get an exact sequence Finally, since M is flat over B there is an isomorphism M/Y M ∼ − → XM .We get the desired short exact sequence:

Ihara's lemma
Let D be a quaternion division algebra over F ramified at exactly one infinite place, so that we are in the indefinite case of section 2. Suppose that p is a finite place of F at which D is unramified.6.1.Statements.Let K ⊆ G(A F,f ) be unramified at p and sufficiently small, and let S be any finite set of finite places of F containing Σ(K) ∪ Σ l ∪ {p} ∪ Σ ∞ .There are two natural degeneracy maps π 1 , π 2 : X K0(p) → X K , defined in section 2.11.Conjecture 6.1.Suppose that Λ is the local system on X K attached to a finitedimensional continuous F l -representation of K p .Then for any non-Eisenstein maximal ideal m of T S Z l the map For Λ the constant sheaf F l , this becomes: Conjecture 6.2.For any non-Eisenstein maximal ideal m of T S Z l , the map π We also have an equivalent dualized version: Conjecture 6.3.For any non-Eisenstein maximal ideal m of T S Z l , the map (π 1, * , π 2, * ) : Lemma 6.4.Conjecture 6.2 (or, equivalently, Conjecture 6.3) for all K implies Conjecture 6.1 for all K.
Proof.Suppose that Conjecture 6.2 holds for all K. Suppose that Λ and m are as in the statement of Conjecture 6.1, and that Λ is associated to a representation V of K p .Let H p ⊂ K p be an open subgroup that acts trivially on V , and H = H p K p .Let f : X H → X K be the projection.The Hochschild-Serre spectral sequence provides a (Hecke-equivariant) exact sequence 0 → H 1 (K/H, H 0 (X H , f * Λ)) → H 1 (X K , Λ) → H 0 (K/H, H 1 (X H , f * Λ)).
After localizing at m, the first term vanishes by Lemma 2.3.Noting that f * Λ is constant, we get an inclusion that commutes with the maps π * .Since Conjecture 6.2 holds for the subgroup H by assumption, we deduce Conjecture 6.1 for the subgroup K.
Our main result is the following: Theorem 6.5.Conjectures 6.1, 6.2 and 6.3 are true for any non-Eisenstein maximal ideal m of T S Z l satisfying the conditions: (1) l|#ρ m (G F ).That is, m is not exceptional.The reason for including the stronger assumption that m is not exceptional, instead of just the usual Taylor-Wiles conditions, is that this assumption will be necessary for picking the auxiliary prime q.See Lemma 6.9 below.Remark 6.7.We have assumed that K is sufficiently small, for convenience.This assumption could be removed by the standard device of introducing auxiliary level structure at a place q 0 at which there are no congruences, as in [Man19]  For the rest of the proof we fix such a prime q.Note that it satisfies the requirements of sections 2.13 and 3.3.We let D be a definite quaternion algebra ramified at ∆ ∪ {q, τ }.
6.4.The proof.Choose F large enough that ρ m is defined over F, and let (E, O, F) be the coefficient system satisfying Hypothesis 3.1.Let ψ : G F → O × be a finite order character lifting det(ρ m )ǫ, and also write ψ for the character ψ • Art F of A × F,f /F × .We make sure that F × (K ∩ Z(A F,f )) ⊂ ker(ψ) and that the prime q is chosen so that ψ is unramified at q.
Let S be as in section 6.1.Enlarging S if necessary (which is allowed, by Lemma 4.11), we assume that q ∈ S. We write Σ for the set of finite places in S. The results of section 2 imply that there is a filtration of H 1 (X K0(q) , F) m [ψ] (by T S -submodules) whose graded pieces are In section 4 we explain how these cohomology groups and this filtration (more precisely, their duals) may be 'patched' using the Taylor-Wiles method.For each place v ∈ Σ let R v be • if v ∤ l, the universal fixed determinant framed deformation ring R ,ψ , and recall that d and g were chosen so that R ∞ and S ∞ have the same dimension.
Then in section 4.4 we constructed an injective homomorphism S ∞ → R ∞ , maximal Cohen-Macaulay R ∞ -modules M ∞,K and N ∞,K q , and an exact functor M ∞,K q from the category of finitely-generated O-modules with a continuous action of GL 2 (O F,q ) (satisfying a condition on the central character) to the category of finitely-generated R ∞ -modules.Moreover, M ∞,K q has the property that if σ is a finite free O-module (resp.a finite dimensional F-vector space) then M ∞,K q (σ) is maximal Cohen-Macaulay over R ∞ (resp.R ∞ = R ∞ ⊗ O F).These are equipped with isomorphisms M ∞,K ⊗ S∞ F ∼ = H 1 (X K , F) m,ψ −1 and N ∞,K q ⊗ S∞ F ∼ = H 0 (Y K q , F) m,ψ −1 .In Table 1, for various patched modules, we write down a corresponding quotient R ?q of R q on which they are supported.Here ? is an element of {nr, N, unip, ps}, and we write R ?q = R ?,ψ ρ|G Fq ,O and R ?q = R ?q ⊗ O F, Table 1.Supports of patched modules.
Proposition 6.11.The module M ∞,K (St F ) is flat over R unip q and there is an isomorphism Proof.By Proposition 6.10 and the above exact sequence, the hypotheses of Lemma 5.2 apply with R = R unip ∞ ⊗ O F (made into an F[[X, Y ]]/(X 2 Y )-algebra in the evident way), L = M ∞,K q (½ F ), M = M ∞,K q (σ ps F ), and N = M ∞,K q (St F ).The proposition follows.Now we know that M ∞,K q (St F ) is flat, the filtration (⋆) can be to "transfer information" between N ∞ and M ∞ .More precisely, we have: Proposition 6.12.There is a short exact sequence of R ∞ -modules Proof.By Proposition 6.11 and the filtration (⋆), the hypotheses of Lemma 5.3 apply with R = R ps ∞ ⊗ O F (made into an F[[X, Y ]]/(XY )-algebra in the evident way), L = M ∞,K q (½ F ), M = M ∞,K q (St F ), P = M ∞,K0(q) , N = N ∞,K q , and P 1 and P 2 given by (⋆).The proposition follows.
Proof of Theorem 6.5: Now we are ready to prove our main result.We may carry out the constructions and arguments above equally well with K q replaced by K 0 (p) q in a way compatible with the degeneracy maps π * .We therefore obtain a commut- By Theorem 6.8 the outer maps are surjective after applying ⊗ S∞ F, and so by Nakayama's Lemma they are surjective.It follows that the middle map is surjective, and by Nakayama's Lemma again that the map is surjective.Tensoring with R nr q and applying Proposition 6.11 this gives that M ∞,K0(p) → M ∞,K ⊕2 is surjective.Applying ⊗ S∞ F, we see that is surjective.By Nakayama's Lemma, we obtain that m is surjective.This proves Conjecture 6.3 and hence Theorem 6.5 for this m.

F
associated to χ by class field theory, and ρ = ψ ⊕ ǫψ, then T v and Nm(v)S v act on A[C K ]/n by the scalars tr(ρ(Frob v )) and det(ρ(Frob v )), so that the action of T S A on A[C K ]/n factors through an Eisenstein maximal ideal as required.It follows that the action of T S

6
Thus by [Sta17, Lemma 0598] it follows that lim ← − : finAb I → Ab is exact.Now assume that A , B and C are weak patching systems, and that we have an exact sequence 0 → A → B → C → 0 Then for any a ⊆ S ∞ , A /a → B/a → C /a → 0 is exact, so by the exactness of U(−) we get the exact sequence U(A /a) → U(B/a) → U(C /a) → 0. Thus we have an exact sequence of inverse systems U(A /a) a → U(B/a) a → U(C /a) a → 0 But now as U(A /a), U(B/a) and U(C /a) are all finite, and there are only countably many open ideals of S ∞ , the above argument shows that taking inverse limits preserves exactness, and so indeed P(A ) → P(B) → P(C ) → 0 is exact.For an easy counterexample, assume that S∞/In is ̟-torsion free for all n (a condition which will be satisfied for our choice of In below) and let M = {S∞/In} n≥1 .Define ϕ = {ϕn} n≥1 : M → M by ϕn(x) = ̟ n x.Then ϕ : M → M is injective, P(M ) = S∞, and P(ϕ) : S∞ → S∞ is the zero map.
DT94b]) could be used to prove analogues of Emerton's Theorem 1.2.6 for the completed cohomology of Shimura curves, at least in settings where multiplicity one still holds.
[CS17]Local-global compatibility.In the work ofEmerton [Eme11]on local-global compatibility in the p-adic Langlands progam, Ihara's lemma is essential to obtain results with integral coefficients.Generalisations of Emerton's result to compact forms of U (2) over totally real fields in which l splits have been proved in[CS17]the compactness assumption ensuring that Ihara's Lemma is known.We expect that our results (and those of [ But if we now replace T , S and U by Y 2 , δ and P as discussed above, we obtain thatR unip O,ρ is the quotient of O[[X, Y 2 , P, R, δ]] by XY 2 = 0 as required.The expressions for the quotients R nr ρ,O and R N ρ,O follow immediately, and finally we eliminate δ by imposing the fixed determinant condition.Proposition 3.7.The images of Y 1 and Y 2 are equal in R