Skip to content

Fix multiplicative_generator predicate: orderOf mult_gen = P - 1 - #10

Open
LucidSamuel wants to merge 1 commit into
NethermindEth:mainfrom
LucidSamuel:fix/multiplicative-generator-predicate
Open

Fix multiplicative_generator predicate: orderOf mult_gen = P - 1#10
LucidSamuel wants to merge 1 commit into
NethermindEth:mainfrom
LucidSamuel:fix/multiplicative-generator-predicate

Conversation

@LucidSamuel

Copy link
Copy Markdown

fixes #9

this PR emits orderOf mult_gen = P - 1. orderOf resolves 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 via orderOf_eq_iff + decide, while (2 : ZMod 5) ^ 5 = 1 is provably false.

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).
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.

Emitted multiplicative_generator predicate is unsatisfiable for actual generators (g ^ P = 1 forces g = 1)

1 participant