# ApCoCoA-1:SB.IsSagbiOf

## SB.IsSagbiOf

Checks if a set of polynomials is a SAGBI-basis of a given subalgebra.

### Syntax

```SB.IsSagbiOf(Gens:LIST of POLY, Basis:LIST of POLY):BOOL
```

### Description

This function checks if the given list of polynomials Basis forms a SAGBI-basis of the subalgebra S generated by the polynomials of the list Gens, i.e. it is checked if Basis is a SAGBI-Basis and if Basis also generates the subalgebra S. Then the corresponding boolean value is returned.

• @param Gens A list of polynomials, which are the generators of the current subalgebra.

• @param Basis A list of polynomials, possibly a SAGBI-basis of the current subalgebra.

• @return The corresponding boolean value.

#### Example

```Set Indentation;
Use R::=QQ[x,y], DegLex;

G:=[x^2-y^2,x^2y,x^2y^2-y^4,x^2y^4,y^6x^2y^6-y^8];
SBasis:=SB.Sagbi(G);
SBasis;

SB.IsSagbiOf(G,SBasis);

-- This SAGBI-basis generates the same subalgebra as the
-- the polynomials of the set G
[
x^2 - y^2,
x^2y,
x^2y^2 - y^4,
x^2y^4,
x^2y^12 - y^8,
y^6,
x^2y^6 - y^8,
x^2y^16 + x^4y^8 - y^12,
x^2y^10 - 3/8y^12,
y^14 - y^8,
y^14 - y^8]
-------------------------------
TRUE
-------------------------------
-- Done.
-------------------------------
```

#### Example

```Set Indentation;
Use R::=QQ[x,y], DegLex;

G:=[x+y,xy];
SBasis:=SB.Sagbi(G);
SBasis;

SB.IsSagbiOf(G,SBasis);

-- This SAGBI-basis generates the same subalgebra as the
-- the polynomials of the set G
[
x + y,
xy]
-------------------------------
TRUE
-------------------------------
-- Done.
-------------------------------
```

#### Example

```Set Indentation;
Use R::=QQ[x,y], DegLex;

G:=[x+y,xy];
Basis:=[x^3+x^2y];

-- The polynomial y^3+x^2y is not a member of K[G].
-- Therefore it is impossible that the given Basis generates
-- the same subalgebra.

SB.IsSagbiOf(G,Basis);

FALSE
-------------------------------
-- Done.
-------------------------------
```