主要内容

高等代数教学辅导

1.3 最大公因式和辗转相除法

定义 1.3.1.

\(f (x), g (x)\in \mathbb{F}[x]\)。若\(d(x)\in \mathbb{F}[x]\)满足:
  1. \(d(x) | f (x)\)\(d(x) | g(x)\)
  2. 只要\(h(x) | f (x)\)\(h(x) | g(x)\),就有\(h(x) | d(x)\)
则称\(d(x)\)\(f (x)\)\(g (x)\)最大公因式

定义 1.3.5.

\(f (x), g (x)\in\mathbb{F}[x]\),若\(\left(f (x) , g(x)\right) = 1\),则称\(f (x)\)\(g(x)\)互素互质

练习 练习

基础题.

1.
\(f(x)=x^4+3x^3-x^2-4x-3,g(x)=3x^3+10x^2+2x-3\),求\(\left(f(x),g(x)\right)\),并求\(u(x),v(x)\),使得\(\left(f(x),g(x)\right)=u(x)f(x)+v(x)g(x)\)
解答.
因为
\begin{equation*} f(x)=g(x)q_1(x)+r_1(x), \end{equation*}
\begin{equation*} g(x)=r_1(x)q_2(x)+r_2(x), \end{equation*}
\begin{equation*} r_1(x)=r_2(x)q_3(x), \end{equation*}
其中
\begin{equation*} q_1(x)=\frac{1}{3}x-\frac{1}{9},r_1(x)=-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3}, \end{equation*}
\begin{equation*} q_2(x)=-\frac{27}{5}x+9,r_2(x)=9x+27, \end{equation*}
\begin{equation*} q_3(x)=-\frac{5}{18}x-\frac{10}{81}, \end{equation*}
所以
\begin{equation*} \left(f(x),g(x)\right)=\frac{1}{9}r_2(x)=x+3. \end{equation*}
注意到
\begin{align*} r_2(x) &=g(x)-r_1(x)q_2(x) \\ &=g(x)-\left(f(x)-g(x)q_1(x)\right)q_2(x) \\ &=-q_2(x)f(x)+\left(1+q_1(x)q_2(x)\right)g(x), \end{align*}
故取
\begin{equation*} u(x)=-\frac{1}{9}q_2(x)=\frac{3}{5}x-1, \end{equation*}
\begin{equation*} v(x)=-\frac{1}{9}\left(1+q_1(x)q_2(x)\right)=-\frac{1}{5}x^2+\frac{2}{5}x, \end{equation*}
\(\left(f(x),g(x)\right)=u(x)f(x)+v(x)g(x)\)
2.
\(f(x)=x^3+(1+a)x^2+2x+2b,g(x)=x^3+ax^2+b\)的最大公因式是一个二次多项式,求\(a,b\)的值。
解答.
因为\(f(x)=g(x)+(x^2+2x+b)\),所以
\begin{equation*} (f(x),g(x))=(g(x),x^2+2x+b) \end{equation*}
是一个二次多项式,因此\(x^2+2x+b | g(x)\)。注意到
\begin{equation*} g(x)=(x^2+2x+b)(x+a-2)+[(4-2a-b)x+(3-a)b], \end{equation*}
\begin{equation*} \left\{\begin{array}{l}4-2a-b=0,\\(3-a)b=0,\end{array}\right. \end{equation*}
\(\left\{\begin{array}{c}a=2\\b=0\end{array}\right.\)\(\left\{\begin{array}{c}a=3\\b=-2\end{array}\right.\)
3.
\(f(x),g(x)\)是数域 \(\F\)上非零多项式,证明: \(f(x)\)\(g(x)\)不互素的充分必要条件是存在非零多项式 \(u(x),v(x)\),使得
\begin{equation*} u(x)f(x)=v(x)g(x), \end{equation*}
其中 \(\deg u(x)<\deg g(x),\deg v(x)<\deg f(x)\)
解答.
充分性:假设\(f(x)\)\(g(x)\)互素。由于\(f(x)|v(x)g(x)\text{,}\)所以
\begin{equation*} f(x)|v(x). \end{equation*}
这与 \(v(x)\)是非零多项式且 \(\deg v(x)<\deg f(x)\)相矛盾。因此\(f(x)\)\(g(x)\)不互素。
必要性:设 \(d(x)=\left(f(x),g(x)\right)\)。由题设, \(\deg d(x)\geq 1\)。令
\begin{equation*} u(x)=\frac{g(x)}{d(x)},v(x)=\frac{f(x)}{d(x)}, \end{equation*}
\(u(x),v(x)\)\(\F\)上非零多项式满足
\begin{equation*} u(x)f(x)=v(x)g(x), \end{equation*}
\(\deg u(x)<\deg g(x),\deg v(x)<\deg f(x)\)
4.
\(f(x),g(x)\in\mathbb{F}[x]\),证明下面几点等价:
  1. \(\left(f(x),g(x)\right)=1\)
  2. \(\left(f(x),f(x)+g(x)\right)=1\)
  3. \(\left(g(x),f(x)+g(x)\right)=1\)
  4. \(\left(f(x)g(x),f(x)+g(x)\right)=1\)
解答.
“a.\(\Rightarrow \)b.”因为\(\left(f(x),g(x)\right)=1\),所以存在\(u(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)f(x)+v(x)g(x)=1, \end{equation*}
即存在\(u(x)-v(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} \left(u(x)-v(x)\right)f(x)+v(x)\left(f(x)+g(x)\right)=1, \end{equation*}
\(\left(f(x),f(x)+g(x)\right)=1\)
“b.\(\Rightarrow \)c.”因为\(\left(f(x),f(x)+g(x)\right)=1\),所以存在\(u(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)f(x)+v(x)\left(f(x)+g(x)\right)=1, \end{equation*}
即存在\(-u(x),u(x)+v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} -u(x)g(x)+\left(u(x)+v(x)\right)\left(f(x)+g(x)\right)=1, \end{equation*}
\(\left(g(x),f(x)+g(x)\right)=1\)
“c.\(\Rightarrow \)a.”因为\(\left(g(x),f(x)+g(x)\right)=1\),所以存在\(u(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)g(x)+v(x)\left(f(x)+g(x)\right)=1, \end{equation*}
即存在\(v(x),u(x)+v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} v(x)f(x)+\left(u(x)+v(x)\right)g(x)=1, \end{equation*}
\(\left(f(x),g(x)\right)=1\)
“a.\(\Rightarrow \)d.”因为\(\left(f(x),g(x)\right)=1\),由 项 1.3.4.a,项 1.3.4.b,项 1.3.4.c等价性可知
\begin{equation*} \left(f(x),f(x)+g(x)\right)=1,\left(g(x),f(x)+g(x)\right)=1, \end{equation*}
从而\(\left(f(x)g(x),f(x)+g(x)\right)=1\)
“d.\(\Rightarrow \)a.”因为\(\left(f(x)g(x),f(x)+g(x)\right)=1\),所以存在\(u(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)f(x)g(x)+v(x)\left(f(x)+g(x)\right)=1, \end{equation*}
即存在\(v(x),v(x)+u(x)f(x)\in\mathbb{F}[x]\),使得
\begin{equation*} v(x)f(x)+\left(v(x)+u(x)f(x)\right)g(x)=1, \end{equation*}
\(\left(f(x),g(x)\right)=1\)
5.
*求一个次数最低的多项式\(f(x)\),使\(f(x)\)除以\(x^2+1,x^3+x^2+1\)的余式分别为\(x+1,x^2-1\)

提高题.

6.
\(t(x)\)是首一多项式, \(\left(f (x), g(x)\right) = d(x)\),则
\begin{equation*} \left(f (x) t(x), g(x) t(x)\right) = d(x) t(x). \end{equation*}
解答.
因为\(d(x)| f(x)\)\(d(x)| g(x)\),所以
\begin{equation*} d(x)t(x)| f(x)t(x),\ d(x)t(x)| g(x)t(x). \end{equation*}
根据Bézout定理,存在\(u(x),v(x)\in\F[x]\),使得
\begin{equation*} f(x)u(x)+g(x)v(x)=d(x). \end{equation*}
于是,存在\(u(x),v(x)\in\F[x]\),使得
\begin{equation*} (f(x)t(x))u(x)+(g(x)t(x))v(x)=d(x)t(x). \end{equation*}
从而\(\left(f (x) t(x), g(x) t(x)\right) = d(x) t(x) \)
7.
\(f_1(x)=af(x)+bg(x),g_1(x)=cf(x)+dg(x)\),且\(ad-bc\neq 0\),证明:
\begin{equation*} (f(x),g(x))=(f_1(x),g_1(x)). \end{equation*}
解答.
\(d(x)= (f(x),g(x))\),则\(d(x)|f(x),\ d(x)|g(x)\),因此
\begin{equation*} d(x)|af(x)+bg(x),\ d(x)|cf(x)+dg(x), \end{equation*}
\(d(x)|f_1(x),\ d(x)|g_1(x)\)。 因为\(ad-bc\neq 0\),所以
\begin{align} f(x)\amp =\frac{d}{ad-bc}f_1(x)-\frac{b}{ad-bc}g_1(x),\tag{1.3.2}\\ g(x)\amp =-\frac{c}{ad-bc}f_1(x)+\frac{a}{ad-bc}g_1(x).\tag{1.3.3} \end{align}
根据Bézout定理,存在 \(u(x),v(x)\in\F[x]\),使得
\begin{equation} u(x)f(x)+v(x)g(x)=d(x).\tag{1.3.4} \end{equation}
(1.3.2), (1.3.3)代入 (1.3.4)
\begin{equation*} s(x)f_1(x)+t(x)g_1(x)=d(x), \end{equation*}
其中
\begin{equation*} s(x)=\frac{d}{ad-bc}u(x)-\frac{c}{ad-bc}v(x), \end{equation*}
\begin{equation*} t(x)=-\frac{b}{ad-bc}u(x)+\frac{a}{ad-bc}v(x), \end{equation*}
因此\(d(x)=\left(f_1(x),g_1(x)\right)\)
8.
\(m,n\)是正整数,证明:
\begin{equation*} \left(x^m-1,x^n-1\right)=x^d-1, \end{equation*}
其中 \(d\)\(m,n\)的最大公因数。
解答.
不妨设\(m\geq n\)。根据带余除法,存在 \(q_1,r_1\in\N\),使得
\begin{equation*} m=nq_1+r_1, \end{equation*}
其中 \(0\leq r_1< n\)。则
\begin{equation*} \begin{array}{cl} x^m-1 & = (x^{nq_1}-1)x^{r_1}+(x^{r_1}-1)\\ & =(x^{n}-1)\left(\sum\limits_{k=0}^{q_1-1}x^{nk}\right)x^{r_1}+(x^{r_1}-1). \end{array} \end{equation*}
根据引理 1.3.2
\begin{equation*} \left(x^m-1,x^n-1\right)=\left(x^n-1,x^{r_1}-1\right). \end{equation*}
  • \(r_1=0\),即\(n\)\(m\)的因数时,
    \begin{equation*} \left(x^m-1,x^n-1\right)=\left(x^n-1,0\right)=x^n-1. \end{equation*}
    此时,\(d=n\),结论成立。
  • \(r_1\neq 0\)时,再用带余除法,有
    \begin{equation*} n=r_1q_2+r_2, \end{equation*}
    其中 \(0\leq r_2< r_1\)。同上证明可得
    \begin{equation*} \left(x^n-1,x^{r_1}-1\right)=\left(x^{r_1}-1,x^{r_2}-1\right), \end{equation*}
    \begin{equation*} \left(x^{m}-1,x^n-1\right)=\left(x^{r_1}-1,x^{r_2}-1\right). \end{equation*}
    • \(r_2=0\)时,则
      \begin{equation*} \left(x^{m}-1,x^n-1\right)=x^{r_1}-1, \end{equation*}
      这里 \(r_1\)\(m,n\)的最大公因数,结论成立。
    • \(r_2\neq 0\)时,继续辗转相除,必有
      \begin{equation*} r_{s-1}=r_sq_{s+1}, \end{equation*}
      \(r_s\)\(m,n\)的最大公因数且根据引理 1.3.2,练习 1.2.9
      \begin{equation*} \left(x^{m}-1,x^n-1\right)=\left(x^{r_{s-1}}-1,x^{r_s}-1\right)=x^{r_s}-1, \end{equation*}
      结论成立。
9.
\(f_1(x),\ldots ,f_m(x)\in\mathbb{F}[x]\),证明:存在\(u_1(x),\ldots ,u_m(x)\in\mathbb{F}[x]\),使得
\begin{equation} \left(f_1(x),\ldots ,f_m(x)\right)=u_1(x)f_1(x)+\cdots +u_m(x)f_m(x).\tag{1.3.5} \end{equation}
解答.
首先,可以证明如下引理:
\begin{equation*} \left(f_1(x),\ldots ,f_m(x)\right)=\left((f_1(x),\ldots ,f_{m-1}(x)),f_m(x)\right). \end{equation*}
假设
\begin{equation*} d(x)=\left(f_1(x),\ldots ,f_m(x)\right). \end{equation*}
因为\(d(x)\left|f_i(x)\right.,i=1,\ldots ,m-1,m\),所以
\begin{equation*} d(x)\left|(f_1(x),\ldots ,f_{m-1}(x))\right.\mbox{且}d(x)\left|f_m(x)\right. \end{equation*}
其次,设\(h(x)\left|(f_1(x),\ldots ,f_{m-1}(x))\right.\)\(h(x)\left|f_m(x)\right.\),则
\begin{equation*} h(x)\left|f_i(x)\right.,i=1,\ldots ,m-1,m, \end{equation*}
所以\(h(x)\left|d(x)\right.\)。根据定义,\(\left((f_1(x),\cdots ,f_{m-1}(x)),f_m(x)\right)=d(x)\)
下面对\(m\)用数学归纳法证明本题的结论。
\(m=2\)时,就是 定理 1.3.3
假设命题对\(m-1\)成立,即对于\(f_1(x),\ldots ,f_{m-1}(x)\),存在\(v_1(x),\ldots ,v_{m-1}(x)\in\mathbb{F}[x]\),使得
\begin{equation*} (f_1(x),\ldots ,f_{m-1}(x))=v_1(x)f_1(x)+\cdots +v_{m-1}(x)f_{m-1}(x). \end{equation*}
因此
\begin{equation*} \left(f_1(x),\cdots ,f_m(x)\right)=\left(v_1(x)f_1(x)+\cdots +v_{m-1}(x)f_{m-1}(x),f_m(x)\right), \end{equation*}
根据定理 1.3.3,存在\(v_m(x),u_m(x)\in\mathbb{F}[x]\),使得
\begin{align*} &\left(f_1(x),\ldots ,f_m(x)\right)\\ =&v_m(x)\left(v_1(x)f_1(x)+\cdots +v_{m-1}(x)f_{m-1}(x)\right)+u_m(x)f_m(x), \end{align*}
\(u_i(x)=v_m(x)v_i(x),i=1,\ldots ,m-1\),则结论成立。
10.
\(f(x),g_1(x),g_2(x),g_3(x)\in\F[x]\)。若 \(g_i(x)| f(x),i=1,2,3\),试问下列命题是否成立,并说明理由:
  1. 如果 \(g_1(x),g_2(x),g_3(x)\)两两互素,那么一定有 \(g_1(x)g_2(x)g_3(x)| f(x)\)
  2. 如果\((g_1(x),g_2(x),g_3(x))=1\),那么一定有 \(g_1(x)g_2(x)g_3(x)| f(x)\)
解答.
  1. 因为 \(\left(g_1(x),g_2(x)\right)=1\)\(g_i(x)| f(x),i=1,2\),所以由命题 1.3.7
    \begin{equation*} g_1(x)g_2(x)|f(x). \end{equation*}
    注意到
    \begin{equation*} \left(g_1(x),g_3(x)\right)=1,\left(g_2(x),g_3(x)\right)=1, \end{equation*}
    根据 命题 1.3.9,有
    \begin{equation*} \left(g_1(x)g_2(x),g_3(x)\right)=1. \end{equation*}
    \(g_3(x)|f(x)\) ,故由命题 1.3.7可知
    \begin{equation*} g_1(x)g_2(x)g_3(x)|f(x). \end{equation*}
  2. 结论未必成立。如
    \begin{equation*} g_1(x)=x(x-1),g_2(x)=x(x+1),g_3(x)=(x-1)(x+1) \end{equation*}
    满足\((g_1(x),g_2(x),g_3(x))=1\),且
    \begin{equation*} g_i(x)|x(x-1)(x+1),\ i=1,2,3, \end{equation*}
    \begin{equation*} g_1(x)g_2(x)g_3(x)\nmid x(x-1)(x+1). \end{equation*}
11.
\(f(x),g(x),h(x)\in\F[x]\)\(h(x)\ne 0\),且 \(g(x)\)\(h(x)\)互素,证明:存在 \(r(x),s(x)\in\F[x]\),使得
\begin{equation*} f(x)=g(x)r(x)+h(x)s(x), \end{equation*}
其中 \(\deg r(x)<\deg h(x)\)
解答.
因为 \(\left(g(x),h(x)\right)=1\),所以存在 \(u(x),v(x)\in\F[x]\),使得
\begin{equation*} u(x)g(x)+v(x)h(x)=1. \end{equation*}
两边同乘 \(f(x)\)
\begin{equation} f(x)u(x)g(x)+f(x)v(x)h(x)=f(x).\tag{1.3.6} \end{equation}
根据带余除法,存在 \(q(x),r(x)\in\F[x]\),使得
\begin{equation} f(x)u(x)=q(x)h(x)+r(x),\tag{1.3.7} \end{equation}
\(\deg r(x)<\deg h(x)\)。将 (1.3.7)代入 (1.3.6)即得
\begin{equation*} g(x)r(x)+h(x)s(x)=f(x), \end{equation*}
其中 \(s(x)=f(x)v(x)+g(x)q(x)\)
12.
\(f(x),g(x)\in\mathbb{F}[x],\deg f(x)>0,\deg g(x)>0\)。证明:如果\(\left(f(x),g(x)\right)=1\),那么存在唯一的\(u(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)f(x)+v(x)g(x)=1, \end{equation*}
\(\deg u(x)<\deg g(x),\deg v(x)<\deg f(x)\)
解答.
存在性:因为\(\left(f(x),g(x)\right)=1\),所以存在\(h(x),k(x)\in\mathbb{F}[x]\),使得
\begin{equation} f(x)h(x)+g(x)k(x)=1.\tag{1.3.8} \end{equation}
由于\(\deg g(x)>0\),所以由带余除法,存在\(q(x),r(x)\in\mathbb{F}[x]\),使得
\begin{equation} h(x)=g(x)q(x)+r(x),\tag{1.3.9} \end{equation}
其中\(\deg r(x)<\deg g(x)\)。将 (1.3.9)代入 (1.3.8)
\begin{equation*} f(x)\left(g(x)q(x)+r(x)\right)+g(x)k(x)=1. \end{equation*}
故存在\(u(x)=r(x),v(x)=f(x)q(x)+k(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)f(x)+v(x)g(x)=1, \end{equation*}
其中\(\deg u(x)<\deg g(x)\)
我们断言,\(\deg v(x)<\deg f(x)\)。若不然,\(\deg v(x)\geq \deg f(x)\),由\(\deg u(x)<\deg g(x)\)知:
\begin{equation*} \deg\left(u(x)f(x)\right)<\deg f(x)+\deg g(x)\leq \deg \left(v(x)g(x)\right). \end{equation*}
因此
\begin{equation*} \deg \left(u(x)f(x)+v(x)g(x)\right)=\deg \left(v(x)g(x)\right)\geq 2, \end{equation*}
\(u(x)f(x)+v(x)g(x)=1\)相矛盾。
唯一性:设另有\(u_1(x),v_1(x)\)满足条件,即\(u_1(x)f(x)+v_1(x)g(x)=1\),其中\(\deg u_1(x)<\deg g(x),\deg v_1(x) < f(x)\),则
\begin{equation*} \left(u(x)-u_1(x)\right)f(x)=\left(v_1(x)-v(x)\right)g(x). \end{equation*}
\begin{equation*} \left.g(x)\right|\left(u(x)-u_1(x)\right)f(x). \end{equation*}
由于\(\left(f(x),g(x)\right)=1\),所以由 命题 1.3.8
\begin{equation*} \left.g(x)\right|u(x)-u_1(x). \end{equation*}
\(\deg\left(u(x)-u_1(x)\right)\leq\max\left\{\deg u(x),\deg u_1(x)\right\}<\deg g(x)\),所以只能\(u(x)-u_1(x)=0\),即\(u(x)=u_1(x)\),进而\(v(x)=v_1(x)\)
13.
\(f_1(x),\cdots ,f_m(x),g_1(x),\cdots ,g_n(x)\in\mathbb{F}[x]\)。证明:
\begin{equation*} \left(f_1(x)\cdots f_m(x),g_1(x)\cdots g_n(x)\right)=1 \end{equation*}
的充分必要条件是
\begin{equation*} \left(f_i(x),g_j(x)\right)=1,\forall i=1,\ldots ,m,\ j=1,\ldots ,n. \end{equation*}
解答.
充分性:因为
\begin{equation*} \left(f_i(x),g_j(x)\right)=1,\forall i=1,\ldots ,m,\ j=1,\cdots ,n, \end{equation*}
所以根据 命题 1.3.9,得
\begin{equation*} \left(f_1(x)\cdots f_m(x),g_j(x)\right)=1,\ \forall j=1,\ldots ,n. \end{equation*}
进而,有
\begin{equation*} \left(f_1(x)\cdots f_m(x),g_1(x)\cdots g_n(x)\right)=1. \end{equation*}
必要性:因为\(\left(f_1(x)\cdots f_m(x),g_1(x)\cdots g_n(x)\right)=1\),所以存在\(u(x),v(x)\in\mathbb{F}[x]\),使得
\begin{equation*} u(x)f_1(x)\cdots f_m(x)+v(x)g_1(x)\cdots g_n(x)=1. \end{equation*}
\(\forall i=1,\cdots ,m,\ j=1,\cdots ,n\),令
\begin{equation*} p_i(x)=u(x)(\prod\limits_{\substack{1\leq k\leq m\\k\neq i}}f_k(x)),q_j(x)=v(x)(\prod\limits_{\substack{1\leq l\leq n\\l\neq j}}g_l(x)), \end{equation*}
\(p_i(x)f_i(x)+q_j(x)g_j(x)=1\)。因此\(\left(f_i(x),g_j(x)\right)=1\)
14.
\(f(x),g(x)\in\mathbb{F}[x],m\in\mathbb{Z}^+\),证明:如果\(\left(f(x),g(x)\right)=1\),那么\(\left(f^m(x),g^m(x)\right)=1\)
解答.
因为\(\left(f(x),g(x)\right)=1\),所以根据 命题 1.3.9 ,有\(\left(f^m(x),g(x)\right)=1\),进而\(\left(f^m(x),g^m(x)\right)=1\)
15.
\(f(x),g(x)\in\mathbb{F}[x],m\in\mathbb{Z}^+\),证明:
\begin{equation*} \left(f^m(x),g^m(x)\right)=\left(f(x),g(x)\right)^m. \end{equation*}
解答.
\(f(x)=g(x)=0\)时,结论显然成立。
\(f(x),g(x)\)不全为0时,设\(d(x)=\left(f(x),g(x)\right)\),则\(d(x)\neq 0\),存在\(f_1(x),g_1(x)\in\mathbb{F}[x]\),使得
\begin{equation*} f(x)=d(x)f_1(x),g(x)=d(x)g_1(x),\mbox{且}\left(f_1(x),g_1(x)\right)=1\mbox{。} \end{equation*}
于是根据 练习 1.3.6
\begin{align*} \left(f^m(x),g^m(x)\right)&=\left(d^m(x)f_1^m(x),d^m(x)g_1^m(x)\right) \\ &=d^m(x)\left(f_1^m(x),g_1^m(x)\right). \end{align*}
由上题结论知\(\left(f_1^m(x),g_1^m(x)\right)=1\),因此\(\left(f^m(x),g^m(x)\right)=d^m(x)\)

Sage相关.

16.
实现本节中使用的sage自带程序。
18.
写一个中国剩余定理的程序,以\(p_1,\ldots,p_n;g_1,\ldots,g_n\)为输入,\(f(x)\)为输出。