Overview
If you’re familiar with the Lagrange interpolation, you may know that it is used to construct the interpolation polynomial for a set of points in one dimension and if you’re not, no worries you can just watch these two videos (Video 1, Video 2) before proceeding. Our main focus today is using Lagrange interpolation in multilinear extensions. Don’t be overwhelmed by the upcoming formulas, you only need to understand what they do. We will provide you with a much simpler formula to use when dealing with MLEs at the end of the article, after understanding everything.
The formulation of the multilinear extension can be thought of as a multi-dimensional extension of the Lagrange interpolation formula. The idea is to maintain the properties of the function at the vertices while allowing for interpolation within the entire hypercube.
Given as input all 2l evaluations of a function f:{0,1}l→F, for any point r∈Fl there is an O(2l)-time algorithm for evaluating f~(r).
Multilinear Extension Formula:
f~(r)=w∈{0,1}l∑f(w)⋅δ~w(r)
where δ~w(r) is the Multilinear Lagrange basis Polynomial corresponding to w :
δ~w(r)=Πi=1l(riwi+(1−ri)(1−wi))
The formula δ~w(r) is part of a multilinear extension (MLE), which allows us to extend a function defined on binary inputs to work with real inputs between 0 and 1.
It works by multiplying together simple terms that either "pick" rior 1−ri, depending on whether the binary value wi is 1 or 0. This product ensures a smooth transition between the values at each binary point. Essentially, it blends between these binary points based on the real values of r, allowing us to interpolate the function over continuous inputs.
If you still don’t understand how it works, no worries you don’t need to. Just keep going and you’ll get a much simpler formula that you can use easily at the end.
How It Uses Lagrange Concepts
-
Basis Structure: δ~w(r), can be seen as a generalization of Lagrange basis polynomials. They ensure that at each vertex r, the extension matches the value of f(ri), similar to how Lagrange interpolation ensures the polynomial passes through each point.
-
Generalization: The multilinear extension extends the concept of interpolation from one dimension to multiple dimensions. The basis polynomials in both cases are structured to ensure that the extended function preserves the behavior of the original function at specified points (the vertices).
What is the Boolean Hypercube ?
A Boolean hypercube is a geometric representation of all possible binary values {0,1} in n-dimensional space. Each vertex of the hypercube corresponds to an n-length binary string, and there are 2n n vertices in total, representing all possible combinations of 0 and 1.
For example:
-
In a 1-dimensional Boolean hypercube, you have 2 vertices: 0 and 1, which is just a line.
-
In a 2-dimensional Boolean hypercube, you have 4 vertices: (0,0),(0,1),(1,0),(1,1), forming a square.
-
In a 3-dimensional Boolean hypercube, you have 8 vertices:(000),(001),(010),(011),(100),(101),(110),(111), forming a cube.
000---------001
/ | / |
/ | / | 3-Dimensional Boolean Hypercube:
010--------011 | {000,001,010,011,100,101,110,111}
| | | |
| 100------|-101
| / | /
| / | /
110--------111
In ZKPs, you often need to work with functions that are defined over binary inputs. For instance, a function f might be defined on inputs of length n that are either 0 or 1, meaning f is naturally defined on the vertices of a Boolean hypercube of dimension n. So a Boolean Hypercube is another way of describing our multivariate function.
Derivation of Multilinear Extension
-
Building the Formula
-
Choose the points for interpolation: For bilinear interpolation in two dimensions, you generally have four points:
-
v0=(xv0,yv0)
-
v1=(xv1,yv1)
-
v2=(xv2,yv2)
-
v3=(xv3,yv3)
-
Lagrange Basis Functions:
-
To construct the MLE, we first need to define the Lagrange basis functions. These functions will ensure that the MLE passes through the vertex values of f.
-
The Lagrange basis functions for the vertices v0,v1,, v2 and v3 are:
L0(x1,x2)=(xv0−xv1)(xv0−xv2)(x1−xv1)((x1−xv2)⋅(yv0−yv1)((yv0−yv2)(x2−yv1)(x2−yv2)
L1(x1,x2)=(xv1−xv0)(xv1−xv2)(x1−xv0)((x1−xv2)⋅(yv1−yv0)((yv1−yv2)(x2−yv0)(x2−yv2)
L2(x1,x2)=(xv2−xv0)(xv2−xv1)(x1−xv0)((x1−xv1)⋅(yv2−yv0)((yv2−yv1)(x2−yv0)(x2−yv1)
L3(x1,x2)=(xv3−xv0)(xv3−xv1)(x1−xv0)((x1−xv1)⋅(yv3−yv0)((yv3−yv1)(x2−yv0)(x2−yv1)
Each Li(x,y) equals 1 at vertex vi and 0 at the other vertices meaning:
-
L0(x1,x2) is 1 when x1=xv0 and x2=yv0, and 0 when either x1=xv1 or x2=yv1
-
L1(x1,x2) is 1 when x1=xv1 and x2=yv0, and 0 when either x1=xv0 or x2=yv1
-
L2(x1,x2) is 1 when x1=xv0 and x2=yv1, and 0 when either x1=xv1 or x2=yv0
-
L3(x1,x2) is 1 when x1=xv1 and x2=yv1, and 0 when either x1=xv0 or x2=yv0
-
Formulating the Multilinear Extension:
- Now, we can express the multilinear extension f~(x,y) using the function values at the vertices and the Lagrange basis functions:
f~(x1,x2)=f(v0)L0(x1,x2)+f(v1)L1(x1,x2)+f(v2)L2(x1,x2)+f(v3)L3(x1,x2)
- Final Formula (Simplified):
f~(x1,x2)=f(v0)(1−x1)(1−x2)+f(v1)(1−x1)x2+f(v2)x1(1−x2)+f(v3)x1x2
You only need to understand this formula when dealing with MLEs without going through all of the math behind it.
f~(r)=w∈{0,1}l∑f(w)⋅δ~w(r)
So the Final Formula is basically this formula but written in a more elegant way.
Example
We define a bivariate function over the domain {0,1}l :
f(0,0)=1 f(0,1)=2 f(1,0)=8 f(1,1)=10
The MLE of the bivariate function will look like this:
f~(x1,x2)=1(1−x1)(1−x2)+2(1−x1)x2+8x1(1−x2)+10x1x2
which we can simplify it to:
f~(x1,x2)=1+7x1+x2+x1x2
Notice that each of the four terms on the right hand side of the equation ensures that the MLE evaluates equally to our predefined values for the bivariate function:
f(0,0)=f~(0,0)=1⋅1+2⋅0+8⋅0+10⋅0=1
f(0,1)=f~(0,1)=1⋅0+2⋅1+8⋅0+10⋅0=2
f(1,0)=f~(1,0)=1⋅0+2⋅0+8⋅1+10⋅0=8
f(1,1)=f~(1,1)=1⋅0+2⋅0+8⋅0+10⋅1=10
So our MLE looks like this:
By replacing x1 and x2 in f~(x1,x2) by the indexes (4,5) we will get 54 which is the most bottom right cell.
f~(x1,x2)=1+7x1+x2+x1x2
f~(5,5)=1+7⋅4+5+4⋅5=1+28+5+20=54
Conclusion
Formula 1: f~(r)=w∈{0,1}l∑f(w)⋅δ~w(r)
Formula 2: f~(x1,x2)=f(v0)(1−x1)(1−x2)+f(v1)(1−x1)x2+f(v2)x1(1−x2)+f(v3)x1x2
Both of these formulas represent multilinear extensions (MLE) of a Boolean function defined on binary points like {0,1} to a continuous domain.
The first formula is the general case for an l-dimensional Boolean function, where you're summing over all possible binary vectors w∈{0,1}l .
The second formula is the specific bivariate (2-dimensional) case, where l=2, and you're interpolating between the four possible binary inputs (0,0),(0,1),(1,0),(1,1) as we saw in the previous example.
This is all you need to know about Multi-dimensional Lagrange Interpolation for Multilinear extensions. Hope this article was helpful. The next article will be a full guide on the sumcheck protocol. We’ll be applying everything we’ve learned so far.