S001 · implies
操作前
a=2, modulus=35
操作後
n=35≥2; seek u with 2u≡1 (mod 35)
條件:無
先固定模數與逆元條件,目標不是整數乘積恰等於 1。
步驟識別與依賴
規則:inverse_definition · 依賴:G001
P250-0059 · q-20261014-advance-20261103-r07-modular-inverse-0059
整數a與模數n大於等於2的exact Euclidean arithmetic。操作=modinv-normalized-inverse;資料={"a":2,"n":35}。請依 [a,n,inverse,product_mod_n,valid,uniqueness] 欄序回答。
G001 — 整數a與模數n大於等於2的exact Euclidean arithmetic。操作=modinv-normalized-inverse;資料={"a":2,"n":35}。請依 [a,n,inverse,product_mod_n,valid,uniqueness] 欄序回答。整數模數 n≥2 且 gcd(a,n)=1;唯一性指模類及指定區間的代表元。
操作前
a=2, modulus=35
操作後
n=35≥2; seek u with 2u≡1 (mod 35)
條件:無
先固定模數與逆元條件,目標不是整數乘積恰等於 1。
規則:inverse_definition · 依賴:G001
操作前
divide 2 by 35
操作後
2=0·35+2
條件:0≤2<35
商為 0、餘數為 2;每次用前一除數與餘數繼續。
規則:euclidean_division · 依賴:G001, S001
操作前
divide 35 by 2
操作後
35=17·2+1
條件:0≤1<2
商為 17、餘數為 1;每次用前一除數與餘數繼續。
規則:euclidean_division · 依賴:G001, S002
操作前
divide 2 by 1
操作後
2=2·1+0
條件:0≤0<1
商為 2、餘數為 0;每次用前一除數與餘數繼續。
規則:euclidean_division · 依賴:G001, S003
操作前
last nonzero Euclidean remainder
操作後
gcd(2,35)=1; 2·(-17)+35·(1)=1
條件:無
沿除法鏈保留整數線性組合,得到實際的 Bézout 等式。
規則:bezout_identity · 依賴:G001, S004
操作前
2·(-17)+35·(1)=1
操作後
-17 mod 35=18; 0≤18<35
條件:無
Bézout 的 a 係數已代表逆元類,再取指定區間內的代表元。
規則:normalize_residue · 依賴:G001, S005
操作前
a·u := mul(2, 18)
操作後
a·u = 36
條件:無
將原 a 與正規化逆元相乘。
規則:exact_rational_arithmetic · 依賴:G001, S006
操作前
a·u=36
操作後
36=1·35+1 ⇒ a·u mod n=1
條件:無
乘積與 1 的差是模數的整數倍,故逆元條件成立。
規則:congruence_check · 依賴:G001, S007
操作前
a·v≡a·u≡1 (mod n), gcd(a,n)=1
操作後
n divides v−u; if 0≤u,v<n then u=v
條件:無
由 n|a(v−u),再把 Bézout 等式乘以 v−u,可知 n|(v−u)。正規化後差的絕對值小於 n,只能為零。
規則:inverse_uniqueness · 依賴:G001, S008
S009 · premise_and_result_audit — 唯一的是模類及指定區間的代表;u+kn 仍是其他整數代表。S008 · premise_and_result_audit — 商數為整數,且餘數確實為 1。S007 · premise_and_result_audit — 以精確有理數重算 a·u,不以小數近似替代。S006 · premise_and_result_audit — 只正規化逆元代表,不要求 Bézout 的兩個係數都在該區間。S005 · premise_and_result_audit — 直接乘開等式兩邊核對,不只相信 gcd 標記。S004 · premise_and_result_audit — 除法等式與 0≤餘數<除數都須成立。S003 · premise_and_result_audit — 除法等式與 0≤餘數<除數都須成立。S002 · premise_and_result_audit — 除法等式與 0≤餘數<除數都須成立。S001 · premise_and_result_audit — 必須先確認 gcd(a,n)=1,才有此模反元素。(2, 35, 18, 1, 是, unique_modulo_n)
逆元代表是 18,唯一性以模 35 解讀。
覆核日期:2026-10-24
原題、答案、步驟表達式、數值 AST 與既有歷史保持原樣;原來的候選狀態屬於來源歷史,不覆寫為形式化證明。
input commit: 0f7be61e2c22317a4075561dc822c87d881a50dboriginal question SHA-256: 7107a4e9ee99dfed1d8317e52aa53e5b774c92652f22705067be24e0b0660788candidate record SHA-256: e64da8f265f4d65334c03a29c25aa1352d454947a0c0166ca326e82c82743fccsemantic review receipt SHA-256: 4727d1bd957a9b7f6cadb7972ddb5ab80a31f5259dc5394c1dff2b71944ed36bquestion-first witness SHA-256: 51e18649133238ac992229f6e16542a5f3af53ca73b2262ab0524508ea937deeLean: NOT_RUN · human review: NOT_PERFORMED