---
title: "Basic Operations"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/operation.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/operation.md"
part: "Matrices and Linear Algebra"
chapter: "Vector Spaces"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Matrices and Linear Algebra", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/index-matrices-linear-algebra.md"}
  - {"title": "Vector Spaces", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/index-vector-spaces.md"}
prev: {"title": "Changing the Coefficient Field", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/modification-coefficient-field.md"}
next: {"title": "Reducing Vectors Relative to a Subspace", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/reducing-vectors.md"}
intrinsics:
  - {"name": ".", "signature": "V . i: ModTupFld, RngIntElt -> ModTupFldElt"}
  - {"name": "CoefficientField", "signature": "CoefficientField(V): ModTupFld -> Fld"}
  - {"name": "BaseField", "signature": "BaseField(V): ModTupFld -> Fld"}
  - {"name": "Degree", "signature": "Degree(V): ModTupFld -> RngIntElt"}
  - {"name": "Degree", "signature": "Degree(u): ModTupFldElt -> RngIntElt"}
  - {"name": "Dimension", "signature": "Dimension(V): ModTupFld -> RngIntElt"}
  - {"name": "Generators", "signature": "Generators(V): ModTupFld -> { ModElt}"}
  - {"name": "NumberOfGenerators", "signature": "NumberOfGenerators(M): ModTupFld -> RngIntElt"}
  - {"name": "Ngens", "signature": "Ngens(M): ModTupFld -> RngIntElt"}
  - {"name": "OverDimension", "signature": "OverDimension(V): ModTupFld -> RngIntElt"}
  - {"name": "OverDimension", "signature": "OverDimension(u): ModTupFldElt -> RngIntElt"}
  - {"name": "Generic", "signature": "Generic(V): ModFld -> ModFld"}
  - {"name": "Parent", "signature": "Parent(V): ModFld -> SetPow"}
  - {"name": "in", "signature": "v in V: ModTupFldElt, ModTupFld -> BoolElt"}
  - {"name": "notin", "signature": "v notin V: ModTupFldElt, ModTupFld -> BoolElt"}
  - {"name": "subset", "signature": "U subset V: ModTupFld, ModTupFld -> BoolElt"}
  - {"name": "notsubset", "signature": "U notsubset V: ModTupFld, ModTupFld -> BoolElt"}
  - {"name": "eq", "signature": "U eq V: ModTupFld, ModTupFld -> BoolElt"}
  - {"name": "ne", "signature": "U ne V: ModTupFld, ModTupFld -> BoolElt"}
  - {"name": "+", "signature": "U + V: ModTupFld, ModTupFld -> ModTupFld"}
  - {"name": "meet", "signature": "U meet V: ModTupFld, ModTupFld -> ModTupFld"}
  - {"name": "meet:=", "signature": "U meet:= V: ModTupFld, ModTupFld -> ModTupFld"}
  - {"name": "&meet", "signature": "&meet S: [ ModTupFld ] -> ModTupFld"}
  - {"name": "TensorProduct", "signature": "TensorProduct(U, V): ModTupFld, ModTupFld -> FldElt"}
  - {"name": "Complement", "signature": "Complement(V, U): ModTupFld, ModTupFld -> ModTupFld"}
  - {"name": "Transversal", "signature": "Transversal(V, U): ModTupFld, ModTupFld -> { ModTupFldELt}"}
---

# Basic Operations

## Accessing Vector Space Invariants

<a id="operation-operation-modtupfld-rngintelt-modtupfldelt"></a>
### `V . i: ModTupFld, RngIntElt -> ModTupFldElt`

Given a vector space $V$ and a positive integer $i$, return the $i$-th generating element of $V$.

<a id="function-coefficientfield-modtupfld"></a>
### `CoefficientField(V): ModTupFld -> Fld`

<a id="function-basefield-modtupfld"></a>
### `BaseField(V): ModTupFld -> Fld`

Given a $K$-vector space $V$, return the field $K$.

<a id="function-degree-modtupfld"></a>
### `Degree(V): ModTupFld -> RngIntElt`

Given a $K$-vector space $V$ which is a subspace of $K^{(n)}$, return $n$.

<a id="function-degree-modtupfldelt"></a>
### `Degree(u): ModTupFldElt -> RngIntElt`

Given a vector $u$ belonging to a subspace of the vector space $K^{(n)}$, return $n$.

<a id="function-dimension-modtupfld"></a>
### `Dimension(V): ModTupFld -> RngIntElt`

The dimension of the vector space $V$.

<a id="function-generators-modtupfld"></a>
### `Generators(V): ModTupFld -> { ModElt}`

The generators for the vector space $V$, returned as a set.

<a id="function-numberofgenerators-modtupfld"></a>
### `NumberOfGenerators(M): ModTupFld -> RngIntElt`

<a id="function-ngens-modtupfld"></a>
### `Ngens(M): ModTupFld -> RngIntElt`

The number of generators for the vector space $V$.

<a id="function-overdimension-modtupfld"></a>
### `OverDimension(V): ModTupFld -> RngIntElt`

Given a $K$-vector space $V$ which is a subspace of $K^{(n)}$, return $n$.

<a id="function-overdimension-modtupfldelt"></a>
### `OverDimension(u): ModTupFldElt -> RngIntElt`

Given a vector $u$ belonging to a subspace of the vector space $K^{(n)}$, return $n$.

<a id="function-generic-modfld"></a>
### `Generic(V): ModFld -> ModFld`

The generic vector space containing $V$, i.e. the full vector space in which $V$ is naturally embedded.

<a id="function-parent-modfld"></a>
### `Parent(V): ModFld -> SetPow`

The power structure for the vector space $V$ (the set consisting of all finite dimensional vector spaces).

## Membership and Equality

<a id="operation-op-in-modtupfldelt-modtupfld"></a>
### `v in V: ModTupFldElt, ModTupFld -> BoolElt`

Returns `true` if the element $v$ lies in the vector space $V$, where $v$ and $V$ belong to a common space.

<a id="operation-op-notin-modtupfldelt-modtupfld"></a>
### `v notin V: ModTupFldElt, ModTupFld -> BoolElt`

Returns `true` if the element $v$ does not lie in the vector space $V$, where $v$ and $V$ belong to a common space.

<a id="operation-op-subset-modtupfld-modtupfld"></a>
### `U subset V: ModTupFld, ModTupFld -> BoolElt`

Returns `true` if the $K$-vector space $U$ is contained in the $K$-vector space $V$, where $U$ and $V$ are subspaces of some common vector space.

<a id="operation-operation-notsubset-modtupfld-modtupfld-boolelt"></a>
### `U notsubset V: ModTupFld, ModTupFld -> BoolElt`

Returns `true` if the $K$-vector space $U$ is not contained in the $K$-vector space $V$, where $U$ and $V$ are subspaces of some common vector space.

<a id="operation-op-eq-modtupfld-modtupfld"></a>
### `U eq V: ModTupFld, ModTupFld -> BoolElt`

Returns `true` if the subspaces $U$ and $V$ are equal, where $U$ and $V$ belong to a common vector space.

<a id="operation-op-ne-modtupfld-modtupfld"></a>
### `U ne V: ModTupFld, ModTupFld -> BoolElt`

Returns `true` if the subspaces $U$ and $V$ are not equal, where $U$ and $V$ belong to a common vector space.

## Operations on Subspaces

<a id="operation-op-plus-modtupfld-modtupfld"></a>
### `U + V: ModTupFld, ModTupFld -> ModTupFld`

Sum of the subspaces $U$ and $V$, where $U$ and $V$ must be subspaces of a common vector space.

<a id="operation-op-meet-modtupfld-modtupfld"></a>
### `U meet V: ModTupFld, ModTupFld -> ModTupFld`

Intersection of the subspaces $U$ and $V$, where $U$ and $V$ must be subspaces of a common vector space.

<a id="operation-operation-meet-modtupfld-modtupfld-modtupfld"></a>
### `U meet:= V: ModTupFld, ModTupFld -> ModTupFld`

Replace $U$ with the intersection of the subspaces $U$ and $V$, where $U$ and $V$ must be subspaces of a common vector space.

<a id="operation-operation-meet-modtupfld-modtupfld"></a>
### `&meet S: [ ModTupFld ] -> ModTupFld`

Intersection of the subspaces of the set or sequence $S$, which must be subspaces of a common vector space.

<a id="function-tensorproduct-modtupfld-modtupfld"></a>
### `TensorProduct(U, V): ModTupFld, ModTupFld -> FldElt`

The tensor (Kronecker) product of the vector spaces $U$ and $V$, generated by all the tensor products of elements of $U$ by elements of $V$. The resulting vector space has degree equal to the product of the degrees of $U$ and $V$.

<a id="function-complement-modtupfld-modtupfld"></a>
### `Complement(V, U): ModTupFld, ModTupFld -> ModTupFld`

Given a subspace $U$ of the vector space $V$, construct a complement for $U$ in $V$ (a subspace of $V$).

Note that this complement is always with respect to the standard inner product, and thus need not be orthogonal with respect to a given one.

<a id="function-transversal-modtupfld-modtupfld"></a>
### `Transversal(V, U): ModTupFld, ModTupFld -> { ModTupFldELt}`

Given a subspace $U$ of the vector space $V$ over a finite field, return a transversal for $U$ in $V$ as a set of vectors.
