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