Skip to content

A square system is not answered with rows that are no solution - #2125

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-system-row-is-kept-where-it-satisfies-the-system
Oct 26, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-system-row-is-kept-where-it-satisfies-the-system

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

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: sqrt(y) = x is solved for y as x^2, so 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 dropped. It is no solution for any value of anything. The test is the one that already 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, and where it fails there the system is declined as null. The system's own symbols are tried 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. The row is not dropped, because it may hold for other values, as sqrt(t^2) = t does for positive t, and the other rows would then read as all of the solutions.
  • Anything else is kept, as a root of one equation is.
2.6.0 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 and x^2 - a, y - x (rows in a), sin(x) - y, y - 1/2 and tan(x) - y, y - 1 (rows in n_1), and both cubic systems in SolveSystem, 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.

SpuriousSystemRowTest covers the drops, the two nulls, and the rows kept, which it checks at several values of a and n_1, negative ones among them. Entry in BREAKING-CHANGES.md.

Fixes #2123

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

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 Rafael-SOWNet added this to the 2.7.0 milestone Oct 26, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit c2a75a9 into master Oct 26, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 26, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-system-row-is-kept-where-it-satisfies-the-system branch October 26, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

A system of equations is answered with rows that do not satisfy it

1 participant