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.
Correctness and bit cost of the modular inverse recurrence
Statement
For and , Extended-Euclidean modular inverse with bounded bit cost returns NO_INVERSE exactly when is not a unit modulo , and otherwise returns the unique with . With , the algorithm uses bit operations.
Facts & Assumptions
Given: Integers , , Euclidean division, and binary schoolbook arithmetic.
Each division has unique quotient and remainder with (Division with remainder in : for and there are unique with and ).
The Euclidean remainder sequence terminates at (The Euclidean algorithm: for and the remainder descent from terminates, and the last nonzero remainder is ).
A residue class is a unit modulo exactly when its representative is coprime to (For , is a unit if and only if ).
The recurrence, initialization, and return rule are those of Extended-Euclidean modular inverse with bounded bit cost.
Proof
First handle : since , , so the algorithm returns NO_INVERSE, correctly. Suppose . The initialized coefficients satisfy and .
If and modulo , the division identity and update give
Replacing a coefficient by its least residue preserves this congruence. Induction proves for every generated index.
By [F1], each positive remainder is strictly smaller than its predecessor, so the divisions terminate. By [F2], the last nonzero remainder is . The algorithm returns an exactly when ; by [F3], this is exactly the unit case. If it returns, the invariant at the last nonzero index says , hence the returned least residue is an inverse. If , [F3] says no inverse exists, so NO_INVERSE is correct.
Let . There are divisions: in two consecutive Euclidean divisions the remainder falls below half its earlier positive value. Indeed, if this already holds; otherwise , so the next quotient is and . Thus at most two steps halve a positive remainder, which has at most bits.
Every quotient, remainder, and coefficient residue has bits; each Euclidean quotient is found by binary long division in bit operations. Each product and reduction modulo also costs by schoolbook multiplication and division. With iterations from step 3.1, the total is .
Depends on
- Extended-Euclidean modular inverse with bounded bit cost
- Division with remainder in $\mathbb{Z}$: for $a \in \mathbb{Z}$ and $b > 0$ there are unique $q, r \in \mathbb{Z}$ with $a = qb + r$ and $0 \le r < b$
- The Euclidean algorithm: for $a \in \mathbb{Z}$ and $b > 0$ the remainder descent from $(a,b)$ terminates, and the last nonzero remainder is $\gcd(a,b)$
- For $n\ge1$, $[a]_n$ is a unit if and only if $\gcd(a,n)=1$
Used by
Dependency tree · two levels
31 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
- Andrew M. Childs, Lecture Notes on Quantum Algorithms (17 April 2025) (standard reference, not scraped)
- D. Proos and C. Zalka, Shor's discrete logarithm quantum algorithm for elliptic curves (standard reference, not scraped)