Repository navigation
feat(multilinear): evaluation at the Boolean vertices and uniqueness of multilinear interpolants - #404
Conversation
…of multilinear interpolants Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR Summary
Mathematical Formalization
Module Imports
Discrepancy with PR BodyThe PR body describes only the file Validation
Statistics
Lean Declarations ✏️ Added: 13 declaration(s)
📋 **Additional Analysis**The diff introduces two new files and registers them in FindingsScope and title
Module and file layout
Naming and statement phrasing
Docstrings and references
Naming and style details
Used/defined helper names and exposed theorem names
Documentation completeness
Code formatting
New types / codec
Performance contribution
Blueprint / large contribution
Repository guardrails (AGENTS.md, TCB)
Checklist of hard requirements
Suggested minimum fixes
📄 **Per-File Summaries**
Last updated: 2026-10-27 12:42 UTC. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dhsorens
left a comment
There was a problem hiding this comment.
Thanks, this is a nice, tight addition, and the Nullstellensatz proof of Lemma 3.6 is very clean.
Comments are inline. The main one is connecting the two halves (on ext_of_eval_vertex), so that uniqueness applies to CompPoly's own multilinear type.
Note that CI hasn't run on this yet: workflows on a first PR need a maintainer to approve them.
| simp only [Vector.get_eq_getElem, lagrangeBasis_vertex, ite_true, mul_one, Fin.getElem_fin] | ||
|
|
||
| /-- Hypercube tables with the same values at every vertex are equal. -/ | ||
| theorem ext_of_eval_vertex [Nontrivial R] {p q : CMlPolynomialEval R n} |
There was a problem hiding this comment.
This is where I'd like the two halves connected. Multilinear/Equiv.lean already has toMvPolynomial / equivMvPolynomialDeg1. A lemma stating that a CMlPolynomial and its MvPolynomial image agree at every vertex i would let eq_of_degreeOf_le_one_of_eval_zeroOne apply to CompPoly's own type, which is the uniqueness the PR title promises.
| Nat.testBit_lt_two_pow (lt_of_lt_of_le k.isLt (Nat.pow_le_pow_right two_pos (by omega)))] | ||
|
|
||
| /-- At a Boolean vertex the Lagrange basis is the indicator of that vertex. -/ | ||
| theorem lagrangeBasis_vertex [Nontrivial R] (i k : Fin (2 ^ n)) : |
There was a problem hiding this comment.
Is [Nontrivial R] needed here, and on eval_vertex and ext_of_eval_vertex? In the trivial ring all three statements hold anyway. If the proofs go through without it, please drop it (docs/wiki/typeclass-minimization.md).
| if (i : ℕ).testBit j = (k : ℕ).testBit j then (1 : R) else 0 := fun j => by | ||
| simp only [vertex, Vector.getElem_ofFn, BitVec.getLsb_eq_getElem, Fin.getElem_fin, | ||
| BitVec.getElem_ofFin] | ||
| by_cases hi : (i : ℕ).testBit j <;> by_cases hk : (k : ℕ).testBit j <;> simp [hi, hk] |
There was a problem hiding this comment.
Please use simp only [...] here. Same for (by simp) on line 65 and simpa [eval_vertex] on line 71.
|
|
||
| end CompPoly | ||
|
|
||
| namespace MvPolynomial |
There was a problem hiding this comment.
This lemma is purely about Mathlib's MvPolynomial, so I'd move it to CompPoly/ToMathlib/MvPolynomial/ and import it here. That's where we keep Mathlib-facing material, and it makes upstreaming easier.
- prove that a coefficient form and its `MvPolynomial` image evaluate alike at every point - evaluate coefficient forms at the Boolean vertices through the zeta transform - show that the image of a hypercube table is its unique multilinear extension - drop the unneeded `[Nontrivial R]` assumptions - move the Nullstellensatz uniqueness lemma to `ToMathlib/MvPolynomial/Nullstellensatz.lean` - replace bare `simp` and `simpa` calls with `simp only` forms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review! All four points are addressed in e220882.
|
What it adds
A new file,
CompPoly/Multilinear/Unique.lean.CMlPolynomialEval.vertex i: the Boolean vertex with indexi, coordinatejbeing bitjofi, as the rest of the file reads indices.lagrangeBasis_vertex: at a vertex, the Lagrange basis is the indicator of that vertex.eval_vertex: a hypercube table evaluates to its entryiat the vertexi.ext_of_eval_vertex: two tables with the same values at every vertex are equal.MvPolynomial.eq_of_degreeOf_le_one_of_eval_zeroOne: two polynomials of degree at most one in each variable that agree on{0,1}^σare equal.The last one is Lemma 3.6 of Thaler, "Proofs, Arguments, and Zero-Knowledge".
Its proof is three lines on top of mathlib's combinatorial Nullstellensatz, with the set
{0, 1}in each variable.Why
CompPoly evaluates hypercube tables, but has no statement that the evaluation interpolates the table, or that the interpolant is unique.
Plonky3-lean needs both to call its multilinear-extension specification "the" extension.
It currently proves them locally, in big-endian order, which is the order Plonky3 uses.
Validation
lake build CompPoly.Multilinear.Unique,scripts/update-lib.sh,scripts/check-imports.shandscripts/lint-style.shpass.No
sorry, nonative_decide.A PR against
mainwould rebase this one commit.References
MvPolynomial.eq_zero_of_eval_zero_at_prod_finset.🤖 Generated with Claude Code