###################################################################### ## Hilbert10.txt Save this file as Hilbert10.txt to use it, # # stay in the # ## same directory, get into Maple (by typing: maple ) # ## and then type: read `Hilbert10.txt`: # ## Then follow the instructions given there # ## # ## Written by Robert Dogherty-Bliss and Doron Zeilberger, # ##Rutgers University , # ## Send bugs to DoronZeil at gmail dot com # ###################################################################### print(`First Written: Sept. 2022: tested for Maple 2020`): print(`Version : Sept. 2022 `): print(): print(`This is Hilbert10.txt, A Maple package`): print(`accompanying Robert Dogherty-Bliss nd Doron Zeilberger's article: `): print(` Experimenting with Matiyasevich's Seminal Proof of Hilbret's 10th problem `): print(): print(`The most current version is available on WWW at:`): print(` http://sites.math.rutgers.edu/~zeilberg/tokhniot/Hilbert10.txt .`): print(`Please report all bugs to: DoronZeil at gmail dot com .`): print(): print(`For general help, and a list of the MAIN functions,`): print(` type "ezra();". For specific help type "ezra(procedure_name);" `): print(`For a list of the supporting functions type: ezra1();`): print(): ezra1:=proc() if args=NULL then print(`The SUPPORTING procedures are`): print(` EMatrix`): else ezra(args): fi: end: ezra:=proc() if args=NULL then print(` Hilbert10.txt: A Maple package for experimenting with Matiyasevich's proof of Hilbert 10th`): print(`The MAIN procedures are:`): print(` Bmat, Dio, BackwardsProof, SeqFromRec, SolveD, SolveDd`): print(`CheckYuriBad, findBadYuriDiag, BackwardsInequalities`): elif nargs=1 and args[1]=Bmat then print(`Bmat(b): The matrix associated with the C-finite recurrence with coefficients [b[1], b[2], ..., nops(b)]`): print(`Try:`): print(`Bmat([2, -1]);`): print(`Bmat([a, b, 1]);`): elif nargs=1 and args[1]=BackwardsProof then print(`BackwardsProof(b): Returns the simplified difference`): print(` P(x[1], x[2], ..., x[nops(b)]) - P(x[0], x[1], x[2], ..., x[nops(b) - 1])`): print(`where P is the polynomial Dio(b, x) and x[0] is the value obtained by`): print(`undoing the recurrence with coefficients [b[1], b[2], ..., b[nops(b)]]`): print(`on the values x[1], x[2], ..., x[nops(b)].`): print(`In particular, if this is 0, then the diophantine equation is possibly`): print(`uniquely solved by consecutive terms of the C-finite sequence`): print(`[[0, 0, ..., 0, 1], [b[1], ..., b[nops(b)]]]`): print(`Try:`): print(`BackwardsProof([3, -1])`): print(`BackwardsProof([3, 2, 1])`): print(`BackwardsProof([a, b, 1])`): elif nargs=1 and args[1]=Dio then print(`Dio(b, x): The polynomial P(x[1],x[2],...x[nops(b)]) such that the solution`): print(`a(n) to the recurrence with coefficients [b[1], b[2], ..., b[nops(b)]] and`): print(`initial conditions [0, 0, ..., 0, 1] satisfies`): print(`P(a(n), a(n + 1), ..., a(n + nops(b) - 1)) = det(B)^n,`): print(`where B is the matrix associated with the recurrence.`): print(`Try:`): print(`Dio([3, -1], x)`): print(`Dio([3, 2, 1], x)`): elif nargs=1 and args[1]=DioV then print(`DioV(b,k): Verbose form of Dio(b,k). Try:`): print(`DioV(b,2,x);`): elif nargs=1 and args=EMatrix then print(`EMatrix(b, e, n): Produce Bmat(b)^n in terms of the first fundamental sequence e(n),`): print(`i.e., the solution to the recurrence with coefficients b[1], b[2], ..., b[m]`): print(`with initial conditions 0, 0, ..., 0, 1.`): print(`Try:`): print(`EMatrix([b, -1], e, n);`): elif nargs=1 and args[1]=SeqFromRec then print(`SeqFromRec(S,N): Inputs S=[INI,ope]`): print(`where INI is the list of initial conditions, a ope a list of`): print(`size L, say, and a recurrence operator ope, codes a list of`): print(`size L, finds the first N0 terms of the sequence satisfying`): print(`the recurrence f(n)=ope[1]*f(n-1)+...ope[L]*f(n-L).`): print(`For example, for the first 20 Fibonacci numbers,`): print(`try: SeqFromRec([[1,1],[1,1]],20);`): elif nargs=1 and args[1]=SolveD then print(`SolveD (p, vars, K)`): print(` Input: Polynomial p, list of variables var, and a positive integer K`): print(` Output: All positive integers K vars[1] <= vars[2] <= ... <= vars[m] <= K`): print(` such that p(vars[1], ..., vars[m]) = 0.`): print(`Try: `): print(`SolveD(x^2+y^2-z^2,[x,y,z],40);`): elif nargs=1 and args[1]=SolveDd then print(`SolveDd(p, vars, K)`): print(` Input: Polynomial p, list of variables var, and a positive integer K`): print(` Output: All positive integers K vars[1] < vars[2] < ... L then print(`The first two arguments must be lists of the same size`): RETURN(FAIL): fi: if not type(N,integer) then print(`The third argument must be an integer`, L): RETURN(FAIL): fi: if N member(L, chunks(SeqFromRec(C, n), nops(L))): findFundamentalSolutions := proc(Ls, rec) local ics, L: ics := []: for L in Ls do if not ormap(ic -> contained([ic, rec], L, 100), ics) then ics := [op(ics), L]: fi: od: ics: end: chunks := proc(L, n) local i: [seq(L[i..i+n-1], i=1..nops(L)-n)]: end: # Example code (* P := Dio([1, 1, 1, -1], x): Ls := SolveD(P - 1, [x[1], x[2], x[3], x[4]]): findFundamentalSolutions(Ls, [1, 1, 1, -1]): *) findYuriLike := proc(K) local a, b, c, P, Ls, solns, res, x: res := []: for a from 1 to K do for b from 1 to K do P := Dio([a, b, 1], x): Ls := SolveD(P - 1, [x[1], x[2], x[3]], 100): solns := findFundamentalSolutions(Ls, [a, b, 1]): if nops(solns) = 1 then res := [op(res), [a, b, 1]]: fi: od: od: res: end: # Find the equations Dio([a, a, 1], x) that are generated by *more* than 1 # fundamental solution (probably) from a = 1 to K, using the solutions up to M. findBadYuriDiag := proc(K, M) local a, c, P, Ls, solns, res, x: res := []: for a from 1 to K do print(a): if CheckYuriBad([a, a, 1], M) then res := [op(res), a]: fi: od: res: end: # Check if the solutions to Dio(rec, x) - 1 are generated by more than one set # of initial conditions. (Efficiently, without generating all possible # solutions up to K.) CheckYuriBad := proc(rec, K) option remember: local p, x, L, i, k, solns, res: p := Dio(rec, x) - 1: solns := {}: res := {}: L := [0 $ nops(rec)]: while L <> [K $ nops(rec)] do if subs({seq(x[i] = L[i], i=1..nops(L))}, p) = 0 then solns := {op(solns), L}: if nops(findFundamentalSolutions(solns, rec)) > 1 then # We know it's bad. return true: fi: fi: for i from nops(L) to 1 by -1 while L[i] = K do od: # i is the index of the first thing we can increment. # Note that i will never be zero because of the condition on the while # loop. L[i] := L[i] + 1: for k from i + 1 to nops(L) do L[k] := L[i]: od: od: # We think it's good. return false: end: yuriFundamentalSolutions := proc(a, M) local P, Ls, x: P := Dio([a, a, 1], x) - 1: Ls := SolveD(P, [x[1], x[2], x[3]], M): findFundamentalSolutions(Ls, [a, a, 1]): end: # Return the inequalities that the backwards transformation should satisfy. BackwardsInequalities := proc(b, x) local f, B, m, transform, Binv, k, i, d, ineqs: f := Dio(b, x): B := Bmat(b): Binv := B^(-1): m := nops(b): transform := {seq(x[m - k] = x[m - k - 1], k=0..m-2)}: transform := transform union {x[1] = add(Binv[-1][i] * x[m - i + 1], i=1..m)}: ineqs := {0 <= x[1], seq(x[i] <= x[i + 1], i=1..m-1)}: ineqs union {f = 1}, subs(transform, ineqs) end: