(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 30996, 998] NotebookOptionsPosition[ 28284, 899] NotebookOutlinePosition[ 28641, 915] CellTagsIndexPosition[ 28598, 912] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"LeadingMonomial", "[", RowBox[{"poly_", ",", "vars_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"p", ",", "exps"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"p", "=", RowBox[{"Expand", "[", "poly", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"poly", "===", "0"}], ",", RowBox[{ "Throw", "[", "\"\\"", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Head", "[", "p", "]"}], "===", "Plus"}], ",", RowBox[{"p", "=", RowBox[{"List", "@@", "p"}]}], ",", RowBox[{"p", "=", RowBox[{"{", "p", "}"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"exps", "=", RowBox[{ RowBox[{ RowBox[{"Exponent", "[", RowBox[{"#", ",", "vars"}], "]"}], "&"}], "/@", "p"}]}], ";", "\[IndentingNewLine]", RowBox[{"exps", "=", RowBox[{"Sort", "[", "exps", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", RowBox[{"Times", "@@", RowBox[{"(", RowBox[{"vars", "^", RowBox[{"Last", "[", "exps", "]"}]}], ")"}]}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.481414538655553*^9, 3.481414551426204*^9}, { 3.481414585732854*^9, 3.481414627812261*^9}, {3.481414679818692*^9, 3.481414688501773*^9}, {3.481414741971976*^9, 3.481414814672934*^9}, { 3.481414999387036*^9, 3.481415001302936*^9}, {3.481416377025102*^9, 3.481416393661702*^9}, {3.481416445818897*^9, 3.481416451077863*^9}, { 3.481497825198894*^9, 3.481497827086021*^9}, {3.481557945752745*^9, 3.481557950928995*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"LeadingCoefficient", "[", RowBox[{"poly_", ",", "vars_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"lm", ",", "c"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"lm", "=", RowBox[{"LeadingMonomial", "[", RowBox[{"poly", ",", "vars"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"c", "=", "poly"}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"c", "=", RowBox[{"Coefficient", "[", RowBox[{"c", ",", RowBox[{"vars", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"Exponent", "[", RowBox[{"lm", ",", RowBox[{"vars", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "vars", "]"}]}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", "c", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.481414917084593*^9, 3.481415006385497*^9}, { 3.481416195298444*^9, 3.481416197073755*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"PolynomialReduction", "[", RowBox[{"poly_", ",", "set_", ",", "vars_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"lm", ",", "lc", ",", RowBox[{"rem", "=", "0"}], ",", RowBox[{"p", "=", "poly"}], ",", "i", ",", "test"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"While", "[", RowBox[{ RowBox[{"p", "=!=", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"lm", "=", RowBox[{"LeadingMonomial", "[", RowBox[{"p", ",", "vars"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"lc", "=", RowBox[{"LeadingCoefficient", "[", RowBox[{"p", ",", "vars"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"i", "=", "1"}], ";", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{"i", "\[LessEqual]", RowBox[{"Length", "[", "set", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"test", "=", RowBox[{"lm", "/", RowBox[{"LeadingMonomial", "[", RowBox[{ RowBox[{"set", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "vars"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"PolynomialQ", "[", RowBox[{"test", ",", "vars"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"p", "=", RowBox[{"Expand", "[", RowBox[{"p", "-", RowBox[{ RowBox[{"lc", "/", RowBox[{"LeadingCoefficient", "[", RowBox[{ RowBox[{"set", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "vars"}], "]"}]}], "*", "test", "*", RowBox[{"set", "[", RowBox[{"[", "i", "]"}], "]"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Break", "[", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"i", "++"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"i", ">", RowBox[{"Length", "[", "set", "]"}]}], ",", RowBox[{ RowBox[{"rem", "=", RowBox[{"rem", "+", RowBox[{"lc", "*", "lm"}]}]}], ";", RowBox[{"p", "=", RowBox[{"p", "-", RowBox[{"lc", "*", "lm"}]}]}]}]}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", "rem", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.481415064268105*^9, 3.481415156758594*^9}, { 3.48141526935769*^9, 3.481415593653731*^9}, {3.481415679292653*^9, 3.481415689906071*^9}, {3.481416302244042*^9, 3.481416337704413*^9}, { 3.481416469788111*^9, 3.481416474287646*^9}, 3.481497844122428*^9, { 3.481557959199205*^9, 3.481557960079566*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"p1", "=", RowBox[{ RowBox[{"x", "*", "y"}], "-", "1"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"p2", "=", RowBox[{ RowBox[{"x", "^", "2"}], "+", "y", "+", "1"}]}], ";"}]}], "Input", CellChangeTimes->{{3.481558024302638*^9, 3.481558036495103*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialReduction", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "*", "y"}], ",", RowBox[{"{", RowBox[{"p1", ",", "p2"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481558006791934*^9, 3.481558012849638*^9}, { 3.481558048591657*^9, 3.481558054946895*^9}}], Cell[BoxData["x"], "Output", CellChangeTimes->{3.481558055404721*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialReduction", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "*", "y"}], ",", RowBox[{"{", RowBox[{"p2", ",", "p1"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481558061903205*^9, 3.481558065417909*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"-", "y"}], "-", SuperscriptBox["y", "2"]}]], "Output", CellChangeTimes->{3.481558065859581*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{ RowBox[{"Buchberger", "'"}], "s", " ", "algorithm", " ", "computes", " ", "a", " ", "Groebner", " ", "bases", " ", "for", " ", "the", " ", "ideal"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Buchberger", "[", RowBox[{"set1_", ",", "vars_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", "pairs", ",", RowBox[{"set", "=", "set1"}], ",", "p1", ",", "p2", ",", "lm1", ",", "lm2", ",", "gcd", ",", "sp"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"pairs", "=", RowBox[{"Subsets", "[", RowBox[{"set", ",", RowBox[{"{", "2", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{"pairs", "=!=", RowBox[{"{", "}"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"p1", "=", RowBox[{"pairs", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"p2", "=", RowBox[{"pairs", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"pairs", "=", RowBox[{"Rest", "[", "pairs", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"lm1", "=", RowBox[{"LeadingMonomial", "[", RowBox[{"p1", ",", "vars"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"lm2", "=", RowBox[{"LeadingMonomial", "[", RowBox[{"p2", ",", "vars"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"gcd", "=", RowBox[{"PolynomialGCD", "[", RowBox[{"lm1", ",", "lm2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"sp", "=", RowBox[{"Expand", "[", RowBox[{ RowBox[{ RowBox[{"lm2", "/", "gcd"}], "*", RowBox[{"LeadingCoefficient", "[", RowBox[{"p2", ",", "vars"}], "]"}], "*", "p1"}], "-", RowBox[{ RowBox[{"lm1", "/", "gcd"}], "*", RowBox[{"LeadingCoefficient", "[", RowBox[{"p1", ",", "vars"}], "]"}], "*", "p2"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"sp", "=", RowBox[{"PolynomialReduction", "[", RowBox[{"sp", ",", "set", ",", "vars"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"sp", "=!=", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"pairs", "=", RowBox[{"Join", "[", RowBox[{"pairs", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"set", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "sp"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "set", "]"}]}], "}"}]}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"AppendTo", "[", RowBox[{"set", ",", "sp"}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", "set", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.481415604727299*^9, 3.481415669732211*^9}, { 3.481415703955568*^9, 3.481415944844114*^9}, {3.48141612479372*^9, 3.481416183273381*^9}, {3.481416502771057*^9, 3.481416537390329*^9}, { 3.481417057113162*^9, 3.481417112122385*^9}, {3.481497886812669*^9, 3.481497895412216*^9}, {3.481558096905236*^9, 3.481558109650188*^9}, 3.481558336535234*^9, {3.48155844402084*^9, 3.481558445353573*^9}}], Cell[CellGroupData[{ Cell["Examples", "Subsection", CellChangeTimes->{{3.481417455113267*^9, 3.4814174562613*^9}}], Cell[CellGroupData[{ Cell["Find common zeros of a polynomial system", "Subsubsection", CellChangeTimes->{{3.481557910099354*^9, 3.481557916668766*^9}}], Cell["\<\ Gr\[ODoubleDot]bner bases can be used for solving a polynomial system. When \ using a lexicographic monomial order, an elimination is performed. Hence we \ get a univariate equation which we can solve, and backwards substitute the \ results in the other equations:\ \>", "Text", CellChangeTimes->{{3.481558077958328*^9, 3.481558148244546*^9}, { 3.481558238373165*^9, 3.481558265274151*^9}, {3.481558299166119*^9, 3.481558321658708*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Buchberger", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"x", "*", "y"}], "-", "1"}], ",", RowBox[{ RowBox[{"x", "^", "2"}], "+", "y", "+", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{3.481557999368338*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "+", RowBox[{"x", " ", "y"}]}], ",", RowBox[{"1", "+", SuperscriptBox["x", "2"], "+", "y"}], ",", RowBox[{ RowBox[{"-", "x"}], "-", "y", "-", SuperscriptBox["y", "2"]}], ",", RowBox[{"1", "+", SuperscriptBox["y", "2"], "+", SuperscriptBox["y", "3"]}]}], "}"}]], "Output", CellChangeTimes->{{3.481558323540991*^9, 3.481558341066095*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"Last", "[", "%", "]"}], "\[Equal]", "0"}], ",", "y"}], "]"}]], "Input", CellChangeTimes->{{3.481558344930949*^9, 3.481558354485836*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"y", "\[Rule]", RowBox[{ FractionBox["1", "3"], " ", RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "-", SuperscriptBox[ RowBox[{"(", FractionBox["2", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}]], ")"}], RowBox[{"1", "/", "3"}]], "-", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], ")"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", "\[Rule]", RowBox[{ RowBox[{"-", FractionBox["1", "3"]}], "+", RowBox[{ FractionBox["1", "6"], " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], "+", FractionBox[ RowBox[{"1", "-", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], RowBox[{"3", " ", SuperscriptBox["2", RowBox[{"2", "/", "3"}]], " ", SuperscriptBox[ RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}], RowBox[{"1", "/", "3"}]]}]]}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", "\[Rule]", RowBox[{ RowBox[{"-", FractionBox["1", "3"]}], "+", RowBox[{ FractionBox["1", "6"], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], "+", FractionBox[ RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], RowBox[{"3", " ", SuperscriptBox["2", RowBox[{"2", "/", "3"}]], " ", SuperscriptBox[ RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}], RowBox[{"1", "/", "3"}]]}]]}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.481558354757982*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{"#", "\[Equal]", "0"}], ",", "x"}], "]"}], "&"}], "/@", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"x", "*", "y"}], "-", "1"}], ")"}], "/.", "%"}], ")"}]}]], "Input", CellChangeTimes->{{3.481558373360061*^9, 3.481558401189672*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"-", FractionBox["6", RowBox[{"2", "+", RowBox[{"2", " ", SuperscriptBox[ RowBox[{"(", FractionBox["2", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}]], ")"}], RowBox[{"1", "/", "3"}]]}], "+", RowBox[{ SuperscriptBox["2", RowBox[{"2", "/", "3"}]], " ", SuperscriptBox[ RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}], RowBox[{"1", "/", "3"}]]}]}]]}]}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{"x", "\[Rule]", FractionBox["1", RowBox[{ RowBox[{"-", FractionBox["1", "3"]}], "+", RowBox[{ FractionBox["1", "6"], " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], "+", FractionBox[ RowBox[{"1", "-", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], RowBox[{"3", " ", SuperscriptBox["2", RowBox[{"2", "/", "3"}]], " ", SuperscriptBox[ RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}], RowBox[{"1", "/", "3"}]]}]]}]]}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{"x", "\[Rule]", FractionBox["1", RowBox[{ RowBox[{"-", FractionBox["1", "3"]}], "+", RowBox[{ FractionBox["1", "6"], " ", RowBox[{"(", RowBox[{"1", "-", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], "+", FractionBox[ RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], RowBox[{"3", " ", SuperscriptBox["2", RowBox[{"2", "/", "3"}]], " ", SuperscriptBox[ RowBox[{"(", RowBox[{"29", "-", RowBox[{"3", " ", SqrtBox["93"]}]}], ")"}], RowBox[{"1", "/", "3"}]]}]]}]]}], "}"}], "}"}]}], "}"}]], "Output",\ CellChangeTimes->{3.48155840270486*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Uniqueness of remainder", "Subsubsection", CellChangeTimes->{{3.481417760245538*^9, 3.481417764962675*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ideal", "=", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"x", "*", "y"}], "-", "1"}], ",", RowBox[{ RowBox[{"x", "^", "2"}], "+", "y", "+", "1"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.481417464918252*^9, 3.481417480192039*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "+", RowBox[{"x", " ", "y"}]}], ",", RowBox[{"1", "+", SuperscriptBox["x", "2"], "+", "y"}]}], "}"}]], "Output", CellChangeTimes->{3.481417480873972*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialReduction", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "*", "y"}], ",", "ideal", ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417493095703*^9, 3.481417517836083*^9}}], Cell[BoxData["x"], "Output", CellChangeTimes->{{3.481417512638324*^9, 3.481417518187625*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialReduction", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "*", "y"}], ",", RowBox[{"Reverse", "[", "ideal", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417524502948*^9, 3.481417526733262*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"-", "y"}], "-", SuperscriptBox["y", "2"]}]], "Output", CellChangeTimes->{3.481417527042182*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"gb", "=", RowBox[{"Buchberger", "[", RowBox[{"ideal", ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.481417482950189*^9, 3.481417484247797*^9}, { 3.48141753060977*^9, 3.481417533322285*^9}, {3.481417571013437*^9, 3.481417571550228*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "+", RowBox[{"x", " ", "y"}]}], ",", RowBox[{"1", "+", SuperscriptBox["x", "2"], "+", "y"}], ",", RowBox[{ RowBox[{"-", "x"}], "-", "y", "-", SuperscriptBox["y", "2"]}], ",", RowBox[{"1", "+", SuperscriptBox["y", "2"], "+", SuperscriptBox["y", "3"]}]}], "}"}]], "Output", CellChangeTimes->{3.481417533676653*^9, 3.481417572106266*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialReduction", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "*", "y"}], ",", "gb", ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417578938947*^9, 3.481417578985068*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"-", "y"}], "-", SuperscriptBox["y", "2"]}]], "Output", CellChangeTimes->{3.481417579540444*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialReduction", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "*", "y"}], ",", RowBox[{"Reverse", "[", "gb", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417589158956*^9, 3.481417592324171*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"-", "y"}], "-", SuperscriptBox["y", "2"]}]], "Output", CellChangeTimes->{3.481417592583736*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["gcd in the univariate case", "Subsubsection", CellChangeTimes->{{3.481417774388292*^9, 3.481417778828344*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Expand", "[", RowBox[{ RowBox[{"(", RowBox[{"x", "-", "3"}], ")"}], "*", RowBox[{"(", RowBox[{"x", "+", "1"}], ")"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417868638715*^9, 3.481417899073298*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"-", "3"}], "-", RowBox[{"2", " ", "x"}], "+", SuperscriptBox["x", "2"]}]], "Output", CellChangeTimes->{{3.481417880527768*^9, 3.481417899437181*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Buchberger", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"x", "^", "3"}], "-", RowBox[{"10", "x"}], "+", "3"}], ",", RowBox[{ RowBox[{"x", "^", "2"}], "-", RowBox[{"2", "x"}], "-", "3"}]}], "}"}], ",", RowBox[{"{", "x", "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417783638657*^9, 3.481417786213913*^9}, { 3.481417883063012*^9, 3.481417908222937*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"3", "-", RowBox[{"10", " ", "x"}], "+", SuperscriptBox["x", "3"]}], ",", RowBox[{ RowBox[{"-", "3"}], "-", RowBox[{"2", " ", "x"}], "+", SuperscriptBox["x", "2"]}], ",", RowBox[{"9", "-", RowBox[{"3", " ", "x"}]}]}], "}"}]], "Output", CellChangeTimes->{3.481417908544035*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PolynomialGCD", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "3"}], "-", RowBox[{"10", "x"}], "+", "3"}], ",", RowBox[{ RowBox[{"x", "^", "2"}], "-", RowBox[{"2", "x"}], "-", "3"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417920795219*^9, 3.481417938390874*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"-", "3"}], "+", "x"}]], "Output", CellChangeTimes->{3.481417938691312*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Gauss in the first-degree case", "Subsubsection", CellChangeTimes->{{3.481417959959371*^9, 3.481417969436501*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Buchberger", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a", "+", "b", "+", "c", "-", "1"}], ",", RowBox[{"a", "-", RowBox[{"2", "b"}], "-", RowBox[{"3", "c"}], "+", "4"}], ",", RowBox[{ RowBox[{"2", "a"}], "-", "b", "+", RowBox[{"2", "c"}], "-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "b", ",", "c"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481417967647335*^9, 3.481418010167772*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "+", "a", "+", "b", "+", "c"}], ",", RowBox[{"4", "+", "a", "-", RowBox[{"2", " ", "b"}], "-", RowBox[{"3", " ", "c"}]}], ",", RowBox[{ RowBox[{"-", "2"}], "+", RowBox[{"2", " ", "a"}], "-", "b", "+", RowBox[{"2", " ", "c"}]}], ",", RowBox[{ RowBox[{"-", "5"}], "+", RowBox[{"3", " ", "b"}], "+", RowBox[{"4", " ", "c"}]}], ",", RowBox[{"5", "-", RowBox[{"4", " ", "c"}]}]}], "}"}]], "Output", CellChangeTimes->{3.481418010531*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "+", "b", "+", "c", "-", "1"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"a", "-", RowBox[{"2", "b"}], "-", RowBox[{"3", "c"}], "+", "4"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{ RowBox[{"2", "a"}], "-", "b", "+", RowBox[{"2", "c"}], "-", "2"}], "\[Equal]", "0"}]}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "b", ",", "c"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.481418027956078*^9, 3.481418038164945*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"a", "\[Rule]", RowBox[{"-", FractionBox["1", "4"]}]}], ",", RowBox[{"b", "\[Rule]", "0"}], ",", RowBox[{"c", "\[Rule]", FractionBox["5", "4"]}]}], "}"}], "}"}]], "Output", CellChangeTimes->{3.481418038509633*^9}] }, Open ]] }, Open ]], Cell[TextData[{ "Compare also with the ", StyleBox["Mathematica", FontSlant->"Italic"], " command GroebnerBasis!" }], "Subsubsection", CellChangeTimes->{{3.48155848581861*^9, 3.481558497201856*^9}}] }, Open ]] }, WindowSize->{1392, 972}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, FrontEndVersion->"7.0 for Linux x86 (32-bit) (November 10, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 1935, 47, 225, "Input"], Cell[2483, 69, 1358, 34, 225, "Input"], Cell[3844, 105, 3319, 78, 432, "Input"], Cell[7166, 185, 313, 9, 64, "Input"], Cell[CellGroupData[{ Cell[7504, 198, 369, 10, 40, "Input"], Cell[7876, 210, 70, 1, 40, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7983, 216, 320, 9, 40, "Input"], Cell[8306, 227, 134, 4, 45, "Output"] }, Open ]], Cell[8455, 234, 4113, 96, 478, "Input"], Cell[CellGroupData[{ Cell[12593, 334, 94, 1, 59, "Subsection"], Cell[CellGroupData[{ Cell[12712, 339, 131, 1, 42, "Subsubsection"], Cell[12846, 342, 452, 8, 72, "Text"], Cell[CellGroupData[{ Cell[13323, 354, 342, 11, 40, "Input"], Cell[13668, 367, 454, 14, 49, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14159, 386, 214, 6, 40, "Input"], Cell[14376, 394, 2757, 92, 219, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17170, 491, 355, 12, 40, "Input"], Cell[17528, 505, 3008, 97, 188, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[20585, 608, 114, 1, 42, "Subsubsection"], Cell[CellGroupData[{ Cell[20724, 613, 278, 8, 40, "Input"], Cell[21005, 623, 244, 8, 49, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21286, 636, 273, 7, 40, "Input"], Cell[21562, 645, 94, 1, 40, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21693, 651, 308, 8, 40, "Input"], Cell[22004, 661, 134, 4, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22175, 670, 329, 8, 40, "Input"], Cell[22507, 680, 452, 14, 49, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22996, 699, 270, 7, 40, "Input"], Cell[23269, 708, 134, 4, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[23440, 717, 305, 8, 40, "Input"], Cell[23748, 727, 134, 4, 45, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[23931, 737, 117, 1, 42, "Subsubsection"], Cell[CellGroupData[{ Cell[24073, 742, 246, 7, 40, "Input"], Cell[24322, 751, 191, 5, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24550, 761, 445, 13, 40, "Input"], Cell[24998, 776, 365, 12, 49, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[25400, 793, 314, 9, 40, "Input"], Cell[25717, 804, 110, 3, 40, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[25876, 813, 121, 1, 42, "Subsubsection"], Cell[CellGroupData[{ Cell[26022, 818, 496, 14, 40, "Input"], Cell[26521, 834, 567, 18, 40, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27125, 857, 597, 17, 40, "Input"], Cell[27725, 876, 312, 10, 65, "Output"] }, Open ]] }, Open ]], Cell[28064, 890, 204, 6, 42, "Subsubsection"] }, Open ]] } ] *) (* End of internal cache information *)