#!/usr/bin/env python # coding: utf-8 # ## Exercice 10.1 # In[1]: A. = PolynomialRing(QQ, order='lex') I = A.ideal(y^4*x + 3*x^3 - y^4 - 3*x^2, x^2*y - 2*x^2, 2*y^4*x - x^3 - 2*y^4 + x^2) # On retrouve le générateur de $ℚ[y] ∩ I$ à la fin de la base de Gröbner # In[2]: I.groebner_basis() # In[3]: I.change_ring(A.change_ring(names='y,x')).groebner_basis() # Une méthode alternative de calculer le même résultat # In[4]: I.elimination_ideal(x) # ## Exercice 10.2 # In[5]: A. = PolynomialRing(QQ, order='lex') I = A.ideal(x + y - z, x^2- 2*t^2, y^2 - 5*t^2) # In[6]: G = I.groebner_basis() G # In[7]: p = G[-1](t=1) p # In[8]: p(z=sqrt(2)+sqrt(5)).expand() # In[9]: q = G[-2](t=1) q # In[10]: q(y=sqrt(5), z=sqrt(2)+sqrt(5)).expand() # ## Exercice 10.5 # In[11]: A. = PolynomialRing(QQ, order='lex') I = A.ideal(X^4 + Y^4 - 1, X^5*Y^2 - 4*X^3*Y^3 + X^2*Y^5 - 1) G = I.groebner_basis() G # In[12]: G[-1] # In[13]: q = G[-1].univariate_polynomial() q # In[14]: q.factor() # In[15]: q.change_ring(RR).factor() # In[16]: q.roots(RR) # In[17]: (implicit_plot(I.0, (X,-5,5), (Y,-5,5)) + implicit_plot(I.1, (X, -5, 5), (Y, -5, 5))) # L'avant-dernier polynôme de la base de Gröbner nous permet de calculer $X$ en fonction de $Y$ # In[18]: G[-2] # In[19]: I.variety() # In[20]: I.variety(CC) # ## Exercice 10.6 # In[21]: A. = PolynomialRing(QQ, order='lex') I = A.ideal(v*x - u^2, u*y - v^2, z - u) G = I.groebner_basis() G # L'idéal obtenu par élimination contient une hyper-surface parasite $z=0$. À l'aide d'une variable $t$, on peut forcer les dénominateurs $u$ et $v$ à ne pas s'annuler en ajoutant le polynôme $1 - uvt$ à l'idéal. # In[22]: A. = PolynomialRing(QQ, order='lex') I = A.ideal(v*x - u^2, u*y - v^2, z - u, 1 - u*v*t) G = I.groebner_basis() G # In[23]: A. = PolynomialRing(QQ, order='lex') I = A.ideal(t^2 + t + 1 - x, (t^2 - 1) - y*(t^2 + 1), 1 - u*(t^2+1)) G = I.groebner_basis() G