Cap product for Hochschild (co)chains Let $A$ be an associative algebra and $M$ be an $A$-bimodule. Then we can form the Hochschild cochains $C^\bullet(A,A)$ and chains $C_\bullet(A, M)$ and define a pairing (cap product)
$$
  C^\bullet(A,A) \otimes C_\bullet(A, M)
  \xrightarrow{\enspace\frown\enspace}
  C_\bullet(A, M)
$$
in the following way: for $f\in C^n(A,A)$ and $g = m \otimes a_1 \otimes \dotsb \otimes a_p \in C_p(A,M)$,
$$f\frown g := 
\begin{cases}
  (-1)^n m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_n & \text{for $p \geq n$},\\
  0 & \text{for $p < n$},
\end{cases}
  $$
which is an element of $C_{n-p}(A, M)$.
There is the following simple assertion:
Proposition. $C_\bullet(A, M)$ is a differential graded module over $C^\bullet(A, A)$ with respect to the cap product, i.e.,
$$
  d(f \frown g) = d(f) \frown g + (-1)^{\deg(f)} f \frown d(g) \,.
  \tag{1}
$$
The reference for this is
https://pbelmans.ncag.info/assets/hh-2018-notes.pdf page 24 or http://www.math.tamu.edu/~sarah.witherspoon/pub/HH-25August2018.pdf page 17.
This looked to be an easy exercise, but even in simple cases the computations went wrong. For example, let $f \in C^1(A, A)$ and $g = m \otimes a_1 \otimes a_2 \in C_2(A, M)$. Then $f \frown g = -m f(a_1) \otimes a_2$ and the left-hand side of $(1)$ is
$$
  d(f \frown g)
  = d(-m f(a_1) \otimes a_2)
  = -(m f(a_1) a_2 - a_2 m f(a_1))
  = a_2 m f(a_1) - m f(a_1) a_2 \,.
$$
At the same time, the right-hand side is
\begin{align*}
  {}&
  d(f) \frown g + (-1)^{\deg(f)} f \frown d(g) \\
  ={}& m \cdot d(f)(a_1 \otimes a_2) - f \frown (m a_1 \otimes a_2 - m \otimes a_1 a_2 + a_2 m \otimes a_1) \\
  ={}& m a_1 f(a_2) - m f(a_1 a_2) + m f(a_1) a_2 + m a_1 f(a_2) - m f(a_1 a_2) + a_2 m f(a_1) \\
  ={}& 2 m a_1 f(a_2) - 2 m f(a_1 a_2) + m f(a_1) a_2 + a_2 m f(a_1) \,.
\end{align*}
These two expressions obviously do not coincide.
Where I was wrong?
Edit. It seems that there is a sign mistake in the definition of the cap product given above and the right definition should be
$$
  f \frown g := m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_n \,.
$$
 A: I will do the computation using bar symbols.
(It is really hard from here to understand why the author in loc. cit.
prefers the many tensors. Notations are important to fix the calculus.)
There are always sign conventions from textbook to textbook,
here i am doing the computations barely without checking the reference.
We have for $f$ of degree one, and $g=m[a|b]$ the following
computation using bar symbols:
$$
\begin{aligned}
g &= m[a|b]\ ,\\
f\frown g
& =mf(a)[b]\ ,\\[2mm]
d(f\frown g)
&= -mf(a)d[b] \\
&= -mf(a)\; (b[]-[]b) \\
&= -mf(a)b[] +mf(a)[]b\\
&= -\color{blue}{mf(a)b[]} +\color{red}{bmf(a)[]}\\
&\qquad\text{and here is the sense for the bar symbols,}\\[2mm]
\underbrace{df}_{\in C^2}\frown g
&= df\frown m[a|b]\\
&= m\;df[a|b]\\
&= m\;fd[a|b]\\
&= m\;f\;(a[b]-[ab]+[a]b)\\
&= m\;(af(b)[]-f(ab)[]+\color{red}{f(a)[]b})\\[2mm]
f\frown dg
&= f\frown m\; d[a|b]\\
&= f\frown m\; (a[b]-[ab]+[a]b)\\
&= m\; (af(b)[]-f(ab)[]+\color{blue}{f(a)b[]})\\
\end{aligned}
$$
Subtracting the two terms $df\frown g$ and $f\frown g$ from each other
produces the cancellation of the unmarked terms, and the red/blue term in
the result corresponds to the one in $d(f\frown g)$.
Here, we use the convention that scalars after the bar symbol, e.g. as in
$mf(a)[]b$ can be "cyclically" moved in front (via the tensor product of that $A^e=A\otimes A^{\text{opp}}$,
from the opp-part) to the $m\in M$, which has as structure of bimodule.
(It is hard to do cyclic (co)homology without a notation supporting the cyclicity.)
A: We have that
\begin{equation}
\tag{$\ast$}
    d(f \cap g)
  = (-1)^n d(f) \cap g + (-1)^n f \cap d(g)
  = (-1)^{|f|} \Bigl( d(f) \cap g + f \cap d(g) \Bigr).
\end{equation}
for all $f \in \operatorname{C}^n(A) = \operatorname{Hom}_k(A^{\otimes n}, A)$ and $g \in \operatorname{C}_p(A, M) = M \otimes A^{\otimes p}$ (the computation is at the end of this post).
From what I understand this may or may not be a problem, depending on what we are planning to do:

*

*The equation $(\ast)$ sufficies to show that the cup product descends to a well-defined bilinear map $\operatorname{HH}^\bullet(A) \times \operatorname{HH}_\bullet(A,M) \to \operatorname{HH}_\bullet(A,M)$, (nearly) making $\operatorname{HH}_\bullet(A,M)$ into a graded $\operatorname{HH}^\bullet(A)$-module as claimed in Witherspoon’s text (see below for a possible problem).


*From what I understand the Hochschild chain complex $\operatorname{C}_\bullet(A,M)$ does not become a dg $\operatorname{C}^\bullet(A)$-module as we would instead need the sign convention
\begin{equation*}
\tag{$\ast\ast$}
  d(f \cap g) = d(f) \cap g + (-1)^n f \cap d(g).
\end{equation*}
But I need to point out that there are some things about the cap product which confuse me, and the correct understanding of which may show that there are actually no problems.

*

*It seems that both Witherspoon and Belmans try to define a left module structure on $\operatorname{C}_\bullet(A,M)$ and $\operatorname{HH}_\bullet(A,M)$ via the cap product (where $\operatorname{C}^\bullet(A)$ and $\operatorname{HH}^\bullet(A)$ are equipped with the cup product).
But it seem to me that
$$
    (f_1 \cup f_2) \cap g
  = f_2 \cap (f_1 \cap g),
$$
so that the cap product actually defines a right module structure.
(Maybe this is no problem for the Hochschild (co)homology because the cup product is graded-commutative on $\operatorname{HH}^\bullet(A)$?)


*Because $\operatorname{C}^\bullet(A)$ is a cochain complex but $\operatorname{C}_\bullet(A,M)$ is a chain complex there might be some more signs hidden in the definition of an dg module (as both differentials go in different directions).
I suspect that we want that the flipped complex $\widetilde{\operatorname{C}}^\bullet(A,M) = \operatorname{C}_{-\bullet}(A,M)$ to be dg $\operatorname{C}^\bullet(A)$-module with the sign convention as in $(\ast\ast)$, which would then mean that we always want the sign convention $(\ast\ast)$.

Now the calculations:
To show $(\ast)$ we start by computing the terms $d(f \cap g)$, $f \cap d(g)$ and $d(f) \cap g$.
For $n \leq p$ all three terms are zero, so let’s only look at $n > p$.
Let’s also assume that $g$ is a pure tensor $g = m \otimes a_1 \otimes \dotsb \otimes a_p$.
First term:
\begin{align*}
   &\,
       d( f \cap  (m \otimes a_1 \otimes \dotsb \otimes a_p ) )
  \\
  =&\,
       (-1)^n d( m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_p )
  \\
  =&\, (-1)^n \Big[
           m f(a_1 \otimes \dotsb \otimes a_n) a_{n+1} \otimes a_{n+2} \otimes \dotsb \otimes a_p
  \\
   &\, \phantom{(-1)^n \Big[}
          + \sum_{i=1}^{p-n-1} (-1)^i
           m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_{n+i} a_{n+i+1} \otimes \dotsb \otimes a_p \\
   &\, \phantom{(-1)^n \Big[}  
          + (-1)^{p-n} a_p m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_{p-1}
       \Big]
  \\
  =&\,   (-1)^n m f(a_1 \otimes \dotsb \otimes a_n) a_{n+1} \otimes a_{n+2} \otimes \dotsb \otimes a_p
       \tag{1}
  \\
   &\, + (-1)^n \sum_{i=1}^{p-n-1} (-1)^i
         m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_{n+i} a_{n+i+1} \otimes \dotsb \otimes a_p
       \tag{2}
  \\
   &\, + (-1)^p a_p m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_{p-1}
       \tag{3}
\end{align*}
Second Term:
\begin{align*}
   &\,
       d(f) \cap (m \otimes a_1 \otimes \dotsb \otimes a_p)
  \\
  =&\,
       (-1)^{n+1} m \, d(f)(a_1 \otimes \dotsb \otimes a_{n+1}) \otimes a_{n+2} \otimes \dotsb \otimes a_p
  \\
  =&\,
       (-1)^{n+1} m
       \Big[
           a_1 f (a_2 \otimes \dotsb \otimes a_{n+1})
  \\
   &\, \phantom{(-1)^{n+1} m \Big[}
         + \sum_{i=1}^n (-1)^i f(a_1 \otimes \dotsb \otimes a_i a_{i+1} \otimes \dotsb \otimes a_{n+1})
  \\
   &\, \phantom{(-1)^{n+1} m \Big[}
         + (-1)^{n+1} f(a_1 \otimes \dotsb \otimes a_n) a_{n+1}
       \Big]
       \otimes a_{n+2} \otimes \dotsb \otimes a_p
  \\
  =&\,
         (-1)^{n+1} m a_1 f(a_2 \otimes \dotsb \otimes a_{n+1}) \otimes a_{n+2} \otimes \dotsb \otimes a_p
       \tag{4}
  \\
   &\,
       + (-1)^{n+1} \sum_{i=1}^n (-1)^i
         m f(a_1 \otimes \dotsb \otimes a_i a_{i+1} \otimes a_{n+1}) \otimes a_{n+2} \otimes \dotsb \otimes a_p
       \tag{5}
  \\
   &\,
       + m f(a_1 \otimes \dotsb \otimes a_n) a_{n+1} \otimes a_{n+2} \otimes \dotsb \otimes a_p
       \tag{1}
\end{align*}
Third term:
\begin{align*}
   &\,
       f \cap d(m \otimes a_1 \otimes \dotsb \otimes a_p)
  \\
  =&\, f \cap \Big[
           m a_1 \otimes a_2 \otimes \dotsb \otimes a_p
  \\
   &\, \phantom{f \cap \Big[}
         + \sum_{i=1}^{p-1} (-1)^i m \otimes a_1 \otimes \dotsb \otimes a_i a_{i+1} \otimes \dotsb \otimes a_p
  \\
   &\, \phantom{f \cap \Big[}
         + (-1)^p a_p m \otimes a_1 \otimes \dotsb \otimes a_{p-1}
       \Big]
  \\
  =&\,
         (-1)^n m a_1 f(a_2 \otimes \dotsb \otimes a_{n+1}) \otimes a_{n+2} \otimes \dotsb \otimes a_p
       \tag{4}
  \\
   &\, + (-1)^n \sum_{i=1}^n (-1)^i
         m f(a_1 \otimes \dotsb \otimes a_i a_{i+1} \otimes \dotsb \otimes a_{n+1}) \otimes a_{n+2} \otimes \dotsb \otimes a_p
       \tag{5}
  \\
   &\, + (-1)^n \sum_{i=1}^{p-n-1} (-1)^{n+i}
         m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_{n+i} a_{n+i+1} \otimes \dotsb \otimes a_p
       \tag{2}
  \\
   &\, + (-1)^{n+p} a_p m f(a_1 \otimes \dotsb \otimes a_n) \otimes a_{n+1} \otimes \dotsb \otimes a_{p-1}
       \tag{3}
\end{align*}
We now want to combine these three terms in an equation of the form
$$
  d(f \cap g) = \varepsilon_1 d(f) \cap g + \varepsilon_2 f \cap d(g)
$$
for suitable signs $\varepsilon_1, \varepsilon_2 = \pm 1$, which may depend on the degrees $n$ and $p$.
We get from $(1)$ that $\varepsilon_1 = (-1)^n$ and from $(2)$ that $\varepsilon_2 = (-1)^n$. This is also compatible with $(3)$, and the additional terms of the forms $(4)$ and $(5)$ cancel each other out because $\varepsilon_1 = \varepsilon_2$.
We thus find that
$$
    d(f \cap g)
  = (-1)^n d(f) \cap g + (-1)^n f \cap d(g)
  = (-1)^{|f|} \Bigl( d(f) \cap g + f \cap d(g) \Bigr).
$$
