AFTD Auto-Formalizing Theoretical Domains

Schnorr.extract

defimported Lean

Given two challenges $c_1, c_2$ and corresponding responses $s_1, s_2$ in $\mathbb{Z}_q$, the extractor returns \[ \frac{s_1 - s_2}{c_1 - c_2} \;\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.extract (c₁ c₂ s₁ s₂ : ZMod q) : ZMod q
Defined in
TCSlib, `Schnorr.extract`
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 1
  • Schnorr.schnorr_soundnessSpecial soundness of the Schnorr protocol. Special soundness. Let $q$ be prime, let $g$ be an element of order $q$ in a commutative group…

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
/-- Two-transcript witness extractor: `(s₁ - s₂) / (c₁ - c₂)` in `ZMod q`. -/
def Schnorr.extract (c₁ c₂ s₁ s₂ : ZMod q) : ZMod q :=
  ((s₁ - s₂) / (c₁ - c₂) : ZMod q)
See it in the graphDiscuss this resultChallenge it