It looks like the second index in the lhs is not a dummy which I think is an error. 

```
>>> A, B = (X*Y)[4,2], Sum(X[4, k]*Y[k, 2], (k, 0, m - 1))
>>> A.atoms()
set([k, m, 0, n, _k, 4, 2, -1])
     __\that is a non-Dummy
>>> B.atoms()
set([m, 0, n, k, 4, 2, -1])
>>> srepr(A)
"Sum(Mul(MatrixElement(MatrixSymbol('X', Symbol('n'), Symbol('m')), Integer(4),
Dummy('k')), MatrixElement(MatrixSymbol('Y', Symbol('m'), Symbol('k')), Dummy('k
                                                             _______\there it is
'), Integer(2))), Tuple(Dummy('k'), Integer(0), Add(Symbol('m'), Integer(-1))))"

>>> k_ = A.atoms(Dummy).pop();k_
_k
>>> srepr(A.subs(k_,k))
"Sum(Mul(MatrixElement(MatrixSymbol('X', Symbol('n'), Symbol('m')), Integer(4),
Dummy('k')), MatrixElement(MatrixSymbol('Y', Symbol('m'), Symbol('k')), Dummy('k
'), Integer(2))), Tuple(Dummy('k'), Integer(0), Add(Symbol('m'), Integer(-1))))"


the Dummy symbols were not removed.
```

The dummy_eq fails (I suspect) because it uses subs rather than xreplace

```
>>> Sum(k_,(k_,1,2)).dummy_eq(Sum(x,(x,1,2)))
False
>>> Sum(k_,(k_,1,2)).xreplace({k_:x}).dummy_eq(Sum(x,(x,1,2)))
True
>>> Sum(k_,(k_,1,2)).subs({k_:x}).dummy_eq(Sum(x,(x,1,2)))
False
```