Repository navigation
A negative whole power is inverted to its roots, not to none - #2154
Merged
Rafael-SOWNet merged 1 commit intoOct 27, 2026
Merged
Conversation
Inverting x^n = v for a whole n multiplies an n-th root of v by each
root of unity of order n, which GetAllRootsOf1 lists by counting up to
n. For a negative n it counted nothing, so the inversion found no roots,
and an equation that reached one inside another was answered with the
empty set, a claim that it has none: 1/(1 + x^(-2)) = 1/2 came back { }
where its roots are 1 and -1, and 1/(1 + x^(-2)) = y came back { } for
every y. x^(-2) = 4 on its own was answered correctly by another route.
x^n = v for a negative n has the roots of x^|n| = 1/v, and an n-th root
of v times a root of unity of order |n| is each of them, so the roots of
unity are now counted to |n|. A negative power is never zero, so
x^(-2) = 0 is still answered with none, now on purpose; x^0 is not
inverted at all.
Measured on 2.6.0 and on this branch, in BREAKING-CHANGES.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
This was referenced Oct 27, 2026
Rafael-SOWNet
deleted the
a-negative-power-equation-is-not-answered-empty
branch
October 27, 2026 10:40
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.
Fixes #2144.
A wrong answer: an equation that reaches a negative whole power inside another expression was answered with the empty set, which claims it has no roots.
1/(1 + x^(-2)) = 1/2{ }{ 1, -1 }2/(1 + x^(-2)) = 1{ }{ 1, -1 }1/(2 + p^(-3)) = 1/3{ }{ 1, -1/2 + i * 1/2 * sqrt(3), -1/2 + i * -1/2 * sqrt(3) }1/(1 + x^(-2)) = y{ }{ ((-1) / (-y) - 1) ^ (-1/2), -((-1) / (-y) - 1) ^ (-1/2) }Cause.
Powf's inversion ofx^n = vfor a wholenmultiplies ann-th root ofvby each root of unity of ordern.GetAllRootsOf1lists those roots by counting up ton, so forn = -2it listed none, and the inversion returned no roots. The replacement machinery solvest = x^(-2)ast = 1correctly, and then asks that inversion forx.Fix.
x^n = vfor a negativenhas the roots ofx^|n| = 1/v, so the roots of unity are counted to|n|.x^(-2) = 0is still answered{ }, now deliberately.x^0is not inverted at all.x^(-2) = 4on its own was already answered correctly by another route, and is unchanged.Checked:
NegativePowerInversionTest: every root is in the answer and a non-root is not; a symbolic right-hand side gives the two roots, which aty = 1/2are 1 and −1; and a negative power is never zero.Found while reading Modenov's Problems in Geometry for #2131.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura