查找相關知識與題目 →

第 71 題:模反元素

本頁導覽
  1. 原題與已知條件
  2. 定義與適用範圍
  3. 逐步推導
  4. 逐步反向核對
  5. 結論
  6. 本題覆核與來源綁定

返回所在分頁 1

← 逐題詳解目錄 · 原題批次

P250-0071 · q-20261014-advance-20261103-r07-modular-inverse-0071

原題與已知條件

整數a與模數n大於等於2的exact Euclidean arithmetic。操作=modinv-normalized-inverse;資料={"a":2,"n":47}。請依 [a,n,inverse,product_mod_n,valid,uniqueness] 欄序回答。

  • G001 — 整數a與模數n大於等於2的exact Euclidean arithmetic。操作=modinv-normalized-inverse;資料={"a":2,"n":47}。請依 [a,n,inverse,product_mod_n,valid,uniqueness] 欄序回答。

定義與適用範圍

整數模數 n≥2 且 gcd(a,n)=1;唯一性指模類及指定區間的代表元。

逐步推導

S001 · implies

操作前

a=2, modulus=47

操作後

n=47≥2; seek u with 2u≡1 (mod 47)

條件:無

先固定模數與逆元條件,目標不是整數乘積恰等於 1。

步驟識別與依賴

規則:inverse_definition · 依賴:G001

S002 · implies

操作前

divide 2 by 47

操作後

2=0·47+2

條件:0≤2<47

商為 0、餘數為 2;每次用前一除數與餘數繼續。

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S001

S003 · implies

操作前

divide 47 by 2

操作後

47=23·2+1

條件:0≤1<2

商為 23、餘數為 1;每次用前一除數與餘數繼續。

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S002

S004 · implies

操作前

divide 2 by 1

操作後

2=2·1+0

條件:0≤0<1

商為 2、餘數為 0;每次用前一除數與餘數繼續。

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S003

S005 · implies

操作前

last nonzero Euclidean remainder

操作後

gcd(2,47)=1; 2·(-23)+47·(1)=1

條件:無

沿除法鏈保留整數線性組合,得到實際的 Bézout 等式。

步驟識別與依賴

規則:bezout_identity · 依賴:G001, S004

S006 · implies

操作前

2·(-23)+47·(1)=1

操作後

-23 mod 47=24; 0≤24<47

條件:無

Bézout 的 a 係數已代表逆元類,再取指定區間內的代表元。

步驟識別與依賴

規則:normalize_residue · 依賴:G001, S005

S007 · calculation

操作前

a·u := mul(2, 24)

操作後

a·u = 48

條件:無

將原 a 與正規化逆元相乘。

步驟識別與依賴

規則:exact_rational_arithmetic · 依賴:G001, S006

S008 · implies

操作前

a·u=48

操作後

48=1·47+1 ⇒ a·u mod n=1

條件:無

乘積與 1 的差是模數的整數倍,故逆元條件成立。

步驟識別與依賴

規則:congruence_check · 依賴:G001, S007

S009 · implies

操作前

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, 47, 24, 1, 是, unique_modulo_n)

逆元代表是 24,唯一性以模 47 解讀。

本題覆核與來源綁定

覆核日期:2026-10-24

原題、答案、步驟表達式、數值 AST 與既有歷史保持原樣;原來的候選狀態屬於來源歷史,不覆寫為形式化證明。

來源雜湊與覆核憑證
  • input commit: 0f7be61e2c22317a4075561dc822c87d881a50db
  • original question SHA-256: 97ee63b799d59f076f3002cb01651fdbf9e054ec87c09e1ea4dd32c4a3b107eb
  • candidate record SHA-256: 47ab2cba7862ce8719b8fc2b8f9a398a466dc2f2f62239b8e0ab9862ce1b8ebf
  • semantic review receipt SHA-256: 4727d1bd957a9b7f6cadb7972ddb5ab80a31f5259dc5394c1dff2b71944ed36b
  • question-first witness SHA-256: 51e18649133238ac992229f6e16542a5f3af53ca73b2262ab0524508ea937dee
  • Lean: NOT_RUN · human review: NOT_PERFORMED
同源完整 JSON