clifford_t_circuit_t_count_example
Sanity check: the circuit H_0, T_0, T_1 on two qubits has T-count 2.
Statement
theorem clifford_t_circuit_t_count_example : clifford_t_circuit_t_count ([.h 0, .t 0, .t 1] : List (CliffordTGate 2)) = 2- Source
- sanity check of the definition clifford_t_circuit_t_count (arXiv:2610.01024 Sec. A.3)
- Verified
- 06 Oct 2026
- Axioms
propext- Built on 2
- clifford_t_circuit_t_countThe T-count of a Clifford+T circuit: the number of T gates in its gate list.
- CliffordTGateA gate of a Clifford+T circuit on N qubits: a Hadamard H on qubit i, a phase gate S on qubit i, a CNOT with control c and target t (c…
- Used by 1
- clifford_t_circuit_t_count_nilThe empty Clifford+T circuit has T-count 0.
The proof, explained
The statement is a sanity check asserting that the circuit consisting of an $H$ gate on qubit 0 followed by $T$ gates on qubits 0 and 1 has a T-count of 2. Because the circuit is a concrete list of gates and the T-count function is decidable and fully defined, the claim is verified by direct computational evaluation.
The T-count of the two-qubit circuit $[H_0, T_0, T_1]$ is equal to 2. automation
The function `clifford_t_circuit_t_count` counts how many gates in the list are $T$ gates. Evaluating this on the three-gate sequence $[H_0, T_0, T_1]$, the Hadamard gate $H_0$ is ignored while the two $T$ gates each contribute $1$, producing $2$. Since all expressions are concrete and computable, the `decide` tactic verifies the equality by direct computation.
theorem clifford_t_circuit_t_count_example : clifford_t_circuit_t_count ([.h 0, .t 0, .t 1] : List (CliffordTGate 2)) = 2 := by decide
- The proof is completed entirely by computation (`decide`) evaluating the recursive definition of `countP` on a concrete list.
Written by a model (gemini-3.8-flash) from the Lean source alone (no goal states were available). Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem clifford_t_circuit_t_count_example : clifford_t_circuit_t_count ([.h 0, .t 0, .t 1] : List (CliffordTGate 2)) = 2 := by decide