Daniel Le
email: le@math.toronto.edu

Bao V Le Hung

AND Brandon Levin
email: bwlevin@math.arizona.edu

Stefano Morra
email: stefano.morra@umontpellier.fr

POTENTIALLY CRYSTALLINE DEFORMATION RINGS AND SERRE WEIGHT CONJECTURES: SHAPES AND SHADOWS

. We also prove automorphy lifting theorems in dimension three. The key input is an explicit description of tamely potentially crystalline deformation rings with Hodge-Tate weights (2, 1, 0) for K/Qp unramified combined with patching techniques. Our results show that the (geometric) Breuil-Mézard conjectures hold for these deformation rings.

choice of monomial order

Introduction

Let p be a prime. Serre's modularity conjecture ( [START_REF] Serre | Propriétés galoisiennes des points d'ordre fini des courbes elliptiques[END_REF]) predicts that any continuous, irreducible, odd Galois representation r : G Q def = Gal(Q/Q) → GL 2 (F p ) is modular. In other words, there exists a cuspidal modular form f = n>0 a n q n , which is an eigenvector for the Hecke operators, such that tr(r (Frob )) ≡ a mod p for all primes = p not dividing the level of f . In [START_REF]Sur les représentations modulaires de degré 2 de Gal(Q/Q)[END_REF], Serre made his conjecture more precise, by specifying the minimal weight (for prime to p level) of such a modular form. More precisely, if r is modular, then the set of weights in which a modular form f associated to r occurs is determined in an explicit way from the local datum ρ def = r| Gal(Q p /Qp) . In generalizations of Serre's conjecture beyond GL 2 (Q), there is no obvious notion of minimality, and it is more natural to attach to ρ a set of irreducible mod p representations, or Serre weights, of the rational points of a general linear group over a finite field. This is referred to as the weight part of Serre's conjecture or more succinctly, the Serre weight conjectures.

There has been considerable progress on generalizations of Serre's weight conjecture in dimension two (the Buzzard-Diamond-Jarvis conjecture) ( [START_REF] Buzzard | On Serre's conjecture for mod Galois representations over totally real fields[END_REF], [START_REF] Schein | Weights of Galois representations associated to Hilbert modular forms[END_REF], [START_REF] Gee | The Breuil-Mézard conjecture for potentially Barsotti-Tate representations[END_REF], [START_REF] Gee | The weight part of Serre's conjecture for GL(2)[END_REF], [START_REF] Newton | Serre weights and Shimura curves[END_REF],...), leading to complete results for 2-dimensional Galois representations. A key insight in [START_REF] Gee | The Breuil-Mézard conjecture for potentially Barsotti-Tate representations[END_REF] connects the weight part of Serre's conjecture to the Breuil-Mézard conjecture ( [START_REF] Breuil | Multiplicités modulaires et représentations de GL2(Zp) et de Gal(Q p /Qp) en l = p[END_REF], [START_REF]Multiplicités modulaires raffinées[END_REF]), and its geometrization ( [START_REF]A geometric perspective on the Breuil-Mézard conjecture[END_REF], [EG]), which predicts the multiplicities of the special fibers of deformation spaces (or, more generally, moduli stacks) of local Galois representations when = p in terms of Serre weights of general linear groups.

In particular, a good understanding of the geometry of local Galois deformation spaces leads naturally to modularity lifting results, Breuil-Mézard, and the weight part of Serre's conjecture, via the patching techniques of Kisin-Taylor-Wiles.

In dimension two, potentially Barsotti-Tate (BT) deformation rings were studied via moduli of finite flat group schemes ( [START_REF]Moduli of finite flat group schemes, and modularity[END_REF], [START_REF] Breuil | Groupes p-divisibles, groupes finis et modules filtrés[END_REF]) leading to explicit presentations when K/Q p is unramified ( [START_REF]Multiplicités modulaires raffinées[END_REF][START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF]). The geometry of these (potentially) BT-deformation rings is a key input into the proof of the weight part of Serre's conjecture in [START_REF] Gee | The Breuil-Mézard conjecture for potentially Barsotti-Tate representations[END_REF] and provides evidence for mod p local Langlands. However, a satisfactory understanding of the n-dimensional analogue, potentially crystalline deformation rings with Hodge-Tate weights (n -1, n -2, . . . , 0), seemed out of reach, due to the difficulty of understanding the monodromy operator in the theory of Breuil-Kisin modules.

In this paper, we overcome this difficulty in dimension 3 to give a description of the local deformation rings R (2,1,0),τ ρ for K/Q p unramified and τ a generic tame inertial type.

We thereby obtain the first examples in dimension greater than 2 of Galois deformation rings which are neither ordinary nor Fontaine-Laffaille. Our results are consistent with the Breuil-Mézard conjecture and lead to improvements in modularity lifting.

Results on local deformation spaces. Let K/Q p be a finite unramified extension. We fix a sufficiently large finite extension E/Q p , O its ring of integers and F its residue field (the rings of coefficients for our representations).

Let τ : I Qp → GL 3 (O) be a tame inertial type and ρ : G K → GL 3 (F) be a continuous Galois representation. In Definitions 2.1 and 3.7, we introduce a mild condition on the inertial weights of τ and ρ, which we call genericity. Our main local results (cf. Corollary 5.13, Theorem 6.14 in the main body of the paper) are a detailed description of the framed potentially crystalline deformation ring R (2,1,0),τ ρ (if it is nonzero) in terms of the notion of shape attached to the pair (ρ, τ ) (cf. Definition 3.3). The shape is an element of length ≤ 4 in the Iwahori-Weyl group of GL 3 and arises from the study of moduli of Kisin modules with descent datum in §2.1 (inspired by work of [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF][START_REF]Multiplicités modulaires raffinées[END_REF][START_REF]Variétés de Kisin stratifiées et déformations potentiellement Barsotti-Tate[END_REF][START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF] and further pursued in [CL]); it generalizes the notion of genre which is crucial in [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF] in describing tamely Barsotti-Tate deformation rings for GL 2 .

Theorem 1.1. Let ρ : G Qp → GL 3 (F) be a continuous Galois representation. Let τ be a strongly generic tame inertial type. Then the framed potentially crystalline deformation ring R

(2,1,0),τ ρ with Hodge-Tate weights (2, 1, 0) has connected generic fiber and its special fiber is as predicted by the geometric Breuil-Mézard conjecture.

If R

(2,1,0),τ ρ is nonzero and the shape of (ρ, τ ) has length at least 2, then R (2,1,0),τ ρ has an explicit presentation given in Table 7. If the shape of (ρ, τ ) has length ≤ 1, then the special fiber of R (2,1,0),τ ρ is described in Section 8. The first step towards Theorem 1.1 is a detailed study of the moduli space of Kisin modules with descent datum. The shapes of Kisin modules which arise from reductions of potentially crystalline representations with Hodge-Tate weights (2, 1, 0) are indexed by (2, 1, 0)-admissible elements (Adm(2, 1, 0)) in the Iwahori-Weyl group of GL 3 as defined by Kottwitz and Rapoport (cf. [PZ13, (9.17)]). For generic τ , the Kisin variety is trivial, and so we can associate a shape to a pair (ρ, τ ).

There are 25 elements in Adm(2, 1, 0) (cf. Table 1). Due to an additional symmetry, we are able to reduce our analysis to nine cases. The shorter the length of the shape the more complicated the deformation ring is. In seven cases (length ≥ 2), the deformation ring admits a simple description (see Table 7). The remaining two cases require separate analysis undertaken in §8. Our strategy is as follows:

(1) Classify all Kisin modules of shape w ∈ Adm(2, 1, 0) over F p (Theorem 2.21);

(2) For M of shape w, construct the universal deformation space with height conditions (Theorem 4.17);

(3) Impose monodromy condition on the universal family ( §5).

Steps (1) and (2) generalize techniques of [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF][START_REF]Variétés de Kisin stratifiées et déformations potentiellement Barsotti-Tate[END_REF][START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF] used to compute tamely Barsotti-Tate deformation rings for GL 2 . Step (2) amounts to constructing local coordinates for the Pappas-Zhu local model for (GL 3 , µ = (2, 1, 0), Iwahori level) (cf. [CL]) and requires a more systematic approach to the p-adic convergence algorithm employed by [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF][START_REF]Variétés de Kisin stratifiées et déformations potentiellement Barsotti-Tate[END_REF][START_REF] Levin | Potentially crystalline deformation rings in the ordinary case[END_REF].

Step (3) requires a genuinely new method not present in the tamely Barsotti-Tate case where the link between moduli of finite flat groups schemes and Galois representations is stronger. Kisin [Kis06] characterized when a torsion-free Kisin module M over Z p comes from a crystalline representation in terms of the poles of a monodromy operator N M rig which is naturally defined on the extension M rig of M to the rigid analytic unit ball. This condition on the poles of the monodromy operator is a subtle analogue of Griffiths transversality in p-adic Hodge theory. While one cannot compute N M rig completely, it is possible to give an explicit approximation using the genericity condition on τ . The error term turns out to be good enough to understand the geometry of the deformation rings.

Global applications. Using Kisin-Taylor-Wiles patching methods, the local information on the Galois deformation spaces leads to new modularity results and the Serre weight conjectures. To state these results, we fix a global setup (cf. §7.1) and remark that the weight part of Serre's conjecture is expected to be independent of the global setup. Our proofs only use the existence of patching functors in the sense of [START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF][START_REF] Gee | General Serre weight conjectures[END_REF] verifying certain axioms (Definition 7.11) and so our results should hold in other situations as well.

Let F/Q be a CM field with totally real subfield F + . Assume that p splits completely in F . Let r : Gal(F /F ) → GL 3 (F) be a continuous irreducible representation. Let G be a unitary group over F + which is isomorphic to U (3) at each infinite place and split above p.

Attached to this data, there is a well known notion of modularity for r (cf. Definition 7.1).

Roughly speaking, we can find a prime-to-p level U p in the finite adèlic points G(A ∞,p F ) of G and a maximal ideal m r in the Hecke algebra T acting on the space of mod p algebraic automorphic forms S(U p , F) with infinite level at p, such that S(U p , F) m r = 0.

Rather than specify a minimal weight for which r is modular, it is natural to consider local systems attached to irreducible mod p-representations of G(O F + p ) (also called Serre weights) on the locally symmetric spaces of G. We let W (r) be the set of modular weights (i.e., the set of Serre weights V for which Hom G(O F + p ) (V, S(U p , F) m r ) = 0). We define what it means for Serre weights to be reachable (cf. Definition 7.2, which is an explicit condition on the highest weight) and write W elim (r) for the set of reachable modular weights. (The notion of reachable weight is due to the current weight elimination result when r is irreducible at a place above p, cf. [START_REF] Emerton | Weight cycling and Serre-type conjectures for unitary groups[END_REF], Theorem 5.2.5.)

If r is semisimple at each place above p, then there is a set of conjectural weights W ? (r) defined in [START_REF]The weight in a Serre-type conjecture for tame n-dimensional Galois representations[END_REF][START_REF] Gee | General Serre weight conjectures[END_REF] which only depends on the restriction of r to the inertia subgroups at the primes above p.

Theorem 1.2. Let r : G F → GL 3 (F) be a continuous Galois representation, verifying the Taylor-Wiles conditions (cf. Definition 7.3). Assume that r| G Fv is semisimple and 8-generic for all v | p (cf. Definition 3.7), that r is automorphic of some reachable Serre weight, and that r has split ramification outside p. Then W elim (r) = W ? (r).

When r is irreducible at each prime above p, this is proven in [START_REF] Emerton | Weight cycling and Serre-type conjectures for unitary groups[END_REF] using the technique of weight cycling and without any Taylor-Wiles conditions. The inclusion W elim (r) ⊂ W ? (r) (weight elimination) is proven in [START_REF] Emerton | Weight cycling and Serre-type conjectures for unitary groups[END_REF][START_REF] Herzig | On mod p local-global compatibility for GL3 in the ordinary case[END_REF][START_REF] Morra | Serre weights for three dimensional ordinary Galois representations[END_REF]. Recent improvements in weight elimination results show that W elim (r) can be replaced by W (r) and 'automorphic of some reachable Serre weight' with just 'automorphic', see Remark 7.10 for a precise discussion.

If [F + : Q] = d, there are 9 d conjectural weights appearing in W ? (r), 6 d of which are called obvious weights since they are directly related to the Hodge-Tate weights of "obvious" crystalline lifts of (r| G Fv ) v|p . The precise relation between Serre weights of r and Hodge-Tate weights of crystalline lifts of ρ was first made precise in [START_REF] Gee | Automorphic lifts of prescribed types[END_REF] and the obvious weights are shown to be modular in [BLGG] using global methods (namely, modularity lifting techniques) under the assumption that r is modular of a lower alcove weight.

The remaining weights in W ? (r) are more mysterious and are referred to as shadow weights. The modularity of the shadow weights lies deeper than that of the obvious weights, in part, because modularity of a shadow weight cannot be detected by modularity lifting alone but requires characteristic p information. It is at this point that the computation of the monodromy operator appears to play a critical role. The proof of Theorem 1.2 builds on the Breuil-Mézard philosophy introduced in [START_REF] Gee | The Breuil-Mézard conjecture for potentially Barsotti-Tate representations[END_REF]. The patching techniques of Gee-Kisin [START_REF] Gee | The Breuil-Mézard conjecture for potentially Barsotti-Tate representations[END_REF] and Emerton-Gee [START_REF]A geometric perspective on the Breuil-Mézard conjecture[END_REF] connect the geometry of the local deformation rings to modularity questions. We use geometric information about the local deformation rings, especially the geometry of their special fibers, to prove the modularity of the shadow weights.

Theorem 1.2 is stated only for r which are semisimple above p because those are the only representations for which there is an explicit conjecture. Our computations, together with work of [START_REF] Herzig | On mod p local-global compatibility for GL3 in the ordinary case[END_REF][START_REF] Morra | Serre weights for three dimensional ordinary Galois representations[END_REF], suggest a set W ? (ρ) for non-semisimple ρ for which the Theorem should hold. We give one example in Proposition 7.17 and will return to this question in future work. We also give counterexamples in Proposition 7.18 to Conjecture 4.3.2 (for some non-semisimple ρ) of [START_REF] Gee | Automorphic lifts of prescribed types[END_REF], which predicts Serre weights in terms of the existence of crystalline lifts.

The information on the deformation rings (Theorem 1.1), namely the connectedness of their generic fiber, lets us deduce new modularity lifting theorems.

Theorem 1.3. Let r : G F → GL 3 (O) be a Galois representation and write r : G F → GL 3 (F) for its associated residual representation.

Assume that:

(1) p splits completely in F + ;

(2) r is unramified almost everywhere and satisfies r c ∼ = r ∨ -2 (where c denotes the complex conjugation on F/F + );

(3) for all places w ∈ Σ p , the representation r| G Fw is potentially crystalline, with parallel Hodge type (2, 1, 0) and with strongly generic tame inertial type τ Σ + p = ⊗ v∈Σ + p τ v (cf. Definition 2.1);

(4) r verifies the Taylor-Wiles conditions (cf. Definition 7.3, in particular r is absolutely irreducible) and r has split ramification;

(5) r ∼ = r ı (π) for a RACSDC representation π of GL 3 (A F ) with trivial infinitesimal character and such that ⊗ v∈Σ + p σ(τ v ) is a K-type for ⊗ v∈Σ + p π v . Then r is automorphic.

In Theorem 1.3, we do not assume that ρ is semisimple nor do we make any potential diagonalizability assumptions. We also allow any tame type not just principal series types. Assumption (1) can be relaxed to the condition that p is unramified in F + . This requires new representation theoretic techniques which will be discussed in a companion paper ( [LLHLMa]). We also believe that the genericity assumptions on the type τ can be weakened with more work.

Our results shed light on other questions in mod p and p-adic Langlands as well. For example, Breuil [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF] formulates a conjecture, based on calculations of tamely Barsotti-Tate deformation rings for GL 2 , on integral lattices in tame types cut out by completed cohomology. When a tame principal series representation π of G(F + p ) appears in the m r -part (for a globalization of ρ) of the completed cohomology of an appropriate Shimura curve, the natural integral structure on the cohomology induces an integral structure on the type associated to π. Breuil conjectures that this lattice only depends on the local p-adic Galois representation attached to π by the hypothetical p-adic local Langlands correspondence. A related conjecture of Dembélé in [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF] is a "multiplicity one" statement for cohomology at Iwahori level. Both conjectures for K/Q p unramified were proven by Emerton-Gee-Savitt [START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF] using the Taylor-Wiles method and geometric Breuil-Mézard realized by explicit presentations of tamely Barsotti-Tate deformation rings.

The first author proved a generalization of Breuil's conjecture to GL 3 in the setting of [START_REF] Emerton | Weight cycling and Serre-type conjectures for unitary groups[END_REF]. In a companion work ( [LLHLMa]), we address Breuil's conjecture for GL 3 and K/Q p unramified using the methods developed in this paper. We will also extend the global results of this paper to the case of K/Q p unramified. For ease of exposition, we restrict ourselves to the case of GL 3 throughout this paper, although §2-4, some of §5, and §6 could be extended to GL n without serious difficulty.

Overview of the paper. We start in Section §2.1 with the basic formalism of Kisin modules with tame descent data (notion of eigenbasis, genericity and the basic formulas of semilinear algebra). This is further pursued in §2.2, where we obtain a complete classification of Kisin modules with generic descent data in terms of shapes (cf. Definition 2.17 and Theorem 2.21). Section 3 compares the moduli of Kisin modules with generic tame descent data and Galois deformation spaces. The genericity assumption guarantees the triviality of the Kisin variety (Theorem 3.2) and injectivity on tangent spaces. We conclude the section with the notion of shape and genericity for a mod p Galois representation (cf. Definitions 3.3, 3.7) together with a Galois cohomology argument which shows that, under a mild assumption on ρ, restriction to Galois deformations of some deeply ramified extension is fully faithful on tangent spaces. Section 4 and 5 are the technical heart of the paper. In §4, we develop an algorithm to construct a "universal family" of Kisin modules of finite height, lifting a residual Kisin module of a given shape (Theorem 4.1). The strategy is a wide generalization of the methods already appearing in [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF][START_REF] Caruso | Un calcul d'anneaux de déformations potentiellement Barsotti-Tate[END_REF][START_REF] Levin | Potentially crystalline deformation rings in the ordinary case[END_REF]]. An algorithm is described to construct a gauge basis on the universal family in §4.1 on which we then impose the p-adic Hodge type conditions (cf. Table 5 and Theorem 4.17)

In §5, we endow the rigid analytification of the universal family of Kisin modules with a canonical monodromy operator, which we determine up to an error term which is divisible by a power of p (Theorem 5.6); by imposing the monodromy to have logarithmic poles (Proposition 5.3), we finally obtain explicit equations for the moduli of Kisin modules with monodromy (Table 6), and hence for the Galois deformation ring ( §5.2, Corollary 5.13, and Table 7).

Section 6 extends the results of §5 to other tame types (cf. Theorem 6.14). We generalize the formalism of "base change" for deformation rings as developed in [START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF] in dimension 2.

The main global applications are discussed in §7. Via Kisin-Taylor-Wiles patching and the formalism of patched functors (as introduced in [EGS15]), we prove the main theorems discussed above. Section 8 is devoted to the analysis of the monodromy condition when the shape has length ≤ 1 where the computations become more involved. In the Appendix, we collect tables summarizing our results.

Acknowledgments: We would like to thank Matthew Emerton, Toby Gee, and Florian Herzig for many helpful conversations and for comments on an earlier draft of the paper.

We thank the referee for the very careful reading and many suggestions on the first version of this paper, which very much improved the exposition and the precision of our work.

1.1. Notation. If F is any field, we write G F def = Gal(F /F ) for the absolute Galois group, where F is a separable closure of F . If F is moreover a p-adic field, we write I F to denote the inertia subgroup of G F .

We fix once and for all an algebraic closure Q of Q. All number fields are considered as subfields of our fixed Q. Similarly, if ∈ Q is a prime, we fix algebraic closures Q as well as embeddings Q → Q . All finite extensions of Q are considered as subfields of Q . Moreover, the residue field of Q is denoted by F .

Let p > 3 be a prime. For f > 0, we let K be the unramified extension of Q p of degree f . We write k for its residue field and let W = W (k). We set e

ω π : ∆ → W × g → g(π) π
whose associated residual character is denoted by ω π . In particular, for f = 1, ω π is the mod p cyclotomic character, which will be simply denoted by ω. The p-adic cyclotomic character will be denoted by ε : Let E be a finite extension of Q p . We write O for its ring of integers, fix an uniformizer ∈ O and let m E = ( ). We write F def = O/m E for its residue field. We will always assume that E is sufficiently large, i.e. that any embedding σ :

G Qp → Z × p . If F w /Q p is
K → Q p factors through E ⊂ Q p .
In particular, any embedding σ : k → F p factors through F.

Let ρ : G K → GL n (E) be a p-adic, de Rham Galois representation. For σ : K → Q p ,
we define HT σ (ρ) to be the multiset of σ-labeled Hodge-Tate weights of ρ, i.e. the set of

integers -i such that dim E ρ ⊗ σ,K C p (i)
G K = 0 (with the usual notation for Tate twists).

In particular, we have HT σ (ε) = {1} for any σ. We define the Hodge type of ρ to be the We fix an embedding σ 0 : K ⊂ E, which induces maps W → O and k → F; by an abuse of notation, we denote all of these by σ 0 . We let ϕ denote the p-th power Frobenius on k and set σ j def = σ 0 • ϕ -j . The choice of the embedding σ 0 gives a fundamental character

multiset HT σ (ρ) σ∈S K ∈ Z n S K where S K def = σ | σ : K → Q p and
ω f := σ 0 • ω π : I K → O × of niveau f .
Let S 3 denote the symmetric group on {1, 2, 3}. We fix an injection S 3 → GL 3 (Z) sending s to the permutation matrix whose (k, m)-entry is δ k,s(m) and δ k,s(m) ∈ {0, 1} is the Kronecker δ specialized at {k, s(m)}. We will abuse notation and simply use s to denote the corresponding permutation matrix. Finally for m ≥ 0 and a collection (B j ) j=0,...,m of square matrices of the same size, we write

m j=0 B j = B 0 • B 1 . . . B m .
2. Kisin modules modulo p 2.1. Kisin modules with descent datum. Let τ = η 1 ⊕ η 2 ⊕ η 3 be an O × -valued inertial type consisting of pairwise distinct characters.

Let a 1 = (a 1,j ) j , a 2 = (a 2,j ) j , and a 3 = (a 3,j ) j where 0 ≤ j ≤ f -1 and 0 ≤ a k,j ≤ p -1.

For any 0

≤ j ≤ f -1, define a (j) k = f -1 i=0 a k,-j+i p i .
For 1 ≤ k ≤ 3, we can write

η k = (ω f ) -a (0)
k for a unique choice of a k . We say that (a 1 , a 2 , a 3 ) is associated to τ . We will need the following genericity assumption throughout the paper.

Definition 2.1. Let n ∈ N. We say that the triple (a

1 , a 2 , a 3 ) is n-generic if n ≤ |a 1,j -a 2,j |, |a 2,j -a 3,j |, |a 1,j -a 3,j | ≤ p -1 -n (2.1)
for all j. We say that an inertial type τ = η 1 ⊕ η 2 ⊕ η 3 is n-generic if the associated triple (a 1 , a 2 , a 3 ) is generic. We say that τ is generic (resp. weakly generic, resp. strongly generic) if τ is 5-generic (resp. 3-generic, resp. 10-generic).

Let R be an O-algebra. Any W ⊗ Zp R-module M decomposes as direct sum of R-modules

M = f -1 j=0 M (j)
where M (j) is the submodule such that (x ⊗ 1)m = (1 ⊗ σ j (x))m for all m ∈ M (j) and x ∈ W .

For any g ∈ ∆ and any O-algebra R, we let g be the W ⊗ Zp R-linear automorphism of

(W ⊗ Zp R)[[u]] given by u → (ω π (g) ⊗ 1)u. Definition 2.2. Let M R be an (W ⊗ Zp R)[[u]]-module. A semilinear action of ∆ on M R is collection of g-semilinear additive bijections g : M R → M R for each g ∈ ∆ such that g • h = gh for all g, h ∈ ∆.
Recall that for any O-algebra R, we define the Frobenius ϕ :

(W ⊗ Zp R)[[u]] → (W ⊗ Zp R)[[u]
] to be trivial on R, the Frobenius on W , and with ϕ(u) = u p . Note that g

• ϕ = ϕ • g. Definition 2.3. Let R be any O-algebra. A Kisin module with height in [0, h] over R is a finitely generated projective (W ⊗ R)[[u]]-module M R together with Frobenius φ M R : ϕ * (M R ) → M R
such that the cokernel is killed by E(u) h . Here and throughout the paper the notation ϕ * (M R ) stands for the base change of M R along ϕ :

(W ⊗ Zp R)[[u]] → (W ⊗ Zp R)[[u]]. Definition 2.4. A Kisin module with descent datum over R is a Kisin module (M R , φ M R )
together with a semilinear action of ∆ given by { g} g∈∆ which commutes with φ M R , i.e., for all g ∈ ∆,

g • φ M R = φ M R • ϕ * ( g). Let M R ∼ = f -1 j=0 M (j)
R . We say that the descent datum is of type τ if the linear representation of ∆ on the R-module satisfies

M (j) R /uM (j) R ∼ = τ ⊗ O R for each 0 ≤ j ≤ f -1.
For any O-algebra R, let Y [0,h],τ (R) be the category of Kisin modules over R with height in [0, h], rank 3, and descent datum of type τ . For a given N ∈ N, it is shown in [CL] that Y [0,h],τ mod (m E ) N is represented by an Artin stack of finite type over O/(m E ) N . The aim of this section is to classify the F-points of Y [0,2],τ which are reductions of Kisin modules with "Hodge-Tate" weights (2, 1, 0).

Definition 2.5. Let v def = u e and M R ∈ Y [0,2],τ (R). For k ∈ {1, 2, 3}, define M R,k to be the (W ⊗ R)[[v]]-submodule of M R on which ∆ acts by η k , i.e., M R,k def = M R ∆=η k . Similarly, we define ϕ M R,k to be the (W ⊗ R)[[v]]-submodule of ϕ * (M R ) on which ∆ acts by η k , i.e., ϕ M R,k def = ϕ * (M R ) ∆=η k . By considering the decomposition M R ∼ = f -1 j=0 M (j) R , we write M (j+1) R,k for the R[[v]]- submodules of M (j+1) R
on which ∆ acts by η k and we write ϕ M (j)

R,k for the R[[v]]-submodules of (ϕ * (M R )) (j+1) = ϕ * (M (j)
R ) on which ∆ acts by η k (with the usual convention that j + 1

def = 0 if j = f -1).
While we have made a choice of global ordering η 1 , η 2 , η 3 , it will be important for uniform statements to order things (possibly) differently at each embedding σ j : K → E. We introduce this local ordering now.

Definition 2.6. Let (a 1 , a 2 , a 3 ) be a triple as in Definition 2.1. An orientation of (a 1 , a 2 , a 3 ) is an f -tuple (s j ) j ∈ S f 3 such that a (j)

s j (1) ≥ a (j) s j (2) ≥ a (j) s j (3) .
If τ is an inertial type as above, an orientation of τ is defined to be an orientation of the triple (a 1 , a 2 , a 3 ) associated to it. In this case, we say that s j is an orientation at j of τ .

Under the weak genericity condition (2.1), there exists a unique orientation on τ and the orientation at j is determined by the values of a 1,f -j-1 , a 2,f -j-1 , a 3,f -j-1 which are the dominant terms of a

(j) 1 , a (j) 2 , a (j)
3 respectively. In particular, we have

(2.2) a s j (1),f -j-1 > a s j (2),f -j-1 > a s j (3),f -j-1 .
For any M ∈ Y [0,h],τ (R), we have the following commutative diagram relating the different isotypic components:

(2.3) ϕ M (j-1) s j (3) u e-(a (j) s j (1) -a (j) s j (3) ) G G φ (j-1) M,s j (3) ϕ M (j-1) s j (1) u a (j) s j (1) -a (j) s j (2) G G φ (j-1) M,s j (1) ϕ M (j-1) s j (2) φ (j-1) M,s j (2) u a (j) s j (2) -a (j) s j (3) G G ϕ M (j-1) s j (3) φ (j-1) M,s j (3) M (j) s j (3) u e-(a (j) s j (1) -a (j) s j (3) ) G G M (j) s j (1) u a (j) s j (1) -a (j) s j (2) G G M (j) s j (2) u a (j) s j (2) -a (j) s j (3) G G M (j) s j (3)
where the composition along each row is multiplication by u e and the vertical arrows are induced by φ M . All the maps in the diagram are injective (again, with the standard conven-

tion that j-1 def = f -1 if j = 0).
In particular, any one of the three maps φ

(j-1) M,1 , φ (j-1) M,2 , φ (j-1) M,3
determines the other two. We choose to focus on φ

(j-1)
M,s j (3) . We discuss in more detail at the end of the section how the Frobenii φ (j-1) M,s j (k) , for 1 ≤ k ≤ 3, are related (Proposition 2.23).

Remark 2.7. The submodule ϕ M k of ϕ * (M) is NOT the same as the Frobenius pullback of M k . In particular, φ M,k does not define a semilinear endomorphism of M k . It is merely a linear map from ϕ M k → M k . This fact is reflected again in the change of basis formula (Proposition 2.15). We want to consider φ (j) M,s j+1 (3) j as a collection of matrices with respect to a choice of bases. We will refine the basis further in the next section.

Definition 2.8. Let M ∈ Y [0,2],τ (R). An eigenbasis β := β (j) j for M is a collection of bases β (j) = f (j) 1 , f (j) 2 , f (j) 3 of each M (j) such that f (j) k ∈ M (j) k for each k ∈ {1, 2, 3}. Lemma 2.9. If β = f (j) 1 , f (j) 2 , f (j) 3 j
is an eigenbasis for M, then for any 0 ≤ j ≤ f -1,

β (j) s j (3) := u a (j) s j (1) -a (j) s j (3) f (j) s j (1) , u a (j) s j (2) -a (j) s j (3) f (j) s j (2) , f (j)
s j (3) ,
is a basis for M (j)

s j (3) . Similarly, ϕ β (j-1) s j (3) := u a (j) s j (1) -a (j) s j (3) ⊗ f (j-1) s j (1) , u a (j) s j (2) -a (j) s j (3) ⊗ f (j-1) s j (2) , 1 ⊗ f (j-1) s j (3)
is a basis for ϕ M (j-1)

s j (3) .
Remark 2.10. We always order an eigenbasis β (j) with respect to the ordering on the characters η 1 , η 2 , η 3 . On the other hand, when we work with the isotypic pieces M (j) s j (3) we order our bases using the orientation (s j ) of τ . It will be important to keep track of this difference.

Definition 2.11. Given an eigenbasis β for M, the matrix C (j) of φ (j) M with respect to β (j) is defined to be the matrix C (j) such that

φ (j) M ϕ * β (j) = β (j+1) C (j) .
The matrix A (j) of φ (j) M,s j+1 (3) with respect to β (j) is defined to be the matrix A (j) such that

φ (j) M,s j+1 (3) ϕ β (j) s j+1 (3) = β (j+1) s j+1 (3) A (j) .

It is customary to write

C (j) = Mat β φ (j) M and A (j) = Mat β φ (j)
M,s j+1 (3) for short. To understand how C (j) and A (j) relate to each other we define the following conjugation action by diagonal matrices:

Definition 2.12. For any b 1 , b 2 , b 3 ∈ Z and for any M ∈ Mat 3 (R((u))), we define Ad(u b 1 , u b 2 , u b 3 )(M ) :=     u b 1 0 0 0 u b 2 0 0 0 u b 3     M     u -b 1 0 0 0 u -b 2 0 0 0 u -b 3     .
For any 0 ≤ j ≤ f -1 and any M ∈ Mat 3 (R((u))), we define conjugation with orientation by

Ad s j (u a 1 , u a 2 , u a 3 )(M ) := s j Ad u a (j) s j (1) , u a (j) s j (2) , u a (j) s j (3) (M ) s -1 j and Ad -1 s j (u a 1 , u a 2 , u a 3 )(M ) := Ad u -a (j) s j (1) , u -a (j) s j (2) , u -a (j) s j (3) (s -1 j M s j ).
In particular, if M has the form C (j) ∈ GL 3 (R((u))) as in Definition 2.11 then Ad -1 s j+1 (u a 1 , u a 2 , u a 3 )(M ) is a matrix in GL 3 (R((v))) (and the above conjugation can be thought as "removing the descent datum"). For M ∈ Y [0,h],τ (R), the following Proposition relates the matrix for φ Proposition 2.13. Let β be an eigenbasis for M and (s j ) be the orientation of τ . Let

A (j) = Mat β φ (j)
M,s j+1 (3) be as in Definition 2.11. Then

C (j) = Mat β φ (j) M = Ad s j+1 u a 1 , u a 2 , u a 3 A (j) . (2.4)
Proof. This is straightforward from Definition 2.11 and Lemma 2.9 noting that:

β (j+1) s j+1 (3) = β (j+1) s j+1       u a (j+1) s j+1 (1) 0 0 0 u a (j+1) s j+1 (2) 0 0 0 u a (j+1) s j+1 (3)       u -a (j+1) s j+1 (3) .
For any O-algebra R, define

• L GL 3 (R) := GL 3 (R((v))) • L + GL 3 (R) := GL 3 (R[[v]]) • I(R) := {M ∈ L + GL 3 (R) | M mod v is upper triangular } • I 1 (R) := {M ∈ L + GL 3 (R) | M mod v is upper triangular unipotent } • D 3 (R) := {M ∈ L + GL 3 (R) | M mod v 3 is diagonal }. Lemma 2.14. Let I ∈ Mat 3 (R((v))). For any integers b 1 , b 2 , b 3 with e > b 1 -b 3 > b 2 -b 3 > 0, consider D = Ad u b 1 , u b 2 , u b 3 (I). Then D ∈ Mat 3 (R[[u]]) if and only if I is in Mat 3 (R[[v]]
) and is upper triangular modulo v.

Proof. The proof is a straightforward computation.

We will now describe the effect of change of basis for the eigenbasis coordinates. Recall that (s j ) ∈ S f 3 is the orientation of τ (Definition 2.6), and we associate to s j the corresponding permutation matrix in GL 3 (O) as described in §1.1. Proposition 2.15. Let R be an O-algebra. Let M ∈ Y [0,2],τ (R) together with two eigenbases

β (j) 1 := f (j) 1 , f (j) 2 , f (j) 3 and β (j) 2 := f (j) 1 , f (j) 2 , f (j) 3 related by f (j) 1 , f (j) 2 , f (j) 3 D (j) = f (j) 1 , f (j) 2 , f (j) 3 with D (j) ∈ GL 3 (R[[u]]). Let us write A (j) 1 def = Mat β 1 φ (j) M,s j+1 (3) and A (j) 2 def = Mat β 2 φ (j) M,s j+1 (3)
as in Definition 2.11. Then (2.5)

A (j) 2 = I (j+1) A (j) 1 s -1 j+1 s j I (j),ϕ s -1 j s j+1
where, for all 0 ≤ j ≤ f -1, we have I (j) def = Ad -1 s j (u a 1 , u a 2 , u a 3 )(D (j) ) ∈ I(R) and

I (j),ϕ def = Ad(v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 )(ϕ(I (j) ) -1 ).
Proof. The proof is a direct computation using Proposition 2.13. More precisely, let us write

C (j) i def = Mat β i (φ (j)
M ) for i ∈ {1, 2} as in Definition 2.11. We have

(2.6) C (j) 2 = D (j+1) C (j) 1 ϕ D (j) -1 .
Since D (j) respects the descent datum, I (j) := Ad -1 s j (u a 1 , u a 2 , u a 3 )(D (j) ) is in GL 3 (R((v))), hence in I(R) by Lemma 2.14. Using (2.6) and Proposition 2.13, one obtains:

Ad s j+1 (u a 1 , u a 2 , u a 3 ) A (j) 2 = D (j+1) C (j) 1 ϕ D (j) -1 = D (j+1) Ad s j+1 (u a 1 , u a 2 , u a 3 ) A (j) 1 ϕ D (j) -1 .
Conjugating on both sides, we further deduce that

A (j) 2 = I (j+1) A (j) 1 Ad -1 s j+1 (u a 1 , u a 2 , u a 3 ) ϕ D (j) -1 . (2.7)
We now study the final term of the right-hand side of (2.7). Let s j+1,j := s -1 j+1 s j . We have

Ad -1 s j+1 (u a 1 , u a 2 , u a 3 ) ϕ D (j) -1 (2.8) = Ad u -a (j+1) s j+1 (1) , u -a (j+1) s j+1 (2) , u -a (j+1) s j+1 (3) s j+1,j Ad u pa (j) s j (1) , u pa (j) s j (2) , u pa (j) s j (3) ϕ(I (j) ) -1 s -1 j+1,j
=s j+1,j Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 (ϕ(I (j) ) -1 )s -1 j+1,j .

where the last step follows from pa

(j) k -a (j+1) k = a k,f -j-1 e and s -1 j+1,j       u -a (j+1) s j+1 (1) 0 0 0 u -a (j+1) s j+1 (2) 0 0 0 u -a (j+1) s j+1 (3)       s j+1,j =       u -a (j+1) s j (1) 0 0 0 u -a (j+1) s j (2) 0 0 0 u -a (j+1) s j (3)       .
The conclusion follows by combining (2.7) and (2.8).

Proposition 2.16. Assume that τ is weakly generic (Definition 2.1). Let I (j) ∈ I(R) be as in Proposition 2.15. Then

I (j),ϕ = Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 (ϕ(I (j) ) -1 ) ∈ D 3 (R).
Proof. By the weak genericity assumptions and choice of orientation, a s j (1),f -j-1 -a s j (2),f -j-1 ≥ 3 and p -4 ≥ a s j (1),f -j-1 -a s j (3),f -j-1 > a s j (2),f -j-1 -a s j (3),f -j-1 ≥ 3.

Since I (j) -1 ∈ I(R), the entries of ϕ I (j) -1 below the diagonal are divisible by v p . A direct computation then shows that Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ(I (j) ) -1 ∈ D 3 (R).

2.2. Classification over F. We keep the notations of the previous section except we now work over F as opposed to O. In this subsection, we assume that τ is weakly generic. We are now ready to define the shape (or genre in French) of a Kisin module. Let T be the diagonal torus of GL 3 and let N GL 3 (T ) denote the normalizer of T . The (extended) affine Weyl group of GL 3 is given by

W := N GL 3 (T )(F((v)))/T (F[[v]]).
Recall that W sits in an exact sequence

0 → X * (T ) → W → S 3 → 0
where S 3 is the ordinary Weyl group of GL 3 and X * (T ) ∼ = Z 3 are the cocharacters of T . If λ ∈ X * (T ) is a cocharacter, it is customary to write t λ to denote the corresponding element (a translation) in W .

For any finite extension F of F, Bruhat-Tits theory gives the following double coset decomposition (2.9)

LGL 3 (F ) = w∈ W I(F ) w I(F ).

Definition 2.17. Let w = ( w 0 , w 1 , . . . , w f -1 ) ∈ W f . A Kisin module M ∈ Y [0,h],τ (F ) has shape w if for any eigenbasis β, the matrices

A (j) j = Mat β φ (j)
M,s j+1 (3) j have the property that A (j) ∈ I(F ) w j I(F ).

It follows immediately from Propositions 2.15 and 2.16 that the shape of a Kisin module is well-defined, i.e., it does not depend on the choice of the eigenbasis. The motivation for this definition comes from the theory of local models and a corresponding stratification there. We now give an overview of this connection which is described in detail in the joint work [CL] of the third author. We turn our attention to the study of Kisin modules with "parallel" weight (2, 1, 0). Precisely, let µ = (µ j ) with µ j = (2, 1, 0) for all j considered as a geometric cocharacter of Res K/Qp GL 3 . Then, [CL] constructs a closed substack Y µ,τ ⊂ Y [0,2],τ together with a "local model diagram"

Y µ,τ π | | Ψ 5 5 Y µ,τ M (µ
(F) ⊂ Y µ,τ (F) of shape w is given by π Ψ -1 S 0 w .
The set of w ∈ W f such that S 0 w is a nonempty subscheme of M (µ) is given by the µ-admissible set Adm(µ) = j Adm(2, 1, 0) (see [CL, §5.2] for details).

Corollary 2.19. The set Y µ,τ w (F) is nonempty if and only if w = ( w 0 , w 1 , . . . , w f -1 ) where w j is a (2, 1, 0)-admissible element of W .

One can describe Adm(2, 1, 0) quite concretely. Let W 0 be the affine Weyl group of SL 3 .

It is a Coxeter group generated by three reflections α, β and γ. We represent the elements α and β which generate the finite Weyl group by

α =     0 1 0 1 0 0 0 0 1     , β =     1 0 0 0 0 1 0 1 0     .
The element γ is given by

γ =     0 0 v -1 0 1 0 v 0 0     .
The set Adm(2, 1, 0) is a subset of v W 0 ⊂ W (i.e., those matrices with determinant v 3 (unit)). In particular, the element t (2,1,0) ∈ W corresponding to the GL 3 -cocharacter (2, 1, 0) is in v W 0 . Recall that W 0 is endowed with a Bruhat ordering, and for w 1 , w 2 ∈ W 0 , we say v w 1 ≤ v w 2 if and only if w 1 ≤ w 2 . Adm(2, 1, 0) is then defined to be the subset of elements w ∈ v W 0 such that w ≤ t s(2,1,0) for some permutation s ∈ S 3 .

There are six extremal elements in Adm(2, 1, 0) of length 4, corresponding to the six permutations of (2, 1, 0). The length three shapes are divided into two different sets which reflect different behavior on the Galois side. The set Adm(2, 1, 0) is given in Table 1.

The following is the key result for classifying Kisin modules with F -coefficients, where F is a finite extension of F.

Lemma 2.20. Let M, M ∈ Y µ,τ (F ) and let β, β be eigenbases of M, M respectively.

We define

A (j) def = Mat β φ (j) R,s j+1 (3) (resp. A (j) def = Mat β φ (j)
R,s j+1 (3) ) as in Definition 2.11. Assume further that there exists J (j+1) ∈ I 1 (F ) such that A (j) = J (j+1) A (j) for all

0 ≤ j ≤ f -1. Then there is an isomorphism M ∼ -→ M in Y µ,τ (F ).
Proof. We define, by induction, the following sequence J (j)

n n∈N of elements in I 1 (F ). For all j ∈ Z/f Z, set J (j) 0 def = Id 3 . For n ≥ 1, set J (j+1) n+1 = J (j+1) A (j) A (j) s j+1,j J (j),ϕ n s -1 j+1,j -1 where J (j),ϕ n is constructed from J (j)
n ∈ I(F ) as in Proposition 2.15. Note that this defines a sequence in the pro-v Iwahori I 1 (F ).

From the definition of J (j) n and the hypothesis A (j) = J (j+1) A (j) , we obtain (2.10)

A (j) = J (j+1)
n+1 A (j) s j+1,j J (j),ϕ n s -1 j+1,j .

Provided that the sequence J (j)

n n converges, we deduce the desired isomorphism M ∼ -→ M via Proposition 2.15.

We now prove the convergence of the sequence J (j)

n n . By the definition of the v-adic topology on I(F ), it is enough to prove that

(2.11) v p(n-2) J (j+1) n+1 -J (j+1)
n for all n ≥ 3. We induct on n.

It follows directly from the definitions that for all n ≥ 1 the element J (j+1) n+1 -J (j+1) n equals (2.12)

J (j+1) A (j) s j+1,j Ad v a s j (1),f -1-j , v a s j (2),f -1-j , v a s j (3),f -1-j ϕ J (j) n -J (j) n-1 s -1 j+1,j A (j) -1 .
First, let n = 1. Then J (j) 1 = J (j) ∈ I 1 (F ) and hence:

ϕ J (j) 1 -Id 3 ∈     (v p ) F [[v]] F [[v]] (v p ) (v p ) F [[v]] (v p ) (v p ) (v p )     .
By the weak genericity condition (2.1) and the height condition, we deduce that

v 3 | Ad v a s j (1),f -1-j , v a s j (2),f -1-j , v a s j (3),f -1-j • ϕ J (j) -Id 3 and v 2 A (j) -1 ∈ Mat 3 (F [[v]]
), respectively. We conclude from (2.12) that v J

(j+1) 2 - J (j+1) 1
.

For n = 2, we have v p ϕ J

(j) 2 -J (j) 1
by the previous step, and hence v 2 J (j)

3 -J (j) 2
by the weak genericity condition (2.1). Finally, we conclude that v p J (j) 4 -J

(j) 3 since v 2p ϕ J (j) 3 -J (j) 2
.

For n ≥ 3, we see by induction, the weak genericity condition, and the height condition on A (j) , that (2.13)

v p 2 (n-2)-(p-4)-2 Ad v a s j (1),f -1-j , v a s j (2),f -1-j , v a s j (3),f -1-j ϕ J (j) n -J (j) n-1 A (j) -1 . Hence p 2 (n -2) -p + 2 ≥ p(p(n -2) -1) ≥ p(n -1) since p ≥ 3.
With more careful analysis, Lemma 2.20 probably holds with even weaker genericity conditions. However, we do not attempt such an analysis here.

Theorem 2.21. Let F be a finite extension of F. Let M ∈ Y µ,τ w (F ) with w = ( w 0 , w 1 , . . . , w f -1 ). Fix a choice of representatives for w j • P w j \ I(F ) , where

P w j def = w -1 j I 1 (F ) w j ∩ I(F ).
Then there exists an eigenbasis β of M such that for each j ∈ Z/f Z the matrix

A (j) = Mat β φ (j)
M,s j+1 (3) lies in our fixed choice of representatives.

Proof. Let A (j)

1 := Mat β (j) 1 φ (j)
M,s j+1 (3) for some eigenbasis β

(j) 1 of M (j) . If A (j) ∈ I(F ) w j I(F ) is such that A (j) and A (j)
1 lie in the same left coset I 1 (F )\ I(F ) w j I(F ), then by Lemma 2.20 there exists an eigenbasis of β (j) of M (j) such that A (j) = Mat β (j) φ (j) M ,s j+1 (3) . By considering the obvious isomorphism

w j • P w j \ I(F ) ∼ -→ I 1 (F )\ I 1 (F ) w j I(F ) = I 1 (F )\ I(F ) w j I(F ),
we conclude that if M (j) has shape w j , then there exists an eigenbasis β of M such that Mat β φ (j) M,s j+1 (3) = A (j) where A (j) lies in our choice of representatives in w j • P w j \ I(F ) .

In Table 4, we have listed a choice of representatives for w j • P w j \ I(F ) for 9 out of the 25 elements in Adm(2, 1, 0). As we will see below, a choice of representatives for the remaining 16 can be easily obtained from these 9 elements by cyclic symmetry.

We now introduce the notion of a gauge basis of a mod p Kisin module:

Definition 2.22. Let M ∈ Y µ,τ w (F ). A gauge basis β = (β (j) ) j of M is an eigenbasis such that for each 0 ≤ j ≤ f -1, the matrix Mat β φ (j)
M,s j+1 (3) is in the form given by the w j -entry in Table 4.

Note that a gauge basis always exists by Theorem 2.21.

In the above discussion, one could just as well have chosen to use φ

(j) M,s j+1 (2) or φ (j) M,s j+1 (1) instead of φ (j)
M,s j+1 (3) . There is a simple way of determining the matrices for φ

(j) M,s j+1 (2) or φ (j) M,s j+1 (1) in terms of φ (j)
M,s j+1 (3) . Furthermore, while the shape of the Kisin module depends on the choice of the isotypic piece, there is a simple recipe which relates them. As a consequence we can restrict ourselves to the study of the shapes listed in Table 4, and the results for any other shape can be easily deduced by cyclic symmetry via Corollary 2.24 below.

Let

δ =     0 0 v -1 1 0 0 0 1 0     ∈ W .
Conjugation by δ induces an outer automorphism of W 0 of order 3 satisfying

δαδ -1 = β, δβδ -1 = γ, δγδ -1 = α.
It is furthermore easy to check that δ I(R)δ -1 = I(R)

for any O-algebra R. Proposition 2.23. Let M ∈ Y [0,h],τ (R). Let β (j) = f (j) 1 , f (j) 2 , f (j) 3
be an eigenbasis for M and let A (j)

3 def = Mat β φ (j)
M,s j+1 (3) be as in Definition 2.11. Then u e-a (j) s j (2) +a (j)

s j (3) ⊗ f (j-1) s j (3) , u a (j) s j (1) -a (j) s j (2) ⊗ f (j-1) s j (1) , 1 ⊗ f (j-1) s j (2)
, u e-a (j) s j (2) +a (j)

s j (3) f (j) s j (3) , u a (j) s j (1) -a (j) s j (2) f (j) s j (1) , f (j) s j (2)
u e-a (j) s j (1) +a (j)

s j (2) ⊗ f (j-1) s j (2)
, u e-a (j) s j (1) +a (j)

s j (3) ⊗ f (j-1) s j (3) , 1 ⊗ f (j-1) s j (1)
, u e-a (j) s j (1) +a (j)

s j (2) f (j) s j (2)
, u e-a (j) s j (1) +a (j)

s j (3) f (j) s j (3) , f (j) s j (1)
are bases for ϕ M (j-1)

s j (2) and M (j)
s j (2) respectively (resp. for ϕ M (j-1) s j (1) and M (j)

s j (1) respectively). If A (j) 2 def = Mat β φ (j) M,a s j+1 (2) and A (j) 1 def = Mat β φ (j)
M,a s j+1 (1) are defined in the evident way following Definition 2.11, then

A (j) 2 = δA (j) 3 δ -1 , A (j) 1 = δ 2 A (j) 3 δ -2 .
Proof. We give the proof for M (j-1)

s j (2) as the other proof is similar. Let C (j) def = Mat β φ (j) M
be as in Definition 2.11 so that by Proposition 2.13 we have

(2.14) C (j-1) = Ad s j (u a 1 , u a 2 , u a 3 ) A (j-1) .

Let c 1 = βα be the permutation matrix corresponding to the cycle (132). It is clear that the elements listed in the statement form a basis for ϕ M (j-1)

s j (2) and M (j)
s j (2) respectively and hence the same argument as in Proposition 2.13 shows that

A (j-1) 2 = Ad u -a (j) s j (3) -e , u -a (j) s j (1) , u -a (j) s j (2) c -1 1 s -1 j C (j-1) s j c 1 , (2.15)
Combining (2.14) and (2.15), we see that

A (j) 2 = Ad(δ 2 ) A (j) 3 ,
where

δ 2 = Diag u -a (j) s j (3) -e , u -a (j) s j (1) , u -a (j) s j (2) c -1 1 Diag u a (j) s j (1) , u a (j) s j (2) , u a (j) s j (3) .
A direct computation shows that δ 2 = δ.

Corollary 2.24. Let M ∈ Y [0,h],τ (F ). If M has shape w = ( w 0 , . . . , w f -1 ) then for any

eigenbasis β = (β (j) ), Mat β (φ (j) M,a s j+1 (2) ) ∈ I(F )(δ w j δ -1 ) I(F ), Mat β (φ (j) M,a s j+1 (1) ) ∈ I(F )(δ 2 w j δ -2 ) I(F )
for all 0 ≤ j ≤ f -1.

Remark 2.25. As a consequence of Corollary 2.24, there is symmetry among the 25 shapes of Adm(2, 1, 0). It is easy to see that δAdm(2, 1, 0)δ -1 = Adm(2, 1, 0) and that there are 9 orbits under conjugation by δ. In Table 4, we choose representatives for these 9 orbits and restrict our attention to those 9 shapes. One can deduce all our results for the remaining

= -p. We let K ∞ def = n∈N K(p n ) and G K∞ def = Gal(Q p /K ∞ ).
By classical work of Fontaine ([Fon90]) we have an exact anti-equivalence of ⊗-categories:

Φ-Mod ét (R) ∼ -→ Rep G K∞ (R) M -→ V * (M) def = Hom Φ-Mod M, O E un ,K
where O E un ,K is the étale extension of O E,K corresponding to a separable closure of k((v)).

The above construction can also be carried out with descent datum. More precisely, choose (π n ) n∈N to be the sequence satisfying π e n = p n and π p n+1 = π n with π 0 = π.

Then L ∞ def = n∈N L(π n ) and G L∞ def = Gal(Q p /L ∞ ). We have Gal(L ∞ /K ∞ ) ∼ = Gal(L/K) = ∆. Let O E,L denote the p-adic completion of (W [[u]])[1/u] equipped with an action of Gal(L ∞ /K ∞ ) ∼ = ∆ characterized by g(u) def = ω π (g)u.
We define, in the evident way, the category Φ-Mod ét dd (R) of étale ϕ-module over O E,L ⊗ Zp R with descent data and note that O E,L is an O E,K -algebra (by "ramifying the variable" u = v 1/e ).

We have an exact anti-equivalence of categories:

Φ-Mod ét dd (R) ∼ -→ Rep G K∞ (R) M -→ V * dd (M) def = Hom φ,O E,L M, O E un ,K
where we make

G K∞ act on Hom φ,O E,L M, O E un ,K via g • f def = g • f • g -1
(here we write g to denote the automorphism of M associated to g ∈ Gal(L ∞ /K ∞ ) ∼ = ∆ via the descent data).

Define T * dd to be the composition

Y [0,h],τ (R) → Φ-Mod ét dd (R) → Rep G K∞ (R)
, where the first map is given by tensoring with O E,L (over (W [[u]])).

In order to compute T * dd , it is convenient to both remove the descent datum and pass to a single Frobenius. This is carried out in [START_REF] Caruso | Un calcul d'anneaux de déformations potentiellement Barsotti-Tate[END_REF]§2.1.3]. We briefly recall the construction.

For any O-algebra R, we consider R as a W -algebra via σ 0 . We endow the ring O E,K ⊗ W,σ 0 R with a Frobenius ϕ f (by base change). We can now define in the evident fashion the cate-

gory Φ f -Mod ét W,σ 0 (R) of étale (ϕ f , O E,K ⊗ W,σ 0 R
)-modules and we have an exact equivalence of categories:

Φ f -Mod ét W,σ 0 (R) ∼ -→ Rep G K∞ (R) M -→ V * W (M) def = Hom Φ f -Mod M, O E un ,K . In particular, if (M, φ M ) ∈ Φ-Mod ét (R), then (M (0) , φ f M ) ∈ Φ f -Mod ét W,σ 0 (R)
. This defines a functor ε 0 : Φ-Mod ét (R) → Φ f -Mod ét W,σ 0 (R). We have the following compatibility between the above constructions (cf. Theorem 2.1.6 and equation ( 12) in [CDMa]):

Y [0,2],τ (R) G G T * dd C C Φ-Mod ét dd (R) V * dd G G (•) ∆=1 Ó Ó Rep G K∞ (R) Φ-Mod ét (R) ε 0 •(•) G G V * W W -⊗ O E,K O E,L f f Φ f -Mod ét W (R) V * W y y
If R is a F-algebra and M ∈ Y [0,2],τ (R), it will be useful to describe the étale (ϕ f , R((v)))-

module ε 0 (M ⊗ F[[u]] F((u))) ∆=1 explicitly in terms of the A (j) . Proposition 2.26. Let M ∈ Y [0,2],τ (R) and β be an eigenbasis of M. Write (s j ) for an orientation of τ , A (j) = Mat β φ (j) M,s j+1 (3) and consider M = M[1/u] ∈ Φ-Mod ét dd (R). Then the étale (ϕ f , R((v)))-module ε 0 M ∆=1 is described with respect to the basis f = (u a (0) 1 f (0) 1 , u a (0) 2 f (0) 2 , u a (0) 3 f (0) 3 ) by Mat f (φ f M (0) ) = f -1 j=0 s f -j • ϕ j A (f -1-j)     v a s f -j (1),j 0 0 0 v a s f -j (2),j 0 0 0 v a s f -j (3),j     • s -1 f -j .
Proof. This is a direct computation (cf. [START_REF] Caruso | Un calcul d'anneaux de déformations potentiellement Barsotti-Tate[END_REF](24)]).

Kisin varieties and tangent spaces

In this section, we show that under the weak genericity assumption (Definition 2.1) the Kisin variety is trivial; in particular, if ρ :

G K → GL 3 (F ) comes from a Kisin module M ∈ Y µ,τ (F ), then M is unique.
As a consequence, one can attach a shape w(ρ, τ ) to ρ. Later, in Proposition 7.16 (also Table 9), we show that the shape w(ρ, τ ) is closely related to the Serre weights of ρ which appear in the principal series type σ(τ ) (as was the case for GL 2 [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF]). In this section, we also show that the map on tangent spaces from deformations of Kisin modules to deformations of étale φ-modules is injective and that under mild assumptions the same is true for the restriction on Galois deformations from

G K to G K∞ . 3.1. Kisin varieties. In what follows, let F denote a finite extension of F. If M ∈ Φ-Mod ét dd (F) is an étale O E,L ⊗ Zp F-module with descent data (cf. §2.3) and R is any F -algebra, we set M R def = M ⊗ F ((u)) R((u)) ∈ Φ-Mod ét dd (R). Definition 3.1. The Kisin variety Y [0,2],τ M (R) of M is a projective scheme over Spec (F)
which represents the functor:

Y [0,2],τ M (R) def = M R ⊂ M R | M R [1/u] = M R , φ M R (M R ) ⊂ M R , M R ∈ Y [0,2],τ (R)
In other words,

Y [0,2],τ M (R) is the set of (k ⊗ Fp R)[[u]
]-lattices in M R which have type τ and height ≤ 2. We can also consider

Y µ,τ M = M R ⊂ M R | M R [1/u] = M R , φ M R (M R ) ⊂ M R , M R ∈ Y µ,τ (R) .
There is an obvious inclusion

Y µ,τ M ⊂ Y [0,2],τ M
. These are projective schemes because they are closed subschemes of finite type in the affine Grassmannian for the group Res k/Fp GL 3 .

(cf. [Kis09b, Proposition 2.1.7]: the proof there is in the height 1 case, but works for all heights.) The result for

Y µ,τ M follows from the fact that Y µ,τ is a closed substack of Y [0,2],τ (cf. [CL, Proposition 5.2]). Theorem 3.2. If τ is weakly generic (Definition 2.1), then Y µ,τ M (F ) is either empty or a single point. Proof. We show that Y [0,2],τ M (F ) is either empty or a single point. Assume we have two (k ⊗ Fp F )[[u]]-lattices M 1 and M 2 in M F . For i ∈ {1, 2} choose an eigenbasis β i for M i , such that Mat β i φ (j) M i ,s j+1 (3) = A (j)
i , where (s j ) denotes the orientation on τ . Let D (j) ∈ GL 3 (F ((u)))

f be the f -tuple of matrices which gives the basis for M 2 in terms of M 1 as in Proposition 2.15. Note that, a priori, the matrices D (j) have denominators in u.

We want to show that

D (j) ∈ GL 3 (F [[u]]
) for all j. For all j ∈ Z/f Z, let us define

I (j) = Ad -1 s j (u a 1 , u a 2 , u a 3 ) D (j) ∈ GL 3 (F ((v))
) and recall the change of basis formula (2.5) which remains valid for M:

(3.1) A (j) 2 = I (j+1) A (j) 1 s j+1,j Ad v as j(1),f -j-1 , v as j(2),f -j-1 , v as j(3),f -j-1 ϕ I (j) -1 s -1 j+1,j . For each j ∈ Z/f Z, define k j ∈ Z such that v k j I (j) =: I (j),+ ∈ Mat 3 (F [[v]]
) and such that

I (j),+ ≡ 0 mod v. Rearranging (3.1), we get (3.2) v -pkj • s j+1,j Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 • ϕ I (j),+ s -1 j+1,j = v -kj+1 A (j) 2 -1 I (j+1),+ A (j) 1 .
Multiplying through by v 2+k j+1 the right side of (3.2) becomes integral. Since

I (j),+ i,k ∈ (F ) × + vF [[v]] for some 1 ≤ i, k ≤ 3, Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ I (j),+ is at most divisible by v a s j (1),f -1-j -a s j (3),f -1-j . We conclude that (3.3) k j+1 ≥ pk j -(a s j (1),f -1-j -a s j (3),f -1-j ) -2.
Since τ is weakly generic, max j {a s j (1),f -1-j -a s j (3),f -1-j } < p -3. Thus, if k j ≥ 1 for any j, then by iterating (3.3) we deduce that all k j become arbitrary large. Thus, k j ≤ 0 for all j and

I (j) ∈ Mat 3 (F [[v]]
). Interchanging the roles of M 1 and M 2 , we conclude that

I (j) ∈ GL 3 (F [[v]]).
It remains to show that I (j) ∈ I(F ): by Lemma 2.14, this is equivalent to

D (j) ∈ GL 3 (F [[u]]).
Rearranging again the change of basis formula (2.5), we have (3.4)

A (j) 2 -1 I (j+1) A (j) 1 = s j+1,j Ad v as j(1),f -j-1 , v as j(2),f -j-1 , v as j(3),f -j-1 ϕ I (j) s -1 j+1,j . For 1 ≤ k, h ≤ 3, we have Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ I (j) hk ∈ v pα hk -(a s j (k),f -1-j -a s j (h),f -1-j )
where the integers α hk ∈ N are defined by

I (j) h,k ∈ (v α h,k
). On the other hand, the height condition on A (j) 2 forces the LHS in (3.4) to be an element in

1 v 2 Mat 3 (F [[v]]).
In particular, we have pα hk -(a s j (k),f -1-j -a s j (h),f -1-j ) ≥ -2 for all 1 ≤ k, h ≤ 3 and this implies α h,k ≥ 1 when h > k since τ is weakly generic. Therefore, I (j) ∈ I(F ), as required. Theorem 3.2 allows us to attach a shape w(ρ, τ ) to ρ : G K → GL 3 (F ) when the type τ is weakly generic: Definition 3.3. Let ρ : G K → GL 3 (F) and τ be as in Theorem 3.2. Assume there exists

M ρ ∈ Y µ,τ (F) such that T * dd (M ρ ) ∼ = ρ| G K∞ .
We define w(ρ, τ ) ∈ Adm(2, 1, 0) f to be the shape of M ρ . Whenever we invoke the shape w(ρ, τ ) implicit in that is the assertion that there exists a Kisin module M ρ as above.

Next, we study the tangent space at a closed point of M ∈ Y µ,τ (F ). Since M often has automorphisms, we work at the categorical level. Define

t M = (M, δ 0 ) | M ∈ Y µ,τ (F [ε]/ε 2 ), δ 0 : M/εM ∼ -→ M
which we consider as a category where morphisms are maps in Y µ,τ (F [ε]/ε 2 ) commuting with trivializations.

Proposition 3.4. Assume that τ is weakly generic. The functor T * dd induces a fully faithful functor

T * tan : t M → Rep F [ε]/ε 2 (G K∞ ). Proof. The functor V * dd : Φ-Mod ét dd (F [ε]/ε 2 ) → Rep F [ε]/ε 2 (G K∞
) is an anti-equivalence of categories so we are reduced to showing that

M → M[1/u] is fully faithful on t M . Let M 1 , M 2 ∈ t M . Choose an eigenbasis β of M and let A (j) = Mat β φ (j) M,s j+1(3)
. For i ∈ {1, 2}, we fix eigenbases β i of M i lifting β and write A (j) +εB

(j) i = Mat β i φ (j) M i ,s j+1(3) for some B (j) i ∈ Mat 3 (F [[v]]). An isomorphism ι : M 1 [1/u] ∼ -→ M 2 [1/u] which is trivial modulo (ε) satisfies Mat β 1 ,β 2 (ι) = id 3 + εD (j) for some D (j) ∈ Mat 3 (F ((u))). Define Y (j) def = Ad -1 s j (u a 1 , u a 2 , u a 3 ) D (j) ∈ Mat 3 (F ((v))). A direct computation using Proposition 2.15 gives B (j) 2 = B (j) 1 +Y (j+1) A (j) -A (j) s j+1,j Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ Y (j) s -1 j+1,j .
Arguing as in Theorem 3.2, we deduce that

Y (j) ∈ Mat 3 (F [[v]]). More precisely, for each i ∈ Z/f Z such that Y (i) = 0, define k i ∈ Z by v k i Y (i) = Y (i),+ ∈ Mat(F [[v]]),
where

Y (i),+ ≡ 0 modulo v. We define k i def = 0 if Y (i) = 0. We deduce as in Theorem 3.2 that v -pk j s j+1,j Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ Y (j),+ s -1 j+1,j = (3.5) = A (j) -1 -B (j) 2 + v -k j+1 Y (j+1),+ A (j) + B (j) 1
and therefore, by the height condition on A (j) :

v 2-pk j +k j+1 Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ Y (j),+ ∈ Mat 3 (F [[v]]).
If Y (j) = 0, we obtain the key inequality (3.3). The same iterative argument as above then

shows that k j ≤ 0.

It remains to show that

D (j) ∈ Mat 3 (F [[u]]
), which is equivalent to proving that Y (j) is upper triangular modulo v. This is immediate if k j < 0; otherwise, specializing (3.5) at

k j = 0 and Y (j),+ = Y (j) , we see that v 2 Ad v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ϕ Y (j)
is integral. By the weak genericity assumption, the same argument in the proof of Theorem 3.2 shows that Y (j) is upper triangular mod v.

Corollary 3.5. Assume that τ is weakly generic. If Y µ,τ M (F) = ∅ then Y µ,τ M = Spec (F).
3.2. Kisin resolution. We now apply the computations from the previous section to obtain preliminary results in our study of potentially crystalline deformation rings. Fix a representation ρ :

G K → GL 3 (F).
Let R µ,τ ρ be the framed potentially crystalline deformation ring with parallel Hodge-Tate weights (2, 1, 0) and inertial type τ as in [START_REF]Potentially semi-stable deformation rings[END_REF]. Consider the projective morphism Θ : Y µ,τ ρ → SpfR µ,τ ρ as constructed in [CL] (see Theorem 5.19 and discussion before). This is a version with descent datum of the partial resolution introduced in [Kis08, § (1.4)]. Note that

(3.6) Y µ,τ ρ × SpfR µ,τ ρ Spf(R µ,τ ρ /m) = Y µ,τ M with Y µ,τ
M as defined in the previous section. Here M is the étale ϕ-module of ρ. Since we always work in parallel weight (2, 1, 0), we drop µ from the notation. Set

D ,τ ρ def = SpfR µ,τ
ρ . For τ weakly generic, by (3.6) and Corollary 3.5, Θ is quasi-finite and hence finite since it is proper. Thus Y µ,τ ρ = SpfR τ, M,ρ with SpfR τ, M,ρ local and finite over SpfR µ,τ ρ .

Corollary 3.6. Let ρ :

G K → GL 3 (F). If τ is weakly generic, then Θ : Y µ,τ ρ → SpfR µ,τ
ρ is an isomorphism.

Proof. We saw above that Θ is a finite morphism. By [START_REF] Caraiani | Moduli of Kisin modules with descent data and parahoric local models[END_REF]Theorem 5.19], Θ[1/p] is an isomorphism. Proposition 3.4 implies that the induced map

SpfR τ, M,ρ → SpfR µ,τ ρ is an injective on tangent spaces. Hence Θ is a closed immersion. Since R µ,τ ρ is O-flat, we conclude that Θ is an isomorphism. Thus R τ, M,ρ is the complete local O-algebra representing the deformation problem (3.7) D τ, M,ρ (A) def = (M A , ρ A , δ A ) | M A ∈ Y µ,τ (A), ρ A ∈ D ,τ ρ (A), δ A : T * dd (M A ) ∼ = (ρ A )| G K∞ .
3.3. Galois cohomology. In this section, we work with Galois cohomology to prove thatunder mild hypotheses-the natural restriction map from G K -deformations to G K∞ -deformations is a closed immersion. This will be important in §5.2.

Definition 3.7. Let ρ : G K → GL 3 (F) be a continuous semisimple Galois representation and let m ∈ N be an integer. Let

a k = (a k,j ) j with 0 ≤ a k,j ≤ p -1 and j ∈ Z/f Z be f -tuples such that ρ| I K ∼ = ω a (0) 1 f ⊕ ω a (0) 2 f ⊕ ω a (0) 3 f . We say that ρ is m-generic if m ≤ |a 1,j -a 2,j |, |a 2,j -a 3,j |, |a 1,j -a 3,j | ≤ p -1 -m
for all j. We say that a continuous Galois representation ρ :

G K → GL 3 (F) is m-generic
if there exists a finite unramified extension K /K such that ρ ss | I K is the direct sum of characters and is m-generic in the previous sense. This does not depend on the extension

K /K.
There is a weaker genericity condition which suffices for our Galois cohomology arguments:

Definition 3.8. Let ρ : G K → GL n (F) be a continuous Galois representation. We say ρ is cyclotomic free if ρ becomes upper triangular over an unramified extension K /K of degree prime to p such that

H 0 G K , ρ| ss G K ⊗ ω -1 = 0. Proposition 3.9. If p > 3 and ρ : G K → GL 3 (F) is 2-generic, then ad(ρ) is cyclotomic free.
Proof. Let K denote the unramified extension of K of degree 6. Then ρ| G K is upper triangular and we can write ρ|

G K ss | I K = ⊕ 3 i=1 ω a (0) i 6f where the 6f -tuple a i ∈ {0, 1, . . . , p - 1} 6f is 2-generic. In particular, it follows that ad(ρ)| G K = ad(ρ| G K ) is upper triangular with diagonal characters of the form ω a (0) i -a (0) i 6f
, where i, i ∈ {1, 2, 3}. Its semisimplification does not have cyclotomic constituents as long as a

(0) i -a (0) i ≡ 1+p+• • •+p 6f -1 mod p 6f
-1 which follows easily from the 2-genericity assumption.

Lemma 3.10. Let ρ : G K → GL n (F) be cyclotomic free. Then the restriction map

H 1 (K, ρ) → H 1 (K ∞ , ρ) is injective.
Proof. We first assume that ρ is upper triangular. In this case the proof is a standard dévissage. More precisely, we have an exact sequence 0 → ρ 1 → ρ → χ → 0 where

χ : G K → F × is not the cyclotomic character and ρ 1 : G K → GL n-1 (F) is upper triangular (and ρ 1 | ss G K
does not contain the cyclotomic character).

Group cohomology provides us with the following commutative diagram, with exact rows:

H 0 (K, χ) δ G G f 0 H 1 (K, ρ 1 ) G G f 1 H 1 (K, ρ) G G f 2 H 1 (K, χ) f 3 H 0 (K ∞ , χ) δ G G H 1 (K ∞ , ρ 1 ) G G H 1 (K ∞ , ρ) G G H 1 (K ∞ , χ)
the vertical maps being induced by restriction to G K∞ . By [GLS15, Lemma 5.4.2], the morphism f 3 is injective. By dévissage, we can assume that f 1 is injective. Finally, as χ is a character and as all characters are tame, f 0 is surjective. Hence f 2 is injective by the "four lemma."

As for the general case, letting

K ∞ = K ∞ • K we have an exact sequence of groups 1 G G G K G G G K G G Gal(K /K) G G 1 1 G G G K ∞ G G ? y y G K∞ G G ? y y Gal(K ∞ /K ∞ ) G G y y 1
and hence restriction to G K∞ induces a morphism between the Hochschild-Serre spectral sequences

(3.8) H r Gal(K /K), H s (K , ρ) + 3 H r+s (K, ρ) H r Gal(K ∞ /K ∞ ), H s (K ∞ , ρ) + 3 H r+s (K ∞ , ρ).
As p [K : K], the category of Gal(K /K)-representations over F is semisimple and the above spectral sequence becomes simply (3.9)

H 0 Gal(K /K), H s (K , ρ) ∼ G G H s (K, ρ) H 0 Gal(K ∞ /K ∞ ), H s (K ∞ , ρ) ∼ G G H s (K ∞ , ρ).
The conclusion follows from the result in the upper triangular case.

A statement similar to Lemma 3.10 (via a slightly different argument) has been obtained in [Gao, Proposition 6.1].

A similar argument yields the following:

Lemma 3.11. Let ρ : G K → GL n (F) be cyclotomic free. Then the natural restriction map

B 1 (K, ρ) → B 1 (K ∞ , ρ)
on Galois cohomology boundaries is an isomorphism.

Proof. The argument follows closely the proof of Lemma 3.10 above. Let V ρ be the F-linear space underlying ρ. Then one has

V ρ (V ρ ) G K ∼ → B 1 (K, ρ), V ρ (V ρ ) G K∞ ∼ → B 1 (K ∞ , ρ);
therefore it is enough to prove that the (obviously injective) restriction map

H 0 (K, ρ) → H 0 (K ∞ , ρ) is surjective.
We assume first that ρ is upper triangular. Let us fix an extension 0 → ρ 1 → ρ → χ → 0, where (ρ 1 ) ss and the character χ : G K → F × do not have cyclotomic constituents. The restriction functor to G K∞ and classical group cohomology give us the following commutative diagram, with exact lines:

H 0 (K, ρ 1 ) G G f 0 H 0 (K, ρ) G G f 1 H 0 (K, χ) f 2 δ G G H 1 (K, ρ 1 ) f 3 H 0 (K ∞ , ρ 1 ) G G H 0 (K ∞ , ρ) G G H 0 (K ∞ , χ) δ G G H 1 (K ∞ , ρ 1 ).
By Lemma 3.10, the morphism f 3 is injective; for i ∈ {0, 1, 2} the morphisms f i are obviously injective. If f 0 , f 2 are both surjective, the "four lemma" again shows that f 1 is surjective as well. Therefore, by dévissage, it is enough to show that H 0 (K ∞ , χ) = 0 if and only if χ is the trivial character of G K . This is immediate as all characters are tame.

The deduction for the general case is formal: as in the proof of Lemma 3.10, the hypotheses on [K : K] give us the commutative diagram (3.9). Again, as the natural map

G K∞ /G K ∞ → G K /G K is an isomorphism, the isomorphism H 0 (K , ρ) ∼ → H 0 (K ∞ , ρ)
obtained in the upper triangular case respects the residual Galois action on both sides.

Therefore H 0 (Gal(K /K), H 0 (K , ρ) → H 0 (Gal(K ∞ /K ∞ ), H 0 (K ∞ , ρ) is an isomor- phism.
Proposition 3.12. Let ρ : G K → GL n (F) be cyclotomic free. Then the map on Galois cohomology cycles

Z 1 (K, ρ) → Z 1 (K ∞ , ρ) is injective.
Proof. If ρ is cyclotomic free, we can apply Lemmas 3.10 and 3.11 to ρ and the claim follows from the snake lemma applied to the defining sequences of Z 1 :

0 G G B 1 (K, ρ) G G G G Z 1 (K, ρ) G G H 1 (K, ρ) G G 0 0 G G B 1 (K ∞ , ρ) G G G G Z 1 (K ∞ , ρ) G G H 1 (K ∞ , ρ) G G 0. 4. Finite height K ∞ -deformations
In this section, τ will denote a weakly generic tame principal series type (Definition 2.1).

Let M ∈ Y µ,τ (F) with a basis β as in Theorem 2.21. We will now compute the deformations of (M, β) according to the shape of M. Roughly, we are giving local coordinates for Y µ,τ at M. This amounts to giving coordinates for the Pappas-Zhu local model M (µ) discussed after Definition 2.17, though this won't be used. The strategy will be to start with an arbitrary lift of M to a local Noetherian O-algebra R with finite residue field and then by a convergence process put the Frobenius into a special form where entries are polynomials with coefficients in R with controlled degree. In this special form, it is straightforward to impose the height [0, 2] condition as well as a determinant condition. The algorithm combines the u-adic and max adic topologies. For GL 2 , a similar strategy was introduced in setting of Breuil modules in [START_REF]Sur un problème de compatibilité local-global modulo p pour GL2[END_REF] and was implemented for Kisin modules for non-generic types in [CDMa].

Theorem 4.1. Let R be a complete local Noetherian O-algebra with finite residue field F and let τ be a weakly generic tame type as in Definition 2.1. Write (s j

) j ∈ S f 3 for the orientation of τ . Let M ∈ Y µ,τ (R) with M := M ⊗ R F of shape w = ( w 0 , w 1 , . . . , w f -1 ).
Then there exists an eigenbasis β for M such that for each 0 ≤ j ≤ f -1 the matrix

A (j) = Mat β (φ (j)
M,s j+1 (3) ) has the form given in row w j in Table 5.

4.1. Algorithm. Let R be a complete local Noetherian O-algebra with maximal ideal m R and residue field R/m R ∼ = F. Let P ∈ R[[u]]. For any r ∈ R, let v R (r) = max{i ∈ N | k ≥ 0, r ∈ m k R }
. This is finite unless r = 0, by Krull's intersection theorem.

Definition 4.2.

Let P = i r i v i ∈ R[[v]]. Define d R (P ) = min i {3v R (r i ) + i}.

We define Tr

l : R[[v]] → R[[v]
] to be the order v l -truncation map, defined by Tr

l i r i v i def = i≥l+1 r i v i . Given a matrix M = (M ik ) ∈ Mat n (R[[v]]), we define d R (M ) = min i,k {d R (M ik )} and Tr l (M ) def = (Tr l (M ik )). Proposition 4.3. For any P, Q ∈ Mat n (R[[v]]
) and any l ∈ N, we have

(1) d R (P + Q) ≥ min(d R (P ), d R (Q)); (2) d R (P Q) ≥ d R (P ) + d R (Q); (3) d R (Tr l (P )) ≥ d R (P ).
Proof. This follows from v R (ab The algorithm proceeds by successive row operations which we introduce now. For any

) ≥ v R (a) + v R (b) and v R (a + b) ≥ min(v R (a), v R (b)) for a, b ∈ R.
x ∈ R[[v]],
we define

U 12 (x) :=     1 x 0 0 1 0 0 0 1     , U 13 (x) :=     1 0 x 0 1 0 0 0 1     , U 23 (x) :=     1 0 0 0 1 x 0 0 1     .
Similarly, for any x ∈ vR[[v]], we define

L 21 (x) :=     1 0 0 x 1 0 0 0 1     , L 31 (x) :=     1 0 0 0 1 0 x 0 1     , L 32 (x) :=     1 0 0 0 1 0 0 x 1     . D 11 (x) :=     1 + x 0 0 0 1 0 0 0 1     , D 22 (x) :=     1 0 0 0 1 + x 0 0 0 1     , D 33 (x) :=     1 0 0 0 1 0 0 0 1 + x     .
The essence of the algorithm is as follows. Let

β n = (β (j)
n ) be an eigenbasis for M R at the n-th step of the algorithm. If A

(j) n = Mat βn (φ (j)
M,s j+1 (3) ), we can always write

A (j) n = B (j) w j ,n + E (j) n
where the entries of B (j)

w j ,n ∈ Mat 3 (R[[v]]
) satisfy degree bound conditions according to the shape w j of M (j) R (the degree bound conditions are listed in Table 5; this will be made precise in Definition 4.5 below.)

We call E (j) n the error term associated to β n . The inductive step is to show that there exists a new eigenbasis β n+1 with error E (j)

n+1 such that min j (d R (E (j) n+1 )) > min j (d R (E (j) n )).
We start with a few definitions.

Definition 4.5. Let A (j) ∈ Mat 3 (R[[v]]
) and w j ∈ W be the shape of M at j. Then there exists a unique decomposition in Mat 3 (R[[v]])

A (j) = B (j) w j + E (j)
such that B (j)

w j ∈ Mat 3 (R[v]
) and for all i, k one has

deg v B (j) w j ik = deg v A (j) w j ik < val v (E (j) ik )
where deg v A (j)

w j ik ∈ {-∞, 0, 1, 2}
is defined in the third column of Table 5. (In the notations of Table 5, an entry of the form i * , i ∈ N, stands for a polynomial in R[v] of degree i and whose leading coefficient is a unit in R; an entry of the form v(≤ i) stands for a polynomial in R[v] of degree at most i + 1 and which is moreover divisible by v; a similar comment applies for entries of the form ≤ i and v(i * ).)

The defect of A (j) at the entry (ik) is defined as δ(A

(j) ik ) def = d R (E (j)
ik ). Similarly, the total defect of A (j) is defined as

δ(A (j) ) def = d R (E (j) ).
Typically, the matrix A (j) in definition 4.5 is either Mat β (φ

(j)
M,s j+1 (3) ) in some eigenbasis β on M R , or its modification by row and (adjoint ϕ-twisted)-column operations by U ik (x (j) ), L ik (x (j) ) (cf. Proposition 4.6, Proposition 4.11).

Let (x (j) ) denote an f -tuple of elements of R [[v]]. An elementary operation (associated to (x (j) )) is a change of eigenbasis on M R such that for each embedding j, the associated matrix D (j) as in Proposition 2.15 can be written as D (j) = Ad s j (u a 1 , u a 2 , u a 3 ) I (j) for some

I (j) ∈ {U ik (x (j) ), L ki (x (j) ) | i < k} ∪ {D ii (x (j) )}.
The following proposition controls the change in precision after right multiplication by s -1 j+1 s j I (j),ϕ s -1 j s j+1 (cf. (2.5)) in terms of the precision of an elementary operation I (j) .

Proposition 4.6. Let M ∈ Y [0,2],τ (R), with eigenbasis β, and let A (j) = B (j)

w j + E (j) as in Definition 4.5, where we have set

A (j) def = Mat β (φ (j)
M,s j+1(3) ). Let (I (j) ) be an elementary operation associated to the f -tuple (x (j) ) and define

I (j),ϕ def = Ad(v a s j (1),f -1-j , v a s j (2),f -1-j , v a s j (3),f -1-j ) • ϕ I (j) -1 .
Then one has

A (j) s -1 j+1 s j I (j),ϕ s -1 j s j+1 = B (j) w j + E (j)
where

(1) d R (E (j) ) ≥ min(δ(A (j) ), 3 + d R (x (j) )); (2) d R (E (j) -E (j) ) ≥ 3 + d R (x (j) ).
Proof. We saw in Proposition 2.16 that

I (j),ϕ = id + v 3 X where X ∈ Mat(R[[v]]
). The same calculation shows that d R (X) ≥ d R (x (j) ). Therefore

A (j) • s j+1,j • I (j),ϕ • s -1 j+1,j = B (j) w j + E (j) id + v 3 s j+1,j Xs -1 j+1,j + v 3 B (j) w j s j+1,j Xs -1 j+1,j
which immediately implies items (1) and (2) in the statement of the Proposition. Note that E (j) is actually the error term associated to

A (j) • s j+1,j • I (j),ϕ • s -1 j+1,j , since v 3 |E (j) -E (j)
and the degree bounds appearing in Table 5 are at most 2.

Corollary 4.7. In the setting of Proposition 4.6, assume that in the elementary operation (I (j) ) only the element I (j+1) is not the identity. Set (A

(j) 1 ) def = (A (j) ) and let (A (j)
2 ) be the f -tuple obtained by performing the elementary operation (I (j) ) on (A

(j) 1 ). Then if f > 1, one has: (1) A (j) 2 = I (j+1) A (j) 1 ; and (2) δ(A (j+1) 2 ) ≥ min(δ(A (j+1) 1 ), 3 + d R (x (j+1) )). If f = 1, then d R (A (j) 2 -I (j+1) A (j) 1 ) ≥ 3 + d R (x (j+1) ).
We introduce the crucial notion of pivots associated to a shape: Definition 4.8. Let w j ∈ W be the shape at j of M ∈ Y [0,2],τ (F). The pivots of w j are the pairs (m, k) such that the (m, k)-entry of

w j ∈ N GL 3 (T )(F((v))) is non-zero.
Let M ∈ Y [0,2],τ (R) be a Kisin module and let w j be the shape of

M def = M ⊗ R F at j. If A (j) = Mat β (φ (j)
M,s j+1 (3) ) with respect to an eigenbasis β, and such that A (j) is given by the second column of Table 5, we say that the pair (m,

k) ∈ {1, 2, 3} 2 is a pivot of A (j) if (m, k)
is a pivot of the shape w j . We define the degree of the pivot (m, k) to be deg v (A

(j) mk ).
Remark 4.9. We explain how to produce the bounded degree conditions in the third column of Table 5, starting from the position and the degree of the pivots. (Note that the pivots of the matrices in the third column of Table 5 are exactly the starred entries.) Heuristically the effect of change of eigenbases on (A (j) ) is very close to left-multiplication by elements in (I 1 (R)) f . If we literally use left multiplication, we would be able to make A (j) have polynomial entries and moreover if (m, k) is a pivot of A (j) of degree i, we see that any entry above (m, k) has degree strictly less than i and any entry below (m, k) has degree at most i. All the strict lower triangular entries of A (j) must be divisible by v by construction.

The key lemma that enables us to control the convergence is the following:

Lemma 4.10. Keep the notation as in Definition 4.8. Assume that the eigenbasis β lifts a gauge basis β of M R (cf. Definition 2.22; in particular A (j) = A (j)

w j as in Table 4). Let (m, k) be a pivot for A (j) of degree i. For all k ≥ k, we can write

A (j) mk = v i P mk + Q mk
where all the coefficients of Q mk lie in the maximal ideal of R. For all k < k, we can write

A (j) mk = v i+1 P mk + Q mk
where all the coefficients of Q mk lie in the maximal ideal of R.

In particular, if k ≥ k, then d R (A (j) mk ) ≥ i whereas if k < k then d R (A (j) mk ) ≥ i + 1.
Proof. Modulo m R , the matrices A (j) are of the form wj I, and thus every entry to the left (in the same row) of a pivot of degree i is divisible by v i+1 , while every entry to the right is divisible by v i . The last statement follows noting that i ≤ 2 and d R (Q mk ) ≥ 3.

The following Proposition shows that by suitable row operations via the elementary matrices U ik (x (j) ), L ik (x (j) ), D ii (x (j) ), we can strictly increase the defect of an entry of A (j) without decreasing the total defect of A (j) .

Proposition 4.11. Keep the notations and assumptions of Lemma 4.10. Assume that (m, k) is a pivot of A (j) . There exists x ∈ R[ [v]] such that, by letting

A ,(j) def =        U m m (x)A (j) if m < m, D mm (x)A (j) if m = m, L m m (x)A (j) if m > m,
one has δ(A ,(j) ) ≥ δ(A (j) ) and moreover δ(A

,(j) m k ) > δ(A (j) m k ), δ(A ,(j) rs ) ≥ min(δ(A (j) rs ), δ(A (j) )+ 1) unless r = m , s > k.
Proof. Let us write A (j) = B (j) w j + E (j) as in Definition 4.5 and let δ = δ(A (j) ) be the total defect of A (j) . Let i ∈ {0, 1, 2} be the degree of the pivot of A (j) at (m, k). As A

(j) mk ∈ F[[v]] is a monomial in v (cf. Definition 4.8), we can write A (j) mk = u mk v i + Q mk for some unit u mk ∈ R × and some element Q mk ∈ R[[v]] verifying d R (Q mk ) ≥ 3.
Let us consider the case m < m. By the definition of the error term E (j) , we have

E (j) m k ∈ v i R[[v]].
In particular, we can write E (j)

m k = v i P m k for some P m k ∈ R[[v]] verifying d R (P m k ) = d R (E (j) m k )-i ≥ δ-i. We set x def = -u -1 mk P m k . We have A ,(j) m k = (B (j)
w j ) m k +xQ mk . Letting E ,(j) be the error term of A ,(j) , by Proposition 4.3, we have

d R (E ,(j) m k ) ≥ d R (Q mk ) + d R (P m k ) ≥ 3 + δ -i > δ.
We now verify that δ(A ,(j) ) ≥ δ. Indeed, we have A

,(j) ik = A (j)
ik for all i = m and 1 ≤ k ≤ 3.

If i = m and k = k, we have A ,(j) m k = A (j) m k -u -1 mk P m k A (j) mk .
By Lemma 4.10, we conclude that d R (P m k A (j) mk ) ≥ i+d R (P m k ) ≥ δ and that the inequality is strict unless k > k. This completes the proof in the case m < m. The other cases are similar.

Remark 4.12. The element x ∈ R [[v]] used in the proof of Proposition 4.11 always has the

property that d R (x) ≥ δ(A (j) ) -2, since i ≤ 2. Proposition 4.13. Let M ∈ Y [0,
2],τ (R) and let β be a gauge basis of M. Let β be an eigenbasis of M lifting β and for all 0

≤ j ≤ f -1 set A (j) = Mat β (φ (j)
M,s j+1 (3) ). There exists another eigenbasis β lifting β such that min j δ(A ,(j) ) > min j δ(A (j) ) for all 0 ≤ j ≤ f -1, where A ,(j) def = Mat β (φ

(j)
M,s j+1 (3) ). Furthermore, if

Ad -1 s j (u a 1 , u a 2 , u a 3 ) D (j) = I (j)
as in Proposition 2.15, then d R (I (j) ) ≥ δ(A (j) ) -2

Proof. Let (m 1 , 1), (m 2 , 2) and (m 3 , 3) be the pivot entries for A (j) , and put δ = min j δ(A (j) ).

We consider first the case f > 1. Using the operations as in Corollary 4.7 with I (j+1) given by the matrices in Proposition 4.11 for the pivot (m 1 , 1), we can find a change of basis such that with respect to the new basis, the matrix A (j) will have entries in its first column of defect > δ. Apply the same argument for the second and the third column, we can make also the second and third column entries have defect > δ noting that by performing the elementary operations in this order, the last part of Proposition 4.11 guarantees that we do not lose the increased defect of an entry of A (j) that was already made to have defect > δ.

During this process, Corollary 4.7 and Remark 4.12 show that even though δ(A (j+1) ) may decrease, whenever it decreases then the decreased value is automatically ≥ δ + 1. Thus, by performing this process for each j, we arrive at an eigenbasis satisfying the first part of the Proposition.

The claim on d R (I (j) ) follows now by Remark 4.12.

Lemma 4.14.

Let (x ) ≥1 be elements of R[[v]]. If lim →∞ d R (x ) = ∞, then there exists x ∈ R[[v]] such that x = ∞ =1 x . Proof. This is because R[[v]] is (m R , v)-adically complete.
Proof of Theorem 4.1: By a repeated application of Proposition 4.13, we can find a sequence of bases whose change of basis matrix converge by the above Lemma. Taking the limit change of basis matrix produces an eigenbasis with respect to which A (j) has the desired form.

4.2. Gauge basis. We introduce the crucial notion of gauge basis for a Kisin module

M ∈ Y [0,2],τ (R)
, and study some of its properties.

A (j) w j def = Mat β (φ (j)
M,s j+1 (3) ) satisfies the degree conditions in the third column, row w j in Table 5.

We now consider the question of the uniqueness of the gauge basis constructed by the algorithm from the previous section. While the basis is not unique, it is unique up to component-wise scaling by a torus. Let M ∈ Y [0,2],τ M (R). Any eigenbasis β for M induces an eigenbasis on M/uM (i.e., a basis for M (j) /uM (j) for each j compatible with the linear action of descent datum). We denote this by β mod u. The key consequence of Theorem 4.16 which we will use in the next section is that the addition of a gauge basis is a formally smooth operation.

Proof. Given a gauge basis β = (β (j) ), scaling any β (j) by the diagonal torus T (R) gives a new gauge basis. Hence, the map is surjective.

It suffices then to show that if β 1 and β 2 are two gauge bases such that (4.1)

β 1 mod u = β 2 mod u then β 1 = β 2 . Let us write A (j) i def = Mat β i (φ M,s j+1 (3)
) for i = {1, 2} (we omit the subscript w j to ease notation). Then the change of basis formula (2.5) gives us

A (j) 2 s -1 j+1 s j Ad(v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 )•ϕ(id 3 +I (j) ) s -1 j s j+1 = (id 3 +I (j+1) ) A (j) 1
where all entries of I (j) which are on or below the diagonal are divisible by v. By the weak genericity assumption, we see as in the proof of Proposition 4.6 that

s -1 j+1 s j Ad(v a s j (1),f -j-1 , v a s j (2),f -j-1 , v a s j (3),f -j-1 ) • ϕ(I (j) ) s -1 j s j+1 = v 3 M (j)
where

M (j) ∈ Mat 3 (R[[v]]) verifies d R (M (j) ) ≥ d R (I (j)
). We obtain:

(4.2)

A (j) 2 + v 3 A (j) 2 M (j) = A (j) 1 + I (j+1) A (j) 1 .
From equation (4.2), we now show that for all n ∈ N, d R (I (j) ) ≥ n for all j = 0, . . . , f -1, i.e., that I (j) = 0, for all j = 0, . . . , f -1. Suppose we have d R (I (j) ) ≥ δ for all j.

Set A

(j) def = A (j) 1 ⊗ R F = A (j)
2 ⊗ R F. We define a pivot (k(1), m(1)) ∈ {1, 2, 3} 2 of degree i(1) (cf. Definition 4.8) via the requirement that A km(1) = 0 for all k = k(1) and i(1) is minimal among the degrees of the pivots of A (j) . Similarly, we define a pivot (k(2), m(2)) ∈ {1, 2, 3} 2 of degree i(2) via the requirement that A km(2) = 0 for all k = k(1), k(2) and i(2) is minimal among the degrees of the pivots of A (j) which are different from (k(1), m(1)). We write (k(3), m(3)) for the remaining pivot, of degree i(3). Table 4 shows that a choice of pivots like this exists, because each A (j) is obtained from an upper triangular matrix by permuting rows and columns. Note that (i(1), i(2), i(3)) = (0, 1, 2) or (1, 1, 1).

For instance, in shape αβα, we have (k(1), m(1)) = (3, 1), (k(2), m(2)) = (2, 2) and

(k(3), m(3)) = (1, 3
) and they all have degree 1.

For l ∈ {1, 2}, we have d R (( 3) for all k but, when i(3) = 2 then one loses precision and we just have d R (( A (j) 1 ) km(3) ) + 1 ≥ i(3) for k = k(3). Moreover, since a pivot reduces to a monomial modulo the maximal ideal of R, we have ( A

A (j) 1 ) km(l) ) ≥ i(l) for all k ∈ {1, 2, 3}. Furthermore, d R (( A (j) 1 ) km(1) ) ≥ 3 if k = k(1) and d R (( A (j) 1 ) km(2) ) ≥ 3 for k = k(1), k(2). If i(3) = 1, then one still has d R (( A (j) 1 ) km(3) ) ≥ i(
(j) 1 ) k(l)m(l) = x * l v i(l) + E l where d R (E l ) ≥ 3 and x * l ∈ R × .
For all n ∈ {1, 2, 3}, we now compare the nm(1)-th entry of equation (4.2). We use Tr s for truncation (cf. Proposition 4.3) which deletes the terms of degree ≤ s. Taking s = i(1) -δ n<k(1) (the degree at the entry (nm(1))), one has

I (j+1) nk(1) x * 1 v i(1) + I (j+1) nk(1) E 1 + Tr s I (j+1) nk(2) ( A (j) 1 ) k(2)m(1) + Tr s I (j+1) nk(3) ( A (j) 1 ) k(3)m(1) = v 3 A (j) 2 M (j)
nm(1) .

Here we use that the truncation kills off the contribution of A

D τ,β M → Y µ,τ M is a torsor for G 3f m .
The main result of this subsection is the following: Theorem 4.17. The deformation problem D τ,β M is representable by a complete local Noetherian O-algebra R τ,β M . Let (M univ , β univ ) be the universal family over R τ,β M . Then Mat β univ (φ

(j) M univ ,s j+1 (3) ) is given in column 4 of Table 5. Furthermore, (4.3) R τ,β M ∼ = ⊗ j (R expl w j ) p-flat, red
where R expl w j is given in the second column of Table 6 and (R expl w j ) p-flat, red denotes its p-flat and reduced quotient.

In order to prove Theorem 4.17, we need the following preliminary result from [CL].

Recall that the p-adic Hodge type ≤ (2, 1, 0) condition is imposed by flat closure from the generic fiber; Theorem 5.13 and Corollary 5.12 in [CL] give a characterization of points of Y τ,µ for p-flat and reduced O-algebras R. In our setting, this translates into the following:

Proposition 4.18. Let R be a complete local Noetherian flat reduced O-algebra. Consider M R ∈ Y [0,h],τ (R) for some h and let A (j) = Mat β φ (j) M,s j+1(3) for any eigenbasis β of M R . Then M R ∈ Y µ,τ (R) if and only if (1) det(A (j) ) = x * j P (v) 3 for x * j ∈ R[[v]] × ; (2) P (v) 2 (A (j) ) -1 ∈ Mat 3 (R[[v]][1/p]) (recall that P (v) = v + p).
We explain how 4.18 was used to generate column 4 of Table 5 and hence column 2 of Table 6. Letting A (j) w j be the universal matrix lifting A (j) which satisfies the degree conditions in the third column, row w j of Table 5, then R expl w j is obtained by first imposing the conditions i) for all 1 ≤ i, k ≤ 3 the (ik)-minor satisfies

A (j) w j (ik) ≡ 0 modulo P (v); ii) det A (j) w j = x * j P (v) 3
. and then performing a partial p-saturation process of the relations. For example, whenever we have the condition

(v + p) | v k Q(v), we actually get (v + p) | Q(v). The resulting R expl w j
in rows from αβαγ to αβγ in Table 5 are p-flat and reduced. We do not claim that the remaining rings are p-flat and reduced, and we will not need that information.

Proof of Theorem 4.17. Since D τ,β M is a formal torus torsor on Y µ,τ M and has no non-trivial automorphisms, we deduce that D τ,β M is representable. The representing ring R τ,β M is p-flat and reduced, as it is equisingular to a complete local ring of M (µ).

Let R denote the right hand side of (4.3). Since R is p-flat and reduced, the relations in R implies that the obvious Kisin module M with gauge basis over R is actually inside Y µ,τ M by Proposition 4.18. (The Kisin module M is defined as the unique Kisin module with descent data of type τ endowed with an eigenbasis β such that Mat β φ

(j) M,s j+1(3) = A (j) w j .
Note that M has finite height since by construction it satisfies the determinant condition.) Thus there exists a unique map g : R τ,β M → R such that g * (M univ , β univ ) = (M, β). On the other hand the definition of the gauge basis, the elementary divisors condition satisfied by M univ and the fact that R τ,β M is reduced and p-flat show that there is a map h : R → R τ,β M such that (M univ , β univ ) = h * (M, β). One easily checks that the maps g and h are inverse of each other.

Remark 4.19. Under the hypotheses of Theorem 4.17, it can be shown that Y µ,τ M has dimension 4f over O which implies that R τ,β M has dimension 7f over O. However, we will not need this information in this paper.

We end this section by giving some sample computations of the partial p-saturation process mentioned above: The computations for the other cells are analogous and left to the reader.

Monodromy and potentially crystalline deformation rings

In the previous section, we essentially computed certain finite height G K∞ Galois deformation rings. We will now describe (framed) potentially crystalline deformation rings R (2,1,0),τ ρ of p-adic Hodge type (2, 1, 0) at each embedding and Galois type τ . The codimension of Spec R

(2,1,0),τ ρ [1/p] in the finite height G K∞ -deformation space is f , the difference being the existence of a monodromy operator (cf. [START_REF] Kisin | Crystalline representations and F -crystals[END_REF]). We describe this condition explicitly in Theorem 5.6. In most cases, it can be described by f equations on the generic fiber (one for each embedding of K into Q p ). Although the equations involve power-series, they can be expressed as polynomial conditions plus a transcendental part which is divisible by a high power of p (due to the genericity condition).

In section §5.3, we obtain (in most cases) integral equations for the deformation rings by analyzing the p-flatness properties of these equations. As a result, we obtain descriptions of the special fibers of the deformation spaces. In §7, we use these descriptions to prove instances of the Serre weight conjectures and modularity lifting.

M Λ ∈ Y [0,2],τ (Λ), we define its base change to O rig as M rig Λ def = M Λ ⊗ S O rig . We have a decomposition M rig Λ = ⊕ f -1 j=0 M rig,(j) Λ .
One has the following important result:

Theorem 5.1. The module

M rig Λ [1/λ] is equipped with a canonical derivation N M rig Λ over N ∇ such that (5.1) N M rig Λ φ M rig Λ = E(u)φ M rig Λ N M rig Λ and N M rig Λ mod u = 0. The module M rig Λ is stable under N M rig Λ if and only if T * dd (M Λ )[1/p] is the restriction to G K∞ of a potentially crystalline representation of G K which becomes crystalline when restricted to G L .
Proof. This is essentially [Kis06, Corollary 1.3.15]. It is stated there without tame descent data, however, using the full faithfulness of the restriction from crystalline G Lrepresentations to G L∞ -representations (Corollary 2.1.14 loc. cit.) one can extend the result to the potentially crystalline case.

We remark that the monodromy operator

N M rig Λ respects the decomposition M rig Λ = ⊕ f -1 j=0 M
rig,(j) Λ

. In particular, one has

N (j+1) M rig Λ φ (j) M rig Λ = E(u)φ (j) M rig Λ N (j) M rig Λ
where N .

Let M Λ ∈ Y [0,2],τ (Λ) be as above and let β = {β (j) } be an eigenbasis for M Λ . Given the finite height conditions on M Λ , we always have

N M rig Λ (M Λ ) ⊂ 1 λ M rig Λ by same argument from [Kis06, Proposition 2.2.2].
In what follows, we set C (j-1) def = Mat β (φ

(j-1)
M Λ ) and define the matrix of the monodromy at j as N (j)

∞ def = Mat β (N (j) M rig Λ ).
The following Lemma shows that we can construct N (j)

∞ by successive approximation. We state it in a slightly greater generality than our specific situation.

Lemma 5.2. Let τ be a tame inertial type and let M Λ ∈ Y [0,2],τ (Λ) be a Kisin module over

Λ. Let N (j) 0 = 0 for all j ∈ Z/f Z. For each i ≥ 1, set N (j) i def = E(u)C (j-1) ϕ(N (j-1) i-1 )(C (j-1) ) -1 -N ∇ (C (j-1) )(C (j-1) ) -1 . Then N (j) i converges in 1 λ Mat(O rig Λ ) to N (j) ∞ . Moreover, Ad s j (u a 1 , u a 2 , u a 3 ) N (j) ∞ ∈ Mat 3 (O rig Λ ) ∆=1 .
Proof. We show by induction that (5.2) λ(N

(j) i+1 -N (j) i ) ∈ u p i-1 Mat(O rig Λ )
for all j and i ≥ 1. This proves that λN

(j) i converges to λ N (j) ∞ in Mat(Λ[1/p][[u]]
) and satisfies the commutation relation with Frobenius, and thus we conclude that λ N (j)

∞ = λN (j) ∞ ∈ Mat 3 (O rig
Λ ) (a priori, the convergence happens in a formal power series ring, however one can estimate the Gauss norms to see that sequence actually converges in O rig Λ ). The inductive step for i ≥ 1 follows easily from the relation

λ N (j) i+1 -N (j) i = E(u) 2 p C (j-1) ϕ λ N (j-1) i -N (j-1) i-1 (C (j-1) ) -1 since we have E(u) 2 C (j-1) -1 ∈ Mat(Λ[[u]]
) by the height condition. For the base case, we consider λN

(j) 1 = -λN ∇ (C (j-1) )(C (j-1) ) -1 .
By the height condition, λ 2 C (j-1) -1 ∈ Mat(O rig Λ ) so it suffices to show that

(5.3) 1 λ N ∇ (C (j-1) ) ∈ u Mat(Λ[[u]])
which is obvious.

The last assertion is an immediate consequence of the compatibility between the descent data action on M rig Λ and the monodromy operator.

We now state the condition which controls the poles of the monodromy operator. Recall that we fixed π def = (-p)

1 p f -1 as a uniformizer for L. Proposition 5.3. Let M Λ ∈ Y [0,2]
,τ (Λ) with eigenbasis β, and write Mat β (N

(j) M rig Λ ) = N (j) ∞ = lim i→∞ N (j) i as in Lemma 5.2. Then M rig Λ is stable under N M rig Λ if and only if λN (j) ∞ | u=π = 0 for all j.
Proof. Since λN

(j) ∞ ∈ Mat(O rig Λ ), M rig Λ is stable under N M rig Λ if and only if λN (j)
∞ is divisible by λ. Since λ has simple zeroes exactly at

ζπ 1/p n | n ≥ 0, ζ ∈ O, ζ p n e = 1 , it suffices to show that λN (j) ∞ | u=ζπ 1/p n = 0
for all n ≥ 0, ζ and all j. The commutation relation N

(j) M rig Λ φ (j-1) M rig Λ = E(u)φ (j-1) M rig Λ N (j-1) M rig Λ translates into N (j) ∞ C (j-1) + N ∇ (C (j-1) ) = E(u)C (j-1) ϕ N (j-1) ∞ .
Since C (j-1) is invertible at ζπ 1/p n when n > 0 and N ∇ (C (j-1) ) is divisible by λ, we see that

λN (j-1) ∞ | u=ζ p π 1/p n-1 = 0 =⇒ λN (j) ∞ | u=ζπ 1/p n = 0.
for all n > 0. Thus, we are reduced to checking the pole condition at u = ζπ for ζ being an e-th root of unity. As N

∞ are all conjugate to matrices in Λ[1/p][[v]] by Lemma 5.2, we are reduced to check the condition at u = π.

By construction, N (j)

∞ only depends on the (C (j) ). So, of course, λN

∞ | u=π also only depends on the C (j) . In general, however this could be a complicated condition on the coefficients of (C (j) ). We now show in fact this condition can be written as an explicit polynomial equation plus an "error" term which is divisible by a power of p depending on the genericity of τ . If τ is sufficiently generic, the special fiber of R (2,1,0),τ ρ will only depend on the "leading term."

We will want to apply our condition to the universal finite height deformations constructed in §4.2. Let R be any complete local Noetherian flat O-algebra with finite residue field. Define O rig R to be the power series ∞ i=0 a n u n with a n ∈ R[1/p] such that p n a k n → 0 for all k > 0.

Let M R ∈ Y [0,2],τ (R) equipped with an eigenbasis β. As before, we let C (j) def = Mat β (φ

(j) M R ) and write Mat β (N (j) M rig R ) = N (j) ∞ = lim i→∞ N (j) i as in Lemma 5.2. Note that N (j) ∞ ∈ 1 λ Mat 3 (O rig R
). We will now study the convergence in Lemma 5.2 more carefully.

Lemma 5.4. We have

1 λ N ∇ (C (j-1) ) = Ad s j (u a 1 , u a 2 , u a 3 )(A (j-1), † )
where

A (j), † ∈ Mat 3 (R[[v]]). Furthermore, A (j), † mod v is upper triangular nilpotent.
Proof. Applying Leibniz rule to (2.4), we see that (5.4)

A (j-1), † = -u d du A (j-1) -Diag(a (j) s j (1) , a (j)
s j (2) , a (j)
s j (3) )A (j-1) + A (j-1) Diag(a (j)

s j (1) , a (j)
s j (2) , a (j)
s j (3) )
which is a matrix in v. Furthermore, -u d du A (j-1) is divisible by v and the rest is 0 modulo v along the diagonal. Definition 5.5. We define the leading term as P N (A (j-1) ) def = A (j-1), † P (v) 2 (A (j-1) ) -1 .

Note that

P N (A (j-1) ) ≡ z j -ev d dv A (j-1) + A (j-1) Diag(a (j)

s j (1) , a (j)
s j (2) , a (j)
s j (3) ) 1 P (v)
adj(A (j-1) ) modulo P (v), where z j ∈ R * is a suitable unit.

The following theorem is the main result of this section:

Theorem 5.6. Let M R ∈ Y [0,2],τ (R) equipped with an eigenbasis β and let N (j) ∞ ∈ 1 λ Mat 3 (O rig R ) be defined as in Lemma 5.2 above. Assume that τ is n-generic with n ≥ 2. Then Ad -1 s j (u a 1 , u a 2 , u a 3 )(λN (j) ∞ ) | u=π = z P N (A (j-1) ) | u=π -p n-1 M (j) err
where z is a unit in R[1/p], P N (A (j-1) ) is as in Definition 5.5 and M (j) err ∈ Mat 3 (R). Moreover there exists a matrix Z (j) ∈ Mat 3 (R) such that

M (j) err = A (j-1) | v=-p Z (j) P (v) 2 (A (j-1) ) -1 | v=-p .
Proof. Let's examine the sequence from Lemma 5.2 in more detail. Consider that

N (j) ∞ = N (j) 1 + ∞ i≥1 (N (j) i+1 -N (j) i ) = N (j) 1 + ∞ i≥1 C (j-1) ϕ(N (j-1) i -N (j-1) i-1 )E(u)(C (j-1) ) -1 = N (j) 1 + ∞ i≥1 i-1 k=0 ϕ k (C (j-k-1) ) ϕ i (N (j-i) 1 ) 0 k=i-1 ϕ k (C (j-k-1), * )
where C (j), * := E(u)(C (j) ) -1 .

From Lemma 5.4, we deduce that

λN (j) 1 = - ϕ(λ) 2 p 2 Ad s j (u a 1 , u a 2 , u a 3 )(P N (A (j-1) )). Let z = -ϕ(λ) 2 p 2 | u=π which is in 1 p 2 O × K since ϕ n (E(u)/p) has constant term 1. Now consider the trailing term p 2 λ i-1 k=0 ϕ k (C (j-k-1) ) ϕ i (N (j-i) 1 ) 0 k=i-1 ϕ k (C (j-k-1), * ) for i ≥ 1. Substituting N (j-i) 1 = ϕ(λ) p u d du C (j-i-1) C (j-i-1
), * , we can rewrite this as (5.5)

X (j) i := ϕ i+1 (λ) 2 p i i-1 k=0 ϕ k (C (j-k-1) ) ϕ i u d du C (j-i-1) 0 k=i ϕ k E(u)C (j-k-1), * .
We would now "remove the descent datum" and write this as an expression in the A (j) 's.

Define

(5.6)

Z (j) i = Ad -1 s j (u a 1 , u a 2 , u a 3 ) 1 ϕ i+1 (λ) 2 X (j) i ;
and note that so far we can write

p 2 Ad -1 s j (u a 1 , u a 2 , u a 3 )(λN (j) ∞ ) = -ϕ(λ) 2 P N (A (j-1) ) + ∞ i≥1 ϕ i+1 (λ) 2 Z (j) i .
We inductively show that Z

(j) i ∈ v (n-1)p i-1 p i Mat(R[[v]]) when i > 1 and Z (j) 1 ∈ v n p Mat(R[[v]]) (recall that n ≤ p-1
2 ). This suffices to prove the first part of the Theorem by evaluating at u = π (i.e. v = -p), and shows in particular that (5.7)

M (j) err = 1 ϕ(λ) 2 ∞ i≥1 ϕ i+1 (λ) 2 Z (j) i | v=-p p n-1 with Z (j) i | v=-p p n-1 ∈ Mat 3 (R) for all i ≥ 1.
First observe that by compatibility with descent datum and by the height condition

Ad -1 s j (u a 1 , u a 2 , u a 3 )(ϕ k (C (j-k-1) )), Ad -1 s j (u a 1 , u a 2 , u a 3 )(ϕ k (E(u)C (j-k-1), * )) ∈ Mat(R[[v]]).
The key divisibility comes from the middle term. Take = j -i, then

Y (j), † i := -Ad -1 s j (u a 1 , u a 2 , u a 3 ) ϕ i u d du C ( -1)
=s Ad u

p i a ( ) s (1) -a (j)
s (1) , u

p i a ( ) s (2) -a (j) s (2) , u p i a ( ) s (3) -a (j) s (3) ϕ i (A ( -1), † ) s -1 =s Ad (v r i,1 , v r i,2 , v r i,3 ) ϕ i (A ( -1), † ) s -1
for some s ∈ S 3 , by the same calculation as in (2.8). We have u

p i a ( ) s (k) -a (j) s (k) = u er i,k = v r i,k
for some r i,k where r i,1 > r i,2 > r i,3 . When i = 1, we have r 1,k = a s (k),f --1 and by the n-genericity condition,

p -1 -n ≥ |r 1,1 -r 1,2 |, |r 1,2 -r 1,3 | ≥ n which implies that v n | Y (j), † 1
. When i > 1, an elementary calculation shows that

(p -1 -n)p i-1 ≥ |r 1,1 -r 1,2 |, |r 1,2 -r 1,3 | ≥ (n -1)p i-1
and so v (n-1)p i-1 | Y (j), † i

. We now prove the second statement in the Theorem. An easy computation shows that, by letting s j,j-1 def = s -1 j s j-1 (cf. the proof of Proposition 2.15), one has

Z (j) i = A (j-1) Ad -1 s j (u a 1 , u a 2 , u a 3 ) Ad s j-1 (u pa 1 , u pa 2 , u pa 3 ) ϕ(Z (j-1) i-1 ) p P (v) 2 (A (j-1) ) -1 = A (j-1) s j,j-1 Ad(v a s j-1 (1),f -j , v a s j-1 (2),f -j , v a s j-1 (3),f -j ) ϕ(Z (j-1) i-1 ) p s -1 j,j-1 P (v) 2 (A (j-1) ) -1
for all j = 0, . . . , f -1 and i ≥ 1 (and where we define

Z (j-1) 0 def = Ad s j-1 (u a 1 , u a 2 , u a 3 ) u d du C (j-2
) for all j). We now prove that Ad(v

a s j-1 (1),f -j , v a s j-1 (2),f -j , v a s j-1 (3),f -j ) ϕ(Z (j-1) i-1 ) p | v=-p ∈ p n-1 Mat 3 (R)
for all i ≥ 1 from which the conclusion follows easily from (5.7).

For i > 1 we have ϕ(Z

(j-1) i-1 ) p | v=-p ∈ p p-2 Mat 3 (R)
using the fact that ϕ(Z

(j-1) i-1 ) p ∈ v (n-1)p i-1 p i Mat 3 (R[[v]]) for i ≥ 3 and ϕ(Z (j-1) 1 ) p ∈ v pn p 2 Mat 3 (R[[v]]
). This together with the n-genericity of τ gives the desired inclusion in this case. For i = 1 the inclusion follows from Lemma 5.4.

Let M ∈ Y µ,τ (F) with shape w = ( w 0 , w 1 , . . . , w f -1 ). Fix a gauge basis β on M. Let R τ,β M = ⊗ j∈Z/f Z (R expl w j ) p-flat, red where R expl w j is given in the first column and w j row of Table 6. This represents the universal family (M univ , β univ ) of deformations of (M, β) (Theorem 4.17).

Definition 5.7. Assume that τ is n-generic. Let A (j-1) = Mat β (φ (j-1) M univ ,s j (3) ). The monodromy condition at j on (M univ , β univ ) is

P N (A (j-1) )| v=-p = p n-1 M (j)
err .

Let I (j) mon ⊂ R τ,β M be the ideal generated by the nine equations from the monodromy condition at j.

The following proposition allows us to reduce, in most cases, the monodromy condition to just one equation. Proof. Recall from Theorem 5.6 that we can write

p n-1 M (j) err = A (j-1) | v=-p Z (j) = Z ,(j) P (v) 2 (A (j-1) ) -1 | v=-p
for some Z (j) , Z ,(j) ∈ Mat 3 (R τ,β M [1/p]). Furthermore, we have P N (A (j-1) ) = A (j-1), † P (v) 2 (A (j-1) ) -1 . We also claim that P N (A (j-1) ) ≡ A (j-1) Y mod P (v). This follows from (5.4) and the fact that

-u d du A (j-1) P (v) 2 (A (j-1) ) -1 ≡ 0 mod P (v), which implies -u d du (A (j-1) )P (v) 2 (A (j-1) ) -1 ≡ A (j-1) u d du (P (v) 2 (A (j-1) ) -1 ) mod P (v).
We conclude then the monodromy condition satisfies (5.8)

P N (A (j-1) )| v=-p -p n-1 M (j) err = A (j-1) | v=-p X = X (P (v) 2 (A (j-1) ) -1 )| v=-p for some X, X ∈ Mat 3 (R τ,β M [1/p]).
Each 2 × 2 minor of the matrices A (j-1) | v=-p and (P (v) 2 (A (j-1) ) -1 )| v=-p is zero by the height conditions, in particular these matrices have rank at most one. It follows from 5.8 that the ratios between the rows and the columns of P N (A (j-1) )| v=-p -p n-1 M err are the same as the ratios of the rows of A (j-1) | v=-p and the ratios of the columns of (P (v) 2 (A (j-1) ) -1 )| v=-p respectively. A survey of Table 5 shows that as long as w j-1 = id the matrix A (j-1) | v=-p ∈ Mat 3 (R τ,β M [1/p]) has at least one unit entry (say in row m) and the same is true for (P (v) 2 (A (j-1) ) -1 ) v=-p (say in column k).

It follows that I (j)

mon [1/p] is generated by the (m, k)-entry of P N (A (j-1) )| v=-p -p n-1 M err , hence is principal.

In Table 6, we list the one equation which generates

I (j) mon [1/p].
Remark 5.9. Proposition 5.8 is false for the case w j-1 = id. The reason is that the monodromy conditions only cut out potentially crystalline representations whose Hodge-Tate weights are ≤ (2, 1, 0), and so the Hodge-Tate weights could be either (2, 1, 0) or (1, 1, 1).

In case of id shape, the representations with Hodge-Tate weights (1, 1, 1) do show up, and one must further refine the monodromy condition to get rid of them. This will be addressed separately in §8.

Potentially crystalline deformation rings.

In the previous section, we gave a condition for Kisin module with descent datum and p-adic Hodge type (2, 1, 0) to come from a potentially crystalline representation (Proposition 5.3). We will now construct a candidate for the (framed) potentially crystalline Galois deformation ring.

We begin by introducing some deformation problems. Let ρ : G K → GL 3 (F). Recall that R

(2,1,0),τ ρ is the universal framed potentially crystalline deformation ring with p-adic Hodge type (2, 1, 0). Let D τ, ρ := SpfR (2,1,0),τ ρ denote the deformation functor. Since we will always be working in parallel weight (2, 1, 0), we omit the p-adic Hodge type in the notation.

Assume there exists M ∈ Y µ,τ (F) such that T * dd (M) ∼ = ρ| G K∞ . Note that this is a necessary condition for R (2,1,0),τ ρ to be non-zero. By Theorem 3.2, if such a Kisin module exists, then it is unique. Furthermore, we fix an isomorphism γ : T * dd (M) ∼ = ρ| G K∞ . We fix a gauge basis β of M (in particular, Mat β (φ (j) M,s j+1 (3) ) has the form given in Table 4).

Definition 5.10. In the following definitions, all data is taken to be compatible with the corresponding data on M when reduced modulo the maximal ideal.

(1) Let R τ, M,ρ denote the complete local Noetherian O-algebra which represents the deformation problem

D τ, M,ρ (A) := (M A , ρ A , δ A ) | M A ∈ Y µ,τ (A), ρ A ∈ D τ, ρ (A), δ A : T * dd (M A ) ∼ = (ρ A )| G K∞
(2) Let R τ,β, M,ρ denote the complete local Noetherian O-algebra which represents the deformation problem The relationships between the various deformation problems are summarized in the following diagram. The square is Cartesian and f.s. stands for formally smooth.

D τ,β, M,ρ (A) = (M A , ρ A , δ A , β A ) | (M A , ρ A , δ A ) ∈ D τ, M,ρ (
(5.9)

SpfR τ,β, ,∇ M f.s. G G _ SpfR τ,β,∇ M _ SpfR τ,β, M,ρ f.s. + ξ W W G G SpfR τ,β, M f.s. G G SpfR τ,β M SpfR µ,τ ρ SpfR τ, M,ρ ∼ o o
The maps which are formally smooth correspond to forgetting either a framing on the Galois representation or a gauge basis on the Kisin module. The former is clearly formally smooth while the latter is formally smooth by Theorem 4.16. The dotted arrows will be proved in Proposition 5.11 and Theorem 5.12 below to exist and be closed immersions when ad(ρ) is cyclotomic free.

The isomorphism between SpfR µ,τ ρ and SpfR τ, M,ρ is Corollary 3.6. If M has shape ( w 0 , . . . , w f -1 ), then R τ,β M = ⊗(R expl w j ) p-flat, red where R expl w j is given in Table 6 (Theorem 4.17). As we will see, as long as w j = id for all j, the map ξ will be an isomorphism (see Remark 5.9).

The following Proposition follows from Proposition 3.12: Proposition 5.11. Assume that ad(ρ) is cyclotomic free (Definition 3.8). The obvious map SpfR τ,β, M,ρ → SpfR τ,β, M between the deformation spaces defined in Definition 5.10 is a closed immersion.

Theorem 5.12. Assume that ad(ρ) is cyclotomic free. The map

SpfR τ,β, M,ρ → SpfR τ,β, M factors through SpfR τ,β, ,∇ M inducing a surjective map R τ,β, ,∇ M ξ - → R τ,β, M,ρ . Furthermore, if w j = id for all j ∈ Z/f Z, then ξ is an isomorphism. Proof. Both R τ,β, M and R τ,β,
M,ρ are flat O-algebras. Furthermore, R τ,β, M,ρ [1/p] is reduced since the same is true for the potentially crystalline deformation ring R µ,τ ρ . Thus, it suffices to show factorization at the level of Q p -points. 5. Furthermore, M O ⊗ S O rig is stable under the monodromy operator and hence T * dd (M O )[1/p] =: V E extends to a potentially crystalline representation of G K . The claim is as long as w j = id, then V E has p-adic Hodge type of parallel weight (2, 1, 0). The p-adic Hodge type at the embedding σ j is (1, 1, 1) if and only if the Frobenius C (j) is divisible by E(u), equivalently A (j) is divisible by P (v). A survey of last column of Table 5 shows that this can only happen when w j = id.

Corollary 5.13. Assume that ad(ρ) is cyclotomic free. If w j = id for all j ∈ Z/f Z, then

R µ,τ ρ [[S 1 , . . . , S 3f ]] ∼ = R τ,β,∇ M [[T 1 , . . . , T 8 ]].
Remark 5.14. The assumption that ad(ρ) is cyclotomic free is automatic (by Proposition 3.9) if one assumes a slightly stronger genericity condition on τ which forces ρ to be 2generic. In any case, it is likely that this assumption could be removed by using more about the tangent space of the potentially crystalline deformation ring.

Explicit deformation rings.

We now proceed to compute R τ,β,∇ M for generic τ (which means 5-generic cf. Definition 2.1) in many cases thus obtaining by Corollary 5.13 a description of R µ,τ ρ . Assume that w j ∈ {α, β, γ, id} for all j. Recall that R τ,β M := ⊗(R expl w j ) p-flat, red where R expl w j is the O-algebra corresponding to shape w j in Table 6. Let I mon ⊂ R τ,β M denote the p-saturation of the sum of the ideals I (j) mon generated by the monodromy conditions (Definition 5.7). By definition,

R τ,β,∇ M = (R τ,β M / I mon ) red .
Now, we can consider the explicit quotient R expl,∇ M of R τ,β M given by imposing the single monodromy equation for each j in Table 6. By Proposition 5.8,

R expl,∇ M [1/p] = R τ,β M / I mon [1/p].
The aim is to determine the p-torsion free and reduced quotient R τ,β,∇ M of R expl,∇

M

. As long as w j has length at least 2 for all j, this is non-canonically isomorphic to a completed tensor product of the explicit rings R expl,∇ M, w j given in Table 7. Note that Table 7 gives R expl,∇ M, w j for each shape of length at least 2, with further conditions from M.

Remark 5.15. Table 7 only includes the R expl,∇ M, w j for our chosen representatives for the δorbits on Adm(2, 1, 0) (see Corollary 2.24 and Remark 2.25). If w is in the same δ-orbit as w, then the explicit ring for that shape is isomorphic to R expl,∇ M, w j , only the labelling of the variables by entry changes.

We give two sample calculations of R τ,β,∇ M with the rest being similar. The computations below show that this is a quotient of (a completed tensor product of) the ring appearing in Table 7. Since the rings in Table 7 By the finite height and determinant equations, we see that

c 11 (c 22 c 33 + 1 p c 33 c 22 ) ≡ pc * 12 c * 23 c * 31 hence c 11 is a unit in R τ,β M [1/p].
We multiply (5.12) by c 11 : using the finite height and the determinant equations, we obtain

p c 11 ((a -b)c 32 c * 23 -(a -c)c 22 c 33 ) -p(e -a + c)c * 12 c * 23 c * 31 + O(p n-2 ).
In particular if the descent data is generic, we can write There are again two cases. When c 32 = 0, y 32 is a unit in which case we can solve the first equation. Otherwise, y 32 is in the maximal ideal in which case this is a minimal set of equations. Note that c 13 ≡ 0 modulo so y 13 is never a unit. In particular if the descent data is generic, we can write

c 12 ((a -b)c 31 c 23 + (b -c)c * 21 c 33 ) = pz *
where z * is a unit. The computations are now similar to those of the βα case.

Base change

In this section, we extend the results of §4-5 to non-principal series tame types. These tame inertial types provide more flexibility in isolating certain combinations of Serre weights in global applications. The setup is similar to [START_REF] Emerton | Lattices in the cohomology of Shimura curves[END_REF] where deformation rings for tame cuspidal types are computed for GL 2 . The end result is that the deformation rings have essentially the same form and shapes as for the principal series types.

Let r ∈ {2, 3} and define

f def = f r, K def = Q p f .
L ∞ def = n∈N L (π n ), K ∞ def = n∈N K (p n ), L ∞ def = n∈N L(π n ) and K ∞ def = n∈N K(p n ).
We have Gal(L ∞ /K ∞ ) ∼ = Gal(L /K) is generated by ∆ def = Gal(L /K ) and σ subject to the relations σg σ -1 = g p f and σ r = 1 (here σ is characterized by σ(π ) = π and σ(ζ) = ζ p f for ζ any e -th root of unity). We will fix once and for all a lift of σ to G K∞ , and abusively also call it σ. Note that the image of σ in Gal(K ∞ /K ∞ ) is a generator.

As in Section 2.3, we have the rings O E un ,K = O E un ,K with an action of G K∞ , and

subrings O E,K , O E,L , O E,K and O E,L which are the ring of invariants under G K∞ , G L∞ , G K ∞ and G L ∞ , respectively.
Recall the character ω π : I K → W (k ) × . By fixing an embedding σ 0 : k → F extending σ 0 : k → F, we obtain a fundamental character ω f satisfying ω e e f = ω f . We also fix a compatible embedding σ 0 : W (k ) → O, which allows us to regard ω f as an O × -valued character.

6.1. Tame descent datum. Recall the notations and the general setting of §2.1. Consider f -tuples a k ∈ {0, . . . , p -1} f for 1 ≤ k ≤ 3 and the following tame (non-principal series) inertial types τ :

         ω -a (0) 1 -p f a (0) 1 f ⊕ ω -a (0) 2 -p f a (0) 3 f ⊕ ω -a (0) 3 -p f a (0) 2 f when r = 2 ω -a (0) 1 -p f a (0) 2 -p 2f a (0) 3 f ⊕ ω -a (0) 2 -p f a (0) 3 -p 2f a (0) 1 f ⊕ ω -a (0) 3 -p f a (0) 1 -p 2f a (0) 2 f when r = 3.
We write τ for the base change of τ to K /K (which is just τ considered as a representation of I K ). There is a triple (a 1 , a 2 , a 3 ) with a k ∈ {0, . . . , p -1} f associated to τ such that

τ = η 1 ⊕ η 2 ⊕ η 3 with η k = ω -a (0) k f
(with the characters ordered as above). We say that the type τ is n-generic if τ is n-generic (equivalently, the triple (a 1 , a 2 , a 3 ) is n-generic).

Similar conventions apply for the notion of genericity, weak genericity and strong genericity.

Let (s j ) ∈ S f 3 be the orientation of (a 1 , a 2 , a 3 ) (cf. Definition 2.6)

The following lemma records the effect of base change on the orientation: Proposition 6.1. Let τ be a weakly generic tame type. For 0 ≤ j ≤ f -1 and 0 ≤ i ≤ r -1, define

s j+if = s i+1 τ • s j ∈ S 3
where s τ = (23) (resp. s τ = (123)) if r = 2 (resp. r = 3). Then, the f -tuple (s j ) ∈ S f 3 is an orientation of τ .

Proof. This is a casewise computation, remarking that the orientation at j on (a 1 , a 2 , a 3 ) is determined, under the weak genericity assumption, by (a 1,f -1-j , a 2,f -1-j , a 3,f -1-j ).

We now study Kisin modules with descent datum of type τ in relation to Kisin modules with descent datum of type τ . In the next subsection, we will apply this to potentially crystalline deformation rings with tame Galois type τ . We write σ ∈ Gal(K /Q p ) for the absolute Frobenius on K and recall ∆ = Gal(L /K ). We also denote by σ the automorphism of W (k ) [[u]] which fixes u and acts as σ on W (k). This extends to an automorphism of O E,L , also denoted by σ, and σ f agrees with the Galois automorphism

σ ∈ G K∞ on O E un ,K restricted to O E,L . We define a Frobenius-twist morphism (σ f ) * : Y [0,h],τ → Y [0,h],(τ )
( g p f ) * (σ f ) * (M) ∼ = (σ f ) * ( g * (M))
using that g → g p f is an automorphism of ∆ . In the Lemma below, we see that if M has type τ , then (σ f ) * (M) has type (τ )

p -f := (η 1 ) p -f ⊕ (η 2 ) p -f ⊕ (η 3 ) p -f . We have a canonical σ -f semilinear bijection (σ f ) * (M) → M given by a⊗m → σ -f (a)m. Lemma 6.2. Let M ∈ Y [0,h],τ (R). For all j ∈ {0, . . . , f -1}, one has the following commutative diagram of R[[u]]-modules ϕ * (((σ f ) * (M)) (j) ) φ (j) (σ f ) * (M) G G ((σ f ) * (M)) (j+1) ϕ * (M (j-f ) ) φ (j-f ) M G G M (j-f +1) .
Furthermore, for any character η : ∆ → O × , one has the following commutative

diagram of R[[v]]-modules ϕ ((σ f ) * (M)) (j) η G G ((σ f ) * (M)) (j+1) η ϕ M (j-f ) η p f G G M (j-f +1) η p f
. with horizontal maps induced by the Frobenius.

Since τ is the base change of the tame inertial type for I K , (τ ) p -f = τ and the Frobeniustwist induces an automorphism of Y µ,τ . We define the 'fixed points' of this automorphism:

Definition 6.3. For any O-algebra R, define Y µ,τ (R) = {(M, ι) | M ∈ Y µ,τ (R), ι : (σ f ) * (M) ∼ → M} such that the following cocycle condition holds: ι • (σ f ) * ι = id M (resp. ι • (σ f ) * ι • (σ 2f ) * ι = id M ) when r = 2 (resp. r = 3).
We define Y [0,2],τ in a similar fashion.

A morphism (M 1 , ι 1 ) → (M 2 , ι 2 ) in Y µ,τ (R) is a morphism M 1 → M 2 in Y µ,τ which
commutes with the Frobenius twist.

Let R be a complete local Noetherian O-algebra. Recall from Section 2.3 the functor T * dd from Y µ,τ (R) to G K ∞ -representations given by

T * dd (M) = V * dd (M) = Hom ϕ,O E,L (M, O E un ,K )
where

M = M ⊗ W (k )[[u]] O E,L
is the étale ϕ-module with descent data corresponding to M.

If (ρ, V ) is a linear representation of a group G and ψ is an automorphism of G, the

ψ-twist of V is the G-representation obtained by the composition ρ • ψ : G → GL(V ).
The following computes the effect of Frobenius twisting under T * dd :

Proposition 6.4. There is a canonical bijection

can : T * dd (M) ∼ → T * dd ((σ f ) * (M)) which identifies T * dd ((σ f ) * (M)) as the Ad( σ)-twist of T * dd (M)
Proof. We construct the map by sending h ∈ Hom ϕ,O E,L (M, O E un ,K ) to σ • h, which is a σ f -semilinear map from M to O E un ,K commuting with ϕ, hence gives an element of T * dd ((σ f ) * (M)) (namely id ⊗ σ f h). One easily checks it has the correct equivariance properties. Lemma 6.5. Let G be a group and G a normal subgroup of G such that G/G is a cyclic group of order d. Let g ∈ G be an element lifting a generator of G/G . Let V be a linear G -representation. Then the data of an extension of the G -action to a G-action is the same as the data of a linear isomorphism h :

V ∼ → V such that (1) h(g v) = (Ad(g)(g )) h(v), (2) h d (v) = g d (v), for all v ∈ V and g ∈ G .
Proof. The data of h is exactly equivalent to the action of the element g, and the conditions are exactly what is needed to make it a group action of G. Proposition 6.6. Let R be a complete local Noetherian O-algebra and let (M, ι) ∈ Y µ,τ (R).

Let M be the étale ϕ-module associated to M. Then the data of an extension of the

G K ∞ - representation T * dd (M) = V * dd (M) to a G K∞ -representation is equivalent to the data of an isomorphism ι : (σ f ) * (M) ∼ → M
satisfying the cocycle condition (cf Definition 6.3).

Proof. This follows from Proposition 6.4, Lemma 6.5 and the fact that V * dd is an antiequivalence. Note that the action of σ on V * dd (M) is given by V * dd (ι -1 ) • can.

Corollary 6.7. Let R be a complete local Noetherian O-algebra and let (M, ι) ∈ Y µ,τ (R).

The G K ∞ -representation T * dd (M) admits a canonical extension to a G K∞ -representation which we denote by T * dd (M).

Remark 6.8. The étale φ-module M over O E,L associated to M has an action of the group ∆ from the descent datum. The isomorphism ι extends this to an action of Gal(L /K).

One can describe T * dd as

T * dd (M) = V * dd (M) = Hom ϕ,O E,L (M, O E un ,K )
with the G K∞ -action given by g

•f def = g •f •g -1
, where G K∞ -acts on M through Gal(L /K).

Proposition 6.9. Let (M, ι) ∈ Y µ,τ (F). If w = ( w 0 , . . . , w f -1 ) ∈ W f is the shape of M considered as an element of Y µ,τ (F), then w j 1 = w j 2 whenever j 1 ≡ j 2 mod f.

In other words, M has parallel shape.

Proof. The isomorphism ι induces an isomorphism M (j)

η s j (3) ∼ = M (j-f )
(η s j (3) ) p f (Lemma 6.2). The Proposition follows from the fact that (η s j (3) ) p f = η s j-f (3) .

Definition 6.10. Let ρ : G K → GL 3 (F) such that T * dd (M) ∼ = ρ| G K∞ for some (M, ι) ∈ Y µ,τ (F). Define w(ρ, τ ) = ( w 0 , . . . , w f -1 ) ∈ Adm(2, 1, 0) f where w j is the shape of M ∈ Y µ,τ (F) at j for any j ≡ j mod f . This is well defined by Proposition 6.9 and Theorem 3.2 applied to ρ| G K and τ .

We now discuss gauge bases in the current setting. Definition 6.11. Assume τ is weakly generic. Let R be a complete local Noetherian O-algebra and let (M, ι) ∈ Y [0,2],τ (R) . A gauge basis of (M, ι) is a gauge basis β of

M ∈ Y [0,2],τ (R) which is compatible with ι, that is, ι((σ f ) * (β)) = β.
Proposition 6.12. Assume τ is weakly generic. Let R be a complete local Noetherian Oalgebra and let (M, ι) ∈ Y [0,2],τ (R). Then the set of gauge bases of (M, ι) is a torsor for

(Res W (k )/Zp T (R)) σ f =id = T (W (k ) ⊗ Zp R) σ f =id
Proof. Let β 1 be a gauge basis of M ∈ Y [0,2],τ (R). Then β 2 = ι((σ f ) * (β 1 )) is also a gauge basis of M. By Theorem 4.16, the set of gauge bases of M is exactly T (W (k )⊗ Zp R)β 1 (note that the proof of Theorem 4.16 also implies that gauge bases of M are uniquely determined up scalings). Thus

β 2 = cβ 1 for a unique c ∈ T (W (k ) ⊗ Zp R). The cocycle condition satisfied by ι is equivalent to c • σ f (c) • • • σ (r-1)f (c) = 1. Observe that ι((σ f ) * (tβ 1 )) = σ f (t)ι((σ f ) * (β 1 )) = σ f (t)cβ 1 .
Thus the set of gauge bases of (M, ι) is exactly the set of solutions t ∈ T (W (k ) ⊗ Zp R) to the equation t = σ f (t)c. As Res W (k )/Zp splits over O, the equation has a solution, and the solution set is a torsor over (Res W (k )/Zp T (R)) σ f =id .

Finally, we observe that by Lemma 6.2, if β is a gauge basis of (M, ι), and

A (j) = Mat β φ (j)
M,s j+1 (3) , then A (j) = A (j+f ) . The analogue of Theorem 4.17 also holds in our setting, namely the problem of deforming a pair (M, ι) is representable by ⊗ f j=1 (R expl w j ) p-flat, red . This is obtained as the quotient of the universal deformation of (M, β) over Y µ,τ by imposing the condition A (j) = A (j+f ) . 6.2. Tame deformation rings. Throughout this section, we assume that τ is weakly generic. Let (M, ι) ∈ Y µ,τ (F). Fix a gauge basis β of (M, ι), which exists by Proposition 6.12. We define the same deformation problems from Definition 5.10 but with Y µ,τ as in

Applications

In this section, we apply the descriptions of the deformation rings to modularity lifting and the Serre weight conjectures. Before stating the main theorems, we describe a global setup, the particulars of which are not so important. The proofs of the main theorems only rely on the existence of patched modules satisfying the axioms spelled out in Definition 7.11. 7.1. Global setup. Let F/Q be a CM field with maximal totally real subfield F + = Q and write Σ + p (resp. Σ p ) for the places of F + (resp. of F ) lying above p. Let c denote the generator of Gal(F/F + ) and assume that for all places v ∈ Σ + p , v decomposes as ww c in F . Let G /F + be a reductive group which is an outer form for GL 3 which is quasi-split at all finite places of F + and which splits over

F . Suppose that G(F + v ) ∼ = U 3 (R) for all v|∞. Recall from [EGH13, §7.1] that G admits a reductive model G defined over O F + [1/N ], for some N ∈ N which is prime to p, together with an isomorphism (7.1) ι : G /O F [1/N ] ι → GL 3/O F [1/N ]
which specializes to ι w :

G(O F + v ) ∼ → G(O Fw ) ι → GL 3 (O Fw ) for all places v ∈ Σ + p . Define F + p := F + ⊗ Q Q p and O F + ,p := O F + ⊗ Z Z p . If W is a finite O-module endowed with a continuous action of G(O F + ,p ) and U ≤ G(A ∞,p F + ) × G(O F + ,p
) is a compact open subgroup, the space of algebraic automorphic forms on G of level U and coefficients in W is the O-module defined as:

(7.2) S(U, W ) def = f : G(F + )\G(A ∞ F + ) → W | f (gu) = u -1 p f (g) ∀ g ∈ G(A ∞ F + ), u ∈ U .
We recall that the level U is said to be sufficiently small if for all t ∈ G(A ∞ F + ), the order of the finite group t -1 G(F + )t ∩ U is prime to p. For a finite place v of F + that splits in

F , we say that U is unramified at v if one has a decomposition U = G(O F + v )U v for some compact open subgroup U v ≤ G(A ∞,v F + ).
If w is a finite place of F we say, with an abuse, that w is an unramified place for U if its restriction w| F + is unramified for U .

Let P U be the set of finite places w of F such that v def = w| F + is split in F , v p and U is unramified at v. For any subset P ⊆ P U of finite complement that is closed under complex conjugation, we write

T P = O[T (i)
w , w ∈ P, i ∈ {0, 1, 2, 3}] for the universal Hecke algebra on P. The space of algebraic automorphic forms S(U, W ) is endowed with an action of T P , where T (i) w acts by the usual double coset operator

ι -1 w GL 3 (O Fw ) w Id i 0 0 Id 3-i GL 3 (O Fw ) .
A Serre weight (for G) is an isomorphism class of a smooth, absolutely irreducible rep-

resentation V of G(O F + ,p ). If v|p is a place of F + , a Serre weight at v is an isomorphism class of a smooth, absolutely irreducible representation V v of G(O F + v ).
Finally, if w|p is a place of F , a Serre weight at w is an isomorphism class of a smooth, absolutely irreducible representation V w of GL 3 (O Fw ). Note that if V v is a Serre weight at a place v such that v = ww c in F , then the Serre weights at w c defined by

V v • ι -1 w • c, V v • ι -1 w c are dual to each other. Any Serre weight V for G(O F + ,p ) can be written as V ∼ = v|p V v where V v are Serre weights at v. Definition 7.1. Let r : G F → GL 3 (F)
be a continuous Galois representation and let V be a Serre weight for G. We say that r is automorphic of weight

V (or that V is a Serre weight of r) if there exists a compact open subgroup U of G(A ∞,p F ) × G(O F + ,p
) which is unramified at places v|p, and a cofinite subset P ⊂ P U such that

S(U, V ) m = 0
where m is the kernel of the system of Hecke eigenvalues α : T P → F associated to r, and

α satisfies the equality det 1 -r ∨ (Frob w )X = 3 j=0 (-1) j (N F/Q (w)) ( j 2 ) α(T (j) w )X j
for all w ∈ P. We write W (r) for the set of all Serre weights of r. We say that r is

automorphic if W (r) = ∅.
From now until the end of this subsection, we assume that p splits completely in F . If w|p is a place of F and w| F + = v, following [GHS] we write (X

1 ) v for the set of p-restricted pairs {a w , a w c } ⊂ Z 3 such that a i,w + a 2-i,w c = 0 for all 0 ≤ i ≤ 2 (recall that p-restricted means that p-1 ≥ a i,w -a i+1,w ≥ 0 for i ∈ {0, 1}). To a p-restricted element a w ∈ Z 3 , we associate an irreducible representation F a w of GL 3 (k w ) and, by inflation, GL 3 (O Fw ) as in [GHS, §3.1] (cf. also [START_REF] Emerton | Weight cycling and Serre-type conjectures for unitary groups[END_REF](4

.1.3)]). To an element a

v = {a w , a w c } ∈ (X (3) 1 ) v , we associate an irreducible representation F a v def = F a w • ι w of G(O F + v ) that is independent of the choice of place w dividing v. Let (X (3) 1 )
Σp 0 be the set of a = (a w ) w|p where {a w , a w c } ∈ (X

(3) 1 ) v .
Given an element a ∈ (X

upper alcove if a -c > p -2. We say that F (a, b, c) is regular if 0 ≤ a -b, b -c < p.
Following [EGH13, Theorem 5.2.5], we say that

F (a, b, c) is reachable if either a -c ≤ p -4 or a -b, b -c ≤ p -6 and a -c ≥ p + 2.
An inspection on Table 3 shows that JH(σ(τ )) consists of reachable weights as soon as τ is 6-generic.

Let v|p be a place of F + . From the definition of (X

(3) 1 ) v , if a v = {a w , a w c } ∈ (X (3) 1 ) v , then F a w is regular (resp. reachable) if and only if F a w c is regular (resp. reachable. For a v = {a w , a w c } ∈ (X (3) 1 ) v , we say that F a v is regular (resp. reachable) if F a w is regular (resp. reachable). Finally, if a ∈ (X (3) 1 ) Σp 0 , we say that F a = v|p F a v is regular (resp. reach- able) if F a v is regular (resp. reachable) for all v|p. If r : G F → GL 3 (F) is as in Definition 7.1,
we write W reg (r) (resp. W elim (r)) to denote the set of regular (resp. reachable) elements of W (ρ).

We now recall the tame types for GL 3 (Q p ). Let τ : I Qp → O × be a tame inertial type.

We define a GL 3 (F p )-representation σ(τ ), valued in E, via the "inertial local Langlands correspondence" (cf. [CEG + 16, Theorem 3.7]). For each tame type τ , σ(τ ) is given in Table

2. If σ(τ ) • is a GL 3 (F p )-stable O-lattice inside σ(τ ), we write JH(σ(τ )) to denote the set of Jordan-Hölder constituents of σ(τ ) • def = σ(τ ) • ⊗ O F.
The set JH(σ(τ )) does not depend on the choice of the lattice σ(τ ) • . When τ is weakly generic, the set JH(σ(τ )) consists of nine

Serre weights which we list in Table 3.

7.2. Modularity lifting and Serre weight conjectures. We are now ready to state our main theorems. Fix once and for all an isomorphism ı :

Q p ∼ → C.
If r : G F → GL 3 (E) is a continuous Galois representation, we say (following [BLGG]) that r is automorphic if there exists a RACSDC representation π of GL 3 (A F ) such that

r ⊗ E Q p ∼ = r ı (π) where r ı (π) : G F → GL 3 (Q p ) is the continuous representation attached to π by [BLGG, Theorem 2.1.2].
Theorem 7.4 is a consequence of the following Theorem using standard Kisin-Taylor-Wiles patching methods. (Note that, in the setup of Theorem 7.4, the representation r| G Fw satisfies the hypotheses of Theorem 7.7 for all w ∈ Σ p .)

Theorem 7.7. Let ρ : G Qp → GL 3 (F) be a continuous Galois representation and let τ be a generic tame inertial type such that R

(2,1,0),τ ρ = 0. If w(ρ, τ ) ∈ {α, β, γ, id}, assume furthermore that τ is strongly generic. Then the framed potentially crystalline deformation ring R

(2,1,0),τ ρ

with Hodge-Tate weights (2, 1, 0) has connected generic fiber.

Proof. If w(ρ, τ ) / ∈ {α, β, γ, id}, then this is immediate upon inspection of Table 7. The remaining cases will be proved in §8.

If ρ : G Qp → GL 3 (F) is a continuous semisimple Galois representation an explicit set of weights W ? (ρ| I Qp ) is defined in [Her09, Conjecture 6.9]. The main conjecture in loc. cit. is that W ? (ρ| I Qp ) should give the set of regular modular weights. More precisely, fix a place v above each v ∈ Σ + p , we prove the following generalization of the weight part of Serre's conjecture as conjectured in [Her09, Conjecture 6.9] (cf. §7.4):

Theorem 7.8. Assume that p splits completely in F . Let r : G F → GL 3 (F) be a continuous Galois representation, verifying the Taylor-Wiles conditions. Assume that r| G F v is semisimple and 8-generic (Definition 3.7) for all v ∈ Σ + p , that r is automorphic of some reachable Serre weight, and that r has split ramification outside p. Then

v∈Σ + p F a v ∈ W elim (r) ⇐⇒ F a v • ι -1 v ∈ W ? (r| I F v ) for all v ∈ Σ + p .
Remark 7.9. Theorem 7.8 is stated only for r which are semisimple above p because those are the only representations for which there is an explicit conjecture. Our computations together with work of [START_REF] Herzig | On mod p local-global compatibility for GL3 in the ordinary case[END_REF], [MP] suggest a set W ? (r| G F v ) for non-semisimple r| G F v for which the analogue of Theorem 7.8 should hold. One example is worked out in Proposition 7.17. A complete analysis for a set W ? (r|

G F v ) when r| G F v is not semisimple is carried out in [LLHLMb].
Remark 7.10. The restriction to reachable weights in the statement of Theorem 7.8 is due to the current weight elimination results. For the niveau 1 and 2 case the works [HLM17], [MP],

[LMP] provide weight elimination for all weights (not just reachable ones). Specifically, [HLM17, §2.5] and [MP] deals with the niveau 1 case (when (r| G F v ) ss is 3-generic) and [START_REF] Le | On mod p local-global compatibility for GL3 in the non-ordinary case[END_REF]§3] with the niveau 2 case (when (r| G F v ) ss is 4-generic). For the niveau 3 case the weight elimination for reachable weights has been established in [EGH13, Theorem 5.2.5] (this is the reason for our definition and restriction to reachable weights). This has been improved by unpublished work from John Enns (private communication) to eliminate also non-reachable weights when r| G F v is irreducible at places above p and 9-generic. In particular, granting the work of John Enns, Theorem 7.8 would hold for W (r) instead of W elim (r) and assuming only that r is automorphic.

On the other hand, our arguments and the elimination results of [LLHL] suffice to show Theorem 7.8 when W elim (r) is replaced by W reg (r) (which is the analogue of Conjecture 6.9

in [START_REF]The weight in a Serre-type conjecture for tame n-dimensional Galois representations[END_REF] in our setting). If we make the stronger assumption that ρ is 9-generic, we can even replace W reg (r) by W (r).

The rest of §7 is devoted to the proof of Theorem 7.8, which uses the Breuil-Mézard philosophy introduced in [START_REF] Gee | The Breuil-Mézard conjecture for potentially Barsotti-Tate representations[END_REF]. Namely, we use the descriptions of the special fibers of deformation rings to determine the Hilbert-Samuel multiplicities of minimal patched modules. The argument only requires Theorem 7.7 in the case where w(ρ, τ ) has length at least 2, and thus makes no use of the results in §8.

Assuming first that r is modular of a lower alcove weight, we use an inductive argument involving carefully chosen tame types to prove modularity of the shadow weights (Proposition 7.16). A slightly more intricate argument shows that if r is modular, then it is modular of a lower alcove weight.

7.3. Weak minimal patched modules. As before, let F/F + be a CM extension. With an eye towards future applications, in this subsection, we assume that every place v|p of F + splits in F , but nothing more about the splitting behavior at p. Let r : G F → GL 3 (F) be a Galois representation. For each place v|p of F + , fix a place v of F such that v|

F + = v. Let R v denote the unrestricted universal O-framed deformation ring of r| G F v . Fix a natural number h and let R ∞ = v∈Σ + p R v [[x 1 , x 2 , . . . , x h ]] and X ∞ = SpfR ∞ . If τ v is an inertial type for G F v , then let R ,τ v v
be the universal O-framed potentially crystalline deformation ring of r| G F v of inertial type τ v (and p-adic Hodge type (2, 1, 0)). If

τ = v∈Σ + p τ v , then let R ∞ (τ ) = v∈Σp R ,τ v v [[x 1 , x 2 , . . . , x h ]] and X ∞ (τ ) = SpfR ∞ (τ ).
Let d + 1 be the dimension of R ∞ (τ ) (the dimension is independent of τ by Theorem 3.3.4 of [START_REF]Potentially semi-stable deformation rings[END_REF]). Note that X ∞ (τ )[1/p] is regular by [Kis08, Theorem 3.3.8]. We denote by R v , R ∞ , etc. the reduction of these objects modulo . The following definition is adapted from Definition 4.1.1 of [GHS].

Definition 7.11. A weak minimal patching functor for r is defined to be a covariant exact functor M ∞ : Rep K (O) → Mod(X ∞ ) satisfying the following axioms:

(1) Let

τ def = v∈Σ + p τ v
, where for all v ∈ Σ + p , τ v is an inertial type, and let σ(τ

) def = v∈Σ + p σ(τ v ) • ι v be the associated K-type as in [CEG + 16, Theorem 3.7]. If σ(τ ) • an O-lattice in it, then M ∞ (σ(τ ) • ) is p-torsion free and is maximally Cohen-Macaulay over R ∞ (τ ); (2) if V = v∈Σ + p V v , where for all v ∈ Σ + p the V v are irreducible G(k v )-representations over F (i.e. V is a Serre weight for G), the module M ∞ (V ) has nonempty support if and only if r is automorphic of weight V ; furthermore if M ∞ (V ) = 0 then its support is equidimensional of dimension d; and (3) the sheaf M ∞ (σ(τ ) • )[1/p] over X ∞ (τ )[1/p] (which is locally free, being maximal
Cohen-Macaulay over a regular scheme) has rank at most one on each connected component.

Remark 7.12. The adjective "weak" corresponds to the fact that M ∞ (σ(τ ) • ) is not assumed to have full support on X ∞ (τ ) for all inertial types τ in contrast to Definition 4.1.1 of [GHS].

Remark 7.13. The adjective "minimal" corresponds to the multiplicity one property in condition (3). Our results on automorphy of global Serre weights could be proved without requiring minimality using the geometric perspective of [START_REF]A geometric perspective on the Breuil-Mézard conjecture[END_REF], but we have avoided this for ease of exposition.

Given a Noetherian ring R and an R-module M , we denote the Hilbert-Samuel multiplic-

ity of M by e(M, R). If R = R ∞ , let e(M ) = e(M, R ∞ ).
The following proposition is the key to relating automorphy of global Serre weights to multiplicities of deformation rings.

Proposition 7.14. If M ∞ is a weak minimal patching functor, then e(M ∞ (σ(τ ))) ≤ e(R ∞ (τ )), and we have equality if and only if M ∞ (σ(τ ) • ) has full support on X ∞ (τ ) (for

any choice of lattice σ(τ ) • ). Proof. Let T ∞ (τ ) be the quotient of R ∞ (τ ) which acts faithfully on M ∞ (σ(τ ) • ). Then e(M ∞ (σ(τ ) • )) = e(T ∞ (τ )) ≤ e(R ∞ (τ ))
where the equality follows from Definition 7.11(3) and Corollary 1.3.5 of [START_REF]The Fontaine-Mazur conjecture for GL2[END_REF] and the inequality follows from the fact that dim T ∞ (τ ) = dim R ∞ (τ ) by Definition 7.11(1). The inequality is an equality if and only if

T ∞ (τ ) = R ∞ (τ ) since R ∞ (τ ) is reduced and equidi- mensional.
We now construct a weak minimal patching functor for r under some hypotheses using the Taylor-Wiles method. We write Σ 0 to denote the finite primes of F where r ramifies and

define Σ + 0 def = {w| F + , w ∈ Σ 0 } and Σ + def = Σ + p ∪ Σ + 0 .
Assume for the rest of this section that r satisfies the Taylor-Wiles conditions of Definition 7.3. Note that the first condition, which is stronger than the usual condition of adequacy, allows us (see Section 2.3 of

[CEG + 16]) to choose a place v 1 / ∈ Σ + of F + such that • v 1 splits in F as v 1 = v 1 v c 1 ; • v 1 does not split completely in F (ζ p ); and • ρ(Frob v 1 ) has distinct F-rational eigenvalues, no two of which have ratio (N F + /Q v 1 ) ±1 .
In order to satisfy the minimality condition, recall (cf. §7.2) that we have made the following two further assumptions.

• The extension F/F + is unramified at all finite places.

• If r : G F → GL 3 (F) is ramified at a place w of F , then v = w| F + splits as ww c .

As mentioned in Remark 7.13, these two assumptions can be removed by working with weak patched modules which are not necessarily minimal. For v ∈ Σ + 0 , let τ v be the type which is minimally ramified with respect to r| G Fw (τ v is the restriction to inertia of the Weil-Deligne representation attached to a Galois representation which is minimal in the sense of Definition 2.4.14 of [START_REF] Clozel | Automorphy for some l-adic lifts of automorphic mod l Galois representations[END_REF]). Let R ,τ v v be the corresponding universal O-framed

deformation ring of r| G F v . Let R v 1 be the unrestricted universal O-framed deformation ring of r| G F v 1 . Let R loc = v∈Σ + p R v ⊗ v∈Σ + 0 R ,τ v v ⊗R v 1 .
Choose an integer q ≥ 3[F + : Q] as in Section 2.5 of [CEG + 16], and let [Le], however the construction, results, and proofs of Section 4 extend verbatim). Then define a covariant functor

R ∞ = R loc [[x 1 , . . . , x q-3[F + :Q] ]]. By [CHT08, Corollary 2.4.21], R ,τ v is formally smooth over O for v ∈ Σ + 0 . By the choice of v 1 , R v 1 is formally smooth over O by [CEG + 16, Proposition 2.5]. We con- clude that R ∞ is formally smooth over v∈Σ + p R v and hence there is an isomorphism R ∞ ∼ = v∈Σ + p R v [[x 1 , x 2 , . . . , x h ]] for some natural number h. One can construct an R ∞ [[G(O F + ,p )]]-module M ∞ as in [Le, Section 4.2] (p is assumed to split in F in
M ∞ : Rep G(O F + ,p ) (O) → Mod(X ∞ ) by M ∞ (W ) = Hom G(O F + ,p ) (W, M ∨ ∞ )
∨ where • ∨ denotes the Pontriagin dual.

Proposition 7.15. If E is sufficiently large, M ∞ is a weak minimal patching functor.

Proof. This proof is adapted from various proofs in [CEG + 16] and [Le]. While the contexts differ slightly, the proofs apply verbatim. Note that the definition of M ∞ (σ(τ ) The following combinatorial result matches shapes with predicted Serre weights. The terms shadow and non-shadow shapes are defined in Table 1.

Proposition 7.16. Let ρ : G Qp → GL 3 (F) be semisimple and n-generic with n ≥ 5. Proof. The strategy is the same in all four cases so we focus on the proof of (2). The type τ for (2) is given in Table 8. The table is constructed starting with a tame type τ over Q p . For each shape w ∈ {αβα, γβγ, αγα}, one can consider the mod p Kisin modules of shape w as in Table 4. We consider the special Kisin modules of this shape where A w is a monomial matrix-these Kisin modules give rise to semisimple ρ. For example, when ). This confirms the shape w(ρ, τ ) in the 10th row of Table 8.

τ = ω -a ⊕ ω -b ⊕ ω -c ,
As another example, consider σ(τ ) = Ind

Mat(φ M ) = s 0 A (1)     v c-1 0 0 0 v b+1 0 0 0 v a     s 0 • ϕ s 1 A (0)     v c-1 0 0 0 v b+1 0 0 0 v a     (s 1 ) -1 =     0 v (c+1)+p(a+1) 0 0 0 v (b+1)+p(c+1) v (a+1)+p(b+1) 0 0    
up to constants. In particular, we see that the ϕ 6 -action on e 1 is described by

e 1 → v (p 3 +1)((c+1)+p(a+1)+p 2 (b+1)) e 1 .
We conclude that ρ := T * dd (M) is tame with

ρ| I Qp ∼ = ω (a+1)+p(b+1)+p 2 (c+1) 3 ⊕ ω (b+1)+p(c+1)+p 2 (a+1) 3 ⊕ ω (c+1)+p(a+1)+p 2 (b+1) 3
.

We conclude that (up to unramified twist) ρ = Ind

G Qp G Q p 3 ω (a+1)+p(b+1)+p 2 (c+1) 3
and so w(ρ, τ ) = βγβ, confirming the 9th row of Table 8. Each semisimple ρ arises in this way from exactly three types. Comparing JH(σ(τ )) and W ? (ρ| I Qp ) is a tedious but not difficult computation.

We see that in each case the intersection JH(σ(τ )) ∩ W ? (ρ| I Qp ) is exactly a lower alcove weight together with its shadow.

A similar computation can be done for the other shapes and cuspidal types using Proposition 2.26. Briefly, regarding parts (1), (3), and (4), for each tame type τ , there are six shapes of length 4, six non-shadow shapes of length 3, and six shapes of length 2. For each semisimple ρ, there are exactly six types for which w(ρ, τ ) has length 4, six types for which w(ρ, τ ) has non-shadow length 3 and six types for which w(ρ, τ ) has length 2. For each obvious weight, there is a unique type satisfying (1) and two types satisfying (3). For each shadow weight, there are two types which work for part (4).

Proof of Theorem 7.8. For generic tame types τ v and ρ

v := r| G F v , if w(ρ v , τ v )
V v )) = 1 whenever V v • ι -1 v ∈ W ? (r| I F v ) for all v. Let W ? (ρ v ) be W ? (r| I F v ) • ι v .
As usual, this does not depend on the choice of place v|v.

Similarly define W obv (ρ v ). Our assumptions imply that if r is modular of a reachable weight

⊗ v∈Σ + p V v then V v ∈ W ? (ρ v
) for all v ∈ Σ + p (cf. Remark 7.10), and all weights in W ? (ρ v ) are reachable.

First, assume that r is modular of a reachable weight ⊗ v∈Σ + p V v such that all V v are lower alcove. Under these hypotheses, the modularity of the obvious weights is known by [BLGG,Theorem 5.1.4] (alternatively, one could deduce the modularity of the obvious weights using the arguments two paragraphs below and Proposition 7.16(3)). Choose V v ∈ W ? (ρ v ) for each v ∈ Σ + p . Let S + p ⊂ Σ + p be the set of places for which V v is a shadow weight. For each v ∈ S + p , let V v denote the lower alcove weight corresponding to V v . We induct on the size of S + p . If S + p is empty, then by Proposition 7.16(1), we can choose types

τ v for each v ∈ Σ + p such that JH(σ(τ v )) ∩ W ? (ρ v ) = {V v }. In this case, M ∞ (⊗ v∈Σ + p σ(τ v ) • ) = M ∞ (⊗ v∈Σ + p V v )
V v )) = e(M ∞ (⊗ v∈Σ + p σ(τ v ) •
)) = 1 since the corresponding deformation ring is a power-series ring.

In general, for each v ∈ Σ + p \S + p , we choose τ v as in 7.16(1). For each v ∈ S + p , we choose τ v as in 7.16(2) to contain exactly V v and V v . Consider M ∞ (σ(τ )) over R ∞ (τ ). The deformation rings for v / ∈ S + p are again formally smooth. By the previous paragraph, r is modular of all the obvious weights and so M ∞ (σ(τ )) is nonzero. By Table 7 andProposition 7.14, we deduce that

e(M ∞ (σ(τ ))) = e(R ∞ (τ )) = 2 |S + p | .
By the inductive hypothesis, the contribution to e(M ∞ (σ(τ ))) of any Serre weight in W ? (r)∩ JH(σ(τ )) not equal to ⊗ v∈Σ + p V v is 1. We deduce that e(M ∞ (⊗ v∈Σ + p V v )) = 1. Finally, we show that if r is modular of any reachable weight then it is modular of a reachable weight ⊗ v∈Σ + p V v where V v lower alcove for each v. Assume r is modular of a reachable weight ⊗ v V v . As above, let S + p ⊂ Σ + p be the set of places for which V v is a shadow weight. Assume |S + p | is minimal among such weights and is nonzero. Choosing types τ v as above, we conclude that e(M ∞ (σ(τ ))) = 2 |S + p | and so

e(M ∞ (⊗ v∈Σ + p V v )) ≤ 2 |S + p | .
Choose now a place v 0 ∈ S + p , and replace τ v 0 by a tame type τ v 0 for the shadow weight V v 0 as in Proposition 7.16(4). (Note that since ρ v is 8-generic, then τ v is 6-generic; this implies that weights in JH(σ(τ v )) are reachable.) For the new type τ , we have

e(M ∞ (σ(τ ))) = 2 |S + p |+1 .
By comparing multiplicities and using that M ∞ vanishes on reachable weights

⊗ v V v if V v / ∈ W ? (ρ v ) for some v ∈ Σ + p , we conclude that M ∞ (⊗ v V v ) = 0 for some Serre weight ⊗ v V v of r such that V v ∈ W obv (ρ v ) if V v ∈ W obv (ρ v )
for all v and V v 0 ∈ W obv (ρ v 0 ). This contradicts the minimality of |S + p |. To prove that r is modular of a weight ⊗ v∈Σ + p V v with V v reachable and lower alcove for all v, one repeats the argument of the last paragraph beginning with a modular weight ⊗ v∈Σ + p V v with V v reachable and obvious for all v, defining S + p ⊂ Σ + p using upper alcove in place of shadow, and defining τ and τ using Proposition 7.16(1) and (3).

We provide an example of a calculation of modular reachable Serre weights for a nonsemisimple ρ. This will be needed in §8.2.2 for the proof of Theorem 7.7.

Proposition 7.17. Let τ be a strongly generic tame type. Let ρ be a non-semisimple representation such that w(ρ, τ ) = α (i.e., c 22 = 0 in Table 4). Then there is a subset W ? (ρ) ⊂ W ? (ρ ss ) consisting of six weights such that the following holds:

There exists a CM field F and a continuous Galois representation r : G F → GL 3 (F) as in the statement of Theorem 7.8, except that r| G F v ∼ = ρ at all places v ∈ Σ + p and such that

v∈Σ + p F a v ∈ W (r) ⇐⇒ F a v • ι -1 v ∈ W ? (ρ) for all v ∈ Σ + p .
Proof. We focus on the case of principal series type as the other cases are similar. Let such that the étale ϕ-module M with Mat(ϕ 3 M ) given by

τ = ω -a ⊕ ω -b ⊕ ω -c
s 0 As 0 -1 s 1     v a+1 0 0 0 v b-1 0 0 0 v c     ϕ(A)s 1 -1 s 2     v p(a+1) 0 0 0 v p(b-1) 0 0 0 v pc     ϕ 2 (A)s 2 -1     v p 2 c 0 0 0 v p 2 (a+1) 0 0 0 v p 2 (b-1)     (cf. Proposition 2.26) is isomorphic to the étale ϕ 3 -module M associated to ρ| G Q p 3 ,∞ , which
has matrix Mat(ϕ 3 M ) given by

A α     v a 0 0 0 v b 0 0 0 v c     ϕ(A α )     v pa 0 0 0 v pb 0 0 0 v pc     ϕ 2 (A α )     v p 2 a 0 0 0 v p 2 b 0 0 0 v p 2 c     .

Indeed we can set

A def = A α     v -1 0 0 0 v 0 0 0 1   
 s 1 -1 s 0 , and this has the required properties.

We now address the proof of the proposition. We pick a weak minimal patching functor for r (it exists since r and F/F + satisfy the setup of §7.2). Note that

M ∞ (⊗ v∈Σ + p F (a - 1, b, c + 1) • ι v ) = 0 in our situation. First note that if ⊗ v V v ∈ W (r) then V v ∈ W ? (ρ)
for all v ∈ Σ + p by Theorem 1.1 in [MP]. To finish the proof, it suffices to show that

e(M ∞ (⊗ v V v )) = 1 if V v ∈ W ? (ρ) for all v.
We first show this statement in the case where V v ∈ {F (a -1, b, c + 1), F (a -1, c, bp + 2)} for all v. Let S be the set of v ∈ Σ + p such that V v = F (a -1, c, b -p + 2). We induct on the size of S. Consider the type ⊗ v∈Σ + p σ(τ v ) where τ v is as in item (1). Then

M ∞ (⊗ v∈Σ + p σ(τ v )) = M ∞ (⊗ v∈Σ + p F (a -1, b, c + 1) • ι v ). By
σ(τ v ))) = 2 |S| . Every ⊗ v∈Σ + p V v ∈ JH(⊗ v∈Σ + p σ(τ v ))∩W (r) we have V v ∈ {F (a-1, b, c+1), F (a-1, c, b-p+2)} for all v. All such factors other than ⊗ v∈Σ + p V v will have V v = F (a-1, c, b-p+2
) for strictly less than |S| embeddings v. From the inductive hypothesis we deduce that e(M ∞ (⊗ v V v )) = 1.

A similar argument using the type τ as in item (3) deals with the case where V v ∈ W obv (ρ).

Finally we deal with the shadow weights in W ? (ρ) exactly as in Theorem 7.8, using the type τ as in item (5) to deal with the weight F (a, c, b -p + 1) and the types as in item (4) for the remaining shadows.

We conclude this section with a counterexample to [Gee11, Conjecture 4.3.2] (the crystalline conjecture).

Proposition 7.18. Let F = F (a -1, b, c + 1) be a lower alcove weight such that the triple (a, b, c) is generic and write F Sh def = F (c+p-1, b, a-p+1). There exists a CM field F where p splits completely and a continuous automorphic Galois representation r : G F → GL 3 (F) Proof. We consider the generic type

such that ⊗ v∈Σ + p F • ι v ∈ W (r) but (⊗ v∈Σ + p \S F v • ι v ) ⊗ (⊗ v∈S F Sh • ι v ) / ∈ W (
τ def = ω -a ⊕ ω -b ⊕ ω -c . It satisfies F, F Sh ∈ JH(σ(τ )).
Then there exists M ∈ Y µ,τ (F) over F p ⊗ Fp F[[u]] endowed with an eigenbasis β such that

A def = Mat β (φ M,ω c
) is given by the matrix in row αβα in Table 4, Note that w(ρ, τ ) = αβα by construction.

By the same argument as in the proof of Proposition 7.17, we find a CM field F/F + which is unramified at all finite places and an automorphic Galois representation r : G F → GL 3 (F) satisfying the Taylor-Wiles conditions such that r| G Fw ∼ = ρ for all w ∈ Σ p (note that ρ admits a crystalline lift of weight (a + 1, b + 1, c + 1)).

Let M ∞ be a weak minimal patching functor for r (which exists by Proposition 7.15).

Let σ(τ ) • be the unique lattice in σ(τ ) such that σ(τ

) • has irreducible cosocle isomorphic to ⊗ v∈Σ + p F • ι v .
Then the kernel N of the surjection σ(τ

) • ⊗ v∈Σ + p F • ι v contains all the weights of the form (⊗ v∈Σ + p \S F • ι v ) ⊗ (⊗ v∈S F Sh • ι v ) where ∅ = S ⊆ Σ + p . By [HLM17, Theorem D], if a weight ⊗ v∈Σ + p F v • ι v is modular, then necessarily F v ∈ {F, F Sh } for all v.
Thus for the first claim of the Proposition, it suffices to show M ∞ (N ) = 0. Indeed on one hand, we have e M ∞ (⊗ v∈Σ + p F • ι v ) ≥ 1 (since r is modular of the lower alcove weight ⊗ v∈Σ + p F • ι v ). On the other hand, we have e (M ∞ (σ(τ )

• )) = e R ∞ (τ ) = 1 since R ∞ (τ ) is formally smooth over O (cf. row 6 in Table 7).
By exactness of M ∞ , we conclude that e(M ∞ (N )), and hence M ∞ (N ), is 0 as required.

As for the last part of the statement, let W def = W (c + p -1, b, a -p + 1) denote the GL 3 (F p )-representation over F obtained by taking the GL 3 (F p )-rational points of the Weyl module of highest weight (c + p -1, b, a -p + 1), and extending the coefficient field to F.

Then JH(W ) = {F, F Sh }.

For any ∅ = S ⊆ Σ + p , we have M ∞ (⊗ v∈Σ + p \S F • ι v ) ⊗ (⊗ v∈S W • ι v ) =

The α and id shapes

The aim of this section is complete the proof of Theorems 7.4 and 7.7 by studying the deformation rings in the most complicated cases when the shape has length 0 or 1. To recall the assumptions, τ will be a generic tame inertial type and ρ : G Qp → GL 3 (F) satisfies w(ρ, τ ) ∈ {α, id}. There are three cases to consider: the identity shape w(ρ, τ ) = id ( § 8.1), the case where w(ρ, τ ) = α and ρ is semisimple ( § 8.2.1) and the case where w(ρ, τ ) = α and ρ is non-semisimple ( § 8.2.2) In the three cases, the cardinality of the intersection JH(σ(τ ))∩W ? (ρ) is 6, 6 and 5 respectively (see Proposition 7.17 when ρ is non-semisimple).

The difficulty of these cases is that the monodromy equations in characteristic 0 become too complicated to manipulate, and in particular it is hard to see exactly the effect of p-saturation. Nevertheless, one can guess an explicit candidate for the mod p fiber of the deformation ring, because the monodromy equations (and the relations implied by psaturation) become much simpler mod p. A priori, this candidate could be strictly larger than the mod p fiber of the deformation ring, but we then invoke global arguments in the form of the Serre weight conjectures (Theorem 7.8 and Proposition 7.17) to show that this does not happen.

The genericity condition is used to guarantee that the error terms in the monodromy equations are divisible by a large enough power of p so that they can be ignored in our manipulations after reducing modulo p.

With respect to the notations of § 2.1, we have f = 1 and set a 8.1. The identity shape. We now assume that τ is n-generic with n ≥ 4 and that

w(ρ, τ ) = id. Let A =     c 11 + c * 11 (v + p) c 12 c 13 vc 21 c 22 + c * 22 (v + p) c 23 vc 31 vc 32 c 33 + c * 33 (v + p)     .
In this section, we work over the ring R aux which is defined to be the p-saturation of the We have

quotient of O[c ij , (c * ii ) ±1 , 1 ≤ i, j ≤
-A † |v=-p =     -pec * 11 (a -b)c12 (a -c)c13 -p(e + b -a)c21 -pec * 22 (b -c)c23 -p(e + c -a)c31 -p(e + c -b)c32 -pec * 33     , det(A) P (v) A -1 |v=-p=     c * 22 c33 + c * 33 c22 -c23c32 c13c32 -c * 33 c12 -c * 22 c13 pc * 33 c21 c * 11 c33 + c * 33 c11 -c13c31 c13c21 -c * 11 c23 -pc21c32 + pc * 22 c31 pc * 11 c32 c * 11 c22 + c * 22 c11 -c12c21     .
In the following lemmas, let us abbreviate

U def = A| v=-p and V def = det(A) P (v) A -1 | v=-p .
Lemma 8.1. The ring R aux is a domain and c ij = 0 in R aux for all 1 ≤ i, j ≤ 3.

(A| v=-p ) Z det(A) P (v) A -1 | v=-p = (U ij X j ) 1≤i,j≤3 with pX j ∈ R aux [Z ij , 1 ≤ i, j ≤ 3].
Proof. It suffices to show that for any 1 ≤ i, k, l, j ≤ 3, one has (8.1) The fact that X jkl is independent of i can also be checked on the locus (using Lemma 8.1) where all the U ij 's are invertible, where it follows immediately from the 2 by 2 minor condition (

U ik V lj = U ij X jkl for some X jkl ∈ 1 p O[c ij , c * ii , 1 ≤ i, j, ≤ 3] independent of i. The fact that the (U ik V lj ) ∈ c ij p O[c ij , c * ii , 1 ≤ i, j, ≤ 3] follows from the fact that V lj is a R aux -
U ik U ij = U i k U i j
).

We now study the deformation ring. We observe that the finite height ring R τ,β, M is an R aux -algebra in an obvious way.

Recall the O-algebra R τ,β, M,ρ from Definition 5.10 (2). By (5.9) and Theorem 4.16, it is isomorphic to a power series ring in 3 variables over the potentially crystalline ring R µ,τ ρ , and hence has relative dimension 14 over O. Recall also (cf. (5.9)) that we have a surjection π : R τ,β, M R τ,β, M,ρ , where we quotient out by the monodromy equations (and take the reduced and p-flat quotient of the result).

The leading term for the monodromy is given by (A † P (v) 2 A -1 ) v=-p (cf. Definition 5.5). A direct computation shows that in R aux we have the equality

Define

(A † P (v) 2 A -1 ) v=-p = A| v=-p •     Mon 1 0 0 0 Mon 2 0 0 0 Mon 3    
Thus Theorem 5.6 and Lemma 8.2 show that in R τ,β, M,ρ we have the equation

A| v=-p •     Mon 1 + O 1 (p n-2 ) 0 0 0 Mon 2 + O 2 (p n-2 ) 0 0 0 Mon 3 + O 3 (p n-2 )     = 0
where O i (p n-2 ) stands for an error term which is divisible by p n-2 .

The following proposition refines Theorem 5.12 in the present situation:

Proposition 8.3. The surjection π factors through the quotient of R τ,β, M by the relations

(8.2) Mon i + O i (p 2 ) = 0, ∀i ∈ {1, 2, 3}.
Proof. We already know that (Mon j + O j (p 2 ))c ij = 0. The refinement will come from the fact that R µ,τ ρ classifies representations with Hodge-Tate weights exactly (2, 1, 0

) instead of just being in [0, 2]. Since R µ,τ ρ is flat and R µ,τ ρ [ 1 p ] is regular, it suffices to show that the equations (8.2) hold in the p-flat closure of each connected component of R τ,β, M,ρ [ 1 p ]. Let R denote the p-flat closure of a connected component of R τ,β, M,ρ [ 1 p ]
and assume that we have Mon 1 + O 1 (p 2 ) = 0 in R. Since R is a domain, we conclude that c i1 = 0 in R for all i. On the other hand, c ij cannot be 0 in R for all i, j since the Hodge-Tate weights are exactly (2, 1, 0), so at least one of the equations Mon j + O j (p 2 ) = 0 for j = 2, 3 holds in R. Assume without loss of generality that Mon 2 + O 2 (p 2 ) = 0. This implies that c 33 ∈ pR × and in particular c 33 = 0. Then the ring R τ,β, M,ρ / is a power series ring over a quotient of R.

Proof. This is a direct consequence of Proposition 8. Proof. Observe that the relations defining R are actually polynomials instead of genuine power series, so R can be viewed as a completion of a quotient of a polynomial ring by the ideal I generated by the relations above. We use some standard terminology from the theory of Gröbner bases [START_REF] Eisenbud | Commutative algebra[END_REF]. We pick the monomial order on The computation of the irreducible components is left as an easy exercise to the reader.

F[c ij ] def = F[c ij , 1 ≤ i, j ≤
For the following Proposition, we need to assume that τ is strongly generic.

Proposition 8.6. Assume that τ is strongly generic. Then R τ,β, M,ρ / is isomorphic to a power series ring over R.

Proof. We globalize ρ to a r : G F → GL 3 (F) such that the following conditions hold:

• The assumptions of Theorem 7.8 are satisfied;

• r is unramified away from p;

• p splits completely in F . Make a choice ṽ above each place v|p in F + ;

• For each ṽ|p, there is an isomorphism F ṽ ∼ = Q p and r| G F ṽ ∼ = ρ (cf. the proof of Proposition 7.17). With this global setting, we can choose a weak minimal patching functor M ∞ . We now choose a tame type ⊗ v∈Σ + p τ v such that r| G F ṽ has a shape of length 4 with respect to τ v for all but one place v 0 |p, while r| G F ṽ0 has id shape with respect to τ v 0 def = τ . Since τ is strongly generic, we deduce from Lemma 8.7 below that ρ is 8-generic.

Moreover JH(σ(τ )) consists of reachable weights. With this choice, the intersection JH(⊗ v∈Σ + p σ(τ v )) ∩ W ? (⊗ v∈Σ + p r| G F ṽ ) (with obvious notation) consists of exactly 6 weights. By Theorem 7.8, we conclude that if W is any Serre weight for G in this intersection we have M ∞ (W ) = 0. Thus we have e(M ∞ (σ(⊗ v∈Σ + p τ v ))) ≥ 6. On the other hand, by our choice of τ v and the knowledge of Galois deformation rings for length 4 shapes (Corollary 5.13 and Table 7), R ∞ (⊗ v∈Σ + p τ v ) is isomorphic to a power series ring over R µ,τv 0 ρ . It follows that e(R µ,τ ρ / ) ≥ 6. The Proposition now follows from Lemma 8.8 below, the fact that R τ,β, M,ρ / receives a surjection from a power series ring over R (Corollary 8.4) and has the same Hilbert-Samuel multiplicity as R µ,τ ρ / . Proof. This follows from a direct computation using Proposition 2.26. Lemma 8.8. Suppose R, S are complete Noetherian local rings over F, with R S.

Assume that R is reduced, that R and S are equidimensional with dim R = dim S and that e(R) = e(S). Then R ∼ = S.

Proof. Let I be the kernel of R S. Because e(R) = e(S) and dim R = dim S, the support of I as an R-module does not contain any minimal primes, hence I p = 0 for all minimal primes p of R. But this implies that I is inside the intersection of all the minimal primes of R, hence I = 0 because R is reduced.

Corollary 8.9. Assume that τ is strongly generic. The ring R µ,τ ρ is normal, Cohen-Macaulay, and R µ,τ ρ [ 1 p ] is a domain.

Proof. By Propositions 8.5, 8.6 above, R τ,β, M,ρ / is reduced and Cohen-Macaulay, hence R µ,τ ρ / inherits those properties by formal smoothness (cf. (5.9)). This implies Cohen-Macaulayness.

Since R µ,τ ρ [ 1 p ] is regular, to show it is a domain it suffices to show it has no non-trivial idempotent. Suppose e is a non-trivial idempotent. Then there is a maximal k ∈ Z such that -k e ∈ R µ,τ ρ . By maximality and e = e 2 ∈ 2k R µ,τ ρ , we have k ≥ 2k. On the other hand ( -k e) 2 = -k ( -k e) and -k e = 0 mod , hence we must have k = 0 since R µ,τ ρ / is reduced. But then e is an idempotent of the local ring R µ,τ ρ , hence it must be a trivial idempotent.

Finally, since R µ,τ ρ [ 1 p ] is regular and R µ,τ ρ / is reduced, R µ,τ ρ satisfies conditions R 1 and
S 2 , hence is normal.

Remark 8.10. The reason for which we need τ to be 10-generic in Proposition 8.6 is due to Lemma 8.7 and the 8-genericity assumption on ρ appearing in Theorem 7.8. By Remark 7.10 an improvement on weight elimination for a niveau three ρ could relax the genericity assumption on τ . (An inspection of the proof of Theorem 7.8 and Table 8 shows however that any improvement of Theorem 7.8 based on stronger weight elimination results will require ρ to be at least 7-generic: in order to obtain a further relaxation on the genericity hypotheses on ρ, hence on τ , one should be able to perform the explicit computations in § 5.3 with types which are m-generic with m ≤ 4).

We also observe that in the specific situation of Proposition 8.6 we could have avoided Lemma 8.7, noting that w(ρ, τ ) = id implies that ρ and τ have the same degree of genericity.

However, this is no longer true when w(ρ, τ ) = γ, in which case we need to invoke Lemma 8.7 to have the analogous statement of Proposition 8.6 for shape γ.

8.2. The α shape. We assume that τ is n-generic with n ≥ 4 and that w(ρ, τ ) = α. The universal family of shape α is given by

A =     c 11 c 12 + (v + p)c * 12 c 13 c * 21 v c 22 + (v + p)c 22 c 23 c 31 v c 32 v (c 33 + (v + p)c * 33 )    
subject to the condition that all 2 by 2 minors of We have Proof. The proof is very similar to the proof of Proposition 8.5, so we will only sketch it.

-A † v=-p =     0 (a -b)c12 -epc * 12 (a -c)c13 -p(e -a + b)c * 21 -epc 22 (b -c)c23 -p(e -a + c)c31 -p(e -b + c)c32 -pec * 33     , det(A) P (v) A -1 |v=-p=     -c23c32 + c22c * 33 + c33c 22 c13c32 -c12c * 33 -c * 12 c33 c * 12 c23 -c13c 22 pc * 33 c * 21 -c13c31 + c11c *
The relation ideal I defining R consists of polynomials, and indeed form a Gröbner basis with respect to the monomial order c 11 > c 13 > c 21 > c 23 > c 31 > c 32 > c 22 . Since the initial ideal of I is generated by square-free monomials, we get reducedness. Cohen-Macaulayness follows as in Proposition 8.5.

8.2.2. The non-semisimple case. Finally, we handle the case where ρ is non-semisimple.

Then we have that c 22 is a unit instead of a topologically nilpotent element. The relations of Propositions 8.11, 8.12 continue to hold, the only difference is that R is not a quotient of The proofs of the following results for the α shape are exactly the same as the proofs for the id shape, so we will not repeat them.

Proposition 8.13. Assume that τ is strongly generic. Then R τ,β, M,ρ / is isomorphic to a power series ring over R.

Corollary 8.14. Assume that τ is strongly generic. Then the ring R µ,τ ρ is normal, Cohen-Macaulay, and R µ,τ M [ 1 p ] is a domain.

This completes the proof of Theorem 7.7. 9. Appendix: Tables Table 1. The (2, 1, 0)-admissible elements

Length 4 αβαγ = t (2,1,0) , βγαγ = t (1,2,0) , βγβα = t (0,2,1) , γαβα = t (0,1,2) , αγαβ = t (1,0,2) , αβγβ = t (2,0,1) Table 5. Deforming M by shape (without monodromy) w j ) is the degree of the polynomial in each entry. We write k * to indicate an entry polynomial of degree k whose leading coefficient is a unit. We use c * to indicate an entry which is a unit in R. Each entry is also subject to the condition that the reduction modulo m R gives A (j) w j . The third column is further explained in Remark 4.9. In the fourth column, we describe Mat β (φ (j) M,s j+1 (3) ) with finite height and determinant conditions imposed, and performing some obvious p-saturation. However, we do not claim that we have performed all the p-saturation in the case of the last 5 rows. We list the generator of I The condition imposed by monodromy on the coefficients of Mat β φ (j)

M,s j+1 (3) , according to the shape of M (cf. Table 4). We take a def = a (3) . Note that the table above covers all the shapes of length ≥ 2; the shapes of length ≤ 1 are more delicate and treated in detail in §8.

def=

  p f -1 and consider the Eisenstein polynomials E(u) def = u e + p ∈ K[u] and P (v) def = v + p ∈ K[v] where v = u e . We fix a root π def = (-p) 1 e ∈ K, define the extension L = K(π) and set ∆ def = Gal(L/K). The choice of the root π lets us define a character

  the inertial type of ρ as the isomorphism class of WD(ρ)| I K , where WD(ρ) is the Weil-Deligne representation attached to ρ as in [CDT99], Appendix B.1 (in particular, ρ → WD(ρ) is covariant). Recall that an inertial type is a morphism τ : I K → GL n (O) with open kernel and which extends to the Weil group W K of G K .

  Remark 4.4. In Definition 4.2, we could have considered d R,m (P ) = min i {mv R (r i ) + i} for m ≥ 3; mutatis mutandis, the statement of Proposition 4.3 still holds true.

  Definition 4.15. Let R be a complete local Noetherian O-algebra and let M ∈ Y [0,2],τ (R) lifting M. An eigenbasis β lifting β is called a gauge basis if the matrix

  Theorem 4.16. Let M, M, β be as in Definition 4.15. The map β → β mod u induces a bijection between gauge bases of M and eigenbases of M/uM lifting β mod u.

  that v s-i(1) |I (j+1) nk(1) . Since every term in the equation except the leftmost term has d R ≥ δ + 3, we conclude thatd R (I (j+1) nk(1) ) ≥ δ + 2.Similarly, by comparing the nk(2) entries and truncating, using that d R (I(j+1) nk(1) ) ≥ δ + 2, we also have d R (I (j+1) nk(2) ) ≥ δ + 2.Finally, comparing the nk(3) entries and truncating, and using d R (I (j+1) nk(l) ) ≥ δ +2 for l = 1, 2, we get d R (I (j+1) nk(3) ) ≥ δ +1 (note the loss of -1 in the lower bound for d R (I (j+1) nk(3) ), which is due to the weaker estimate d R (( A (j) 1 ) km(3) ) + 1 ≥ i(3)). 4.3. Height conditions. Let M ∈ Y µ,τ w (F). We now compute the universal lift of M with height conditions. Fix a gauge basis β mod p of M (Definition 2.22). We consider the problem of deforming (M, β). Recall the closed substack Y µ,τ ⊂ Y [0,2],τ introduced in §3.1 and constructed in [CL, Proposition 5.2]. For any Artinian O-algebra A with residue field F, let D τ,β M (A) be the category of pairs (M A , β A ) deforming (M, β) where M A ∈ Y µ,τ (A) and β A is a gauge basis of M A . By Theorem 4.16, the morphism

4.3. 1 .

 1 The αβα cell. Assume that M (j) has shape w j = αβα. From Theorem 4.1, we deduce that A P (v)c * 22 c 23 + P (v)c 23 c * 31 v c 32 v c 33 + P (v)c 33     where c * 13 , c * 31 , c * 22 are units. Let us consider first condition i). The congruence A (j) αβα (13) ≡ 0 produces (after killing off an extra v factor) c 22 = 0 and, similarly, A all k = 1, 2, 3. Similarly, we deduce from A (j) αβα (2k) ≡ 0 that c 12 c 33 = -pc 32 c 13 , c 11 c 33 = -pc * 31 c 13 , c 11 c 32 = c * 31 c 12(for k = 1, 2, 3 respectively). Now condition ii) becomes equivalent to(c 11 c 33 + pc * 31 c 13 ) + P (v) c 33 c 11 -c * 31 c 13 + pc * 31 c * 13 -c * 31 c * 13 P (v) 2 = x * P (v) 2which implies thatP (v) c 33 c 11 -c * 31 c 13 + pc * 31 c * 13 -c * 31 c * 13 P (v) 2 = x * P (v) 2 .We conclude that conditions i) and ii) and the partial p-saturation process above implies the following relations c 12 c 33 = -pc 32 c 13 , c 11 c 33 = -pc * 31 c 13 , c 11 c 32 = c * 31 c 12 c 33 c 11 -c * 31 c 13 + pc * 31 c * 13 = 0On the other hand, these relations imply that conditions i) and ii) are satisfied. This explains the fourth column, αβα-row in the table 5. 4.3.2. The βα cell. Assume that w j = βα. We have A P (v)c 22 c 23 + P (v)c * we deduce c 23 = 0 and c 22 = 0 respectively. These equations imply A we deduce, for k = 2, 3 respectively, c 11 c 33 = -pc * 31 c 13 , c 11 c 32 = c * 31 c 12 (4.4) These relations together with the fact c * 31 being a unit implies A determinant condition, we obtain: P (v) c 22 (c 11 c 33 + pc * 31 c 13 ) + pc * 23 (c 32 c 11 -c * 31 c 12 ) + P (v) 2 c 11 c 22 c 33 + c 12 c * 23 c * 31 -pc * 31 c * 12 c * 23 -c * 31 c 22 c 13 -c 11 c 32 c * 23 + c * 12 c * 23 c * 31 P (v) 3 = x * P (v) 3 which gives the equation c 11 c 22 c 33 + c 12 c * 23 c * 31 -pc * 31 c * 12 c * 23 -c * 31 c 22 c 13 -c 11 c 32 c * 23 = 0. (4.5) As c 11 c 32 c * 23 = c * 31 c 12 c * 23, the equations (4.4), (4.5) yield precisely the conditions appearing in the fourth column, βα-row in the table 5. Conversely, these relations imply that conditions i) and ii) are satisfied.

5. 1 .

 1 Monodromy condition. We begin by recalling some notations from [Kis06]. Let O rig denote the ring of rigid analytic functions on the open unit disc over K. We fix an embedding O rig → K[[u]], i.e. identify O rig with the ring of power series ∞ i=0 a n u n where a n ∈ K verify |a n | p r n → 0 for all r < 1 (and hence S[1/p] is identified with the subring of bounded functions on the open unit disc). Set λ = ∞ n=0 ϕ n E(u) p ∈ O rig . We define a derivation on O rig by N ∇ def = -uλ d du ; the Frobenius on S extends to a Frobenius ϕ on O rig . If Λ is a finite flat O-algebra, we define O rig Λ def = O rig ⊗ Zp Λ. For any Kisin module

Proposition 5. 8 .

 8 Keep the hypotheses of Theorem 5.6. If w j-1 = id, then I (j) mon [1/p] is principal.

  A), β A a gauge basis for M A (3) Let R τ,β M be as in Theorem 4.17 which represents the deformation problem D τ,β M (A). (4) Let R τ,β, M denote the complete local Noetherian O-algebra which represents the deformation problem of triples (M A , β A , e A ) where (M A , β A ) ∈ D τ,β M (A) and e A is a basis of T * dd (M A ) lifting the basis on ρ| G K∞ so that (T * dd (M A ), e A ) is a framed deformation of ρ| G K∞ . (5) Let R τ,β,∇ M denote the O-flat and reduced quotient of R τ,β M such that Spec R τ,β,∇ M [1/p] is the vanishing locus of the monodromy equations on Spec R τ,β M [1/p]. We define R τ,β, ,∇ M from R τ,β, M in a similar way.

For

  any O finite over O, an O -point of R τ,β, M,ρ corresponds to a Kisin module M O ∈ Y µ,τ (O ) such that T * dd (M O ) is a lattice in a potentially crystalline representation with Hodge-Tate weights (2, 1, 0). By Theorem 5.1, the monodromy condition holds at the corresponding O [1/p] point. Any homomorphism R τ,β, ,∇ M → O gives rise to a Kisin module M O together with a gauge basis on which A (j) = Mat β (φ (j) M O ,s j+1 (3) ) has the form given in Table

  are reduced and p-flat and satisfy the defining relations of R expl w j and the monodromy conditions, this gives us R τ,β,∇ M . 5.3.1. The αβα cell. From the monodromy equation in Table6, we have(5.10) (e -(a -c))c 33 c * 22 -p(a -b)c 23 c 32 + pec * 22 c 33 + O(p n-2 ).By the finite height and determinant equations, we see thatc 11 (c 33 + pc 33 ) ≡ -p 2 c * 13 c * 31 hence c 11 is a unit in R τ,β M [1/p].We multiply (5.10) by c 11 : using the finite height and the determinant equations, we obtain after easy manipulations:c 11 (a -b)c 23 c 32 -(a -c)c * 22 c 33 + p(e -a + c)c * 31 c * 22 c * 13 + O(p n-3 ).In particular if the descent data is generic, we can write c 11 (a -b)c 23 c 32 -(a -c)c * 22 c 33 = pz * where z * is a unit in R τ,β M . Let y 33 = ((a -b)c 23 c 32 -(a -c)c * 22 c 33 )(z * ) -1 which replaces c 33 . (Note that the former change of variables in R τ,β M makes sense even if the unit z * involves c 33 .) We have (5.11) c 11 y 33 = p. By p-flatness, y 33 is not a zero-divisor, and we can multiply the first height equation by y 33 to get y 33 c 11 c 33 = -py 33 c 13 c * 31 (5.11) =⇒ c 33 = -c 13 y 33 c * 31 thereby eliminating c 33 . The second finite height equation can be solved to eliminate c 13 . We are left then with the one equation c 11 y 33 = p. There are two cases. When (a -b)c 23 c 32 -(a -c)c * 22 c 33 = 0, then y 33 is unit in which case we can solve for c 11 . Otherwise, y 33 is in the maximal ideal, and we are left with this one equation as in Table 7. 5.3.2. The βα cell. From Table 6, the monodromy condition gives (5.12) (-e + a -c)c 33 c 22 + p(a -b)c 32 c * 23 -pec 22 c 33 + O(p n-2 ).

c

  11 (a -b)c 32 c * 23 -(a -c)c 22 c 33 = pz * where z * is a unit. Let y 32 = ((a -b)c 32 c * 23 -(a -c)c 22 c 33 )(z * ) -1 which replaces c 32 so that we have c 11 y 32 = p. Multiplying the first height equation by y 32 , we get y 32 c 11 c 33 = -pc * 31 c 13 y 32 =⇒ c 33 = -c * 31 c 13 y 32 thereby eliminating c 33 . Let y 13 = -(c 11 c 33 -c 13 c * 31 )(c * 23 c * 12 c * 31 ) -1 which replaces c 13 . We have reduced the equations to c 11 y 32 = p, c 22 y 13 = p.

  5.3.3.The αβ cell. The computations are similar to the βα case and we only outline how to obtain the relevant monodromy equations. From Table6, the monodromy condition gives (5.13) (e -a + c)c 31 c 23 + p(e -a + b)c * 21 c 33 + p(a -b)c 31 c 23 + O(p n-2 ). Note that c 22 is a unit in R τ,β M [1/p]. Multiplying the determinant equation by c 22 and using the finite height relation c 22 c 13 = c 12 c 23 , we obtain c 12 (c 23 c * 32 -c 33 c 22 ) = pc * 32 c * 13 c 22 hence c 12 is a unit in R τ,β M [1/p]. We multiply (5.13) by c 12 : using the finite height equations, we obtain -(e -a + c)pc * 13 c * 21 c * 32 + p(e -a + b)c 12 c * 21 c 33 + p(a -b)c 12 c 31 c 23 + O(p n-2 ). Using now the determinant condition, we finally get p c 12 ((a -b)c 31 c 23 + (b -c)c * 21 c 33 ) -p(e -a + c)c * 21 c * 32 c * 13 + O(p n-2 ).

=

  K (π ). We fix a sequence of p-power roots π n of π , such that π n e e = π n , and set

  p f . Let R be any O-algebra and let M ∈ Y [0,h],τ (R). Define (σ f ) * (M) to be the (W (k ) ⊗ Zp R)[[u]]-module obtained from M via the base change σ f : W (k ) → W (k ). We define the Frobenius by φ (σ f ) * (M) def = (σ f ) * (φ M ) and an action of ∆ via the canonical isomorphism

  associate an irreducible representation F a def = v|p F a v of G(O F + ,p ), or in other words a Serre weight for G. All Serre weights are of the form F a for some a ∈ (X F a ∼ = F a if and only if a ∼ a as in Section 3.1 of [GHS]. Definition 7.2. If w|p and a w = (a, b, c) ∈ Z 3 is p-restricted, let F (a, b, c) := F a w be the corresponding weight at w. Then F (a, b, c) is lower alcove if a -c < p -2 and it is in the

  • ) agrees with the definition given after 4.13 of [CEG + 16] by [CEG + 16, Remark 4.15]. This definition guarantees that M ∞ (σ(τ ) • ) is p-torsion free. Exactness of M ∞ follows from [CEG + 16, Proposition 2.10] (the choice of place v 1 guarantees projectivity). (1) and (3) are proved similarly to [CEG + 16, Lemma 4.18(1)]. If V is a Serre weight for G, by Theorem 5.2.1(iii) of [HLM17] and Nakayama's lemma (using Theorem 5.2.1(i) of [HLM17]), M ∞ (V ) is nonzero if and only if r is automorphic of weight V . By Theorem 4.1.4(2) of [Le], M ∞ (V ) is maximal Cohen-Macaulay of depth d, which shows (2). 7.4. Shapes and Serre weights. We now prove Theorem 7.8. The key ingredient in the proof of Theorem 7.8 is the description of the deformation rings in Table 7 and combinatorics of the sets W ? (ρ) and JH(σ(τ )) for generic tame types τ . We first recall the notion of shadow weight. For ρ : G Qp → GL 3 (F) semisimple and weakly generic, W ? (ρ) contains a set of six obvious weights denoted W obv (ρ) (three upper alcove weights and three lower alcove weights, cf. [GHS, Definition 7.1.4 ]) and an additional three weights called shadow weights, as summarized in Table 9. Each lower alcove weight F (a, b, c) ∈ W obv (ρ) has a corresponding shadow weight F (p -2 + c, b, a -p + 2) ∈ W ? (ρ) (cf. [GHS, Definition 7.2.3]).

( 1 )

 1 If F (a, b, c) ∈ W obv (ρ| I Qp ), then there is a (n -2)-generic tame type τ such that JH(σ(τ )) ∩ W ? (ρ| I Qp ) = {F (a, b, c)} and w(ρ, τ ) has length 4.(2) If F (p -2 + c, b, a -p + 2) ∈ W ? (ρ| I Qp ) is a shadow weight, then there is a (n -2)generic tame type τ such that JH(σ(τ )) ∩ W ? (ρ| I Qp ) = {F (a, b, c), F (p -2 + c, b, ap + 2)} and w(ρ, τ ) is a length 3 shadow shape.(3) If F (a, b, c) ∈ W ? (ρ| I Qp ) is an obvious upper (resp. lower) alcove weight, then there is a (n -2)-generic tame type τ such that JH(σ(τ )) ∩ W ? (ρ| I Qp ) contains F (a, b, c) plus one other obvious lower (resp. upper) alcove weight and w(ρ, τ ) is a length 3 non-shadow shape.(4) If F (p -2 + c, b, a -p + 2) ∈ W ? (ρ| I Qp ) is a shadow weight, then there is a (n -2)generic tame type τ such that JH(σ(τ )) ∩ W ? (ρ| I Qp ) contains F (p -2 + c, b, a -p + 2)plus three obvious weights of W ? (ρ| I Qp ) and w(ρ, τ ) has length 2.

  T * dd ) to a G Qp,∞ -representation which extends to a G Qp -representation ρ with ρ| I Qp = ω b+1 ⊕ Ind(ω (a+1)+p(c+1) 2

GL 3

 3 (Fp) P 1 (Fp) ω b+1 ⊗ Θ( ω (c-1)+pa 2) and parallel shape βγβ which appears in the third section of Table8. Define τ orientation s 0 = (12) and s 1 = (132). The special point of (M, ι) ∈ Y µ,τ (F) of shape βγβ hasAWe are only interested in the restriction to inertia and so we can forget ι and set the constantsto 1. Let M def = M ⊗ F[[u]] F((u)) ∈ Φ-Mod étdd (F) be the associated étale ϕ-module with descent datum. By Proposition 2.26, the étale (ϕ 2 , k ⊗ Fp F((v)))-module M 0 def = ε 0 (M) ∆ =id is described, in an appropriate basis f def = (e 1 , e 2 , e 3 ), as follows:

  with a -b, b -c > 3. Let ρ be the unique non-split representation of G Qp of the form characters χ i . Then w(ρ, τ ) = α. To see this, consider a Kisin moduleM ∈ Y µ,τ (F) such that Mat β (φ M,ω c ) = A α .Then by Lemma 2.20 which allows row operations, there is another eigenbasis β for M such that Mat β (φ M,ω c ) is given by It can be seen, for instance via [HLM17, Lemma 2.2.7], that such Kisin module comes from a Fontaine-Laffaille module with Hodge-Tate weights (a+1, b+1, c+1) and the corresponding Galois representation must be ρ (up to unramified twist).

  r) for any ∅ = S ⊆ Σ + p and F v any weight at v ∈ Σ + p \ S. Moreover, for any v ∈ Σ + p the representation r| G F v has a crystalline lift of weight (c + p + 1, b + 1, a -p + 1).

  satisfying (a -b)c 23 c 32 -(a -c)c * 22 c 33 = 0, c 23 c 32 -c * 22 c 33 = 0, c 23 c 32 = 0, and c 33 = 0. Moreover, T dd (M) ∼ = ρ| G Qp,∞ for a continuous Galois representation ρ : G Qp → GL 3 (F). This is checked as in the proof of Proposition 7.17 by showing that the étale ϕ-module associated to M comes from a Fontaine-Laffaille module M over F p ⊗ Fp F with Hodge-Tate weights (a + 1, b + 1, c + 1). In fact it can be shown, using the Fontaine-Laffaille module M , that the associated ρ is maximally non-split with ω a+1 ⊆ ρ and ρ ω c+1 , ρ ss ∼ = ω a+1 ⊕ ω b+1 ⊕ ω c+1 and Fontaine-Laffaille parameter FL(ρ) = 0, ∞: cf. [HLM17, Definition 2.1.10, Corollary 2.1.8 and Lemma 2.2.7].

  0 and hence by classical local-global compatibility r| G F v admits a crystalline lift of weight (c + p + 1, b + 1, a -p + 1) for v ∈ S.

def=

  a s 0 (1),0 , b def = a s 0 (2),0 and c def = a s 0 (3),0 .

-

  3] by the following relations: all 2 by 2 minors of A| v=-p = pc 31 -pc 32 c 33     vanish and the determinant condition c 11 c * 22 c * 33 + c 22 c * 33 c * 11 + c 33 c * 11 c * 22 -c * 11 c 23 c 32 -c * 22 c 13 c 31 -c * 33 c 12 c 21 + c 21 c 13 c 32 = 0.

Proof.

  It suffices to prove the statements for R aux [1/p]. Let Det be the determinantal variety over E on the entries of U obtained by imposing that the 2 by 2 minors of U vanish. Then the map Spec (R aux [1/p]) → Det obtained by forgetting c * ii is smooth and surjective. This gives both statements of the lemma. Lemma 8.2. Keep the setting and notation above. For any matrix Z = (Z ij ) 1≤i,j≤3 of formal variables Z ij , we have the following equality

  linear combination of c mj 's (for example, c * 22 c 33 + c * 33 c 22 -c 23 c 32 = -(c * 22 c * 33 c 11 + c * 22 c 13 c 31 + c * 33 c 12 c 21 -c 21 c 13 c 32 )/c * 11 ), and the minor conditions allows us to convert from c ij c kl to c il c kj , at possibly a cost of a p in the denominator.

  Mon 1 =(e -a + c)c * 22 c 33 + (e -a + b)c 22 c * 33 -(e -a + c)c 23 c 32 + pec * 22 c * 33 Mon 2 =(a -b)c * 33 c 11 + (e -b + c)c 33 c * 11 -(a -b)c 13 c 31 + pec * 33 c * 11 Mon 3 =(b -c)c * 11 c 22 + (a -c)c 11 c * 22 -(b -c)c 12 c 21 + pec * 11 c * 22 .

Thus

  Mon 3 + O 3 (p 2 ) = 0 and hence c 22 ∈ pR × . Now the relation c 12 c 33 = -pc 13 c 32 gives c 12 = -pc 13 c 32 c 33 in R and c 23 c 32 = -1 p c 22 c 33 = 0 in R/ . Thus we see R/ is a quotient of a power series ring in 8 variables over F[[c 13 , c 32 , c 23 , c * ii -[c * ii ], i = 1, 2, 3]]/(c 23 c 32 ). This shows that R/ has dimension at most 13, a contradiction. Corollary 8.4. Let R be the quotient of F[[c ij , 1 ≤ i, j, ≤ 3]] by the relations: c ii c jj = 0, for i = j; c 11 c 23 = 0; c 31 c 22 = 0; c 12 c 23 = c 22 c 13 ; c 11 c 32 = c 12 c 31 ; c 21 c 33 = c 31 c 23 ; (e -a + c)c 33 + (e -a + b)c 22 -(e -a + c)c 23 c 32 = 0; (b -c)c 22 + (a -c)c 11 -(b -c)c 12 c 21 = 0; (a -b)c 11 + (e -b + c)c 33 -(a -b)c 13 c 31 = 0; c 11 + c 22 + c 33 -c 12 c 21 -c 13 c 31 -c 23 c 32 + c 21 c 13 c 32 = 0.

  3 and the observation that replacing c ij by c ij c * jj eliminates the c * ii from all the equations. The following Proposition gives basic structural information about R: Proposition 8.5. The ring R is a reduced 3-dimensional Cohen-Macaulay ring. It has 6 minimal primes and each irreducible component is formally smooth over F. Thus e( R) = 6.

  3] given by c 11 > c 12 > c 13 > c 21 > c 22 > c 23 > c 31 > c 32 > c 33 and write I for the ideal generated by the relations of Proposition 8.4. An easy but tedious calculation (using Buchberger's algorithm, for example) shows that the ideal I has the following Gröbner basis with our In each of the above polynomials, the leading monomial is exactly the left-most term. Thus we see that the initial ideal in(I) of I is generated by square-free monomials. This implies that I is radical: Suppose f k ∈ I, then in(f ) k ∈ in(I), so in(f ) ∈ in(I). But then we can divide f by elements in I and get some f < f with f k ∈ I. Continuing this way, we see that f ∈ I. Furthermore, as in [Eis95, §15.8], we can realize F[c ij ]/I as the fiber F t (for any t = 0) of a flat family F over F[t], such that the fiber F 0 is F[c ij ]/in(I). Since this quotient is Cohen-Macaulay by an explicit check, and the Cohen-Macaulay locus is open in F, we conclude that F is Cohen-Macaulay at some closed point of the form c ij = 0 for all i and j, and t = t 0 = 0. But then (t -t 0 ) is a regular element in the localization of F at this point, and hence the localization of F[c ij ]/I at the closed point c ij = 0 for all i and j is Cohen-Macaulay.

Lemma 8. 7 .

 7 Let n ≥ 2. Let τ 0 be an n-generic inertial type for I Qp and ρ 0 : G Qp → GL 3 (F) be a Galois representation such that there exists M ∈ Φ-Mod ét dd (F) with Y µ,τ 0 M (F) = ∅ (and thus a single point by Theorem 3.2) and V * dd (M) ∼ = ρ 0 | G Qp,∞ . Then ρ 0 is an (n -2)-generic continuous Galois representation.

-

  pc 31 -pc 32 c 33     vanish and the determinant condition c 11 c 22 c * 33 + c 13 c * 21 c 32 -c 13 c 22 c 31 -c 12 c * 21 c * 33 + pc * 21 c * 12 c * 33 = 0.

33,

  we eliminate c * 12 , c * 21 , c * 33 from all equations, so we can assume c * 12 = c * 21 = c * 33 = 1 in what follows. The monodromy equations mod solves c 12 , c 22 in terms of the remaining variables: c 12 = a -c a -b c 13 c 32 , (8.3) c 22 = e -a + c e -a + b c 23 c 32 . (8.4) The determinant condition thus gives c 11 c 22 = b -c a -b c 13 c 32 . (8.5) From the relation c 11 c 32 = c 12 c 31 , using (8.3), the definition of c 32 and (8.5), we obtain: c 11 c 32 =c 13 c 31 c 32 . Multiplying (8.4) by c 13 , (8.3) by c 23 and using the relation c 12 c 23 = c 13 c 22 , we obtain: c 13 c 23 c 32 =0. Using c 22 c 31 = 0 and (8.4), we get c 23 c 31 c 32 =0. Finally, using the third monodromy equation and the previous relations, we obtain (a -b)c 13 c 31 c 22 + (c -b)c 13 c 32 + (e -a + c)c 23 c 31 = 0. Proposition 8.12. The ring R is a reduced 3-dimensional Cohen-Macaulay ring. It has 6 minimal primes, and each irreducible component is formally smooth over F. Thus e( R) = 6. Furthermore, the minimal primes of R are exactly (c 11 -c 13 c 31 , c 23 , (a -b)c 31 c 22 + (c -b) c 32 ); (c 11 , (a -b)c 13 c 22 + (e -a + c)c 23 , c 32 ); (c 11 , c 13 , c 23 ); (c 11 , c 13 , c 31 ); (c 11 , c 31 , c 32 ); (c 23 , c 32 , c 22 ).

F

  [[c 11 , c 13 , c 21 , c 23 , c 31 , c 32 , c 22 ]], but rather a quotient of F[[c 11 , c 13 , c 21 , c 23 , c 31 , c 32 , c 22 -[c 22 ]]]. The effect of c 22 being a unit is that R only has 5 minimal primes instead of 6 (the minimal prime (c 23 , c 32 , c 22 ) is no longer present).

F)FΘ( ω a+pb+p 2 c 3 )Fc

 3 and write Θ(ψ) for the cuspidal representation of GLr(k) associated to a k -primitive character ψ : (k ) × → E × as in [Her09, Lemma 4.4].Table 3. Jordan-Hölder factors of Deligne-Lusztig GL 3 (F p )representations σ(τ ) JH(σ(τ ))Ind GL 3 (Fp) B(Fp) ( ω a 1 ⊗ ω b 1 ⊗ ω c 1 ) (a, b, c), F (c + p -1, a, b), F (b, c, a -p + 1), F (a, c, b -p + 1), F (c + p -1, b, a -p + 1), F (b + p -1, a, c), F (a -1, b, c + 1), F (c + p -2, a, b + 1), F (b -1, c, a -p + 2) Ind GL 3 (Fp) P 2 (Fp) ω a 1 ⊗ Θ( ω b+pc 2 (a, b -1, c + 1), F (c + p -2, a, b + 1), F (b -1, c + 1, a -p + 1), F (a, c, b -p + 1), F (c + p -1, b, a -p + 1), F (b + p -2, a, c + 1), F (a -1, b, c + 1), F (c + p -1, a, b), F (b -1, c, a -p + 2) (a -2, b + 1, c + 1), F (c + p -2, a, b + 1), F (b -1, c + 1, a -p + 1), F (a -1, c, b -p + 2), F (c + p -1, b, a -p + 1), F (b + p -1, a -1, c + 1), F (a -1, b, c + 1), F (c + p -1, a -1, b + 1), F (b, c, a -p + 1)In the table above, the triple (a, b, c) is assumed to be weakly generic, we set P2 def we write Θ(ψ) for the cuspidal representation of GLr(Fp) associated to a F r -primitive character ψ : F × → E × as in [Her09, Lemma 4.4]. See also [Her,Table 4. Shapes of Kisin modules over F 31 v + c 31 v 2 vc 32 c * 31 + v 2 c 31 vc 32 c * In the above, we have c ik , c ik ∈ F and c * ik ∈ F × .

ccccccc

  32 + v 2 c 32 c * p) 2 c * 22 vc 31 v(c 32 + (v + p)c 32 ) c * 21 + (v + p)c 21 ) c 22 c * 23 v(c 21 c 33 (c * 23 ) -1 + (v + p)c 31 ) vc * 11 c 11 c 32 (c * 31 ) -1 c 13 + (v + p)c * 11 c 33 = -pc 13 c * 31 c 11 c 33 -c 13 c * 31 + pc * 13 c * 31 c 12 (c * 32 ) -1 c 12 c 13 + (v + p)c * 31 c 23 (c * 21 ) -1 + (v + p)c 33 22 c 31 = -pc * 21 c * 32 c 12 c 23 = c 22 c 13 c * 21 c * 32 c 13 -pc * 21 c * 32 c * 13 -c 33 c * 21 c 12 = 0 31 ) -1 c 11 c 32 + (v + p)c * 11 c 33 = -pc * 31 c 13 c 22 (c 11 c 33 -c 13 c * 31 ) = pc * 23 c * 12 c 11 c 12 + (v + p)c * 12 c 13 c * 21 v c 22 + (v + p)c 22 c 23 c 31 v c 32 v (c 33 + (v + p)c * 33 ) 2 minors of A (j) α | v=-p vanish, c 11 c 22 c * 33 + c 13 c * 21 c 32 -c 13 c 22 c 31 -c 12 c * 21 c * 33 + pc * 21 c * 12 c * id | v=-p vanish, c 11 c * 22 c * 33 + c 22 c * 33 c * 11 + c 33 c * 11 c * 22 -c * 11 c 23 c 32 -c * 22 c 13 c 31 -c * 33 c 12 c 21 + c 21 c 13 c 32 = 0 Explanation of the table: deg( A (j)

  pc * 33 (e -(a -c))c * 22 c 31 + p(e -(b -c))c 21 c 32 c * 33 -pec * 22 c 31 + O(p n-1 ) (using the (3, 1) entry of the leading term) βγαγ O[[x * 11 , x * 22 , x * 33 , x 12 , x 31 , x 32 , x 32 ]] pc * 33 (e -(b -c))c 32 c * 11 -(e -(a -c))c 12 c 31 + pec 11 c 32 + O(p n-1 ) (using the (3, 2) entry of the leading term) βαγ O[[x 11 , x * 12 , x * 21 , x * 33 , x 22 , x 31 , x 31 , x 32 ]] c 11 c 22 = -pc * 12 c * 21 pc * 33 (e -(a -c))c * 12 c 31 -pec * 12 c 31 -(e -(b -c))c 32 c 11 + O(p n-1 ) (using the (3, 2) entry of the leading term) αβγ O[[x * 11 , x 21 , x 21 , x 22 , x * 23 , x 31 , x * 32 , x 33 ]] c 22 c 33 = -pc * 32 c * 23 pc * 23 (e -(a -c))c * 32 c 21 + (b -c)c 22 c 31 -p(e -(b -c))c * 32 c 21 + O(p n-1 ) (using the (2, 1) entry of the leading term) αβα O[[x 11 , x 32 , x 23 , x 13 , x 33 , x 33 , x * 31 , x * 22 , x * 13 ]] c 11 c 33 = -pc 13 c * 31 c 11 c 33 -c 13 c * 31 + pc * 13 c * 31 = 0 -pc * 31 (e -(a -c))c 33 c * 22 -p(a -b)c 23 c 32 + pec * 22 c 33 ) + O(p n-1 ) (using the (3, 1) entry of the leading term) αβ O[[x 31 , x 22 , x 12 , x 13 , x 23 , x 23 , x 33 , x * 21 , x * 13 , x * 32 ]] c 22 c 31 = -pc * 21 c * 32 c 12 c 23 = c 22 c 13 c * 32 c 13 -pc * 32 c * 13 -c 33 c 12 = 0 pc * 32 (e -(a -c))c 31 c 23 + p(e -(a -b))c * 21 c 33 + p(a -b)c 31 c 23 + O(p n-1 ) (using the (3, 1) entry of the leading term) βα O[[x 11 , x 22 , x 32 , x 13 , x 33 , x 33 , x * 31 , x * 12 , x * 23 ]] c 11 c 33 = -pc * 31 c 13 c 22 (c 11 c 33 -c 13 c * 31 ) = pc * 23 c * 12 c * 31 pc * 31 -(e -(a -c))c 33 c 22 + p(a -b)c 32 c * 23 -pec 22 c 33 + O(p n-1 ) (using the (3, 1) entry of the leading term) α See §8. p (e -a + c)(c 23 c 32 c * 21 -c 22 c 23 c 31 ) -(e -a + b)c 22 c * 33 c * 21 -epc 22 c * 33 c * 21 + O(p n-1 ) (using the (2, 1) entry of the leading term) id See §8. See §8.

s

  j+1(3) . We define the variablesx • ij def = c • ij -[c • ij ] where • = * , or • ∈ ∅ and [•]is the Teichmüller lift.

Θ( ω a+pb+p 2 c 3 )Fω a ⊗ Θ( ω b+pc 2 )F)FFFFFF

 32 τ )) ∩ W ? (ρ) Shape w(ρ, τ )ω a ⊕ ω b ⊕ ω c ⊗ ω Ind GL3(Fp) P2(Fp) ( ω b ⊗ Θ( ω c+pa 2 ))F (a -1, b, c + 1),F (c + p -1, b, a -p + 1) αβα Ind GL3(Fp) P2(Fp) ( ω c ⊗ Θ( ω (a+1)+p(b-1)2))F (b -1, c, a -p + 2), F (a, c, b -p + 1) βγβ Ind GL3(Fp) P2(Fp) ( ω a ⊗ Θ( ω (b+1)+p(c-1)2))F (c + p -2, a, b + 1), F (b + p -1, a, (a -1, b, c + 1), F (c + p -1, b, a -p + 1) αβα Θ( ω (c-1)+pb+p 2 (a+1) 3 ) F (b -1, c, a -p + 2), F (a, c, b -p + 1) βγβ Ind GL3(Fp) B(Fp) ω a ⊗ ω b-1 ⊗ ω c+1 F (c + p -1, a, b), F (b + p -2, a, c + 1) (a -1, b, c + 1), F (c + p -1, b, a -p + 1) (c + p -1, a -1, b + 1), F (b + p -1, a -1, c + 1) γαγ Ind GL3(Fp) P2(Fp) ω b+1 ⊗ Θ( ω (c-1)+pa 2 ) F (b, c, a -p + 1), F (a -1, c, b -p + 2) ω a ⊗ ω b ⊗ ω c F (a -1, b, c + 1), F (c + p -1, b, a -p + 1) αβα Θ ω c+p(b+1)+p 2 (a-1) 3 (c + p -1, a -1, b + 1), F (b + p -1, a -1, c + 1) γαγ Θ ω a+p(b-1)+p 2 (c+1) 3 (b -1, c + 1, a -p + 1), F (a -1, c + 1, b -p + 1) βγβ Table 9. Serre weights for semisimple ρ ρ W obv (ρ) W ? (ρ) \ W obv (ρ) ω a ⊕ ω b ⊕ ω c ⊗ ω F (a -1, b, c + 1), F (b -1, c, a -p + 2), F (c + p -2, a, b + 1), F (a -1, c, b -p + 2), F (b + p -2, a, c + 1), F (c + p -2, b, a -p + 2) F (c + p -1, b, a -p + 1), F (b + p -1, a, c), F (a, c, b -p + 1) (a -1, b, c + 1), F (b -1, c, a -p + 2), F (c + p -1, a, b), F (a -1, c + 1, b -p + 1), F (c + p -1, b -1, a -p + 2), F (b + p -1, a, c) F (c + p -1, b, a -p + 1), F (a, c, b -p + 1), F (b + p -2, a, c + 1(a -1, b, c + 1), F (c + p -1, a -1, b + 1), F (b, c, a -p + 1), F (a -1, c + 1, b -p + 1), F (c + p -1, b + 1, a -p), F (b + p -1, a, c) F (c + p -1, b, a -p + 1), F (b + p -1, a -1, c + 1), F (a -1, c, b -p + 2) (a -1, b, c + 1), F (b -1, c + 1, a -p + 1), F (c + p -1, a -1, b + 1), F (a -1, c, b -p + 2), F (c + p, b, a -p), F (b + p -2, a, c + 1) F (c + p -1, b, a -p + 1), F (b + p -1, a -1, c + 1), F (a -1, c + 1, b -p + 1)The triple (a, b, c) ∈ Z 3 verifies 1 < a -b, b -c < p -2 and a -c < p -2. The table is deduced from [Her09], Lemma 7.6 and Proposition 6.28; alternatively the obvious weights can be deduced from[BLGG], Lemma 5.1.2.

  a finite extension and W Fw ≤ G Fw denotes the Weil group we normalize Artin's reciprocity map Art Fw : F × w → W ab Fw in such a way that uniformizers are sent to geometric Frobenius elements.

  Let R be a local, complete Noetherian O-algebra. By base change, the ring O E,K ⊗ Zp R is naturally endowed with a Frobenius endomorphism ϕ and we write Φ-Mod ét (R) for the category of étale (ϕ, O E,K ⊗ Zp R)-modules. We fix once and for all a ) n∈N where p n ∈ Q p verify p p n+1 = p n and p 0

	18 shapes simply by conjugating by δ or δ 2 .
	2.3. Étale ϕ-modules. We recall briefly some properties of étale ϕ-modules which are
	well-known. We refer to [CDMa, §2.1] and [CL, §5.3] for proofs.
	Let O E,K denote the p-adic completion of S[ 1 v ], where S	def = W [[v]], endowed with the
	unique continuous Frobenius morphism such that the natural inclusion S[ 1 v ] → O E,K is
	Frobenius-equivariant. sequence p def = (p n

  has length greater than or equal 2 for all v | p, then by Theorem 6.14 and Table7, R ∞ (τ ) has connected generic fiber and so if M ∞ (σ(τ ) • ) is nonzero, then it has full support. By Proposition 7.14, we know the Hilbert-Samuel multiplicity of M ∞ (σ(τ ) • ). The strategy is to compute e(M ∞ (⊗ v∈Σ + p V v )) by varying the tame type. In fact, we show that e(M ∞ (⊗ v∈Σ + p

  is nonzero by Definition 7.11(2) and modularity of the obvious weights, and so e(M ∞ (⊗ v∈Σ + p

Table 7 ,

 7 this gives the base case for the induction. In general, we pick the type ⊗ v∈Σ + p σ(τ v ) where τ v is as in item (1) if v / ∈ S and τ v is as in item (2) otherwise. By Table 7, we have e(M ∞ (⊗ v∈Σ + p

Table 2 .

 2 There are 25 different (2, 1, 0)-admissible elements. For simplicity, we label them by the corresponding element in the affine Weyl group of SL3, e.g. αβαγ corresponds to v(αβαγ) Inertial local Langlands

	Length 3 (ordinary)	γαβ, αγβ, αβγ βαγ, βγα, γβα
	Length 3 (shadow)	γαγ, αβα, βγβ
	Length 2	γα, αγ, βα, αβ, βγ, γβ
	Length 1	α, β, γ
	Length 0	id

in W . If (x, y, z) ∈ X * (T ) ∼ = Z 3 is a cocharacter, we write t (x,y,z) for the image of translation by (x, y, z) in W .

Table 6 .

 6 Monodromy equations * 33 , x 21 , x 31 , x 31 , x 32 ]]

	w j	R expl wj	Leading term
	αβαγ	O[[x * 11 , x * 22 , x

Table 7 .

 7 Deformation rings with monodromy * 33 , x 21 , x 31 , x 32 ]] βγαγ (e -b + c)c 32 c * 11 = (e -a + c)c 12 c 31 O[[x * 11 , x * 22 , x * 33 , x 12 , x 31 , x 32 ]] βαγ c 31 = 0 O[[y 11 , y 22 , x * 12 , x * 21 , x * 33 , x 31 , x 32 ]]/(y 11 y 22 -p) αβγ c 21 = 0 O[[y 22 , y 33 , x * 11 , x 21 , x * 23 , x 31 , x * 32 ]]/(y 22 y 33 -p) αβα (a -b)c 23 c 32 -(a -c)c * 22 c 33 = 0 O[[x 32 , x 23 , x 33 , x * 31 , x * 22 , x * 13 ]] αβα (a -b)c 23 c 32 -(a -c)c * 22 c 33 = 0 O[[x 11 , x 32 , x 23 , y 33 , x * 31 , x * 22 , x * 13 ]]/(x 11 y 33 -p) αβ c 33 = 0 O[[y 31 , x 22 , x 23 , x 33 , x * 21 , x * 13 , x * 32 ]]/(y 31 x 22 -p) αβ c 33 = 0 O[[y 31 , x 22 , x 12 , x 23 , y 33 , x * 21 , x * 13 , x * 32 ]]/(y 31 x 22 -p, x 12 y 33 -p) βα c 32 = 0 O[[x 22 , y 13 , x 32 , x 33 , x * 31 , x * 12 , x * 23 ]]/(x 22 y 13 -p) βα c 32 = 0 O[[x 11 , x 22 , y 32 , y 13 , x 33 , x * 31 , x * 12 , x * 23 ]]/(x 22 y 13 -p, x 11 y 32 -p)

	w j	Condition on M	R expl,∇ M, w j
	αβαγ	c 31 = 0	O[[x * 11 , x * 22 , x

Table 8 .

 8 Types with Weyl intersection in the proof of Proposition 7.16(2)

Definition 6.3, using T * dd (Proposition 6.6) in place of T * dd , and with the notion of gauge basis as in Definition 6.11. For instance, we now have

We obtain a diagram analogous to (5.9). We stress that the universal Kisin module living over R τ,β M is a Kisin module of type (µ, τ ), and R τ,β,∇ M is obtained by imposing the monodromy condition on a Kisin module of type (µ, τ ). The arguments from §5.2 will largely go through, so we will only discuss the modifications that need to be made.

The fact that the map SpfR τ, M,ρ → SpfR µ,τ ρ is an isomorphism is due to the following: By Corollary 3.6, there is a unique Kisin module M of type (µ, τ ) living over SpfR µ,τ ρ . What needs to be checked is that there is a unique isomorphism ι : (σ f ) * (M) ∼ → M verifying the cocycle condition. Proposition 6.6 shows that the extension to G K∞ of T * dd (M) given by the universal Galois deformation corresponds exactly to an isomorphism ι :

verifying the cocycle condition, where M is the étale ϕ-module of M. But the uniqueness of M shows that this ι respects M ⊂ M.

The fact that adding gauge bases on (M, ι) is a formally smooth operation follows from Proposition 6.12. The analogue of Theorem 5.12 holds by the following Lemma: Lemma 6.13. Let E /E be a finite extension. Let V E be a continuous representation of

Proof. This is a consequence of the fact that the restriction from crystalline G L -representations to G L ∞ is fully faithful which is Corollary 2.1.14 in [START_REF] Kisin | Crystalline representations and F -crystals[END_REF].

We deduce, with the same hypotheses as in Corollary 5.13, that

Finally, we deduce an explicit description of R τ,β,∇ M as in Section 5.3.

Theorem 6.14. Let τ be a generic type. If w j / ∈ {α, β, γ, id} for all j, then

M, w j is as in Table 7, using e in place of e and a

M,s j+1 (3) . We already saw that A (j+f ) = A (j) . Furthermore, the isomorphism ι shows that the monodromy conditions at the j-th embedding and the (j + f )-th embedding are exactly the same. Definition 7.3. Let r : G F → GL 3 (F) be a continuous Galois representation. We say that r satisfies the Taylor-Wiles conditions if

• r has image containing GL 3 (F 0 ) for some F 0 ⊂ F with #F 0 > 9.

• F ker adr does not contain F (ζ p ).

From now on, we further assume that

• the extension F/F + is unramified at all finite places; and

We make these two assumptions in order to construct a minimal patching functor in Section 7.3. These assumptions can be removed by using not necessarily minimal patched modules, but we avoid this for ease of exposition.

Theorem 7.4. Let r : G F → GL 3 (E) be an absolutely irreducible Galois representation and write r for the reduction of a G F -stable O-lattice in r.

Assume that:

(1) p splits completely in F + ;

(2) r is unramified almost everywhere and satisfies r c ∼ = r ∨ -2 ;

(3) for all places w ∈ Σ p , the representation r| G Fw is potentially crystalline, with parallel Hodge type (2, 1, 0) and with strongly generic tame inertial type τ Σ + p = ⊗ v∈Σ + p τ v (cf. Definition 2.1);

(4) r verifies the Taylor-Wiles conditions (cf. Definition 7.3) and r has split ramification;

(5) r ∼ = r ı (π) for a RACSDC representation π of GL 3 (A F ) with trivial infinitesimal character such that ⊗ v∈Σ + p σ(τ v ) is a K-type for ⊗ v∈Σ + p π v . Then r is automorphic.

Remark 7.5. Note that we do not make any potentially diagonalizability assumption. In fact, we do not know whether or not r| G Fw in the theorem is potentially diagonalizable. We also do not assume that r| G Fw has any particular form.

Remark 7.6. The first assumption and the strong genericity condition can both be relaxed if one assumes that at each place w the shape is not one of {α, β, γ, id}. The difficulty comes from the absence of a general, explicit description of the deformation ring (rather than its special fiber) in those cases, where we need the Serre weight conjectures as input to show Theorem 7.7.

Note that ρ admits a Fontaine-Laffaille and hence a potentially diagonalizable lift with Hodge-Tate weights (a + 1, b + 1, c + 1). We can now apply Lemma A.5 and Proposition A.6 of [START_REF]A geometric perspective on the Breuil-Mézard conjecture[END_REF] to produce an r : Let

⊂ W ? (ρ ss ).

The top row are obvious weights for ρ ss ; the bottom row are shadow weights. Define

To prepare for the proof, we observe:

(1) There exists a generic tame type τ such that JH(σ(τ ))∩W ? (ρ) = {F (a-1, b, c+1)} and w(ρ, τ ) is a length 4 shape;

(2) There exists a generic tame type τ such that JH(σ(τ )) ∩ W ? (ρ) = {F (a -1, b, c + 1), F (a -1, c, b -p + 2)} and w(ρ, τ ) is a length 3 non-shadow shape;

(3) There exists a generic tame type τ such that JH(σ(τ )) ∩ W ? (ρ) = {F (c + p -2, a, b + 1), F (a -1, c, b -p + 2)} and w(ρ, τ ) is a length 3 non-shadow shape;

(4) For each F ∈ W obv (ρ) such that F is lower alcove with shadow F ∈ W ? (ρ), there is a generic tame type τ such that w(ρ, τ ) is a length 3 shadow shape;

(5) For the type

, we have that JH(σ(τ )) ∩ W ? (ρ) = {F (c + p -2, a, b + 1), F (a, c, b -p + 1)} and w(ρ, τ ) is a length 3 non-shadow shape.

For items (1)-(4), we pick the type τ which satisfies the analogous properties for ρ ss (cf.

Proposition 7.16). What needs to be checked are the claims about the shapes of ρ with respect to τ .

We will do it for item (5), the other cases will be similar. Note that by Proposition 6.1, the orientation for the type τ v is s 0 = (123), s 1 = (123) 2 and s 2 = id. We claim that w(ρ, τ ) = αβγ. To do this, it suffices to show that there exists a matrix A ∈ I(F)αβγ I(F)