Skip to content

Floors and ceilings of n over a whole number are decided over its residues - #1566

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
floors-over-residues
Sep 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
floors-over-residues

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

forall n in ZZ : floor(n/2) + ceil(n/2) = n was left as written. It is True now, as is Hermite's identity for thirds, floor(n/3) + floor((n + 1)/3) + floor((n + 2)/3) = n.

Floors and ceilings over residues (Quantifiers.DriftlessPeriod, in the comparison case of Period):

  • A floor of (p/q) n + b rises by exactly p when n rises by q, and a linear term rises by its slope times q.
  • So a sum of floors and ceilings of linear functions of n, beside a linear part, repeats with the least common multiple of the qs wherever those rises cancel.
  • The residues over one period then decide the comparison, as they already decide a divisibility: floor(n/2) = n/2 is False for all whole n, ceil(n/2) - floor(n/2) <= 1 is True over ZZ+, and no whole n has floor(n/2) + ceil(n/2) = n + 1.

It declines unless each argument is linear in n with a rational slope and the rises sum to nothing. The residue periods already in place then answer, or nothing does.

Suite: 13,363 passed, 0 failed on net10.0, and every target framework builds. Gate: passed, with allocation as the baseline says on all 19 gated benchmarks.

BREAKING-CHANGES.md has the entry, after the one for congruences, with 2.5.0 measured.

Part of #1409.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…idues

A comparison between floors and ceilings of linear functions of n and a
linear part repeats with the least common multiple of the floors'
denominators where the drifts cancel: over a period, a floor of
(p/q) n + b rises by as much as the linear terms do. The residues then
decide it, as they decide a divisibility: floor(n/2) + ceil(n/2) = n and
Hermite's identity for thirds hold for every whole n.

Part of #1409.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit d059edd into master Sep 29, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the floors-over-residues branch October 29, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant