Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 6, §C.3.1, p. 41 — two distinct partial-evaluation polynomials in the D_{i,b} collide with probability ≤ (length)/p

Proved
GGHRSW.ColoredMatrix.partial_eval_bound

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

cryptographyobfuscationp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1probabilityschwartz-zippel

Let ppp be prime, L≥0L\ge0L≥0 and r≥1r\ge1r≥1. For each step k=1,…,Lk=1,\dots,Lk=1,…,L and bit bbb fix an arbitrary 5×55\times55×5 matrix Bk,bB_{k,b}Bk,b​ over Zp\mathbb Z_pZp​, and let

Dk,b=(diag⁡(dk,b)00Bk,b)D_{k,b} = \begin{pmatrix} \operatorname{diag}(d_{k,b}) & 0\\ 0 & B_{k,b}\end{pmatrix}Dk,b​=(diag(dk,b​)0​0Bk,b​​)

where the diagonal entries dk,b∈Zprd_{k,b}\in\mathbb Z_p^rdk,b​∈Zpr​ are drawn independently and uniformly. Let f,g:{0,1}L→Zpf,g:\{0,1\}^L\to\mathbb Z_pf,g:{0,1}L→Zp​ be two different coefficient functions and consider the formal multilinear polynomials

P=∑bf(b) D1,b1⋯DL,bL,P′=∑bg(b) D1,b1⋯DL,bL.P = \sum_{\mathbf b} f(\mathbf b)\, D_{1,b_1}\cdots D_{L,b_L},\qquad P' = \sum_{\mathbf b} g(\mathbf b)\, D_{1,b_1}\cdots D_{L,b_L}.P=b∑​f(b)D1,b1​​⋯DL,bL​​,P′=b∑​g(b)D1,b1​​⋯DL,bL​​.

Then

Pr⁡d[P=P′ as matrices over Zp]≤Lp.\Pr_{d}\big[P = P' \text{ as matrices over } \mathbb Z_p\big] \le \frac{L}{p}.dPr​[P=P′ as matrices over Zp​]≤pL​.

In the proof of Theorem 6 this is the case of a "partial evaluation" query with colours LC=i>0LC=i>0LC=i>0 and RC=j<n+2RC=j<n+2RC=j<n+2: the new matrix and an earlier one have the form Ri−1DRj−1−1R_{i-1}DR_{j-1}^{-1}Ri−1​DRj−1−1​ with the same invertible RRR's, so they coincide iff c⋅D=ck⋅Dkc\cdot D=c_k\cdot D_kc⋅D=ck​⋅Dk​, and the segment has L=j−i≤nL=j-i\le nL=j−i≤n steps, giving the page's bound n/pn/pn/p.

Formalization Note. The page writes each polynomial as one scalar times one matrix c⋅Dc\cdot Dc⋅D and calls the earlier polynomial PkP_kPk​; its DDD is a linear combination of products of the Dk,bD_{k,b}Dk,b​, which is the sum with coefficients fff above. The conjugation by Ri−1R_{i-1}Ri−1​ and Rj−1−1R_{j-1}^{-1}Rj−1−1​ is dropped because it is invertible (the page's own "equal if and only if"); the page's Rj−1R_j^{-1}Rj−1​ is read as Rj−1−1R_{j-1}^{-1}Rj−1−1​, the right randomizer of a product ending at colour jjj. Fixed steps are the special case where fff, ggg vanish off the allowed bit. The bottom-right blocks Bk,bB_{k,b}Bk,b​ are arbitrary (in the scheme they are αk,bAk,b\alpha_{k,b}A_{k,b}αk,b​Ak,b​), and the bound is stated as L/pL/pL/p, which is at most n/pn/pn/p.

Preamble
import Mathlib
import Definitions.Def_GGHRSW_ColoredMatrix_Model

open Classical
Formal statement
namespace GGHRSW.ColoredMatrix

theorem partial_eval_bound (p : ℕ) [Fact p.Prime] (L r : ℕ) (hr : 0 < r)
    (B : Fin L → Bool → Matrix (Fin 5) (Fin 5) (ZMod p))
    (f g : (Fin L → Bool) → ZMod p) (hfg : f ≠ g) :
    ((Finset.univ.filter fun d : Fin L → Bool → Fin r → ZMod p =>
        ∑ b : Fin L → Bool, f b • (List.ofFn fun k => blockDiag (d k (b k)) (B k (b k))).prod =
          ∑ b : Fin L → Bool, g b • (List.ofFn fun k => blockDiag (d k (b k)) (B k (b k))).prod).card
        : ℝ) / Fintype.card (Fin L → Bool → Fin r → ZMod p) ≤ (L : ℝ) / p := by sorry

end GGHRSW.ColoredMatrix
Source
Garg, Gentry, Halevi, Raykova, Sahai and Waters, Candidate Indistinguishability Obfuscation and Functional Encryption for All Circuits, SIAM J. Comput. 45(3), 2016 (authors' version of July 21, 2013), p. 41, proof of Theorem 6, §C.3.1, case LC = i > 0 and RC = j < n + 2
Human review
  • Endorsed by Shuze Chen · Oct 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 10, 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