# Subspaces

The following functions compute the cuspidal, Eisenstein, and new subspaces, along with the complement of a subspace.

## `CuspidalSubspace(M): ModSym -> ModSym`

The cuspidal subspace of the space of modular symbols $M$. This is the kernel of `BoundaryMap(M)`.

## `IsCuspidal(M): ModSym -> BoolElt`

Returns `true` if and only if the space of modular symbols $M$ is contained in the cuspidal subspace of the ambient space.

## `EisensteinSubspace(M): ModSym -> ModSym`

The Eisenstein subspace of the space of modular symbols $M$. This is the complement in $M$ of the cuspidal subspace of $M$.

## `IsEisenstein(M): ModSym -> BoolElt`

Returns `true` if and only if the space of modular symbols $M$ is contained in the Eisenstein subspace of the ambient space.

## `NewSubspace(M): ModSym -> ModSym`

The new subspace of the space of modular symbols $M$. This is the intersection of `NewSubspace(M,p)` as $p$ varies over all prime divisors of the level of $M$. Note that $M$ is required to be cuspidal.

## `IsNew(M): ModSym -> BoolElt`

Returns `true` if and only if the space of modular symbols $M$ is contained in the new cuspidal subspace of the ambient space.

## `NewSubspace(M, p): ModSym, RngIntElt -> ModSym`

The $p$-new subspace of the space of modular symbols $M$. This is the kernel of the degeneracy map from $M$ to the space of modular symbols of level equal to the level of $M$ divided by $p$ and character the restriction of the character of $M$. If the character of $M$ does not restrict, then `NewSubspace(M,p)` is equal to $M$. Note that $M$ is required to be cuspidal.

## `Kernel(I, M): [Tup], ModSym -> ModSym`

The kernel of $I$ on the space of modular symbols $M$. Let $T_p$ denote the $p$th Hecke operator (see Section [Operators](operators.md#modsym-operators)). This is the subspace of $M$ obtained by intersecting the kernels of the operators $f_n(T_{p_n})$, where $I$ is a sequence $[\langle p_1, f_1(x)\rangle,...,\langle p_n,f_n(x)\rangle]$ of pairs consisting of a prime number and a polynomial. Only primes $p_i$ which do not divide the level of $M$ are used.

## `Complement(M): ModSym -> ModSym`

The space of modular symbols complementary to the space of modular symbols $M$ in the ambient space of $M$. Thus the ambient space of $M$ is equal to the direct sum of $M$ and `Complement(M)`.

## `BoundaryMap(M): ModSym -> ModMatFldElt`

A matrix that represents the boundary map from the space of modular symbols $M$ to the vector space whose basis consists of the weight $k$ cusps. (Note: At present there is no intrinsic that lists these cusps.)

## `Example: Subspaces (ex-a39393)`

First we compute the cuspidal subspace of the space of modular symbols for $\Gamma_0(11)$.

```magma
> M := ModularSymbols(11,2); M;
Full modular symbols space for Gamma_0(11) of weight 2 and dimension 3
over Rational Field
> IsCuspidal(M);
false
> C := CuspidalSubspace(M); C;
Modular symbols space for Gamma_0(11) of weight 2 and dimension 2 over
Rational Field
> IsCuspidal(C);
true

```

Next we compute the Eisenstein subspace.

```magma
> IsEisenstein(C);
false
> E := EisensteinSubspace(M); E;
Modular symbols space for Gamma_0(11) of weight 2 and dimension 1 over
Rational Field
> IsEisenstein(E);
true
> E + C eq M;
true

```

The Eisenstein subspace is the complement of the cuspidal subspace, and conversely.

```magma
> E eq Complement(C);
true
> C eq Complement(E);
true

```

## `Example: Boundary Map (ex-2e2403)`

```magma
> M := ModularSymbols("37B"); M;
Modular symbols space for Gamma_0(37) of weight 2 and dimension 2 over
Rational Field
> BoundaryMap(M);
[0 0]
[0 0]
> A := AmbientSpace(M);
> BoundaryMap(A);
[ 0  0]
[ 0  0]
[ 0  0]
[ 0  0]
[ 1 -1]

```

Observe that the Eisenstein subspace of $A$ is not in the kernel of the boundary map.

```magma
> Basis(VectorSpace(EisensteinSubspace(A)));
[
    (0 0 0 1 3)
]

```
