MuSig2 aggregation on secp256k1's group
ProvedBitcoinMuSig.musig2_partialSigAgg_secp256k1musig2_partialSigAgg on Mathlib's points of with generator Gpt and integer scalars.
import Definitions.Def_BitcoinMuSig open BitcoinMuSig BitcoinSig BitcoinTaproot
theorem BitcoinMuSig.musig2_partialSigAgg_secp256k1 {ι : Type*} (S : Finset ι) (X R₁ R₂ : ι → W.Point)
(a s : ι → ℤ) (b e g gacc tacc ε : ℤ) (Q : W.Point)
(hQ : Q = gacc • ∑ i ∈ S, a i • X i + tacc • Gpt)
(hpart : ∀ i ∈ S, s i • Gpt = ε • (R₁ i + b • R₂ i) + (e * a i * (g * gacc)) • X i) :
(∑ i ∈ S, s i + e * g * tacc) • Gpt = ε • (∑ i ∈ S, R₁ i + b • ∑ i ∈ S, R₂ i) + e • (g • Q) := by sorryRead-back
What the Lean code literally says, in plain math · claude-fable-5-1 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back: BitcoinMuSig.musig2_partialSigAgg_secp256k1
Source file: Thm_BitcoinMuSig_musig2_partialSigAgg_secp256k1.lean (one theorem; it builds on the MuSig definition file, which itself uses the secp256k1 signature and Taproot definition files).
Statement. Let be an arbitrary index type and any finite set (possibly empty). Let be arbitrary families of curve points (written ), arbitrary families of integers, arbitrary integers, and . All scalars are ordinary integers (no reduction mod ), acting on the group by integer multiples. Assume
- (the term is outside both the sum and the factor );
- for every : .
Then
where on the left the integer is added once to the integer sum .
Definitions used, unfolded
Constants
- is a fixed natural number (the field modulus).
- is a fixed natural number (written in hexadecimal).
- and are fixed natural numbers ( is even: its last hexadecimal digit is ).
The Mathlib curve and its point group
- denotes Mathlib's . For a natural number , is its residue . The definition file registers, as a global instance, the fact that is prime (proved there by a Lucas–Pratt certificate); this instance is what makes a field, which Mathlib needs to put a group structure on curve points.
- is the Weierstrass curve over with coefficients and , i.e. the curve
- is Mathlib's type of points of : a point is either the point at infinity, written , or an affine point with (carrying a proof that it is nonsingular). It is equipped with Mathlib's chord-and-tangent addition, which makes it an additive commutative group with neutral element and negation , .
- For and , ( summands, ). For , is the usual integer multiple ( for ).
- is the affine point .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.