Construct a complete, production-ready Python script (no com...
Prompt
Construct a complete, production-ready Python script (no comments, no simplification, no dummy code, no code blocks, *only* the file, unabridged and error-free) that explicitly implements, at the source-code level, the full algebraic workflow for searching a 2D counterexample to the classical Jacobian conjecture \[ F=(F_1,F_2)\in\mathbb{C}[x,y]^2, \] with \[ \det JF\equiv 1,\qquad F(P)=F(Q),\quad P\neq Q, \] using the globally normalized Ansatz \[ F_1 = x + P(x, y),\quad F_2 = y + Q(x, y), \] where \(P, Q \in (x, y)^2\), and \[ F(0,0)=F(1,0) = (0,0). \] The script must: - Accept input for the maximum degree \(d\) of the unknown polynomials \(P, Q\). - Construct all monomials of total degree at least 2 and at most \(d\) for both \(P\) and \(Q\); define all corresponding unknown coefficients. - Form the symbolic expressions for \(F_1(x,y)\) and \(F_2(x,y)\). - Compute the full symbolic Jacobian determinant \(\det JF\) and subtract 1. - Compute and expand all polynomial equations for each monomial coefficient of \(\det JF - 1\). - Impose the normalized collision constraints: \[ 1 + P(1, 0) = 0, \qquad Q(1, 0) = 0 \] - Collect all unknowns and all equations. - Compute and print the reduced Gröbner basis for this ideal (over \(\mathbb{Q}\)), explicitly. - If the basis is \([1]\), print this fact. - If not, print one explicit (possibly parametric) solution for the coefficients and the resulting explicit \(F_1, F_2\), together with a full verification: - Print their forms, - Print \(\det JF-1\), - Print \(F_1(1,0)\), \(F_2(1,0)\), - Print and check if \(F_1(0,0)=F_1(1,0)\) and \(F_2(0,0)=F_2(1,0)\), - Print \(P \ne Q\). The output must be suitable for rigorous mathematical certification and must not use any code shortcut, omission, or verbal summary. All computation must happen within this single file via sympy (and optionally, numpy or sage.symbolic, if available). The output must be the *entire* source file, no code block markers. # File begins import sympy as sp def all_monomials(x, y, deg_min, deg_max): monoms = [] for deg in range(deg_min, deg_max + 1): for i in range(deg + 1): j = deg - i monoms.append((i, j)) return monoms def build_poly_with_vars(name, x, y, deg_min, deg_max): monoms = all_monomials(x, y, deg_min, deg_max) vars = [] poly = 0 for i, j in monoms: v = sp.symbols(f'{name}{i}_{j}') vars.append(v) poly += v * x**i * y**j return poly, vars, monoms def collision_equations(Ppoly, Qpoly, x, y): eq1 = 1 + Ppoly.subs({x:1, y:0}) eq2 = Qpoly.subs({x:1, y:0}) return [eq1, eq2] def jacobian_equations(F1, F2, x, y): dF1x = sp.diff(F1, x) dF1y = sp.diff(F1, y) dF2x = sp.diff(F2, x) dF2y = sp.diff(F2, y) Jdet = dF1x * dF2y - dF1y * dF2x D = sp.expand(Jdet - 1) mons = [] for p in sp.Poly(D, x, y).terms(): c, e = p coeff = c mon = x**e[0] * y**e[1] mons.append( (coeff, mon, e) ) eqs = [] for coeff, mon, ex in mons: eqs.append(coeff) return eqs, Jdet def explicit_solution(unknowns, groebner_basis): if not groebner_basis: return {} sol = sp.solve(groebner_basis, unknowns, dict=True) if not sol: return {} return sol[0] def substitute_solution(poly, sol): if not sol: return poly return sp.expand(poly.subs(sol)) def main(): x, y = sp.symbols('x y') deg_min = 2 deg_max = 4 Ppoly, Pvars, Pmonoms = build_poly_with_vars('a', x, y, deg_min, deg_max) Qpoly, Qvars, Qmonoms = build_poly_with_vars('b', x, y, deg_min, deg_max) F1 = x + Ppoly F2 = y + Qpoly jac_eqs, Jdet = jacobian_equations(F1, F2, x, y) coll_eqs = collision_equations(Ppoly, Qpoly, x, y) unknowns = Pvars + Qvars all_eqs = jac_eqs + coll_eqs G = sp.groebner(all_eqs, *unknowns, order='lex') print("Number of unknowns:", len(unknowns)) print("Number of equations:", len(all_eqs)) print('Reduced Groebner basis:') for p in G: print(sp.expand(p)) if len(G) == 1 and G[0] == 1: print('Groebner basis is [1], the ideal is unit. No such normalized polynomial map exists in degree', deg_max) return sol = explicit_solution(unknowns, G) if sol: print('Found solution for coefficients:') for k in unknowns: print(f'{k} = {sp.simplify(sol.get(k, 0))}') else: print('No explicit solution found. Try modular/specialized search.') return F1s = substitute_solution(F1, sol) F2s = substitute_solution(F2, sol) print('Explicit F1(x,y):', F1s) print('Explicit F2(x,y):', F2s) dF1x = sp.diff(F1s, x) dF1y = sp.diff(F1s, y) dF2x = sp.diff(F2s, x) dF2y = sp.diff(F2s, y) Jdet_s = sp.expand(dF1x * dF2y - dF1y * dF2x) print('det(JF) - 1:') print(sp.expand(Jdet_s - 1)) F1_1_0 = substitute_solution(F1, sol).subs({x:1, y:0}) F2_1_0 = substitute_solution(F2, sol).subs({x:1, y:0}) print('F1(1,0):', F1_1_0) print('F2(1,0):', F2_1_0) F1_0_0 = substitute_solution(F1, sol).subs({x:0, y:0}) F2_0_0 = substitute_solution(F2, sol).subs({x:0, y:0}) print('F1(0,0):', F1_0_0) print('F2(0,0):', F2_0_0) print('F1(1,0)-F1(0,0):', F1_1_0 - F1_0_0) print('F2(1,0)-F2(0,0):', F2_1_0 - F2_0_0) if F1_1_0 == F1_0_0 and F2_1_0 == F2_0_0: print('Collision: F(0,0) = F(1,0)') else: print('No collision: F(0,0) ≠ F(1,0)') print('P ≠ Q:', (0,0) != (1,0) ) if __name__ == "__main__": main() # File ends --- **Reminder:** The objective is to output a full polynomial search for a normalized 2D Jacobian counterexample as unabridged source code, including symbolic construction, polynomial system, Gröbner basis computation, and explicit verification, with *no comments, no code blocks, no simplification, no omissions*. Revisit this objective if referencing the long instructions above.
Response not available
Response not available