Write and let be its inclusion after the attachment. The cohomology ring of a product of two spheres is
where come from the first and second factors and is the chosen orientation class. The diagonal pulls both and back to the same generator of .
There is one new three-cell. In the cellular chain complex, its boundary has coordinates in the two-dimensional cells. Thus the relevant differential is
and the original four-cell still has zero boundary. This gives , , , and no other positive homology groups. Equivalently, the relative cohomology sequence of gives an injective restriction in degree two with image , and an isomorphism in degree four.
Choose and by , . Naturality of the cup product gives
Since restriction is injective in degree four, . All further positive-degree cup products vanish by dimension. Therefore
Changing the sign of would instead give ; the displayed sign uses the product orientation . The factor is the characteristic feature of a cup square after a diagonal sphere attachment.
Let be the pullbacks of the two orientation classes. The cohomology ring of a product of two spheres has
and generates . Write
The matrix lies in because a homeomorphism induces a cohomology ring automorphism.
If is even, graded commutativity gives
Thus . Invertibility forces to be diagonal or anti-diagonal, and its two nonzero entries must each be . Hence there are exactly eight possible actions: the signed permutation matrices.
Evenness is necessary. For , the product is the torus, and every is induced by an integral linear automorphism of the torus. For example, the infinitely many matrices give distinct actions on .