查找相關知識與題目 →

第 68 題:模反元素

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

返回所在分頁 1

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

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

原題與已知條件

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

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

定義與適用範圍

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

逐步推導

S001 · implies

操作前

a=3, modulus=44

操作後

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

條件:無

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

步驟識別與依賴

規則:inverse_definition · 依賴:G001

S002 · implies

操作前

divide 3 by 44

操作後

3=0·44+3

條件:0≤3<44

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

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S001

S003 · implies

操作前

divide 44 by 3

操作後

44=14·3+2

條件:0≤2<3

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

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S002

S004 · implies

操作前

divide 3 by 2

操作後

3=1·2+1

條件:0≤1<2

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

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S003

S005 · implies

操作前

divide 2 by 1

操作後

2=2·1+0

條件:0≤0<1

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

步驟識別與依賴

規則:euclidean_division · 依賴:G001, S004

S006 · implies

操作前

last nonzero Euclidean remainder

操作後

gcd(3,44)=1; 3·(15)+44·(-1)=1

條件:無

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

步驟識別與依賴

規則:bezout_identity · 依賴:G001, S005

S007 · implies

操作前

3·(15)+44·(-1)=1

操作後

15 mod 44=15; 0≤15<44

條件:無

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

步驟識別與依賴

規則:normalize_residue · 依賴:G001, S006

S008 · calculation

操作前

a·u := mul(3, 15)

操作後

a·u = 45

條件:無

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

步驟識別與依賴

規則:exact_rational_arithmetic · 依賴:G001, S007

S009 · implies

操作前

a·u=45

操作後

45=1·44+1 ⇒ a·u mod n=1

條件:無

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

步驟識別與依賴

規則:congruence_check · 依賴:G001, S008

S010 · 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, S009

逐步反向核對

  • S010 · premise_and_result_audit — 唯一的是模類及指定區間的代表;u+kn 仍是其他整數代表。
  • S009 · premise_and_result_audit — 商數為整數,且餘數確實為 1。
  • S008 · premise_and_result_audit — 以精確有理數重算 a·u,不以小數近似替代。
  • S007 · premise_and_result_audit — 只正規化逆元代表,不要求 Bézout 的兩個係數都在該區間。
  • S006 · premise_and_result_audit — 直接乘開等式兩邊核對,不只相信 gcd 標記。
  • 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,才有此模反元素。

結論

(3, 44, 15, 1, 是, unique_modulo_n)

逆元代表是 15,唯一性以模 44 解讀。

本題覆核與來源綁定

覆核日期:2026-10-24

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

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