S001 · implies
Before
a=5; n=42≥2
After
compute gcd and a Bezout certificate before inversion
Conditions: none
Invertibility requires coprimality, after qualifying the modulus.
Step identifiers and dependencies
Rule: modular_domain · Uses: G001
Explore related knowledge and questions →
← Question derivation index · Original question batch
P1000-0341 · q-20261014-advance-20261103-r07-modular-inverse-0016
Use the original signed integer a=5 and modulus n=42≥2. Exact extended Euclid gives nonnegative g=gcd(a,n) and signed coefficients x,y satisfying a*x+n*y=g. An inverse exists exactly when g=1; normalize its representative to 0≤inverse<n. Uniqueness means one residue class modulo n, not a unique integer representative. This family excludes moduli 0 and 1 and does not use approximate division. Give (a,n,gcd,exists?,inverse), with inverse=null for a nonunit.
G001 — Use the original signed integer a=5 and modulus n=42≥2. Exact extended Euclid gives nonnegative g=gcd(a,n) and signed coefficients x,y satisfying a*x+n*y=g. An inverse exists exactly when g=1; normalize its representative to 0≤inverse<n. Uniqueness means one residue class modulo n, not a unique integer representative. This family excludes moduli 0 and 1 and does not use approximate division. Give (a,n,gcd,exists?,inverse), with inverse=null for a nonunit.Integer a and modulus n≥2. An inverse exists exactly when gcd(a,n)=1; normalize the representative into [0,n).
Before
a=5; n=42≥2
After
compute gcd and a Bezout certificate before inversion
Conditions: none
Invertibility requires coprimality, after qualifying the modulus.
Rule: modular_domain · Uses: G001
Before
divide 5 by 42
After
5=0·42+5
Conditions: none
Continue with divisor and remainder; nonzero remainders decrease strictly.
Rule: euclidean_division · Uses: G001, S001
Before
divide 42 by 5
After
42=8·5+2
Conditions: none
Continue with divisor and remainder; nonzero remainders decrease strictly.
Rule: euclidean_division · Uses: G001, S002
Before
divide 5 by 2
After
5=2·2+1
Conditions: none
Continue with divisor and remainder; nonzero remainders decrease strictly.
Rule: euclidean_division · Uses: G001, S003
Before
divide 2 by 1
After
2=2·1+0
Conditions: none
Continue with divisor and remainder; nonzero remainders decrease strictly.
Rule: euclidean_division · Uses: G001, S004
Before
a·x := mul(5, 17)
After
a·x = 85
Conditions: none
Multiply by the original signed a.
Rule: exact_rational_arithmetic · Uses: G001, S005
Before
n·y := mul(42, -2)
After
n·y = -84
Conditions: none
Retain the modulus coefficient as well.
Rule: exact_rational_arithmetic · Uses: G001, S006
Before
Bezout value := sum(85, -84)
After
Bezout value = 1
Conditions: none
The two terms must sum to the final nonzero remainder, the gcd.
Rule: exact_rational_arithmetic · Uses: G001, S007
Before
5·(17)+42·(-2)=1
After
inverse representative=17; 5·17≡1 (mod 42)
Conditions: none
Modulo n the modulus term vanishes; normalize the coefficient of a into[0,n).
Rule: reduce_bezout · Uses: G001, S008
S009 · premise_and_result_audit — Check integer identities, remainder bounds and gcd conditions; congruence is not integer equality.S008 · premise_and_result_audit — Recompute Bezout value with exact rational arithmetic, not rounded decimals.S007 · premise_and_result_audit — Recompute n·y with exact rational arithmetic, not rounded decimals.S006 · premise_and_result_audit — Recompute a·x with exact rational arithmetic, not rounded decimals.S005 · premise_and_result_audit — Check integer identities, remainder bounds and gcd conditions; congruence is not integer equality.S004 · premise_and_result_audit — Check integer identities, remainder bounds and gcd conditions; congruence is not integer equality.S003 · premise_and_result_audit — Check integer identities, remainder bounds and gcd conditions; congruence is not integer equality.S002 · premise_and_result_audit — Check integer identities, remainder bounds and gcd conditions; congruence is not integer equality.S001 · premise_and_result_audit — Check integer identities, remainder bounds and gcd conditions; congruence is not integer equality.(5, 42, 1, Yes, 17)
The full substitutions and premise audits recover the original answer, retaining its field order and verdict meanings.
Review date: 2026-10-26
Original questions, answers, step expressions, numeric ASTs and historical records are retained. Source candidate labels remain historical and are not overwritten as formal proof.
input commit: 0f7be61e2c22317a4075561dc822c87d881a50dboriginal question SHA-256: 27c345cb7a3fb334deb3761712b6657f1e22bbc9ce6cf62f2393f7bd6f5054aacandidate record SHA-256: 6f85582f971a6b7ea386651787c0bc3e72854e9708697038f1cde0a4e9b3817dsemantic review receipt SHA-256: 6c2c6d46aded7582a11ac41a8c0b3bdde2669a53bdb6e796eea2039994a02772question-first witness SHA-256: 77e43898df9efdbf8094ad81fe4ab91cf4b4bd82f481eb9b4699b73cb4da612bLean: NOT_RUN · human review: NOT_PERFORMED