Alphabeta Math
AlgorithmAlgorithm: AI-adaptedProof: Not applicablePipeline-generatedjudge pass (gpt-6-luna)
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.

Shor factoring with verified output and bounded outer retries

Definition

Inputs. A composite integer N≥4, encoded in binary, and a rational target failure probability δ=u/v with coprime integers 0<u<v. Use the modular-order-finding procedure on the earlier A page with its explicit reversible modular-multiplication circuit. Output is a verified proper divisor of N or FAIL.

Arithmetic subroutines. For c≥1 and exponent e≥0, CappedPower(c,e) returns min⁡{ce,N+1}: initialize (r,d,k)=(1,c,e); while k>0, replace r by min⁡{rd,N+1} if k is odd, then replace k by ⌊k/2⌋ and, if the new k>0, replace d by min⁡{d2,N+1}. For any integer c and exponent e≥0, ModPower(c,e) returns ce mod N: initialize (r,d,k)=(1,c mod N,e); while k>0, replace r by rd mod N if k is odd, then replace k by ⌊k/2⌋ and, if the new k>0, replace d by d2 mod N. In both routines, parity, quotient, product, comparison, and remainder operations are exact integer operations.

  1. Set n=⌈log⁡2N⌉. If N is even, set d=2, check 1<d<N and N mod d=0, and return d if both checks pass.

  2. For each integer exponent e=2,3,…,n, initialize L=2 and R=N. While L≤R, set b=⌊(L+R)/2⌋ and y=CappedPower(b,e). If y<N, set L=b+1. If y>N, set R=b−1. If y=N, verify 1<b<N and N mod b=0; return b if both checks pass, and otherwise set R=b−1. If the loop ends without a return, continue to the next exponent.

  3. Initialize T=1, A=5, and B=8. While Av>Bu, replace (T,A,B) by (T+1,5A,8B). Continue to instruction 4 with this T; it is the least positive integer satisfying 5Tv≤8Tu, equivalently T=⌈ln⁡(1/δ)/(−ln⁡(5/8))⌉.

  4. For attempts i=1,…,T, obtain a fresh independent sample a by running Exact uniform sampling from the nonzero residue representatives on N with a fresh independent countable fair-bit tape. Compute g=gcd⁡(a,N). If 1<g<N and N mod g=0, return g. If g≠1, start the next attempt; the case g=N is rejected as an invalid sample and also starts the next attempt.

  5. When g=1, run modular order finding on (N,a) with target parameter b=2, so its target failure is 2−2=1/4. Use fresh measurement randomness independent of the sampler tape and all previous attempts. If it returns FAIL, start the next attempt. Otherwise let q be its candidate. Reject the candidate unless 2≤q≤N, q is even, and ModPower(a,q)=1. Set z=ModPower(a,q/2), the standard representative of aq/2 mod N. Compute d−=gcd⁡(z−1,N) and d+=gcd⁡(z+1,N). Return the first of these satisfying 1<d±<N and N mod d±=0; if neither passes, start the next attempt.

  6. If all T attempts finish without returning a divisor, return FAIL.

The residue sampler's exact uniformity, almost-sure termination, and expected-bit bound are proved separately. The outer attempt count, root search, modular exponentiation, and divisor checks have the finite bounds stated above. Correctness, success probability, and costs are separate claims.

Remarks

The odd-composite branch reaches order finding only after the gcd test establishes gcd⁡(a,N)=1, so the residue class of a is a unit by For n≥1, [a]n is a unit if and only if gcd⁡(a,n)=1. A returned candidate period is rechecked even though the order-finding contract also verifies candidates. Its fair-bit tapes use countable choice and dependent choice through the sampler's countable product model; the number-theoretic and output-verification branches use finite arguments. Order-finding success and cost are separate claims.

Depends on

Used by

Dependency tree · two levels

79 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