Repository navigation
A square system is not answered with rows that are no solution - #2125
Merged
Rafael-SOWNet merged 1 commit intoOct 26, 2026
Merged
Conversation
EquationSystem.Solve returned every row the eliminator found for a square system without putting it back into the system. Solving one equation can widen it, so a row could be no solution: sqrt(y) = x is solved for y as x^2, and sqrt(y) - x, x + 1 was answered [[-1, 1]], where sqrt(1) - (-1) is 2. Each row is now put back into the equations as the caller wrote them: - A row that leaves an equation with no symbol in it a number away from zero is no solution for any value of anything, and is dropped. The test is the one that drops a spurious root of one equation, taken out of IsSpurious as StatementSolver.IsEvidenceAgainst. A system left with no row is null. - A row with symbols in it is tried at one value of them: the system's own symbols at positive values that are not whole, and a parameter the row brings with it, t_1 or n_1, at 2, since an n_1 stands for whole numbers only. A row that fails there may hold for other values, as sqrt(t^2) = t does for positive t, so the system is declined as null instead of being answered by the other rows alone. - Anything else is kept, as a root of one equation is. Measured, each probed on 2.6.0 and on this branch: sqrt(y) - x; x + 1 [[-1, 1]] -> null sqrt(y) - x; y - 4 [[2, 4], [-2, 4]] -> [[2, 4]] ln(x) + ln(y); x - y [[-1, -1], [1, 1]] -> [[1, 1]] sqrt(y) - x; y - a [[sqrt(a), (sqrt(a)) ^ 2], [-sqrt(a), (-sqrt(a)) ^ 2]] -> null Unchanged: x*y - a; x - y, x^2 - a; y - x, sin(x) - y; y - 1/2 with its rows in n_1, and both cubic systems in SolveSystem, whose nine rows each hash the same. Cost, the 1024-row uncoupled quartics: 1.50 s -> 1.58-1.67 s. The symbolic cubic system: 111 -> 372 ms, its nine rows of nested radicals evaluated at the sample point. Fixes #2123 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
deleted the
a-system-row-is-kept-where-it-satisfies-the-system
branch
October 26, 2026 15:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EquationSystem.Solvereturned every row the eliminator found for a square system without putting it back into the system. Solving one equation can widen it:sqrt(y) = xis solved foryasx^2, sosqrt(y) - x,x + 1was answered[[-1, 1]], wheresqrt(1) - (-1)is 2.Each row is now put back into the equations as the caller wrote them:
IsSpuriousasStatementSolver.IsEvidenceAgainst. A system left with no row isnull.null. The system's own symbols are tried at positive values that are not whole, and a parameter the row brings with it,t_1orn_1, at 2, since ann_1stands for whole numbers only. The row is not dropped, because it may hold for other values, assqrt(t^2) = tdoes for positivet, and the other rows would then read as all of the solutions.sqrt(y) - x,x + 1[[-1, 1]]nullsqrt(y) - x,y - 4[[2, 4], [-2, 4]][[2, 4]]ln(x) + ln(y),x - y[[-1, -1], [1, 1]][[1, 1]]sqrt(y) - x,y - a[[sqrt(a), (sqrt(a)) ^ 2], [-sqrt(a), (-sqrt(a)) ^ 2]]nullUnchanged:
x*y - a,x - yandx^2 - a,y - x(rows ina),sin(x) - y,y - 1/2andtan(x) - y,y - 1(rows inn_1), and both cubic systems inSolveSystem, whose nine rows hash the same on both builds.Cost. The 1024-row uncoupled quartics, the largest system that answers: 1.50 s to 1.58-1.67 s. The symbolic cubic system: 111 to 372 ms, since its nine rows of nested radicals are evaluated at the sample point.
SpuriousSystemRowTestcovers the drops, the twonulls, and the rows kept, which it checks at several values ofaandn_1, negative ones among them. Entry inBREAKING-CHANGES.md.Fixes #2123
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura