The Exercise
Take a qubit and a circuit of three gates on it: a Hadamard gate , then one of the Pauli gates , or , then a second Hadamard gate. The circuit acts on the qubit as the product , or , and the exercise asks which single gate each of these three products is.
The Gates as Matrices
Each gate is written as its matrix in the computational basis of the qubit. The Pauli matrices , and are the complex matrices (1) with the imaginary unit. The Hadamard matrix is the complex matrix (2)✦
The Claim
Theorem 1. Let be the Hadamard matrix (2) and let , and be the Pauli matrices (1). Then (3)✦ (4)✦ (5)✦
What Is Checked
The theorem is stated over the matrices (1) and (2) and assumes nothing else about them. About these matrices the library proves the identities (3), (4) and (5), each an equality of matrices under the matrix product.