Repository navigation
A series whose terms do not vanish is +oo, not left as written - #1224
Merged
Merged
Conversation
sum(2^k, k, 0, +oo) and sum(k, k, 1, +oo) were left as written. They have no finite value, and saying nothing was the only thing missing: the nth-term test settles them. Terms that do not tend to zero mean the series diverges, and the sign of the limit says which infinity -- where the terms tend to a positive L they are eventually all above L / 2, so the partial sums pass every bound. A negative limit gives -oo the same way, and the finitely many terms before that point are finite and cannot change it. A limit of zero is declined, and that is the point of the test rather than a gap in it: sum(1/k) diverges and sum(1/k^2) converges and the terms of both tend to 0. A limit that does not exist is declined too, since telling "does not exist" apart from "was not computed" is not something to infer from a failed computation. And a summand that can fail to exist at some index is declined, because one undefined term makes the sum undefined rather than infinite -- sum(k / (k - 5), k, 0, +oo) has terms tending to 1 and no term at k = 5. Rather than hunt for poles the index is allowed only where none can arise, which also keeps this cheap: the structural check runs first, so a summand it cannot speak about never reaches the limit engine. A condition that holds over the whole range is dropped, which is what lets the step split hand over n ^ n provided not n = 0 or n > 0. Last in the chain, so a series that converges is summed rather than tested. Asked for on the review of #1218, where integral(floor(x)^floor(x), x, 1, +oo) splits into sum(n^n, n, 1, +oo) and was left as written for want of it -- that test carried a comment saying it would move to the value the day this existed, and it has. Three other pinned examples move with it, each having used an infinite range as its illustration of a sum that stays. BREAKING-CHANGES.md has the rows, measured on both builds. Part of #1212. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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.
Closes the question you raised on #1218 — "can you really assume that
integral(floor(x)^floor(x), x, 1, +oo)cannot be solved, or is it just missing a solver?" It was missing a solver. It is+oo.What it answers
sum(2^k, k, 0, +oo)andsum(k, k, 1, +oo)were left as written. They have no finite value, and saying nothing was the only thing missing — the nth-term test settles them. Terms that do not tend to zero mean the series diverges; the sign of the limit says which infinity, because where the terms tend to a positiveLthey are eventually all aboveL / 2, so the partial sums pass every bound. A negative limit gives-oothe same way, and the finitely many terms before that point are finite and cannot change it.What it refuses, which is most of the design
sum(1/k)diverges andsum(1/k^2)converges and the terms of both tend to 0. Answering either from here would be a guess.sum((-1)^k, k, 0, +oo)has no value rather than an infinite one. I am deliberately not inferring "the limit does not exist" from "the limit did not compute" — those arrive identically and only one of them licenses an answer.sum(k / (k - 5), k, 0, +oo)has terms tending to 1, so a reader that consulted only the limit would answer+ooand be wrong aboutk = 5. Rather than hunt for poles, the index is allowed to occur only where none can arise — under+,-,*, and three power shapes (k^3,2^k,n^n). Division by anything containing the index, a factorial of it, a logarithm of it are refused outright.That structural check runs before the limit, which is also what keeps it cheap: a summand this cannot speak about never reaches the limit engine, and it is only consulted at all after every closed form has declined.
One wrinkle worth recording: the step split hands over
n ^ n provided not n = 0 or n > 0, because0 ^ 0is the one power that must say what it assumes. A condition true for every index in range is dropped; one that is not leaves theProvidedfin place, where the pole check declines it.ExponentialSerieshas a sibling of this specialised to factorial clauses — the vocabularies do not overlap, and a third caller would be the moment to merge them rather than now.Measured
Both columns on builds,
102911beagainst this branch:sum(2^k, k, 0, +oo),sum(k, k, 1, +oo),sum(k^2 + 1, k, 0, +oo),sum(n^n, n, 1, +oo)+oosum(-k, k, 1, +oo),sum(-2^k, k, 0, +oo)-oointegral(floor(x)^floor(x), x, 1, +oo)+oosum(1/k, k, 1, +oo),sum(1/k^2, …),sum((-1)^k, …),sum(k / (k - 5), …)sum(2^(-k), k, 0, +oo),sum(x^k / k!, k, 0, +oo),sum(2^k, k, 0, 5)2,e^x,63Pins that moved, and why
Four pinned examples used an infinite range as their illustration of a summation that stays unevaluated, and three are no longer that:
BreakpointIntegrationTestassertedintegral(floor(x)^floor(x), x, 1, +oo)stayed anIntegralf, with a comment I wrote on A geometric series is summed in closed form #1218 saying it would move to the value the day a divergence test existed. It has.GeometricSeriesTestlistedsum(2^k, k, 0, +oo)under "not a geometric series". That reader still declines it — a ratio at or beyond 1 has no sum — but the chain now answers it, so the example moved rather than the claim.ClosedFormSummationTestandSyntaxDocumentedTesteach usedsum(k, k, 1, +oo)to illustrate a bound the polynomial closed form declines. Their other examples still make that point; the infinite one no longer does.Docs/Usage/Syntax.mdgains a paragraph, since what a sum to+oodoes is now a documented behaviour rather than an absence.Checks
DivergentSeriesTest, 27 cases: seven diverging to+oo, three to-oo, three vanishing limits, two non-existent limits, three poles, the two condition cases, what still converges, finite ranges, a symbolic lower bound, and the sheet's integral. Full suite in two chunks: 8471 and 1485 pass.One unrelated failure appeared once in the first chunk and not on re-run of the same binary:
FractionFreeDeterminantTest, which is the concurrency defect filed as #1219. I have added the sighting there — the notable part is that the test is seeded, so the 300 matrices are identical between runs, and a different matrix failed this time than the first, which rules out anything data-dependent and points at a race.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura