AFTD Auto-Formalizing Theoretical Domains

Schnorr.respond

defimported Lean

Given witness $w$, randomness $r$, and challenge $c$ in $\mathbb{Z}_q$, the response is $s := r + c \cdot w \in \mathbb{Z}_q$.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {G : Type*} [CommGroup G] in
variable {q : ℕ} [Fact q.Prime] in
variable (g : G) in
def Schnorr.respond (w r c : ZMod q) : ZMod q
Defined in
TCSlib, `Schnorr.respond`
Lean proof
By Hydroxyi (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
none listed
Used by 3
  • Schnorr.schnorr_completenessCompleteness of the Schnorr identification protocol. Let $q$ be a prime, let $G$ be a commutative group, and let $g \in G$ be an element…
  • Schnorr.schnorr_hvzkHonest-verifier zero knowledge of the Schnorr protocol. Let $G$ be a commutative group, let $q$ be prime, and let $g \in G$ be an element…
  • Schnorr.honestThe honest prover's full transcript for witness $w$, randomness $r$, and challenge $c$ is the triple…

Lean source view module on GitHub

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {G : Type*} [CommGroup G] in
variable {q : ℕ} [Fact q.Prime] in
variable (g : G) in
/-- Prover's second message: response `s := r + c·w` for witness `w`, randomness `r`, challenge `c`. -/
def Schnorr.respond (w r c : ZMod q) : ZMod q := r + c * w
See it in the graphDiscuss this resultChallenge it