Exploring Christol's function, studied as an explicit globally bounded D-finite function which may not be a rational diagonal.
Requirements: ore_algebra package
# Define the rings of differential and shift operators
from ore_algebra import *
Ind.<n> = PolynomialRing(QQ); Shift.<Sn> = OreAlgebra(Ind)
Pols.<z> = PolynomialRing(QQ); Diff.<Dz> = OreAlgebra(Pols)
# Initial series terms of Christol's function from its definition
ser = add([rising_factorial(1/9,k)*rising_factorial(4/9,k)*rising_factorial(5/9,k)/rising_factorial(1/3,k)/rising_factorial(1,k) * z^k/factorial(k) for k in range(10)])
ser.truncate(5)
542421880/31381059609*z^4 + 3124550/129140163*z^3 + 2275/59049*z^2 + 20/243*z + 1
# By the definition of the factorial and rising factorial, the coefficients of Christol's function satisfy
show(LatexExpr("\\frac{c_{n+1}}{c_n} = \\frac{(n + 1/9) (n + 4/9) (n + 5/9)}{(n + 1/3) (n + 1)^2}"))
# Thus, the coefficient sequence satisfies the recurrence defined by the operator
rec = 729 * (n + 1/3) * (n + 1)^2 * Sn - 729 *(n + 1/9) * (n + 4/9) * (n + 5/9)
rec
(729*n^3 + 1701*n^2 + 1215*n + 243)*Sn - 729*n^3 - 810*n^2 - 261*n - 20
# This implies the generating function satisfies the D-finite equation defined by the operator
diff = rec.to_D(Diff)
diff
(-729*z^4 + 729*z^3)*Dz^4 + (-5913*z^3 + 3888*z^2)*Dz^3 + (-10791*z^2 + 3645*z)*Dz^2 + (-3620*z + 243)*Dz - 20
# The differential equation listed in the textbook corresponds to the following operator
text_diff = 729*z^2*(z-1)*Dz^3 + 81*z*(37*z-21)*Dz^2 + 9*(200*z-27)*Dz + 20
text_diff
(729*z^3 - 729*z^2)*Dz^3 + (2997*z^2 - 1701*z)*Dz^2 + (1800*z - 243)*Dz + 20
# The textbook differential equation is a right factor of the differential equation calculated here
diff.quo_rem(text_diff)
(-z*Dz - 1, 0)
# Thus, Christol's function satisfies the textbook differential equation if the textbook equation
# has a solution with the same 4 initial series terms as Christol's function, which it does
print(text_diff.power_series_solutions(5)[0])
print(diff.power_series_solutions(5)[0])
1 + 20/243*z + 2275/59049*z^2 + 3124550/129140163*z^3 + O(z^4) 1 + 20/243*z + 2275/59049*z^2 + 3124550/129140163*z^3 + O(z^4)