[step:Compute Hecke matrices from finitely many Fourier coefficients]
Fix $k \in \mathbb{Z}$ and let $V$ denote either $M_k$ or $S_k$. Since $V$ is finite-dimensional, choose a basis $v_1,\dots,v_r$ of $V$. For each $i \in \{1,\dots,r\}$, write the Fourier expansion
\begin{align*}
v_i(z)=\sum_{m=0}^{\infty} b_{i,m}q^m.
\end{align*}
The $q$-expansion map
\begin{align*}
Q: V &\to \mathbb{C}[[q]] \\
h &\mapsto \sum_{m=0}^{\infty} c_m q^m
\end{align*}
is injective, because a modular form whose Fourier expansion at the cusp is identically zero vanishes on a punctured neighbourhood of the cusp and hence vanishes identically by the identity theorem for holomorphic functions. Since $V$ is finite-dimensional and $Q(v_1),\dots,Q(v_r)$ are linearly independent in $\mathbb{C}[[q]]$, there exists $N \in \mathbb{Z}_{\geq 0}$ such that the truncated coefficient map
\begin{align*}
Q_N: V &\to \mathbb{C}^{N+1} \\
h=\sum_{m=0}^{\infty} c_m q^m &\mapsto (c_0,c_1,\dots,c_N)
\end{align*}
is injective.
Now fix $n \in \mathbb{N}$. For a form
\begin{align*}
h(z)=\sum_{m=0}^{\infty} c_mq^m
\end{align*}
in $V$, the Hecke coefficient formula gives
\begin{align*}
T_n h
=
\sum_{m=0}^{\infty}
\left(
\sum_{d\mid \gcd(m,n)} d^{k-1}c_{mn/d^2}
\right)q^m.
\end{align*}
Thus the first $N+1$ coefficients of $T_n h$ are determined by finitely many coefficients of $h$. Since each basis vector $v_i$ is explicitly computable from the polynomial expressions in $E_4$, $E_6$, and possibly $\Delta$, the vectors $Q_N(T_n v_i)$ can be computed finitely. Injectivity of $Q_N$ then determines the unique coordinates of $T_n v_i$ in the basis $v_1,\dots,v_r$, and hence determines the matrix of $T_n$ on $V$.
[/step]