Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5 — in a cyclic group of order ≥ 4, b₂ = ¬(b₀ ∧ b₁) iff b₀ + b₁ + 2b₂ − 2 ∈ {0, 1}

Proved
GOSNIZK.CircuitSound.lemma_5

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

circuit-satcryptographyp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1zmod

Let M\mathcal MM be a finite cyclic group with neutral element 000 and generator 111, and let b0,b1,b2∈{0,1}b_0,b_1,b_2\in\{0,1\}b0​,b1​,b2​∈{0,1}, read as elements of M\mathcal MM.

  1. If the order of M\mathcal MM is at least 444, then
b2=¬(b0∧b1)  ⟺  b0+b1+2b2−2∈{0,1}.b_2=\neg(b_0\wedge b_1)\iff b_0+b_1+2b_2-2\in\{0,1\}.b2​=¬(b0​∧b1​)⟺b0​+b1​+2b2​−2∈{0,1}.
  1. If the order of M\mathcal MM is 333, then
b2=¬(b0∧b1)  ⟺  b0+b1+2b2−2∈{0,1}  and  b0+b1+b2−1∈{0,1}.b_2=\neg(b_0\wedge b_1)\iff b_0+b_1+2b_2-2\in\{0,1\}\ \text{ and }\ b_0+b_1+b_2-1\in\{0,1\}.b2​=¬(b0​∧b1​)⟺b0​+b1​+2b2​−2∈{0,1}  and  b0​+b1​+b2​−1∈{0,1}.

The lemma turns a NAND gate into a statement that a single message lies in {0,1}\{0,1\}{0,1}, which a homomorphic proof commitment can prove. For order 333 the first condition alone does not suffice: b0=b1=b2=0b_0=b_1=b_2=0b0​=b1​=b2​=0 gives −2=1-2=1−2=1.

Formalization Note M\mathcal MM is ZMod N (a finite cyclic group with generator 111 is isomorphic to it, 1↦11\mapsto11↦1); "order at least 4" is 4 ≤ N and "order 3" is N = 3. Bits are booleans mapped to 0,1∈Z/NZ0,1\in\mathbb Z/N\mathbb Z0,1∈Z/NZ.

Preamble
import Mathlib
import Definitions.Def_GOSNIZK_CircuitSound_Scheme
Formal statement
namespace GOSNIZK.CircuitSound

/-- Lemma 5 (Groth, Ostrovsky, Sahai, *New Techniques for Noninteractive Zero-Knowledge*, J. ACM
59(3) (2012), authors' version of March 7, 2011, p. 14). The finite cyclic group `M` with generator
`1` is `ZMod N`; bits are read as `0, 1 ∈ ZMod N` via `ofBit`. If the order is at least 4,
`b₂ = ¬(b₀ ∧ b₁)` iff `b₀ + b₁ + 2b₂ − 2 ∈ {0, 1}`; if the order is 3, iff in addition
`b₀ + b₁ + b₂ − 1 ∈ {0, 1}`. -/
theorem lemma_5 (N : ℕ) (b₀ b₁ b₂ : Bool) :
    (4 ≤ N →
      (b₂ = !(b₀ && b₁) ↔
        (ofBit b₀ + ofBit b₁ + 2 * ofBit b₂ - 2 : ZMod N) ∈ ({0, 1} : Set (ZMod N)))) ∧
    (N = 3 →
      (b₂ = !(b₀ && b₁) ↔
        (ofBit b₀ + ofBit b₁ + 2 * ofBit b₂ - 2 : ZMod N) ∈ ({0, 1} : Set (ZMod N)) ∧
        (ofBit b₀ + ofBit b₁ + ofBit b₂ - 1 : ZMod N) ∈ ({0, 1} : Set (ZMod N)))) := by sorry

end GOSNIZK.CircuitSound
Source
Groth, Ostrovsky, Sahai, New Techniques for Noninteractive Zero-Knowledge, J. ACM 59(3) (2012), authors' version of March 7, 2011, p. 14, Lemma 5
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