Fix multiplicative_generator predicate: orderOf mult_gen = P - 1 - #10
Open
LucidSamuel wants to merge 1 commit into
Open
Fix multiplicative_generator predicate: orderOf mult_gen = P - 1#10LucidSamuel wants to merge 1 commit into
LucidSamuel wants to merge 1 commit into
Conversation
The emitted predicate was mult_gen ^ P = 1, which is unsatisfiable for actual generators: by Fermat's little theorem g ^ P = g in ZMod P for prime P, so the predicate held only for mult_gen = 1. Since mult_gen models halo2's Field::MULTIPLICATIVE_GENERATOR (a generator of the multiplicative group, order P - 1), any circuit with a real generator made Circuit.isValid unsatisfiable, and root_of_unity / delta lost their intended meaning whenever isValid was used. Emit orderOf mult_gen = P - 1 instead. orderOf resolves with the imports the extraction already emits (verified against Mathlib via Lean: the def compiles, and orderOf (2 : ZMod 5) = 4 = 5 - 1 is kernel-checkable, so the new predicate is satisfiable by a real generator where the old one was not).
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.
fixes #9
this PR emits
orderOf mult_gen = P - 1.orderOfresolves with the imports the extraction already emits (verified against Mathlib: the definition compiles as-is),orderOf(2 : ZMod 5) = 4 = 5 - 1 is kernel-checkable viaorderOf_eq_iff + decide, while (2 : ZMod 5) ^ 5 = 1 is provably false.