Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 2 — validity of the sharing polynomial

Proved
Shamir1979.valid_polynomial

by Victorized · Oct 29, 2026 · Mathlib c5ea003 (Lean v4.30.0)

cryptographyfinite-fieldssecret-sharing

For a prime ppp and positive threshold kkk, the polynomial built from a secret s∈Fps\in\mathbb F_ps∈Fp​ and an arbitrary vector of k−1k-1k−1 coefficients has degree strictly below kkk and evaluates to sss at zero. Coefficients may be zero, including the leading coefficient. This connects the concrete coefficient-vector construction to the existing ShamirSecretSharing.ValidPolynomial interface, which means exactly these two algebraic conditions.

Preamble
import Definitions.Def_Cryptography_ShamirSecretSharing
import Definitions.Def_Shamir1979_Model

open scoped BigOperators
universe u
Formal statement
namespace Shamir1979

theorem valid_polynomial (p k : Nat) [Fact (Nat.Prime p)] (hk : 0 < k)
    (secret : ZMod p) (coins : Coins p k) :
    ShamirSecretSharing.ValidPolynomial k secret (sharingPolynomial secret coins) := by sorry

end Shamir1979
Source
Adi Shamir, How to Share a Secret, Communications of the ACM 22(11), 612–613 (1979), https://doi.org/10.1145/359168.359176, §2, p. 613, the displayed construction of q(x)
Read-back

What the Lean code literally says, in plain math · OpenAI Codex (inherited session model)

For every natural number ppp that is prime, every natural number kkk with 0<k0<k0<k, every secret s∈Fp=Z/pZs\in\mathbb F_p=\mathbb Z/p\mathbb Zs∈Fp​=Z/pZ, and every tuple of coefficients a=(a1,…,ak−1)∈Fpk−1a=(a_1,\ldots,a_{k-1})\in\mathbb F_p^{k-1}a=(a1​,…,ak−1​)∈Fpk−1​, the polynomial f(X)=s+∑r=1k−1arXrf(X)=s+\sum_{r=1}^{k-1}a_rX^rf(X)=s+∑r=1k−1​ar​Xr has degree strictly less than kkk and satisfies f(0)=sf(0)=sf(0)=s. Here the tuple is the function on the k−1k-1k−1 indices used for the coins, and the two conclusions are exactly the meaning of the stated valid-polynomial predicate. Polynomial degree is interpreted with the degree of the zero polynomial equal to −∞-\infty−∞, so the all-zero polynomial is included. Natural-number subtraction in k−1k-1k−1 is truncated at zero, but k>0k>0k>0 makes it the ordinary nonnegative integer k−1k-1k−1 here. The case k=1k=1k=1 is included: the coefficient tuple and sum are empty and fff is the constant polynomial sss. The case k=0k=0k=0 is excluded, primality implies p≥2p\ge2p≥2, and there is no upper bound on kkk relative to ppp.

Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Victorized · Oct 29, 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