feat: division proof#89
Draft
bollu wants to merge 10 commits into
Draft
Conversation
Mirrors MulUnnormalized.toInt_ex_le; bounds the exponent difference in (-2^e + 1, 2^e - 1) before the post-normalization shift. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Discharge `a.isNaN` case by NaN propagation through ExtRat.div = mul·inv. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Each case uses the same NaN-propagation pattern via ExtRat.div_eq_mul_inv: NaN.inv = NaN, then mul · NaN = NaN, then both branches of the xorSign if/then/else collapse to NaN. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
inv inf = 0, then inf * 0 = NaN closes the inf/inf case via the standard NaN-propagation pipeline. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The 'rounding-stable-under-perturbation' lemma: if two rationals agree on isNaN, isZero, lower, upper, lowerHalf, and tieBreak classifiers, roundRNE returns the same packed float. This is the abstract property the sticky-bit machinery relies on to bridge the gap between the implementation's truncated-quotient toRat and the true rational quotient. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Document remaining sign-convention reconciliation needed for the non-NaN cases (0/num, etc.). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The sign reconciliation for inf/0 is non-trivial because SmtLib's inv(Number 0) returns Infinity false (discarding zero's sign), then the xorSign+neg machinery in SmtLibFunctions.div tries to restore it. Verifying this needs case analysis we defer. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Fix the original `lsb_eq_sticky` statement (which was wrong for the unshifted msb=true case): the lsb of the adjusted significand is `(msb && quot.lsb) || (rem != 0)`. Proved by case-split on quot.msb. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
This PR proves the correctness of the division operation.