Equivariant K-Theory and Refined Vafa–Witten Invariants

In Maulik and Thomas (in preparation) the Vafa–Witten theory of complex projective surfaces is lifted to oriented C∗\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathbb {C}}^*$$\end{document}-equivariant cohomology theories. Here we study the K-theoretic refinement. It gives rational functions in t1/2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$t^{1/2}$$\end{document} invariant under t1/2↔t-1/2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$t^{1/2}\leftrightarrow t^{-1/2}$$\end{document} which specialise to numerical Vafa–Witten invariants at t=1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$t=1$$\end{document}. On the “instanton branch” the invariants give the virtual χ-t\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi ^{}_{-t}$$\end{document}-genus refinement of Göttsche–Kool, extended to allow for strictly semistable sheaves. Applying modularity to their calculations gives predictions for the contribution of the “monopole branch”. We calculate some cases and find perfect agreement. We also do calculations on K3 surfaces, finding Jacobi forms refining the usual modular forms, proving a conjecture of Göttsche–Kool. We determine the K-theoretic virtual classes of degeneracy loci using Eagon–Northcott complexes, and show they calculate refined Vafa–Witten invariants. Using this Laarakker (Monopole contributions to refined Vafa–Witten invariants. arXiv:1810.00385) proves universality results for the invariants.


Introduction
Numerical. Vafa-Witten invariants should exist for all Riemannian 4-manifolds S [VW], but mathematicians have yet to find a general definition. When (S, O S (1) is a smooth complex projective surface the invariants were defined in [TT1,TT2]. However, physicists are by now less interested in numerical Vafa-Witten invariants, which they mostly know how to calculate 1 in rank 2. They care more about the refined Vafa-Witten invariants which arise in topologically twisted maximally supersymmetric 5d super Yang-Mills theory, but which do not have a mathematical definition.
Joyce/Kontsevich-Soibelman. So we would like to refine the numerical invariants [TT1,TT2] on a smooth complex polarised surface (S, O S (1)). Those numerical invariants are closely related to local DT invariants of the local Calabi-Yau threefold X = K S . (In fact when H 1 (O S ) = H 2 (O S ) they are precisely local DT invariants, as studied in [GSY1,GSY2] for instance.) They count certain compactly supported 2-dimensional torsion sheaves on X via localisation with respect to the obvious T = C * action on X . If they were defined by Euler characteristic localisation-weighted by the Behrend function [Be]-they would have an obvious refinement given by the work of Team Joyce and Kontsevich-Soibelman. But Euler characteristic localisation gives the wrong answer, and in fact the invariants of [TT1,TT2] are defined by virtual localisation.

Nekrasov-Okounkov.
For threefolds X with a C * action, Nekrasov and Okounkov [NO] give a different refinement of DT theory via equivariant virtual K -theoretic invariants. This means replacing the length of the 0-dimensional virtual cycle (the classical DT invariant) by the holomorphic Euler characteristic of the virtual structure sheaf. This gives the same numerical answer, but also allows for a refinement by using the T action to promote dimensions of cohomology groups to characters of T . The result is rational functions of t which specialise at t = 1 to the old numerical invariants.
In fact Nekrasov-Okounkov twist by a square root of the virtual canonical bundle of the moduli space before taking (equivariant) holomorphic Euler characteristic. This is motivated by physics, relating the ∂ operator to the Dirac operator. From an algebrogeometric point of view, it makes the refinement more symmetric: it is a rational function in t 1/2 which, by Serre duality, is invariant under t 1/2 ↔ t −1/2 . The choice of square root is equivalent to the choice of orientation data in the Joyce/Kontsevich-Soibelman theory. Fortunately in our setting there is a canonical choice on the T -fixed locus: see Proposition 2.6 below.
Vafa-Witten refinement. Under certain circumstances Davesh Maulik [Ma] proved that the K -theoretic and Joyce/Kontsevich-Soibelman refinement of DT theory coincide. (The most general refinement is based on the two variable Hodge-Deligne polynomial; here we are concerned with the Hirzebruch χ −t one variable specialisation.) So he suggested that it is natural to try to also refine Vafa-Witten theory using T -equivariant K -theory. That is what we do in this paper. We use the Vafa-Witten perfect obstruction theory of [TT1,TT2] to produce a virtual structure sheaf, and then twist by the square root (2.7) of the virtual canonical bundle. We then use a virtual localisation formula to take equivariant holomorphic Euler characteristic. In Theorem 5.15 we reprove Maulik's result that this refinement recovers the refined DT invariant when deg K S < 0.
Further refinements. In fact this is a special case of more general refinements. Recall [BF] that virtual cycles come from intersecting a cone in a vector bundle C ⊂ E over moduli space M with the zero section ι : 0 E → E of the vector bundle. One can intersect these two cycles [C] and [0 E ] in any oriented cohomology theory. Traditionally we use Fulton-MacPherson intersection theory to get the virtual cycle in homology [BF], In K -theory we instead take the (derived) tensor product of the structure sheaves of the two cycles [FG,CFK], The result is slightly different-differing by a Todd class, by virtual Riemann-Rochand therefore interesting! (Especially when we work equivariantly with respect to the T action.) To get the Nekrasov-Okounkov-twisted version of this used in our paper we instead take the intersection in KO-theory. This replaces the K -theoretic "fundamental classes" O Z of submanifolds by their twists by K 1/2 Z (this is the Atiyah-Bott-Shapiro complex orientation, and is well defined over Z only for spin manifolds).
The universal case is complex cobordism theory; see [Sh,GK2] for instance. From this one can pass to all other oriented cohomology theories, such as "topological modular forms". 2 In Vafa-Witten theory, the three T -equivariant cohomology theories homology, KO-theory, tmf give rise to virtual versions of of the Vafa-Witten moduli space M respectively. On the "instanton locus" these produce the Euler characteristic, Hirzebruch χ y -genus, elliptic genus of the moduli space of instantons (or Gieseker stable sheaves) on the surface S. (This apparent paradox is because the Vafa-Witten obstruction theory on the instanton moduli space differs from its usual obstruction theory.) Calculations give generating series which seem to be (modular forms, Jacobi forms, Borcherds lifts of Jacobi forms) respectively; in particular see [GK2] for the instanton locus contributions in rank 2.
These refinements of Vafa-Witten theory are defined and studied in the forthcoming paper [MT2]. In this paper we specialise the general definition from [MT2] to Tequivariant K -theory and explore it in more detail.
Results. In Sect. 2 we give a careful treatment of virtual K -theoretic localisation for T -equivariant K -theory on quasi-projective T -schemes with a T -equivariant perfect obstruction theory and compact T -fixed locus. This allows us to define K -theoretic invariants for such schemes endowed with a choice of square root of the virtual canonical bundle. For simplicity, in this Introduction we state our results for symmetric perfect obstruction theories; then Proposition 2.6 gives a canonical choice (2.7) of this square root.

Theorem. Let M be a quasi-projective T -scheme with compact T -fixed locus, and a T -equivariant symmetric perfect obstruction theory. Then the refined invariant
Stable case. In Sect. 4 we apply this to the Vafa-Witten moduli space for a projective surface S and a charge α ∈ H * (S) for which semistability implies stability. 3 The moduli space carries a symmetric perfect obstruction theory and a T action inherited from the T action on X . The result is invariants which specialise to the numerical Vafa-Witten invariants [TT1] VW α (t) ∈ Q(t 1/2 ) such that VW α (1) = VW α ∈ Q.
(1.1) This VW α (t) is made up of contributions from the two types of component of the T -fixed locus: • the "instanton branch" of sheaves on S pushed forward to X , • the "monopole branch" of T -equivariant sheaves supported on a nontrivial scheme theoretic thickening of S ⊂ X .

Semistable case.
We tackle the general case in Sect. 5. We use Joyce-Song pairs to rigidify semistable sheaves as in [TT2]. The resulting refined pair invariants P ⊥ α,n (t) are functions of the twisting parameter n 0 of the Joyce-Song pairs. According to Conjecture 5.2 they should be expressable in terms of certain universal functions in n, if H 0,1 (S) = 0 = H 0,2 (S); otherwise we take only the first term in the sum: The coefficients VW α (t) then define the refined Vafa-Witten invariants. Here [χ ] t is the quantum integer Since [χ ] t → χ as t → 1, Conjecture 5.2 specialises to Conjecture 6.5 of [TT2], now proved in many cases [TT2,MT1]. Here we prove the refined conjecture in some situations.
• When all semistable sheaves of charge α are stable. In this case VW α (t) recovers the invariants (1.1). • K S < 0. When deg K S < 0, for any charge α. Here we recover refined 4 DT invariants: VW α (t) = J α (t). • K S = 0. When S is a K3 surface and the charge α is primitive or a prime multiple of a primitive class. • K S > 0. When p g (S) > 0, for any charge α with prime rank, Laarakker [La2] shows that the conjecture holds for the contribution of the monopole locus. He uses the vanishing Theorem 5.23 to remove many components, and [GT1,GT2] to calculate with the rest.

K3 surfaces.
We are able to do extensive calculations when S is a K3 surface. The well-known 1/d 2 multiple cover formula of DT theory is replaced by a 1/[d] 2 t multiple cover formula (5.39) in the refined setting. (This is a surprising contrast to the 1/d[d] t refined multiple cover formula seen in DT theory-see [DM,Section 6.7] for instance.) At the level of generating series we are led to the conjecture where is the Jacobi form When the rank r is prime this reduces to a conjecture of Göttsche-Kool [GK3] which we prove in Theorem 5.48.
Theorem. Let S be a K3 surface with generic polarisation O S (1). Then (1.3) holds for prime r .
Modularity. On the instanton branch M our refined Vafa-Witten invariants recover the virtual χ −t -genus refinement studied by Göttsche-Kool on surfaces with K S > 0 [GK1]. This is most easily seen when M is smooth and unobstructed as a moduli space of fixed-determinant sheaves on S. Then its Vafa-Witten obstruction bundle is M ⊗ t so that . Applying modularity to Göttsche-Kool's calculations of these invariants gives predictions for the contribution of the "monopole branch". We calculate a small number of cases (which nonetheless take 9 pages of calculation) and find perfect, honest 5 agreement.

Nested Hilbert schemes.
There are components of the monopole branch which are nested Hilbert schemes of S. In [GT1,GT2] it was shown how to view these as degeneracy loci in smooth products of Hilbert schemes of S. This induces a virtual cycle which agrees with the one from Vafa-Witten theory. Its pushforward is described by the Thom-Porteous formula. This gives a more systematic way to compute numerical Vafa-Witten invariants as integrals over products of smooth Hilbert schemes.
In Sect. 3 we describe K -theoretic analogues of these results, replacing Chern classes by Koszul resolutions and the Thom-Porteous formula by Eagon-Northcott complexes. The most straightforward result, relevant to nested Hilbert schemes of points on a surface, is the following.
Theorem. Given a map of vector bundles σ : E 0 → E 1 over a smooth scheme X , the locus Z where σ is not injective carries a natural virtual structure sheaf whose pushforward to X has K -theory class When the degeneracy locus Z has the correct codimension, the Eagon-Northcott complex of σ : E 0 → E 1 -whose K -theory class is the right hand side of (1.4)-is well known to resolve ι * O Z . So the above result shows that even when it has the wrong codimension, its K-class is ι * O vir Z ∈ K 0 (X ). Carlsson-Okounkov [CO] express the Thom-Porteous class of [GT1] in terms of Grojnowski-Nakajima operators. There are K -theoretic analogues of this in [CNO, MO,SV] to which we intend to return.
We also relate O vir Z to the Vafa-Witten virtual structure sheaf when Z is a nested Hilbert scheme. The upshot is that monopole branch contributions to refined Vafa-Witten invariants can be computed from calculations on smooth products of Hilbert schemes of S.

Laarakker.
In [La1] (stable case) and [La2] (general case) Laarakker uses this to great effect on surfaces with p g > 0 (and h 0,1 = 0 for now). Things work best in prime rank, using the vanishing Theorem 5.23 to eliminate many components of the monopole locus. The rest can be calculated via universal integrals over Hilbert schemes of points and curves on surfaces using the results of [GT1,GT2].
Moreover, the contributions from points and curves split, in an appropriate sense. The curves contribute Seiberg-Witten invariants (certain well-understood integrals over linear systems). Laarakker evaluates the contributions of Hilbert schemes of points via the method of [EGL]. The result depends only on the curve class β ∈ H 2 (S, Z) and the cobordism class of the surface-and thus only on c 1 (S) 2 , c 2 (S) and β 2 . Therefore these contributions can be calculated on K3 surfaces and toric surfaces (despite these not having p g > 0!).
Theorem. [La1] Let S be a minimal general type surface with p g (S) > 0 and H 1 (S, Z) = 0 such that K S does not admit a square root. We work with rank 2 Higgs pairs (E, φ) with det E = K S . Then the monopole branch contributions to the refined Vafa-Witten generating series n VW 2,K S ,n (t) q n can be written A(t, q)

are universal functions, independent of S.
Furthermore K3 calculations determine A(t, q) completely, while by modularity and the work of Göttsche-Kool he knows what B(t, q) should be, and he can check this in low degree by toric computations.

K -Theoretic Virtual Cycles
The foundations of cohomological virtual cycles are laid down in [BF,LT]; we use the notation from [BF]. The foundations for K -theoretic virtual cycles (or "virtual structure sheaves") are laid down in [CFK,FG]; we use the notation from [FG].
2.1. Virtual cycle and virtual structure sheaf. Let M be a quasi-projective scheme with a perfect obstruction theory E • → L M supported in degrees [−1, 0]. That is, E • is a 2-term complex E −1 → E 0 of vector bundles on M such that the map E • → L M induces an isomorphism on h 0 and a surjection on h −1 . We call L vir M := E • the virtual cotangent bundle of M, of rank vd := rank E 0 − rank E −1 and determinant and its virtual structure sheaf [FG] where ι 0 : M → E 1 is the zero section. (Since ι 0 is a regular embedding, Lι * 0 O C is a bounded complex.) If M is compact the virtual Riemann-Roch theorem of [FG,Corollary 3.4] then gives In particular, if M also has virtual dimension zero vd = 0 we can use either the virtual structure sheaf or the virtual cycle to define the same numerical invariant but it will make a big difference to its refinement when we work equivariantly. This will also allow us to fix the ambiguity in the choice of K 1/2 vir , because on the fixed locus there is a canonical choice. (2.7) Here E • | M T ≥0 denotes the part of E • | M T with nonnegative T -weights, and r ≥0 is its rank.
Proof. Decompose the virtual cotangent bundle in weight spaces for the T action, Here each F i is a T -fixed two-term complex of vector bundles on M T of (super)rank r i := rank(F i ). The symmetry of the obstruction theory, Therefore 2.3. Localisation. Suppose as above T := C * acts on both M and its perfect obstruction theory E • → L M . Then on its fixed locus ι : M T → M we get a splitting into fixed and moving parts (i.e. weights 0 and nonzero). By [GP] the fixed part (E • ) T defines a perfect obstruction theory on M T (and so a virtual structure sheaf (2.1)). We call the dual of the moving summand the virtual normal bundle N vir . The virtual localisation formula of [GP] states that (2.8) Here we consider the T -equivariant Chow homology to be a module over H * (BT ) = Z[t], which we localise, inverting the equivariant parameter t-the first Chern class of the weight 1 irreducible representation t of T . This ensures that, writing N vir as a two-term complex of T -equivariant vector bundles N 0 → N 1 all of whose weights are nonzero, the c top (N i ) are invertible. Thus we may define e(N vir ) := c top (N 0 )/c top (N 1 ).
To mimic this in K -theory we use the module structure of K 0 T (M) over K 0 T (point) = Z[t, t −1 ] to localise to the field of fractions 8 Q(t). Adjoining t 1/2 (so we can lift our choice of square root (2.7) to localised T -equivariant K -theory), we work in Now applying (2.8) to (2.5), and using the notation the last line from the virtual Riemann-Roch theorem [FG,Corollary 3.4] on M T . This suggests there should be a K -theoretic localisation formula from which (2.9) would follow by taking χ · ⊗K 1 2 vir . Such a result is proved in [CFK,Theorem 5.3.1] for (M, E • ) which can be enhanced to a [0, 1]-dg-manifold structure. More recently Qu has proved (2.10) for any T -equivariant (M, E • ) [Qu].
For the first version of this paper I was unaware of Qu's work, and did not want to have to prove that Vafa-Witten moduli spaces M admit a T -equivariant [0, 1]-dg-manifold structure (though they certainly do). So I proved a weaker statement-a T -equivariant version of (2.9), which is sufficient for our purposes. I have kept that proof-which is Proposition 2.13 below-since it demonstrates the compatiblity of K -theoretic and cohomological localisation under virtual Riemann-Roch. So we turn to this now.

Refinement.
We are interested in situations where M may be noncompact, but carries a T action with compact fixed locus M T . Then (2.2) and (2.5) make no obvious sense, but their natural refinements-given by replacing (super)ranks of graded vector spaces by characters of (virtual) T -modules-are perfectly well-defined. That is, we define (2.11) Here the left hand side may involve infinite direct sums; then the right hand side will be a sum of power series in t 1/2 and t −1/2 which, in our situation, will be expansions of rational functions in Q(t 1/2 ). When the sums are finite we may set t = 1 and recover the usual Euler characteristic or (super)rank. Applying (2.11) to R M, O vir M gives our refinement of the integer (2.5).
When M is compact this specialises to (2.5) at t = 1, but (2.12) makes sense more generally.
Proposition 2.13. Suppose M T is compact and we have chosen a square root K 1/2 vir ∈ K T 0 (M)(t 1/2 ). Then the refined invariant (2.12) can be calculated on M T by localisation as (2.14) Proof. This follows directly from the localisation formula (2.10) of [CFK] when M is a [0, 1]-dg-manifold acted on by T , and from [Qu] more generally. Alternatively, we can repeat the argument of (2.9) in an equivariant setting, replacing the virtual Riemann-Roch formula of [FG,Corollary 3.4] by its equivariant analogue. We use the standard trick of approximating the homotopy quotient M × T E T over BT = P ∞ by the M-bundle (Here T acts with weight 1 on C N +1 .) Applying the virtual Grothendieck-Riemann-Roch theorem of [FG,Theorem 3.3]  As N increases this is a sequence of compatible cohomology classes over P N ⊂ P N +1 ⊂ · · · , defining a class in  (M). This therefore vanishes for − rank(N vir ) − i > dim M, i.e. for i sufficiently negative. Therefore 1/e(N vir ) is a Laurent polynomial in t, and we may pick n 0 such that t n · 1/e(N vir )

By (2.8) its class in H
. Then the statement is that lim ← − (2.15) is t −n times by the inverse limit of the compatible sequence of cohomology classes Substituting s = e t gives the result.
Now we have localised to M T we can use the canonical square root (2.7) of Proposition 2.6 to make an unambiguous definition of our refined invariants.
Assumption 2.18. We will assume (1) M is a quasi-projective T -variety with projective fixed locus M T , (2) M has a T -equivariant symmetric obstruction theory.
By Proposition 2.6, this implies the existence of • a T -equivariant perfect obstruction theory with vd = 0, and • a choice of line bundle on M T whose square is K M,vir | M T , and this is all we will actually use. So although it is more elegant to assume (1) and (2) from now on, the reader can replace (2) by the above two conditions instead to get a slightly more general result. We then call the line bundle K  Again, when M is compact, (2.20) specialises to (2.5) at t = 1. When M is noncompact (but M T is compact) and has virtual dimension vd = 0 we can still define a cohomological substitute for (2.5) or (2.2) (both of which are [M] vir 1 in the compact case) by localisation (2.8) as follows: Then (2.20) refines (2.21) even when M is noncompact: is a rational function of t 1/2 with poles only at roots of unity and the origin, but not at 1. We may therefore specialise to t = 1, where we recover the rational number (2.21): Proof. We compute (2.23) We wish to evaluate this at t = 0 (i.e. e t = 1). Writing K 1 2 vir = Lt w for some w ∈ Z[1/2], we expand . Therefore c i = 0 for i 0 and the first series is a finite sum. Consider multiplying it by the last series.
• The t <0 terms of the first series all have coefficients in H >2 vd(M T ) (M T ) (both before and after multiplication by the last series). These integrate to zero against [M T ] vir . • The t >0 terms of the first series go to 0 at t = 0, and the same is true when they are multiplied by the last series.
So we are left with the c vd(M T ) t 0 term of the first series. When multiplied by any e i we get a class in H >2 vd(M T ) (M T ) whose integral over [M T ] vir is zero. So when we multiply c vd(M T ) t 0 by the last series and integrate, we get the same as just (multiplying by 1 and) integrating; this contributes This gives the numerical result claimed. But since it doesn't give the statement about rationality, we now go back to the first line of (2.23) and expand everything in sight carefully. Write (N vir ) ∨ = N 0 − N 1 as a global difference of two T -bundles with nonzero weights. Let the Chern roots of N 0 and N 1 be x i + w i t and y j + v j t respectively, where w i , v j are all nonzero integers. Letting s := e t , we have (2.24) lies in cohomological degrees ≥ 2, so, when we multiply out, any (1 − s) − j term comes multiplied by a term a j s u j , where a j has cohomological degree ≥ 2 j on M T (and u j is an integer). And − rank (N vir Multiplying by (2.25) and integrating, (2.23) becomes Thus χ s is a rational function of s 1/2 with poles only at roots of unity and possibly zero, but not 1, as required.
Since we've got this far we may as well use (2.26) to give another derivation of the evaluation at s = 1. This gives This integral sees only the part of a vd which has degree precisely 2 vd, so only the degree 2 parts To evaluate at s = 1, we now reuse t to denote s − 1 and take the coefficient of t 0 in the Laurent expansion (in t −1 !) of .
. Therefore integrating over [M T ] vir takes only the t 0 term. We conclude again that Proposition 2.27. The refinement (2.20) is a rational function of t 1 2 (with poles only at roots of unity and the origin) invariant under t 1 2 ↔ t − 1 2 , and is deformation invariant.
Proof. All that is left to prove is the invariance under t 1 2 ↔ t − 1 2 . This follows from the "weak virtual Serre duality" of [FG,Proposition 3.13] on M T : where the last equality is from the identity (2.28)

Shifted cotangent bundles.
When M is the (−1)-shifted cotangent bundle T * [−1]M T of a quasi-smooth derived projective scheme M T , with the obvious T = C * action on the fibres, it has a symmetric perfect obstruction theory and the refined invariant (2.20) simplifies. Letting p denote the projection M → M T we get the exact triangle where t denotes the standard weight 1 representation of T . In particular K M,vir = p * (K M T ,vir ) 2 ⊗ t vd(M T ) and the canonical choice (2.7) of square root is just On the zero section M T ⊂ M the exact triangle (2.29) gives . Therefore, using both (2.30) and the identity (2.28), we have in localised K -theory, where χ vir y is the virtual χ y -genus of Fantechi-Göttsche [FG]. Specialising to t = 1 gives the signed virtual Euler characteristic studied in [JT].

K -Theoretic Invariants from Degeneration Loci
Fix a map of bundles σ : E 0 −→ E 1 of ranks r 0 , r 1 over a smooth ambient space X . We suppose for simplicity 10 that dim ker(σ | x ) ≤ 1 for all points x ∈ X . Then we let D(σ ) := x ∈ X : σ | x isnotinjective 10 More general degeneracy loci were treated in [GT1,GT2]. denote the degeneracy locus of σ . Its scheme structure is defined by the vanishing ideal of r 0 σ -the ideal generated by the r 0 × r 0 minors of σ .
Furthermore it is shown in [GT1] that D(σ ) inherits a perfect obstruction theory by seeing it as the vanishing locus of the composition This perfect obstruction theory depends only on the complex E 0 → E 1 up to quasiisomorphism, and endows D(σ ) with a virtual cycle of codimension r 1 − r 0 + 1 whose pushforward to X is described in [GT1] by the Thom-Porteous formula as 3.1. K -theoretic degeneracy loci. The above perfect obstruction theory induces a virtual structure sheaf O vir D(σ ) on the degeneracy locus by (2.1). The K -theoretic analogue of the Thom-Porteous formula is the Eagon-Northcott complex of σ . When D(σ ) has the correct codimension, this complex is well known to resolve O D(σ ) . Here we show that even when it has the wrong codimension, the K -theory class of the Eagon-Northcott complex is O vir Proof. The composition (3.1) defines a section σ ∈ (q * E 1 (1)) which cuts out D(σ ) ⊂ P(E 0 ). This defines the virtual structure sheaf is the cone over D(σ ) defined by σ . This is the flat limit, as t → ∞, of the graphs t σ ⊂ q * E 1 (1). Therefore, in K -theory, Suppressing some obvious pullback maps for clarity, σ is cut out of the total space of q * E 1 (1) by the section σ − σ taut of the pullback of q * E 1 (1). This induces a Koszul resolution of O σ on the total space of q * E 1 (1). Applying Lι * restricts this to the zero section, where σ taut is zero. Thus the right hand side of (3.4) is the Koszul complex • (q * E 1 (1)) * , σ (which is not in general exact, since σ does not generally intersect the zero section transversally). Thus where r i := rank(E i ).
Finally we push down to X , using (by Serre duality) There are different formulae for (more general) K -theoretic degeneracy loci in [HIMN,A], essentially given by the Thom-Porteous formula with cohomological Chern classes replaced by K -theoretic Chern classes. By some algebraic identities these formulae are surely equivalent to the Eagon-Northcott formula above. Therefore, by Theorem 3.3, those formulae also describe the pushforward of the virtual structure sheaf of a degeneracy locus. Vafa-Witten theory. In [GT1,GT2] it was shown how some of the monopole components of the Vafa-Witten T -fixed point set can be described as degeneracy loci, at the level of both their scheme structures and virtual cycles. We briefly review the simplest examples-2-step nested punctual Hilbert schemes of a smooth projective surface S,

Application to
For more details and more general results see [GT1,GT2].
While S [n 1 ,n 2 ] is in general singular, it lies in the smooth ambient space S [n 1 ] × S [n 2 ] as the set of points (I 1 , I 2 ) for which there is a nonzero map Hom S (I 1 , I 2 ) = 0. To write this scheme theoretically, let π : be the projection down S, and let I 1 , I 2 denote the (pullbacks of the) universal ideal sheaves on S [n 1 ] × S [n 2 ] × S. Consider the complex of vector bundles RH om π (I 1 , which, restricted to a point (I 1 , I 2 ), computes Ext * S (I 1 , I 2 ). When p g (S) = 0 this complex can be made 2-term, 11 RH om π (I 1 , Then the degeneracy locus D(σ ) is (scheme-theoretically) S [n 1 ,n 2 ] , and the construction (3.1) endows it with a perfect obstruction theory of dimension n 1 + n 2 which is independent of the choices of E 0 , E 1 (depending only on the K -theory class of their difference RH om π (I 1 , I 2 ).) By [GT1, Section 10] this perfect obstruction theory and the Vafa-Witten perfect obstruction theory of [TT1] have virtual tangent bundles which agree in K -theory. 12 Therefore the degeneracy locus virtual cycle coincides which the one coming from Vafa-Witten theory [TT1] or reduced DT theory [GSY1,GSY2] when h 1 (O S ) = 0. And when h 1 (O S ) > 0, the complex RH om π (I 1 , I 2 ) can be modified [GT1, Section 6], or one can work relative to Pic(S) [GT1,Section 9], to get the same result.
The Thom-Porteous formula (3.2) then calculates the pushforward to S [n 1 ] × S [n 2 ] of the Vafa-Witten virtual cycle on S [n 1 ,n 2 ] . In fact [GT1,GT2] deal with more complicated nested Hilbert schemes of points and curves on S. For points, the result is the following.
Theorem 3.7. [GT1] The pushforward of S [n 1 ,n 2 ,...,n r ] vir to S [n 1 ] × · · · × S [n r ] equals the product of Carlsson-Okounkov classes c n 1 +n 2 RH om π (I 1 , For the K -theoretic analogue, we assume for simplicity that H ≥1 (O S ) = 0 so we do not have to modify the complex (3.6). Theorem 3.2 of [Th] gives a formula for any virtual structure sheaf O vir M which shows that it depends only on M and the K -theory class of the virtual tangent bundle T vir M . Since the degeneracy locus construction induces the same virtual tangent bundle on S [n 1 ,n 2 ] as Vafa-Witten theory, the two virtual structure sheaves induced by (2.1) are equal. Therefore Theorem 3.3 describes the Vafa-Witten K -theoretic virtual cycle as follows. For a general surface S, the techniques of [GT1] can be used to split off H ≥1 (O S ) from this complex. The upshot is the same result, except with the complex RH om π (I 1 , I 2 ) replaced by RH om π (I 1 , Proof. Theorem 3.3 gives the first result immediately. For the second we use [GT2,Equation 4.27], which shows the Carlsson-Okounkov K -theory class CO := O − RH om π (I 1 , I 2 ) is represented by an honest rank r + 1 = n 1 + n 2 vector bundle (instead of a difference of vector bundles) on an affine bundle over S [n 1 ] × S [n 2 ] . Therefore, writing the pullback of RH om π (I 1 , upstairs on the affine bundle. Since this is homotopic to the base S [n 1 ] × S [n 2 ] , the result follows in topological K -theory (which, by Riemann-Roch, is enough for computing holomorphic Euler characteristics). Therefore in this situation we get a more familiar Koszul resolution description of the virtual structure sheaf.
These results can be plugged into the definition (4.3) of refined Vafa-Witten invariants below to calculate monopole locus contributions in terms of K -theory classes on smooth ambient spaces like S [n 1 ] × S [n 2 ] . (This requires lifts of the K -theory classes N vir and K 1/2 vir (2.7) from S [n 1 ,n 2 ] to S [n 1 ] × S [n 2 ] ; these exist since they can be written in terms of the universal sheaves I Z 1 , I Z 1 and RH om π s between them, all of which extend.)

Refined Vafa-Witten Invariants: Stable Case
Fix a smooth complex poplarised surface (S, O S (1)), a rank r > 0, Chern classes c 1 , c 2 and a line bundle L on S with c 1 (L) = c 1 . We use the notation from [TT1]; in particular N ⊥ r,L ,c 2 denotes the moduli space of Gieseker semistable Higgs pairs (E, φ) on S, where E is a rank r torsion-free sheaf on S with c 2 (E) = c 2 and By the spectral construction [TT1, Section 2], (E, φ) is equivalent to a Gieseker semistable compactly supported torsion sheaf E φ on This makes N ⊥ r,L ,c 2 the moduli space of Gieseker semistable compactly supported torsion sheaves E on X with the right Chern classes, such that the "centre of mass" of E on each K S fibre of ρ : X → S is zero, and ρ * E ∼ = L.
When (r, c 1 , c 2 ) are chosen so that semistability implies stability, 13 N ⊥ r,L ,c 2 carries a natural symmetric perfect obstruction theory [TT1,Theorem 6.1] supported in degrees [−1, 0]. It is noncompact in general, but has a T = C * action scaling the fibres of K S (or, equivalently, scaling the Higgs field φ). The fixed locus (N ⊥ r,L ,c 2 ) T is compact, so in [TT1] Vafa-Witten invariants are defined by virtual (cohomological) localisation where L is any line bundle on S with c 1 (L) = c 1 . This lies in Q ⊂ Q[t, t −1 ] because vd(N ⊥ r,L ,c 2 ) = 0. The perfect obstruction theory gives us a virtual structure sheaf, and its symmetry gives us a canonical square root of the virtual canonical bundle by Proposition 2.6.
First fixed locus. The invariant (4.1) and its refinement (4.3) have contributions from the connected components of the fixed locus (N ⊥ r,L ,c 2 ) T . The first of these is the "instanton branch" where φ = 0. This is just the moduli space M r,L ,c 2 of stable sheaves of fixed determinant L on S. By [TT1,Equation 7.3] this locus contributes the Fantechi-Göttsche virtual signed Euler characteristic of M r,L ,c 2 to VW r,c 1 ,c 2 (4.1). It is an integer, with an obvious refinement given (up to a sign) by the virtual χ t -genus of Fantechi-Göttsche [FG], as studied in [GK1]. We check now that this is what the refined Vafa-Witten invariant (4.3) indeed gives. An open neighbourhood in N ⊥ r,L ,c 2 of the instanton branch M r,L ,c 2 is isomorphic to its own (−1)-shifted cotangent bundle T * [−1]M r,L ,c 2 . (It is the neighbourhood consisting of those pairs (E, φ) for which E is itself Gieseker stable. At the level of points this says that the Higgs fields take values in the dual (Ext 2 (E, E) 0 ) * ∼ = Hom(E, E ⊗ K S ) of the obstruction space of E.) By (2.32), then, its contribution to VW(t) (4.3) is Specialising to t = 1 gives which is (4.4).
Second fixed locus. The other fixed loci have nilpotent φ = 0; following [DPS,GK1] we call their union M 2 the "monopole branch". For K S negative in a suitable sense the stability condition forces the second fixed locus to be empty (a "vanishing theorem" holds). So we do some very elementary preliminary calculations on M 2 for general type surfaces, refining the first calculations of [TT1, Section 8]. (1)). Then in [TT1,Lemma 8.3] it is shown that (N ⊥ 2,K S ,n ) T is the disjoint union of M 2,K S ,n and the nested Hilbert schemes

Some calculations for
We call the components with i = 0 horizontal and, at the other extreme, the components with i = n/2 vertical. Horizontal loci and n ≤ 1 case. We start with the horizontal loci, so Z 1 = ∅ and M 2 ∼ = S [n] . Here a point Z 0 ∈ S [n] corresponds in N ⊥ 2,K S ,n to the torsion sheaf I Z 0 ⊂2S on X = K S , where 2S ⊂ X is the twice-thickened zero section defined by the ideal I 2 S⊂X . In [TT1,Section 8.2] it is shown that the fixed obstruction bundle over this S [n] is K [n] S * . It follows that It also follows that O vir S . In K -theory this has the same class as the sheaf of dgas given by inserting a differential, where s ∈ H 0 (K S ) cuts out the smooth connected canonical divisor C ⊂ S and s [n] is the induced section of K [n] S on S [n] . Since this cuts out C [n] ⊂ S [n] which is smooth of codimension n, (4.7) is an exact Koszul resolution quasi-isomorphic to its cokernel: (4.8) Moreover the K -theory class of the virtual normal bundle is computed in [TT1,Section 8.3] to be (4.9) Here where g = c 1 (K S ) 2 + 1 is the genus of C. Combining (4.9) with (4.6) determines the virtual canonical bundle: The choice (2.7) of square root is (4.10) With this, we are ready to calculate in the simplest, n = 0, 1 and 2 cases. Even here the calculation will be somewhat involved.
Therefore we calculate the contribution of S [0] to (4.3) as (4.11) where [2] t is the quantum integer (1.2). n = 1 case. Combining (4.10) where, by (4.9), where the (L i , w i ) are K * S C , −1 , K 2 S C , 1 and P 2 copies of (O C , −2), (4.13) and the (M i , v i ) are , −1 and P 2 copiesof(O C , 1). (4.14) Therefore Integrating over C gives χ e t . Then replacing e t by t gives χ t as Substituting (4.13), (4.14) and using deg K S | C = g − 1 = deg O C (C) (by adjunction) gives Plugging this into (4.12) gives the contribution of M 2 to VW 2,K S ,1 (t) as (4.16) Horizontal n = 2 case; preliminaries. To calculate on C [2] we fix some notation and collect some results. Let denote the universal length-2 subscheme over C [2] , with projection p to C. Then Z ∼ = C ×C with p the projection to the first factor, while the above double cover q : C ×C → C [2] is the quotient by the Z/2 action τ swapping the factors.
Given a line bundle L on C, the induced rank 2 bundle L [2] = q * p * L on C [2] is therefore so its pullback by q * sits inside an exact sequence The exact sequence gives an equality in K -theory In particular, As noted in (4.8), Combining this with (4.20) gives (4.21) Substituting (4.21, 4.18) into (4.10) we find Tensoring this by (4.8) shows where, by an abuse of notation, we are considering O vir S [2] to be a sheaf on C [2] (really, by (4.8), it is the K-class of the pushforward of this to S [2] ). Horizontal n = 2 case; calculation. We wish to calculate (4.23) Let k := c 1 (K C ) = −c 1 (C) and χ := 2 − 2g = − C k = 2 C . Putting s := e t , (4.22) gives where vol is the Poincaré dual of a point on C × C. By (4.19), For the K -theory class of q * N vir | C [2] ∨ we use (4.9): By (4.19) and several applications of (4.17) this is Here we have suppressed some restrictions to C, which are easily handled using K 2 S C ∼ = K C . As in the last section we write this as where L i , M i are line bundles with first Chern classes i , m i respectively. Since 2 i , m 2 i needn't be zero 14 on the surface C × C, (4.15) is modified to Multiplying by 1 2 (4.26) and integrating gives χ s (4.23). It is the product of (4.28) and the integral over C × C of
The prefactor (4.28) is Therefore, replacing s by t, we find the contribution of S [2] to the refined Vafa-Witten invariant is (4.29) At t = 1 this gives (−2) −P 2 (1 − g)(11 − 2g), as in [TT1,Equation 8.24]. Vertical n = 2 case. When n = 2 there is another component of the T -fixed locus, given by taking i = 1 in (4.5). This gives a copy of S, where x ∈ S corresponds to the sheaf In [TT1,Section 8.7] it is shown that this T -fixed moduli space has vanishing obstruction sheaf, so that
For higher c 2 we need a more systematic way to compute. Laarakker [La1] combines the degeneracy locus description of monopole branches in [GT1] and Sect. 3 of this paper with cobordism arguments to prove universality results. This also translates computations to calculations on toric surfaces, which can be done by localisation and computer for c 2 not too large.

Refined Vafa-Witten Invariants: Semistable Case
As before we fix a polarised surface (S, O S (1)). Pulling back gives a polarisation O X (1) on the local Calabi-Yau threefold X = K S . We define the charge of a compactly supported coherent sheaf E on X to be the total Chern class α = (r, c 1 , c 2 ) ∈ H ev (S) (5.1) of the pushdown E = ρ * E on S. Given n 0 and L ∈ Pic c 1 (S), an SU (r )-Joyce-Song pair (E, s) consists of • a compactly supported coherent sheaf E of charge α on X , with centre-of-mass zero on each fibre of ρ : X → S and det ρ * E ∼ = L, and • a nonzero section s ∈ H 0 (E(n)).
For fixed α we may choose n 0 such that H ≥1 (E(n)) = 0 for all Joyce-Song stable pairs (E, s). There is no notion of semistability; there is a quasi-projective moduli scheme P ⊥ α,n of stable Joyce-Song pairs whose T = C * -fixed locus is already compact. Most importantly, P ⊥ α,n can be shown to be a moduli space of complexes I • := {O X (−n) → E} with a symmetric perfect obstruction theory governed by R Hom(I • , I • ) ⊥ . As a result it inherits a virtual structure sheaf and the virtual canonical bundle admits a canonical square root (2.7) on the T -fixed locus. Thus by (2.20) we get a refined pairs invariant Using the quantum integers defined in (1.2), [n] q := q −(n−1)/2 + q −(n−3)/2 + · · · + q (n−3)/2 + q (n−1)/2 = q n/2 − q −n/2 q 1/2 − q −1/2 (which specialise to n at q = 1) we can state the refined version of [TT2, Conjecture 6.5].
for n 0. When either of H 0,1 (S) or H 0,2 (S) is nonzero we take only the first term in the sum: The first justification for this Conjecture is that it specialises at t = 1 to Conjecture 6.5 of [TT2], which is proved in many cases [MT1,TT2]. Therefore, when the Conjecture holds, the resulting VW α (t) specialise at t = 1 to the numerical Vafa-Witten invariants of [TT2].
As a second sanity check, we show it is true-and reproduces the earlier Definition 4.2 of refined Vafa-Witten invariants-when there are no strictly semistable sheaves.
Proposition 5.5. If all semistable sheaves in N ⊥ α are stable then Conjecture 5.2 is true with the coefficients VW α (t) given by (4.3).
Proof. We adapt the proof of the corresponding result for numerical Vafa-Witten invariants in [TT2,Proposition 6.8].
We proceed by induction on the rank r of α = (r, c 1 , c 2 ). We first claim that if there are no strictly semistables in class α then only the first term contributes to the sum (2.24). Indeed, if there was a nonzero contribution indexed by α 1 , . . . , α with > 1 then the nonvanishing of the coefficients VW α i (t) (which equal the refined Vafa-Witten invariants (4.3) by the induction hypothesis) would imply that the moduli spaces N ⊥ α i are nonempty. Picking an element E i of each defines a strictly semistable E := E 1 ⊕· · ·⊕E of N ⊥ α , a contradiction. We use the smooth P χ(α(n))−1 -bundle where E is the (possibly twisted) universal sheaf on N ⊥ α × X and π : N ⊥ α × X → N α . There is a corresponding relationship between the deformation-obstruction theories of (N ⊥ α ) T and (P ⊥ α,n ) T worked out in [TT2,. In particular [TT2,Equation 6.13] implies that the virtual structure sheaves of their T -fixed loci satisfy where T p is the relative tangent bundle of p. And by [TT2,Equation 6.14] their dual virtual normal bundles are related by N vir Taking the determinant of [TT2,Equation 6.12] gives, by (2.7), Putting it all together we have by the identity (2.28) applied to T p ⊗ t −1 . To take χ t we first push down the restriction of p to (P ⊥ α,n ) T → (N ⊥ α ) T . This is a smooth bundle; on each fibre we get where P = P χ(α(n))−1 is acted on by T with fixed locus P T . We recognise (5.6) as the computation of by localisation to the fixed locus P T . (Here we have used the fact that T acts trivially on H i ( j P )) since the latter is topological.) Moreover, there is no twisting as we move over the base-the fibrewise cohomology groups of a P χ(α(n))−1 bundle are canonically trivialised by powers of the hyperplane class. 16 So the upshot is 16 If the universal sheaf E is twisted by a nonzero Brauer class then P ⊥ α,n = P( p * E (n)) is not the projectivisation of an untwisted bundle, so the hyperplane class does not lift to H 2 (P ⊥ α,n ). But its fibrewise class in H 0 (N ⊥ α,n , R 1 p * p ) is well-defined and is all we use.
5.1. deg K S < 0: refined DT invariants. When deg K S < 0 the moduli space P ⊥ α,n of Joyce-Song pairs on X is smooth [TT2, Section 6.1] and consists entirely of pairs pushed forward (scheme theoretically) from S. The obstruction bundle is T * follows from Proposition 2.31 that the refined pairs invariant is The Vafa-Witten obstruction theory on P ⊥ α,n is the DT obstruction theory of [JS] since So we can expect the refined Vafa-Witten invariants to be closely related to refined DT invariants, 17 and this is what we will find.
We use Joyce's Ringel-Hall algebra for Coh(S) constructed in [Jo2]. Joyce starts with the Q-vector space on generators given by (isomorphism classes of) representable morphisms of stacks from algebraic stacks of finite type over C with affine stabilisers to the stack of objects of Coh(S). He then quotients out by the scissor relations for closed substacks, and makes the result into a ring with his Hall algebra product * on stack functions.
At the level of individual objects, the product 1 E * 1 F of (the indicator functions of) E and F is the stack of all extensions between them, with e ∈ Ext 1 (F, E) mapping to the corresponding extension of F by E. More generally * is defined via the stack Ext of all short exact sequences in Coh(S), with its morphisms π 1 , π, π 2 : Ext → Coh(S) taking the extension to E 1 , E, E 2 respectively. This defines the universal case, which is the Hall algebra product of Coh(S) with itself: Other products are defined by fibre product with this: given two stack functions U, V → Coh(S) we define U * V → Coh(S) by the Cartesian square (5.11) We are interested in the elements where M ss α is the stack of Gieseker semistable sheaves of class α on (S, O S (1)), and 1 M ss α is its inclusion into the stack of all sheaves on S. To handle the stabilisers of strictly semistable sheaves, Joyce replaces these indicator stack functions by their "logarithm": the following (finite!) sum: Here p α denotes the reduced Hilbert polynomial of sheaves of class α.
A deep result of Joyce [Jo3,Theorem 8.7] is that the logarithm (5.12) lies in the set of virtually indecomposable stack functions with algebra stabilisers, α ∈ SF ind al (Coh(S)). By [JS,Proposition 3.4] this means it can be written as a Q-linear combination of morphisms from stacks of the form (scheme) × (Spec C)/C * .
(5.13) Now all moduli stacks of semistable torsion free sheaves on S of class α are smooth of dimension −χ S (α, α), since any obstruction space Ext 2 (E, E) is Serre dual to Hom(E, E⊗ K S ), which vanishes by the semistability of E and the negativity of deg K S . Therefore we do not have to worry about vanishing cycles or orientation data; we can make a naive definition of the Joycian refined DT invariant 18 by taking the normalised Hirzebruch χ −t -genus of the (Q-linear combination of) stacks α : (5.14) The factor (t − 1) is there to cancel the C * stabilisers in (5.13). Joyce's result that α is a virtual indecomposable therefore means that J α (t) has a finite limit as t → 1; this limit is the numerical DT invariant. We can use this to prove a refined version of the Joyce-Song identity [JS,Theorem 5.27], and hence our Conjecture 5.2, when deg K S < 0.
Because the Vafa-Witten perfect obstruction theory coincides with the DT obstruction theory when H 1 (O S ) = 0 = H 2 (O S ), this theorem is an instance of Maulik's result [Ma] that, for some local Calabi-Yaus, the refinement of Joyce/Kontsevich-Soibelman coincides with the refinement of Nekrasov-Okounkov.
Proof. We follow [JS,Chapter 13], fixing n 0 and use the same auxiliary categories B p α (whose objects are Gieseker semistable sheaves E on S with reduced Hilbert polynomial a multiple of p α , plus a vector space V and a linear map V → H 0 (E(n))) with K -theory classes in K (Coh(S)) ⊕ Z. We use the Euler formχ (α, d), (β, e) := χ S (α, β) − dχ(α(n)) − eχ(β(n)) + deχ(O S ). Gieseker stability on Coh(S) induces stability conditions on B p α . Wall crossing between them gives the following identity of stack functions [JS,Proposition 13.10] 19 Here the Lie bracket is with respect to the Hall algebra product on stack functions, and α is the stack function (5.12) mapping to the stack of semistable sheaves in Coh(S) thought of as semistable objects in B p α . Then (α,1) is defined in a similar way from objects in B p α (with the K -theory class of O(−n) → E, for E of class α) which are semistable with respect to Joyce-Song's stability conditionτ . As in [JS,13.5], it is the stack P ⊥ α,n /C * . Set α <k := α 1 + . . .+ α k−1 and α ≤k := α 1 + . . .+ α k . We multiply out the Lie brackets in (5.16), starting with the innermost one. We claim that by induction, at the k th stage, we get a bracket where A (α <k ,1) maps to the stack of semistable objects A of B p α which have charge (α <k , 1). Let E be any semistable object of B p α of charge (α k , 0) (i.e. semistable sheaf on S of charge α k ). All extensions from E to F or from F to E giving semistable objects of B p α of charge (α ≤k , 1). Therefore (5.17) maps to the stack of semistable objects of B p α of charge (α ≤k , 1), and the induction continues. Moreover, with no other Exts, and also with no further Exts. Therefore by the scissor relations and (5.9) (in constructible families) we have [A (α <k ,1) , α k ] = L −χ S (α k ,α <k ) − L χ(α k (n)))−χ S (α <k ,α k ) A (α <k ,1) × α k as a Q-linear combination of stacks. Since all α i = δ i α are proportional to α we see that χ S (α <k , α k ) is symmetric in its arguments, and Therefore the Lie brackets in (5.16) give in total where the final term comes from (0,1) ∼ = BC * . Taking (t − 1)χ −t of this gives, by (5.14), this can be rewritten Therefore (t − 1)χ −t ( · ) applied to (5.16) gives Multiplying both sides by (−1) dim P ⊥ α,n t − 1 2 dim P ⊥ α,n gives, by (5.8), which is the result claimed.

p g(S)
> 0 cosection and vanishing theorem. Fix a surface S with p g (S) > 0. In his calculations [La1] Ties Laarakker observed a certain vanishing (more-or-less Corollary 5.30 below, in low ranks). Here we explain it by describing a certain cosection of the fixed obstruction theory, on any connected component P of the monopole branch of the T -fixed loci (P ⊥ α,n ) T . If stable = semistable the same construction can be done with moduli spaces N ⊂ (N ⊥ α ) T of sheaves on X (or Higgs pairs on S) instead. The construction is basically the same as in [PT,Section 5]; we simply replace stable pairs by Joyce-Song pairs and impose the centre-of-mass-zero condition 20 on each C fibre of X = S × C (equivalently, the tr φ = 0 condition on the Higgs field).
We find it convenient to describe the cosection using Higgs data on S. For a more geometric description using sheaves on X instead, see [PT,Section 5]. By the symmetry of the obstruction theory, what we require is a T -weight one P ⊥ α,n vector field along (but not tangent to) P. This is Serre dual to a weight zero (i.e. invariant) cosection of the obstruction sheaf.
Since Joyce-Song stable pairs have no automorphisms and form a fine moduli space, there is a universal Higgs pair and Joyce-Song section (E, , s) over the total space of p S : S × P → P. Thus where n 0 is sufficiently large that E(n) has no higher cohomology on any S fibre. Furthermore this lack of automorphisms means the universal T -fixed sheaf E admits a T -linearisation. (For any λ ∈ T we get a unique isomorphism φ λ : , λφ, s). Uniqueness then implies that φ λ • φ μ = φ λμ .) Tensoring by its highest weight, we may assume that with each of E 0 and E r −1 nonzero and all E i flat over P. Since we are on the monopole branch, r ≥ 2. The weight one maps each E i to E i+1 , and s is T -fixed up to automorphisms of E. Fix a nonzero holomorphic 2-form and consider the trace-free endomorphisṁ It defines a family of Higgs triples 21 (E, + tφ, s) over P × C t , (5.20) 20 Hence we get only one of the two cosections of [PT,Equation 5.8]. This is sufficient since the Vafa-Witten R Hom(I • , I • ) ⊥ [1] obstruction theory of [TT1,TT2] has already had an H 2 (O S ) term removed from the obstruction sheaf, i.e. it is a reduced obstruction theory in the language of [PT]. 21 This flow is most easily understood in terms of sheaves on X [PT,Section 5]; for instance it takes the sheaf O r S at t = 0 to O (r −1) −tσ/r ⊕ O tσ at time t = 0, where σ ⊂ K S is the graph of σ .
where t is the parameter on C = C t . This family is classified by a map P × C t −→ P ⊥ α,n .
Differentiating at t = 0 (equivalently, restricting from C t to Spec C[t]/(t 2 )) we get a P ⊥ α,n vector field on P,φ ∈ P, T P ⊥ α,n P . (5.21) By construction it has T weight one. The symmetry of the obstruction theory makes P ∼ = Ob P ⊗ t −1 , so (5.21) is equivalent to a weight zero cosection Its image is an ideal sheaf so (5.22) has a well-defined zero scheme Z (φ).
Proof. First we discuss how basechange works in this setting. If p = (E, φ, s) is a point of P with ideal m ⊂ O P then P | p ∼ = m/m 2 and (5.22) induces a map m/m 2 → O p ∼ = C which is zero if and only if p ∈ Z (φ). Therefore p ∈ Z (φ) if and only if the vector field (5.21) restricted to p maps to zero under the natural map (which need not be an isomorphism!) (5.24) But m/m 2 * is described by deformation theory [TT2] as Ext 1 X (I • , I • ) ⊥ . By forgetting the section s, this maps (see [TT2,Equation 6.11], for instance) to the first order deformation space of (E, φ), which sits in the exact sequence in the second term. So to prove that p ∈ Z (φ) it is sufficient to show that (5.27) is not in the image of the first term of the sequence (5.26). Assume first that at the point p = (E = ⊕ r −1 i=0 E i t −i , φ, s) ∈ P, one of the φ : E i → E i+1 fails to be injective on S. Letting K i denote the kernel of (5.28) our assumption is that Since (E, φ) is semistable it is torsion free, so all of the K i ⊂ E i are torsion free.
There is an open subset U ⊂ S over which they are all locally free, φ has constant rank, and-we claim-there is a φ-invariant splitting To prove the claim, we may shrink U if necessary and then split K 0 ⊂ E 0 over it. Then we proceed inductively. At the ith stage we have split Further shrinking U if necessary we can find a complement C i to this subbundle. Then C i ⊕ φ(E i /K i ) gives the required complement to K i+1 ⊂ E i+1 . Therefore (5.29) defines a local splitting of Higgs bundles over U . The endomorphisṁ ϕ| U of (5.27) acts on the first summand as Therefore it is not in the image of the map [ · , φ] in the sequence (5.26), since commutators are trace-free. That is, it defines a nonzero deformation of the Higgs pair (K , φ| K ) over U . Therefore the cosection (5.22) is nonzero at p. So now we turn to the case where K = 0 but at least one of the maps (5.28) has cokernel of rank > 0. Then there is an open set U ⊂ S over which the cokernels are locally free, rank(φ) is constant, and-we claim-there is a φ-invariant splitting of locally free sheaves with C k−1 = 0. We prove the claim inductively, with base case C 0 := 0. At the ith stage, possibly after shrinking U as usual, we pick a complement D i+1 to φ i+1 (E 0 ) and then set C i+1 = D i+1 ⊕ φ(C i ).
Therefore k−1 i=0 φ i E 0 | U is a proper sub Higgs bundle of (E, φ)| U . On restriction to it, the endomorphism (5.27) acts as Therefore it is not in the image of the map [ · , φ] in the sequence (5.26). That is, it defines a nonzero deformation of the sub Higgs bundle over U , and again the cosection (5.22) nonzero at p = (E, φ, s).
These results can be strengthened, for instance by showing that at points of Z (φ) the cokernels of φ : E i → E i+1 must have support on the zero divisor of σ -see Theorem 5.34 below for K3 surfaces, for example. But since a nowhere zero cosection on P forces its contribution to the K -theoretic invariant to vanish (by an easy special case of [KL]; see for instance [KL,Proposition 3.2]) the above result is enough to prove that most components P do not contribute to the invariants. In particular the most obvious special case is the following.
Corollary 5.30. If h 2,0 (S) > 0 and the multi-rank is non-constant, a, a, . . . , a) ∀a ∈ N then P does not contribute to the refined invariants.
Remark 5.31. The cosection does not rule out the contribution of all components. For instance, when : E i → E i+1 is an isomorphism for i = 0, . . . , r − 2, the cosection (5.22) vanishes identically. This is because the endomorphism (5.19) can be writteṅ where A : E → E acts as zero on E 0 and as −1 : E i → E i−1 on any other summand. Therefore, in the exact sequence of [TT1,Equations 2.20 and 5.32], we see thatφ maps to zero in the deformation space of E on p X : X × P → P. That is, the first order deformation of E (or equivalently (E, )) is zero. Since s is constant in the flow (5.20), we see the tangent vector (5.21) vanishes identically so Z (φ) = P. 5.3. K3 surfaces. The cosection (5.22) gives the strongest results on (polarised) K 3 surfaces (S, O S (1)). Just as for the stable pairs in [PT], it will show that the only Joyce-Song pairs on S × C which contribute nontrivially to the refined Vafa-Witten invariants are those which have constant thickening in the C-direction. That is, they are pulled back from S then tensored by O r S := O X /I r S⊂X for some r > 0: In Higgs language these correspond to the following.
Definition 5.33. We call a point (E, φ, s) ∈ (P ⊥ α,n ) T uniform if the maps (5.28) are all isomorphisms. Equivalently, Otherwise the cosection is nowhere zero on P. In particular, non-uniform components P contribute zero to the refined invariants.
Proof. Firstly we claim that for any semistable Higgs pair (E, φ) on S the underlying sheaf E is also semistable.
Let F ⊂ E be the first term of its Harder-Narasimhan filtration. Therefore F is semistable with strictly larger reduced Hilbert polynomial (or "Gieseker slope") than the other graded pieces of the filtration. Since those pieces are also semistable, it follows that Therefore the Higgs field φ preserves F, so F either strictly destabilises (E, φ) or is all of E.
In particular each E i in the weight space decomposition of E is semistable (and so torsion-free) of the same reduced Hilbert polynomial. Therefore if φ : E i → E i+1 is injective and generically surjective, it is an isomorphism.
It therefore follows from Theorem 5.23 that any closed point of the zero locus Z (φ) of the cosection is uniform in the sense of Definition 5.33. Since being uniform is an open condition, while the zero locus Z (φ) is closed, a single uniform point makes the whole connected component P uniform. In this case the cosection vanishes identically on P by Remark 5.31.

Refined multiple cover formula.
When O S (1) is generic for charge α this leaves only the uniform components to calculate on: . (5.35) Here P ⊥ ( α r ) r , n is the moduli space of uniform Joyce-Song pairs of charge α which are r -times thickened pairs of charge α/r . They are determined by their restriction to S, giving an isomorphism Here P S α/r,n denotes the moduli space of Joyce-Song stable pairs (E, s) on (S, O S (1)) with charge α/r : so E is a Gieseker semistable sheaf on S with total Chern class α/r , and s ∈ H 0 (E(n)) does not factor through any destabilising subsheaf of E. We noted in Theorem 5.34 this gives a bijection of sets. That this makes P S α/r,n scheme theoretically isomorphic to a component of (P ⊥ α,n ) T follows from the the deformation theory analysis (5.36) below, or by [PT,Lemma 1].
Fix r and let α 0 = α/r . Both P S := P S α 0 ,n and (P ⊥ r α 0 ,n ) T are fine moduli spaces. We denote the two universal sheaves by E 0 on S × P S and E = ρ * E 0 ⊗ O r S×P S on X × P S , and the universal complexes made from the Joyce-Song pairs by with O(−n) in degree 0. As usual p S : S × P S → P S and p X : X × P S → P S denote the projections. Now let Though we will not need to know it, this is the virtual cotangent bundle of the natural perfect obstruction theory on the moduli space P S of pairs on S; see [KT1] for instance. When considered instead as a moduli space of sheaves on X (not yet imposing the centre-of-mass-zero condition), we get a the virtual cotangent bundle by [PT,Proposition 4]. (While that paper works with stable pairs, it uses none of their special properties-the proof goes through verbatim for Joyce-Song pairs.) To get the Vafa-Witten obstruction theory we remove H 0 (K S ) ⊗ t from the deformations (imposing the centre-of-mass-zero condition) and-dually-H 2 (O S ) from the obstructions, replacing E • S by the reduced obstruction theory of [KT1] (we do not prove this compatibility of obstruction theories since we do not need it; we only require the K -theory class of the virtual (co)tangent bundle). The upshot is that the Vafa-Witten obstruction theory of [TT2] is, on restriction to P S ⊂ P ⊥ r α 0 ,n , the K -theory class of L vir P ⊥ r α,n P S ∼ = L red P S ⊗ (t 0 ⊕ · · · ⊕ t r −1 ) − (t ⊕ · · · ⊕ t r −1 ) −(L red P S ) ∨ ⊗ (t −1 ⊕ · · · ⊕ t −r ) + (t −2 ⊕ · · · ⊕ t −r ).
Theorem 5.38. Suppose any of (1), (2) or (3) holds for the charge α 0 . Then the contribution (5.37) of uniform Joyce-Song pairs satisfies Conjecture 5.2 for all r . The resulting refined Vafa-Witten invariants are given by the multiple cover formula [r ] 2 t .
Substituting this into (5.40) gives So (5.39) turns out to be the correct refinement of the more familiar multiple cover formula For these numerical invariants it is known (by a results of [MT1,PT,To] combined in [TT2,Theorem 6.21]) that even when α 0 is not primitive. That is, the contribution of T -fixed semistable sheaves scheme theoretically supported on S to the Vafa-Witten invariants is what we get for primitive α 0 . It seems natural to conjecture the same for the refined invariants. Summing over all uniform multiple covers using (5.35), P ⊥ α,n = (−1) χ(α(n))−1 r |α t − 1 2 r vd χ vir −t r P S α r ,n [r ] t , (5.42) then substituting in (5.39) gives the following. When α = r α 0 with r prime and α 0 primitive, this was already conjectured by . But by (5.42) and Theorem 5.38, we have proved this to be true.