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

f := homogenize(f);
XF2 := Scheme(ProjectiveSpace(P),f);
FF := FunctionField(XF2);
AFF := AlgorithmicFunctionField(FF);
plc1 := Places(AFF,1);
divgrp := DivisorGroup(AFF);
div1 := [divgrp ! i : i in plc1];
cuspsum := &+ div1;
load "function_degrees.m";

print("The number of places of degrees 1-4:");
[#Places(AFF,i) : i in [1..4]];
// [ 11, 0, 0, 0 ]

// Our goal is to show that X1(23) has no non-constant functions of degree <7
// over F2 and hence over Q.

// Say f is a function of degree <= 6, since f^(-1)({0,1,infinity}) contains
// all 11 rational points, by the pigeon hole principle we may assume that
// f^(-1)({infinity} contains at least 4 distinct rational points, and so
// the remaining polar-part of f has degree at most 2.

s := {(cuspsum + 1*Q1+plc1[1]) : Q1 in plc1};
&cat[FunctionDegrees(D) : D in s];

