{"id":"linear-solution-check","version":"1.0.0","description":"Check that a proposed solution x satisfies A x = b exactly over the rationals and report the first row that fails.","supported_operations":["check a proposed solution of a linear system exactly","does x satisfy A x = b with fractions","substitute a solution into simultaneous equations","verify my answer to a system of linear equations","which equation does my solution violate","exact rational check of a solver output","בדיקת פתרון למערכת משוואות לינאריות"],"unsupported_operations":["solving the system or deciding whether the solution is unique (see matrix-rank)","tolerance-based or floating-point acceptance of approximate solutions (see linear-residual-check)","symbolic or complex entries","inequality constraints or variable bounds"],"semantics":["Exact rationals are strings: an integer, a fraction p/q with q >= 1 or a finite decimal; JSON numbers, exponents, NaN and Infinity are rejected; outputs are canonical (reduced p/q, or an integer).","matrix is m x n (1-64 each) with equal row lengths; rhs has m entries and solution n entries. Dimensions are checked before any dot product (a mismatch is invalid_input).","Row i holds when sum_j a_ij x_j = b_i exactly; sums use pairwise addition of unreduced fractions and cross-multiplication, reducing only reported values.","Rows are checked in order; the first failure gives reason row_not_satisfied and first_discrepancy {check: row, index, computed (Ax)_i, required_relation =, required_value b_i, difference (Ax)_i - b_i}; rows_satisfied counts rows that held before it.","Only the supplied solution is checked: uniqueness is not claimed or tested. Every output carries reference_version."],"limits":{"max_rows":64,"max_columns":64,"max_number_chars":64},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["matrix","rhs","solution"],"properties":{"matrix":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$"}}},"rhs":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$"}},"solution":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\\.[0-9]+)?$"}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","first_discrepancy","rows_satisfied","reference_version"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":["row_not_satisfied",null]},"first_discrepancy":{"type":["object","null"],"additionalProperties":false,"required":["check","index","computed","required_relation","required_value","difference"],"properties":{"check":{"type":"string","enum":["row"]},"index":{"type":["integer","null"],"minimum":0},"computed":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*)?$"},"required_relation":{"type":"string","enum":["="]},"required_value":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*)?$"},"difference":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(/[1-9][0-9]*)?$"}}},"rows_satisfied":{"type":"integer","minimum":0},"reference_version":{"type":"string","const":"r49-linear-solution-1.0.0 (NIST DLMF section 1.2(v), equation 1.2.34 row-times-column rule; exact rational arithmetic)"}}},"examples":[{"input":{"matrix":[["2","1","-1"],["-3","-1","2"],["-2","1","2"]],"rhs":["8","-11","-3"],"solution":["2","3","-1"]},"output":{"valid":true,"reason":null,"first_discrepancy":null,"rows_satisfied":3,"reference_version":"r49-linear-solution-1.0.0 (NIST DLMF section 1.2(v), equation 1.2.34 row-times-column rule; exact rational arithmetic)"}},{"input":{"matrix":[["1","1/2","1/3"],["1/2","1/3","1/4"],["1/3","1/4","1/5"]],"rhs":["11/6","13/12","47/60"],"solution":["1","1","1.001"]},"output":{"valid":false,"reason":"row_not_satisfied","first_discrepancy":{"check":"row","index":0,"computed":"5501/3000","required_relation":"=","required_value":"11/6","difference":"1/3000"},"rows_satisfied":0,"reference_version":"r49-linear-solution-1.0.0 (NIST DLMF section 1.2(v), equation 1.2.34 row-times-column rule; exact rational arithmetic)"}}],"execute_url":"/v1/tools/linear-solution-check/versions/1.0.0/execute"}