Alphabeta Math
Pipeline-generated
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Clifford+T Exact and Approximate Synthesis

1 · Prerequisites

2 · Summary

This page treats exact one-qubit Clifford+T synthesis, controlled-T with and without a clean ancilla, and ancilla-free on-the-nose Rz approximation. It fixes the exact H, T, and CNOT matrices, ordered-wire convention, dyadic cyclotomic ring, and denominator-exponent convention. Exact matrix equality, global-phase equivalence, T-count, H-count, ancilla use, approximation error, and classical input encoding remain distinct. The exact ring characterization is limited to one qubit; no multi-qubit ring criterion is asserted. The grid has finite coefficient bounds at each exponent and an efficient randomized prefix iterator. A complete factored norm solver and exact certificate checks support the oracle-optimal and conditional near-optimal searches; exhaustive alternatives establish completeness without an efficiency claim. The arithmetic-runtime guarantee retains its quantitative prime model and calibrated budgets. Arbitrary real inputs carry no implicit Turing-time guarantee.

3 · Logical flowchart

4 · Definitions, theorems and proofs

DefinitionDefinition: AI-adaptedProof: Not applicableOpen item page →

Dyadic cyclotomic ring for Clifford+T synthesis

Definition

Set ω=eiπ/4, K=Q(ω), O=Z[ω], and D=O[1/2]=Z[ω,1/2]. The relation ω4=−1 reduces every element of O to four integer coefficients in the power basis 1,ω,ω2,ω3. The canonical dyadic encoding of a nonzero z∈D is

z=(a0+a1ω+a2ω2+a3ω3)/2r,

where r≥0 is least and, if r>0, the four integers are not all even. Zero is encoded with r=0 and all four coefficients zero. Arithmetic is exact: multiply polynomials, reduce with ω4=−1, combine denominators, and remove the common power of 2 from the coefficients. The integral-basis supplier Ring of integers of every cyclotomic field and the proof of Canonical dyadic coefficient encoding ↗ justify existence and uniqueness.

Remarks

The ring D is a subring of K⊂C. All coefficients and equality tests in this page use the displayed power basis; no floating-point comparison is implicit.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Exact randomized modular square roots in expected polynomial time

Statement

Given a prime integer p and an integer a, there is an exact randomized algorithm that returns a square root of a modulo p or correctly reports that none exists. With ordinary binary integers, schoolbook arithmetic and independent unbiased random bits, its expected bit cost is polynomial in the input length; after reducing a modulo p, it is O((1+log⁡p)4). Every returned answer is correct, and the algorithm terminates with probability one. The input promise that p is prime is not a primality test.

Facts & Assumptions

Given: A prime p and an integer a in binary; random bits are independent and unbiased.

[F1]

Euler's criterion gives a(p−1)/2=(a/p) modulo an odd prime (Euler's criterion: (a/p)≡a(p−1)/2(modp)).

[F2]

Exactly half the nonzero classes modulo an odd prime are nonsquares (An odd prime has (p−1)/2 nonzero quadratic residues and as many nonresidues).

[F3]

The residue ring modulo a prime is a field (For every prime p, the two operations on Z/p make it a field).

Proof

1.1givenF1F2constructalgebra

Reduce a modulo p. If p=2, return its residue; if a=0, return zero. Otherwise [F1] rejects exactly the nonsquares by testing a(p−1)/2=−1. In the remaining case write p−1=2sq with q odd and s≥1. Repeatedly sample z uniformly from 1,…,p−1 until z(p−1)/2=−1. Uniform sampling is implemented by drawing ⌈log⁡2p⌉ bits and rejecting zero and integers at least p. Each draw is accepted with probability at least 1/4, and each accepted z is a nonsquare with probability 1/2 by [F2]; thus this search has bounded expected trials and terminates almost surely.

2.1F1F3step 1.1algebraconstruct

Set x=a(q+1)/2, t=aq, c=zq and M=s, all modulo p. Then x2=at, c has exact multiplicative order 2M, and t2M−1=1 by the tests in step 1.1. While t≠1, find the least m≥1 with t2m=1 by successive squaring; it satisfies m<M. Put b=c2M−m−1 and replace (x,t,c,M) by (xb,tb2,b2,m). The identity x2=at is preserved. The old t has order exactly 2m, so t2m−1=−1: in a field, the only roots of X2−1 are 1,−1 by factorization. Likewise b2 has order 2m and its 2m−1-st power is −1. Therefore the new t has order dividing 2m−1, while the new c has order 2m. The invariants are maintained and M strictly decreases. After at most s iterations, t=1 and x2=a. Return x.

3.1step 1.1step 2.1algebra∎

Put B=1+⌈log⁡2p⌉. Every modular integer has O(B) bits. Schoolbook multiplication and division use O(B2) bit operations; binary repeated squaring computes a power with O(B)-bit exponent in O(B) modular multiplications. These bounds follow directly by forming at most B shifted rows for multiplication and eliminating at most B quotient digits for division. Step 1.1 uses an expected bounded number of such powers. Each of the at most B iterations in step 2.1 uses at most O(B) modular multiplications to find m and compute b. Its total cost is O(B4). Initial reduction has cost polynomial in the original length of a and p. Thus the algorithm has the asserted expected bit bound; only the nonsquare search is randomized, and its outcome never changes the correctness of the final answer.

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

The nontrivial real-conjugation automorphism of the eighth cyclotomic field

Definition

Let K=Q(ω), where ω=eiπ/4. The class [5]8 is a unit modulo 8, so the cyclotomic Galois group supplier [Q(ζn):Q]=φ(n) and Gal⁡(Q(μn)/Q)≅(Z/n)× gives the unique Q-automorphism ∙ with ω∙=ω5=−ω. It fixes i=ω2 and sends 2=ω−ω3 to −2. Complex conjugation and ∙ commute, as is checked on the generator ω. The four embeddings of K are the identity, complex conjugation, ∙, and their composite, because the Galois group consists of the four maps ω↦ωj for j=1,3,5,7. Since ∙ fixes 1/2 and maps ω into Z[ω], it preserves D=Z[ω,1/2].

This is the nontrivial real-conjugation embedding used in the scaled-grid conditions; it is distinct from complex conjugation.

LemmaStatement: AI-adaptedProof: AI-adaptedOpen item page →

Canonical dyadic coefficient encoding

Statement

Every z∈D has exactly one canonical dyadic encoding specified in Dyadic cyclotomic ring for Clifford+T synthesis.

Facts & Assumptions

Given: ω=eiπ/4, O=Z[ω], and D=O[1/2].

[F1]

Ring of integers of every cyclotomic field: for n=8, 1,ω,ω2,ω3 is an integral basis of OQ(ω)=Z[ω].

Proof

1.1givenF1choose

For z∈D, its definition gives z=a/2r for some a∈O and integer r≥0. Expand a in the integral basis [F1]. Among all such exponents choose the least r; if r>0 and all four coefficients of a were even, replacing (a,r) by (a/2,r−1) would contradict minimality. This gives an encoding of the required form.

2.1givenF1step 1.1algebra∎

Suppose a/2r=b/2s are two canonical encodings. If r<s, then b=2s−ra, so every coefficient of b is even, contrary to its canonical condition because s>0. If s<r, the same argument makes every coefficient of a even. Hence r=s, and then a=b; uniqueness of the four coefficients follows from the basis property [F1]. The zero element is represented only by the all-zero numerator, and minimality forces its exponent to be 0.

Remarks

The proof uses only the integral-basis statement for n=8; it does not use unique factorization of ideals or a choice axiom.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Square root of two divisibility criterion in the eighth cyclotomic ring

Statement

For x=a+bω+cω2+dω3∈O, multiplication by 2=ω−ω3 has coefficient vector (b−d,a+c,b+d,c−a). Consequently 2 divides x in O exactly when a≡c and b≡d(mod2). Also,

xxˉ=P+2Q,P=a2+b2+c2+d2,Q=a(b−d)+c(b+d),

and 2 divides xxˉ in O exactly when 2 divides x.

Facts & Assumptions

Given: O=Z[ω], ω4=−1, and ωˉ=ω−1=−ω3.

[F1]

Dyadic cyclotomic ring for Clifford+T synthesis: O=Z[ω] and ω4=−1; the power-basis coefficients are unique.

Proof

1.1F1givenalgebra

Multiplying (ω−ω3)(a+bω+cω2+dω3) and reducing every power ωj with ω4=−1 gives (b−d)+(a+c)ω+(b+d)ω2+(c−a)ω3. By [F1], this product is in 2O exactly when all four displayed coefficients are even, which is equivalent to a+c and b+d even, or a≡c and b≡d(mod2). This proves the first criterion.

2.1F1step 1.1algebra∎

Expanding xxˉ with ωˉ=−ω3 and reducing powers gives the stated P+2Q. Write A=a+c and B=b+d modulo 2. Then P≡A+B and Q≡AB(mod2). The pair (A+B,AB) is (0,0) exactly for (A,B)=(0,0): the other three pairs give (0,1), (1,0), or (1,0). Since P+2Q is in 2O exactly when its unique power-basis coefficients are all even, equivalently when P,Q are both even, the norm is in 2O exactly when A=B=0, which by step 1.1 is exactly when 2 divides x.

Remarks

Here divisibility means divisibility by an element of O: u∣v iff v=uw for some w∈O. The parity criterion is coefficient arithmetic, not an ideal-factorization assertion.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Denominator exponent is a well-defined integer

Statement

For every nonzero z∈D, the set {k∈Z:(2)kz∈O} is nonempty and bounded below, hence has a least integer.

Facts & Assumptions

Given: z≠0 has the canonical form z=(a0+a1ω+a2ω2+a3ω3)/2r with r≥0.

[F1]

Canonical dyadic coefficient encoding: the canonical numerator has integer coefficients, is not all even when r>0, and is nonzero.

Proof

1.1F1givenalgebra

Since (2)2r=2r, multiplying z by (2)2r gives its canonical numerator in O. Hence the exponent set is nonempty.

1.2F1givenchoosealgebra

Suppose k=−m<0 belongs to that set, so z=(2)my for some y∈O. Then the numerator a=2rz=(2)m+2ry=2q(2)ϵy, where q=⌊(m+2r)/2⌋ and ϵ∈{0,1}. Multiplication by 2 has integer coefficients in the power basis, so all coefficients of a are divisible by 2q. Choose a nonzero coefficient aj; its finite 2-adic valuation bounds q above, and therefore bounds m above. Thus the negative exponents in the set are bounded below; nonnegative exponents already are.

2.1step 1.1step 1.2algebra∎

A nonempty subset of Z bounded below has a least element. Hence the set of clearing exponents has a least integer; this does not assume that the least exponent is nonnegative.

Remarks

For z=0 the exponent set is all of Z and has no least element; that is why the definition assigns −∞ separately.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Conjugate norms from the dyadic eighth-cyclotomic ring are real dyadics

Statement

Let D=Z[ω,1/2] and D+=Z[2,1/2]⊆R. For every z∈D, its complex-conjugate norm satisfies z†z∈D+. More precisely, if z=(a0+a1ω+a2ω2+a3ω3)/2r is its canonical encoding, then z†z=P+2Q22r,P=∑j=03aj2,Q=a0(a1−a3)+a2(a1+a3).

Facts & Assumptions

Given: ω=eiπ/4, 2=ω−ω3, z∈D, and scalar adjoint means complex conjugation: z†=zˉ.

[F1]

Canonical dyadic coefficient encoding: every z∈D has a canonical power-basis numerator over a power 2r.

[F2]

Square root of two divisibility criterion in the eighth cyclotomic ring: for a=a0+a1ω+a2ω2+a3ω3∈O, a†a=P+2Q with the displayed integer forms P,Q.

Proof

1.1F1givenalgebra

Write z=a/2r using [F1]. Since 2r is real, z†z=(a†a)/22r.

2.1F2step 1.1algebra∎

Substituting the exact norm formula from [F2] gives z†z=(P+2Q)/22r. Both coefficients are dyadic rationals, so this element lies in D+=Z[2,1/2] and has the claimed form.

LemmaStatement: AI-adaptedProof: AI-adaptedOpen item page →

Unit-modulus elements of the dyadic cyclotomic ring

Statement

If z∈D and zzˉ=1, then z=ωj for some j∈{0,1,…,7}.

Facts & Assumptions

Given: D=O[1/2], O=Z[ω], ω4=−1, and complex conjugation sends ω to −ω3.

[F1]

Canonical dyadic coefficient encoding: every z∈D has a unique canonical numerator a0+a1ω+a2ω2+a3ω3 over a power of 2.

[F2]

Square root of two divisibility criterion in the eighth cyclotomic ring: 2∣xxˉ in O iff 2∣x in O, and xxˉ=P+2Q with P=∑aj2 for the integer coefficients of x.

Proof

1.1F1F2givenalgebra

For nonzero z, write its canonical form z=a/2r using [F1]. If r>0, then aaˉ=22r, so 2∣aaˉ in O and [F2] gives a=2a1 for some a1∈O. Whenever aj∈O has ajaˉj=2m with m>0, the same argument gives aj=2aj+1 and aj+1aˉj+1=2m−1. Applying this for m=2r,2r−1,…,1 yields a=(2)2ra2r=2ra2r. All canonical coefficients of a are then even, contradicting the minimality of r. Thus r=0 and z∈O.

2.1F2step 1.1algebra∎

Write z=a+bω+cω2+dω3 with integer coefficients. Direct multiplication gives zzˉ=P+2Q=1, where P=a2+b2+c2+d2 and Q=a(b−d)+c(b+d) by [F2]. The numbers 1 and 2 are linearly independent over Q: if 2=m/n in lowest terms, then m2=2n2 forces m even and then n even, a contradiction. Thus P=1 and Q=0. Four integer squares sum to 1 only when exactly one coefficient is 1 or −1 and the others are zero. Hence z∈{±1,±ω,±ω2,±ω3}={ωj:0≤j<8}.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Constructive cyclotomic factorization and real unit squares

Statement

Put R=Z[2], O=Z[ω], and λ=1+2. Both rings are norm-Euclidean domains and hence unique factorization domains with effective gcd and associate tests. There is a terminating finite-search algorithm factoring every nonzero element of O into primes and a unit. The units of R are exactly ±λj (j∈Z); a unit is positive at both real embeddings if and only if it is a square of a unit of R. These assertions include effective square root recovery. No polynomial runtime bound is asserted for finite-search factorization.

Facts & Assumptions

Given: ω=eiπ/4, i=ω2, and ∙ sends ω to −ω and fixes i; † is complex conjugation.

[F1]

Canonical dyadic coefficient encoding supplies unique power-basis coordinates and exact arithmetic. The automorphisms in The nontrivial real-conjugation automorphism of the eighth cyclotomic field commute with conjugation.

Proof

1.1F1givenalgebra

For x=a+b2∈Q(2) put NR(x)=∣a2−2b2∣. For z=A+Bω with A,B∈Q(i) put NO(z)=∣A2−iB2∣2=∣z∣2∣z∙∣2. These functions are multiplicative, positive on nonzero elements, and take positive integer values on nonzero elements of their respective rings: A,B∈Z[i] for z∈O, and zz∙=A2−iB2∈Z[i]. Integer norm one is equivalent to being a unit: the converse follows by multiplicativity, and the forward implication follows by taking the product of the other conjugates divided by the norm (with a sign in R). All coordinates of that inverse remain in the ring.

1.2F1givenalgebra

The real elements of O are exactly R. Indeed, for z=a0+a1ω+a2i+a3ω3, its imaginary part is a2+(a1+a3)/2; irrationality of 2 makes this zero exactly when a2=0 and a3=−a1. The real part is then a0+a12. A real unit of O consequently is a unit of R, since its inverse is real too. Also λ−1=2−1∈R and λ∙=−λ−1.

2.1step 1.1algebraconstruct

To divide in R, round the rational coefficients of a quotient to nearest integers. Its error e=a+b2 has ∣a∣,∣b∣≤1/2, so NR(e)=∣a2−2b2∣≤1/2<1. To divide in O, express a quotient as A+Bω and round A,B to Gaussian integers. For the errors C,D, ∣C∣2,∣D∣2≤1/2, whence NO(C+Dω)=∣C2−iD2∣2≤(∣C∣2+∣D∣2)2≤1. If the last upper bound equals one, all four real coordinates of C,D are ±1/2. Then C2,D2 are purely imaginary of magnitude 1/2, so C2 and −iD2 are perpendicular and the actual norm is 1/2. Otherwise the displayed bound is already strict. Multiplicativity therefore gives a remainder of norm strictly below that of the divisor in both rings. This proves the Euclidean assertions, including ties in rounding.

2.2step 1.1step 1.2algebraconstruct

If u∈R is a unit, choose a sign and an integer power of λ to make v=±λju lie in [1,λ). Such a power exists because λ>1. Write v=a+b2. Its signed field norm is ±1, so v∙=±1/v. For norm +1, a=(v+1/v)/2∈[1,2), hence a=1; the equation a2−2b2=1 forces b=0 and v=1. For norm −1, a=(v−1/v)/2∈[0,1), hence a=0, incompatible with −2b2=−1. This proves u=±λm. Its two embeddings are positive exactly when the sign is positive and m is even. In this case λm/2 is the required real unit square root. Enumerating integer powers until the exact coefficients agree recovers m in finite time. Signs and comparisons of a+b2 are decided by signs of the rational coefficients and, when necessary, comparing a2 and 2b2.

3.1step 1.1step 2.1algebraconstruct

Repeated division terminates because nonzero remainder norms strictly decrease through positive integers. Back substitution expresses the gcd as a linear combination. If an irreducible p does not divide a, the gcd of p,a is a unit, so multiplying a Bezout identity by b shows that p∣ab implies p∣b. Thus irreducibles are prime. A nonunit has a factorization into irreducibles by induction on its norm: a proper factorization has two factors of norm at least two, each of smaller norm. The prime-divisor property and cancellation give uniqueness up to ordering and units. Divisibility is decidable by computing the quotient in the field and checking its integral coordinates; two elements are associates exactly when their quotient has integral coordinates and norm one.

4.1step 1.1step 3.1step 1.2algebraconstruct∎

Here is an explicit finite factor search, which makes the existence proof algorithmic without a primality oracle for O. For a nonunit α∈O put M=NO(α)≥2 and enumerate all power-basis integer tuples with coefficients between −(M+3) and M+3. Test whether such an element d divides α and 1<NO(d)<M; any successful d splits α into smaller-norm factors. If α is reducible, choose a nonunit proper divisor and multiply it by a power of the unit λ so 1≤∣d∣<λ. Its norm is unchanged and less than M, and ∣d∙∣=NO(d)/∣d∣≤M. Recovering power-basis coefficients from the two complex embeddings gives ∣a0∣,∣a2∣≤(∣d∣+∣d∙∣)/2 and ∣a1∣,∣a3∣≤(∣d∣+∣d∙∣)/2. They are all below λ+M<M+3, so the list contains this normalized proper divisor. Failure of the finite search therefore certifies irreducibility. Recursing on successful factors terminates by strict norm descent, and the residual norm-one elements supply the unit.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

One-dimensional quadratic grid enumeration and counting

Statement

Put λ=1+2. For bounded closed real intervals I,J, let N count α∈Z[2] with α∈I, α∙∈J, and put P=∣I∣∣J∣. There is an explicit finite proposal list containing every solution once, with constant work per proposal, of length O(N+1). If both lengths are positive its length is O(P+1), and N≥P/(4λ3) when P≥4λ3. The list has constant-size random-access data. Empty intervals give empty lists; singleton intervals are also allowed. Floor operations are specified as integer-part operations, and their comparison cost is charged separately, rather than assumed constant.

Facts & Assumptions

Given: Closed bounded intervals and exact arithmetic/comparisons on their endpoints.

[F1]

The automorphism sends a+b2 to a−b2 (The nontrivial real-conjugation automorphism of the eighth cyclotomic field).

Proof

1.1F1F2givenconstructalgebra

First suppose I=[x0,x1], J=[y0,y1] have positive lengths δ,Δ. Multiplication by the unit λr on the first embedding and by (−λ−1)r on the second is a bijection of the grid solutions. Choose the integer r so the new first length lies in [λ−1,1), reversing the second interval's endpoints when necessary. This is done by taking an integer part of a logarithm and checking the endpoint inequalities; P is unchanged. Work henceforth with the rescaled intervals. Every solution a+b2 satisfies (x0−y1)/(22)≤b≤(x1−y0)/(22). Enumerate the integers in this interval. For each b, the interval [x0−b2,x1−b2] has length less than one, so its least integer is the only possible a; retain it only if both grid inequalities hold. No solution is duplicated or missed. The number of b proposals is at most 1+(δ+Δ)/(22)=O(1+P) because λ−1≤δ<1 and Δ=P/δ. The integer endpoints and the affine formula for b give random access to proposals.

2.1F1F2step 1.1constructalgebra

Any pair of intervals whose length product is at least λ3 contains a solution. Indeed, rescale as above, this time putting the first length in [λ,λ2); the second length is then greater than or equal to λ. For the two interval centers x,y, round (x+y)/2 and (x−y)/(22) to their nearest integers a,b. Both errors ∣a+b2−x∣ and ∣a−b2−y∣ are at most (1+2)/2=λ/2, so the rounded point satisfies both constraints. If P≥4λ3, put q=⌊P/(2λ3)⌋. Divide I into q equal cells and use the concentric closed half of each cell. Each resulting interval paired with J has length product P/(2q)≥λ3. Their disjointness gives q distinct solutions, and q≥P/(4λ3). Consequently the proposal bound in step 1.1 is O(N+1), including the case P<4λ3.

3.1step 1.1step 2.1construct∎

If I is a singleton and J has length Δ, replace I temporarily by the concentric interval of length 1/(Δ+1) and test the original equality when filtering proposals. The product is at most one, so step 1.1 gives only constantly many proposals and contains all original solutions. Treat a singleton J symmetrically; if both are singletons, enlarge both to length 1/2. Empty intervals need no work. For all cases, restore the inverse unit scaling on retained points. Thus the asserted finite list and counting estimates hold without an unbounded search for a witness or a free floor oracle.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Effective simultaneous grid uprighting of paired ellipses

Statement

Let E,F be ellipses in R2, specified by their centers and positive definite symmetric matrices. Normalize their matrices separately to determinant one, obtaining D0,Δ0. Suppose the eigenvalues of both normalized matrices lie in [H−1,H], H≥2. There is a constructive real linear map G such that GZ[ω]=Z[ω], det⁡G=±1, (Gu)∙=G∙u∙, and both G(E) and G∙(F) have area at least 1/6 of their axis-aligned bounding-box area. It uses O(log⁡H) matrix/arithmetic/logarithm/exponentiation operations and O(log⁡H) integer-part operations. All real quantities to which integer parts are applied have magnitude HO(1), so implementing those parts by comparisons and binary search costs O((log⁡H)2) operations overall. The entries of G,G∙ have magnitude HO(1).

Facts & Assumptions

Given: The two normalized matrices, centers and H as in the Statement. Square roots may be evaluated as positive real exponentiation; this is an arithmetic-operation bound, not a bit-time claim about arbitrary real inputs.

Proof

1.1F1givenconstructalgebra

Put λ=1+2 and define R=12(1−111), A=(1−201), B=(1201), K=12(−λ−1−1λ1), X=(0110), Z=diag⁡(1,−1), and L=diag⁡(λ,λ−1). Express a determinant-one positive matrix as D=(eλ−zbbeλz), e=1+b2; use β,f,ζ for Δ. Define skew S=b2+β2 and bias ζ−z. For a matrix T, act on the pair by (TTDT,(T∙)TΔT∙). In real/imaginary coordinates, with s=1/2, the additive group O=Z[ω] is {(a+sb,c+sd):a,b,c,d∈Z, b≡d(mod2)}. For integer matrices P,Q, the real matrix M=P+sQ maps O into O exactly when the sum of the four entries of P is even and all four entries of Q have the same parity; applying M to (1,0),(0,1),(s,s),(−s,s) gives these conditions. In the order (sum parity of P, common parity of Q, determinant), each of R,R−1 has (even, odd, 1); each of A,A−1 has (even, even, 1); each of B,B−1 has (even, even, 1); each of K,K−1 has (even, odd, 1); X has (even, even, −1); Z has (even, even, −1); and each of L,L−1 has (even, even, 1). Thus these matrices preserve O and have the stated determinants. Their entries lie in Q(2), so [F1] gives the conjugation identity.

2.1step 1.1algebraconstruct

The extra maps in the shifted-map factorization also preserve the lattice, including their inverses. With the criterion of step 1.1, U=diag⁡(λ,1), U−1, λI, and λ−1I each have even total integer part and even entries in their s-coefficient matrix; hence all four map O into itself. Applying the same criterion to each inverse gives equality with O.

3.1F1F2step 1.1step 2.1constructalgebra

A skew-preserving temporary shift replaces (z,ζ,b,β) by (z−q,ζ+q,b,(−1)qβ), where q=⌊(1−(ζ−z))/2⌋. It puts the bias in [−1,1]. This is conjugation by σq=diag⁡(λq/2,λ−q/2) on D and by τq=diag⁡(λ−q/2,(−1)qλq/2) on Δ. If a lattice map T reduces the shifted pair, then T′=σqTσq reduces the original skew by the same factor: shifting again preserves skew and gives precisely the action of T′, whose bullet is (−τ)qT∙τq. This T′ is still a lattice map. For q=1, its entries are (λt11t12t21λ−1t22), the product λ−1Idiag⁡(λ,1)Tdiag⁡(λ,1) of lattice maps; the same argument applies to inverse shifts. Finally apply Z if necessary to make β≥0, and X if necessary to make z+ζ≥0. These preserve skew and the bias strip.

4.1step 1.1step 3.1algebra

Assume S≥15 and the normalization of step 3.1. In the central region ∣z∣,∣ζ∣≤4/5, use R. Its new off-diagonals are esinh⁡λz,fsinh⁡λζ, where sinh⁡λx=(λx−λ−x)/2. Thus S′≤S(17/15)sinh⁡λ2(4/5)<(9/10)S. For an explicit strict bound, λ4/5<21/10 follows from λ<5/2 and (5/2)4<(21/10)5, so sinh⁡λ(4/5)<341/420 and (17/15)(341/420)2<9/10.

4.2step 1.1step 3.1algebra

If b≥0, z≤3/10, and ζ≥4/5, use K. Its off-diagonal squares sum to (2b−ecosh⁡λ(z+1))2+(2β−fcosh⁡λ(ζ−1))2. Both arguments belong to [−1/5,13/10]. For c=cosh⁡λx=(λx+λ−x)/2, the inequality be≥b2 gives (2b−ec)2≤b2(2−c)2+c2, and likewise for β. On this interval 1≤c<109/60<22−1, so (2−c)2≤(2−1)2. Here the rational bound follows from λ<17/7, λ1/5<6/5, λ1/10<11/10, and λ13/10>12/5: hence c<((17/7)(6/5)(11/10)+5/12)/2<109/60. All fractional-power comparisons follow by raising positive sides to powers five or ten. Therefore S′/S≤(2−1)2+(2/15)(109/60)2<9/10. For z≥4/5, ζ≤3/10, use K∙ and exchange the two matrices.

4.3F2step 1.1step 3.1algebra

If b≥0 and z,ζ≥3/10, put c=min⁡(z,ζ), n=max⁡(1,⌊λc/2⌋) and use An. The new off-diagonals are b−2neλ−z and β−2nfλ−ζ. Expanding their squares and using be≥b2, βf≥β2 gives S′/S≤max⁡x∈{z,ζ}(1−2nλ−x)2+(8/15)n2λ−2c. If ⌊λc/2⌋≥1, then λc/4≤n≤λc/2 and c≤z,ζ≤c+1; the displayed bound is at most (1−1/(2λ))2+2/15<9/10. Otherwise n=1, λc<2, and the two arguments λ−x lie in [1/(2λ),λ−3/10]. The quadratic's maximum is at the left endpoint: λ3/10>13/10 and λ>12/5 verify the endpoint comparison. The bound is then at most (1−1/λ)2+(8/15)λ−3/5<(3/5)2+8/15<9/10.

4.4F2step 1.1step 3.1algebra

If b≤0 and z,ζ≥−1/5, put c=min⁡(z,ζ), n=max⁡(1,⌊λc/2⌋) and use Bn. Its off-diagonals are b+2neλ−z and β−2nfλ−ζ. Since be≤−b2 and βf≥β2, expansion gives S′/S≤max⁡x∈{z,ζ}(1−2nλ−x)2+(4/15)n2λ−2c. When the floor is positive, λc/(22)≤n≤λc/2, giving at most (1−1/(2λ))2+2/15<9/10. Otherwise n=1 and λ−x∈[1/(2λ),λ1/5]. The absolute value at both endpoints is less than 5/7: use 1−1/λ<3/5, 2<10/7, and λ1/5<6/5. The remaining term is below (4/15)(6/5)2=48/125, so S′/S<25/49+48/125<9/10.

5.1step 3.1step 4.1step 4.2step 4.3step 4.4algebra

These cases cover the normalized strip. If the central region fails, one coordinate exceeds 4/5: a coordinate below −4/5 would, by z+ζ≥0, force bias magnitude greater than one. When b≥0, either both coordinates are at least 3/10, or the smaller is at most 3/10 and a K case applies. When b≤0, a coordinate below −1/5 forces the other below 4/5 by the bias strip, putting both in the central region. Undo the temporary shift as in step 3.1 and repeat. Each iteration reduces S by 9/10, so after O(log⁡H) iterations S<15, since initially S≤2H2. For a determinant-one ellipse, its area-to-box ratio is π/(41+b2): its area is π and box half-widths are d,a when the matrix is (abbd). Thus the final ratios exceed π/16>1/6. The inverse cumulative map is the desired G, including translated centers.

6.1F2step 1.1step 3.1step 5.1algebra∎

To control integer parts, after every contraction balance the top-left coefficients a,α using a right action Lr with λ−2≤(a/α)λ4r≤λ2; this preserves skew. Let T be the cumulative lattice map. Each column v has some nonzero coordinate in 2−1/2Z[2], so ∥v∥2∥v∙∥2≥1/4 by its nonzero rational norm, whose absolute value is at least 1/2. Hence aα≥H−2/4, and likewise dδ≥H−2/4. Since (ad)(αδ)=(1+b2)(1+β2)≤(1+2H2)2, both products are also at most 4H2(1+2H2)2. Balancing makes a,α individually HO(1) and bounded below by H−O(1); d=(1+b2)/a and δ=(1+β2)/α have the same bounds. The quadratic forms then bound the entries of T,T∙ by HO(1). At each iteration the temporary shifts and powers in step 3.1 and step 4.1 and step 4.2 and step 4.3 and step 4.4 have exponents O(log⁡H) and values HO(1) as well. Integer parts are therefore computable by binary search within integer bounds HO(1) in O(log⁡H) comparisons each. Balancing does not alter any skew estimate or termination bound, proving the quantitative claims without a free floor oracle.

DefinitionDefinition: AI-adaptedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Smallest square root of two denominator exponent

Definition

For nonzero z∈D, define sde⁡(z)=min⁡{k∈Z:(2)kz∈O}; exponents may be negative. Set sde⁡(0)=−∞. For a matrix U, the denominator statistic used in the synthesis statements below is sde⁡(∣U00∣2), the exponent of the squared modulus of its upper-left entry. The base regime in this convention is exponent at most 3.

Remarks

The set whose minimum is taken is nonempty and bounded below for each nonzero z by Denominator exponent is a well-defined integer. This is the square-root of-two convention of Kliuchnikov–Maslov–Mosca, not an exponent of 2.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Constructive decision of the dyadic cyclotomic norm equation

Statement

For every ξ∈Z[2,1/2] there is a terminating exact algorithm deciding whether t†t=ξ has a solution t∈D=Z[ω,1/2], and returning such a solution when one exists. A supplied prime factorization of the numerator of ξ∙ξ is permissible but unnecessary for the finite-search version below. No polynomial runtime bound is asserted.

More explicitly, reject a negative real embedding; handle ξ=0 by t=0. Otherwise choose r≥0 with η=4rξ∈Z[2] and factor η into primes of O=Z[ω]. Group the prime associate classes into orbits of complex conjugation. There is a solution exactly when every conjugation-fixed class has even exponent. The conjugation-paired classes have equal exponents automatically. Allocate half of each fixed exponent, and the whole exponent to one representative of each pair, to form s. Recover a real unit v with v2=η/(s†s); then t=vs/2r is an exact solution.

Facts & Assumptions

Given: The automorphisms ∙ and † commute, and the two real embeddings are the identity and ∙ on Q(2).

[F1]

Constructive cyclotomic factorization and real unit squares proves unique factorization and a terminating factor algorithm in O, identifies O∩R=Z[2], and gives effective square roots of real units positive at both embeddings.

Proof

1.1givenalgebraconstruct

For any t∈D, both t†t=∣t∣2 and (t†t)∙=∣t∙∣2 are nonnegative. If either real embedding of ξ is negative, reject. The signs are decidable by rational arithmetic and squaring the rational coefficients of a+b2 after checking their signs. If either embedding is zero, injectivity of that embedding implies ξ=0, and the output t=0 suffices. Thus the remaining case has both embeddings strictly positive. Choose r by clearing the powers of two in the two coefficients of ξ; multiplication by the positive rational square 4r preserves their signs.

1.2F1givenalgebra

Put δ=1+ω and λ=1+2. Direct multiplication gives NO(δ)=2, δ†=ω−1δ, and δ4=2iλ2. Norm two makes δ irreducible, hence prime by [F1]. As i and λ are units, the last identity shows that 2 has just the prime associate class of δ, with multiplicity four. Every element w∈D has a unique-factorization valuation vπ(w)∈Z at each prime associate class of O, obtained from its integral numerator minus the valuations of its power-of-two denominator; only vδ(w) can be negative. Conjugation acts on these valuations by permuting the prime classes, since it is a ring automorphism. In particular, for a fixed class, vπ(w†w)=2vπ(w).

2.1step 1.1step 1.2algebra

If w†w=η∈O for w∈D, then 2vδ(w)=vδ(η)≥0, so all valuations of w are nonnegative and w∈O. To see the last implication without any assumption on units of D, write w=a/2m with a∈O; its only possible denominator class is δ, and the valuation inequality says δ4m∣a, hence 2m∣a. Consequently a solution to t†t=ξ gives an integral solution w=2rt to w†w=η. Every conjugation-fixed prime exponent of η must therefore be even. Conversely an integral solution for η gives a solution for ξ by division by 2r. This proves both necessity of the parity test and completeness of the denominator-clearing reduction.

3.1F1step 2.1algebraconstruct

Factor nonzero η by the finite algorithm of [F1]. Determine conjugation orbits by conjugating each factor and testing associates; η†=η and uniqueness of prime factorization imply that both classes in every two-element orbit occur with the same exponent. This is also an effective prime splitting test: each factor is assigned either to a fixed class or to a pair of distinct conjugate classes; no unproved classification by rational primes modulo eight is required. If a fixed exponent is odd, reject as justified in step 2.1. Otherwise, for each fixed class of exponent 2h choose its displayed prime to power h, and for each pair of exponent m choose one displayed prime to power m. Let s be the product of these choices, with empty product one. Then s†s and η have exactly the same prime-class exponents.

4.1F1step 1.1step 3.1algebraconstruct∎

Their quotient e=η/(s†s) is a unit of O by unique factorization, and is real. Its inverse is real too, so it is a unit of R=Z[2] by [F1]. Both embeddings of s†s are strictly positive, as are those of η, so both embeddings of e are positive. The unit-square construction of [F1] therefore returns v∈R with v2=e. Because v†=v, (vs)†(vs)=es†s=η, and division by 2r gives the claimed t. All loops terminate: denominator clearing is finite, factorization terminates, associate tests are exact, the factor list is finite, and square-root recovery terminates for a positive real unit. Together with the rejection cases and necessity this proves the entire decision and construction claim.

Remarks

The proof supplies a complete terminating mode. Ross–Selinger Appendix C uses rational-prime splitting and modular square-root algorithms for a faster mode. Its expected polynomial runtime is a separate complexity assertion; it does not follow from the finite-search construction here.

AlgorithmAlgorithm: AI-adaptedProof: Not applicableOpen item page →

Efficient exact-denominator Rz grid iterator

Definition

Inputs are 0<ε<1/2 and the unit vector w=e−iθ/2, in the ideal exact-real arithmetic/comparison model. Put h=ε2/2 and A={u:∣u∣≤1, Re⁡(wˉu)≥1−h},B={u:∣u∣≤1}. The outer ellipse E has center (1−h/2)w, semiaxes h in direction w and 2h perpendicular to w. Compute G simultaneously uprighting E,B by Effective simultaneous grid uprighting of paired ellipses, including its balancing operations, with H=4/ε. Retain this map for every layer. All subsequent coordinates are exact. Square roots in line/ellipse intersections are positive real exponentiation, or equivalently their comparisons can use sign tests and squared inequalities. Integer parts are obtained by bounded binary search, with their comparison cost charged.

Process denominator layers k=0,1,… in order. At k=0, enumerate the 81 coefficient tuples (a0,a1,a2,a3)∈{−1,0,1}4 in lexicographic order, form u=a0+a1ω+a2ω2+a3ω3, and retain exactly those satisfying u∈A and u∙∈B. At k≥1, run three disjoint subproblems, indexed by r∈{1,ω,1+ω}: write u=(r+2v)/(2)k,v∈Z[ω], and impose the corresponding affine constraints on v,v∙. In each subproblem apply G to v and G∙ to v∙, and replace the constraints by their affine images. Their outer ellipses are translated/scaled copies of G(E),G∙(B). For each of the two lattice cosets v′=α+iβ+sω, s=0,1, translate both constraint sets appropriately, remembering that ω∙=−ω. The unknowns α,β then lie in Z[2].

Construct a finite proposal domain for each resulting subproblem as follows. Let Ix,Iy be the coordinate intervals of its first outer ellipse's bounding box, and Jx,Jy those of its second; set Px=∣Ix∣∣Jx∣, Py=∣Iy∣∣Jy∣ and the fixed constant T=4λ3642, λ=1+2.

  • If both Px,Py≥T, use the Cartesian product of the two one-dimensional proposal lists from One-dimensional quadratic grid enumeration and counting. Filter each proposal by the original exact cap and disk inequalities after inverse transformations.
  • Otherwise take a coordinate with product less than T, enumerate and filter its one-dimensional list completely, and retain its finitely many actual coordinate solutions. For each, compute the two exact remaining-coordinate slice intervals of the transformed cap and disk. Each is the intersection of a quadratic interval and a linear half-line; compute it by the quadratic formula and sign tests, declaring it empty when appropriate. Use the one-dimensional proposal list on these slice intervals, including its singleton rule, and test both original constraints. Before normalizing a positive first slice width δ with second width Δ, if δ<1/(Δ+1), enlarge that first interval concentrically to width 1/(Δ+1) and retain the original slice inequalities as filters; its new length product is at most one. For singleton second intervals first use the singleton enlargement of the one-dimensional lemma. This padding prevents arbitrarily small slice widths from causing an unbounded unit-rescaling exponent.

Each component is a Cartesian index range or one of finitely many one-dimensional ranges. Keep their lengths and prefix sums, so a domain index specifies one proposal without materializing a long list. Map a retained point back to u. Maintain a set of already emitted exact coefficient tuples for the current layer.

To stream the layer, interleave a random proposal attempt with the next index of an exhaustive sequential scan. For domain size M>0, a random attempt draws q=⌈log⁡2M⌉ unbiased bits and treats them as an integer z. If z<M, visit proposal z; otherwise omit the random visit on this iteration. In either case advance the exhaustive scan by one index. Thus accepted random visits are uniform and a random attempt is accepted with probability at least 1/2, while rejection cannot block the exhaustive scan. At each visit emit its retained u if not already emitted. Stop the layer once the sequential scan finishes, then discard its emitted set and advance to k+1. For an empty proposal domain advance immediately. This is a randomized within-layer order with deterministic finite-layer completion; it promises no lexicographic tie order. The enumeration and its complexity are established in Complete scaled-grid enumeration with expected polynomial prefix cost ↗.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Finite coefficient bounds for the scaled cyclotomic grid

Statement

Let ∙ be the automorphism of K=Q(ω) defined in The nontrivial real-conjugation automorphism of the eighth cyclotomic field, so ω∙=−ω=ω5, and let u∈D∖{0} satisfy ∣u∣≤1 and ∣u∙∣≤1. Then k=sde⁡(u)≥0. If a=(2)ku=a0+a1ω+a2ω2+a3ω3, then

∣aj∣≤2k/2(0≤j≤3).

Thus for each fixed k only finitely many coefficient vectors can occur; the integer search may be restricted to ∣aj∣≤⌊2k/2⌋.

Facts & Assumptions

Given: K=Q(ω) has the four embeddings σj(ω)=ωj for j=1,3,5,7, complex conjugation pairs σ1 with σ7 and σ5 with σ3, and sde⁡ is the least square-root-of-two exponent.

[F1]

Dyadic cyclotomic ring for Clifford+T synthesis: O=Z[ω] has unique power-basis coefficients and D=O[1/2].

[F2]

The nontrivial real-conjugation automorphism of the eighth cyclotomic field: ∙ is the field automorphism ω↦ω5=−ω, fixes i, commutes with complex conjugation, and preserves D.

[F3]

Conjugate norms from the dyadic eighth-cyclotomic ring are real dyadics: for x=a0+a1ω+a2ω2+a3ω3∈O, xxˉ=P+2Q with P,Q∈Z.

Proof

1.1givenF2F3algebra

The two inequalities ∣u∣,∣u∙∣≤1, together with their complex conjugates, give ∣σj(u)∣≤1 for all four embeddings j=1,3,5,7; these are the identity, complex conjugation, ∙, and their composite by [F2]. If k=−m<0, the definition of k gives x=(2)ku=(2)−mu∈O, so u=(2)mx. Thus ∣σj(x)∣≤2−m/2 for every j. By [F3], xxˉ=P+2Q with P,Q∈Z. Since ∙ negates 2 and commutes with conjugation, the product of all four embeddings is ∏j=1,3,5,7σj(x)=(xxˉ)(x∙x∙‾)=(P+2Q)(P−2Q)=P2−2Q2. It is a nonzero integer because x≠0 and each embedding is injective. Its modulus is at most 2−2m<1, a contradiction. This proves k≥0.

2.1F1step 1.1algebra∎

For k≥0, set a=(2)ku∈O. Then ∣σj(a)∣≤2k/2 for every j. Fourier inversion in the power basis gives ar=14∑j∈{1,3,5,7}σj(a)ω−jr: expanding the sum, the coefficient of as is 14∑j oddωj(s−r), which equals 1 for s=r and 0 for distinct r,s∈{0,1,2,3}. Therefore ∣ar∣≤14∑j∣σj(a)∣≤2k/2. Since ar is an integer, it lies in the stated finite interval.

Remarks

This proves a finite search bound, not a running-time bound for deciding exact real inequalities at an arbitrary real input angle. The norm-equation step of Cyclotomic scaled grid and norm-equation solver is a separate procedure with its own locally proved correctness and complexity suppliers.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Squared entry denominator bound

Statement

For nonzero z∈D, write s=sde⁡(z). There is m∈{0,1} such that sde⁡(∣z∣2)=2s−m. In particular, if sde⁡(∣z∣2)≤3, then sde⁡(z)≤2.

Facts & Assumptions

Given: O=Z[ω], 2=ω−ω3, and the exponent is the least integer power placing an element in O.

[F1]

Square root of two divisibility criterion in the eighth cyclotomic ring: for x=a+bω+cω2+dω3, 2∣x iff a+c and b+d are even, and xxˉ=P+2Q with P≡(a+c)+(b+d) and Q≡(a+c)(b+d)(mod2).

Proof

1.1givenF1algebra

Put s=sde⁡(z) and x=(2)sz∈O. Minimality of s implies 2∤x, since otherwise x=2y with y∈O would make (2)s−1z=y∈O.

2.1F1step 1.1algebra

Write x=a+bω+cω2+dω3 and set A=a+c, B=b+d. By [F1], 2∤x means (A,B) is not (0,0) modulo 2. The two congruences P≡A+B and Q≡AB show that P,Q are not both even: among the three nonzero pairs (A,B)∈{0,1}2, the pair (A+B,AB) is never (0,0). For P+2Q, divisibility by (2)2=2 is equivalent to both coefficients P,Q being even. Hence xxˉ is divisible by 2 at most once.

3.1step 2.1algebra

Let m∈{0,1} be the number of factors 2 dividing xxˉ; write xxˉ=(2)my with y∈O and 2∤y. Since ∣z∣2=(xxˉ)/(2)2s, its least denominator exponent is 2s−m: multiplying by that power gives y, while any smaller exponent leaves a denominator because 2∤y. Thus sde⁡(∣z∣2)=2s−m.

4.1step 3.1givenalgebra∎

The hypothesis gives 2s−m≤3 and m≤1, so 2s≤4 and s≤2.

Remarks

The zero case is excluded in the statement; for z=0 both denominator exponents have the stipulated value −∞ and the implication also holds.

CorollaryStatement: AI-adaptedProof: AI-adaptedOpen item page →

Prime norm numerators congruent to one modulo eight are solvable

Statement

Let ξ∈Z[2,1/2] be positive at both real embeddings. If ξ∙ξ=p/2ℓ with ℓ≥0 and a rational prime p≡1(mod8), then t†t=ξ has a solution in Z[ω,1/2]. The complete finite-time norm solver returns a solution on every such input. The same conclusion holds when ξ∙ξ=1/2ℓ. No runtime bound is implied.

Facts & Assumptions

Given: p,ℓ,ξ as above; O=Z[ω], δ=1+ω, and λ=1+2.

[F1]

Constructive decision of the dyadic cyclotomic norm equation: after clearing a rational square denominator, solvability is equivalent to even exponents at all conjugation-fixed prime classes. Its proof gives δ prime, δ†∼δ, and δ4=2iλ2.

[F2]

Constructive cyclotomic factorization and real unit squares supplies unique factorization, effective associates and real unit correction.

[F3]

First supplement: (−1/p)=(−1)(p−1)/2 implies that −1 is a square modulo every prime congruent to one modulo four.

Proof

1.1F1F2givenalgebrachoose

Choose r large enough that η=4rξ∈Z[2] and a=4r−ℓ≥0. Then η∙η=2ap. Any prime π of O dividing η divides the rational integer 2ap, hence divides 2 or p by the prime-divisor property. The only prime class over 2 is that of δ, by [F1].

1.2F2F3givenalgebraconstruct

No prime π dividing p has a conjugation-fixed associate class. Indeed, choose an integer b with b2≡−1(modp) by [F3], so π∣(b+i)(b−i). Thus π divides at least one of b+i,b−i. If its conjugate were associate to itself, conjugating this divisibility would make it divide both factors, and hence 2i. Since i is a unit, π∣2i implies π∣2. As p is odd, 1=2((p+1)/2)−p with (p+1)/2∈Z. Thus π∣1, a contradiction. The required b can also be found by the finite search 0≤b<p.

1.3F1F2algebra

Every nonzero element of Z[2] has even δ-valuation in O. To prove this, direct multiplication gives δ2=2 ωλ, so vδ(2)=2 and vδ(2)=4. An odd integer c0 is not divisible by δ: since 1=2((c0+1)/2)−c0 and δ∣2, divisibility of c0 by the prime δ would imply δ∣1. Hence, for each nonzero integer c, writing c=2rc0 with c0 odd gives vδ(c)=4r=4v2(c). For nonzero integers c,d, the summands of c+d2 therefore have valuations 4v2(c) and 4v2(d)+2. Their residues modulo 4 are distinct, so the valuation of their sum is their minimum: after factoring out the lower power, the remaining lower-valuation term is nonzero modulo δ, whereas the other is zero. This minimum is even. When a coefficient is zero, the valuation of the remaining summand is even as well. Apply this to η to conclude that its δ-exponent is even.

2.1F1step 1.1step 1.2step 1.3

By steps 1.1 and 1.2, the only possible conjugation-fixed prime class in η is δ, and step 1.3 proves its exponent is even. The criterion of [F1] therefore constructs a solution, and its complete terminating solver returns one.

3.1F1F2step 1.1step 1.3algebra∎

If the norm numerator is 1, clear the denominator as in step 1.1; then η∙η=2a. Every prime divisor of η therefore lies in the sole class δ. Its exponent is even by step 1.3, so [F1] again constructs and returns a solution. This includes ℓ=0, where a positive real unit is corrected by the same unit-square step.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Efficient exact cyclotomic norm solving with a supplied integer factorization

Statement

Put R=Z[2], O=Z[ω], and D=O[1/2], with ω=eiπ/4. Given ξ∈R[1/2] and a valid complete rational-prime factorization of the nonzero numerator n in the reduced fraction ξ∙ξ=n/2ℓ, there is an exact randomized algorithm returning t∈D with t†t=ξ, or correctly reporting that no such t exists. Zero input requires no factorization. The algorithm terminates almost surely and has expected bit cost polynomial in the total binary length L of the explicitly encoded rational coefficients of ξ and the supplied factorization. Denominators are ordinary binary integers, not compressed exponent encodings. The algorithm does not compute or verify rational primality of the promised prime factors.

In particular, suppose 0≤ξ,ξ∙≤1, and k is the least nonnegative integer with (2)kξ∈R. Given the factorization of n, the expected cost, including exact solution recovery or a correct negative answer, is polynomial in k+1 when ξ is supplied in reduced coefficient form. For a grid candidate u∈D with least 2-denominator exponent h, its residual ξ=1−u†u has least exponent at most 2h. Under the same embedding bounds, n≤4h and the residual solver has expected cost polynomial in h+1. The unrestricted cost includes the bit length of the coefficients, rather than depending on log⁡n alone.

For the stated grid residual with n prime, or n∈{0,1}, a concrete schoolbook implementation of this algorithm has expected bit cost at most P(h)=2200(h+1)20. This explicit bound includes input reading in reduced coefficient form and exact verification of a returned solution. Bit cost counts Boolean operations and bit reads/writes on binary arrays; multi-bit arithmetic is performed by the schoolbook loops detailed below. It gives a numerical cap for interrupted attempts; it makes no correctness or termination assertion about calling prime-specific branches with a composite integer falsely presented as prime.

Facts & Assumptions

Given: Binary rational coefficients for ξ, the stated factorization promise, and independent unbiased random bits; arithmetic is ordinary bit arithmetic.

[F1]

The rings R,O are norm-Euclidean unique factorization domains. Their rounding divisions, exact divisibility tests and unit tests are constructive; R has units ±λj, where λ=1+2, and a real unit positive at both embeddings is λ2j (Constructive cyclotomic factorization and real unit squares).

[F2]

For η∈R positive at both embeddings, factorization into O-prime classes decides s†s=η: every conjugation-fixed class must have even exponent; paired classes have equal exponents. Allocating half of each fixed exponent and one entire member of each pair leaves a totally positive real unit for correction. Denominator clearing by η=4rξ is complete. Its proof gives δ=1+ω prime, δ4=2iλ2, and that its class is the only prime class over 2 (Constructive decision of the dyadic cyclotomic norm equation).

[F3]

The modular-root algorithm returns exact roots or certifies their absence in expected polynomial bit time (Exact randomized modular square roots in expected polynomial time). For odd primes, −1 is a square exactly modulo p≡1(mod4), 2 is a square exactly modulo p≡1,7(mod8), and quadratic characters multiply (First supplement: (−1/p)=(−1)(p−1)/2, Second supplement: (2/p)=(−1)(p2−1)/8, The Legendre symbol is multiplicative for all integer numerators).

[F4]

Residues modulo a rational prime form a field; a polynomial quotient over a field is a field exactly when its defining polynomial is irreducible (For every prime p, the two operations on Z/p make it a field, For a nonconstant p in F[x], the ideal (p) is maximal and F[x]/(p) is a field exactly when p is irreducible).

Proof

1.1givenF2algebraconstruct

Reject if either real embedding of ξ is negative, and return zero if ξ=0. Signs of a+b2 are determined by coefficient signs and comparison of a2 with 2b2, so these are exact polynomial bit operations. A zero real embedding implies ξ=0 by injectivity. Otherwise both embeddings are positive. Clear a rational square denominator by choosing the least r≥0 with η=4rξ∈R. Since the input uses explicit denominators, r=O(L) and η has O(L)-bit coefficients. Its positive rational norm is NR(η)=24r−ℓn, so its factorization is obtained from the supplied one by adjoining the known factor 2. All its prime factors and their multiplicities have total size polynomial in L.

2.1F1step 1.1algebra

Here are polynomial bit gcd and associate procedures for [F1], with coefficient growth controlled. Use NR(a+b2)=∣a2−2b2∣ and NO(z)=∣z∣2∣z∙∣2. The real coefficient-rounding error has norm at most 1/2. Write the cyclotomic rounding error as C+Dω, where C=x+iy, D=z+it and ∣x∣,∣y∣,∣z∣,∣t∣≤1/2. Put S=∣C∣2+∣D∣2. If S≤9/10, then NO(C+Dω)=∣C2−iD2∣2≤S2≤81/100. If S>9/10, each of the four squared real coordinates exceeds 3/20, since the other three sum to at most 3/4. Thus ∣Re⁡C2∣,∣Re⁡D2∣<1/10 and ∣Im⁡C2∣,∣Im⁡D2∣≤1/2. Expanding the square gives ∣C2−iD2∣2≤∣C∣4+∣D∣4+2(∣Re⁡C2∣∣Im⁡D2∣+∣Im⁡C2∣∣Re⁡D2∣)≤1/2+1/5=7/10. Hence every cyclotomic remainder contracts the norm by at most ρ=81/100. As (81/100)4<1/2, every four nonzero divisions halve the norm. This explicit estimate needs no compactness premise.

3.1F1step 2.1algebraconstruct

Before and after each division, balance any nonzero remainder z by multiplying it by a power of λ, which changes neither its norm nor the generated principal ideal. In R arrange NR(z)≤∣z∣<λNR(z); in O arrange NO(z)1/4≤∣z∣<λNO(z)1/4. The other embedding then has comparable magnitude, since their absolute product is respectively NR(z) or NO(z). The fixed inverse linear conversion from embeddings to power-basis coordinates bounds every balanced coefficient by a constant times NR(z)1/2 or NO(z)1/4. All comparisons can be performed without numerical approximations by squaring and comparing elements of Q(2). For inputs with B-bit coordinates, the initial norm has O(B) bits, and its nonzero conjugates are bounded above by 2O(B) and below by 2−O(B) using their integer product. Hence initial balancing uses O(B) unit multiplications. Thereafter all balanced coordinates and each exact quotient have O(B) bits; division in the fixed-degree number field uses a fixed number of rational operations. Rounding produces O(B)-bit remainders, whose balancing again uses O(B) multiplications. Step 2.1 bounds the number of divisions by O(B). This proves polynomial bit cost for gcds; exact quotient and associate tests have polynomial cost as well. Units used in balancing do not affect any gcd ideal.

4.1F1F3F4step 1.1step 3.1algebraconstruct

Recover all R-prime classes above each odd rational prime p in step 1.1 as follows. If p≡3,5(mod8), the polynomial X2−2 has no root by [F3], so R/(p)=Fp[X]/(X2−2) is a field by [F4], and p is already prime in R. If p≡1,7(mod8), compute b2=2(modp) using [F3]. Evaluation at the two distinct roots b,−b identifies R/(p) with Fp×Fp: interpolation of a linear polynomial gives the inverse, since 2b is invertible. The gcds π+=gcd⁡R(p,2−b) and π−=gcd⁡R(p,2+b) generate the preimages of the two component kernels. Their quotients are fields, so these gcds are nonassociate primes, and the component description shows (π+π−)=(p). These procedures give every R-prime over p and use the modular-root algorithm and polynomial gcds of step 3.1.

5.1F1F3F4step 3.1step 4.1algebraconstruct

For an odd p and an R-prime π just obtained, put E=R/(π). Because 2 is invertible modulo π and ω=(2/2)(1+i), there is an explicit isomorphism O/(π)=E[i]=E[T]/(T2+1): the displayed formula expresses ω in the right-hand ring, and i=ω2 expresses its inverse map. If p≡7(mod8), then E=Fp and T2+1 is irreducible by [F3]. Thus O/(π) is a field, and π is prime also in O; its class is fixed by conjugation because π is real. If p≡1,5(mod8), compute b2=−1(modp) and put h=b+i. If p≡3(mod8), compute b2=−2(modp) and put h=b+i2; the root exists since both characters of −1 and 2 are −1 by [F3]. In these cases T2+1 splits into distinct roots in E: they are ±b in the first case and ±b/2 in the second. Hence O/(π) is a product of two fields, by the same explicit interpolation as in step 4.1. The ideals generated by (π,h) and (π,h†) select the two distinct component kernels. Consequently t=gcd⁡O(π,h) and t† are nonassociate primes, with π∼t†t. This proves prime recovery and its completeness, rather than merely asserting a splitting table.

6.1F1F2step 4.1step 5.1algebraconstruct

Include δ as the sole prime class over 2 by [F2]. Step 4.1 and step 5.1 now give a finite list of all O-prime classes over the rational prime divisors of NR(η). Every prime of O dividing η appears: it divides the integer ηη∙, and the prime-divisor property of [F1] makes it divide one of those rational primes. Repeated exact division of η by the displayed generators, with associate tests to remove duplicate classes, therefore gives its full prime-class exponent list. The remaining quotient has norm one and is a unit, since otherwise unique factorization would supply a missing prime divisor. Compute conjugation orbits by conjugating the generators and testing associates. Reject exactly when a fixed class has odd exponent; otherwise form s by the allocation in [F2]. This decision and allocation are complete, including the ramified class and arbitrary multiplicities, by [F2].

7.1F1F2step 1.1step 6.1algebraconstruct

Put e=η/(s†s). By [F2], this is a real unit of R, positive at both embeddings; [F1] gives e=λ2j for an integer j. Recover its exponent by multiplying e by λ−1 while it is at least λ, or by λ while it is below 1, recording the signed number of multiplications. The resulting unit in [1,λ) is 1 by [F1], so this finds 2j exactly, including negative exponents. Set v=λj and return t=vs/2r. Then t†t=v2s†s/4r=ξ. This also states the actual unit-recovery algorithm; no search over arbitrary coefficients is used.

8.1F1F3step 1.1step 3.1step 4.1step 5.1step 6.1step 7.1algebra

All rational primes in step 1.1 have O(L) bits, and their multiplicities sum to O(L) since their product is an O(L)-bit integer. Each gcd in step 4.1 and step 5.1 is normalized as in step 3.1, so its output has O(L)-bit coefficients. The number of prime generators is at most four per rational prime. A prime in O has integer norm at least two; consequently step 6.1 uses O(L) successful divisions. Products and quotients of at most O(L) such factors have at most O(L2) coefficient bits: a product in fixed degree adds operand bit lengths plus a constant, and a field inverse is given by the product of the other conjugates divided by the integer norm. Thus s, e and the intermediate divisions have polynomial bit length. An element λj with B-bit coefficients has ∣j∣=O(B), because its two real absolute embeddings are λj and λ−j and both are bounded by 2O(B). Step 7.1 therefore takes polynomially many bit operations and produces a polynomial-size answer. Modular-root calls are the only randomized operations; their number is O(L) and each has expected polynomial cost by [F3]. This proves the full expected polynomial bit bound, without using the exhaustive factor search in [F1].

9.1givenF1step 1.1step 8.1algebra

For the bounded case, put α=(2)kξ=A+B2∈R. Both absolute embeddings of α are at most 2k/2, so ∣A∣≤2k/2 and ∣B∣≤2k/2/2. If k is even, ξ=(A+B2)/2k/2; if k is odd, ξ=(2B+A2)/2(k+1)/2. These expressions and their reductions have O(k+1) coefficient bits. Moreover ∣NR(α)∣=2kξξ∙≤2k is an integer, so the reduced nonzero numerator n is at most 2k (and hence at most 4k); its supplied prime factorization has polynomial length in k+1. Thus L is polynomial in k+1, and step 8.1 yields the asserted bounded-input complexity. For the candidate case, write u=z/(2)h with z∈O. Then (2)2hξ=2h−z†z is a real element of O, hence lies in R by [F1]; the least residual exponent is at most 2h. Applying the preceding bounds with that exponent proves n≤4h and expected polynomial cost in h+1. Zero was already handled in step 1.1. For unrestricted inputs, real units can have norm one but arbitrarily large coefficients; retaining L in the general statement is therefore necessary.

10.1givenF1step 1.1step 2.1step 4.1step 5.1step 9.1algebra

We calibrate the last bound for H=h+1≥1. The bounded residual lies in 2−hR, so write ξ=(a+b2)/2h with ∣a∣,∣b∣≤2h, by adding and subtracting its two embeddings. Using the least clearing exponent of step 1.1 gives r≤⌈h/2⌉ and η-coefficient bit lengths at most h+2. The input coefficient denominators divide 2h. For prime n=p, p≤22h; hence its bit length is at most 2h+1. The cases n=0,1 omit these prime calls. At most two real primes and four cyclotomic primes over p, together with δ, need be represented. Reusing the modular roots, at most eight modular-root calls and sixteen ring gcds cover step 4.1 and step 5.1, including harmless duplicate computations. All gcd inputs have coefficient bit lengths at most 8H: the modular roots are reduced below p, and a balanced real factor has coefficients at most 2NR(p)=2p, so converting it to the cyclotomic basis still fits this bound. The real and cyclotomic norm bounds for an integer element with b-bit coordinates are respectively 22b+2 and 24b+8, because each complex embedding has magnitude at most 4⋅2b. Step 2.1 therefore requires fewer than 32(b+2) divisions per gcd.

11.1F1step 3.1step 10.1algebra

Here is explicit storage and loop bookkeeping for these gcds. Multiplication in the power basis of O has at most four signed product terms per output coefficient, so multiplying elements with coefficient bit lengths b1,b2 gives lengths at most b1+b2+3; the real basis obeys the same bound. The other field conjugates only permute or negate coordinates. Forming x/y by multiplying x by the other three conjugates of y and dividing by NO(y) gives numerator and denominator lengths at most bx+3by+12 and 4by+12. Balanced gcd operands have lengths at most b+6, by the embedding bounds in step 3.1 and the preceding norm estimate. Thus the unbalanced integer remainder has lengths below 8(b+8). Its nonzero embeddings lie between 2−8(b+8)−2 and 28(b+8)+2, by the integer norm and the upper bound for the other embedding. Since λ>2, balancing needs fewer than 32(b+8) unit multiplications, including comparisons; during balancing each embedding stays between its initial and final values, so all coefficient lengths stay below 16(b+8). The quotient formulas keep temporary rational coordinates below 512(b+8) bits. Allowing eight fixed-degree field actions per balancing iteration and 256 for division, norm and rounding, 32(b+2) divisions, and initial balancing, fewer than 221(b+8)2 field actions suffice per gcd. Here an action means a fixed-degree field multiplication, quotient, norm, sign comparison or coordinate rounding, with their integer-operation costs expanded below.

12.1F1step 6.1step 7.1step 10.1step 11.1algebra

For the remaining work, the number of prime factors of η counted with multiplicity is at most log⁡2NO(η)≤4h+8≤16H. Balanced prime-generator coefficients have at most 32H bits, including δ. Multiplying at most 16H generators gives coefficient lengths below 210H2; successive exact divisions increase length by at most 3(32H)+12 each by step 11.1, hence stay below 212H2. The quotient e=η/(s†s) has length below 214H2. If e=λm, its two embedding bounds and λ>2 give ∣m∣<215H2, so both exponent recovery and construction of λm/2 use fewer than 216H2 unit multiplications in total. A unit multiplication increases length by at most three; monotonicity of the embedding sizes during exponent reduction, or the direct power formula during reconstruction, bounds every stored coordinate, including the returned numerator and denominator, by B=220H2 bits. Sixteen gcds with b≤8H, at most 16H successful divisions and at most one failed division per generator, at most 25 associate comparisons, and these unit loops, are together fewer than 240H4 field actions; this also includes reading, denominator clearing, allocation, and checking t†t=ξ exactly before returning. A field action can be implemented using fewer than 4096 signed integer operations and rational reductions on values of at most 4096(B+1) bits: expand the at most four coordinates, the at most three conjugate factors for inversion, and reduce each rational coordinate by the ordinary integer gcd. Binary schoolbook addition, multiplication and long division of d-bit integers take fewer than 210(d+1)2 bit steps, by their nested digit loops. An integer gcd has at most 2d+2 divisions, since every two Euclidean divisions at least halve its positive divisor. For d≤4096(B+1), 4096 such integer-gcd costs are below 263(B+1)3. Maintaining the at most four binary array-index counters costs at most 64(B+1) further bit operations per digit action, since their lengths are at most 13+⌈log⁡2(B+1)⌉≤16(B+1). Including this overhead and the rational reductions, one field action therefore costs less than 270(B+1)4 bit steps. These bounds deliberately allow more integer operations and bits than any of the displayed fixed-degree formulas require.

13.1F3step 10.1step 11.1step 12.1algebra∎

Finally, for a modular-root call with prime bit length d, the sampling implementation of [F3] uses an expected at most eight raw bit strings before finding a nonsquare: sampling accepts with probability at least 1/4, and half its accepted residues are nonsquares. Binary powering uses at most 2d modular multiplications, and the at most d order-reduction iterations use at most 4d modular multiplications each. The schoolbook bounds in step 12.1 consequently put the expected cost of one call below 220(d+1)5 bit steps, including sampling and initialization. Since d≤2H, eight calls cost less than 231H5 in expectation. The deterministic part is less than 240H4 270(220H2+1)4≤2194H12. Adding the random part gives a bound below 2195H12≤2200H20=P(h). For n=0,1 the omitted prime calls only reduce the bound. This proves the explicit majorant for the actual chosen arithmetic loops, with no timing assumption about composite inputs.

LemmaStatement: AI-adaptedProof: AI-adaptedOpen item page →

Exponent growth of the Rz scaled grid

Statement

Let θ∈R, 0<ε<1/2, and let u1,u2,… be the distinct points in G={u∈D:∣u∣,∣u∙∣≤1, Re⁡(eiθ/2u)≥1−ε2/2}, ordered by nondecreasing least denominator exponent kj. Put K=⌈log⁡2(512/ε2)⌉. Then this sequence is infinite, k2≤K, and kj≤k2+2⌈log⁡2j⌉(j≥1). More generally, if two bounded convex plane regions A,B contain disks of radii r,R>0, then for every integer k the simultaneous grid {u∈(2)−kO:u∈A, u∙∈B} has at least two points whenever 2krR≥128.

Facts & Assumptions

Given: The rings O=Z[ω], D=O[1/2], and the displayed regions and ordering.

[F1]

The nontrivial real-conjugation automorphism of the eighth cyclotomic field fixes i and sends 2 to −2; Dyadic cyclotomic ring for Clifford+T synthesis contains Z[2]+iZ[2] in O.

[F2]

Smallest square root of two denominator exponent defines least denominator exponents; Finite coefficient bounds for the scaled cyclotomic grid makes every bounded exponent layer of the two unit disks finite.

[F3]

Integer part: for every real x there is exactly one integer m with m≤x<m+1: for every real x, the integer ⌊x+1/2⌋ is within 1/2 of x.

Proof

1.1F1F3givenconstructalgebra

Write q=1+2 and C=(1+2)/2. For any integer m, the unit (using q−1=2−1 for negative m) λ=qm∈Z[2] satisfies ∣λ∙∣=λ−1. For arbitrary real x,y, solve the two real linear equations λ(a+2b)=x and λ∙(a−2b)=y for real a,b and round each to an integer by [F3]. The resulting α∈Z[2] satisfies ∣α−x∣≤Cλ and ∣α∙−y∣≤Cλ−1. Applying this independently to real and imaginary coordinates gives, for arbitrary complex centers z,w, a v∈O such that ∣v−z∣≤2Cλ and ∣v∙−w∣≤2Cλ−1.

2.1F1step 1.1choosealgebra

Set s=2k/2. Choose the integer m so that 42C/(sR)≤λ<4q2C/(sR). If s2rR≥128, then 32C2q=56+402<128 implies 2Cλ<sr/4, while 2Cλ−1≤sR/4. Apply step 1.1 to centers of disks in sA and (2)k∙B; the latter disk has radius sR, since ∣(2)k∙∣=s. Both v and v+λ lie in the first disk: their errors are bounded by sr/4 and sr/4+λ<sr/4+sr/(42C)<sr. Their bullet images likewise lie in the second disk, since the corresponding errors are at most sR/4 and sR/4+sR/(42C)<sR. Dividing by (2)k gives two distinct simultaneous grid points.

3.1F2step 2.1algebra

Put δ=ε2/2. The disk centered at (1−δ/2)e−iθ/2 with radius r=δ/2=ε2/4 lies in the unit disk and in the half plane Re⁡(eiθ/2u)≥1−δ by the triangle inequality. Take this as the disk in A and the full unit disk as B. Since 2Kr≥128, step 2.1 gives two candidates of exponent at most K. Every candidate is nonzero because its displayed real part is positive; [F2] therefore gives nonnegative exponents and finitely many candidates through each fixed exponent. In particular k2≤K.

4.1F1F2step 3.1algebra∎

If u≠v are grid points of exponent at most k2, then for every integer ℓ≥0 the 2ℓ+1 points wh=(h/2ℓ)u+(1−h/2ℓ)v, 0≤h≤2ℓ, are distinct. They have exponent at most k2+2ℓ, and both their original and bullet images lie in the required convex regions, because rational coefficients are fixed by ∙. Thus the grid is infinite. Together with finite layers this proves the existence of its stated enumeration, and taking ℓ=⌈log⁡2j⌉ gives the exponent bound.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Size and residue of the Rz candidate norm integer

Statement

Let u∈D satisfy ∣u∣,∣u∙∣≤1, put ξ=1−u†u, and write ξ∙ξ=n/2ℓ with n∈Z and least ℓ≥0. Then n≥0, and either n=0 or n≡1(mod8). If u≠0 has least square-root-of-two denominator exponent k, then n≤4k.

Facts & Assumptions

Given: The displayed u,ξ,n,ℓ and the convention z†=zˉ for scalars.

[F1]

Dyadic cyclotomic ring for Clifford+T synthesis supplies the unique integral power basis of O and its localization D.

[F2]

The nontrivial real-conjugation automorphism of the eighth cyclotomic field fixes i, negates 2, and commutes with conjugation.

[F3]

For nonzero u satisfying the two disk bounds, Finite coefficient bounds for the scaled cyclotomic grid gives k=sde⁡(u)≥0 and bounds its scaled integral coefficients. Smallest square root of two denominator exponent defines this least exponent and sets sde⁡(0)=−∞.

Proof

1.1F1F2givenchoosealgebra

Put δ=1+ω and q=1+2. Direct multiplication gives δ2=q2ω, δ4=2q2i, and δ−1=(1−ω+ω2−ω3)/2. Since q−1=2−1∈O, these identities give D=O[δ−1]. Choose the least integer h≥0 such that u=x/δh with x=aω3+bω2+cω+d∈O. Multiplying x by the displayed inverse of δ shows that x/δ∈O exactly when a+b+c+d is even: each numerator coefficient is a signed sum of the four coefficients, and all four sums have the same parity. Thus if h>0, this sum is odd.

2.1F1F2step 1.1algebra

If h=0, the two disk conditions give ∣x∣2+∣x∙∣2=2(a2+b2+c2+d2)≤2. Consequently x=0 or x=±ωj for 0≤j≤3. If h=1, the same identity and ∣δ∣2+∣δ∙∣2=4 give a2+b2+c2+d2≤2; its parity is odd by minimality, so it equals 1. Then x is again a root of unity, contradicting ∣u∙∣2=1/(2−2)>1. Thus the cases h≤1 give only u=0 (where n=1) and the eight roots of unity (where n=0).

3.1F2step 1.1step 2.1algebra

For h≥2, multiplication gives x†x=A+B2, where A=a2+b2+c2+d2 and B=cd+bc+ab−da. The odd sum of coefficients makes A odd; also B≡(a+c)(b+d)≡0(mod2) since the two factors have opposite parity. Write (δ†δ)h=(2+2)h=C+D2. Both C,D are even, since (2+2)2=6+42. It follows that ξ=(X+Y2)/(2+2)h, with X=C−A odd and Y=D−B even. Taking real conjugates gives ξ∙ξ=(X2−2Y2)/2h. Its numerator is 1(mod8), hence odd, so this denominator is already minimal. This proves the residue assertion; nonnegativity follows from 0≤ξ,ξ∙≤1.

4.1F1F2F3step 3.1algebra∎

For nonzero u, write u=v/(2)k, v∈O. Then ξ=(2k−v†v)/2k, and 2k−v†v∈Z[2] by the same multiplication as in step 3.1. Therefore 22kξ∙ξ is an integer, whence ℓ≤2k. The inequality 0≤ξ∙ξ≤1 now yields n≤2ℓ≤4k.

TheoremStatement: AI-adaptedProof: AI-adaptedOpen item page →

Complete scaled-grid enumeration with expected polynomial prefix cost

Statement

The iterator Efficient exact-denominator Rz grid iterator enumerates exactly once every u∈Z[ω,1/2] satisfying u∈A, u∙∈B, in increasing least 2 denominator exponent. Let L=1+log⁡(1/ε). Its startup costs O(L2) ideal exact-real arithmetic/comparison operations. In a layer k having N solutions, its explicit proposal domain has size M≤C(N+1) for an absolute constant C, without filtering already emitted lower-denominator points. Empty layers cost poly⁡(k+L). For 1≤j≤N, the expected work through its first j distinct outputs is O(j(1+log⁡j)poly⁡(k+L)); the rth moment of that prefix work is Or(j2rpoly⁡(k+L)r) for every fixed positive integer r. Complete-layer work is O((N+1)poly⁡(k+L)) in expectation. These are arithmetic bounds with random-bit generation charged, and do not assert bit-time bounds for unspecified real inputs or worst-case polynomial delay.

Facts & Assumptions

Given: The arithmetic/comparison and real-input contract of the algorithm, independent unbiased random bits, and exact algebraic coefficient arithmetic.

[F1]

One-dimensional intervals have the proposal and counting bounds of One-dimensional quadratic grid enumeration and counting.

[F2]

The paired-ellipse construction makes both outer ellipses at least 1/6 upright, with all map entries polynomially bounded in 1/ε (Effective simultaneous grid uprighting of paired ellipses).

[F3]

Simultaneous disk bounds give at most (2⌊2k/2⌋+1)4=2O(k+1) coefficient tuples at exponent k (Finite coefficient bounds for the scaled cyclotomic grid).

[F4]

Bullet negates 2 and sends ω to −ω (The nontrivial real-conjugation automorphism of the eighth cyclotomic field).

Proof

1.1givenF2F3F4constructalgebra

The ring O=Z[ω] has exactly four residue classes modulo 2O, represented by 0,1,ω,1+ω. Indeed 2ω=1+i and 2=ω−ω3 imply i≡1, ω3≡ω, and 2≡0. Conversely the coefficient map a0+a1ω+a2ω2+a3ω3↦(a0+a2,a1+a3) mod 2 annihilates every multiple of 2: multiplying by 2=ω−ω3 gives even sums in both coordinates. Thus those four residues are distinct and exhaustive. Consequently for k≥1 the three chosen affine subproblems describe precisely the elements of least exponent k. For k=0, the algorithm scans all 81 coefficient tuples in {−1,0,1}4; [F3] bounds every nonzero grid candidate in this layer by that box, and zero fails the cap because 1−ε2/2>0. The two further cosets Z[2]+iZ[2] and its translate by ω partition O: expand a power-basis element's real and imaginary parts and separate the parity of a1+a3. Thus all affine subproblems are disjoint. The lattice bijection [F2] and the exact filters preserve every solution, while the emitted set suppresses revisits. The exhaustive background scan makes every finite layer terminate for every sequence of random bits.

1.2givenF2constructalgebra

The cap is sandwiched between E and its concentric 1/8-dilate. In coordinates u=xw+yiw, cap points have 1−h≤x≤1 and y2≤2h, so (x−(1−h/2))2/h2+y2/(4h)≤1/4+1/2<1. Conversely the 1/8-ellipse lies in ∣x−(1−h/2)∣≤h/8, ∣y∣≤h/4, hence x≥1−h and x2+y2≤(1−3h/8)2+h/16<1 for 0<h<1/8. The normalized outer ellipse eigenvalues are 2/h and h/2, within [H−1,H] for H=4/ε; the disk matrix is the identity. Therefore [F2] applies with log⁡H=O(L). For a final normalized ellipse matrix (abbd) with b2≤15, its centered bounding box has half-widths d,a. At its box scaled by 1/8, the quadratic form is at most 2(ad+∣b∣ad)/64≤1, since ad=1+b2≤16. Each transformed cap therefore contains its outer ellipse's bounding box scaled concentrically by 1/64, and the same weaker bound holds for the transformed disk. Affine shifts, negative scalar dilations, and coset translations preserve these inclusions.

2.1F1step 1.1step 1.2algebra

At k=0 the direct coefficient scan has at most 81 proposals, hence M=O(N+1) for the number N of layer solutions. For k≥1, consider one of the at most six subproblems. If Px,Py≥T, the two inner axis rectangles from step 1.2 supply independent coordinate grid problems with length products Px/642 and Py/642. Both exceed 4λ3, so [F1] gives at least cPx and cPy solutions, with a fixed c>0. Their Cartesian product lies inside both true constraints, giving Nsub≥c2PxPy. The two outer one-dimensional proposal lengths are O(Px+1) and O(Py+1), so their product is O(Nsub). If one coordinate product is below T, its entire proposal list and filtered coordinate list have bounded length by [F1]. Each remaining exact slice gives O(Nx+1) proposals by the same result, including singleton slices. Summing over the constantly many coordinate solutions gives O(Nsub+1) proposals. Combining the at most six disjoint subproblems proves M=O(N+1). In particular an empty layer has only constantly many proposals; no exponentially large lower-denominator list is generated.

3.1F1F2F3step 1.2step 2.1constructalgebra

The bound [F2] on G and the affine scalings 2k/2 bounds all outer centers and widths above by exp⁡(O(k+L)). A nonzero outer width is bounded below by exp⁡(−O(k+L)), by the ellipse eigenvalue bounds and det⁡G=±1. Thus the integer parts in outer one-dimensional preprocessing cost O(k+L) comparisons each. There are only constantly many exact slice intervals in the small-coordinate branch. A positive slice can have arbitrarily small width, so the algorithm pads it before the [F1] normalization: replace a slice width δ smaller than 1/(Δ+1) by that value, keeping its center and filtering the original slice. Its product is at most one and it creates constantly many proposals. Otherwise δ≥1/(Δ+1), so both positive widths used for normalization are at least exp⁡(−O(k+L)), since Δ is bounded by the outer width. The same padding handles singleton slices, and an empty slice is skipped. In either branch the [F1] unit-rescaling exponents are O(k+L), all floor operands have magnitude exp⁡(O(k+L)), and the earlier O(Nx+1) bound is retained. Root and line-intersection calculations use boundedly many source arithmetic operations; sign decisions are charged exact comparisons. Finally M=O(N+1) and [F3] give log⁡(M+1)=O(k+1), so each random proposal attempt uses O(k+1) random bits and is accepted with probability at least 1/2. A balanced comparison tree on exact coefficient tuples handles the emitted set in O(log⁡(N+2))=O(k+1) comparisons per visit. Thus each proposal visit and all layer preprocessing cost poly⁡(k+L) in expectation, with polynomial moments.

4.1givenF3step 1.1step 2.1step 3.1algebra∎

Every actual solution occupies exactly one proposal index. For N≥1, after s<N distinct solutions have been drawn, an independent random attempt produces a new solution with probability at least (N−s)/(2M). Ignoring the background scan can only delay obtaining j solutions. The expected number of random draws to obtain them is at most ∑s<j2M/(N−s)≤2C(N+1)∑s<j1/(N−s)≤4Cj∑t=1j1/t, since N/(N−s)≤j/(j−s) for N≥j. This is O(j(1+log⁡j)). Moreover each waiting time is dominated by a geometric variable with success probability 1/(4C(s+1)), whose rth moment is Or((s+1)r): sum its geometric tail, or bound the sum by the integral of rxr−1exp⁡(−x/(4C(s+1))). The inequality (∑s<jxs)r≤jr−1∑s<jxsr gives the stated Or(j2r) draw-moment bound. Each random draw adds only one background visit. Independently, after at most M such pairs the deterministic scan ends the layer, bounding complete-layer work by O((N+1)poly⁡(k+L)). Combining these estimates with step 3.1 proves all complexity claims. They control prefixes as well as complete output sizes, so they do not hide a whole-layer precomputation before the first candidate.

LemmaStatement: AI-adaptedProof: AI-adaptedOpen item page →

Conditional stopping bounds for prime-tested Rz candidates

Statement

For the candidate sequence and exponents of Exponent growth of the Rz scaled grid, let Ej be success events and J=min⁡{j≥1:Ej}. Suppose there are numbers pj∈[0,1] with pj≥c/(kj+1), for a constant 0<c≤1 independent of the input, such that Pr⁡(J>j)≤∏i=1j(1−pi)(j≥1). Independent success events of probabilities pj are a sufficient special case; independence of the events is not otherwise required. Then J<∞ almost surely and, for every fixed positive integer r, E[Jr]=O((k2+1)r)=O((1+log⁡(1/ε))r). In particular E[J]=O(log⁡(1/ε)) and E[log⁡2J]=O(1+log⁡log⁡(1/ε)). The implied constants can depend on c and r, but not on θ or ε. For every fixed nonnegative integer d, E[J(1+k2+log⁡J)d] is polynomially bounded in 1+k2.

This is the explicit quantitative probabilistic assumption needed when Ross–Selinger Hypothesis 8.3 is used for a complexity claim. It is a conditional model, not an assertion of independence for a deterministic input sequence.

Facts & Assumptions

Given: The success events, joint-failure product bound, constant c, and random index J in the statement.

[F1]

Exponent growth of the Rz scaled grid gives kj≤k2+2⌈log⁡2j⌉ and k2=O(1+log⁡(1/ε)).

Proof

1.1F1givenalgebra

By [F1], choose constants a≥1 and b>0, with a=O(k2+1), so that pj≥1/(a+bln⁡j) for all j≥1. The assumed joint-failure bound and 1−x≤e−x imply Pr⁡(J>j)≤∏h=1j(1−ph)≤exp⁡(−j/(a+bln⁡j)). This upper bound tends to zero, which proves almost sure finiteness.

2.1step 1.1algebra

For j≥a, put x=j/a≥1. Since ln⁡a≤a and ln⁡x≤2x, one has a+bln⁡j≤(1+3b)ax. Hence Pr⁡(J>j)≤exp⁡(−j/a/(1+3b)) for j≥a. For an integer-valued positive random variable, summing the identity Jr=∑j=0J−1((j+1)r−jr) and using nonnegative sums gives E[Jr]=∑j≥0((j+1)r−jr)Pr⁡(J>j). The part j<a is O(ar). The remaining part is bounded by a constant times ∑j≥a(j+1)r−1e−j/a/(1+3b)=O(ar): comparison with the integral and substitution y=t/a reduce it to ar∫1∞y2r−1e−y/(1+3b) dy, which is finite by repeated integration by parts. This proves all the moment bounds.

3.1F1step 2.1algebra∎

The elementary tangent bound ln⁡x≤ln⁡μ+(x−μ)/μ for x,μ>0, with μ=E[J], gives E[log⁡2J]≤log⁡2E[J]=O(1+log⁡(k2+1)). Finally log⁡J≤J, and expansion of J(1+k2+J)d reduces its expectation to the finitely many moments in step 2.1; these are polynomial in k2+1. The stated bounds in ε follow from [F1].

DefinitionDefinition: AI-adaptedProof: Not applicableOpen item page →

Clifford+T gate library and exact matrices

Definition

Let ω=eiπ/4. The one-qubit generators and exact matrices in the ordered computational basis are

H=12(111−1),T=(100ω),T†=(100ω−1).

On basis vectors, H∣q⟩=(∣0⟩+(−1)q∣1⟩)/2 and Tk∣q⟩=ωkq∣q⟩ for q∈{0,1}.

Write S=T2=diag⁡(1,i) and Z=T4=diag⁡(1,−1). Pauli X,Y,Z are as in The Pauli matrices. On two ordered wires, CNOT⁡∣a,b⟩=∣a,b⊕a⟩; the first wire is control and the second target. A circuit is a finite chronological word of these gates at stated wire positions; its matrix is the product with later gates on the left. No extra wire or controlled-T operation is implicit.

The scalar phase ωI is an allowed Clifford phase in the one-qubit matrix-word convention. Its scalar factor is retained in exact matrix products; the convention that an overall scalar does not affect a resource count is stated separately from matrix equality. It does not grant a controlled-T operation or allow a scalar on a target wire to be discarded under control.

The exact one-qubit H/T algebra is generated by H,T,T†; S and Z are aliases for the displayed powers. The distinction between exact matrix equality and global-phase equivalence is maintained. Resource costs are supplied by Finite circuit resource accounting and remain separate from this matrix definition.

Unresolved supplier checks

The actual QC07 Pauli/gate bodies and QC08 controlled-unitary body were inspected; their displayed matrices and control-first phase convention agree with this definition. The actual QC09 resource-vector body was inspected: it defines size, depth, width, and separately declared weighted/query costs. Scalar phase remains a matrix-word convention and is not an extra QC09 gate call. The actual QC07/08 gate interfaces and QC09 resource interface agree; this is reconciliation, not acceptance of their draft content.

AlgorithmAlgorithm: AI-adaptedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Controlled T using a clean ancilla

Definition

Input two data bits a,b and a third clean work bit t=0. On the ordered register (a,b,t), apply the following chronological word:

  1. Ht.
  2. CNOT⁡b,t,Tt†,CNOT⁡a,t,Tt,CNOT⁡b,t,Tt†,CNOT⁡a,t.
  3. Tb,Tt,Ht.
  4. CNOT⁡a,b,Ta,Tb†,CNOT⁡a,b.
  5. Tt.
  6. Apply the same 15-gate word from steps 1–4 again.

The 15-gate word in steps 1–4 is the specified three-wire block. The output is the complete three-wire circuit, with no implicit fourth wire.

Remarks

The source's controlled-T construction computes ab into the clean bit, applies T there, and uncomputes. The target operation C(T) is the control-first block in Controlled Unitary Access. Its exact correctness and restoration claim is the separate proposition above.

Unresolved supplier checks

The actual QC09 syntax/denotational-semantics and QC10 Toffoli/ancilla carriers were inspected. Their ordered-wire and clean-return interfaces agree with this circuit. This is interface reconciliation, not acceptance of the supplier drafts.

DefinitionDefinition: AI-adaptedProof: Not applicableOpen item page →

Ancilla-free Rz approximation problem and T-count

Definition

For θ∈R set Rz(θ)=diag⁡(e−iθ/2,eiθ/2). Given ε>0, the on-the-nose ancilla-free approximation problem is to find a finite one-qubit Clifford+T word U such that

∥Rz(θ)−U∥op≤ε,

and minimize the number of occurrences of T or T†; the T-count of a word is this integer. An overall scalar Clifford phase ωjI, viewed under Global Phase Equivalence, is free in the resource count but remains part of the exact matrix used in the displayed norm inequality. Thus changing the representative can change feasibility even when it leaves T-count unchanged. No workspace wire is permitted. The operator norm is the finite-dimensional norm from The operator norm is zero on the zero domain and otherwise is max_{||v||=1} ||Tv||.

This defines a mathematical optimization problem for exact real inputs (θ,ε). It does not specify a bit representation or assert a Turing algorithm for arbitrary real input.

Unresolved supplier checks

The actual QC07 gate/rotation and QC09 circuit/resource bodies were inspected. The resource vector counts explicit occurrences and keeps weighted/query costs separate; this problem's T-count is the stated number of T or T† occurrences while exact matrix phase remains in the error objective. No bit encoding or Turing-time claim for arbitrary real inputs is made.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Determinants of one-qubit Clifford+T words are eighth roots

Statement

Every exact one-qubit Clifford+T matrix word, including a free scalar Clifford phase ωjI, has determinant in {ωk:k∈Z}.

Facts & Assumptions

Given: ω=eiπ/4 and a finite word from the one-qubit Clifford+T matrix alphabet.

[F1]

Clifford+T gate library and exact matrices: H has its displayed Hadamard matrix, T=diag⁡(1,ω), T†=diag⁡(1,ω−1), S=T2, Z=T4, X,Y,Z are the displayed Pauli matrices, and ωI is an allowed scalar Clifford phase.

Proof

1.1F1algebra

Direct 2×2 determinants give det⁡H=−1=ω4, det⁡T=ω, det⁡T†=ω−1, det⁡S=ω2, det⁡S†=ω−2, and det⁡X=det⁡Y=det⁡Z=−1=ω4. Also det⁡(ωjI)=ω2j. Thus every one-qubit generator has determinant an integer power of ω.

2.1F1F2step 1.1algebra∎

By [F2], the determinant of a finite product is the product of the generator determinants from step 1.1. The product is again an integer power of ω, including for the empty word, whose determinant is 1.

LemmaStatement: AI-adaptedProof: AI-adaptedOpen item page →

Clifford+T circuit entries lie in the dyadic cyclotomic ring

Statement

Every finite circuit on n ordered wires using only the matrices in Clifford+T gate library and exact matrices has all matrix entries in D.

Facts & Assumptions

Given: n≥1, chronological gate order, and the exact matrices in the gate-library definition.

[F1]

Dyadic cyclotomic ring for Clifford+T synthesis: D=Z[ω,1/2] is a subring of C and contains ω and 1/2.

[F2]

Clifford+T gate library and exact matrices: H has entries ±1/2, T,T†,S,Z have entries in {0}∪{ωj:j∈Z}, and CNOT is a computational-basis permutation matrix.

[F3]

A local gate has a unique global wire embedding: each gate occurrence acts on its named ordered wires and as identity on the complementary wires.

[F4]

Denotational semantics of a finite layered circuit: a circuit matrix is the finite product of its layer matrices, with later chronological layers multiplying on the left.

Proof

1.1F1F2F3givenalgebra

Since 1/2=2/2=(ω−ω3)/2∈D, every entry of H lies in D. The displayed diagonal gates have entries 0 or powers of ω, the scalar Clifford phases have entries powers of ω, and the displayed CNOT has entries 0 or 1, so each primitive gate matrix has entries in D by [F1] and [F2]. The embeddings in [F3] are obtained from tensoring with identity matrices and permuting factors; these operations only insert zeros and copy entries, hence preserve membership in D.

2.1F1F4step 1.1algebra∎

The product of two matrices with entries in a subring has entries that are finite sums of products in that subring. By the finite product interpretation [F4], induction on the circuit's finite gate list therefore places every entry of its matrix in D; the empty word is the identity matrix and also has entries in D.

Unresolved supplier checks

The actual QC07 matrices and the QC09 syntax, local-wire-embedding, and denotational-semantics bodies were inspected. Their ordered-factor and chronological-product conventions match the local closure argument. This is interface reconciliation only, not acceptance of the supplier drafts.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Reduced Hadamard words and their exact denominators

Statement

Use G={H,T,T†,S,S†,X,Y,Z} and allow scalar phases ωqI. Only H contributes to the H count; only T,T† contribute to the T count. Every word can be rewritten, with its exact scalar retained, as

ωqTaHTb1H⋯HTbh−1HTcXe,

where all bi are odd, exponents are read modulo 8, and e∈{0,1}. For h=0 interpret this as ωqTaXe. The rewriting never increases either resource count. Each odd power uses one T gate and even powers use none. A reduced word with h≥2 has sde⁡(∣U00∣2)=h+1; with h=1 the exponent is 2, and with h=0 the squared entry is 0 or 1. Consequently reduced words minimize H count among all words for the same matrix up to global phase.

Facts & Assumptions

Given: The exact matrices of G, S=T2, and the ring O=Z[ω].

[F1]

Clifford+T gate library and exact matrices supplies the matrices and ω4=−1.

[F2]

Smallest square root of two denominator exponent defines the least exponent placing an element in O.

Proof

1.1F1givenalgebraconstruct

Replace Y by iXZ, and move all X factors to the right using XTr=ωrT−rX and XH=HZ. Combine adjacent diagonal powers. For an even interior exponent, use H2=I, HT4H=X, HT2H=ωT−2HT−2, or HT6H=ω−1T2HT2. Each replacement strictly decreases the H count and introduces only free diagonal Clifford or Pauli factors. Repeat until all interior exponents are odd. Combining powers never increases the number of odd powers, since the parity of a sum is at most the sum of the parities. Thus both counts never increase. Exact scalar exponents are updated modulo 8. A stack of diagonal blocks and H symbols implements this reduction in linear time in the input word length: each interior even-block replacement removes at least one H symbol and requires only bounded local stack updates.

1.2F1algebra

For a unit column (u,v)T, set x=2Re⁡(uˉv), y=2Im⁡(uˉv), z=∣u∣2−∣v∣2. Direct matrix multiplication gives the H action (x,y,z)↦(z,−y,x) and the Tr action (x,y,z)↦(xcos⁡(rπ/4)−ysin⁡(rπ/4),xsin⁡(rπ/4)+ycos⁡(rπ/4),z). For odd r, its sine and cosine are independently signed 1/2. The rightmost TcXe starts the column at (0,0,(−1)e), and the leftmost Ta does not change the final z.

2.1F2step 1.2algebra

Ignore these endpoint factors temporarily. After one H the triple is (±1,0,0). After two H gates with an odd intervening power it is (0,±1/2,±1/2). After three it has x=±1/2, y=±1/2, z=±1/2, so the respective least exponents are 1,2,2. If two nonzero elements have unequal least exponents, their sum and difference have exponent equal to the larger one: scale by that larger power; one summand is primitive modulo 2O and the other is divisible by 2, so their sum cannot be divisible. Inductively, after h≥3 H gates the exponents of (x,y,z) are (h−2,h−1,h−1). Indeed an odd rotation makes both new transverse coordinates have exponent h, and H makes the new exponents (h−1,h,h). The same transition from the displayed two-H triple establishes the induction base.

3.1F2step 1.1step 2.1algebra∎

Since ∣u∣2=(1+z)/2, the positive exponent h−1 of z for h≥2 gives exponent h+1 for ∣u∣2 by the same primitive-numerator argument. For one H, z=0 and ∣u∣2=1/2 has exponent 2; for zero H the column is a basis vector. Thus the squared-entry exponent distinguishes every possible reduced H count, including 0,1. Any competing word reduces by step 1.1 without increasing H count, and its squared-entry exponent is unchanged by scalar phase. Its reduced H count therefore equals that of the given reduced word. This proves H minimality.

AlgorithmAlgorithm: AI-adaptedProof: Not applicableOpen item page →

Cyclotomic scaled grid and norm-equation solver

Definition

Fix ω=eiπ/4 and D=Z[ω,1/2]. Use the automorphism ∙ from The nontrivial real-conjugation automorphism of the eighth cyclotomic field, which sends ω to −ω=ω5 and fixes i. Let 0<ε<1/2 and θ∈R. The scaled grid for this input is

G(θ,ε)={u∈D: ∣u∣≤1, ∣u∙∣≤1, Re⁡(eiθ/2u)≥1−ε2/2}.

The default iterator is Efficient exact-denominator Rz grid iterator, with w=e−iθ/2. It emits every candidate once in increasing least k=sde⁡(u), with randomized order within each layer and finite layer completion for every random-bit sequence. Its expected prefix cost and all fixed prefix moments are proved in Complete scaled-grid enumeration with expected polynomial prefix cost.

A complete finite-search alternative uses lexicographic power-basis coefficients within each layer. For each k≥0, write u=(a0+a1ω+a2ω2+a3ω3)/(2)k with least exponent k; the finite coefficient bound is ∣aj∣≤⌊2k/2⌋, proved in Finite coefficient bounds for the scaled cyclotomic grid. Test the three displayed conditions exactly. This defines a finite candidate list for each k.

For a candidate u, put ξ=1−u†u=1−∣u∣2∈D+=Z[2,1/2], using Conjugate norms from the dyadic eighth-cyclotomic ring are real dyadics. For scalars, z†=zˉ. Write ξ∙ξ=n/2ℓ with n∈Z and least ℓ≥0; compute it by writing ξ=a+b2 with a,b∈Z[1/2] and multiplying (a−b2)(a+b2)=a2−2b2. The two disk conditions give ξ,ξ∙≥0, so n≥0; if ξ≠0, injectivity of ∙ gives n>0. The complete norm-equation subprocedure receives ξ and, if n≠0, a prime factorization of n. It must decide whether some t∈D satisfies t†t=ξ, return an exact such t if one exists, and otherwise return NO_SOLUTION. If ξ=0, it returns t=0. A bounded factorization attempt may return FACTOR_TIMEOUT; that result skips this candidate and is not a proof of NO_SOLUTION.

Factored norm-equation subprocedure

When the supplied integer factorization is available, use the efficient construction in Efficient exact cyclotomic norm solving with a supplied integer factorization. Clear the denominator by η=4rξ, taking the least nonnegative r for which η∈Z[2]. For each rational prime in its known norm factorization, recover its real prime generators using gcd⁡(p,2−b) when b2=2(modp) exists, and otherwise retain p. Split these into cyclotomic prime generators by the displayed modular roots of −1 or −2 and cyclotomic gcds; retain the inert generators and include δ=1+ω over 2. Recover the exponents in η by exact division, allocate them under complex conjugation as below, and recover the real unit by multiplying by 1+2 or its inverse until its positive embedding lies in [1,1+2). The cited construction specifies all residue-class branches and its randomized modular square-root subroutine; balance gcd remainders by real units as there. It returns an exact solution or NO_SOLUTION and has expected polynomial bit cost in the explicit algebraic input size. For a grid candidate of exponent k, this is polynomial in k+1.

Calibrated bounded prime attempts

In bounded mode no prime recognition oracle is used. For candidate exponent k, use the fixed calibrated polynomial P(k)=2200(k+1)20 from Efficient exact cyclotomic norm solving with a supplied integer factorization. If n=0, return t=0. If n=1, run the complete efficient construction with the empty odd-prime factor list; its remaining powers of two are known.

For n>1, execute the factored construction prospectively, using the single factor hint n1, for at most 2P(k) of its elementary binary operations. This is an attempt, not a claim that n is prime. Instrument all loops, including random sampling, with this counter. Guard every partial operation: check divisors for zero and obtain modular inverses by the integer extended Euclidean algorithm, aborting if the gcd is not one. Impossible order/root searches, malformed outputs, negative solver outcomes, failed inverses, and work-cap interruptions all end the attempt with FACTOR_TIMEOUT, never with a claim of NO_SOLUTION.

Before accepting any prospective output, reduce its rational power-basis coefficients and check t†t=ξ exactly. Accept only when that equality holds; otherwise return FACTOR_TIMEOUT. Watchdog, guard and final certificate costs are charged; they are polynomial in k+1+P(k) even on composite inputs. The solver-work counter bounds every intermediate bit string by its input length plus 2P(k), so certification cannot hide an unbounded output cost. Use fresh independent random bits at each candidate.

After the capped prime attempt fails, return FACTOR_TIMEOUT for this candidate and continue to the next grid candidate. Bounded mode makes no additional factoring attempt and takes no factor-suggestion procedure or additional factor-attempt budget as input. Complete oracle mode instead supplies a valid full factorization and runs the complete efficient solver without this cap.

Complete finite-search alternative

Use the complete terminating construction of Constructive decision of the dyadic cyclotomic norm equation. Explicitly, after the zero case choose the least integer r≥0 clearing the coefficient denominators so that η=4rξ∈Z[2]. Factor η in O=Z[ω] by the finite divisor search in Constructive cyclotomic factorization and real unit squares. Group the prime associate classes under †. If any fixed class has odd exponent, return NO_SOLUTION. Otherwise form s by allocating half each fixed exponent, and all of the common exponent to one class from each conjugate pair. Compute the positive real unit e=η/(s†s), recover v∈Z[2] with v2=e by the unit construction, and return t=vs/2r. Every computation here uses exact power-basis arithmetic.

The supplied integer factorization is retained as an admissible input for implementations using rational-prime splitting. The finite-search mode above does not need it and has no asserted polynomial runtime. In bounded mode, FACTOR_TIMEOUT skips the current candidate and never changes the complete subprocedure's NO_SOLUTION criterion.

Comparison contract

The grid comparisons involve the supplied real parameters θ and ε. Their exact comparison interface is part of the outer real-input contract. It is independent of the algebraic norm solver, whose sign, equality, divisibility and associate tests are all exact and terminating.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Determinant-one Clifford+T words are dense in SU(2)

Statement

Let G be the group of exact one-qubit Clifford+T matrix words, and let SU(2)={U∈U(2):det⁡U=1}. For every R∈SU(2) and every ε>0, some W∈G satisfies det⁡W=1 and ∥R−W∥op<ε.

Facts & Assumptions

Given: U(2) is the group of unitary 2×2 matrices and SU(2)={U∈U(2):det⁡U=1}. Equip C2 with its standard inner product, linear in the first argument, ⟨x,y⟩=x1yˉ1+x2yˉ2, and induced norm. The exact one-qubit Clifford+T matrices and projective unitary group PU(2)=U(2)/{λI:∣λ∣=1} have quotient metric d([A],[B])=min⁡∣λ∣=1∥A−λB∥op, and R∈SU(2).

[F1]

Clifford+T Is Dense Projectively on One Qubit: projective classes of finite words in H,T are dense in PU(2) in operator norm.

[F2]

Determinants of one-qubit Clifford+T words are eighth roots: every exact one-qubit Clifford+T word has determinant in μ8={ωj:j∈Z}.

[F3]

Clifford+T gate library and exact matrices: Z=T4 and the exact matrices H,X,Z are the displayed Hadamard and Pauli matrices.

[F6]

The operator norm is zero on the zero domain and otherwise is max_{||v||=1} ||Tv||: the operator norm is the maximum norm of the image of a unit vector.

[F9]

Global Phase Equivalence: two matrices represent the same projective class exactly when they differ by a unit scalar.

Proof

1.1F1F2F4F7F8F9givenalgebra

By [F7], determinant is a homomorphism on G, and [F2] places its image in the finite group μ8. Therefore its kernel G1={W∈G:det⁡W=1} has finite index in G. Let π:U(2)→PU(2) be the quotient map. Then π(G1) has finite index in π(G), and [F1] makes π(G) dense. Its closure π(G1)‾ is consequently a closed finite-index subgroup of PU(2): the dense group π(G) is a finite union of cosets of π(G1), so its closure is the same finite union of the corresponding closed cosets of π(G1)‾. Every projective class has an SU(2) representative: write det⁡Q=eiϕ using [F8] and multiply Q by λ=e−iϕ/2. Every SU(2) matrix has eigenvalues eiα,e−iα; [F4] diagonalizes it and the path s↦Sdiag⁡(eisα,e−isα)S∗ joins it to I. Thus SU(2), and hence its continuous image PU(2), is connected. The complement of a finite-index closed subgroup is a finite union of its closed cosets, so that subgroup is also open. Since PU(2) is connected, its only nonempty clopen subgroup is PU(2) itself; hence π(G1)‾=PU(2).

2.1F5F6step 1.1algebra

Choose δ>0 and, by the density just proved, a word W∈G1 and a scalar ∣λ∣=1 with ∥W−λR∥op<δ. Write the columns of W and R as w1,w2 and r1,r2. Multilinearity [F5] gives det⁡W−det⁡(λR)=det⁡(w1−λr1,w2)+det⁡(λr1,w2−λr2). For x=(x1,x2)T and y=(y1,y2)T, expanding both sides gives ∣det⁡(x,y)∣2=∥x∥2∥y∥2−∣⟨x,y⟩∣2=∣x1∣2∣y2∣2+∣x2∣2∣y1∣2−2Re⁡(x1y2xˉ2yˉ1)≤∥x∥2∥y∥2. Since the columns are unit vectors and each column difference has norm less than δ by [F6], ∣1−λ2∣≤2δ.

3.1F3F6step 2.1algebrachoose∎

Put a=∣λ−1∣ and b=∣λ+1∣. Then a2+b2=4 and ab=∣1−λ2∣≤2δ. Since max⁡(a,b)≥2 from a2+b2=4, we have min⁡(a,b)=ab/max⁡(a,b)≤2 δ. Choose σ∈{1,−1} attaining this minimum. By the triangle inequality and ∥R∥op=1, ∥W−σR∥op<(1+2)δ. The scalar −I is a word in G: direct multiplication gives X=HZH=(0110),XZ=(0−110),(XZ)2=−I. Thus σW∈G1, and ∥σW−R∥op=∥W−σR∥op is less than (1+2)δ. Because det⁡(−I)=1 and det⁡W=1, this scalar correction leaves the determinant equal to 1. Choosing δ<ε/(1+2) proves the claim.

Unresolved supplier checks

The current QC12 projective-density proof and its Pauli-axis suppliers were inspected. The normalized lifts iH and e−iπ/8T are used only to prove projective density; their scalar phases are not discarded under control. The interfaces match this proof. Supplier drafts remain unapproved by this author.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

The exact operator-norm epsilon region for determinant-one Rz candidates

Statement

Let θ∈R, 0<ε<1/2, and U=(u−tˉtuˉ)∈SU(2). Then ∥Rz(θ)−U∥op≤ε⟺Re⁡(eiθ/2u)≥1−ε2/2.

Facts & Assumptions

Given: The exact matrix Rz(θ), the displayed determinant-one matrix U, and the finite-dimensional operator norm.

[F1]

Ancilla-free Rz approximation problem and T-count: Rz(θ)=diag⁡(e−iθ/2,eiθ/2).

[F3]

The operator norm is zero on the zero domain and otherwise is max_{||v||=1} ||Tv||: ∥A∥op=max⁡∥x∥=1∥Ax∥ for a nonzero finite-dimensional domain.

[F4]

t↦(cos⁡t,sin⁡t) is a bijection from [0,2π) onto the real unit circle and exp⁡(x+iy)=ex(cos⁡y+isin⁡y), ∣exp⁡(x+iy)∣=ex, and eiπ+1=0: every unit complex number has a real angle, and Euler's formula gives eit+e−it=2cos⁡t and ∣1−eit∣2=2−2cos⁡t.

Proof

1.1F1F2F4givenalgebra

Put Δ=Rz(θ)∗U. It is unitary and has determinant 1, so [F2] diagonalizes it. Its eigenvalues λ,μ have modulus one by unitarity and satisfy λμ=1 by the determinant, hence μ=λˉ. By [F4], write λ=eit with t∈[0,2π); if t>π, swap λ,μ and put α=2π−t, while if t≤π put α=t. Thus the eigenvalues are eiα,e−iα for some α∈[0,π]. From the displayed matrices, tr⁡Δ=eiθ/2u+e−iθ/2uˉ=2Re⁡(eiθ/2u). Hence cos⁡α=Re⁡(eiθ/2u).

2.1F2F3F4step 1.1algebra∎

Left multiplication by Rz(θ)∗ preserves vector norms, so [F3] gives ∥Rz(θ)−U∥op=∥I−Δ∥op. Let S be a unitary diagonalizer of Δ from [F2]; conjugation by S preserves the operator norm by [F3]. Using [F4] then gives ∥I−Δ∥op2=max⁡(∣1−eiα∣2,∣1−e−iα∣2)=2−2cos⁡α=2−2Re⁡(eiθ/2u). Both the operator norm and ε are nonnegative, so squaring the bound is equivalent to the stated real-part inequality.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Normal form of a single-qubit ring unitary

Statement

If U=(ubvd) is a 2×2 unitary with entries in D, then for some j∈{0,…,7},

U=(u−ωjvˉvωjuˉ),∣u∣2+∣v∣2=1.

Facts & Assumptions

Given: U∗U=I, and u,v,b,d∈D.

[F1]

Linear isometries, and orthogonal or unitary operators on finite-dimensional inner product spaces: in finite dimension a unitary operator satisfies U∗U=UU∗=I.

[F2]

Unit-modulus elements of the dyadic cyclotomic ring: if x∈D and xxˉ=1, then x=ωj for some integer j.

Proof

1.1F1givenalgebra

The first column of U is a unit vector, so ∣u∣2+∣v∣2=1. Its orthogonal complement is the one-dimensional span of (−vˉ,uˉ), which is itself a unit vector. Therefore the second column is λ(−vˉ,uˉ) for a scalar λ with ∣λ∣=1.

2.1F2step 1.1algebra∎

The determinant of this displayed matrix is λ(∣u∣2+∣v∣2)=λ. Because its entries lie in D and D is a ring, λ=ud−vb∈D. By [F2], λ=ωj for some j∈{0,…,7}. Substitution gives the asserted form.

Unresolved supplier checks

The actual QC07 gate, QC09 circuit-semantics, and local entry-ring bodies were inspected; their matrix and ordered-word conventions match this argument. The supplier items remain draft and are not accepted by this record.

PropositionStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Clean ancilla controlled T circuit is exact

Statement

The procedure of Controlled T using a clean ancilla acts on every computational basis input ∣a,b,0⟩ as ∣a,b,0⟩↦ωab∣a,b,0⟩. Consequently it implements C(T) on the two data bits and returns the clean ancilla to ∣0⟩, also when the data is entangled with any finite-dimensional reference register.

Facts & Assumptions

Given: a,b,t,q∈{0,1}, ω=eiπ/4, the ordered computational basis, and the displayed chronological gate word.

[F1]

Controlled T using a clean ancilla: the Toffoli block is Ht,Cb,t,Tt†,Ca,t,Tt,Cb,t,Tt†,Ca,t,Tb,Tt,Ht,Ca,b,Ta,Tb†,Ca,b.

[F2]

Clifford+T gate library and exact matrices: H acts by H∣q⟩=(∣0⟩+(−1)q∣1⟩)/2, T∣q⟩=ωq∣q⟩, and CNOT adds the control bit modulo 2 to its target.

[F3]

Denotational semantics of a finite layered circuit: the matrix of a chronological circuit is the product of its gate-embedding matrices, with later gates multiplying on the left.

[F4]

A local gate has a unique global wire embedding: a gate occurrence acts on its named ordered wires and as identity on all complementary wires.

[F5]

Controlled Unitary Access: C(T)=diag⁡(I2,T) in the control-first basis.

[F6]

Clean and dirty ancillas: a clean ancilla is initialized in the specified zero state and must be returned exactly for every allowed data input.

[F7]

Toffoli and Fredkin gates: T∣a,b,t⟩=∣a,b,t⊕ab⟩; applying this action twice restores t.

Proof

1.1F1F2F3F4F7givenalgebra

Fix the controls a,b and let q be the target bit immediately after the first Ht. The seven phase gates in [F1] contribute exponent Ea,b(q)=−(q⊕b)+(q⊕a⊕b)−(q⊕a)+b+q(mod8). For (a,b)=00,01,10,11, the pairs (E(0),E(1)) are respectively (0,0),(1,1),(0,0),(7,3). Conjugating these diagonal phases by the final Ht therefore gives, for the four control values, I,ωI,I,ω7X on the target. The last CNOT–Ta–Tb†–CNOT block contributes data phase ωa−(a⊕b), which is 1,ω−1,1,ω in the same order. The combined action is exactly ∣a,b,t⟩↦∣a,b,t⊕ab⟩ with phase 1 in all eight cases, proving the displayed word is Toffoli in the sense of [F7]. By [F3,F4], these basis actions give the denotational matrix of the displayed chronological circuit.

2.1F1F3F4F7step 1.1algebra

Starting with t=0, the first Toffoli sends ∣a,b,0⟩ to ∣a,b,ab⟩. The middle Tt multiplies this vector by ωab; applying the Toffoli action [F7] again gives target ab⊕ab=0. Thus the full circuit sends each basis vector to ωab∣a,b,0⟩. The matrix product is the chronological circuit action by [F3,F4].

3.1F5F6step 2.1algebra∎

Every vector on data and a finite-dimensional reference with a clean ancilla has the finite expansion ∑a,b,rcabr∣a,b,r⟩∣0⟩. Applying step 2.1 termwise gives ∑a,b,rcabrωab∣a,b,r⟩∣0⟩, which is C(T) on the data and identity on the reference, tensored with the restored zero state, by [F5,F6]. This is the asserted correlated-input action.

Finite certificate

The exact arithmetic check at research/quantum-computing-algorithms-60-2026-10-15-batch-13-finite-certificates.json independently applies the 15-gate word to all eight three-bit basis vectors; the table records the two unchanged inputs with ab=1 as 110↦111 and 111↦110, and identity action on the other six, all with phase 1.

Unresolved supplier checks

The eight-case word calculation and reference extension are local. The actual QC07, QC09 and QC10 gate, circuit, ancilla and Toffoli bodies were inspected; their exact matrices, ordered-wire convention and clean-return interface agree. This is interface review, not approval of another batch's draft work.

TheoremStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Two-qubit determinant obstruction to controlled T

Statement

The two-qubit controlled-T matrix C(T)=diag⁡(1,1,1,ω) cannot be implemented exactly, or up to a scalar global phase, by a circuit on exactly two wires using only one-qubit Clifford+T gates and CNOT. The assertion concerns no workspace wire; it does not rule out implementations with an explicit ancilla.

Facts & Assumptions

Given: ω=eiπ/4, the exact two-wire gate embeddings, and multiplicativity and column multilinearity of the determinant.

[F1]

Clifford+T circuit entries lie in the dyadic cyclotomic ring: every matrix entry of a finite Clifford+T circuit lies in D.

[F2]

Unit-modulus elements of the dyadic cyclotomic ring: every λ∈D with λλˉ=1 is an eighth root ωj.

[F3]

Clifford+T gate library and exact matrices: H,T,S,Z have the displayed exact matrices and CNOT permutes the two-wire computational basis by ∣a,b⟩↦∣a,b⊕a⟩.

[F4]

For same-sized finite square matrices over a commutative ring, det⁡(AB)=det⁡(A)det⁡(B): the determinant of a product of square matrices is the product of their determinants.

[F5]

The Leibniz determinant is column-multilinear, alternating and normalized over every commutative ring: determinant is multilinear in its columns, so scaling all four columns by λ scales the determinant by λ4.

[F6]

A local gate has a unique global wire embedding: on two ordered wires, a one-wire operation acts on its selected factor and as identity on the other factor.

[F7]

Denotational semantics of a finite layered circuit: a finite chronological circuit is represented by the product of its gate-embedding matrices, with later gates multiplying on the left.

[F8]

Global Phase Equivalence: A and B are equivalent up to global phase exactly when A=λB for a scalar λ of modulus 1.

Proof

1.1F3F4F6F7givenalgebra

By [F6], the two one-wire embeddings are H⊗I2,I2⊗H and the corresponding tensor embeddings for T,T†,S,S†,X,Y,Z and scalar phases. Direct diagonal/permutation calculations give det⁡(H⊗I2)=det⁡(I2⊗H)=1, det⁡(T⊗I2)=det⁡(I2⊗T)=ω2, and det⁡(T†⊗I2)=det⁡(I2⊗T†)=ω−2. The same calculation gives determinant ω4 for embedded S,S†, determinant 1 for embedded X,Y,Z, and ω4j for the embedded scalar phase ωjI2. CNOT is a single transposition of ∣10⟩ and ∣11⟩, so its determinant is −1=ω4. Thus every primitive determinant is an even power of ω; [F4,F7] make the determinant of a finite circuit product an even power as well.

2.1F1F2F5F8step 1.1algebra∎

The target has determinant det⁡C(T)=ω. Exact equality contradicts step 1.1. If a two-wire circuit V equals λC(T) for a unit scalar λ as in [F8], then its (0,0) entry is λ, so [F1] gives λ∈D; unitarity gives λλˉ=1, so [F2] gives λ=ωj. By [F5], det⁡V=λ4det⁡C(T)=ω4j+1, an odd power, again contradicting step 1.1.

Unresolved supplier checks

The determinant calculation was reconciled with the actual QC09 local-wire embedding and circuit-semantics bodies. QC07's exact gate matrices and the ring-unit-circle supplier were also inspected. This records interface review, not independent acceptance of those draft suppliers.

TheoremStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Two-phase reduction for Clifford+T Rz synthesis up to phase

Statement

For R=Rz(θ) and a one-qubit Clifford+T operator U, if ∥R−λU∥op≤ε for some unit scalar λ, then the same projective T-count has a representative whose phase parameter is one of 1 or eiπ/8. The exact representative in the operator-norm constraint remains explicit in the pair (λ,U). Thus the up-to-phase search need only compare the two scaled candidate problems. If such a phase-equivalent operator is placed under a control, its phase must be restored as a relative phase:

C(λU)=(diag⁡(1,λ)⊗I)C(U).

Facts & Assumptions

Given: Rz(θ) and each Clifford+T word are unitary, det⁡Rz(θ)=1, and λ is a complex scalar with ∣λ∣=1.

[F1]

Determinants of one-qubit Clifford+T words are eighth roots: every exact one-qubit Clifford+T word has determinant ωk for some integer k.

[F3]

The operator norm is zero on the zero domain and otherwise is max_{||v||=1} ||Tv||: ∥A∥op=max⁡∥v∥=1∥Av∥ for a finite-dimensional nonzero domain.

[F4]

For same-sized finite square matrices over a commutative ring, det⁡(AB)=det⁡(A)det⁡(B): det⁡(AB)=det⁡(A)det⁡(B) for square matrices over a commutative ring.

[F5]

Global Phase Equivalence: A and B are phase-equivalent when A=λB for a unit scalar λ.

[F6]

Ancilla-free Rz approximation problem and T-count: Rz(θ)=diag⁡(e−iθ/2,eiθ/2) and scalar Clifford phases do not contribute to T-count.

[F7]

Global Phase Under Control: in control-first order, C(λU)=(diag⁡(1,λ)⊗I)C(U).

[F8]

Controlled Unitary Access: C(U)=diag⁡(I,U) on the control-first register.

[F9]

t↦(cos⁡t,sin⁡t) is a bijection from [0,2π) onto the real unit circle and exp⁡(x+iy)=ex(cos⁡y+isin⁡y), ∣exp⁡(x+iy)∣=ex, and eiπ+1=0: every unit complex scalar has a real angular parameter, and Euler's formula gives ∣1−eix∣=2∣sin⁡(x/2)∣.

[F10]

Signs, monotonicity intervals, and ranges of sine and cosine: sine is strictly increasing on [0,π/2] and strictly decreasing on [π/2,3π/2]; cosine is strictly decreasing on [0,π].

[F11]

Quarter-turn values and shifts by pi/2 and pi: sin⁡(x+π/2)=cos⁡x and cos⁡(π/2)=0.

[F12]

Parity and the Pythagorean identity for sine and cosine: cos⁡(−x)=cos⁡x, sin⁡2x+cos⁡2x=1, and sine and cosine are bounded by 1.

Proof

1.1F1F2F4F6F9givenchoose

Write det⁡U=ωk by [F1], and set V=e−ikπ/8R∗U. Since det⁡R=1, [F4] gives det⁡V=e−ikπ/4ωk=1. The unitary V is normal, so [F2] diagonalizes it. Its two eigenvalues have product 1 and modulus 1, hence are eiϕ,e−iϕ for some ϕ by [F9]; consequently tr⁡V=2cos⁡ϕ is real. Choose σ∈{1,−1} such that W=σV has nonnegative trace. Since −1=ei8π/8, W=einπ/8R∗U for an integer n, and W is unitary with determinant 1.

2.1F2F3F9F10F11F12step 1.1algebra

Since W∈SU(2), its eigenvalues are a unit scalar and its conjugate; by [F9] write them eit,e−it and, swapping them if needed, choose α∈[0,π] with eigenvalues eiα,e−iα. Then tr⁡W=2cos⁡α≥0; [F10,F11] imply α≤π/2. For any unit scalar μ, choose its angle t∈[0,2π) by [F9] and set ψ=t if t≤π, or ψ=t−2π otherwise. Thus ψ∈[−π,π]. By [F2] and [F3], ∥I−W∥op=∣1−eiα∣ and ∥I−μW∥op=max⁡{∣1−ei(ψ+α)∣,∣1−ei(ψ−α)∣}. If ψ≥0, put t=ψ+α∈[α,3π/2]. For t≤π, sin⁡(t/2)≥sin⁡(α/2) by [F10]; for t≥π, sine decreases on [π/2,3π/2], so sin⁡(t/2)≥sin⁡(3π/4). By [F11,F12], sin⁡(3π/4)=sin⁡(π/4)=1/2, and α/2≤π/4 gives sin⁡(α/2)≤1/2 by [F10]. If ψ≤0, apply the same bound to t=∣ψ∣+α from the second eigenvalue. By [F9,F10], ∣1−eix∣=2∣sin⁡(x/2)∣ and these bounds imply ∥I−W∥op≤∥I−μW∥op.

3.1F3F6step 2.1algebra

Left multiplication by R preserves operator norm, since it preserves the norm of every vector in the maximum [F3]. As W=einπ/8R∗U, step 2.1 implies ∥R−einπ/8U∥op=∥I−W∥op≤∥R−λU∥op. Write n=2q+r with r∈{0,1}. Then einπ/8=ωqeirπ/8. Since ωq is a free scalar Clifford phase in [F6], moving it between the explicit scalar and the representative leaves the projective T-count unchanged. Thus the two phase representatives are eirπ/8∈{1,eiπ/8}, proving the reduction.

4.1F5F7F8givenalgebra∎

In the control-first basis [F8], direct block multiplication gives C(λU)=diag⁡(I,λU)=(diag⁡(1,λ)⊗I)C(U), in agreement with the supplier identity [F7]. The first factor is generally not a global scalar on the joint control-target system, so replacing U by λU under control requires this relative phase correction.

Unresolved supplier checks

The actual QC07 gate, QC08 controlled-unitary, QC09 resource, and QC11 global-phase bodies were inspected and their interfaces agree with the matrix and scalar-phase conventions here. The separate Ross–Selinger T-count and arithmetic-runtime claims have their own local suppliers and explicit probabilistic assumptions; this phase-reduction proof does not use them.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Clifford+T denominator descent and finite base table

Statement

Let (u,v)T be a unit vector with entries in D, and put s=sde⁡(∣u∣2). If s>3, then some k∈{0,1,2,3} has

sde⁡ ⁣(∣u+ω−kv2∣2)=s−1.

Moreover, every such unit column with s≤3 is prepared exactly from ∣0⟩ by a word in H,T,T†. A complete coefficient-and-word table for the finite base set is recorded at research/quantum-computing-algorithms-60-2026-10-15-batch-13-finite-certificates.json.

Facts & Assumptions

Given: ∣u∣2+∣v∣2=1, entries in D, ω4=−1, and the exact H/T matrices.

[F1]

Smallest square root of two denominator exponent: sde⁡(z) is the least integer r with (2)rz∈O, and sde⁡(0)=−∞.

[F2]

Squared entry denominator bound: for nonzero z, sde⁡(∣z∣2)=2sde⁡(z)−m for some m∈{0,1}.

[F3]

Square root of two divisibility criterion in the eighth cyclotomic ring: for x=a+bω+cω2+dω3, 2∣x iff a+c and b+d are even; also xxˉ=P+2Q with P=∑aj2 and Q=a(b−d)+c(b+d).

[F4]

Finite coefficient bounds for the scaled cyclotomic grid: if ∣z∣,∣z∙∣≤1, then sde⁡(z)≥0 and the coefficients of (2)sde⁡(z)z have absolute value at most 2sde⁡(z)/2.

[F5]

Clifford+T gate library and exact matrices: H maps (u,v) to ((u+v)/2,(u−v)/2), while Tk multiplies the lower entry by ωk.

[F6]

The nontrivial real-conjugation automorphism of the eighth cyclotomic field: the four embeddings are the identity, complex conjugation, ∙, and their composite; ∙ commutes with complex conjugation.

[F7]

Unit-modulus elements of the dyadic cyclotomic ring: if z∈D and zzˉ=1, then z=ωj for some j∈{0,…,7}.

Proof

1.1F1givenalgebra

For a nonzero real element P+2Q∈Z[2], define ν(P+2Q) as the largest r≥0 for which (2)r divides it in O. This maximum exists: divisibility by (2)2q=2q forces both integer coefficients P,Q to be divisible by 2q, which cannot hold for arbitrarily large q unless the element is zero. If y=(2)jy0 with 2∤y0, then the definition of sde gives sde⁡(y/(2)r)=r−j.

1.2F1F2F3F4F6givenalgebra

Applying each embedding of K to ∣u∣2+∣v∣2=1 preserves the identity by [F6]; hence every embedding of each entry has modulus at most 1. Since s>3, u≠0. If v=0, then ∣u∣2=1 and s=0, a contradiction, so v≠0 as well. Let ru=sde⁡(u) and rv=sde⁡(v). From [F2] and s>3, ru≥2. More generally, if max⁡(ru,rv)≥1 and the exponents differ, the same argument below gives a contradiction. If ru>rv, set x=(2)ruu and y=(2)rvv. Then xxˉ+2ru−rvyyˉ=2ru; the right side and second term lie in 2O, so xxˉ∈2O. Write x=a0+a1ω+a2ω2+a3ω3. By [F3], xxˉ=P+2Q with P=∑aj2 and Q=a0(a1−a3)+a2(a1+a3). If P,Q are both even, then a0+a2 and a1+a3 have equal parity because P≡(a0+a2)+(a1+a3)(mod2), while Q≡(a0+a2)(a1+a3)(mod2) forces both even. Then [F3] gives 2∣x, contradicting the minimality of ru. Since xxˉ∈2O would make both P,Q even in the power basis, this is impossible. If rv>ru, interchange u,v and use the same calculation with the larger exponent. Thus ru=rv=:r. Write x=(2)ru and y=(2)rv. Their minimal exponents make both primitive with respect to 2. The same parity argument shows xxˉ and yyˉ are not divisible by 2, so their divisibility by 2 is either zero or one. Since r≥2, xxˉ+yyˉ=2r is divisible by 2; exactly one of the two norms cannot be divisible by 2, since then their sum would not be divisible by it. Hence ν(xxˉ)=ν(yyˉ)=j∈{0,1}. Also r≥0 by [F4], since the entries and their ∙-conjugates are all in the unit disk.

2.1F1F2F3step 1.2algebra

The squared-entry identity [F2] gives s=2r−j. If r≥3, then xxˉ+yyˉ=2r, so the integer forms P(x),Q(x),P(y),Q(y) satisfy P(x)+P(y)≡Q(x)+Q(y)≡0(mod8). For a real element P+2Q, direct successive division by 2 gives ν≥1  ⟺  2∣P, ν≥2  ⟺  2∣P,Q, ν≥3  ⟺  4∣P and 2∣Q, and ν≥4  ⟺  4∣P,Q. These tests depend only on the four coefficients modulo 8 for every requested exponent through 4. The finite checker enumerates all 4096 vectors in (Z/8)4, groups the 3072 vectors with ν=0 or 1, and checks all 393216 compatible residue pairs. For every pair and each d=1,2,3, it finds a k∈{0,1,2,3} with ν(∣x+ω−ky∣2)=j+d; all 1,179,648 negative-power targets pass. Taking d=3 yields sde⁡(∣(u+ω−kv)/2∣2)=2(r+1)−(j+3)=s−1. The same code checks the positive-power form as a cross-check.

2.2F2F3F4step 1.2algebra

The only remaining case with s>3 is r=2,j=0, so s=4. Here x=2u,y=2v satisfy ∣x∣2+∣y∣2=4. The four embedding bounds and Fourier coefficient formula in [F4] give ∣xi∣,∣yi∣≤2. The checker therefore exhausts all integral coefficient vectors in [−2,2]4 for both columns, retains the 256 normalized pairs with ν(∣x∣2)=0, and verifies for each a k∈{0,1,2,3} that sde⁡(∣(x+ω−ky)/(2)3∣2)=3. This proves descent at the boundary s=4.

2.3F2F4F5F7step 1.2algebra

Suppose s≤3. If u≠0, [F2] gives sde⁡(u)≤2; if u=0, its assigned exponent is −∞. If v=0, the unit-circle result [F7] gives u=ωj, so its power-basis coefficients have absolute value at most 1. If u=0, [F7] gives v=ωj, with the same coefficient bound. In the remaining case both entries are nonzero. The embedding bounds from step 1.2 and [F4] give nonnegative exponents for both. If either exponent is positive, the unequal-exponent contradiction in step 1.2 forces them equal, so both are at most 2; if neither is positive, both are 0. Thus [F4] bounds every numerator coefficient by 2. The exact enumeration in the certificate contains all such columns: it finds 1537 possible entries and exactly 208 normalized columns, with squared-entry exponents −∞,0,2,3 occurring 8,8,64,128 times. Exact breadth-first search from (1,0) using H,T,T† reaches every one of the 208 columns; the stored shortest words have maximum length 16 and the search visits 7660 states. Every stored word is re-evaluated by exact rational coefficient arithmetic. Therefore the table prepares every base column.

3.1step 2.1step 2.2step 2.3∎

The certificate is generated by the exact arithmetic program research/quantum-computing-algorithms-60-2026-10-15-batch-13-finite-certificates.py; the complete rows and all residue/boundary counts are in the adjacent JSON. The bounds in step 2.1 and step 2.2 and step 2.3 prove the enumerated finite sets contain every required case, so the checks prove the descent and base assertions rather than sampling them.

Remarks

The base table is a state-preparation table. For a full unitary, prepare its first column, then use Unit-modulus elements of the dyadic cyclotomic ring to correct the remaining determinant phase by a power of T.

Unresolved supplier checks

The local finite descent and base table are complete. The actual QC07 exact H/T matrices and QC09 circuit-semantics body were inspected; the matrix products and chronological word order agree with this proof. This is interface reconciliation, not acceptance of those draft suppliers.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Every Rz epsilon region contains an exact norm-solvable grid point

Statement

For θ∈R and 0<ε<1/2, there are u,t∈D such that ∣u∣≤1,∣u∙∣≤1,Re⁡(eiθ/2u)≥1−ε2/2,t†t=1−u†u. Thus the scaled grid has at least one candidate whose norm equation is solvable.

Facts & Assumptions

Given: The exact Clifford+T one-qubit matrices, D=Z[ω,1/2], the automorphism ∙, Rz(θ), and 0<ε<1/2. For scalar z, z†=zˉ.

[F1]

Determinant-one Clifford+T words are dense in SU(2): every SU(2) target has an exact determinant-one Clifford+T word within any positive operator-norm error.

[F2]

Dyadic cyclotomic ring for Clifford+T synthesis: D=Z[ω,1/2] is a subring of K=Q(ω).

[F3]

Clifford+T gate library and exact matrices: the exact displayed H,T,T† matrices are the one-qubit generators.

[F4]

The nontrivial real-conjugation automorphism of the eighth cyclotomic field: ∙ is a field automorphism of K that preserves D and commutes with complex conjugation.

[F5]

The exact operator-norm epsilon region for determinant-one Rz candidates: for U=(u−tˉtuˉ)∈SU(2), the operator-norm error bound is equivalent to the displayed real-part condition.

Proof

1.1F1F2F3givenchoose

By [F2,F3], the entries of T,T† lie in D. Also 2=ω−ω3 and 1/2=(ω−ω3)/2, so every entry of H lies in D. The ring D is closed under complex conjugation because ωˉ=ω−1=ω7∈D. Apply [F1] to Rz(θ)∈SU(2) and choose an exact word U with det⁡U=1 and ∥Rz(θ)−U∥op<ε. Every entry of U lies in D because each generator has entries in D and products of matrices over a subring remain over that subring. Let the first column be (u,t)T. It is a unit vector; its orthogonal unit vector (−tˉ,uˉ)T is therefore the second column up to a unit scalar λ. The determinant of the resulting matrix is λ, so det⁡U=1 forces λ=1. Hence U=(u−tˉtuˉ) and t†t=1−u†u.

2.1F4step 1.1algebra

Applying ∙ to U∗U=I preserves products and fixes I; [F4] also makes it commute with the adjoint. Thus U∙ is unitary, and its first-column norm gives ∣u∙∣2+∣t∙∣2=1. The original first column similarly gives ∣u∣2+∣t∣2=1, so ∣u∣,∣u∙∣≤1.

3.1F5step 1.1algebra∎

The strict approximation in step 1.1 and [F5] imply Re⁡(eiθ/2u)>1−ε2/2, hence the required weak inequality. Together with step 1.1 this gives a grid candidate and an exact solution of its norm equation.

Unresolved supplier checks

The actual QC12 projective-density proof and its Pauli-axis suppliers were inspected. Its normalized lifts are used only for projective density; the exact scalar phases are retained in the local matrix argument. This records interface reconciliation, not approval of those supplier drafts.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Determinant-one reduction for optimal Rz approximation

Statement

Set c=∣1−eiπ/8∣. If 0<ε<c, every exact one-qubit Clifford+T matrix V with ∥Rz(θ)−V∥op≤ε has determinant one. If ε≥c, there is a determinant-one Clifford matrix of T-count zero meeting this error bound. Consequently, for every positive precision the minimum T-count over all feasible matrices is attained among determinant-one matrices.

Facts & Assumptions

Given: A real angle θ, positive precision ε, and the on-the-nose error and T-count conventions of the approximation problem.

[F1]

Determinants of one-qubit Clifford+T words are eighth roots: every exact one-qubit Clifford+T matrix has determinant ωj, where ω=eiπ/4.

[F3]

The operator norm is zero on the zero domain and otherwise is max_{||v||=1} ||Tv||: ∥A∥op=max⁡∥x∥=1∥Ax∥.

[F4]

Clifford+T gate library and exact matrices: S=diag⁡(1,i) and ωjI are Clifford matrices, and scalar Clifford phases cost no T gates.

[F5]

Ancilla-free Rz approximation problem and T-count: Rz(θ)=diag⁡(e−iθ/2,eiθ/2); the T-count is a nonnegative integer.

[F7]

Determinant-one Clifford+T words are dense in SU(2): every SU(2) target has an exact determinant-one Clifford+T word within any positive error.

[F8]

Integer part: for every real x there is exactly one integer m with m≤x<m+1: for every real x, ⌊x⌋ is the unique integer m with m≤x<m+1.

[F9]

Signs, monotonicity intervals, and ranges of sine and cosine: sine is strictly increasing on [0,π/2] and cosine is strictly decreasing on [0,π].

[F10]

exp⁡(x+iy)=ex(cos⁡y+isin⁡y), ∣exp⁡(x+iy)∣=ex, and eiπ+1=0: ∣eix∣=1 and ∣1−eix∣=2∣sin⁡(x/2)∣ for real x.

[F11]

t↦(cos⁡t,sin⁡t) is a bijection from [0,2π) onto the real unit circle and [F10]: every unit complex number can be written as eiϕ for a real ϕ.

[F12]

Parity and the Pythagorean identity for sine and cosine: sin⁡(−x)=−sin⁡x and sin⁡2x+cos⁡2x=1; in particular, sin⁡0=0.

[F14]

The derivatives of sine and cosine are cosine and minus sine and A function differentiable at c is continuous at c and The mean value theorem, as the case g(x)=x of Cauchy's: for f continuous on [a,b] with a<b and differentiable on (a,b) there is c∈(a,b) with f(b)−f(a)=f′(c)(b−a): sin⁡′=cos⁡ and differentiability makes sine continuous; for each x>0, the mean value theorem on [0,x] gives sin⁡x=xcos⁡y for some y∈(0,x). By [F12], cos⁡y≤1.

Proof

1.1F1F2F3F5F6F9F10F12givenalgebra

Suppose ε<c and put A=VRz(θ)∗. The matrix A is unitary. By [F2] it has an orthonormal eigenbasis. For a nonzero eigenvector v with eigenvalue λ, norm preservation gives ∣λ∣ ∥v∥=∥Av∥=∥v∥, so ∣λ∣=1; by [F11] write the two eigenvalues as eiϕ1,eiϕ2 with ϕj∈[−π,π]. Unitary multiplication preserves [F3], and the norm of a diagonal matrix is the largest modulus of its entries, so ∣1−eiϕj∣≤ε<c. Since ∣1−eix∣=2∣sin⁡(x/2)∣ by [F10]. Since ∣ϕj∣/2∈[0,π/2], [F12] gives ∣sin⁡(ϕj/2)∣=sin⁡(∣ϕj∣/2) and sin⁡0=0; [F9] makes this strictly increasing in ∣ϕj∣. Thus ∣1−eiϕj∣<c implies ∣ϕj∣<π/8. Hence ∣ϕ1+ϕ2∣<π/4. By [F1,F6] and det⁡Rz(θ)=1, ei(ϕ1+ϕ2)=det⁡A=det⁡V=ωj. The only eighth root with an argument strictly between −π/4 and π/4 is 1; thus det⁡V=1.

1.2F3F4F5F8F9F10F12F13F14algebra

Suppose ε≥c. Set q=⌊2θ/π+1/2⌋ by [F8]. Then q−1/2≤2θ/π<q+1/2, so ∣qπ/4−θ/2∣≤π/8. Set C=ω−qSq=diag⁡(ω−q,ωq). It is a Clifford matrix with determinant one and T-count zero by [F4]. The two diagonal entries of Rz(θ)−C have the same modulus ∣1−ei(qπ/4−θ/2)∣≤2sin⁡(π/16)=c by [F9, F10], and c≤ε by the case hypothesis. To check the domain used here, [F13] gives 0<π/16<π/2; [F9, F12] give 0≤sin⁡(π/16), and [F14] gives sin⁡(π/16)≤π/16. Thus c=2sin⁡(π/16)≤π/8<1/2. [F3] therefore gives the required error bound. At equality ε=c the weak inequality still holds.

2.1F5F7step 1.1step 1.2algebra∎

For ε<c, step 1.1 says every feasible matrix already has determinant one. For ε≥c, step 1.2 attains T-count zero, which is minimal by nonnegativity [F5]. The feasible set is nonempty by [F7], applied with error smaller than ε. Its T-counts form a nonempty subset of the nonnegative integers, hence have a least element attained by a feasible word. Thus restricting to determinant-one matrices never changes this attained minimum.

LemmaStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Certified capped norm attempts succeed on prime residuals

Statement

Let u be a grid candidate of least denominator exponent k, and put ξ=1−u†u, ξ∙ξ=n/2ℓ in reduced form. Let P(k)=2200(k+1)20 be the calibrated prime-input binary-work bound of Efficient exact cyclotomic norm solving with a supplied integer factorization. The capped prime-attempt procedure in Cyclotomic scaled grid and norm-equation solver, with solver budget 2⌈P(k)⌉, has the following properties:

  • Every accepted output is an exact solution t†t=ξ.
  • On every input its work is polynomial in k+1, including the final exact verification, with no primality promise on n.
  • When n is prime, its success probability is at least 1/2. When n∈{0,1}, the explicitly complete zero/unit branches succeed.

For a candidate stream with exponent profile kj, suppose its arithmetic data are given an idealized stochastic model in which the indicators Ij of prime or zero/unit norm numerators are independent, with pj=Pr⁡(Ij=1)≥c/(kj+1). Draw fresh independent solver bits, independently of all arithmetic data. If J is the first successful call, then Pr⁡(J>j)≤∏i=1j(1−pi/2)≤∏i=1j(1−c2(ki+1)). Thus these attempts have the same stopping-tail bound as independent events with probabilities c/(2(kj+1)). Independence of the actual successful-call events is not asserted or needed. This last assertion concerns the explicit stochastic model; the numerators of an actual fixed input have fixed primality, while the first three assertions above hold for each such input.

Facts & Assumptions

Given: The calibrated polynomial budget bound P, the exact algebraic input, and independent random bits for each call. For the last assertion, let D contain all modelled arithmetic data. The indicators Ij are functions of D and have the stated independent marginal model, but the remaining numerical data may have arbitrary correlations. Solver-bit streams are independent of D and of one another; the enumerator ordering uses none of these solver bits. Conditioning on D fixes primality, so no nondegenerate prime probabilities are asserted after that conditioning.

[F1]

Cyclotomic scaled grid and norm-equation solver defines the capped prospective single-factor execution and accepts only a verified exact norm certificate. An invalid or aborted computation only skips its candidate.

[F2]

Efficient exact cyclotomic norm solving with a supplied integer factorization proves that the construction terminates almost surely, is complete with a valid supplied factorization, and supplies the calibrated prime-input bound P(k), as well as expected polynomial bit cost on bounded grid inputs.

[F3]

Size and residue of the Rz candidate norm integer gives n=0 or n≡1(mod8).

[F4]

Prime norm numerators congruent to one modulo eight are solvable gives solvability when n=1 or n is prime congruent to one modulo eight.

Proof

1.1F1givenalgebra

The exact certificate check in [F1] is a comparison of the four rational power-basis coefficients of t†t and ξ. Equality of these coefficients is equality in the field, so acceptance always proves the required equation. On a composite input no field property of a proposed residue quotient and no NO_SOLUTION message is used as evidence: a failed operation, negative outcome, or work-cap interruption causes only a skip.

2.1F1F2step 1.1algebra

The construction is interrupted after B=2⌈P(k)⌉ binary operations, regardless of whether its proposed prime factor was valid. Every generated bit string then has length bounded by the input length plus B. The grid-input bound of [F2] makes its input length polynomial in k+1. A fixed-degree rational-coefficient multiplication and equality check therefore takes polynomial work in k+1+B, by schoolbook integer multiplication and division. Since B is a specified polynomial, total work including exact certification is polynomial on every input.

2.2F1F2F3F4step 1.1algebra

If n is prime, the proposed one-factor factorization is valid, and [F3,F4] make its norm equation solvable. Let T≥0 be the binary work of the uncapped construction on this input. By the calibrated bound [F2], E[T]≤P(k). The elementary inequality T≥B 1{T>B} gives Pr⁡(T>B)≤E[T]/B≤1/2. Whenever T≤B, [F2] returns an exact solution and step 1.1 accepts it. Thus success probability is at least 1/2. The zero case is explicit in [F1], and [F4] plus the complete factored empty-list branch gives the numerator-one case.

3.1givenstep 2.2algebra∎

Condition first on all arithmetic data D. Each call is then a deterministic function of its own input and its fresh solver bits, so its success events are independent under this conditional probability. By step 2.2 its conditional success probability is at least Ii/2; this also holds for the immediate zero/unit branches. Consequently Pr⁡(J>j∣D)≤∏i=1j(1−Ii/2). Average this inequality over D. The indicators, rather than the successful-call events, are independent in the stated model; hence E[∏i=1j(1−Ii/2)]=∏i=1j(1−pi/2). The lower bounds on pi give the displayed joint-failure estimate. Correlated numerical inputs can correlate the unconditional call successes, but cannot invalidate this estimate.

TheoremStatement: AI-adaptedProof: AI-adaptedOpen item page →

Exact single-qubit Clifford+T ring characterization

Statement

A matrix U∈U(2) is exactly the matrix of a finite one-qubit Clifford+T word if and only if all four entries of U lie in D. This is a single-qubit statement; no multi-qubit exact ring characterization is asserted.

Facts & Assumptions

Given: The exact circuit matrices and matrix-product convention of the gate-library and circuit-semantics definitions.

[F1]

Clifford+T circuit entries lie in the dyadic cyclotomic ring: every finite Clifford+T circuit matrix has entries in D.

[F2]

Normal form of a single-qubit ring unitary: a ring-entry unitary has first column (u,v)T and determinant phase ωj, with second column ωj(−vˉ,uˉ)T.

[F3]

Clifford+T denominator descent and finite base table: every normalized ring column reduces by an HT−k step from squared-entry exponent s>3 to s−1, and every column with s≤3 has an exact H/T preparation word.

[F4]

Unit-modulus elements of the dyadic cyclotomic ring: the elements z∈D satisfying zzˉ=1 are exactly ωj.

Proof

1.1F1given

If U is a finite Clifford+T circuit matrix, [F1] puts all its entries in D.

1.2F2F3givenconstruct

Conversely, let U∈U(2) have entries in D. By [F2] its first column (u,v)T is a normalized column. Apply the descent in [F3] repeatedly while s=sde⁡(∣u∣2)>3. Each step replaces the current matrix M by HT−kM and decreases the nonnegative integer s by exactly one; hence after finitely many steps the first column lies in the base regime.

2.1F1F3F4step 1.2algebra

By [F3], the base column has a word W0 with W0∣0⟩=(u0,v0)T. Reversing each descent step by prepending its recorded TkH gives a word W with first column equal to the original (u,v)T. The unitary W∗U has first column (1,0)T, so orthogonality of its columns makes it diag⁡(1,λ) for a unit scalar λ. Its entries lie in D, since W,U have entries in that ring. Therefore [F4] gives λ=ωj, and U=WTj is a finite Clifford+T word.

3.1step 1.1step 2.1∎

Both implications are proved. The proof constructs the converse word with only exact coefficient operations and the finite base lookup; no approximation, ancilla, or multi-qubit inference is used.

Unresolved supplier checks

The actual QC07 gate matrices and QC09 circuit-semantics body were inspected; their exact matrix and chronological word interfaces agree with the local proof. The theorem remains limited to one qubit; no multi-qubit ring characterization is inferred.

AlgorithmAlgorithm: AI-adaptedProof: Not applicableOpen item page →

Exact single-qubit Clifford+T synthesis

Definition

Input a 2×2 matrix U as four canonical elements of D. Perform the following exact procedure.

  1. Test U∗U=I by rational coefficient arithmetic. If it fails, return INVALID.
  2. Set M=U and an empty list K. While s=sde⁡(∣M00∣2)>3, test k=0,1,2,3 in that order and choose the first for which sde⁡(∣(HT−kM)00∣2)=s−1. Append k to K and replace M by HT−kM.
  3. Look up the first column of M in the complete base-column table at research/quantum-computing-algorithms-60-2026-10-15-batch-13-finite-certificates.json. Let W0 be its stored H/T preparation word. Compute W0∗M=diag⁡(1,λ) exactly and find j∈{0,…,7} with λ=ωj.
  4. If K=(k1,…,kr) in reduction order, form the exact matrix-word factorization U=(Tk1H)⋯(TkrH)W0Tj. For the chronological output, emit Tj first, then the stored chronological gate list for W0, then for i=r,r−1,…,1 emit H followed by Tki. The QC09 semantics put later gates on the left, so this list has the displayed matrix product.
  5. Reduce this word by the exact stack rewriting in Reduced Hadamard words and their exact denominators: move Pauli X factors to the right, combine diagonal powers modulo eight, and replace each HT2rH by its zero- or one-H Clifford expression until all interior diagonal powers are odd. Retain the scalar phase ωqI produced by these identities in the exact output. Emit even powers as S,Z factors and odd powers as one T or T† with free S,Z factors, then return the reduced factors in reverse order as the chronological list.

The denominator descent and table completeness are the mathematical properties in Clifford+T denominator descent and finite base table and Exact single-qubit Clifford+T ring characterization. The finite lookup table uses exact rational coefficients; no numerical equality tolerance is used.

Unresolved supplier checks

The current QC07 gate alphabet and QC09 circuit-semantics bodies were inspected. Their exact matrices and chronological order agree with the procedure; no separate interface hold remains.

AlgorithmAlgorithm: Literature-sourcedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Ancilla-free Clifford+T Rz approximation

Definition

Inputs are exact reals θ∈R and ε>0, exact-real arithmetic and comparisons for the grid predicates, and the exact integer part operation needed to compute q=⌊2θ/π+1/2⌋; the integer part is the one defined in Integer part: for every real x there is exactly one integer m with m≤x<m+1. Also choose a norm mode: COMPLETE uses either a valid full integer-factorization oracle or the complete finite-search norm solver; BOUNDED uses the calibrated capped-prime attempt only. Supply a total candidate limit B∈N0∪{∞}, defaulting to ∞; B counts grid candidates on which a norm call is started. Output is either a finite chronological Clifford+T word or TIMEOUT. No bit encoding for arbitrary reals is implicit. In the randomized modes use an independent random stream for the grid iterator and fresh independent streams for each randomized norm call; candidate order depends only on the grid stream, not on norm-call outcomes.

Let c=∣1−eiπ/8∣.

  1. If ε≥c, compute the nearest integer q=⌊2θ/π+1/2⌋, with ties rounded upward, and return the chronological word with scalar phase ω−qI first and Sq second, omitting identity factors. Reduce the scalar exponent modulo 8 and the S exponent modulo 4. It has T-count zero.
  2. Otherwise ε<c<1/2. Set j=0 and enumerate u from Cyclotomic scaled grid and norm-equation solver in increasing denominator exponent. Before starting a norm call for a candidate, if j=B return TIMEOUT; otherwise increment j. Compute ξ=1−∣u∣2. In COMPLETE mode invoke the selected complete norm solver, obtaining a valid complete integer factorization when that solver requires one. In BOUNDED mode use only the calibrated capped-prime attempt, which accepts an exact certificate and otherwise may return FACTOR_TIMEOUT.
  3. If the norm solver returns FACTOR_TIMEOUT or NO_SOLUTION, continue to the next candidate. For each returned t with t∗t=ξ, form U=(u−tˉtuˉ) and U′=TUT†.
  4. Run Exact single-qubit Clifford+T synthesis on both matrices. Return the word with smaller exact T-count; break ties by lexicographic gate word.

The exact grid-to-error equivalence is proved in The exact operator-norm epsilon region for determinant-one Rz candidates. The unbounded factoring-oracle mode uses the complete efficient solver from the norm procedure, or the finite alternative Constructive decision of the dyadic cyclotomic norm equation. Successful termination (almost surely for the randomized efficient mode) under the stated terminating exact-real comparisons is proved in The Rz approximation procedure is correct when it returns ↗. A finite-budget call can return TIMEOUT. The zero-T branch is the construction in Determinant-one reduction for optimal Rz approximation. The complete finite-search norm mode gives no polynomial arithmetic-time guarantee.

TheoremStatement: AI-adaptedProof: AI-adaptedOpen item page →

H-count and T-count optimality of exact Clifford+T synthesis

Statement

Use G={H,T,T†,S,S†,X,Y,Z}, with scalar phase ignored. Count each H as one Hadamard and each T or T† as one T gate; S,S†,X,Y,Z have zero H/T count. Let h(U) and t(U) be the separate minima. For U∈M2(D) unitary with n=sde⁡(∣U00∣2)≥4, the exact synthesis algorithm, including its final reduced-word pass, attains both minima and

h(U)=n−1,t(U)=h(U)+1−(ℓ mod 2)−(j mod 2),

where ℓ,j are any integers satisfying h(HTℓUTjH)=h(U)+2. Such integers exist. Equivalently, if the reduced word has endpoint diagonal exponents a,c, then t(U)=h(U)−1+(a mod 2)+(c mod 2). With canonical binary coefficient encoding the algorithm uses O(nopt+1) ring operations and O((nopt+1)2) bit operations, where nopt is the minimum total H/T count.

More generally, every reduced word with h≥1 Hadamard gates and endpoint diagonal exponents a,c is T-optimal, with t=h−1+(a mod 2)+(c mod 2), including the h=1,2 cases.

Facts & Assumptions

Given: The gate family and costs in the statement, and canonical exact coefficient input.

[F1]

Reduced Hadamard words and their exact denominators supplies a linear-time, resource-nonincreasing exact reduction and its H-optimality invariant.

[F2]

Exact single-qubit Clifford+T synthesis uses denominator descent, a fixed finite base table, and the final reduction pass.

[F3]

Clifford+T denominator descent and finite base table supplies one-step descent and complete finite base preparation.

[F4]

Finite coefficient bounds for the scaled cyclotomic grid bounds scaled numerator coefficients by 2k/2 when all embeddings of the entry have modulus at most 1.

[F5]

Squared entry denominator bound gives sde⁡(∣z∣2)∈{2sde⁡(z),2sde⁡(z)−1}.

Proof

1.1F1F2F3givenalgebra

By [F2,F3], before the final reduction the compiler has an exact word for U. By [F1] its final reduced word is exact and H-optimal, and n≥4 makes its H count h=n−1. Write its endpoint exponents a,c and its trailing Pauli factor Xe as in [F1]. Each of the h−1 odd interior powers costs one T, so its T count is h−1+p(a)+p(c), where p(r)=r mod 2∈{0,1}.

1.2F1algebra

Every Clifford block generated by H,S,X,Y,Z reduces by [F1] to at most one H: all diagonal exponents remain even during that reduction. Splitting any word containing t T gates into t+1 Clifford blocks therefore proves h(V)≤t(V)+1 for every represented V. This argument applies to T† equally.

1.3F2F3F4F5algebra

There are n−3 descent iterations and a constant-size base lookup. Each trial uses boundedly many coefficient additions, sign permutations, multiplications by fixed ring constants, and denominator tests. At every iteration all embeddings of the current unitary remain unitary, so all embedded entries have modulus at most one. For a positive squared-entry exponent, the complementary squared norm has the same exponent: subtracting its primitive numerator from the positive power of 2 leaves it primitive. Thus [F5] bounds every entry exponent by (n+1)/2; the base regime is bounded by [F3]. By [F4] all numerator coefficients have O(n+1) bits. Denominator tests need no integer multiplication: for x=a0+a1ω+a2ω2+a3ω3≠0, let m be the minimum of the binary trailing-zero counts of its nonzero coefficients, and put y=x/2m. Its 2-valuation is 2m+δ, where δ=1 exactly when both opposite-coefficient sums of y are even. Indeed y is not divisible by 2, so it can contain at most one factor 2. For the resulting primitive numerator z, its norm has zero or one factor 2 by [F5]; this factor occurs exactly when ∑zi is even, since the rational coefficient of zzˉ is ∑zi2. These parity and trailing-zero scans take O(n+1) bit operations. Every descent trial therefore costs O(n+1) bits and boundedly many ring operations, with coefficient valuations counted as linear binary scans.

2.1F1step 1.1algebrachoose

Choose ℓ and j with a+ℓ and c−j odd. Then HTℓUTjH has an odd-interior reduced word with h+2 H gates: commute Xe past TjH using the identities in [F1], which changes only the sign of j and adds a free terminal Z when e=1. Its H count is therefore minimal. Conversely if either parity condition fails, the adjacent even-interior pair reduces, giving strictly fewer than h+2 H gates. Thus the extension condition is equivalent to p(ℓ)=1−p(a) and p(j)=1−p(c).

3.1step 1.1step 1.2step 2.1algebra

Apply step 1.2 to the extended matrix V=HTℓUTjH. Multiplication by these endpoint factors gives t(V)≤t(U)+p(ℓ)+p(j), while h(V)=h+2 gives t(V)≥h+1. Consequently t(U)≥h+1−p(ℓ)−p(j)=h−1+p(a)+p(c). Step 1.1 attains this bound, proving simultaneous optimality and both formulas. The same argument proves the endpoint formula for every reduced word with at least one H, since its extension still has at least three H gates and [F1] applies.

4.1F1step 1.1step 3.1step 1.3algebra∎

The initial word has O(n+1) gates and its stack reduction is linear by [F1], retaining only exponents modulo eight and a scalar exponent modulo eight. The preceding bounds give O(n+1) ring operations and O((n+1)2) bit operations overall. Any word's total H/T count is at least h(U)=n−1; the output has h+t≤2h+1=O(n+1) by step 1.1. Hence n+1=Θ(nopt+1), proving the claimed bounds.

Remarks

Appendix B prints h−1+p(ℓ)+p(j) with the same extension condition. Its endpoint parities are complemented, so that printed formula must be corrected as above. For example U=HTHTH has h=3,t=2; odd ℓ,j extend it to a reduced five-H word. The printed formula would give 4. No optimal base-circuit table or unexpanded endpoint case analysis is needed for the local proof.

TheoremStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

The exact single-qubit compiler returns the input matrix

Statement

For every unitary U∈M2(D), the procedure in Exact single-qubit Clifford+T synthesis terminates and returns a finite one-qubit Clifford+T word whose exact matrix is U.

Facts & Assumptions

Given: A unitary U∈M2(D), exact rational coefficient arithmetic, the descent procedure, and the finite base-column certificate.

[F1]

Exact single-qubit Clifford+T synthesis: the procedure tests unitarity, repeatedly applies M←HT−kM for a k lowering the squared-entry denominator exponent, looks up a base-column word W0, and returns the matrix factorization determined by the recorded k values and W0Tj.

[F2]

Clifford+T denominator descent and finite base table: each normalized D-column above exponent 3 has a reducing k∈{0,1,2,3}, and the certificate supplies an exact H/T preparation word for every normalized column in the base regime.

[F3]

Unit-modulus elements of the dyadic cyclotomic ring: if λ∈D and λλˉ=1, then λ=ωj for some j∈{0,…,7}.

[F4]

Smallest square root of two denominator exponent: the squared-entry statistic is sde⁡(∣M00∣2), with sde⁡(0)=−∞.

[F5]

Clifford+T gate library and exact matrices: H,T,T† have the displayed exact matrices, and the matrix of a chronological word is the product with later gates on the left.

[F6]

Denotational semantics of a finite layered circuit: for chronological layers L1,…,Ld, the circuit matrix is ULd⋯UL1.

[F7]

Reduced Hadamard words and their exact denominators: the final reduction preserves exact matrix equality, retaining its scalar phase.

Proof

1.1F1F5givenalgebra

Initially U=I⋅M with M=U. If a loop iteration records k and sets M′=HT−kM, then M=TkHM′. Therefore, after r reductions, the recorded sequence K=(k1,…,kr) satisfies U=(Tk1H)⋯(TkrH)M.

2.1F2F4F5step 1.1algebra

At every iteration, M remains unitary with entries in D, since the matrices in [F5] are unitary over D. If its exponent exceeds 3, [F2] ensures that the finite search over k=0,1,2,3 finds a value reducing that integer exponent by exactly one. Thus the loop terminates after finitely many iterations with exponent at most 3.

3.1F1F2F3step 2.1algebra

Let W0 be the table word for the first column of the terminal M. Then W0∗M is unitary with first column (1,0)T, hence is diag⁡(1,λ) for a unit scalar λ. Its entries lie in D, so [F3] gives λ=ωj for some j∈{0,…,7}. Consequently M=W0Tj.

4.1F1F6F7step 1.1step 3.1algebra∎

Substituting this identity into step 1.1 yields exactly the matrix factorization returned in [F1]. The algorithm emits its factors from right to left as a chronological gate list; [F6] says later gates multiply on the left, so that list has the displayed matrix. The final reduction preserves this matrix by [F7], including its scalar factor. Hence the returned word implements U exactly.

Unresolved supplier checks

The actual QC07 gate matrices and QC09 chronological circuit semantics were inspected. The emitted factor order agrees with the supplier convention. The local exact synthesis proof and finite table are complete; this records interface reconciliation, not independent acceptance of QC07/QC09 drafts.

TheoremStatement: AI-adaptedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

The Rz approximation procedure is correct when it returns

Statement

For θ∈R and ε>0, every word returned by Ancilla-free Clifford+T Rz approximation satisfies ∥Rz(θ)−W∥op≤ε, provided each accepted norm output is exact and the exact compiler returns the requested matrix. When ε≥c=∣1−eiπ/8∣, the algorithm returns its direct zero-T Clifford word. When 0<ε<c, it returns only after the scaled-grid and exact norm-solver branch succeeds. If its total candidate limit is unbounded, either the complete finite-search norm mode is used or the complete factorization-based mode receives valid factorizations in finite time, and the required exact-real comparisons terminate, then it terminates for every such input. With the efficient randomized factored norm mode and independent random bits it terminates with probability one under those assumptions. A finite candidate limit can return TIMEOUT.

Facts & Assumptions

Given: The exact Rz approximation procedure, the exact epsilon-region criterion, and the finite coefficient bound for each denominator layer.

[F1]

Ancilla-free Clifford+T Rz approximation: if ε≥c it returns the direct zero-T Clifford; otherwise, for a candidate u and an exact solution t†t=1−u†u, it forms U=(u−tˉtuˉ) and U′=TUT†, then returns an exact compilation of one of them.

[F2]

The exact operator-norm epsilon region for determinant-one Rz candidates: a determinant-one matrix of the displayed form is within ε of Rz(θ) exactly when Re⁡(eiθ/2u)≥1−ε2/2.

[F3]

Every Rz epsilon region contains an exact norm-solvable grid point: for every 0<ε<1/2 there exists a grid candidate u and an exact t∈D solving its norm equation.

[F4]

Finite coefficient bounds for the scaled cyclotomic grid: every grid candidate at fixed exponent k has coefficients in a finite explicit box, and every candidate has a finite nonnegative exponent.

[F5]

The exact single-qubit compiler returns the input matrix: the exact compiler returns a word with matrix exactly the requested unitary.

[F6]

Clifford+T gate library and exact matrices: T is diagonal and commutes with Rz(θ).

[F7]
[A2]

In the correctness clause, every successful norm-solver outcome used by the procedure supplies an exact t satisfying t†t=1−u†u.

[F8]

Constructive decision of the dyadic cyclotomic norm equation proves that the finite-search norm mode terminates, decides solvability exactly, and returns an exact solution whenever one exists.

[F9]

Complete scaled-grid enumeration with expected polynomial prefix cost proves complete, nonduplicating increasing-exponent enumeration, with finite layer completion for every sequence of iterator random bits.

[F10]

Efficient exact cyclotomic norm solving with a supplied integer factorization proves that the efficient norm mode is exact and complete and terminates almost surely on every valid algebraic input with its supplied factorization.

[F11]

Determinant-one reduction for optimal Rz approximation: for every ε≥c there is a determinant-one Clifford word of T-count zero within ε of Rz(θ).

[A1]

In the termination clause, any requested factoring oracle returns a valid factorization in finite time, the exact integer-part operation used by the direct branch terminates when that branch is taken, and the exact-real comparisons required by the grid enumerator terminate with correct answers.

Proof

1.1A2F1F2givenconstruct

If ε≥c, the direct branch returns the zero-T Clifford word whose error bound is proved in [F11]. Suppose instead 0<ε<c. If the procedure returns, its successful candidate satisfies the scaled-grid real-part inequality by construction and [A2] gives the exact norm equation. Thus ∣u∣2+∣t∣2=1; multiplying the displayed matrix by its conjugate transpose gives U∗U=I and det⁡U=∣u∣2+∣t∣2=1. Therefore U is in the form required by [F2], which gives ∥Rz(θ)−U∥op≤ε.

2.1F1F2F6F7step 1.1algebra

Since T and Rz(θ) are diagonal, they commute. By [F7], unitary left and right multiplication preserve the operator norm: the left factor preserves every vector norm, and the right factor bijects the unit sphere to itself. Thus ∥Rz(θ)−TUT†∥op=∥T†Rz(θ)T−U∥op=∥Rz(θ)−U∥op. Thus both compiler inputs meet the same error bound.

2.2A1F3F4F8F9step 1.1algebra

If ε≥c, [A1] makes the direct integer-part operation terminate, so the zero-T word is returned. Suppose 0<ε<c. Then ε<1/2, and [F3] gives a solvable grid candidate with some finite exponent k. By [F4], each layer from 0 through k has finitely many coefficient vectors. The finite-search alternative checks them all; the default iterator enumerates precisely the candidates and finishes each preceding layer by [F9]. By [F8], each norm call terminates and it succeeds when that candidate is reached; the finitely many comparison and oracle calls terminate by [A1]. Therefore the unbounded loop terminates after finitely many earlier layers and candidates. A finite candidate limit may instead cause TIMEOUT before this point.

3.1F1F5step 1.1step 2.1algebra

The exact compiler conclusion [F5] makes each returned word's matrix equal its selected input. Since the procedure chooses between U and U′, step 2.1 proves the returned word satisfies the required bound.

4.1A1F3F4F9F10step 2.2algebra∎

For efficient factored mode, take a fixed exponent k for one solvable candidate from [F3]. There are only finitely many candidates in layers through k, independent of their within-layer order. The iterator finishes each preceding layer for every random-bit sequence by [F9]. On each of these finitely many algebraic inputs, the norm call terminates with probability one by [F10]. With fresh independent solver bits this remains true conditional on the history, so the finite union of nontermination events has probability zero. On its complement the same candidate argument as in step 2.2 gives successful return.

Remarks

The finite-search mode has no polynomial runtime assertion. The efficient factored mode has almost-sure termination and its separate proved polynomial expected algebraic cost. A finite factor-attempt budget may skip every solvable candidate; this theorem does not infer termination with a circuit from that branch.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Denominator exponent and optimal T count for determinant-one unitaries

Statement

Let U=(u−tˉtuˉ)∈SU(2) with u,t∈D. Let k be the least nonnegative integer such that (2)ku,(2)kt∈O. Count T gates over G={H,T,T†,S,S†,X,Y,Z} up to global phase. If k>0, each of U and TUT† has optimal T count in {2k−2,2k}, and

min⁡{t(U),t(TUT†)}=max⁡{0,2k−2}.

If k=0, both counts are zero. If u,t are nonzero and k>0, their individual least exponents both equal k.

Facts & Assumptions

Given: The displayed determinant-one matrix, exact gate matrices, and the stated cost model.

[F1]

Exact single-qubit Clifford+T ring characterization supplies an exact Clifford+T word for every unitary over D.

[F2]

Reduced Hadamard words and their exact denominators gives an exact reduced word with h H gates and odd interior powers, and squared-entry exponent h+1 for h≥2 or 2 for h=1.

[F3]

H-count and T-count optimality of exact Clifford+T synthesis establishes T optimality of every reduced word with h≥1, with count h−1+p(a)+p(c) for endpoint exponents a,c.

[F4]

Squared entry denominator bound gives sde⁡(∣z∣2)∈{2r,2r−1} when r=sde⁡(z).

[F5]

Unit-modulus elements of the dyadic cyclotomic ring says a unit-modulus element of D is a power of ω.

Proof

1.1F1F2F4F5givenalgebra

Reduce an exact word supplied by [F1] as in [F2], retaining its scalar ωq. When h=0, the matrix is monomial with unit-modulus nonzero entries, so [F5] gives k=0. Since its determinant is one, its diagonal exponent is even: its determinant is ω2q+a+4e. Hence the matrix uses no T gates, and neither does its conjugate by T, which changes its monomial exponent by 0 or 2. When h=1, every entry has modulus 1/2, and [F4] gives exponent 1 for every entry; thus k=1.

2.1F2F4step 1.1algebra

For h≥2, set s=h+1>0. All four squared moduli have exponent s: they are either ∣u∣2 or 1−∣u∣2, and the latter has primitive numerator whenever the former has positive least exponent, since subtracting from (2)s cannot make its primitive numerator divisible by 2. By [F4], every entry therefore has exponent ⌈s/2⌉, so k=⌈(h+1)/2⌉. Together with step 1.1, every case with h≥1 has h∈{2k−2,2k−1}, except that h=0 was treated separately.

3.1F3step 1.1step 2.1algebra∎

Write A=p(a)+p(c)∈{0,1,2}. The exact reduced word has determinant ω2q+a+c+∑bi+4(h+e)=1, so A+h−1 is even. Its optimal T count is h−1+A by [F3]. Conjugating by T changes the endpoint exponents to a+1 and c−(−1)e and leaves every odd interior exponent unchanged; hence both endpoint parities flip. The conjugate is still reduced with the same h and has optimal count h−1+(2−A). If h=2k−2 is even, the determinant parity forces A=1, giving both counts 2k−2. If h=2k−1 is odd, it forces A=0 or 2, giving the two counts 2k−2 and 2k. This includes h=1,k=1. Together with the monomial case in step 1.1, all assertions follow.

Remarks

The common nonnegative exponent handles u=0 without assigning a negative or infinite matrix exponent. When u,t are nonzero and k>0, the proof shows it is also the individual least exponent used in the usual synthesis formula. This provides the denominator/T-count relation locally rather than invoking a normal-form figure as a proof.

TheoremStatement: AI-adaptedProof: AI-adaptedOpen item page →

T-count guarantees for Clifford+T Rz synthesis

Statement

For the ancilla-free, on-the-nose Rz(θ) problem with ε>0, the procedure first returns its zero-T Clifford whenever ε≥c0=∣1−eiπ/8∣. In the remaining range 0<ε<c0, it has the following guarantees with its exact-real comparison and norm-solver assumptions.

  1. In complete mode with a factoring oracle and a complete factorization-based solver for t∗t=ξ, the first successful candidate yields a circuit of minimum T-count among all one-qubit Clifford+T circuits satisfying the operator norm bound. The direct branch for ε≥c0 is also optimal because it has T-count zero.
  2. In bounded-factorization mode, for 0<ε<c0, under Ross–Selinger Hypothesis 8.3, interpreted quantitatively as [A1] below, if m is the returned T-count and m′′ is the second-smallest T-count among non-equivalent feasible solutions, then the expected number of non-equivalent feasible solutions of T-count strictly below m is O(log⁡(1/ε)), and E[m]≤E[m′′]+O(log⁡log⁡(1/ε)) as ε→0. Both expectations include the arithmetic-instance randomness of [A1]; m′′ is almost surely defined and integrable in this range. If m′′ is deterministic in the chosen model, its expectation is simply m′′. For c0≤ε<1/2, the direct branch returns m=0, so there are no feasible solutions of smaller T-count and the same mean bound is immediate whenever m′′ is defined.
  3. For 0<ε<1/2, with the efficient iterator and calibrated capped-prime implementation specified below, the expected arithmetic-operation time is O(polylog⁡(1/ε)). In the range c0≤ε<1/2, the direct branch takes constant arithmetic work. These are not bit-time bounds for arbitrary unencoded real inputs.

Two determinant-one solutions are equivalent when their upper-left entries u agree; the T-count of a class is the least count attained in that class. The nontrivial near-optimality assertion concerns the unbounded candidate stream, without a finite total candidate budget. The source's notation E[m]=m′′+O(log⁡log⁡(1/ε)) is used here only in the upper bound sense of its Proposition 8.8. In the explicit random-arithmetic model [A1], the second-best class is random as well, so its count must also be averaged. No lower bound relative to that class is asserted.

Facts & Assumptions

Given: The exact-real comparisons, the procedure in Ancilla-free Clifford+T Rz approximation, and the displayed input.

[F1]

The Rz approximation procedure is correct when it returns gives correctness for all ε>0 and successful termination in COMPLETE mode with an unbounded candidate limit, valid complete factorizations when required, and terminating exact-real operations (almost surely for the efficient randomized norm mode).

[F2]

Determinant-one reduction for optimal Rz approximation: below c0=∣1−eiπ/8∣ all feasible matrices have determinant one; at or above c0 a determinant-one Clifford solution of T-count zero exists.

[F3]

Denominator exponent and optimal T count for determinant-one unitaries supplies the following interface: for a feasible candidate u of least exponent k and any solution t, the smaller optimal T-count of U and TUT† is f(k)=max⁡(0,2k−2), and no matrix in its u-class has count below f(k).

[F4]

Exponent growth of the Rz scaled grid supplies the increasing distinct candidate sequence, k2=O(1+log⁡(1/ε)), and kj≤k2+2⌈log⁡2j⌉.

[F5]

Size and residue of the Rz candidate norm integer: a candidate's reduced integer n is nonnegative, is zero or 1(mod8), and satisfies n≤4k. Its two disk inequalities also give 0≤ξ,ξ∙≤1 for the residual ξ=1−∣u∣2.

[F6]

Prime norm numerators congruent to one modulo eight are solvable: double positivity and prime n≡1(mod8) or n=1 imply solvability of the norm equation.

[F7]

Conditional stopping bounds for prime-tested Rz candidates proves all fixed stopping-time moments and the logarithmic expectation bound from a joint-failure product estimate; independence of actual solver successes is not required.

[F8]

Complete scaled-grid enumeration with expected polynomial prefix cost gives the default iterator's finite-layer completion and all fixed prefix-work moments. The second moment through j global outputs is polynomially bounded in j, kj, and L=1+log⁡(1/ε): completed layers contain at most j earlier outputs and at most kj+1 layers, while the current layer has the displayed prefix-moment bound.

[F9]

Efficient exact cyclotomic norm solving with a supplied integer factorization gives a complete expected-polynomial solver with a valid supplied factorization, including polynomial cost in the candidate exponent on these bounded grid inputs.

[F10]

H-count and T-count optimality of exact Clifford+T synthesis gives exact optimal compilation with polynomial coefficient cost. The fixed small-exponent base cases are covered by the same compiler's finite lookup and reduction.

[F11]

Certified capped norm attempts succeed on prime residuals proves that the calibrated capped prospective prime attempts accept only exact certificates, have polynomial cost on every candidate, and succeed with probability at least 1/2 on an actual prime numerator. Zero/unit numerators have explicit complete branches. Conditioning on all arithmetic data makes the calls independent in their fresh solver bits; averaging gives the joint-failure product bound from independent modelled prime indicators, without asserting unconditional independence of the actual successful calls.

[F12]

The nontrivial real-conjugation automorphism of the eighth cyclotomic field: ∙ is a field automorphism of K=Q(ω) preserving D. In particular it is injective: applying its inverse to x∙=0 gives x=0.

[A1]

Quantitative prime model: clauses 2--3 adopt an idealized stochastic model of candidate arithmetic in the sense of Ross--Selinger Hypothesis 8.3. The iterator and solver coins are drawn independently of the underlying modelled arithmetic instance, and solver streams are independent of one another. For each fixed enumerator/tie-choice framework, the model assumes that the indicators Ij of prime or zero/unit norm numerators are independent, with probabilities pj≥c/(kj+1), for a constant c>0 uniform in the input and tie choices. Other numerical data can be correlated. This is a model assumption before conditioning on all numerical candidate data; after those data are fixed, primality is fixed too. In particular, fixing an actual input and drawing iterator bits does not make its integers random or prove this hypothesis. The expectations in clauses 2--3 refer to this explicit idealized arithmetic model together with the algorithmic coins. The uniform lower bound is the quantitative reading of Hypothesis 8.3 used here; [F5] gives log⁡n=O(kj+1) for n>1. Zero/unit cases succeed outright. The model is not an established number-theoretic theorem about each deterministic input stream.

[A2]

For the probabilistic and runtime clauses use the efficient scaled-grid iterator and the calibrated capped-prime branch of the stated procedure, with fresh independent bits at each norm call and no finite total candidate limit. Bounded mode makes no extra factor-suggestion attempt. Complete mode instead supplies valid complete factorizations and uses the complete efficient solver. Every returned matrix is compiled by the optimal local exact compiler. The range c0≤ε<1/2 returns before either iterator or norm solver is called; its exact integer-part operation is counted as one arithmetic operation.

Proof

1.1F1F2F3F4givenalgebra

If ε≥c0, the direct branch from [F2] returns a feasible zero-T Clifford, which is globally optimal by nonnegativity of T-count. Suppose instead 0<ε<c0. Then [F1] gives a first solvable candidate in COMPLETE mode. Since the stream is ordered by exponent and the solver is complete, its exponent k is the least exponent of any solvable candidate. By [F3], taking the smaller compiled count returns f(k), the minimum across determinant-one feasible classes, because f is nondecreasing. By [F2] this is the global minimum.

1.2F2F5F6F7F11A1A2algebra

If c0≤ε<1/2, the direct branch returns m=0, so no feasible solution has T-count below m and the expected lower-count is zero; also E[m]=0≤E[m′′] whenever m′′ is defined. Suppose 0<ε<c0. For the bounded-factorization branch let J be the first successful mandatory prime-attempt index, using preassigned fresh bit streams along the candidate sequence. For each enumerator/tie-choice framework, condition first on all its arithmetic data D. By [F11], Pr⁡(J>j∣D)≤∏i=1j(1−Ii/2). Averaging over the arithmetic model [A1] gives Pr⁡(J>j)≤∏i=1j(1−pi/2)≤∏i=1j(1−c/(2(ki+1))). This uses independence of the modelled indicators only; actual successful calls may be correlated after averaging over numerical inputs. The procedure succeeds no later than J. Apply the joint-failure version of [F7], with c replaced by c/2: J is finite almost surely, E[J]=O(L), and E[log⁡2J]=O(1+log⁡L). All constants are uniform in the iterator tie choices, so these bounds survive averaging over its coins.

2.1F2F3F4step 1.2algebra

By [F3], the returned count satisfies m≤f(kJ). Every feasible class of count below m therefore has exponent strictly below kJ, since its class minimum is f(k) and f is nondecreasing. By [F2] these classes cover all feasible solutions. Distinct classes have distinct candidates and occur before index J, so their number is at most J−1. Taking expectations proves the lower-count solution bound.

2.2F2F3F4F5F6F7F11F12A1step 1.2algebra

The model has infinitely many prime or zero/unit candidates almost surely. Indeed, for each integer r≥1, the growth bound [F4] implies that for every sufficiently large m, ∑i=2m2m+1−1pi≥c 2m/(k2+2m+3). These block lower bounds imply ∑i=r∞pi=∞. Independence in [A1] gives Pr⁡(Ii=0 for every r≤i≤N)=∏i=rN(1−pi)≤exp⁡(−∑i=rNpi)→0. Thus with probability one good indices occur after every finite r, so there are infinitely many. By [F5], each candidate has ξ,ξ∙≥0. If n=0, then ξ∙ξ=0 in the field K gives ξ=0 or ξ∙=0. The latter also implies ξ=0 by [F12], so the solver returns t=0. If n=1 or n is prime, then n>0 makes both embeddings strictly positive; for prime n, [F5] gives n≡1(mod8), so [F6] makes the norm equation solvable. Distinct candidates give distinct u-classes, so the best and second-best feasible classes exist almost surely. Choose the best and second-best feasible classes, breaking equal-count ties by increasing exponent, and let their exponents be k′ and k′′. Since their class counts are f(k) and f is nondecreasing, this choice has k′≤k′′. The two classes are distinct candidates, so k2≤k′′. By [F3,F4], m≤2kJ≤2k′′+4⌈log⁡2J⌉≤m′′+2+4⌈log⁡2J⌉≤m′′+6+4log⁡2J. To check integrability of the benchmark, use the deterministic bound K=⌈log⁡2(512/ε2)⌉≥k2 from [F4], and let H be the second index with IH=1. If each of the blocks 1,…,r and r+1,…,2r contains a good index, then H≤2r. By [A1,F4] and the same failure-product bound, Pr⁡(H>2r)≤2exp⁡ ⁣(−crK+2⌈log⁡2(2r)⌉+1). The tail comparison in [F7] gives finite moments of H. The first two good indices give two feasible classes, so m′′≤2kH by [F3], and [F4] makes m′′ integrable. Also m≤2kJ is integrable by step 1.2. Taking expectations of the pathwise inequality and applying step 1.2 now gives E[m]≤E[m′′]+O(1+log⁡L), which is the stated asymptotic bound.

2.3F4F7F8step 1.2algebra

If c0≤ε<1/2, the direct branch takes constant arithmetic work, including one exact integer-part operation and reducing exponents modulo 8. Suppose 0<ε<c0. Write Cj for the iterator work through its jth global candidate, with no norm calls interleaved. The exponent sequence kj depends only on the number of distinct candidates in each layer, so it is unchanged by the iterator's randomized tie order. By [F4,F8], for some fixed D, E[Cj2]≤C(j+1)2(L+1+log⁡(j+1))D. The joint-failure estimate of step 1.2 and [F7] give the stopping tail uniformly for each enumerator/tie-choice framework in [A1], hence also after averaging over the independent iterator coins: Pr⁡(J>j)≤exp⁡(−j/(a+bln⁡j)), with a=O(L) and fixed b>0. Cauchy--Schwarz, applied separately to each event J=j, therefore gives E[CJ]≤∑j≥1E[Cj2]Pr⁡(J=j). For completeness, the product bound follows by expanding the nonnegative expectation of (X/E[X2]−Z/E[Z2])2 with X=Cj and Z=1{J=j}; if either second moment vanishes its term is zero. This sum is polynomial in L. Indeed, for j≥a the tail proof of [F7] bounds its exponential factor by exp⁡(−c1j/a); bound logarithms by powers of j and compare the resulting polynomial-times-exponential sum with its integral, using y=t/a. The part j<a is also polynomial. Thus no independence between iterator delay and J is assumed.

3.1F3F4F5F7F9F10F11A2step 1.2step 2.3algebra∎

In capped mode [F11,A2] bound all candidate work through J by Jpoly⁡(1+kJ), plus the successful exact compilation. In oracle mode take J to be the first prime/zero/unit model index, which has the same tail and moment bounds and is solvable by [F6]. Then [F9] supplies the same bound in conditional expectation: condition on the preceding history before each call, and sum its uniform polynomial expected bound over the calls that are reached. Integer-factor oracle calls cost one operation; their factorization outputs have polynomial length by [F5]. The stopping bounds [F4,F7] make the expectation of these polynomial expressions finite and polynomial in L. By [F3,F10], successful exact compilation also has polynomial cost in kJ+1: its entry denominators are at most kJ and squared-entry exponent at most 2kJ, with only finitely many small cases. Combining this with step 2.3 proves the expected polynomial arithmetic runtime for the actual efficient implementations. It includes charged exact-real arithmetic and comparisons, but supplies no bit-time guarantee for unencoded real parameters.

Remarks

The complete coefficient-box iterator and divisor-search norm solver remain valid alternatives for completeness. Their costs are not used in the expected polynomial bound. Capped prospective executions never infer unsolvability from an unproved prime promise: only a verified exact norm certificate is accepted. The candidate-primality model remains an explicit number-theoretic hypothesis.

5 · Examples, counterexamples and false statements

None yet.

Sources