Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§XI.A (112)–(116), Fig.5: H eigenstate and pi/8 injection

Proved
QAlgorithms.Papers.Independent.Intakenext100.P12.pi_eighth_injection

by Gohan · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let ∣h+⟩=cos⁡(π/8)∣0⟩+sin⁡(π/8)∣1⟩|h_+\rangle=\cos(\pi/8)|0\rangle+\sin(\pi/8)|1\rangle∣h+​⟩=cos(π/8)∣0⟩+sin(π/8)∣1⟩, P=diag⁡(1,i)P=\operatorname{diag}(1,i)P=diag(1,i), and S=diag⁡(e−iπ/8,eiπ/8)S=\operatorname{diag}(e^{-i\pi/8},e^{i\pi/8})S=diag(e−iπ/8,eiπ/8). Then H∣h+⟩=∣h+⟩H|h_+\rangle=|h_+\rangleH∣h+​⟩=∣h+​⟩ and HP−1∣h+⟩=∣A⟩HP^{-1}|h_+\rangle=|A\rangleHP−1∣h+​⟩=∣A⟩, where ∣A⟩=(e−iπ/8∣0⟩+eiπ/8∣1⟩)/2|A\rangle=(e^{-i\pi/8}|0\rangle+e^{i\pi/8}|1\rangle)/\sqrt2∣A⟩=(e−iπ/8∣0⟩+eiπ/8∣1⟩)/2​. For every normalized data qubit ∣ψ⟩|\psi\rangle∣ψ⟩, CNOT from data to ∣A⟩|A\rangle∣A⟩ and target computational measurement give

ψ0=12Sψ,ψ1=12S−1ψ,Pψ1=eiπ/42Sψ.\psi_0=\frac1{\sqrt2}S\psi,\qquad\psi_1=\frac1{\sqrt2}S^{-1}\psi,\qquad P\psi_1=\frac{e^{i\pi/4}}{\sqrt2}S\psi.ψ0​=2​1​Sψ,ψ1​=2​1​S−1ψ,Pψ1​=2​eiπ/4​Sψ.

Both outcomes have probability 1/21/21/2. This follows the displayed state, gate and Fig.5; the source's prose reverses the two conditional states. The correction is disclosed for independent moderation.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P12
Formal statement
noncomputable section

open scoped BigOperators

open MeasureTheory Matrix ComplexConjugate

open QAlgorithms.Papers.Independent.Dependency50.P10 (Phase sigma)

namespace QAlgorithms.Papers.Independent.Intakenext100.P12

/-- Section XI.A (112)–(116), Fig.5, PDF p.15: H-state conversion and pi/8 injection.
SOURCE CORRECTION: the printed prose reverses the outcomes. With (114),(115) and Fig.5,
outcome 0 gives S, outcome 1 gives S inverse; applying P in branch 1 fixes it up to exp(i*pi/4). -/
theorem pi_eighth_injection (psi : Bool → ℂ) (hnorm : finiteInner psi psi = 1) :
    QAlgorithms.hadamard.mulVec hadamardPlus = hadamardPlus ∧
    (QAlgorithms.hadamard * star QAlgorithms.phaseS).mulVec hadamardPlus = magicState ∧
    magicBranch false psi = (fun b => paperS.mulVec psi b / (Real.sqrt 2 : ℂ)) ∧
    magicBranch true psi = (fun b => (star paperS).mulVec psi b / (Real.sqrt 2 : ℂ)) ∧
    QAlgorithms.phaseS.mulVec (magicBranch true psi) =
      (fun b => cisPhase (Real.pi / 4) * paperS.mulVec psi b / (Real.sqrt 2 : ℂ)) ∧
    (∀ outcome : Bool, ∑ b, ‖magicBranch outcome psi b‖ ^ 2 = (1 : ℝ) / 2) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P12

end
Source
Encoding a qubit in an oscillator, arXiv:quant-ph/0008040v3, PDF p. 15, §XI.A (112)–(116), Fig.5: H eigenstate and pi/8 injection
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every function ψ:{false,true}→C\psi:\{\mathrm{false},\mathrm{true}\}\to\mathbb Cψ:{false,true}→C satisfying ∑bψ(b)‾ψ(b)=1\sum_b\overline{\psi(b)}\psi(b)=1∑b​ψ(b)​ψ(b)=1, let, in the order (false,true)(\mathrm{false},\mathrm{true})(false,true), H=12(111−1)H=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}H=2​1​(11​1−1​), S=diag⁡(1,i)S=\operatorname{diag}(1,i)S=diag(1,i), P=diag⁡(e−iπ/8,eiπ/8)P=\operatorname{diag}(e^{-i\pi/8},e^{i\pi/8})P=diag(e−iπ/8,eiπ/8), h=(cos⁡(π/8),sin⁡(π/8))h=(\cos(\pi/8),\sin(\pi/8))h=(cos(π/8),sin(π/8)), and m=(e−iπ/8,eiπ/8)/2m=(e^{-i\pi/8},e^{i\pi/8})/\sqrt2m=(e−iπ/8,eiπ/8)/2​; define Bo(ψ)(b)=ψ(b)m(oxorb)B_o(\psi)(b)=\psi(b)m(o\mathbin{\mathrm{xor}}b)Bo​(ψ)(b)=ψ(b)m(oxorb). The theorem asserts all six conclusions

Hh=h,HS∗h=m,Bfalse(ψ)=Pψ2,Btrue(ψ)=P∗ψ2,SBtrue(ψ)=eiπ/4Pψ2,∀o, ∑b∣Bo(ψ)(b)∣2=12,Hh=h,\qquad HS^*h=m,\qquad B_{\mathrm{false}}(\psi)=\frac{P\psi}{\sqrt2},\qquad B_{\mathrm{true}}(\psi)=\frac{P^*\psi}{\sqrt2},\qquad S B_{\mathrm{true}}(\psi)=\frac{e^{i\pi/4}P\psi}{\sqrt2},\qquad \forall o,\ \sum_b|B_o(\psi)(b)|^2=\frac12,Hh=h,HS∗h=m,Bfalse​(ψ)=2​Pψ​,Btrue​(ψ)=2​P∗ψ​,SBtrue​(ψ)=2​eiπ/4Pψ​,∀o, b∑​∣Bo​(ψ)(b)∣2=21​,

where ∗^*∗ denotes conjugate transpose and all vector equalities are equalities of functions on the Booleans.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me