{"id":"polynomial-division-check","version":"1.0.0","description":"Check a claimed polynomial division A = BQ + R over exact rationals: remainder degree, quotient degree, coefficients.","supported_operations":["check a polynomial long division result","verify quotient and remainder of polynomial division","is this synthetic division correct","check that a polynomial divides another exactly","validate remainder degree is less than divisor degree","verify a = b times q plus r for polynomials"],"unsupported_operations":["performing the division (supply the claimed quotient and remainder)","division over finite fields or integers modulo m","multivariate or pseudo-division conventions","floating-point coefficients"],"semantics":["Polynomials are canonical ascending coefficient arrays (entry k = coefficient of x^k, last entry nonzero, [] = zero) of exact rational strings (<= 40 characters), degree <= 64. Euclidean division over Q: A = BQ + R with R = 0 or deg R < deg B (Cohen 1993, s3.1.3; reference_version cohen-gtm138-1993-ch3).","Divisor [] is not_computable. remainder may be omitted, which claims R = 0 (exact divisibility).","Order: (1) R = 0 or deg R < deg B (remainder_degree_violation); (2) deg Q = deg A - deg B when deg A >= deg B, else Q = 0 (quotient_degree_violation, \"-infinity\" denotes the zero polynomial); (3) A = BQ + R compared from degree 0 upward (identity_mismatch, lowest disagreeing coefficient). first_discrepancy is {check, factor_index: null, degree, lhs, relation, rhs}.","dividend_degree, divisor_degree, quotient_degree and remainder_degree are always returned (null for a zero or omitted polynomial)."],"limits":{"max_degree":64,"max_number_chars":40},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["dividend","divisor","quotient"],"properties":{"dividend":{"type":"array","maxItems":65,"items":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$","maxLength":40}},"divisor":{"type":"array","maxItems":65,"items":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$","maxLength":40}},"quotient":{"type":"array","maxItems":65,"items":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$","maxLength":40}},"remainder":{"type":"array","maxItems":65,"items":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$","maxLength":40}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","first_discrepancy","dividend_degree","divisor_degree","quotient_degree","remainder_degree","reference_version"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":["remainder_degree_violation","quotient_degree_violation","identity_mismatch",null]},"first_discrepancy":{"type":["object","null"],"additionalProperties":false,"required":["check","factor_index","degree","lhs","relation","rhs"],"properties":{"check":{"type":"string","enum":["remainder_degree","quotient_degree","dividend_coefficient"]},"factor_index":{"type":["integer","null"],"minimum":0},"degree":{"type":["integer","null"],"minimum":0},"lhs":{"type":"string"},"relation":{"type":"string","enum":["=","<"]},"rhs":{"type":"string"}}},"dividend_degree":{"type":["integer","null"],"minimum":0},"divisor_degree":{"type":"integer","minimum":0},"quotient_degree":{"type":["integer","null"],"minimum":0},"remainder_degree":{"type":["integer","null"],"minimum":0},"reference_version":{"type":"string","const":"cohen-gtm138-1993-ch3"}}},"examples":[{"input":{"dividend":["-4","0","-2","1"],"divisor":["-3","1"],"quotient":["3","1","1"],"remainder":["5"]},"output":{"valid":true,"reason":null,"first_discrepancy":null,"dividend_degree":3,"divisor_degree":1,"quotient_degree":2,"remainder_degree":0,"reference_version":"cohen-gtm138-1993-ch3"}},{"input":{"dividend":["-4","0","-2","1"],"divisor":["-3","1"],"quotient":["3","1","1"],"remainder":["4"]},"output":{"valid":false,"reason":"identity_mismatch","first_discrepancy":{"check":"dividend_coefficient","factor_index":null,"degree":0,"lhs":"-4","relation":"=","rhs":"-5"},"dividend_degree":3,"divisor_degree":1,"quotient_degree":2,"remainder_degree":0,"reference_version":"cohen-gtm138-1993-ch3"}}],"execute_url":"/v1/tools/polynomial-division-check/versions/1.0.0/execute"}