How do you compute modular symbols? In John Cremona's book, he defines the modular symbol of an elliptic curve in the following way.
Let $E/\mathbf{Q}$ be an elliptic curve and let $f_E$ be the modular form associated to $E$. The modular symbol associated to $E$ is the map $\mathbf{Q} \to \mathbf{Q}$ given by sending any $r \in \mathbf{Q}$ to the rational number
$$ [r] := \dfrac{2 \pi i}{\Omega_E} \left( \int_r^{i \infty} f_E(z) \, dz +  \int_{-r}^{i \infty} f_E(z) \, dz \right). $$
These modular symbols contain interesting information about $L$-values of $E$. I have two questions about this (in increasing levels of importance):

*

*Where can I find a proof that $[r]$ is indeed a rational number? If anyone has a reference, that would be great.


*How do we compute the value of $[r]$ exactly (i.e: not a numerical approximation)? Cremona's book says that for any $r \in \mathbf{Q}$, the value of $[r]$ can be computed exactly. (And in any case, Sage can compute the values exactly.) But I can't find a theorem anywhere that gives a formula for the exact value of $[r]$. If anyone knows of an algorithm to get an exact value of $[r]$, or better yet, a formula that gives the exact value of $[r]$ in terms of invariants of the elliptic curve $E$, I'd greatly appreciate it.
Thanks for the help!
 A: There are two ways.
You can calculate a sufficiently good approximation by integrating numerically the modular form. Since the value of the modular symbol is known to be a rational number and we know a bound for the denominator (by the Manin-Drinfeld Theorem), we know to what precision we need to evaluate the integral. The problem is that the integral converges very slowly if you integrate naively all the way down to the real axis. Instead one should use Atkin-Lehner involutions to move the cusps. This results in a very fast method to compute a single $[r]$ for a single curve as long as the conductor $N$ is square-free and not in the billions. This is implemented as implementation="num" in SageMath.
The second method is to determine the $\mathbb{Q}$-vector space of modular symbols attached to the isogeny class of the elliptic curve $E$ among the total space of modular symbols for the group $\Gamma_0(N)$. This is done by taking the quotient by the relations imposed by the Hecke operators. These computations are all done with rational numbers, they are inherently exact. There is an issue about the scaling to make sure that the period map corresponds to the particular curve in the isogeny class; but this can be done with a single comparison with some $L$-value. Once the space is determined, each evaluation $[r]$ for any $r$ is very fast. This is implemented in pari-gp, magma, SageMath and in eclib. The latter is implemented by John Cremona and based on the explanations in the book you are refering to In particular chapter II. Belabas and Perrin-Riou have improve this a bit for pari-gp. The bottle neck of the computation here is the first step involving linear algebra of rather large matrices. For conductors below a million it should work.
If one is interested in computing many values for varying $r$, like for instance when computing the $p$-adic $L$-function of $E$, one should use overconvergent modular symbols instead.
