Skip to content

A fractional power is inverted where its values lie - #2183

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
a-fractional-power-is-inverted-in-its-range
Oct 28, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
a-fractional-power-is-inverted-in-its-range

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

On #212, sqrt(y) = x was the open question: the system's family needed a condition, and so did the single equation. sqrt(x) = a was { a ^ 2 }, which is no root at a = -1, since sqrt((-1)^2) is 1. Of the three conditions offered there, Happypig375's answer opened the third, an arg node, which #2181 adds. This uses it.

The power's inversion states the power's range. The principal power z^p is e^(p ln z), so its argument is p arg(z):

  • for 0 < p < 1 its values lie in the sector -p pi < arg <= p pi, with 0;
  • for -1 < p < 0 they lie in p pi <= arg < -p pi, without 0;
  • for |p| > 1 the sector is the whole plane, and v^(1/p) is a preimage of every v.

So x^p = a is now a^(1/p) provided a is in the sector, as abs's inversion already carries r in RR and a >= 0. A symbolic exponent has no sector to state and is left as it was. A number on the other side is decided as before: sqrt(x) = -1 is { }, sqrt(x) = i is { -1 }.

A condition is not stated twice. Providedf conjoined a nested condition without looking, so the system's rows came back with the same condition five times over, one for each substitution. A conjunct that is already there is now dropped, and the conjunction is rebuilt only where something repeats, so every other condition keeps its shape.

Input Was (2.6.0) Now
sqrt(x) = a, solved for x { a ^ 2 } { a ^ 2 provided a = 0 or -1/2 * pi < arg(a) and arg(a) <= 1/2 * pi }
x^(1/3) = a { a ^ 3 } { a ^ 3 provided a = 0 or -1/3 * pi < arg(a) and arg(a) <= 1/3 * pi }
x^(-1/2) = a { a ^ (-2) } { a ^ (-2) provided not a = 0 and -1/2 * pi <= arg(a) and arg(a) < 1/2 * pi }
sqrt(y) - x, y - a, solved for x, y [[sqrt(a), (sqrt(a)) ^ 2], [-sqrt(a), (-sqrt(a)) ^ 2]] each row with provided C(row's x), C the sector above

The system was declined on master since #2123, because the -sqrt(a) row fails at a = 137/100. Each row now says where it holds: the first wherever a is, and the second only at a = 0. SpuriousSystemRowTest checks that at four values of a every row whose condition holds solves both equations, and that one of them does.

Still open on #212. The family of sqrt(y) - x alone, in x and y, is still declined. Its check puts t^2 back and needs sqrt(t^2) - t to be 0, which it is only under the condition, and Simplify does not use a condition to simplify. Integer-parameter families also remain open.

Measured (on the branch before its rebase onto #2181's merge, an identical tree)

  • Suite: 17,307 passed, 0 failed, 13 skipped.
  • Intbench chain against master 00d857b: identical on every family, 0 moves. Performance gate passed on all 19 gated benchmarks, every figure equal to master's.
  • Harnesses: BoundCheck 0 disagreements, RootCheck 596/596 clean, CasBench 120/121 with 0 wrong, SimpSweep 10463/10463, CrashCheck 0 crashed, PropCheck and RuleCheck clean, CanonCheck (2091) and Confluence (3) matching their baselines.

Part of #212.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

The principal power z^p is e^(p ln z), so its argument is p arg(z). For 0 < p < 1 its values
lie in the sector -p pi < arg <= p pi, with 0, and for -1 < p < 0 in p pi <= arg < -p pi,
without 0. x^p = a was solved to a^(1/p) with no condition, which is no root where a is
outside the sector: sqrt(x) = a was { a ^ 2 }, and at a = -1 that is 1, whose square root is
not -1. The root now carries the sector, written with arg, as abs's inversion carries its own.
For |p| > 1 the sector is the whole plane and nothing is stated; a symbolic exponent has no
sector to state. A number on the other side is decided as before.

Providedf conjoined a nested condition without looking, so a system's rows carried the same
condition once a substitution, five times over for sqrt(y) - x, y - a. A conjunct already
stated is dropped now, and the conjunction is rebuilt only where something repeats.

That system was declined since #2123, its -sqrt(a) row failing at a = 137/100; each row now
says where it holds, and the test checks the rows by value at four points.

Part of #212.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.46%. Comparing base (0e737d1) to head (8d39164).

Files with missing lines Patch % Lines
...s/AngouriMath/Functions/TreeAnalyzer/RealValued.cs 66.66% 2 Missing and 2 partials ⚠️
...nuous/Solvers/EquationSolver/InvertNode.Classes.cs 94.73% 0 Missing and 1 partial ⚠️
...ontinuous/Solvers/EquationSolver/SolveStatement.cs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2183   +/-   ##
=======================================
  Coverage   86.45%   86.46%           
=======================================
  Files         297      297           
  Lines       65406    65448   +42     
  Branches    19198    19215   +17     
=======================================
+ Hits        56547    56588   +41     
+ Misses       4804     4803    -1     
- Partials     4055     4057    +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.02% <87.50%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Solvers/EquationSolver/AnalyticalEquationSolver.cs 96.18% <100.00%> (ø)
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 88.05% <ø> (ø)
...luation/Evaluation.Omni/Evaluation.Omni.Classes.cs 88.94% <100.00%> (+0.36%) ⬆️
...nuous/Solvers/EquationSolver/InvertNode.Classes.cs 59.91% <94.73%> (+2.77%) ⬆️
...ontinuous/Solvers/EquationSolver/SolveStatement.cs 84.57% <0.00%> (ø)
...s/AngouriMath/Functions/TreeAnalyzer/RealValued.cs 81.52% <66.66%> (-2.23%) ⬇️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Happypig375

Copy link
Copy Markdown
Member

What if there was a provided x in RR or other sets attached to the input equation?

(sqrt(x) = a) provided a in RR was solved to a ^ 2 provided a in RR and the sector of the
complex plane, which for a real a is only the half-line a >= 0. A provided equation is now
solved under TreeAnalyzer.Assuming of its condition, as a provided expression is already
differentiated: its roots are filtered by the condition anyway, so what holds under it can be
stated by it. The power's inversion asks what is known. A value known to lie on the half-line
the power reaches, a >= 0 for p > 0 and a > 0 for p < 0, needs no condition. One known to lie
off it has no root, and one known real, by its codomain, by membership of RR or by being ordered
against something, has the half-line for its condition in place of the sector.

  (sqrt(x) = a) provided a in RR    a ^ 2 provided a in RR and a >= 0
  (sqrt(x) = a) provided a > 0      a ^ 2 provided a > 0
  (sqrt(x) = a) provided a < 0      { }

Part of #212.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet

Copy link
Copy Markdown
Member Author

It was conjoined but not used: (sqrt(x) = a) provided a in RR came back with the whole complex sector beside a in RR. Pushed 8d39164. A provided equation is now solved knowing its condition, as a provided expression is already differentiated. The inversion then asks what is known:

Equation Solution
(sqrt(x) = a) provided a in RR { a ^ 2 provided a in RR and a >= 0 }
(sqrt(x) = a) provided a > -5 { a ^ 2 provided a > -5 and a >= 0 }
(sqrt(x) = a) provided a > 0 { a ^ 2 provided a > 0 }
(sqrt(x) = a) provided a < 0 { }
(x^(-1/2) = a) provided a in RR { a ^ (-2) provided a in RR and a > 0 }
sqrt(x) = domain(a, RR) { domain(a, RR) ^ 2 provided domain(a, RR) >= 0 }

A real value has argument 0 or pi, so for it the sector is the half-line. What counts as real: membership of RR, being ordered against something, or a declared codomain. A condition on x itself, as in (sqrt(x) = a) provided x in RR, is still checked on the root as before: a ^ 2 in RR. Its chain is running again.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

@Rafael-SOWNet
Rafael-SOWNet merged commit 4fe3219 into master Oct 28, 2026
37 of 38 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 28, 2026
@Happypig375

Copy link
Copy Markdown
Member

Some solutions like { a ^ 2 provided a > -5 and a >= 0 } obviously needs improvement - the conditions can be merged

@Rafael-SOWNet

Copy link
Copy Markdown
Member Author

Yes: a >= 0 entails a > -5, so the condition is a >= 0. The PR had just merged when this came in, so it'll be a follow-up: a conjunct that another conjunct of the same condition entails won't be stated. PredicateEntailment already decides that for comparisons against numbers.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

@Rafael-SOWNet

Copy link
Copy Markdown
Member Author

Merged in #2186: (sqrt(x) = a) provided a > -5 is now { a ^ 2 provided a >= 0 }. A conjunct that another conjunct of the same condition forces isn't stated, so x provided a > 1 and a > 2 is x provided a > 2.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

@Rafael-SOWNet
Rafael-SOWNet deleted the a-fractional-power-is-inverted-in-its-range branch October 28, 2026 19:21
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.

2 participants