Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-adaptedPipeline-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.

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.

Depends on

Used by

Dependency tree · two levels

30 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources