Skip to content

A limit at the jump of a step function is not answered by substitution - #2268

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-limit-by-substitution-declines-at-a-jump
Oct 30, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-limit-by-substitution-declines-at-a-jump

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

floor, ceil and sgn each decline a limit whose argument arrives on one of their jumps. But where a node declined, the dispatcher answered the whole expression by substitution, which evaluates straight through the jump. floor(x) - 1 from the left of 0 becomes floor(-1/t) - 1 at t = +oo, and -1/oo evaluates to 0. SolveBySubstitution now declines when a floor, ceil, round or sgn has an argument that lands on one of its jumps at the destination.

2.6.0 and master this branch the limit
limitleft(floor(x) - 1, x, 0) -1 left unevaluated -2
limit(floor(x) + x, x, 1) 2 left unevaluated none
limitleft(-sgn(x), x, 0) 0 left unevaluated 1

LimitAtAJumpTest: nine cases fail on master. Six pass on both, four of them away from a jump, where the values are unchanged. A limit on a branch cut answered by substitution, limitright(ln(x^x), x, -1), is still open on #2266. Suite 18236 passed. The F# wrapper suite, the Mcp, Terminal and InteractiveWrapper suites and the AOT smoke test pass. BoundCheck, RootCheck, CasBench, PropCheck, SimpSweep, RuleCheck, CanonCheck and Confluence are unchanged. Found by a new workspace harness, work/limitcheck.

Part of #2266.

🤖 Generated with Claude Code

floor, ceil and sgn each decline a limit whose argument arrives on one
of their jumps, since the value differs on the two sides. But where the
node declined, the dispatcher answered the whole expression by
substitution, which evaluates through the jump. floor(x) - 1 from the
left of 0 is floor(-1/t) - 1 at t = +oo there, and -1/oo evaluates to
0, so the limit came back -1 where it is -2, and the two-sided limit,
which does not exist, came back -1 too. SolveBySubstitution now
declines when a floor, ceil or round, or a sgn, has an argument that
lands on one of its jumps at the destination: an integer, a
half-integer, and 0.

LimitAtAJumpTest takes seven one-sided limits at a jump, which must be
the limit or nothing, four two-sided ones, which must have no value,
and four away from a jump, which keep their values. Nine fail on
master. A limit on a branch cut answered by substitution,
limitright(ln(x^x), x, -1), is left for #2266.

Found by work/limitcheck.

Part of #2266.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 30, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (2eec9d4) to head (e8199a7).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...nctions/Continuous/Limits/Solvers/Limit.Solvers.cs 69.23% 0 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2268   +/-   ##
=======================================
  Coverage   86.71%   86.71%           
=======================================
  Files         310      310           
  Lines       67830    67846   +16     
  Branches    19685    19692    +7     
=======================================
+ Hits        58820    58836   +16     
+ Misses       4893     4892    -1     
- Partials     4117     4118    +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.26% <69.23%> (+<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 Δ
...nctions/Continuous/Limits/Solvers/Limit.Solvers.cs 84.17% <69.23%> (-1.55%) ⬇️

... and 5 files with indirect coverage changes

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

@Rafael-SOWNet
Rafael-SOWNet merged commit 19305ba into master Oct 30, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 30, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-limit-by-substitution-declines-at-a-jump branch October 30, 2026 23:22
Rafael-SOWNet added a commit that referenced this pull request Oct 31, 2026
…-the-limits

Both this branch and #2268 add a header rule after ModulusPhaseTest's;
each keeps its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet added a commit that referenced this pull request Oct 31, 2026
…2283)

A limit of floor, ceil or sgn whose argument arrives on a jump was
left unevaluated: limitleft(floor(x), x, 0) and limitright(sgn(x), x, 0)
among them. The remark gave the reason that which side the argument
arrives from is not the side x comes from, floor(2 - x^2) coming to 2
from below as x comes to 0 from the right. That side is the sign the
argument less the jump keeps there, which SignNear reads off the limit
or off the first derivative that does not vanish. floor gives the jump
from above and one less from below, ceil one more from above and the
jump from below, and sgn the side itself. A two-sided limit asks each
side, and where they differ, as at a jump, it is NaN.

StepFunctionAtAJumpTest takes sixteen limits; fifteen fail on master.
FloorCeilTest and SignumLimitTest pinned the declines, and now pin the
values: NaN for the two-sided limits, which do not exist, and the sign
of the side for the one-sided ones, each still bounded in time, which
is what they are for. The suite, the trio, F#, AOT and the eight
harnesses pass.

With #2268, which declines the substitution through a jump, the
composed expressions are answered too: limitleft(floor(x) - 1, x, 0)
is -2 and limit(floor(x) + x, x, 1) is NaN.

Part of #2266.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet added a commit that referenced this pull request Oct 31, 2026
limitright(ln(x^x), x, -1) was ln(-1), which is i pi, where it is
-i pi: x^x comes to -1 from below as x comes down to -1, and the
principal logarithm is continuous on its cut from above only. The
value on the cut is the limit along the real line and from above, so
it was given as the limit from either side.

ArrivesOnTheCutOffTheRealLine asks whether a logarithm's argument, or
the base of a power to an exponent that is not whole, tends to a
negative real and is not known to be real on the approach; a power's
base and a logarithm's argument count as positive where their values
at the destination are. Which side such an argument comes from is not
decided, so a limit there is declined: by substitution, by the
logarithm's and the power's descent, by SolveAsLogarithm, by the
quotient of logarithms, and by Gruntz, whose series took the principal
logarithm of a negative coefficient. A limit from above, whose answer
was right, is declined too.

LimitOnABranchCutTest takes eight limits from below the cut, three
two-sided ones that do not exist, and nine along the real line, which
are answered as before; eleven fail on master. The suite, the trio,
F#, AOT and the eight harnesses pass. Composed with #2268, #2275 and
#2276, work/limitcheck finds none of the 56 limits it found answered
with another value on master, of 600 expressions.

Part of #2266.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant