# Chapter 3: Solving and Decomposing¶

This chapter was presented by Yuhan Jiang and Mahsa Sayyary Namin. All their codes are in Macaulay2.

Exercise 9: Find three polynomials in three unknowns, each having degree precisely five, whose variety in \(\mathbb{C}^3\) consists of precisely 37 complex solutions.

We start with the equation of first two generators \(f,g\) of degree 5 and we make sure that they are intersecting in 8 lines. Now by bezout theorem if we take a “general” surface \(h\) of degree 5 it should intersect the eight lines in 5*8=40 points, but we need 37 of them So we choose our general degree 5 surface in a way that 3 of the 40 intersection points are the intersection of different pairs of the 8 lines in \((f,g)\). this way \(h\) intersect \((f,g)\) in 37 distinct points

```
restart
R = QQ [x,y,z]
--First two equations
f = x*y*z*(x - 2*z+1)^2
g = (x - 1)*(y - 1)*(z - 1)^3
--checking that their intersection is 8 lines
I = ideal (f,g)
primaryDecomposition(radical(I))
#oo == 8
--making all the monomials in x,y,z of degree less or equal to 5
L = flatten apply (6, i -> flatten entries basis(5-i,R))
#L
S = QQ [x,y,z,c_0..c_55]
L1 = toList( c_0..c_55)
--making a degree 5 surface with c_0,...,c_55 as coefficients
M = sub(matrix {L},S)*transpose matrix {L1}
-- P_1,P_2,P_3 are the intersection points of the 3 different pairs of 8 lines
--(note that they should not lie on more than 2 lines.
P_1 = {0,0,1}
P_2 = {0,1,0}
P_3 = {1,0,0}
-- substituting three points in our general surface this gives us 3 linear equations in c_i
l1 =flatten entries substitute(M,{x=>(P_1)#0,y=>(P_1)#1,z=>(P_1)#2})
l2 =flatten entries substitute(M,{x=>(P_2)#0,y=>(P_2)#1,z=>(P_2)#2})
l3 =flatten entries substitute(M,{x=>(P_3)#0,y=>(P_3)#1,z=>(P_3)#2})
-- finding a "random" solution for the linear system of equations l_1,l_2,l_3
C = apply(56,i -> c_i = random(-20,20))
C1 = replace(20,-c_35-c_45-c_51-c_54-c_55,C)
C2 = replace(15,-c_31-c_42-c_49-c_53-c_55,C1)
C3 = replace(0,-c_21-c_36-c_46-c_52-c_55,C2)
-- substituting the values of c_i in the general form of a degree 5 surface and call it h
-- now h has "random" coefficients and passes through P_1,P_2,P_3
Mf = sub(matrix {L},S)*transpose matrix {C3}
h = (flatten entries Mf)#0
h = sub(h,R)
I = ideal (f,g,h)
degree (radical I) == 37
```

One example of \(h\):

```
h1 = 11*x^5 + 12*x^4*y - 10*x^3*y^2 + 9*x^2*y^3 - 11*x*y^4 + 2*y^5 + 6*x^4*z - 8*x^3*y*z + 8*x^2*y^2*z - x*y^3*z - 13*y^4*z - 11*x^3*z^2 + 10*x^2*y*z^2 + 4*x*y^2*z^2 - 14*y^3*z^2 + 20*x^2*z^3 - 10*x*y*z^3 - 8*y^2*z^3 - 18*x*z^4 - 13*y*z^4 + 26*z^5 + 11*x^4 + x^3*y - 15*x^2*y^2 - 9*x*y^3 + y^4 + 5*x^3*z + 17*x^2*y*z - 10*x*y^2*z + 18*x^2*z^2 + 17*x*y*z^2 + 16*y^2*z^2 + 4*y*z^3 - 8*z^4 - 18*x^3 + 12*x^2*y - 2*x*y^2 + 8*y^3 + 11*x^2*z - 6*x*y*z + 4*x*z^2 - 15*y*z^2 - 6*z^3 + 6*x^2 + 3*x*y - 7*y^2 + x*z - 6*z^2 - 5*x + y - z - 5;
h1 = sub(h1,R)
degree (radical (ideal (f,g,h1))) == 37
```

Exercise 11: Let \(I\) be the ideal generated by the 2×2-subpermanents \(x_iy_j +x_jx_i\) of a 2 × 5-matrix of unknowns. Find a minimal primary decomposition of \(I\). Interpret your result in terms of solving partial differential equations.

```
restart
R = QQ[x_1..x_5,y_1..y_5]
M = matrix{{x_1,x_2,x_3,x_4,x_5},{y_1,y_2,y_3,y_4,y_5}}
I = permanents (2,M)
L =primaryDecomposition I
dim L#0
dim I
associatedPrimes I==primaryDecomposition I
-- all of the 12 primary ideals are prime and we will find the solutions
-- to the corresponding PDE system as presented during the lecture.
```

Exercise 13: Let \(K = \mathbb{F}_2\) be the field with two elements. Find an ideal \(I\) in \(K[x,y]\) that has precisely ten associated primes, of which five are embedded.

We start with 5 irreducible polynomials over \(\mathbb{Z}/2\) which give all the minimal primes. The embedded primes are the points of intersections of some of the pairs.

```
restart
R = ZZ/2[x,y];
J = intersect((ideal(x+1,y))^3, (ideal(x+1,y+1))^3,(ideal(x+1,y^2+y+1))^3, (ideal(x,y))^3, (ideal(x,y+1))^3,
ideal(x+1),
ideal(x),
ideal(y),
ideal(y+1),
ideal(y^2+y+1));
minimalPrimes J
#oo == 5
--there are 10 different associated primes each corresponds to one of the 10 components
associatedPrimes J
#oo == 10
```

we should make sure that the intersection is irredundant, that is why we take power to be 3 for example : intersection of ideal \((x+1)\) and ideal \((y)\) is a subset of ideal \((x+1,y))^2\) or ideal \((x+1,y)\) but \((x+1)(y)\) is not in ideal \((x+1,y))^3\), …