Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Weighted nine-position sum and arithmetic-program cost

Definition
VWZClique_Weighted

by orz · Nov 20, 2026 · Mathlib 0df444a (Lean v4.33.1)

clique-countingfine-grained-complexity

A field-valued product of unary and edge tables is summed over all assignments of nine positions. A costed program must give the correct output on every table.

Definition code
import Mathlib
import Definitions.Def_OAI_MatrixMultiplication_Arithmetic_omega

namespace VWZClique
open OAI.MatrixMultiplication.Arithmetic
abbrev V := Fin 9
abbrev WeightKey (n : ℕ) :=
  (V × Fin n) ⊕ (V × V × Fin n × Fin n)

open Classical in
noncomputable def weightedSum {F : Type*} [Field F] {n : ℕ}
    (H : SimpleGraph V) (w : WeightKey n → F) : F :=
  ∑ a : V → Fin n,
    (∏ i : V, w (.inl (i, a i))) *
    ∏ i : V, ∏ j : V,
      if i < j ∧ H.Adj i j then w (.inr (i, j, a i, a j)) else 1

def computesWithin {F I : Type*} [Field F] (f : (I → F) → F) (B : ℝ) : Prop :=
  ∃ (r : ℕ) (P : Program F I r) (o : Fin r),
    (P.cost : ℝ) ≤ B ∧ ∀ w, P.eval w o = f w

def wedge (H : SimpleGraph V) (f : Fin 3 → V) : Prop :=
  Function.Injective f ∧ H.Adj (f 0) (f 1) ∧ H.Adj (f 1) (f 2)
end VWZClique
Source
V. Vassilevska Williams and O. Zamir, The k-Clique hypothesis is dead, for good (2026), Section 3, equation (1). https://zamir.prof/kclq.pdf
Read-back

What the Lean code literally says, in plain math · OpenAI Codex (GPT-6), independent blind auditor

Vertex set. VVV denotes the nine indices 0,1,…,80,1,\ldots,80,1,…,8, with their usual order.

Weight keys. For each natural number nnn, write [n]={0,…,n−1}[n]=\{0,\ldots,n-1\}[n]={0,…,n−1}, with [0]=∅[0]=\varnothing[0]=∅, and let V={0,…,8}V=\{0,\ldots,8\}V={0,…,8}. A weight key is either a vertex key (i,x)(i,x)(i,x) with i∈Vi\in Vi∈V and x∈[n]x\in[n]x∈[n], or a separately tagged pair key (i,j,x,y)(i,j,x,y)(i,j,x,y) with i,j∈Vi,j\in Vi,j∈V and x,y∈[n]x,y\in[n]x,y∈[n]. The pair is ordered, and repetitions of either indices or values are allowed. At n=0n=0n=0 there are no keys of either kind.

Weighted sum. For any field FFF, natural number nnn, simple graph HHH on V={0,…,8}V=\{0,\ldots,8\}V={0,…,8} and assignment www of field elements to all vertex keys (i,x)(i,x)(i,x) and all ordered pair keys (i,j,x,y)(i,j,x,y)(i,j,x,y), let ui(x)u_i(x)ui​(x) and vij(x,y)v_{ij}(x,y)vij​(x,y) denote its values on the two respective kinds of keys, where i,j∈Vi,j\in Vi,j∈V and x,y∈[n]={0,…,n−1}x,y\in[n]=\{0,\ldots,n-1\}x,y∈[n]={0,…,n−1}. The defined element of FFF is ∑a:V→[n](∏i∈Vui(a(i)))∏i,j∈V, i<j{i,j}∈E(H)vij(a(i),a(j))\displaystyle\sum_{a:V\to[n]}\left(\prod_{i\in V}u_i(a(i))\right)\prod_{\substack{i,j\in V,\ i<j\\\{i,j\}\in E(H)}}v_{ij}(a(i),a(j))a:V→[n]∑​(i∈V∏​ui​(a(i)))i,j∈V, i<j{i,j}∈E(H)​∏​vij​(a(i),a(j)). All maps aaa occur, including maps with repeated values. Every ordered pair failing either the order test or the adjacency test contributes the factor 111. At n=0n=0n=0 the sum is empty and has value 000.

Computes within a bound. For any field FFF, any input index type III (possibly empty or infinite), any function f:(I→F)→Ff:(I\to F)\to Ff:(I→F)→F, and any real BBB, the predicate holds precisely when there are a natural number rrr, a straight-line program of rrr gates over FFF with inputs indexed by III, and a chosen output register among its rrr registers, such that the program costs at most BBB and this register equals f(w)f(w)f(w) for every assignment w:I→Fw:I\to Fw:I→F. Each gate loads an arbitrary field constant or an indexed input for free, or adds, subtracts, or multiplies two earlier register values at cost one. Total cost is the number of these arithmetic gates. Choosing an output requires r≥1r\ge1r≥1, even when the cost is zero. A negative BBB cannot satisfy the predicate.

Wedge. For a simple graph HHH on V={0,…,8}V=\{0,\ldots,8\}V={0,…,8} and any map f:{0,1,2}→Vf:\{0,1,2\}\to Vf:{0,1,2}→V, the predicate holds precisely when f(0),f(1),f(2)f(0),f(1),f(2)f(0),f(1),f(2) are pairwise distinct, f(0)f(0)f(0) is adjacent to f(1)f(1)f(1), and f(1)f(1)f(1) is adjacent to f(2)f(2)f(2). The endpoints f(0)f(0)f(0) and f(2)f(2)f(2) may also be adjacent.

Human review
  • Endorsed by Shuze Chen · Nov 20, 2026

    Confirmed by the moderator at approval.

  • Endorsed by orz · Nov 20, 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