Five two-qubit gates are necessary for implementing the Toffoli gate

In this paper, we settle the long-standing open problem of the minimum cost of two-qubit gates for simulating a Toffoli gate. More precisely, we show that five two-qubit gates are necessary. Before our work, it is known that five gates are sufficient and only numerical evidences have been gathered, indicating that the five-gate implementation is necessary. The idea introduced here can also be used to solve the problem of optimal simulation of three-qubit control phase introduced by Deutsch in 1989.