Conversation
Over the rationals, msolve only lifted the elements of the modular Groebner basis which do not involve the eliminated variables, hence it returned the basis of the elimination ideal only. Some algorithms, e.g. Suzuki-Sato's algorithm for comprehensive Groebner systems, need the full Groebner basis w.r.t. the elimination order. The new --elim-full-basis command line option, combined with -e, makes the multi-modular lifting keep all elements of the basis (and all variables in their leading monomials) in the learning and application phases, and outputs the full basis together with the elimination monomial order in the header. The default behaviour is unchanged. While at it, the application phase now checks that the basis is not NULL before dereferencing it, and rejects primes for which the basis has fewer elements than expected before reading their lengths. Closes algebraic-solving#339. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wegank
marked this pull request as draft
October 1, 2026 20:23
The test script and its input and expected output files have to be listed in AC_CONFIG_LINKS so that they are shipped in the distribution tarball and linked into the build tree, otherwise make distcheck fails. Co-Authored-By: Claude Opus 5.5 <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.
Closes #339.
Over the rationals,
-e kused to return only the basis of the elimination ideal: the multi-modular lifting kept only the elements of the modular Gröbner basis free of the eliminated variables. Algorithms such as Suzuki–Sato's for comprehensive Gröbner systems need the full basis with respect to the elimination order.This PR adds a
--elim-full-basiscommand line option. Combined with-e k, it returns the full reduced Gröbner basis for the elimination order over QQ. Without the flag, behaviour is unchanged.returns the same 7 polynomials as the characteristic-p run in the tutorial, ending with
t*z-1.Changes
src/msolve/lifting-gb.c,src/msolve/duplicate.c): two helpers,lift_elim_ideal_onlyandlifted_nvars, decide which elements are lifted and how many variables the stored leading monomials have. They are used in the learning phase, the application phase (filtering and bad-prime staircase check), the lifting setup and the buffer duplication. A newelim_full_basisfield inmd_tenables the full-basis mode.src/msolve/main.c,src/msolve/msolve-data.h): new long-only option with help text. With the flag, no variables are dropped from the output (gens->elim = 0), and the header prints the elimination monomial order like the characteristic-p output.bs == NULLis now checked beforebsis dereferenced. A prime whose basis has fewer elements than expected is rejected before its element lengths are read.README.md.test/diff/diff_elim-full-qq.shruns a parametric system with rational coefficients with-e 1/2,-t 1/2and-l 2/44.The Julia/library entry point
export_groebner_qqis untouched so its ABI stays stable. Exposing the option there can be done in a follow-up.Testing
make check: 69/69 pass.dp(k),dp(n-k)) on 14 random and parametric systems, with coefficients up to 544 bits, for all four-t/-lcombinations. All results agree, up to normalisation, since msolve prints with denominators cleared. The default mode still returns exactly the elimination-ideal part.AI disclosure
This change was written with the assistance of generative AI (Claude Code, Claude Opus 5.5), reviewed and tested by me.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
🤖 Generated with Claude Code