#6. 模同余相关性质和中国剩余定理证明
题目描述
本试题涉及 modulo 相关定理与中国剩余定理的形式化。请完成下列定理和引理的证明部分。
任务
1. modulo_tran (40 分)
modulo 的传递性:
theorem modulo_tran (a b c n : Int) :
modulo n a b → modulo n b c → modulo n a c2. modulo_mult_subst (40 分)
modulo 的乘法性质:
theorem modulo_mult_subst (a b c n : Int) :
modulo n a b → modulo n (a * c) (b * c)3. modulo_inv (60 分)
若 和 互素 (rel_prime),则存在 满足 是 在模 下的乘法逆元。
theorem modulo_inv (m n : Int) :
rel_prime m n → ∃ x : Int, modulo n (m * x) 1提示:可以使用 Bézout 定理。在 Mathlib 中使用 Int.gcd_eq_gcd_ab。
4. SimpleChineseRemainder (60 分)
简单版本中国剩余定理:对任意两个整数 和 ,如果我们已经知道 和 是互素的整数,那么我们总可以找到一个整数 ,使得 并且 。
theorem SimpleChineseRemainder (m n : Int) :
rel_prime m n →
∀ (a b : Int), ∃ x : Int, modulo m x a ∧ modulo n x b提示:首先获得 使得 ,然后设 。
分值
- modulo_tran: 40 分
- modulo_mult_subst: 40 分
- modulo_inv: 60 分
- SimpleChineseRemainder: 60 分
总计: 200 分