{'fraction_non_alphanumeric': 0.07877243775332947, 'fraction_numerical': 0.01940938042848871, 'mean_word_length': 3.437410071942446, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Lefschetz type formulas for dg-categories

We prove an analog of the holomorphic Lefschetz formula for endofunctors of smooth compact dg-categories. We deduce from it a generalization of the Lefschetz formula of V. Lunts that takes the form of a reciprocity law for a pair of commuting endofunctors. As an application, we prove a version of Lefschetz formula proposed by Frenkel and Ngo. Also, we compute explicitly the ingredients of the holomorphic Lefschetz formula for the dg-category of matrix factorizations of an isolated singularity w(x). We apply this formula to get some restrictions on the Betti numbers of a Z/2-equivariant module over k[[x_1,...,x_n]]/(w) in the case when w(-x)=w(x).

The derived categories of coherent sheaves and their dg-enhancements have been crucial in some recent developments in algebraic geometry. Among these is the new point of view on the circle of ideas related to Chern characters and Hirzebruch-Riemann-Roch theorem, started in the work of Markarian [22] and continued in [23], [9], [10], [30], [32], [27]. Namely, as shown by Shklyarov in [32], one can formulate and prove a version of the HRR formula for any smooth and proper dg-category C, where the cohomology of the variety is replaced by the Hochschild homology HH * (C). The difficulty of applying Shklyarov's formula is usually in the explicit calculation of the Chern character with values in HH * (C) and of the canonical pairing on HH * (C). For example, for derived categories of coherent sheaves on smooth projective varieties this was done in [9] and [30]. The case of the category of matrix factorizations associated with an isolated hypersurface singularity was treated in [27]. On the other hand, Lunts proved in [21] a version of the topological Lefschetz trace formula for endofunctors of dg-categories that reduces to the standard one in the case of the derived category of coherent sheaves. In the present paper we will consider a dg-version of the holomorphic Lefschetz formula (in its algebraic version) and will calculate its ingredients explicitly for the category of matrix factorizations of an isolated hypersurface singularity.
Recall that the classical Lefschetz fixed point formula equates the number of fixed points of an endomorphism f : M → M of a compact oriented manifold with the supertrace of the action of f on the cohomology of M (assuming the intersection of the graph of f with the diagonal is transversal). In the case when M is a compact complex manifold and f is holomorphic, the holomorphic Lefschetz formula computes the supertrace of the action of f on H * (M, V ), where V is a holomorphic vector bundle equipped with a map f * V → V (see [1,Thm. 2] and [36]). There are also purely algebraic versions of this theorem (see [13], [5], [25], [18,II.6]).
In the abstract dg-context the role of the pair (M, f ) is played by a pair (C, F ), where C is a dgcategory over a field k and F is an endofunctor of Per(C), the perfect derived category of C (see [20]). The cohomology of M is replaced in this context by the Hochschild homology of C. The classical situation is recovered when C is a dg-version of the bounded derived category D b (M ) of coherent sheaves on a smooth projective variety M over C, and F is the pull-back functor with respect to an endomorphism of M . Note that in this case, by the Kostant-Hochschild-Rosenberg theorem, the Hochschild homology HH * (C) is isomorphic to the usual cohomology H * (M, C). The assumption of M being smooth and compact has a well-known analog for dg-categories. In addition we assume the existence of a generator and consider only endofunctors induced by a kernel in Per(C op ⊗ C) (i.e., F is a tensor functor in the terminology of [20]). where the second arrow is given by pre-composing with α and post-composing with β, and our formula reads as str (F, α, β) * , Hom(A, where G : Per(C) → Per(C) is the right adjoint functor to F , β : B → G(B) is induced by β, τ A F : Hom(A, F (A)) → Tr C (F ) is a certain generalized boundary bulk map taking values in a graded vector space Tr C (F ) associated with F , and ?, ? F,G is a canonical perfect pairing between Tr C (F ) and Tr C (G) that we will define. More precisely, here Tr C is the functor on C − C-bimodules given by tensor multiplication with the diagonal bimodule, so Tr C (F ) is just the Hochschild homology with values in the bimodule corresponding to F . In the case when F = Id C the space Tr C (F ) becomes HH * (C) and the formula (0.2) is exactly the generalized abstract Hirzebruch-Riemann-Roch Theorem [27,Thm. 3.1] (a similar property is called "Baggy Cardy Condition" in [10]).
The data consisting of the spaces Tr C (F ) and Tr C (G) and the pairing between them should be thought of as an abstract replacement of the derived intersection of the graph of an endomorphism f : M → M with the diagonal. In the geometric situation (assuming that the intersection is transversal) the spaces Tr C (F ) and Tr C (G) have bases numbered by the fixed points of f , and the pairing ?, ? F,G is diagonal with respect to these bases. It is not clear whether one can formulate an analog of transversality in the abstract situation.
The dg-version of the topological Lefschetz formula, recently established by Lunts [21], has as an input a pair (C, F ) as above and states the equality str(F * , HH * (C)) = sdim Tr C (F ) (0. 3) in the ground field k, where F * is the map on Hochschild homology induced by F and in the right-hand side we use the superdimension of a graded vector space defined by sdim(V ) = dim(V ev ) − dim(V odd ). Using formula (0.2) we establish a certain generalization of (0.3) that we call Lefschetz reciprocity. Namely, assume that we are given a pair of tensor endofunctors of Per(C), F and Ψ, together with a morphism f : F • Ψ → Ψ • F.
Let G be the right adjoint to F . Then f induces a morphism ψ : Ψ • G → G • Ψ. Also, we have the induced map where the third arrow uses the key property that one can switch the order of composition under Tr (see (1.10)). Similarly, we have the map (Ψ, ψ) * : Tr(G) → Tr(G). We prove the following reciprocity relation: The idea of the proof is to apply (0.2) to a certain endofunctor of Per(C op ⊗ C) induced by F . Note that (0.3) is a particular case of (0.4): one should take Ψ to be the identity functor.
In the case when F is an autoequivalence, we deduce from (0.4) a Lefschetz type formula for the action of an autoequivalence F of Per(C) on the Hochschild cohomology of C. Namely, we show that its supertrace is equal to the supertrace of the automorphism of the space Tr(F ) induced by the inverse Serre functor (see Section 3.3).
There are two important classes of examples in which the abstract formulas (0.2) and (0.4) can be made explicit: the categories of coherent sheaves on smooth projective varieties and the categories of matrix factorizations of a potential with an isolated singularity. Note that in [21] the formula (0.3) is rewritten in explicit terms for the case of coherent sheaves (see also [11]), while in [27] the case F = Id C of the formula (0.2) is made explicit for matrix factorizations. In Section 3.4 we extend this calculation to the case of an autoequivalence F induced by a diagonal linear map preserving the potential. In the simplest case when the origin is an isolated fixed point of this map we get the following result.
Theorem 0.1. Let t = (t 1 , . . . , t n ) ∈ (k * ) n be a diagonal symmetry of an isolated singularity w(x 1 , . . . , x n ) ∈ k[[x 1 , . . . , x n ]], such that t i = 1 for all i (i.e., the origin is an isolated fixed point of t). Then for any pair of matrix factorizations of w,Ā andB, equipped with closed morphisms α :Ā → t * Ā and β : t * B →B, one has In the case t = −1 this formula leads to the divisibility for any Z/2-equivariant matrix factorizationĀ of an even isolated singularity w (see Proposition 3.18 and Example 3.19). In the case of the matrix factorization obtained by stabilization of a free resolution of a graded module M over k[x 1 , . . . , x n ]/(w) we get restrictions on the Betti numbers of M which are similar but different from those obtained in [2]. On the other hand, we apply the formula (0.4) in the context of the derived category of coherent sheaves on a smooth projective variety to prove a version of holomorphic Lefschetz formula conjectured by Frenkel and Ngô in [16, Conj. 6.2] (see Theorem 3.8). Presumably a similar proof should work in a more general setting of derived stacks, as envisioned in [16].
Convention. In various maps involving tensor products the Koszul sign rule is tacitly assumed. We work over a fixed ground field k. Whenever we talk about varieties over k we assume that k is algebraically closed. For a morphism of schemes f we denote by f * and f * the corresponding derived functors. Acknowledgments. I am grateful to Luchezar Avramov and David Eisenbud for helpful discussions.

Kernels and traces
1.1. Kernels, duals and tensor products. We refer to [19], [20], [34] and [35] for results about dgmodules over dg-categories. For a dg-category C we denote by Per(C) the derived category of perfect C op -modules, and by Per dg (C) its dg-version, so that Per(C) is the homotopy category of Per dg (C). For M, N ∈ Per(C) we denote by Hom(M, N ) = Hom C op (M, N ) the graded morphism spaces in Per(C). Note that these are given by the cohomology of the complexes Hom C op −mod (M, N ). In this paper we consider only dg-categories C such that Per dg (C) is saturated, i.e., smooth, compact and has a generator. This implies that the spaces Hom(M, N ) are finite-dimensional.
Every dg-functor F : Per dg (C) → Per dg (D) (up to an appropriate equivalence) can be given by a kernel This correspondence can be formulated as a certain quasi-equivalence of dg-categories (see [35,Sec. 2.2], [20,Thm. 4.6]). In this paper, whenever we talk about a functor F : Per(C) → Per(D), we implicitly assume that it is given on a dg-level, and hence is induced by a kernel. Sometimes, we denote the corresponding kernel in Per(C op ⊗ D) also by F . We denote by ∆ C ∈ Per(C op ⊗ C) the diagonal kernel representing the identity functor on Per(C).
The composition of dg-functors F 1 • F 2 , where F 2 is given by a kernel K 2 ∈ Per(C op ⊗ D) and F 1 is given by a kernel K 1 ∈ Per(D op ⊗ E), corresponds to the kernel K 2 ⊗ L D K 1 ∈ Per(C op ⊗ E). Sometimes, when K i are implicit, we denote this kernel simply by F 1 • F 2 .
Recall that we have a natural duality Here h C is the representable C op -module associated with C ∈ C. For M ∈ Per dg (C) and N ∈ Per dg (C op ) we have a natural quasi-isomorphism (see [19, 6.2]). Also, we have a natural quasi , where σ 23 is the permutation. We denote the corresponding functor by where F 1 and F 2 are functors associated with K 1 and K 2 .

Adjoint kernels. Let
be the functor associated with a kernel K ∈ Per(C op ⊗ D). We associate with K two other kernels. First, we define K T ∈ Per(D op ⊗ C), the right dual kernel to K, by where h D is the representable right D-module associated with D. The corresponding functor is right adjoint to F (see [19,Sec. 6.2] and [27,Sec. 1.2]). Furthemore, the adjunction morphisms are induced by the canonical morphisms of kernels in Per(D op ⊗ D) and Per(C op ⊗ C): (in fact, the first morphism has a natural realization in Per dg (D op ⊗ D), see [27, (1.14)]). In terms of the duality (1.1) we can rewrite the definition of K T as follows: and N ∈ Per(C) one has a natural isomorphism in Per(D op ), so that the following diagram of isomorphisms is commutative for M ∈ Per(D) and N ∈ Per(C). In this diagram the upper horizontal arrow is an isomorphism of part (i), the lower horizontal arrow is induced by (1.5), and γ is the adjunction isomorphism of Lemma 1.1.
Proof. (i) By (1.2), we have Reversing the order of factors we can rewrite this as ). (ii) First, taking cofibrant resolutions for K ′ and (K T ) ′ , we can realize the map γ (with M ∨ replaced by any D-module L) on the chain level as the following composition: where the second arrow is induced by the map in Per dg (D ⊗ D op ). Composing (1.7) with a quasi-isomorphism of the form ? ⊗ C op N → Hom(N ∨ , ?) obtained from (1.2), we get a quasi-isomorphism hence we get a quasi-isomorphism F (N ) → G ′ (N ∨ ) ∨ , from which (1.5) is obtained by duality. Now using the isomorphisms (1.2) we can replace (1.6) with the following diagram in which we replaced M ∨ by L and inserted an additional diagonal arrow: It remains to observe that in this diagram the upper left triangle is commutative for trivial reasons, and the lower right triangle is commutative by the above construction of the map F (N ) → G ′ (N ∨ ) ∨ .
Let us consider the external tensor product K ′ 2K T ∈ Per(D ⊗ D op ⊗ C op ⊗ C). Then we have a natural isomorphism [27, (1.8)]). Combining it with the permutation of (1.3) we get a map of kernels in Per(D ⊗ D op ). Note also that the functor F ′ 2G : Per(D op ⊗ D) → Per(C op ⊗ C) given by the kernel K ′ 2K T , viewed as an operation on functors, acts by Φ → G • Φ • F . In particular, (F ′ 2G)(∆ D ) is the kernel giving G • F .

Connection with traces.
Recall that we have the natural trace functors Tr dg C : Per dg (C op ⊗ C) → Per dg (k) given by the tensor product on the right with the diagonal C op ⊗ C-module ∆ C op (see [34,Sec. 5 . In other words, Tr C is the functor of Hochschild homology with coefficients in a bimodule. By abuse of notation, for a tensor endofunctor F : Per(C) → Per(C) given by a kernel K F ∈ Per(C op ⊗ C) we will write Tr C (F ) instead of Tr C (K F ). Recall that for any tensor functors F 1 : Per(C) → Per(D) and F 2 : Per(D) → Per(C) we have a canonical isomorphism Returning to the situation of Section 1.2 we observe that the map of kernels (1.9) induces a natural transformation (1.11) By Lemma 1.1, the above construction is also applicable to the adjoint pair of functors (G ′ , F ′ ), so it gives a map t(G ′ , F ′ ) : Tr C op •(G2F ′ ) → Tr D op . It is easy to see that the following diagram of functors Per(D ⊗ D op ) → Per(k) is commutative is the permutation equivalence, the isomorphism in the left column is induced by the isomorphism and by the isomorphism Tr C •σ C ≃ Tr C op . Note that we have a natural isomorphism Hence, the canonical adjunction map (1.4) can be viewed as a map Using isomorphism of Lemma 1.2(i) for the map we obtain a canonical morphism (1.14) Note also that for M ∈ Per(C op ⊗ C) we have a canonical isomorphism is given by the composition where the second isomorphism uses (1.10).
(ii) Via the identification (1.15), t(F, G)(Φ) can be identified with the composition where the first arrow is given by adjunction of the pair ((G ′ 2F ), (F ′ 2G)), while the second is induced by (1.14).
Proof. (i) Consider the object We have On the other hand, Now the isomorphism between (1.18) and (1.17) is obtained by identifying both with i.e., in terms of the above isomorphism by the map where σ 4321 is the cyclic permutation of factors in the tensor product. Now the required compatibility follows from the commutativity of the diagram in which both horizontal arrows are induced by (1.3).
(ii) Applying the commutative diagram of Lemma 1.2(ii) to the adjoint pair ((G ′ 2F ), (F ′ 2G)) and the pair of objects (∆ C op , ∆ D op ) we obtain that the dual map to (1.14), corresponds by adjointness to γ G ′ ,F ′ . Hence, this map is given by the natural morphism (1.9)). Now rewriting the composition (1.16) using the isomorphisms of the form (1.2) we obtain the result.
2. Generalized functoriality for Hochschild homology with coefficients 2.1. Generalized functoriality. Let (C 1 , F 1 ) and (C 2 , F 2 ) be a pair of dg-categories equipped with endofunctors F i of Per dg (C i ).
consists of a dg-functor Φ : is another dg-category with an endofunctor of Per dg (C 3 ) and is a dg-functor, then we have an induced morphism and we define the composition of these dg-functors by Given a dg-functor (2.1) we define the induced morphism as the composition where Ψ is the right adjoint functor to Φ. The above construction is compatible with compositions.
Proof. This follows from the commutativity of the diagram (where we omitted the • symbols)  2. The definition of the maps (Φ, φ) * is the particular case of the trace maps for a bicategory with a shadow functor (see [29,Def. 5.1]). Namely, we have a bicategory whose 0-cells are dg-categories, the categories of 1-cells are given by derived categories of bimodules, and the shadow functors are the functors Tr C (cf. [29,Ex. 6.4]). In this context our Lemma 2.2 follows from [29, Prop. 7.5].

2.2.
Generalized boundary-bulk map. Given a tensor functor F : Per(C) → Per(C) (given by a kernel K ∈ Per(C op ⊗ C)) and an object A ∈ Per(C), we can construct a natural map τ A F : Hom(A, F (A)) → Tr C (F ) which in the case F = Id becomes the boundary-bulk map defined in [27,Prop. 1.2.4]. Namely, this map is defined by applying the functor Tr C to the natural morphism . It is useful to note that the map c A F is obtained by applying Id C 2F to the morphism 4) or equivalently, by composing the corresponding functors with F on the left (see the proof of Lemma 1.2.5(ii) in [27]). Note that we can view an object A as a dg-functor ι A : and the construction of 2.1 gives an induced map The right adjoint functor Ψ to Φ = ι A is given by the kernel A ∨ , viewed as a C − k-bimodule, so Ψ • Φ corresponds to the vector space Hom(A, A) while Φ • Ψ corresponds to the kernel A ∨ ⊠ A. Thus, by definition, (ι A , α) * is the following composition Note that the last two arrows are obtained by applying Tr C to the morphisms Now the asserted equality follows from the fact that the last composition is equal to (2.3).
Recall that we have an isomorphism where F ′ is given by the kernel K ′ = K • σ (see Lemma 1.2(i)).
Proof. The isomorphism (2.5) can be obtained from the isomorphisms . Thus, it remains to check that the maps F • X → F and X • F → F induced by the canonical morphism X → ∆ C , give rise to the same maps after applying Tr. This boils down to the fact that the isomorphism is equal to the identity.
As in the case of the generalized HRR-theorem of [27, Lem. 1.3.2], the fixed point formula will be deduced from the following compatibility of the boundary-bulk maps with dg-functors.
where the second arrow is induced by φ. Then the following diagram is commutative ?
where the bottom horizontal arrow is the map (2.2).
Proof. The idea is to use the compatibility of the generalized functoriality with compositions (see Lemma 2.2). Namely, as we have seen above, an element α ∈ Hom(A, F 1 A) gives rise to a dg-functor . It follows directly from the definitions that the dg-functor It remains to apply Lemma 2.4 to see that the left-hand side is equal to τ (α ′ ).

Canonical pairings.
We can also use the functoriality to define a canonical pairing where F : Per(C) → Per(C) is given by a kernel K, and G : Per(C) → Per(C) is the right adjoint functor to F associated with the kernel K T (see Sec. 1). Recall that F ′ : Per(C op ) → Per(C op ) denotes the functor associated with the kernel K ′ = K • σ ∈ Per(C ⊗ C op ). We can apply the generalized functoriality (2.2) to the functor Tr dg C : Per dg (C op ⊗ C) → Per dg (k), the identity endofunctor of Per dg (k), and the endofunctor F ′ 2G of Per dg (C op ⊗ C). Note that we have a morphism t(F, G) : Hence, by the construction of Section 2.1, we obtain a map Applying the above construction to the adjoint pair (G ′ , F ′ ) (see Lemma 1.1) we similarly get a pairing where the sign is given by the Koszul rule.
Proof. This follows easily from the commutativity of the diagram (1.12).
Recall that we have a canonical map Proof. (i) By Lemma 2.4, we can view τ ∆C F ′ 2G (γ F,G ) as the generalized functoriality map associated with the dg-functor It is easy to see that the composition is isomorphic to the identity. Indeed, for any kernel K ∈ Per dg (C op ⊗ C) and M ∈ Per dg (C) we have Next, we observe that both arrows in (2.9) extend to dg-functors between dg-categories with endofunctors. Namely, we have dg-functors and (Tr dg (2.7) for the pair (G ′ , F ′ )). We claim that the composition of these dg-functors is For this we have to check that the composition is the identity. The corresponding composition of maps between the kernels can be rewritten as where Tr 23 is the functor Tr C op applied in the 2nd and 3rd factors of the tensor product. But the latter composition can be identified with the composition of two adjunction maps G → G • F • G → G, which is equal to the identity.
(ii) The relation (2.8) shows that the left kernel of ·, · G ′ ,F ′ is trivial. On the other hand, applying (i) to the pair (G ′ , F ′ ) we obtain ( ·, · F,G ⊗ id)(y ⊗ τ G ′ ,F ′ ) = y for any y ∈ Tr(F ) ≃ Tr(F ′ ). Hence, the left kernel of ·, · F,G is trivial. It remains to apply Lemma 2.7. Remarks 2.9. 1. The above proof also shows that the tensor τ G ′ ,F ′ is obtained from τ F,G by the permutation of factors in the tensor product. This can be also seen directly from the definition.
It is well known that this kernel induces the inverse of the Serre functor on Per(C) (cf. [17] or [33]).
Recall that for any kernel K ∈ Per(C op ⊗ C) we have a natural isomorphism (see (1.15)). We want to rewrite the definition of the functoriality map (2.2) in terms of this isomorphism. Thus, we assume that we have a dg-functor (see (1.14)). Note also that the map φ gives rise to a map given as the composition Now using isomorphism (2.12) we can give an alternative map Tr C1 (F 1 ) → Tr C2 (F 2 ) as the composition where the last arrow is induced by (2.13) and by φ. Proof. The map induced by φ gets identified under the isomorphism (2.12) with the composition appearing as part of the definition of (2.2). Hence, it is enough to prove the commutativity of the diagram Using the adjointness of the pair (Ψ ′ 2Φ, Φ ′ 2Ψ) the first arrow in the top row can be identified with the map Next, by Lemma 1.3(ii) the second arrow in the top row is equal to the following composition (where we denoted X = (Ψ ′ 2Φ)(F 1 )): Therefore, by Lemma 1.3(i), the composition of arrows in the top row of (2.16) can be identified with the composition Note that the composition of the first two arrows is equal to the composition of the following two maps induced by adjunction: In the situation when F 1 and F 2 are the identity functors we derive the following Corollary 2.11. Let Φ : Per dg (C 1 ) → Per dg (C 2 ) be a dg-functor. Then the induced map defined as in Section 2.1, is equal to the composition where the second arrow is induced by (2.13) and by the adjunction map Φ • Ψ → ∆ C2 .
Remark 2.12. One can deduce from the above corollary that our definition of functoriality maps on Hochschild homology is equivalent to the one given in [10] and [4,Appendix].
Recall that Hochschild cohomology of C is defined by Note that for any autoequivalence F : Per(C) → Per(C) (given by a kernel) we we have a natural isomorphism is an equivalence (given by a kernel) then there is an induced isomorphism Φ * : HH * (C 1 ) → HH * (C 2 ). (2.18) We are going to show that this map appears as one of our functoriality maps. Since Φ is an equivalence, we have a natural isomorphism and hence the induced isomorphism Proof. By Proposition 2.10, it is enough to prove the commutativity of the diagram where the vertical arrows are isomorphisms (2.17) and the second arrow in the bottom row is induced by the isomorphism φ. Upon unraveling the definitions this becomes a tautology.
In the remainder of this section we explain the relation between the canonical pairing on the Hochschild homology and the Mukai pairing considered in [8,10,31]. This will not be used anywhere else in the paper. Let us recall the definition of the Mukai pairing ·, · M on HH * (X), where X is a smooth projective variety, following [8] 1 . Let S X (resp., S −1 X ) be the kernel in D b (X × X) corresponding to the Serre functor S X (resp., the inverse of the Serre functor S −1 X ) on D b (X). We have natural isomorphisms where ∆ X is the structure sheaf of the diagonal in X × X (see [10, Sec. 2.2, Prop. 1]). From the second isomorphism we get using Serre duality on X × X a canonical functional tr X : Hom X×X (S −1 X , S X ) → k. Now the Mukai pairing is given by where x, y ∈ Hom X×X (S −1 X , ∆ X ), and τ (= τ L in the notation of [10]) is the isomorphism On the other hand, if we take C to be a dg-enhancement of D b (X), we get an identification HH * (C) ≃ HH * (X), so we can compare the Mukai pairing with the canonical pairing ·, · on HH * (C) (see Remark 2.9.2).
Proposition 2.14. With the above identifications we have the equality of pairings ·, · M = ·, · on HH * (X).
Proof. By definition, ·, · is obtained by looking at the map on Hochschild homology induced by the functor . The right adjoint to this functor is given by S X ∈ D b (X × X), and the description of the functoriality via Serre functors (2.15) implies that (2.20) is given by where α ∈ Hom(S −1 X 2 , ∆ X 2 ), the canonical element u ∈ Tr X (S −1 X 2 (S X )) ≃ Hom X 2 (S −1 X , S −1 X ) corresponds to the identity map of S −1 X , and (Tr X •α) SX : (Tr X •S −1 X 2 )(S X ) → Tr X (S X ) is the map induced by the morphism of functors Tr X •α. Note that the action of S −1 X 2 on kernels in D b (X × X) is given by Finally, the Künneth isomorphism sends x ⊗ y to the morphism α : S −1 X 2 → ∆ X 2 such that α F is given by the composition which in the case F = S X gets identified with the composition Applying the map tr X we get exactly the Mukai pairing x, y M .  Proof. We would like to apply Lemma 2.6 to the dg-functor (2.7), extending Tr dg C , from (Per dg (C op ⊗ C), F ′ 2G) to (Per dg (k), Id).
By Lemma 1.2, the map α : A → F (A) in Per(C) induces a morphism α ′ : A ∨ → F ′ (A ∨ ) in Per(C op ). Also, β : F (B) → B induces a map β : B → G(B). Hence, we obtain a morphism Also, for a graded vector space V the map τ V Id : Hom(V, V ) → k is the usual supertrace. Hence, Lemma 2.6 gives an equality Hom(A, B).
Since τ A ∨ F ′ (α ′ ) = τ A F (α) by Lemma 2.5, the right-hand side of (3.1) coincides with the right-hand side of (0.2). It remains to check that f is equal to the endomorphism (F, α, β) * of Hom(A, B) (see (0.1)). We can rewrite the definition of (F, α, β) * as the following composition: (1.5)) and by a natural morphism of functors This morphism of functors is constructed similarly to t(F, G) using the map of kernels (1.4). Now the required equality f = (F, α, β) * follows from the commutativity of the diagram ?
where the vertical arrows in the lower square are induced by the isomorphism G ′ (A ∨ ) ≃ F (A) ∨ and by the adjunction morphisms G ′ F ′ → Id and F G → Id. Note that the commutativity of the lower square follows from Lemma 1.2(ii). corresponds to considering the derived intersection of the graph Γ f with the diagonal. In the case when the intersection is transversal we have If V is a vector bundle (or a complex of vector bundles) on M then applying (f × id M ) * to the natural map (V ∨ ⊠ V ) → O ∆ and then restricting to the diagonal we get a map In the case of transversal fixed points we have where (δ x ) is the natural basis of T f indexed by fixed points. Finally, we claim that in the case of transversal intersection the canonical form ·, · on T f is given by and δ x , δ y = 0 for x = y, where d x f : T x M → T x M is the tangent map to f at x. Indeed, the fact that the basis (δ x ) is orthogonal can be deduced from Lemma 2.8. To get the formula for δ x , δ x , where f (x) = x, we observe that τ Ox f = c x · δ x for some c x ∈ k, and apply the formula (0.2) to the pairs (O M , O x ) and to (O x , O x ). In the former case we get and in the latter case we get is precisely the tangent map d x f . Since F * is compatible with the algebra structure, we obtain Thus, our formula in this case becomes the classical holomorphic Lefschetz formula Using the Lefschetz formula (0.2) we can give some criteria for non-vanishing of the space Tr C (F ) (which is roughly analogous to the existence of a fixed point of an endomorphism).
Proof. We apply (0.2) to A = B, with α : A → F (A) some isomorphism and β = α −1 . We have to show that in all three cases we have str(F * , Hom(A, A)) = 0.
In case (i) we have Hom(A, A) = k and the induced map F * on it is identity, so str(F * , Hom(A, A)) = 1.
In case (ii) F * acts as identity on Hom 0 (A, A) = k · id A and as some N th root of unity ζ on Hom n (A, A) ≃ k. Since n is even, we obtain str(F * , Hom(A, A)) = 1 + ζ which is nonzero since N is odd.
Finally, in case (iii) we use the fact that F * is an endomorphism of the algebra Hom(A, A) ≃ * k (Hom 1 (A, A)), so we get str(F * , Hom(A, A)) = det(id −F * ) = 0.
Note that the property (iii) in the above Corollary is modeled on the properties of the pair (f * , O x ) for a transversal fixed point x of an endomorphism f .

Lefschetz reciprocity.
As before, we assume that C is a dg-category such that Per dg (C) is saturated, and F is a dg-endofunctor of Per dg (C). Now let Ψ be another dg-endofunctor of Per dg (C) together with a morphism f : F • Ψ → Ψ • F Then we have the induced endomorphism (F, f ) * of Tr(Ψ). Let G be right adjoint to F . Then we have the induced map and hence the induced endomorphism (Ψ, ψ) * of Tr(G). We have the following Lefschetz reciprocity formula. Proof. The idea is to apply formula (0.2) to the category C op ⊗ C, equipped with the endofunctor G ′ 2F , taking as B the kernel representing Ψ and A = ∆ ∨ C op , the inverse dualizing complex (see section 2.4).
Note that we have Also, the right adjoint to G ′ 2F is F ′ 2G (by Lemma 1.1). We will apply (0.2) to certain natural morphisms that we are going to define presently. Namely, using the isomorphism of Lemma 1.2(i), α corresponds to a morphism α ′ : , and we take α ′ := γ G ′ ,F ′ (see (1.13)). On the other hand, β corresponds to the morphism of functors If follows that the map β : B → (F ′ 2G)(B), obtained from β by adjunction of the functors (G ′ 2F, F ′ 2G), corresponds to the morphism of functors Thus, the formula (0.2) combined with Lemma 2.5 gives where ψ : Ψ • G → G • Ψ is induced by f . Indeed, this follows from Lemma 2.6 since B = (Id 2Ψ)(∆ C ).
Proof. Let (v i ) be a homogeneous basis in V and let (w i ) be the dual basis of W , so that v i , w j = δ ij .
It is enough to prove the formula for A such that A(v i ) = v j and A(v l ) = 0 for l = i. Then we have Remark 3.6. In the particular case (Ψ, ψ) = (Id C , id) the formula (3.2) gives (0.3). Note however, that the argument of [21] for the proof of (0.3) is more direct. Let us first calculate the morphism ψ. We have a commutative diagram Here and in the diagrams below unnamed arrows are induced by adjunction morphisms. By definition, ψ is given by the composition of the arrows in the top row followed by the right vertical arrow. Hence, it can also be computed as the composition of the arrows in the bottom row with the left vertical arrow. Now the commutative diagram together with the definition of ψ, shows that ψ is equal to the composition Note that the composition of the last two arrows is the identity map, which together with the commutative triangle Tr(G • F • G) The map (F, α) * : Tr(Ψ) → Tr(Ψ) induced by α is the composition On the other hand, the functor F = f * is given by the kernel (f, id M ) * O M on M × M , so Ψ • F is given by the kernel (f, id M ) * V . Hence, where M f is the derived intersection of Γ f with the diagonal in M × M , fitting into the derived cartesian diagram  where the map (i * α) * is given by which follows also from the usual holomorphic Lefschetz formula (see Example 3.2). 2. In the formula of [16, Conj. 6.2] the right-hand side apparently has a typo: it should have i * V rather than i * ∆ * (V ) in order to be correct even in the transversal case. 3. Theorem 3.8 and its proof should generalize to an appropriate class of derived algebraic stacks, as envisioned in [16].
3.3. Lefschetz formula in Hochschild cohomology. Now let (C, F ) be as above and assume in addition that F is an autoequivalence, so that G = F −1 . Let us take Ψ = S −1 , the inverse Serre functor given by the kernel ∆ ∨ C op , and use the canonical morphism f : F • S −1 → S −1 • F (see (2.19)). As we have seen in Corollary 2.13, the map (F, f ) * gets identified with the natural endomorphism F * of the Hochschild cohomology HH * (C) ≃ ∆ ∨ C op . Thus, Theorem (3.4) gives a formula for the supertrace str(F * , HH * (C)). We will rewrite this formula in a slightly different way.
Note that since F ′ is an autoequivalence, we have two non-degenerate pairings Tr(F ′ ) ⊗ Tr(G) ≃ Tr(F ) ⊗ Tr(G ′ ) → k: ·, · F,G and ·, · F ′ ,G ′ (see Section 2.3). Let A F : Tr(G) → Tr(G) be the automorphism such that x, y F,G = A F (x), y F ′ ,G ′ ). is induced by the isomorphism (2.19). Also, we have Proof. By Theorem (3.4), we only have to check that (S −1 , s) * = A F . We are going to deduce this from (3.3). Note that in our case B = ∆ ∨ C op , Ψ = S −1 , and as the proof of Theorem 3.4 shows, β is the map or on the level of kernels, . It is easy to see that this map corresponds under the isomorphism of Lemma 1.2(i) to γ F ′ ,G ′ . Hence, by Lemma 2.5 we obtain which is equivalent to what we needed to check.
In the case F = Id, the above theorem gives the following formula. where n = dim X. Indeed, due to the form of the Serre functor in this case, the operator (−1) n S −1 * on HH * (X) is upper triangular, so its supertrace is equal to sdim HH * (X). Note that the above equality follows also from the well-known identity sdim HH * (X) = c n (Ω 1 X ) = (−1) n c n (T X ) = (−1) n sdim HH * (X). 3.4. Example: matrix factorizations. Let us consider the case when C = MF(w) is the category of matrix factorizations of an isolated singularity w ∈ m ⊂ R = k[[x 1 , . . . , x n ]], where k is a field of characteristic zero (m is the maximal ideal in R). Recall that a matrix factorizationĒ = (E, δ E ) of w is a Z/2-graded finitely generated free R-module E equipped with an odd endomorphism δ such that δ 2 = w · id. The complexes of morphisms Hom(Ē 1 ,Ē 2 ) are defined by taking the spaces of Z/2homogeneous R-morphisms Hom * R (E 1 , E 2 ) with the natural differential induced by δ E1 and δ E2 . Note that MF(w) is a Z/2-dg-category, however, the formalism developed above works in a Z/2-graded case as well (cf. [14,Sec. 5.1]). We will freely use the notation and the conventions of [27,Sec. 2]. Recall that the Hochschild homology of w is naturally isomorphic to the Z/2-graded space where we set ∂ i = ∂/∂x i (see [14,Thm. 6.6], [27, (2.28)]). Let t : (x 1 , . . . , x n ) → (t 1 x 1 , . . . , t n x n ) be a diagonal symmetry of w, so that w(t 1 x 1 , . . . , t n x n ) = w(x 1 , . . . , x n ). We associate with t an autoequivalence t * of MF(w) induced by the similar functor t * on free k[[x 1 , . . . , x n ]]-modules (which acts as identity on objects and as the substitution f → f • t on morphisms).
Recall that the kernels giving dg-functors MF(w) → MF(w) can be viewed as matrix factorizations of w = w(y 1 , . . . , y n ) − w(x 1 , . . . , x n ) (see [14,Sec. 6.1], [27,Sec. 4.2]). The diagonal kernel is represented by the stabilized diagonal matrix factorization, which is the Koszul matrix factorization where R e = R⊗R = k[[x 1 , . . . , x n , y 1 , . . . , y n ]] and V = n i=1 k · e i (see [27, (2.24),(2.25)]). The endomorphism δ st of the exterior algebra has two components: one is given by the exterior product with ∆ i w · e i , and another-by the contraction with (y i − x i ) · e * i . To write explicitly the kernel corresponding to t * we use the relation for F = t * . The functor (Id 2t * ) can be identified with (id ×t) * , so the kernel giving t * is the Koszul matrix factorization (id ×t) * ∆ st . Since the functor Tr : MF( w) → Per(k) is given by the restriction to the diagonal y = x, we get an isomorphism where Γ t is the graph of t (given by the equations y i = t i x i ). Let us renumber the coordinates in such a way that t i = 1 for i ≤ k and t k+1 = . . . = t n = 1.
Then the proof of [27,Lem. 2.5.3] gives an isomorphism where H(w t ) is the space (3.8) for the potential w t , the restriction of w to the subspace x 1 = . . . = x k = 0 of fixed points of w. Note that w t still has isolated singularity (see [27,Lem. 2.5.3](i)). More explicitly, the isomorphism (3.9) is induced by the projection from the term R e ⊗ n−k (V ) to R/(x 1 , . . . , x k ) ⊗ e k+1 ∧ . . . ∧ e n (which factors through the restriction to ∆ ∩ Γ t ). Now letĒ = (E, δ E ) be a matrix factorization of w. The computation of the generalized boundary-bulk map τĒ t * : Hom(Ē, t * Ē ) → Tr(t * ) ≃ H(w t ) (3.10) is very similar to the computation of the equivariant Chern character in [27,Sec. 3]. By definition, we have to take the restriction to the diagonal of the morphism cĒ t * = (id ×t) * cĒ, where with the components D j (i 1 , . . . , i j ) ∈ End(U ) ⊗ R e and D 0 = 1 ⊗ id U , we obtain a system of equations on these components with the unique solution such that D j (i 1 , . . . , i j ) does not depend on y r with r < i 1 (see [27,Lem. 3.2.1]). The morphism (id ×t) * cĒ corresponds to the element where the latter identification uses the action of id ×t on R e . As the description of the isomorphism (3.9) shows, the map τĒ t * = Tr((id ×t) * cĒ) is determined by where we view δ E as an element of End(U ) ⊗ R (see the proof of [ . . , ∂ n w t ).
Next, we want to compute the canonical pairing (2.6) between Tr(F ) and Tr(G) for the autoequivalence F = t * of MF(w). Note that in this case G = (t −1 ) * , so both Tr(F ) and Tr(G) are naturally isomorphic to the Z/2-graded space H(w t ) = H(w t −1 ). Again the calculation is very similar to that of the canonical pairing on the equivariant Hochschild homology in [27,Sec. 4.2]. Namely, it is enough to compute the corresponding Casimir tensor τ F,G ∈ Tr(F ′ ) ⊗ Tr(G), which is obtained by applying the generalized boundary-bulk map associated with F ′ 2G to the canonical morphism ∆ → (F ′ 2G)(∆) (see Lemma 2.8(ii)). In our case F ′ is the autoequivalence (t −1 ) * of MF(−w), so F ′ 2G is the autoequivalence (t −1 ×t −1 ) * of MF( w). Thus, to calculate τ F,G we can apply Proposition 3.13 to the canonical isomorphism (3.11) in the homotopy category of MF( w). Note that . . , t −1 n (y n − x n )} and the morphism α is characterized uniquely (up to homotopy) by the condition that the induced map on coker(δ 10 : 1 → 0 ) is identity, where δ 10 is the component of the differential δ of the Koszul matrix factorization (see [27,Prop. 2.3.1] or [14]). We will use the following fact about Koszul matrix factorizations (that follows from the proof of [27, Lem. 2.5.5]). Lemma 3.14. Let b • = (b 1 , . . . , b r ) be a regular sequence in a local ring A, and let Then there exists an isomorphism of matrix factorizations where we denoted f i (x, y) = (t −1 × t −1 ) * ∆ i w. Now applying the above lemma we get an isomorphism (3.11) of the form α = α t • exp(h). Note that α preserves the filtration k · e j ) ⊗ R e on • (V ) ⊗ R e (since F p are ideals with respect to the exterior multiplication). Thus, the same argument as in [27,Sec. 4.2] shows the equality Proposition 3.15. Under the isomorphisms Tr(t * ) ≃ Tr((t −1 ) * ) ≃ H(w t ) the canonical pairing ·, · t * ,(t −1 ) * (see (2.6)) is given by ·, · t * ,(t −1 ) * = (1 − t 1 ) −1 . . . (1 − t k ) −1 · ·, · w t , where ·, · w t is the canonical pairing on H(w t ) = HH * (MF(w t )), given by [27, (4.6)].
In the case when 0 is an isolated fixed point of t, by Propositions 3.13 and 3.15, the holomorphic Lefschetz formula (0.2) takes the form stated in Theorem 0.1.

Remark 3.16.
Comparing the formula of Proposition 3.13 with that of [27,Thm. 3.3.3] we see that in the situation when G is a finite group of symmetries of w, andĒ is a G-equivariant matrix factorization of w, the components of the boundary-bulk map τĒ for the dg-category MF G (w) of G-equivariant matrix factorizations of w are given by α → τĒ g * (g • α), g ∈ G, where we use the action of g ∈ G on E. Similarly, comparing Proposition 3.15 with the formula for the canonical pairing on the Hochschild homology of MF G (w), we see that the latter pairing has components |G| −1 ·, · g * ,(g −1 ) * .
Elsewhere we will show that the same relations hold whenever a finite group G acts on a smooth and compact dg-category and we pass to the corresponding G-equivariant category.
In conclusion let us point out several consequences of the Lefschetz formula (0.2) in the situation considered above.
Corollary 3.17. Let w(x 1 , . . . , x n ) be an isolated singularity, t ∈ (k * ) n a diagonal symmetry of w, A andB matrix factorizations of w equipped with closed morphisms of degree zero α :Ā → t * Ā and β : t * B →B. Assume that the fixed locus of t has odd dimension (i.e., the number of coordinates of t that are equal to 1 is odd). Then the endomorphism (t * , α, β) * of Hom(Ā,B) defined by (0.1) has zero supertrace.
Proof. The map τĀ t * takes values in the Z/2-graded space Tr(t * ) ≃ H(w t ) which lives in odd degree due to our assumption on the fixed locus of t. Hence, τĀ t * (α) = 0 and the right-hand side of the formula (0.2) vanishes in our situation.
Note that Corollary 3.17 generalizes the result conjectured by Dao [12] and proved in [27] and [7] (see also [24]) that Hom(Ā,B) has zero Euler characteristic in the case when n is odd. (1 − t i ) (3.12) in k, where α :Ā t * Ā is the Z/p-equivariant structure onĀ. We can view this as an equality in Z[ζ p ] ⊂ k, where ζ p is the primitive pth root of unity. Let tr : R Z/p → Z[ζ p ] be the homomorphism induced by taking the trace of the generator of Z/p. We claim that it restricts to an isomorphism of the ideal I ⊂ R Z/p of virtual representations of rank 0 with the ideal (1 − ζ p ) ⊂ Z[ζ p ]. Indeed, a class i=0 n i χ i ∈ R Z/p belongs to I if p−1 i=0 n i = 0. In this case and our claim follows from the fact that ( ideal is also stable under conjugation, so we derive that a is divisible by (1 − ζ p ) ⌈ n 2 ⌉ . Hence, a/(1 − ζ p ) is divisible by (1 − ζ p ) ⌈ n 2 ⌉−1 It remains to use the fact that where u is a unit in Z[ζ p ], so we can replace (1 − ζ p ) m(p−1) by p m . where d(·) is the Krull dimension. In [2] this inequality is proved in the case when R is a graded commutative algebra R, finitely generated by R 1 over R 0 = k, under certain additional assumption on a graded R-module M (e.g., if M has odd multiplicity). Our proof of Proposition 3.18 is very similar to that of Theorem 3 of [2] which essentially proves certain divisibility using Hilbert series and then deduces the lower bound from it. 2. Set R = k[[x 1 , . . . , x n ]]. Recall that there is an equivalence between the stable category of S = R/(w) and the homotopy category of matrix factorizations of w (see [6,26]), and that the matrix fac-torizationĀ = (A, δ) corresponding to a finitely generated S-module M specializes to the 2-periodic free S-resolution of a maximal Cohen-Macaulay module stably equivalent to M (cf. [15,26]). In particular, we get H * (A| 0 , δ) ≃ Tor S 2N (M, k) ⊕ Tor S 2N +1 (M, k).