# Basic Constructions

The following functions give some basic constructions on sheaves.

## `TensorProduct(S, T): ShfCoh, ShfCoh -> ShfCoh`

## `TensorPower(S, n): ShfCoh, RngIntElt -> ShfCoh`

```magma
Maximize: BoolElt                    Default: false
```

```magma
Maximize: BoolElt                    Default: true
```

The first intrinsic gives the tensor product (over ${{\cal O}_X}$) of two sheaves on the same scheme $X$. The second gives the $n$th tensor power of $S$ if $n > 0$, the $(-n)$th tensor power of the dual (see below) of $S$ if $n < 0$ and the structure sheaf ${{\cal O}_X}$ if $n=0$.

Defining modules for these constructions are taken as the appropriate tensor products of modules for the constituent sheaves when the parameter `Maximize` is `false`. The user should note that this is the archetypal case where the module constructed to define the resulting sheaf can be far from maximal, even when the defining modules of $S$ and $T$ are maximal. The rank of the presentation of the tensor power of a module rises rapidly with $n$. Thus, it is usually a good idea to set `Maximize` to `true`, which means that the maximal module of the result is computed and also used as its defining module.

## `Dual(S): ShfCoh -> ShfCoh`

For the sheaf $S$ on a scheme $X$, the function returns the dual sheaf ${\rm Hom}_{{{\cal O}_X}}(S,{{\cal O}_X})$.

## `SheafHoms(S, T): ShfCoh, ShfCoh -> ShfCoh, Map`

For $S$ and $T$ sheaves on the same scheme $X$, the function returns the sheaf $H = {\rm Hom}_{{{\cal O}_X}}(S,T)$. The module defining $H$ is ${\rm Hom}(M_{\rm max},N_{\rm max})$, where $M_{\rm max}$ and $N_{\rm max}$ are the maximal modules of $S$ and $T$. This module, $M_H$, is the maximal module of $H$.

Also returned is a map that takes a homogeneous element of $M_H$ (which can be recovered with `Module(H)` or `FullModule(H)`) of degree $d$ to the sheaf homomorphism of degree $d$ that it represents (see the next section for information about sheaf homomorphisms). All sheaf homomorphisms can be obtained this way.

## `DirectSum(S, T): ShfCoh, ShfCoh -> ShfCoh`

For $S$ and $T$ sheaves on the same scheme $X$, this function returns the sheaf direct sum $S \oplus T$.

## `Restriction(S, Y): ShfCoh, Sch -> ShfCoh`

```magma
Check: BoolElt                    Default: true
```

Given a sheaf $S$ on a scheme $X$ and a subscheme $Y$ of $X$, the function returns the restriction of $S$ to $Y$. A check that $Y$ is a subscheme of $X$ will be performed only if the parameter `Check` is `true` (the default).

## `Example: Cons Exs (ex-22d504)`

We look at the well-known example of a ruling $L$ on a (singular) projective quadric cone $X$ in $P^3$. We find the associated invertible sheaf $O_X(L)$ using the `DivisorToSheaf` intrinsic. The tensor square of this sheaf is $O_X(2L)$ which is just isomorphic to the $O_X(1)$ Serre twist of the structure sheaf, as $2L$ is a hyperplane section. We verify this by getting the tensor and inspection. Of course we need to saturate the result, illustrating that the basic tensor power of maximal modules usually does not result in a maximal module.

```magma
> P<x,y,z,t> := ProjectiveSpace(Rationals(),3);
> R := CoordinateRing(P);
> X := Scheme(P,x*y-z^2); // singular projective quadric
> IL := ideal<R|z,y>;     // line y=z=0 on X
> OL := DivisorToSheaf(X,IL); // associated sheaf O(L)

```

We first make sure that $OL$ is saturated.

```magma
> SaturateSheaf(~OL);
> Module(OL);
Graded Module R^2/<relations>
Relations:
[ y, -z],
[ z, -x]
> O2L := TensorProduct(OL,OL); // or TensorPower(OL,2)
> Module(O2L);
Graded Module R^4/<relations>
Relations:
[ y,  0, -z,  0],
[ 0,  y,  0, -z],
[ z,  0, -x,  0],
[ 0,  z,  0, -x],
[ y, -z,  0,  0],
[ z, -x,  0,  0],
[ 0,  0,  y, -z],
[ 0,  0,  z, -x]

```

Finally, we get the maximum module – just that of OX(1)!

```magma
> FullModule(O2L);
Reduced Module R^1/<relations> with grading [-1]
Relations:
[x*y - z^2]

```
