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.

Gate and bit cost of modular multiplication and powering

Statement

Let N≥2, n=⌈log⁡2N⌉, and let 1≤x<N be the standard representative of a known unit modulo N. In the explicit schoolbook Boolean construction of Reversible modular multiplication by a unit, each controlled multiplication by a known unit has a Boolean DAG with S,E=O(n2). Under the compiler of Gate, workspace, and serial-depth costs of reversible embedding, the complete clean circuit, including both XOR computations, n swaps, and inverse cleanup, uses O(n2) elementary gates and O(n2) clean work bits. Repeated-squaring constants x2j mod N and their inverses for O(n) powers can be computed in O(n3) deterministic multitape bit transitions. No depth bound is asserted.

Facts & Assumptions

Given: N≥2, 1≤x<N a standard unit representative, the stated schoolbook arithmetic, the reversible circuit in Reversible modular multiplication by a unit, and the resource models in Circuit-family and computation cost model and Classical bit-operation cost.

[F1]

The reversible compiler uses at most 6S+4E+m elementary gates and at most S+E clean work bits for an m-bit output Boolean DAG (Gate, workspace, and serial-depth costs of reversible embedding).

[F2]

The multiplier computes a controlled constant product, a remainder, a validity condition, the inverse cleanup, and n swaps; its correctness is established by Correctness of the reversible modular multiplier and its circuit stages are specified in Reversible modular multiplication by a unit.

[F3]

Bit cost counts multitape Turing-machine transitions and charges classical arithmetic, address/input work, and output writing; it is separate from gate and query costs (Classical bit-operation cost, Circuit-family and computation cost model).

[F4]

Division by a positive integer gives a unique quotient and smaller nonnegative remainder; the Euclidean descent from (N,x) with x>0 terminates at (gcd⁡(N,x),0) (Division with remainder in Z: for a∈Z and b>0 there are unique q,r∈Z with a=qb+r and 0≤r<b, The Euclidean algorithm: for a∈Z and b>0 the remainder descent from (a,b) terminates, and the last nonzero remainder is gcd⁡(a,b)).

[F5]

The operations in Z/NZ are well-defined ring operations, so congruences are preserved by subtraction and multiplication (For every natural n, (Z/n,+) is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold).

[F6]

A residue class modulo N is a unit exactly when its representative is coprime to N (For n≥1, [a]n is a unit if and only if gcd⁡(a,n)=1).

[F7]

Every residue class modulo positive N has a unique standard representative x with 0≤x<N (For n≥1, every class in Z/n has one representative r with 0≤r<n, so ∣Z/n∣=n; while Z/0 is in bijection with Z).

Proof

1.1givenF2algebra

In the explicit DAG of [F2], XOR emits four nodes, each adder bit emits two XORs and three carry nodes, hence 11 nodes, and subtraction emits one additional NOT per bit, hence 12w nodes at width w. Selection emits 1+3w nodes. The product uses n2 partial-product AND nodes and n adders of width 2n, totaling 23n2 nodes. Its 2n remainder stages use 2n(12(n+1)+1+3(n+1)) nodes. The final comparison uses 12(n+1) nodes, validity/control uses two more, final selection uses 1+3n, and the two shared constant nodes complete the count. Thus S≤100(n+1)2 suffices for all n≥1; every gate has at most two input ports, so E≤2S. The correctness supplier in [F2] proves that the row sums never overflow and that each remainder stage needs only one conditional subtraction; these are exactly the loops just counted.

1.2givenF3F4F5F6F7inductionalgebra

For the inverse computation, initialize (R,S,U,V)=(N,x,0,1) and, while S>0, divide R=qS+r with 0≤r<S, set h=(U−qV) mod N to its least residue, and simultaneously update (R,S,U,V) to (S,r,V,h). Initially R≡Ux and S≡Vx(modN); these two congruences are preserved because r=R−qS≡(U−qV)x≡hx(modN) by [F5]. The remainder pair is exactly the Euclidean descent in [F4], so it terminates at (R,S)=(gcd⁡(N,x),0)=(1,0) by [F6]. The invariant then gives Ux≡1(modN), and [F7] gives the returned inverse constant b0=U∈[0,N). For its cost, at every division 0<S<R≤N; the new remainder is r<R/2: if S≤R/2, then r<S≤R/2, while if S>R/2, then q=1 and r=R−S<R/2. Thus every two successive positive remainder values shrink by at least a factor of two, giving O(n) iterations. The quotients and remainders have O(n) bits, and U,V always lie in [0,N), so the signed intermediate U−qV has O(n) bits as well (its magnitude is at most N2+N). Schoolbook division, multiplication, subtraction and reduction each take O(n2) multitape transitions, including signed reduction by dividing the absolute value and, when needed, replacing a nonzero remainder d by N−d. Hence this explicit loop costs O(n3) transitions. Set a0=x, and for the remaining O(n) powers compute aj+1=aj2 mod N and bj+1=bj2 mod N. Induction gives aj≡x2j and ajbj≡1(modN); each stage uses two O(n2) schoolbook modular products, so all powers and inverses still cost O(n3) transitions.

2.1F1F2step 1.1algebra

Step 1.1 counts the complete Boolean function DAG, including the validity comparison, control, and conditional output, and gives S,E=O(n2). Apply [F1] separately to the forward and inverse functions; the two compiled XOR maps and their clean work each cost O(n2). The swap uses 3n CNOT gates. Adding these counts proves the claimed O(n2) gate and clean-work bounds; [F2] ensures they implement the required map.

3.1F1F3step 2.1step 1.2∎

The resource definition [F3] keeps gate count, classical bit transitions, and oracle queries separate. The preceding counts establish only gate/work and stated classical arithmetic bounds; no circuit layering or depth estimate follows from them.

Depends on

Used by

Dependency tree · two levels

72 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