A<x,y> := PolynomialRing(GF(2),2);
P,homogenize := Homogenization(A);
print("f := The polynomial from math.mit.edu/~drew/FFFc25.txt reduced mod 2");
f := (x+1)*x^3*y^8+(x^3+x^2+1)*x^2*y^7+(x+1)^3*x^3*y^6+(x+1)*(x^4+x+1)*x^2*y^5+(x+1)*y^4+(x+1)*x^3*y^3+(x^6+x^5+x^2+x+1)*x^2*y^2+x^3*y+1+x^2+x^3+x^4+x ;
C := ProjectiveClosure(Curve(Spec(A),f));

print("The number of places of degrees 1..5:");
print [#Places(C,i) : i in [1..5]];

cuspsum := &+ Places(C,1);
pole := Divisor(Places(C,5)[1]);
p := Places(C,1)[1];

for q,r in Places(C,1) do
  R,m := RiemannRochSpace(cuspsum+p+q+r);
  for f in R do
    g := m(f);
    d := Degree(g);
    if d le 7 and d ge 1 then
       assert IsLinearlyEquivalent(Numerator(Divisor(g)),pole);
    end if;
  end for;
end for;

print("The above loop showed that there are no functions of degree 6 and degree 7,");
print("and that all functions of degree 5 have a pole that is linearly equivalent");
print("to the divisor in the variable 'pole'.");

[Dimension(pole+p+q) : q in Places(C,1)];

print("The above shows that W_7^2(F_2) and hence W_6^2(F_2) are empty. This is");
print("because there are no functions of degree 6 or 7 so we know that every element");
print("in L in W_7^2(F_2) is of the form O(pole + D) where pole is a pole divisor of");
print("a function of degree 5 and D a divisor of degree 2.");
