Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Figure 1 — extraction: cq=(gq)mc^q = (g^q)^mcq=(gq)m and Ext\mathrm{Ext}Ext recovers m mod pm \bmod pmmodp on a binding key

Proved
GOSNIZK.BGNCommit.extraction

by mikedeng1 · Oct 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

commitment-schemescryptographyp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let (p,q,G,GT,e,g)(p, q, \mathbb G, \mathbb G_T, e, g)(p,q,G,GT​,e,g) be a BGN bilinear group with n=pqn = pqn=pq and let h=gpxh = g^{px}h=gpx, x∈Zq∗x \in \mathbb Z_q^*x∈Zq∗​, be a perfectly binding key. For every message m∈Znm \in \mathbb Z_nm∈Zn​ and randomizer r∈Znr \in \mathbb Z_nr∈Zn​, the commitment c=gmhrc = g^m h^rc=gmhr satisfies

cq=(gmhr)q=(gq)m,c^q = (g^m h^r)^q = (g^q)^m,cq=(gmhr)q=(gq)m,

and the extractor of Figure 1 (exhaustive search for the exponent of cqc^qcq in base gqg^qgq) returns Extxk(c)=m mod p\mathrm{Ext}_{xk}(c) = m \bmod pExtxk​(c)=mmodp.

This is the extraction step behind the perfect extractability of the scheme: knowing qqq suffices to read the message (up to its residue modulo ppp) out of a commitment.

Formalization Note The extractor returns the least k<pk < pk<p with cq=(gq)kc^q = (g^q)^kcq=(gq)k, read in Zp\mathbb Z_pZp​. The statement holds for every message, not only for m∈{0,1}m \in \{0,1\}m∈{0,1}; the perfect extractability conjunct of Theorem 2 is its restriction to {0,1}\{0,1\}{0,1}.

Preamble
import Mathlib
import Definitions.Def_GOSNIZK_BGNCommit_BGNSetup
import Definitions.Def_GOSNIZK_BGNCommit_Scheme
Formal statement
namespace GOSNIZK.BGNCommit

theorem extraction {G GT : Type*} [CommGroup G] [Fintype G] [CommGroup GT] [Fintype GT]
    (S : BGNSetup G GT) (h : G) (hkey : S.IsBindingKey h) (m r : ZMod S.n) :
    S.com h m r ^ S.q = (S.g ^ S.q) ^ m.val ∧ S.Ext (S.com h m r) = S.toZp m := by sorry

end GOSNIZK.BGNCommit
Source
Groth, Ostrovsky, Sahai, New Techniques for Noninteractive Zero-Knowledge, J. ACM 59(3) (2012), authors' version of March 7, 2011, p. 10, Figure 1 (Extraction); p. 9, proof of Theorem 2
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 7, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me