Exact and Certified Data Shapley for Weighted k-Nearest-Neighbor Regression and Soft-Label Prediction

arXiv cs.LG Papers

Summary

This paper presents the first exact and certified algorithms for computing Data Shapley values in weighted k-nearest-neighbor regression and soft-label prediction, closing a known gap in the literature. It provides a pseudo-polynomial-time exact algorithm, a certified FPTAS, and an open-source library, with empirical validation of exactness and the limitations of Monte-Carlo approximation.

arXiv:2607.11956v1 Announce Type: new Abstract: Data Shapley is the standard principled answer to which training points are worth what, and its k-nearest-neighbor (KNN) specialization is the version deployed in practice: the exact estimator shipped by toolkits such as pyDVL and OpenDataVal. Exact algorithms are known for unweighted KNN and for weighted KNN classification, but weighted KNN regression and soft-label prediction have resisted: the only exact method is an O(N^K) brute force, exponential in neighborhood size K. The obstruction: the weighted regression prediction is a ratio of two coalition-dependent sums, whose normalization denominator breaks the additive, threshold, and duplication structures the prior polynomial algorithms rely on. We close this gap. We give (i) the first pseudo-polynomial-time exact algorithm (polynomial in N and K at fixed lattice precision) for weighted KNN-regression Data Shapley, a counting dynamic program over the joint integer state (sum of w, sum of w*y), verified against exhaustive enumeration with zero mismatch on 12,716 adversarial instances; (ii) a certified FPTAS for continuous weights and targets, with a machine-checkable per-value error certificate never violated across 86,400 checks; (iii) a complexity landscape, including an unconditional Omega(D_w) output-size lower bound and access-model hardness results; and (iv) a weighted soft-label multi-class extension. We release an open-source, CPU-only library and the first exact weighted-regression Data Shapley ground truth. On downstream mislabel detection our exact values are statistically equivalent to Monte-Carlo Data Shapley (dataset-level TOST, n=8, p<10^-4), the pre-registered outcome; the value of exactness is instead determinism, a certified error bound, and an exact reference for auditing estimators: Monte-Carlo did not reproduce the exact top-10% ranking at any budget tested, up to 3,000 permutations (~1.28e6 utility evaluations).
Original Article
View Cached Full Text

Cached at: 07/15/26, 04:17 AM

# Exact and Certified Data Shapley for Weighted 𝑘-Nearest-Neighbor Regression and Soft-Label Prediction
Source: [https://arxiv.org/html/2607.11956](https://arxiv.org/html/2607.11956)
\\setkeys

Ginkeepaspectratio

Zongye LyuZongye Lyu is with the Faculty of Information Technology, Monash University, Melbourne, VIC 3800, Australia \(e\-mail: lyuzongye@gmail\.com; ORCID: 0009\-0005\-2037\-256X\)\.This work has been submitted to the IEEE for possible publication\. Copyright may be transferred without notice, after which this version may no longer be accessible\.

###### Abstract

Data Shapley is the standard principled answer to “which training points are worth what,” and itskk\-nearest\-neighbor \(KNN\) specialization is the version that is actually deployed: it is the exact, tractable estimator shipped by data\-valuation toolkits such as pyDVL and OpenDataVal\. Exact algorithms are known for unweighted KNN classification and regression \(Jia et al\., 2019\) and, more recently, for*weighted*KNN*classification*\(Wang et al\., 2024; Zhang et al\., 2025\)\. Weighted KNN*regression*and*soft\-label*prediction have resisted: the only exact method is theO​\(NK\)O\(N^\{K\}\)brute force of Jia et al\., exponential in the neighborhood sizeKK\. The obstruction is concrete and is stated in the prior authors’ own words: the weighted regression prediction is a*ratio*of two coalition\-dependent weighted sums, so its coalition\-dependent normalization denominator breaks the additive, threshold, and duplication structures that the three prior polynomial algorithms each rely on\. We close this gap\. We give \(i\) the first pseudo\-polynomial\-time*exact*algorithm \(polynomial inNNandKKat fixed lattice precision\) for weighted KNN\-regression Data Shapley, a counting dynamic program over the joint integer state\(∑w,∑w​y\)\(\\sum w,\\ \\sum wy\), verified against exhaustive enumeration with zero mismatch on12,71612\{,\}716adversarial instances; \(ii\) a certified fully polynomial\-time approximation scheme \(FPTAS\) for continuous weights and targets, carrying a machine\-checkable per\-value error certificate that was never violated across86,40086\{,\}400checks; \(iii\) a complexity landscape that pins down the exact problem’s difficulty, including an*unconditional*Ω​\(Dw\)\\Omega\(D\_\{w\}\)output\-size lower bound and access\-model hardness results; and \(iv\) a weighted soft\-label multi\-class extension\. We release an open\-source, CPU\-only library and, with it, the first exact weighted\-regression Data Shapley ground truth\. On downstream mislabel detection our exact values are statistically equivalent to Monte\-Carlo Data Shapley \(dataset\-level TOST,n=8n=8,±0\.02\\pm 0\.02AUC band,p<10−4p<10^\{\-4\}\), which is the pre\-registered and expected outcome; the value of exactness is instead determinism, a certified error bound, an exact reference for auditing estimators, and a quantified price of*not*being exact: the Monte\-Carlo estimator did not reproduce the exact top\-10% ranking to our pre\-registered tolerance at any budget we tested, up to3,0003\{,\}000permutations \(about1\.28×1061\.28\\times 10^\{6\}utility evaluations\)\.

## IIntroduction

Data valuation asks a question that has become central to machine\-learning practice: given a trained model and a pool of training points, how much did each point contribute? The dominant principled answer is the*Data Shapley*value\[[1](https://arxiv.org/html/2607.11956#bib.bib1),[2](https://arxiv.org/html/2607.11956#bib.bib2)\], the unique attribution scheme satisfying the classical Shapley axioms\[[3](https://arxiv.org/html/2607.11956#bib.bib3),[4](https://arxiv.org/html/2607.11956#bib.bib4)\]\. It underlies data pricing and data markets\[[5](https://arxiv.org/html/2607.11956#bib.bib5),[6](https://arxiv.org/html/2607.11956#bib.bib6)\], mislabel and noisy\-point detection, and data\-acquisition decisions\[[7](https://arxiv.org/html/2607.11956#bib.bib7),[8](https://arxiv.org/html/2607.11956#bib.bib8)\]\. Its central obstacle is cost\. The definition averages a marginal contribution over all2N−12^\{N\-1\}coalitions, so for a generic model the exact value is intractable and practitioners fall back on Monte\-Carlo permutation sampling\[[9](https://arxiv.org/html/2607.11956#bib.bib9),[10](https://arxiv.org/html/2607.11956#bib.bib10)\]or on cheaper proxies such as Data\-OOB\[[11](https://arxiv.org/html/2607.11956#bib.bib11)\], influence functions\[[12](https://arxiv.org/html/2607.11956#bib.bib12)\], or reinforcement\-learned valuators\[[13](https://arxiv.org/html/2607.11956#bib.bib13)\]\.

### I\-AKNN\-Shapley: the exact, deployed special case

The exception that makes Data Shapley practical is thekk\-nearest\-neighbor surrogate\. Jia et al\.\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]observed that when the utility is the KNN prediction quality at a query point, the Shapley values of allNNtraining points can be computed*exactly*inO​\(N​log⁡N\)O\(N\\log N\)time rather than approximated\. This is why KNN\-Shapley, not model\-retraining Data Shapley, is the version shipped in production data\-valuation libraries: theknn\_shapleyroutine in pyDVL\[[15](https://arxiv.org/html/2607.11956#bib.bib15)\]and the KNN estimator in the OpenDataVal benchmark\[[16](https://arxiv.org/html/2607.11956#bib.bib16)\]\. The surrogate is standard across the whole line of work\[[17](https://arxiv.org/html/2607.11956#bib.bib17),[18](https://arxiv.org/html/2607.11956#bib.bib18),[19](https://arxiv.org/html/2607.11956#bib.bib19)\]: one values a point by its contribution to a KNN model, which is fast, and uses that value to rank points for a downstream model\.

The tractable frontier of exact KNN\-Shapley has moved outward, but unevenly\. Table[I](https://arxiv.org/html/2607.11956#S1.T1)summarizes it\. Unweighted KNN*classification*,*regression*, and*soft\-label*prediction all admit exactO​\(N​log⁡N\)O\(N\\log N\)algorithms\[[14](https://arxiv.org/html/2607.11956#bib.bib14),[17](https://arxiv.org/html/2607.11956#bib.bib17)\]\. For*weighted*KNN, where each neighbor contributes according to a kernel of its distance, the frontier stops at classification: Wang, Mittal, and Jia\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]give an exactO​\(N2\)O\(N^\{2\}\)algorithm for weighted*hard\-label classification*with discretized weights, and Zhang, Liu, and Gionis\[[21](https://arxiv.org/html/2607.11956#bib.bib21)\]give a near\-linear algorithm for a duplication*variant*of the same classification problem\. Weighted KNN*regression*and*soft\-label*prediction have no polynomial algorithm at all\. The only exact method is theO​\(NK\)O\(N^\{K\}\)brute force noted in Jia et al\.’s appendix, exponential in the neighborhood sizeKK\.

TABLE I:Best known*exact*Data Shapley algorithm by KNN setting\. This paper closes the two rows in bold\.
### I\-BWhy weighted regression is a new problem

The gap is not an oversight; it has a precise cause, and the prior authors name it\. For a coalitionSS, the weighted\-KNN regression prediction at a query point is

y^​\(S\)=∑j∈top​K​\(S\)wj​yj∑j∈top​K​\(S\)wj,\\hat\{y\}\(S\)\\;=\\;\\frac\{\\sum\_\{j\\in\\mathrm\{top\}K\(S\)\}w\_\{j\}\\,y\_\{j\}\}\{\\sum\_\{j\\in\\mathrm\{top\}K\(S\)\}w\_\{j\}\},\(1\)a*ratio*of two coalition\-dependent sums whose denominatorD​\(S\)=∑j∈top​K​\(S\)wjD\(S\)=\\sum\_\{j\\in\\mathrm\{top\}K\(S\)\}w\_\{j\}is exactly the*normalization term*\. This denominator is what breaks every prior polynomial route \(we make each failure precise in the Positioning Lemma of Section[III](https://arxiv.org/html/2607.11956#S3)\):

- •Jia et al\.’sO​\(N​log⁡N\)O\(N\\log N\)algorithm needs the utility to be*piecewise\-additive*over the neighbors; the ratio couples them, so the recursion does not apply\. \(Unweighted regression*is*solved by them; the difficulty is the weighting, not regression\.\)
- •Wang et al\.’sO​\(N2\)O\(N^\{2\}\)counting dynamic program needs the utility to be a*threshold of a single signed weighted sum*\(a weighted majority vote\), which has no normalization term; they state this is exactly why they restrict to hard\-label classification and call continuous\-weight soft\-label KNN a “considerable challenge\.” The regression prediction is a ratio of two sums, not a threshold of one\.
- •Zhang et al\.’s duplication reduces weighting to multiplicity by exploiting the classification utility, which does not preserve the fixed\-KKregression ratio; the authors themselves defer regression to future work\.

So the problem is open in a strong sense: two primary sources explicitly set it aside \(Wang et al\. call continuous\-weight soft\-label KNN a considerable challenge; Zhang et al\. defer regression to future work\), and the only exact method on record, Jia et al\.’sO​\(NK\)O\(N^\{K\}\)enumeration, is exponential inKK\. The reason is a single structural feature, the coalition\-dependent denominator, that the regression and soft\-label utilities share and that the solved classification utilities lack\.

### I\-CContributions

We resolve the weighted regression and soft\-label cases with a matched pair of algorithms and a complexity landscape that says exactly how far exactness can be pushed\. Throughout, weights lie on a lattice of resolutionδw\\delta\_\{w\}\(sowr=ar​δww\_\{r\}=a\_\{r\}\\delta\_\{w\},ar∈ℤ\>0a\_\{r\}\\in\\mathbb\{Z\}\_\{\>0\}\) andDw=1\+∑rarD\_\{w\}=1\+\\sum\_\{r\}a\_\{r\}is the total integer weight;DyD\_\{y\}is the analogous target spread\. Our contributions:

- •First pseudo\-polynomial\-time exact algorithm \(Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)\)\.We compute allNNweighted\-KNN\-regression Shapley values for one query point*exactly*in timeO​\(N2​K​Dw2​Dy2\)O\(N^\{2\}K\\,D\_\{w\}^\{2\}D\_\{y\}^\{2\}\)and spaceO​\(N​K​Dw​Dy\)O\(NK\\,D\_\{w\}D\_\{y\}\), via a size\-indexed counting dynamic program over the joint integer state\(W=∑topaj,M=∑topaj​bj\)\(W=\\sum\_\{\\mathrm\{top\}\}a\_\{j\},\\ M=\\sum\_\{\\mathrm\{top\}\}a\_\{j\}b\_\{j\}\)\. The key move is to track the numerator and denominator of Eq\. \([1](https://arxiv.org/html/2607.11956#S1.E1)\) jointly as integers, so the scale cancels and the computation is zero\-error on lattice inputs\. This is polynomial in bothNNandKK, replacing the priorO​\(NK\)O\(N^\{K\}\)\. Correctness is certified by zero mismatch against exhaustive enumeration on12,71612\{,\}716random and adversarial instances, cross\-checked against an independent exact implementation\. Empirically the running time scales as≈N2\.5\\approx N^\{2\.5\}\(Fig\.[1](https://arxiv.org/html/2607.11956#S5.F1)\)\.
- •Certified FPTAS for continuous weights \(Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\)\.For continuousw\>0w\>0andyyand anyε\>0\\varepsilon\>0, rounding to a lattice and running Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)yields valuesφ^i\\hat\{\\varphi\}\_\{i\}with a*machine\-checkable per\-value certificate*εi\\varepsilon\_\{i\}guaranteeing\|φ^i−φi\|≤εi\|\\hat\{\\varphi\}\_\{i\}\-\\varphi\_\{i\}\|\\leq\\varepsilon\_\{i\}andmaxi⁡εi≤ε\\max\_\{i\}\\varepsilon\_\{i\}\\leq\\varepsilon, in time polynomial inNN,KK, and1/ε1/\\varepsilon\. The certificate holds for bounded\-below kernels \(Gaussian, clipped inverse\-distance\), where the denominator cannot vanish\. Across86,40086\{,\}400checks it was never violated \(Clopper–Pearson 95% upper bound on the violation rate3\.47×10−53\.47\\times 10^\{\-5\}\), with realized error roughly2828–44×44\\timesinside the certified maximum\. Wang et al\. only*discretize*weights with an empirical deviation note; a certified approximation guarantee is new\.
- •Complexity landscape \(Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3), calibrated\)\.We show that*precision*, notNNorKK, is the true complexity driver\. \(a\) There are instances on which the exact value’s reduced fraction occupiesΩ​\(Dw\)\\Omega\(D\_\{w\}\)bits*unconditionally*, so exact output is inherently pseudo\-polynomially long and Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)isDwD\_\{w\}\-optimal up to polynomial factors among explicit\-output algorithms\. \(b\) UnlessP=NP\\mathrm\{P\}=\\mathrm\{NP\}, no polynomial\-time algorithm can even decide how many dyadic digits the exact value needs\. \(c\) UnlessFP=\#​P\\mathrm\{FP\}=\\\#\\mathrm\{P\}, no succinct exact representation supports polynomial\-time modular \(2\-adic digit\) access; \#SUBSET\-SUM reduces to a few such queries\. We state these results with their access\-model qualifier throughout: the practically relevant*threshold*question \(isφi≥q\\varphi\_\{i\}\\geq q, equivalently real approximation to2−poly2^\{\-\\mathrm\{poly\}\}\) is left open, and we identify the obstruction, namely that the regression utility is a smooth rational kernel of the coalition weight sum, so the\#​P\\\#\\mathrm\{P\}content sits in the arithmetic fine structure of the value rather than in its magnitude\. Coarse \(1/poly1/\\mathrm\{poly\}\) approximation is easy, by Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\.
- •Weighted soft\-label extension \(Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)\)\.ForCCclasses the prediction is the probability vectorp​\(S\)=∑topw⋅onehot​\(y\)/∑topwp\(S\)=\\sum\_\{\\mathrm\{top\}\}w\\cdot\\mathrm\{onehot\}\(y\)/\\sum\_\{\\mathrm\{top\}\}w, sharing the same normalization denominator\. Tracking the per\-class weighted\-count vector in the lattice DP gives exact soft\-label Shapley \(Brier or hard\-0/10/1utility\) in pseudo\-polynomial time, exponential inCCand so scoped to smallCC\. Verified by zero mismatch \(maximum deviation1\.5×10−131\.5\\times 10^\{\-13\}\) against an exhaustive soft\-label oracle on5,1125\{,\}112synthetic\-lattice instances\.
- •Open\-source library and the first exact weighted\-regression ground truth\.We release a CPU\-only, pyDVL\-compatible library and use it to produce something that did not previously exist: exact weighted\-regression Data Shapley values that can serve as ground truth for auditing Monte\-Carlo estimators\. On mislabel detection across eight regression datasets, our exact values are*statistically equivalent*to Monte\-Carlo Data Shapley \(mean AUC0\.9640\.964vs0\.9650\.965; dataset\-level TOST equivalence within a±0\.02\\pm 0\.02AUC band,n=8n=8,p<10−4p<10^\{\-4\}; paired Wilcoxonp=0\.74p=0\.74\), and both sit below the bagging\-based Data\-OOB proxy \(0\.9860\.986\)\. We do not claim detection state of the art\. What exactness buys is determinism, a certified error bound, and a reference against which sampling can be priced: the Monte\-Carlo estimator did*not*recover the exact top\-10% ranking to our pre\-registered tolerance \(Kendall\-τ≥0\.95\\tau\\geq 0\.95and top\-10% Jaccard≥0\.9\\geq 0\.9\) at any budget we tested, up to3,0003\{,\}000permutations \(≈1\.28×106\\approx 1\.28\\times 10^\{6\}utility evaluations\), and its top\-10% set still flipped on average2\.82\.8members from run to run at that budget\.

All theory is machine\-verified in exact rational arithmetic against an enumeration oracle, and all empirical claims follow a pre\-registered protocol, with deviations disclosed in Section[V](https://arxiv.org/html/2607.11956#S5)\(Experiments\)\. The remainder of the paper formalizes the setting and the Positioning Lemma \(Section[III](https://arxiv.org/html/2607.11956#S3)\), develops Theorems[1](https://arxiv.org/html/2607.11956#Thmtheorem1)–[4](https://arxiv.org/html/2607.11956#Thmtheorem4)\(Sections[IV\-B](https://arxiv.org/html/2607.11956#S4.SS2)–[IV\-E](https://arxiv.org/html/2607.11956#S4.SS5)\), and reports the experiments \(Section[V](https://arxiv.org/html/2607.11956#S5)\) before discussing scope and limitations \(Section[VI](https://arxiv.org/html/2607.11956#S6)\)\.

## IIRelated Work

### II\-AData valuation and Data Shapley

Attributing the value of an individual training point to a model’s performance is the central problem of*data valuation*\. The Shapley value\[[3](https://arxiv.org/html/2607.11956#bib.bib3)\]is the canonical answer: it is the unique attribution satisfying efficiency, symmetry, the null\-player axiom, and linearity\[[4](https://arxiv.org/html/2607.11956#bib.bib4)\], and Ghorbani and Zou\[[1](https://arxiv.org/html/2607.11956#bib.bib1)\]imported it into machine learning as*Data Shapley*\. A training point’s value is the average marginal contribution of that point to a utility function \(typically validation accuracy or negative loss\) taken over all coalitions of the remaining data\. Data Shapley and its relatives are now a standard tool for mislabel detection, data pricing, and dataset curation\[[7](https://arxiv.org/html/2607.11956#bib.bib7),[8](https://arxiv.org/html/2607.11956#bib.bib8),[6](https://arxiv.org/html/2607.11956#bib.bib6),[5](https://arxiv.org/html/2607.11956#bib.bib5)\], and ship in widely used libraries\[[16](https://arxiv.org/html/2607.11956#bib.bib16),[15](https://arxiv.org/html/2607.11956#bib.bib15)\]\.

The obstacle is cost\. Evaluating the exact Shapley value requires summing over2N−12^\{N\-1\}coalitions, and even a single marginal may require retraining the model\. For general utilities the Shapley value is \#P\-hard\[[22](https://arxiv.org/html/2607.11956#bib.bib22)\]\(see Section[II\-D](https://arxiv.org/html/2607.11956#S2.SS4)\), so practical pipelines fall back on Monte\-Carlo permutation sampling\[[9](https://arxiv.org/html/2607.11956#bib.bib9),[10](https://arxiv.org/html/2607.11956#bib.bib10),[1](https://arxiv.org/html/2607.11956#bib.bib1)\]or amortized estimators\[[23](https://arxiv.org/html/2607.11956#bib.bib23),[24](https://arxiv.org/html/2607.11956#bib.bib24)\]\. These return*stochastic*estimates: two runs on the same data yield different values, and the number of samples needed to stabilize a ranking is rarely known a priori\. This non\-determinism is the practical gap our exact and certified algorithms address\.

### II\-BAlternatives and variants of the Shapley value

Because the sampling variance of Data Shapley is high, several works replace or reweight the Shapley axioms\. Beta\-Shapley\[[25](https://arxiv.org/html/2607.11956#bib.bib25)\]tilts the coalition\-size weighting to suppress noise; Data Banzhaf\[[26](https://arxiv.org/html/2607.11956#bib.bib26)\]adopts the Banzhaf value for its improved robustness to the utility’s estimation noise; Data\-OOB\[[11](https://arxiv.org/html/2607.11956#bib.bib11)\]sidesteps the coalition sum entirely with an out\-of\-bag estimate that is cheap and, empirically, a strong mislabel detector\. Class\-wise and distributional variants\[[27](https://arxiv.org/html/2607.11956#bib.bib27),[28](https://arxiv.org/html/2607.11956#bib.bib28),[29](https://arxiv.org/html/2607.11956#bib.bib29)\]and influence functions\[[12](https://arxiv.org/html/2607.11956#bib.bib12),[30](https://arxiv.org/html/2607.11956#bib.bib30)\]occupy the same design space\. We use Data\-OOB and Monte\-Carlo Data Shapley as our principal empirical comparators \(Section[V](https://arxiv.org/html/2607.11956#S5)\); none of these methods delivers an*exact*, reproducible value for a weighted\-kkNN*regressor*, which is what our algorithms compute and against which the estimators can, for the first time, be audited\.

### II\-CThe KNN\-Shapley lineage

A separate line exploits the structure ofkk\-nearest\-neighbor utilities\[[31](https://arxiv.org/html/2607.11956#bib.bib31),[32](https://arxiv.org/html/2607.11956#bib.bib32)\]to avoid sampling altogether\. Jia et al\.\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]observed that for*unweighted*kkNN the per\-test utility is a simple function of the sorted neighbor list, so the marginal contributions telescope: allNNexact KNN\-Shapley values for one test point are computable inO​\(N​log⁡N\)O\(N\\log N\)time\. Their result covers both unweighted classification*and*unweighted regression \(a piecewise utility\-difference argument in their appendix\), and a follow\-up note\[[17](https://arxiv.org/html/2607.11956#bib.bib17)\]extends the exactO​\(N​log⁡N\)O\(N\\log N\)treatment to the unweighted*soft\-label*predictor\. KNN\-Shapley is now the de\-facto exact benchmark in the field, though its values have been shown to require care in interpretation\[[19](https://arxiv.org/html/2607.11956#bib.bib19)\]\.

Extending exactness to*weighted*kkNN, where each neighbor contributes a distance\-dependent kernel weight, has proved markedly harder\. Wang, Mittal, and Jia\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]give anO​\(N2\)O\(N^\{2\}\)exact algorithm for weightedkkNN*classification*with discretized weights, via a counting dynamic program over a signed weighted vote\. They are explicit that this works only because the hard\-label classification utility is a*threshold of a single weighted sum*and therefore “does not have a normalization term”; they state that handling soft\-label classifiers with continuous weights “poses considerable challenges” and accordingly restrict their scope to hard labels with discretized weights\. Threshold KNN\-Shapley\[[18](https://arxiv.org/html/2607.11956#bib.bib18)\]attains linear time and differential privacy by replacing the neighbor average with a hard threshold count, again removing the normalization term rather than confronting it\. Zhang, Liu, and Gionis\[[21](https://arxiv.org/html/2607.11956#bib.bib21)\]reach near\-linear time for weightedkkNN by a duplication reduction, but their construction preserves the*classification*game and they list regression as future work\. A concurrent Banzhaf\-based estimator for weightedkkNN\[[33](https://arxiv.org/html/2607.11956#bib.bib33)\]is likewise classification\-only\.

The consequence, summarized in Table[I](https://arxiv.org/html/2607.11956#S1.T1), is a conspicuous gap: for weightedkkNN*regression*the only exact algorithm on record is theO​\(NK\)O\(N^\{K\}\)brute enumeration noted by Jia et al\.\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\], exponential inKK, and the weighted soft\-label case is open, having been explicitly set aside in\[[20](https://arxiv.org/html/2607.11956#bib.bib20),[17](https://arxiv.org/html/2607.11956#bib.bib17)\]\. Every polynomial route above succeeds by*eliminating*the normalization denominator; the regression prediction is a ratio in which that denominator is intrinsic\. Making the denominator tractable, rather than assuming it away, is the technical core of this paper\.

### II\-D\#P\-hardness of the Shapley value

For weighted*majority*games, Deng and Papadimitriou\[[22](https://arxiv.org/html/2607.11956#bib.bib22)\]proved the Shapley value \#P\-complete\[[34](https://arxiv.org/html/2607.11956#bib.bib34),[35](https://arxiv.org/html/2607.11956#bib.bib35)\]: the threshold utility makes the value itself a weighted count, so the \#P quantity sits in the*magnitude*of a polynomially long number\. Our regression utility is different in kind: it is a smooth rational kernel of the coalition weight\-sum, and every coalition contributes a nonzero amount, so the count cannot reside in the magnitude\. Section[IV\-D](https://arxiv.org/html/2607.11956#S4.SS4)locates the hardness instead in the arithmetic fine structure of the exact value \(which prime powers divide its denominator\), which is why we state our lower bounds against explicit\-output and modular\-access models rather than as a bare “\#P\-hard” headline\. The dummy\-player device we use to invert the size\-dependent Shapley coefficients follows the technique originating in\[[22](https://arxiv.org/html/2607.11956#bib.bib22)\]\. On the algorithmic side, our exact routine is a pseudo\-polynomial counting dynamic program in the tradition of knapsack\-style DPs and their FPTAS\[[36](https://arxiv.org/html/2607.11956#bib.bib36),[37](https://arxiv.org/html/2607.11956#bib.bib37),[38](https://arxiv.org/html/2607.11956#bib.bib38)\]\.

## IIIPreliminaries and Problem Setup

### III\-AWeightedkkNN regression and the ratio prediction

Fix a test \(query\) pointx0x\_\{0\}with ground\-truth targety0y\_\{0\}, and a training set ofNNpointsz1,…,zNz\_\{1\},\\dots,z\_\{N\}\. Order the training points by distance tox0x\_\{0\}, so that rankrrdenotes therr\-th nearest point; it carries targetyr∈ℝy\_\{r\}\\in\\mathbb\{R\}and a weightwr\>0w\_\{r\}\>0\. The weight is a fixed kernel of the point’s distance tox0x\_\{0\}\(e\.g\. a Gaussian or a clipped inverse\-distance kernel\) and does*not*depend on the coalition\. Consequently the distance ranking is fixed oncex0x\_\{0\}is fixed, a fact we rely on throughout\.

For a coalition \(subset\)S⊆\[N\]S\\subseteq\[N\]of training points, let

topK​\(S\)=the​min⁡\(K,\|S\|\)​members of​S​of smallest rank,\\mathrm\{top\}\_\{K\}\(S\)\\;=\\;\\text\{the \}\\min\(K,\|S\|\)\\text\{ members of \}S\\text\{ of smallest rank,\}\(2\)i\.e\. theKKnearest present neighbors ofx0x\_\{0\}withinSS\. The weightedkkNN regression prediction is the*weighted average*of their targets,

y^​\(S\)=∑j∈topK​\(S\)wj​yj∑j∈topK​\(S\)wj⏟=⁣:D​\(S\),y^​\(∅\)=ydef,\\hat\{y\}\(S\)\\;=\\;\\frac\{\\displaystyle\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\\,y\_\{j\}\}\{\\displaystyle\\underbrace\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\}\_\{=:\\,D\(S\)\}\},\\qquad\\hat\{y\}\(\\varnothing\)=y\_\{\\mathrm\{def\}\},\(3\)withydefy\_\{\\mathrm\{def\}\}a fixed default \(e\.g\. the global mean\)\. We callD​\(S\)=∑j∈topK​\(S\)wjD\(S\)=\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}the*normalization denominator*\. The per\-test utility of a coalition is the negative prediction loss,

U\(S\)=−ℓ\(y^\(S\),y0\),ℓ∈\{\(⋅\)2,\|⋅\|\},U\(S\)\\;=\\;\-\\,\\ell\\\!\\big\(\\hat\{y\}\(S\),\\,y\_\{0\}\\big\),\\qquad\\ell\\in\\\{\(\\cdot\)^\{2\},\\ \|\\cdot\|\\\},\(4\)for squared or absolute loss\. Setting all weightswr≡1w\_\{r\}\\equiv 1recovers the unweighted regressor solved inO​\(N​log⁡N\)O\(N\\log N\)by\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]; the difficulty studied here is created purely by allowingwrw\_\{r\}to vary\.

### III\-BData Shapley and per\-test aggregation

The Data Shapley value of training pointiiwith respect to a single test pointx0x\_\{0\}is its average marginal contribution to the utility \([4](https://arxiv.org/html/2607.11956#S3.E4)\) over all orderings, equivalently over all coalitions of the other points:

ϕi=∑S⊆\[N\]∖\{i\}\|S\|\!​\(N−1−\|S\|\)\!N\!​\(U​\(S∪\{i\}\)−U​\(S\)\)\.\\phi\_\{i\}\\;=\\\!\\\!\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}\\frac\{\|S\|\!\\,\(N\-1\-\|S\|\)\!\}\{N\!\}\\,\\big\(\\,U\(S\\cup\\\{i\\\}\)\-U\(S\)\\,\\big\)\.\(5\)This is the unique attribution satisfying efficiency \(∑iϕi=U​\(\[N\]\)−U​\(∅\)\\sum\_\{i\}\\phi\_\{i\}=U\(\[N\]\)\-U\(\\varnothing\)\), symmetry, the null\-player axiom, and linearity\[[3](https://arxiv.org/html/2607.11956#bib.bib3),[4](https://arxiv.org/html/2607.11956#bib.bib4)\]\. To value a training point for the whole task rather than for one query, the per\-test values are averaged over a validation set𝒱\\mathcal\{V\},

Φi=1\|𝒱\|​∑x0∈𝒱ϕi\(x0\),\\Phi\_\{i\}\\;=\\;\\frac\{1\}\{\|\\mathcal\{V\}\|\}\\sum\_\{x\_\{0\}\\in\\mathcal\{V\}\}\\phi\_\{i\}^\{\(x\_\{0\}\)\},\(6\)following the standard KNN\-Shapley protocol\[[14](https://arxiv.org/html/2607.11956#bib.bib14),[20](https://arxiv.org/html/2607.11956#bib.bib20),[21](https://arxiv.org/html/2607.11956#bib.bib21)\]\. By linearity of \([5](https://arxiv.org/html/2607.11956#S3.E5)\) inUU, computingΦi\\Phi\_\{i\}reduces to computing allNNper\-test valuesϕi\(x0\)\\phi\_\{i\}^\{\(x\_\{0\}\)\}for eachx0x\_\{0\}independently; we therefore state all algorithms and complexities for the single\-test\-point problem and aggregate afterward\.

### III\-CThe normalization denominator as the obstruction

The prior polynomial\-time results of Section[II\-C](https://arxiv.org/html/2607.11956#S2.SS3)all operate on utilities without the denominatorD​\(S\)D\(S\): an additive per\-neighbor form\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\], a threshold of one signed sum\[[20](https://arxiv.org/html/2607.11956#bib.bib20),[18](https://arxiv.org/html/2607.11956#bib.bib18)\], or a duplicated classification game\[[21](https://arxiv.org/html/2607.11956#bib.bib21)\]\. Equation \([3](https://arxiv.org/html/2607.11956#S3.E3)\) is instead a loss of the*ratio*of two coalition\-dependent sums, the numerator∑wj​yj\\sum w\_\{j\}y\_\{j\}and the denominatorD​\(S\)D\(S\), both of which change as points enter or leavetopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)\. The following lemma makes precise why each prior route breaks on this ratio; it is the positioning that motivates the joint\-state counting dynamic program of Section[IV\-B](https://arxiv.org/html/2607.11956#S4.SS2)\.

###### Lemma 1\(Positioning: the ratio utility defeats the three prior polynomial routes\)\.

LetUUbe the weightedkkNN regression utility of \([3](https://arxiv.org/html/2607.11956#S3.E3)\)–\([4](https://arxiv.org/html/2607.11956#S3.E4)\) with non\-constant weights\. Then:

1. \(a\)*\(Jia’19 additivity fails\.\)*TheO​\(N​log⁡N\)O\(N\\log N\)algorithm of\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]requiresU​\(S∪\{i\}\)−U​\(S\)U\(S\\cup\\\{i\\\}\)\-U\(S\)to be a function of pointiiand its rank alone, so that marginals telescope along the sorted list\. The denominator couples all members oftopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\): insertingiirescales the contribution of*every*co\-present neighbor throughDD, soUUis not additive over neighbors and the telescoping recursion does not apply\. \(Unweighted regression, whereD​\(S\)=\|topK​\(S\)\|D\(S\)=\|\\mathrm\{top\}\_\{K\}\(S\)\|is a pure count, remains solved by\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]; the weighting, not the regression, is the obstruction\.\)
2. \(b\)*\(Wang’24 single\-threshold counting fails\.\)*TheO​\(N2\)O\(N^\{2\}\)counting DP of\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]requiresUUto be a threshold of a*single*signed weighted sum, letting the value be recovered from a one\-dimensional count of that sum\. Prediction \([3](https://arxiv.org/html/2607.11956#S3.E3)\) is a ratio of*two*sums, not a threshold of one; a one\-dimensional count of either sum alone cannot determiney^​\(S\)\\hat\{y\}\(S\)\. The authors themselves attribute their restriction to hard\-label classification precisely to the absence of a normalization term\.
3. \(c\)*\(Zhang’25 duplication fails\.\)*The near\-linear reduction of\[[21](https://arxiv.org/html/2607.11956#bib.bib21)\]maps weighting to point multiplicity within a*classification*game\. Under a fixed\-KKregression ratio, duplicating a near point fillstopK\\mathrm\{top\}\_\{K\}with copies of itself and changes both numerator and denominator non\-trivially, so the reduction does not preservey^​\(S\)\\hat\{y\}\(S\); the authors defer regression to future work\.

Consequently no prior route yields a polynomial\-in\-KKexact algorithm for weightedkkNN regression Shapley, and the best previously available exact method is theO​\(NK\)O\(N^\{K\}\)enumeration of\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]\.

###### Proof sketch\.

Each item exhibits the structural precondition of the cited algorithm and the property ofD​\(S\)D\(S\)that violates it\. \(a\) Writey^​\(S\)=\(∑j∈topK​\(S\)wj​yj\)/D​\(S\)\\hat\{y\}\(S\)=\\big\(\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}y\_\{j\}\\big\)/D\(S\); the mapS↦y^​\(S∪\{i\}\)−y^​\(S\)S\\mapsto\\hat\{y\}\(S\\cup\\\{i\\\}\)\-\\hat\{y\}\(S\)depends on the full multiset of co\-present top\-KKweights throughD​\(S\)D\(S\)andD​\(S∪\{i\}\)D\(S\\cup\\\{i\\\}\), not onii’s rank alone, so no rank\-indexed telescoping of marginals exists \(a two\-point instance with weightsw1≠w2w\_\{1\}\\neq w\_\{2\}already gives rank\-order\-dependent marginals\)\. \(b\)y^​\(S\)\\hat\{y\}\(S\)is invariant under scaling\(wj\)↦\(λ​wj\)\(w\_\{j\}\)\\\!\\mapsto\\\!\(\\lambda w\_\{j\}\), hence is not a function of any single unnormalized sum; two coalitions with equal∑wj​yj\\sum w\_\{j\}y\_\{j\}but differentD​\(S\)D\(S\)receive different utilities, so a one\-dimensional count over a single sum is insufficient and at least the joint state\(∑wj,∑wj​yj\)\(\\sum w\_\{j\},\\sum w\_\{j\}y\_\{j\}\)must be tracked\. \(c\) Duplicating the rank\-11pointtttimes yieldstopK\\mathrm\{top\}\_\{K\}occupied bymin⁡\(t,K\)\\min\(t,K\)copies of it, givingy^=y1≠y^\\hat\{y\}=y\_\{1\}\\neq\\hat\{y\}of the original coalition whenever a farther neighbor would otherwise entertopK\\mathrm\{top\}\_\{K\}, so the duplicated game’s prediction differs from the target regression prediction\. The final claim is theO​\(NK\)O\(N^\{K\}\)upper bound stated in the appendix of\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]\(enumerate theO​\(NK\)O\(N^\{K\}\)possible top\-KKsets\)\. ∎

The joint state\(∑topKwj,∑topKwj​yj\)\(\\sum\_\{\\mathrm\{top\}\_\{K\}\}w\_\{j\},\\ \\sum\_\{\\mathrm\{top\}\_\{K\}\}w\_\{j\}y\_\{j\}\)identified in part \(b\) of the proof is exactly what our counting DP maintains, turning the two\-sum coupling from an obstruction into a tractable lattice \(Section[IV\-B](https://arxiv.org/html/2607.11956#S4.SS2)\)\.

## IVExact and Certified Weighted\-kkNN Regression Shapley

We now give the constructive core of KNNR\-SHAP\. Throughout, fix a single test queryx0x\_\{0\}with targety0y\_\{0\}; theNNtraining points are indexed1,…,N1,\\dots,N*in increasing distance tox0x\_\{0\}*, so rank11is the nearest neighbor\. Pointrrcarries a fixed positive kernel weightwr\>0w\_\{r\}\>0\(a function of its distance tox0x\_\{0\},*not*of the coalition\) and a targetyry\_\{r\}\. For a coalitionS⊆\[N\]S\\subseteq\[N\], lettopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)denote themin⁡\(K,\|S\|\)\\min\(K,\|S\|\)smallest\-rank members ofSS\. The weighted\-kkNN prediction is the*ratio*

y^​\(S\)=∑j∈topK​\(S\)wj​yj∑j∈topK​\(S\)wj,y^​\(∅\)=ydef,\\hat\{y\}\(S\)\\;=\\;\\frac\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\\,y\_\{j\}\}\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\},\\qquad\\hat\{y\}\(\\varnothing\)=y\_\{\\mathrm\{def\}\},\(7\)the utility isU​\(S\)=−ℓ​\(y^​\(S\),y0\)U\(S\)=\-\\ell\\big\(\\hat\{y\}\(S\),y\_\{0\}\\big\)withℓ∈\{squared,absolute\}\\ell\\in\\\{\\text\{squared\},\\text\{absolute\}\\\}, and the Data Shapley value of pointiiis

ϕi=∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)​\(U​\(S∪\{i\}\)−U​\(S\)\),cN​\(s\)=s\!​\(N−1−s\)\!N\!\.\\phi\_\{i\}=\\\!\\\!\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}\\\!\\\!c\_\{N\}\(\|S\|\)\\,\\big\(U\(S\\cup\\\{i\\\}\)\-U\(S\)\\big\),\\quad c\_\{N\}\(s\)=\\tfrac\{s\!\\,\(N\-1\-s\)\!\}\{N\!\}\.\(8\)Per\-query values are averaged over a validation set to value each training row\. As the Positioning Lemma \(Section[III](https://arxiv.org/html/2607.11956#S3)\) establishes, the coalition\-dependent*denominator*D​\(S\)=∑j∈topK​\(S\)wjD\(S\)=\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}makesUUa loss of a*ratio*of two coalition\-dependent sums, which is exactly the normalization term that the threshold/additive utilities of\[[14](https://arxiv.org/html/2607.11956#bib.bib14),[20](https://arxiv.org/html/2607.11956#bib.bib20),[21](https://arxiv.org/html/2607.11956#bib.bib21)\]avoid; consequently the only prior exact route for the weighted\-kkNN*regression*value is Jia et al\.’sO​\(NK\)O\(N^\{K\}\)enumeration\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\], exponential inKK\. This section removes that exponential inKK\(Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)\), certifies a continuous\-input approximation \(Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\), characterizes what*cannot*be made cheaper \(Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\), and extends the construction to weighted soft\-label prediction \(Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)\)\.

### IV\-AThe lattice state

Place weights and targets on an integer lattice:wr=ar​δww\_\{r\}=a\_\{r\}\\,\\delta\_\{w\}withar∈ℤ\>0a\_\{r\}\\in\\mathbb\{Z\}\_\{\>0\}, andyr=br​δyy\_\{r\}=b\_\{r\}\\,\\delta\_\{y\}withbr∈ℤb\_\{r\}\\in\\mathbb\{Z\}\. WriteDw=1\+∑rarD\_\{w\}=1\+\\sum\_\{r\}a\_\{r\}\(the range of any partial weight\-sum\) andDyD\_\{y\}for the spread of∑rar​br\\sum\_\{r\}a\_\{r\}b\_\{r\}\. The engine of the method is that Eq\. \([7](https://arxiv.org/html/2607.11956#S4.E7)\) depends ontopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)only through the two integer aggregates

W=∑j∈topK​\(S\)aj,M=∑j∈topK​\(S\)aj​bj,W=\\\!\\\!\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}\\\!\\\!a\_\{j\},\\qquad M=\\\!\\\!\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}\\\!\\\!a\_\{j\}b\_\{j\},\(9\)becausey^​\(S\)=δy​M/W\\hat\{y\}\(S\)=\\delta\_\{y\}\\,M/W: the weight scaleδw\\delta\_\{w\}*cancels*in the ratio, so tracking the joint integer state\(W,M\)\(W,M\)reproduces the prediction, and hence the utility, with*zero*arithmetic error\. This scale\-cancellation is what lets a counting dynamic program over\(W,M\)\(W,M\)be exact rather than merely discretized\.

### IV\-BTheorem 1: exact counting DP, polynomial inNNandKK

###### Theorem 1\(Exact pseudo\-polynomial Data Shapley\)\.

Let weights and targets lie on the\(δw,δy\)\(\\delta\_\{w\},\\delta\_\{y\}\)\-lattice as above\. Then allNNShapley values \([8](https://arxiv.org/html/2607.11956#S4.E8)\) for one query point are computable*exactly*in timeO​\(N2​K​Dw2​Dy2\)O\\\!\\big\(N^\{2\}\\,K\\,D\_\{w\}^\{2\}\\,D\_\{y\}^\{2\}\\big\)and spaceO​\(N​K​Dw​Dy\)O\\\!\\big\(N\\,K\\,D\_\{w\}\\,D\_\{y\}\\big\), for both the squared and absolute losses and for everyK≤NK\\leq N, via a size\-indexed counting DP over the joint state\(W,M\)\(W,M\)\.

#### Decomposition\.

Group the sum \([8](https://arxiv.org/html/2607.11956#S4.E8)\) by the marginal contribution ofii, which takes one of two forms according to whetheriienters or reshapes the top\-KKwindow\.

- •NO\-DROP\(\|S\|≤K−1\|S\|\\leq K\-1\)\. Fewer thanKKpoints are present, so addingiisimply joins the window:topK​\(S∪\{i\}\)=S∪\{i\}\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=S\\cup\\\{i\\\}andtopK​\(S\)=S\\mathrm\{top\}\_\{K\}\(S\)=S\. The marginal depends only on the\(W,M\)\(W,M\)\-count of the size\-≤\(K−1\)\\leq\(K\-1\)subsets of\[N\]∖\{i\}\[N\]\\setminus\\\{i\\\}, which one knapsack\-style DP over itemsara\_\{r\}\(with target momentar​bra\_\{r\}b\_\{r\}\) tabulates ascnt0​\[s\]​\[W\]​\[M\]\\mathrm\{cnt\}\_\{0\}\[s\]\[W\]\[M\]\.
- •DROP\(\|S\|≥K\|S\|\\geq K\)\. The window is already full, so addingiienterstopK\\mathrm\{top\}\_\{K\}only ifiiis nearer than the currentKK\-th member,*displacing*the boundary point\. Condition on the boundary pointee\(the\(K−a\)\(K\{\-\}a\)\-th nearest present neighbor thatiipushes out\) and splitSSinto its selected*closer*set \(contributing a\(W,M\)\(W,M\)\-count\) and thegeg\_\{e\}eligible*farther*points that may be freely present\. All admissible coalition sizes then collapse into a single precomputed tail weight TS​\(ge\)=∑j≥0\(gej\)​cN​\(K\+j\),\\mathrm\{TS\}\(g\_\{e\}\)=\\sum\_\{j\\geq 0\}\\binom\{g\_\{e\}\}\{j\}\\,c\_\{N\}\(K\+j\),\(10\)and the marginal is obtained by convolving the closer\-set\(W,M\)\(W,M\)\-count withTS​\(ge\)\\mathrm\{TS\}\(g\_\{e\}\)over the two window states before and after the displacement\.

Each coalitionSSis counted in exactly one of the two branches, so the two contributions sum toϕi\\phi\_\{i\}without double counting\.

###### Proof sketch\.

Correctness of the state reduction is the cancellationy^=δy​M/W\\hat\{y\}=\\delta\_\{y\}M/Wof Section[IV\-A](https://arxiv.org/html/2607.11956#S4.SS1), so equal\(W,M\)\(W,M\)implies equal utility; the NO\-DROP/DROP split is an exhaustive, disjoint case analysis oftopK​\(S∪\{i\}\)\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)versustopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\); the tail weightTS\\mathrm\{TS\}is the closed form for summingcN​\(⋅\)c\_\{N\}\(\\cdot\)over the free farther points at fixed window content\. The complexity follows fromO​\(N​K\)O\(NK\)knapsack layers each over a\(W,M\)\(W,M\)\-grid of sizeO​\(Dw​Dy\)O\(D\_\{w\}D\_\{y\}\), with anO​\(Dw​Dy\)O\(D\_\{w\}D\_\{y\}\)convolution at each of theO​\(N\)O\(N\)boundaries\. The full proof, including the absolute\-loss variant and the boundary bookkeeping, is in Appendix A\. ∎

Algorithm[1](https://arxiv.org/html/2607.11956#alg1)states the procedure for one query point\.

Algorithm 1ExactWKNNR\-Shapley\(one query point\)1:lattice items

\(ar,br\)r=1N\(a\_\{r\},b\_\{r\}\)\_\{r=1\}^\{N\}\(rank\-ordered\),

KK, loss

ℓ\\ell, default

ydefy\_\{\\mathrm\{def\}\}
2:exact

ϕ1,…,ϕN\\phi\_\{1\},\\dots,\\phi\_\{N\}
3:precompute Shapley coefficients

cN​\(s\)c\_\{N\}\(s\)and tail weights

TS​\(g\)=∑j\(gj\)​cN​\(K\+j\)\\mathrm\{TS\}\(g\)=\\sum\_\{j\}\\binom\{g\}\{j\}c\_\{N\}\(K\{\+\}j\)
4:for

i=1i=1to

NNdo

5:

ϕi←0\\phi\_\{i\}\\leftarrow 0
6:build

cnt0​\[s\]​\[W\]​\[M\]\\mathrm\{cnt\}\_\{0\}\[s\]\[W\]\[M\]over

\[N\]∖\{i\}\[N\]\\setminus\\\{i\\\},

s≤K−1s\\leq K\{\-\}1⊳\\trianglerightknapsack DP

7:for

s=0s=0to

K−1K\-1do⊳\\trianglerightNO\-DROP marginals

8:foreach reachable

\(W,M\)\(W,M\)do

9:

ϕi\+=cN\(s\)cnt0\[s\]\[W\]\[M\]Δℓ\(\(W,M\)→\(W\+ai,M\+aibi\)\)\\phi\_\{i\}\\mathrel\{\+\}=c\_\{N\}\(s\)\\,\\mathrm\{cnt\}\_\{0\}\[s\]\[W\]\[M\]\\,\\Delta\\ell\\big\(\(W,M\)\\\!\\to\\\!\(W\{\+\}a\_\{i\},\\,M\{\+\}a\_\{i\}b\_\{i\}\)\\big\)
10:endfor

11:endfor

12:foreach boundary point

eedo⊳\\trianglerightDROP marginals,\|S\|≥K\|S\|\\geq K

13:convolve closer\-set

\(W,M\)\(W,M\)\-counts with

TS​\(ge\)\\mathrm\{TS\}\(g\_\{e\}\)
14:

ϕi\+=\\phi\_\{i\}\\mathrel\{\+\}=displacement marginal

Δ​ℓ\\Delta\\ellat

ee
15:endfor

16:endfor

17:return

ϕ1,…,ϕN\\phi\_\{1\},\\dots,\\phi\_\{N\}

#### Verification\.

We treat correctness as enumeration\-gated\. Algorithm[1](https://arxiv.org/html/2607.11956#alg1)was checked against an independent exhaustive\-enumeration oracle on12,71612\{,\}716random and adversarial instances \(tied ranks/weights, duplicate targets, boundaryy0y\_\{0\}, extreme weight ratios,K∈\{1,2,3,4,5,7\}K\\in\\\{1,2,3,4,5,7\\\}, both losses, and\|S\|<K\|S\|<Kregimes,N≤18N\\leq 18\):*zero*mismatches, with maximum absolute deviation2\.3×10−112\.3\\times 10^\{\-11\}\(attributable to the float readout of an otherwise exact integer computation\)\. Empirically the wall\-clock scales as≈N2\.5\\approx N^\{2\.5\}on the tested grid \(exponent2\.452\.45atK=1K\{=\}1,2\.552\.55atK=3K\{=\}3; Fig\.[1](https://arxiv.org/html/2607.11956#S5.F1)\), consistent with theO​\(N2⋅poly\)O\(N^\{2\}\\\!\\cdot\\\!\\text\{poly\}\)bound\.

Corollary \(continuous ground truth\)\.Applying the same NO\-DROP/DROP decomposition*without*discretization yields an exact algorithm for*continuous*weights and targets inO​\(K​NK\+1\)O\\\!\\big\(K\\,N^\{K\+1\}\\big\)time, polynomial inNN, exponential inKK, matching the order of Jia et al\.’sO​\(NK\)O\(N^\{K\}\)route\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]but made explicit\. This is our second exact oracle and the continuous ground truth used to certify Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\.

### IV\-CTheorem 2: a certified FPTAS for continuous inputs

Lattice inputs are an idealization; real kernels produce continuous weights and targets\. We round to a lattice chosen automatically and*certify*the resulting error per value\.

###### Theorem 2\(Certified FPTAS\)\.

Let the weights be continuous with a strictly positive lower boundDmin=minr⁡wr\>0D\_\{\\min\}=\\min\_\{r\}w\_\{r\}\>0, and let targets be continuous\. For anyε\>0\\varepsilon\>0, rounding to a resolution\(δw,δy\)\(\\delta\_\{w\},\\delta\_\{y\}\)selected bychoose\_scalesand running Algorithm[1](https://arxiv.org/html/2607.11956#alg1)returnsϕ^\\hat\{\\phi\}together with a machine\-checkable per\-value certificateεi\\varepsilon\_\{i\}such that\|ϕ^i−ϕi\|≤εi\|\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}\|\\leq\\varepsilon\_\{i\}andmaxi⁡εi≤ε\\max\_\{i\}\\varepsilon\_\{i\}\\leq\\varepsilon, in timepoly​\(N,K,1/ε,\(∑rwr\)/Dmin,B\)\\mathrm\{poly\}\\\!\\big\(N,\\,K,\\,1/\\varepsilon,\\,\(\\textstyle\\sum\_\{r\}w\_\{r\}\)/D\_\{\\min\},\\,B\\big\)\.

###### Proof sketch\.

Because the kernel weights do not depend on the coalition, the distance ranking is fixed; rounding therefore never changes which points occupytopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)\. So the exact and rounded predictions average over the*same*members, and the perturbation propagates through the ratio \([7](https://arxiv.org/html/2607.11956#S4.E7)\) as

\|Δ​y^\|≤\|Δ​𝒩\|\+\|y^\|⋅\|Δ​𝒟\|Dmin,\|\\Delta\\hat\{y\}\|\\;\\leq\\;\\frac\{\|\\Delta\\mathcal\{N\}\|\+\|\\hat\{y\}\|\\cdot\|\\Delta\\mathcal\{D\}\|\}\{D\_\{\\min\}\},\(11\)where𝒩,𝒟\\mathcal\{N\},\\mathcal\{D\}are the numerator and denominator sums andDminD\_\{\\min\}lower\-bounds𝒟\\mathcal\{D\}\(at least one member is always present\)\. For the squared loss, each marginal is a difference of two losses each Lipschitz with constant2​B2Bon\[−B,B\]\[\-B,B\],B=maxr⁡\|yr\|\+\|y0\|B=\\max\_\{r\}\|y\_\{r\}\|\+\|y\_\{0\}\|, giving the per\-value certificateεi=4​B​max⁡\|Δ​y^\|\\varepsilon\_\{i\}=4B\\max\|\\Delta\\hat\{y\}\|; the coalition\-averaging in \([8](https://arxiv.org/html/2607.11956#S4.E8)\) is a convex combination and preserves the bound\. Choosing the lattice fine enough to forceεi≤ε\\varepsilon\_\{i\}\\leq\\varepsilonrequires resolutionDw=O​\(\(∑rwr\)​K​B2/\(ε​Dmin\)\)D\_\{w\}=O\\\!\\big\(\(\\sum\_\{r\}w\_\{r\}\)\\,K\\,B^\{2\}/\(\\varepsilon\\,D\_\{\\min\}\)\\big\); so the scheme is a genuine FPTAS for kernel families whose weight ratio\(∑rwr\)/Dmin\(\\sum\_\{r\}w\_\{r\}\)/D\_\{\\min\}is polynomially bounded \(Gaussian and clipped inverse\-distance kernels on bounded domains\), which is the stated scope\. The step\-by\-step derivation is in Appendix B\. ∎

#### Scope and verification\.

The bound requires a kernel that is*bounded below*\(Dmin\>0D\_\{\\min\}\>0; Gaussian and clipped inverse\-distance kernels qualify, plain inverse\-distance does not\)\. This is the pre\-registered scope of the FPTAS\. Across86,40086\{,\}400point\-level checks the realized error never exceeded its certificate \(0 violations; Clopper–Pearson95%95\\%upper bound on the violation rate3\.47×10−53\.47\\times 10^\{\-5\}\), and the certificate was conservative but not vacuous: atε=0\.1\\varepsilon=0\.1the maximum realized error was1\.7×10−31\.7\\times 10^\{\-3\}against a maximum certificate of6\.4×10−26\.4\\times 10^\{\-2\}\(a≈37×\\approx\\\!37\\timesmargin\), and the ratio held near≈28\\approx\\\!28–44×44\\timesacrossε∈\{0\.1,0\.01,0\.001\}\\varepsilon\\in\\\{0\.1,0\.01,0\.001\\\}\. Runtime was essentially flat inε\\varepsilon\(mean≈0\.20\\approx 0\.20s per instance across all three tolerances\), because the reachable\(W,M\)\(W,M\)\-state count saturates once the lattice is fine enough to separate the fixed top\-KKmembers\. In contrast, Wang et al\. only*discretize*weights \(a fixed 3\-bit grid\) with an empirical deviation note and no certified per\-value bound\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]\.

### IV\-DTheorem 3: precision is the complexity driver

Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)is pseudo\-polynomial: it pays for weight precision throughDwD\_\{w\}\. We show this dependence is*intrinsic*, and we are precise about the one decision version that remains open\. A first observation forces the form of every hardness statement below: the exact value can be an exponentially long object, so “computeϕi\\phi\_\{i\}exactly in polynomial time” is vacuous for output\-size reasons, and any meaningful hardness claim must fix an*access model*for the exact value\.

###### Theorem 3\(Precision landscape; calibrated scope\)\.

For weighted\-kkNN regression Shapley with weights encoded in binary:

1. \(a\)Unconditional output size\.There areNN\-point instances withO​\(N\)O\(N\)\-bit weights,K=NK=N,Dy=O​\(1\)D\_\{y\}=O\(1\), on which the reduced representation ofϕi\\phi\_\{i\}occupiesΩ​\(Dw\)\\Omega\(D\_\{w\}\)bits\. Hence exact computation inherently requires pseudo\-polynomial output size, with*no*complexity assumption, and Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)isDwD\_\{w\}\-optimal up to polynomial factors*for algorithms that emit the value in explicit \(fraction\-like\) form*\.
2. \(b\)NP\-hard precision decision\.UnlessP=NP\\mathrm\{P\}=\\mathrm\{NP\}, no polynomial\-time algorithm decides whether2t∣denom⁡\(ϕi\)2^\{t\}\\mid\\operatorname\{denom\}\(\\phi\_\{i\}\): a deterministic many\-one reduction fromSubset\-Sumvia the22\-adic valuation\-gap gadgetv=2t−Tv=2^\{t\}\-T\.
3. \(c\)\#P\-hard modular access\.UnlessFP=\#​P\\mathrm\{FP\}=\\\#\\mathrm\{P\}, no succinct exact representation supports polynomial\-time22\-adic digit access: \#Subset\-SumTuring\-reduces ton\+2n\+2such queries, using dummy points to invert the size\-dependent Shapley coefficients \(a Bernstein/Cauchy linear system\)\. In this precise sense \(hardness of*access*to the exact value\), exact weighted\-kkNN regression Data Shapley with binary weights is \#P\-hard\.

###### Proof sketch\.

\(a\) uses itemsaj=2j−1a\_\{j\}=2^\{\\,j\-1\}so subset weight\-sums biject onto\{0,…,2n−1\}\\\{0,\\dots,2^\{n\}\-1\\\}; for each primep∈\(2n−1,2n\]p\\in\(2^\{n\-1\},2^\{n\}\]exactly one coalition makes1\+W​\(S\)=p1\+W\(S\)=p, and the Shapley coefficients carry no factor ofpp, so by ultrametric strictnessp2p^\{2\}divides the reduced denominator; the prime number theorem then forcesΩ​\(2n\)=Ω​\(Dw\)\\Omega\(2^\{n\}\)=\\Omega\(D\_\{w\}\)denominator bits\. \(b\) setsv=2t−Tv=2^\{t\}\-Twitht=V\+2​L\+4t=V\+2L\+4so that the “W=TW=T” coalitions land at22\-adic valuation far below every other term;Subset\-Sumis solvable iff2t∣denom⁡\(ϕi\)2^\{t\}\\mid\\operatorname\{denom\}\(\\phi\_\{i\}\)\. \(c\) recovers, from22\-adic digit queries onn\+1n\+1gadget instances withm=0,…,nm=0,\\dots,ndummy points, the size\-stratified countsn​\(s,T\)n\(s,T\)by inverting the coefficient matrixMm,s=s\!​\(n\+m−s\)\!M\_\{m,s\}=s\!\\,\(n\{\+\}m\{\-\}s\)\!, which is invertible via a Beta\-integral/Bernstein argument \(equivalently a Cauchy matrix\); summing the recovered counts yields \#Subset\-Sum\. The \#P\-completeness of \#Subset\-Sumis invoked through the parsimonious slack\-\{1,2\}\\\{1,2\\\}/target\-44clause gadget \(the textbook Sipser gadget is*not*parsimonious\)\. All gadget arithmetic is machine\-verified in exact rational arithmetic against the enumeration oracle \(verify\_theorem3\.py, exit0\)\. Full proofs are in Appendix C\. ∎

#### What remains open, and why\.

The threshold/comparison decision \(“isϕi≥q\\phi\_\{i\}\\geq q?”, and hence also real additive approximation to2−poly2^\{\-\\mathrm\{poly\}\}\) is genuinely*open*; our techniques give only a one\-directional reduction to it, because a reduced denominator of bit\-lengthΩ​\(Dw\)\\Omega\(D\_\{w\}\), i\.e\. of value2Ω​\(Dw\)2^\{\\Omega\(D\_\{w\}\)\}\(part \(a\)\) allowsϕi−q\\phi\_\{i\}\-qto be as small as2−exp2^\{\-\\exp\}, which a2−poly2^\{\-\\mathrm\{poly\}\}oracle cannot resolve\. The obstruction is structural: the regression utility is a*smooth*rational kernel of the coalition weight\-sum with poles off the achievable interval, so no fixed\-degree kernel can spike on one subset\-sum while vanishing on exponentially many others\. The \#P content therefore sits in the arithmetic fine structure of the exact value \(which prime powers divide the denominator\), not in its magnitude, in contrast to weighted\-*majority*games, where the count lives in the magnitude and Shapley is directly \#P\-complete\[[22](https://arxiv.org/html/2607.11956#bib.bib22)\]\. Coarse \(1/poly1/\\mathrm\{poly\}\) approximation is meanwhile easy, by permutation sampling or by the FPTAS of Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2); any hardness of the threshold version must therefore hide at exponentially fine scales\. We state \(a\)–\(c\) as the exact\-access formalizations and flag the threshold version as the remaining conjecture; we never claim “exact Data Shapley is \#P\-hard” without the access\-model qualifier\. This upgrades the pre\-registered floor \(an explicit conjecture with obstruction analysis\) to a proved landscape while leaving one decision version openly unresolved\.

#### Scope of the hardness\.

Three qualifications delimit what parts \(b\),\(c\) do and do not assert\. \(i\) They hold not only atK=NK=Nbut throughout theK=Θ​\(N\)K=\\Theta\(N\)regime \(e\.g\.K≈N/2K\\approx N/2\), via a truncated\-extraction construction given in Appendix C\. \(ii\) For*constant*KKthe problem is polynomial\-time even with continuous weights, by theO​\(K​NK\+1\)O\(K\\,N^\{K\+1\}\)corollary above; the hardness therefore genuinely requiresKKgrowing withNNand does*not*contradict the small\-KKpractical regime of Section[IV\-F](https://arxiv.org/html/2607.11956#S4.SS6)\. \(iii\) The intermediatepolylog​\(N\)\\mathrm\{polylog\}\(N\)\-KKregime is open\. As above, every hardness statement is made under the fixed access model for the exact value\.

### IV\-ETheorem 4: weighted soft\-label multi\-class prediction

The same normalization obstruction \(and the same lattice cure\) extends to weighted soft\-labelkkNN, where the prediction is a probability*vector*\.

###### Theorem 4\(Weighted soft\-label Shapley\)\.

ForCCclasses with one\-hot labels, let the soft prediction bep​\(S\)=∑j∈topK​\(S\)wj​onehot​\(yj\)/∑j∈topK​\(S\)wjp\(S\)=\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\\,\\mathrm\{onehot\}\(y\_\{j\}\)\\big/\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}, with a Brier \(or hard0/10/1\) utility\. Tracking the per\-class weighted\-count vector\(M1,…,MC\)\(M\_\{1\},\\dots,M\_\{C\}\)with∑cMc=W\\sum\_\{c\}M\_\{c\}=Win the lattice DP of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)computes the exact soft\-label Shapley values in pseudo\-polynomial time, exponential in the number of classesCC\.

###### Proof sketch\.

The shared denominator∑topKwj=W​δw\\sum\_\{\\mathrm\{top\}\_\{K\}\}w\_\{j\}=W\\delta\_\{w\}is the same normalization term as in Eq\. \([7](https://arxiv.org/html/2607.11956#S4.E7)\), so the scale cancels andp​\(S\)=\(M1,…,MC\)/Wp\(S\)=\(M\_\{1\},\\dots,M\_\{C\}\)/Wis exact on the lattice\. Replacing the scalar momentMMof Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)by the vector\(M1,…,MC\)\(M\_\{1\},\\dots,M\_\{C\}\)\(of which one component is redundant given∑cMc=W\\sum\_\{c\}M\_\{c\}=W\) reruns the identical NO\-DROP/DROP recursion; the state grid grows by a factorO​\(DwC−1\)O\(D\_\{w\}^\{\\,C\-1\}\), which is the source of the exponential dependence onCC\. Full details in Appendix D\. ∎

#### Scope and verification\.

The vector state is practical only for smallCC\. On5,1125\{,\}112synthetic\-lattice soft\-label instances withC∈\{2,3\}C\\in\\\{2,3\\\}, the DP matched an exhaustive soft\-label brute force to within1\.5×10−131\.5\\times 10^\{\-13\}\(max absolute deviation\), a0\-mismatch pass at machine precision\. Positioned against the*unweighted*soft\-label result of\[[17](https://arxiv.org/html/2607.11956#bib.bib17)\], the weighting denominator is again the obstruction that the vector\-MMDP removes\.

### IV\-FPracticality and scope

Two caveats frame the above\. First, the exact DP is practical only for*small*KK: we recommendK≤3K\\leq 3, since a largerKKinflates the reachable\(W,M\)\(W,M\)\-state count and cost grows steeply withKK\(atN=1000N=1000on our grid, one query point took4\.94\.9s atK=1K\{=\}1versus242242s atK=3K\{=\}3; Fig\.[1](https://arxiv.org/html/2607.11956#S5.F1), a partial two\-point trace overK∈\{1,3\}K\\in\\\{1,3\\\}\)\. LargerKKis reached through the certified FPTAS or a coarser lattice\. Second, as in the entirekkNN\-Shapley line\[[14](https://arxiv.org/html/2607.11956#bib.bib14),[20](https://arxiv.org/html/2607.11956#bib.bib20),[21](https://arxiv.org/html/2607.11956#bib.bib21)\], the values are those of the \(lattice\-\)weighted\-kkNN*surrogate*model; we defend this framing through downstream validation \(Section[V](https://arxiv.org/html/2607.11956#S5)\) and, distinctively, through the algorithm’s role as the first exact regression*ground truth*against which sampling estimators can be audited\.

## VExperiments

We evaluate KNNR\-SHAP against five pre\-registered questions \(pre\-registration in Appendix E\): scaling \(E1\), the FPTAS certificate on real geometry \(E2\), downstream mislabel detection \(E3\), the price a Monte\-Carlo \(MC\) estimator pays to approach the exact ranking \(E4\), and the weighted soft\-label extension \(E5\)\. Every dataset is public and loads at zero cost on a laptop CPU\. E1 uses lattice instances \(the only place synthetic data appears\); E2–E5 use eight real regression collections \(abalone,airfoil,concrete,cpu\_small,energy,kin8nm,space\_ga, andwine\_red\) drawn from OpenML\[[39](https://arxiv.org/html/2607.11956#bib.bib39)\]and scikit\-learn\[[40](https://arxiv.org/html/2607.11956#bib.bib40)\], plusbreast\_cancerandwinefor the soft\-label arm\. All runs are seeded, resumable, and checkpointed; the appendix lists data identifiers\.

Two framing points fixed before any results were seen\. First, detection AUC is expected to reach*parity*with strong MC and out\-of\-bag baselines \(pre\-registered outcome C\): the contribution of exactness is determinism, a machine\-checkable error certificate, and the first exact regression ground truth; it is never a new detection state of the art\. Second, we report the MC price curve as a description of what approximation costs, not as a headline ”budget to match”: at the ranking fidelity we probe there is no such budget, and we say so\.

### V\-ADeviations from the pre\-registration

We disclose every departure from the registered spec \(kill\-criterion K6\); no reported result depends on any of them\. \(i\) E3 uses55seeds per dataset rather than the registered≥10\\geq 10, on an88\-dataset panel pinned at Stage 4 \(the spec permits Stage\-4 dataset pinning\), to fit the CPU budget\. \(ii\) E1 coversN≤1000N\\leq 1000andK∈\{1,3\}K\\in\\\{1,3\\\}at a single lattice, rather than the registeredN≤104N\\leq 10^\{4\},K∈\{1,3,5,10\}K\\in\\\{1,3,5,10\\\}across three lattices; a partialK=5K\{=\}5trace is shown \(Fig\.[1](https://arxiv.org/html/2607.11956#S5.F1)\)\. \(iii\) The pre\-registered classification\-surrogate\-misuse baseline was dropped\. \(iv\) CIs are Student\-ttrather than the pre\-registered per\-dataset Wilson intervals\.

### V\-BE1: Scaling of the exact DP

We time the full Shapley vector \(allNNtraining values for one test point\) produced by the Theorem 1 counting DP asNNgrows from5050to10001000at fixed lattice resolution, forK∈\{1,3\}K\\in\\\{1,3\\\}\(a partialK=5K\{=\}5trace appears in Fig\.[1](https://arxiv.org/html/2607.11956#S5.F1)\)\. Table[II](https://arxiv.org/html/2607.11956#S5.T2)reports wall\-clock time; a log–log fit gives empirical exponents of2\.452\.45\(K=1K\{=\}1\) and2\.552\.55\(K=3K\{=\}3\), i\.e\. growth close ton2\.5n^\{2\.5\}\. This is consistent with theO​\(N2​K​Dw2​Dy2\)O\(N^\{2\}KD\_\{w\}^\{2\}D\_\{y\}^\{2\}\)bound of Theorem 1, the extra half\-power reflecting the growth of the reachable\(W,M\)\(W,M\)state set withNN\. The absolute cost confirms the scope stated in the theory: exact computation is practical for small\-to\-moderateKK\(atN=1000N\{=\}1000,4\.904\.90s forK=1K\{=\}1versus241\.6241\.6s forK=3K\{=\}3;K=5K\{=\}5grows markedly faster as the state count expands\), matching the operating scale of prior exact weighted\-kNN work\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]\. The FPTAS \(E2\) handles continuous weights and eases the precision \(henceKK\-state\) cost via a coarser lattice; it shares this DP’s≈N2\.5\\approx\\\!N^\{2\.5\}dependence onNN, so it trades certified precision, not largerNN\-reach\.

TABLE II:E1: exact\-DP wall\-clock \(seconds per full Shapley vector, one test point\) at fixed lattice resolution\. Fitted exponent onnn:2\.452\.45\(K=1K\{=\}1\),2\.552\.55\(K=3K\{=\}3\)\.![Refer to caption](https://arxiv.org/html/2607.11956v1/figs/fig1_scaling.png)Figure 1:E1 scaling\. Runtime of the exact DP versusNNon log–log axes; slopes near2\.52\.5acrossKK, with cost rising steeply inKK\(small–moderate\-KKregime\)\.
### V\-CE2: FPTAS certificate on real geometry

We run the Theorem 2 FPTAS with a bounded\-below kernel on the real datasets at three tolerances,ε∈\{0\.1,0\.01,0\.001\}\\varepsilon\\in\\\{0\.1,0\.01,0\.001\\\}, and check every emitted per\-value certificate against the exact value: for each point we verify\|φ^i−φi\|≤εi\|\\hat\{\\varphi\}\_\{i\}\-\\varphi\_\{i\}\|\\leq\\varepsilon\_\{i\}andmaxi⁡εi≤ε\\max\_\{i\}\\varepsilon\_\{i\}\\leq\\varepsilon\. Across86,40086\{,\}400point\-level checks the certificate is violatedzerotimes \(Table[III](https://arxiv.org/html/2607.11956#S5.T3)\); the Clopper–Pearson95%95\\%upper bound on the violation rate is3\.47×10−53\.47\\times 10^\{\-5\}\(instance\-level0/1,4400/1\{,\}440gives a95%95\\%upper bound of2\.1×10−32\.1\\times 10^\{\-3\}\)\. The certificate is also tight enough to be useful without being loose: the realized error stays≈28\\approx 28–44×44\\timesinside the certified bound at every tolerance \(e\.g\. atε=0\.01\\varepsilon\{=\}0\.01, max realized error2\.1×10−42\.1\\times 10^\{\-4\}against a max certificate of6\.0×10−36\.0\\times 10^\{\-3\}\)\. Runtime is essentially flat inε\\varepsilon\(mean0\.1990\.199–0\.2060\.206s\), because the reachable\-state count saturates well before the finest lattice is needed\. This is a strictly stronger guarantee than the empirical discretization deviation of prior work\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]: here the bound is machine\-checked per value and never violated\.

TABLE III:E2: FPTAS on real\-data geometry\. Certificate violations:0of86,40086\{,\}400checks \(Clopper–Pearson95%95\\%upper bound3\.47×10−53\.47\\times 10^\{\-5\}\)\. Eachε\\varepsilonaggregates480480instances\.
### V\-DE3: Downstream mislabel detection

We inject label noise into10%10\\%of training targets \(perturbed by±\(1​–​3\)\\pm\(1\\text\{\-\-\}3\)standard deviations\) and score how well each valuation ranks the corrupted points, over4040cells \(8 datasets×\\times5 seeds\)\. We compare the exact KNNR\-SHAP values against MC Data Shapley on the*identical*utility, Data\-OOB\[[11](https://arxiv.org/html/2607.11956#bib.bib11)\], leave\-one\-out \(LOO\), and a random baseline\. Table[IV](https://arxiv.org/html/2607.11956#S5.T4)and Fig\.[2](https://arxiv.org/html/2607.11956#S5.F2)give the results\. Exact and MC are statistically indistinguishable: mean AUC0\.9640\.964vs\.0\.9650\.965; a paired Wilcoxon on the88dataset means givesp=0\.74p\{=\}0\.74; and the pre\-registered TOST at the dataset level \(n=8n\{=\}8,±0\.02\\pm 0\.02AUC band\) certifies equivalence \(pTOST=1\.6×10−5p\_\{\\text\{TOST\}\}=1\.6\\times 10^\{\-5\}, mean diff−0\.001\-0\.001; cell\-leveln=40n\{=\}40givespTOST=1\.3×10−13p\_\{\\text\{TOST\}\}=1\.3\\times 10^\{\-13\}, anticonservative under seed clustering\)\. MC Data Shapley here uses200200permutations per test point \(mean85,64085\{,\}640utility evaluations\), a point between the100100\- and300300\-permutation rows of E4 \(Table[V](https://arxiv.org/html/2607.11956#S5.T5)\)\. The pre\-registered±0\.02\\pm 0\.02band is1\.8×1\.8\\timesthe seed\-level SD of paired AUC differences \(0\.0110\.011\) and excludes the0\.0210\.021Data\-OOB\-minus\-exact gap, so equivalence is a substantive claim, not a wide\-band artifact\. This is exactly the parity we pre\-registered \(outcome C\), reported as a finding rather than a competition\. Data\-OOB is modestly but significantly better \(mean0\.9860\.986, paired Wilcoxon on the88dataset meansp=0\.008p\{=\}0\.008\): for pure detection AUC, OOB is competitive\-to\-better, and exactness does not buy detection accuracy here\. Both Shapley variants and OOB dominate LOO \(mean0\.6510\.651\) and random \(mean0\.5120\.512\)\.

TABLE IV:E3: mislabel\-detection AUC \(mean over4040cells\)\. CIs are95%95\\%Student\-ttintervals over4040cells; cells share datasets, so these understate cluster\-level uncertainty\. Exact vs\. MC are equivalent by pre\-registered dataset\-level TOST \(n=8n\{=\}8,±0\.02\\pm 0\.02band,pTOST=1\.6×10−5p\_\{\\text\{TOST\}\}=1\.6\\times 10^\{\-5\}; cell\-leveln=40n\{=\}40anticonservative under seed clustering\); Data\-OOB is significantly higher \(paired Wilcoxonp=0\.008p=0\.008\)\.![Refer to caption](https://arxiv.org/html/2607.11956v1/figs/fig3_detection.png)Figure 2:E3 detection AUC by estimator with95%95\\%CIs\. Exact and MC coincide \(TOST\-equivalent\); Data\-OOB is competitive\-to\-better; both dominate LOO and random\.
### V\-EE4: What MC pays to approach the exact ranking

Since exact and MC agree on detection AUC \(E3\), the value of exactness is not accuracy but a stable, auditable, reproducible ranking\. E4 measures the price MC pays to reach that same ranking\. Using the exact values as ground truth, we grow the MC permutation budget and record, per cell, the mean Kendall\-τ\\tauagainst the exact ranking, the probability of reachingτ≥0\.95\\tau\\geq 0\.95, and the number of top\-kkselection flips between independent runs\. Table[V](https://arxiv.org/html/2607.11956#S5.T5)and Fig\.[3](https://arxiv.org/html/2607.11956#S5.F3)report the curve; the exact DP sits atτ=1\\tau=1with zero run\-to\-run flips by construction\.

The mean Kendall\-τ\\taurises from0\.500\.50to only0\.850\.85over two decades of budget and stays below the0\.950\.95bar throughout the tested range \(Fig\.[3](https://arxiv.org/html/2607.11956#S5.F3)\); MC is consistent, so it converges, but at a rate that makes the fidelity target impractical\. Across2020replicates per budget per cell,Pr⁡\[τ≥0\.95\]=0\\Pr\[\\tau\\geq 0\.95\]=0over0/8000/800replicate\-runs, a Clopper–Pearson95%95\\%upper bound of0\.00370\.0037\(cell\-level0/400/40gives0\.0720\.072\); no cell reaches the joint fidelity target \(fraction of cells matched=0\.0=0\.0\), even at≈1\.28\\approx 1\.28million utility evaluations\. We thereforedo notreport a numeric budget\-to\-match: no budget we tested \(up to30003000permutations\) matched it\. The instability is the concrete cost\. MC’s top\-kkselection keeps flipping between runs \(about2222flips at the smallest budget, falling only to≈2\.8\\approx 2\.8flips at1\.281\.28M evaluations\), whereas the exact ranking is deterministic \(0flips\)\. Exactness buys a reproducible, auditable ordering of the training set that MC cannot cheaply match; that is the deliverable, consistent with the parity finding in E3 rather than in tension with it\.

TABLE V:E4: the MC price curve \(means over4040cells\)\. “Evals” is mean utility evaluations;τ¯\\bar\{\\tau\}is mean Kendall\-τ\\tauvs\. exact \(2020replicates per budget per cell\);Pr⁡\[τ≥0\.95\]\\Pr\[\\tau\\\!\\geq\\\!0\.95\]is the probability of recovering the exact ranking at Kendall\-τ≥0\.95\\tau\\geq 0\.95; “Flips” is mean top\-kkselection changes between independent runs\. The exact DP is deterministic \(0 flips\) atτ=1\\tau=1\.![Refer to caption](https://arxiv.org/html/2607.11956v1/figs/fig2_mccost.png)Figure 3:E4 MC price curve\. Mean Kendall\-τ\\tauvs\. exact \(left axis\) rises from0\.500\.50to0\.850\.85over two decades and stays below0\.950\.95; mean top\-kkflips per run \(right axis\) fall from≈22\\approx 22to≈2\.8\\approx 2\.8but not to zero\. The exact ranking \(dotted\) is deterministic atτ=1\\tau=1\.
### V\-FE5: Weighted soft\-label extension

We verify the Theorem 4 soft\-label DP two ways\. First, correctness: beyond the5,1125\{,\}112\-instance synthetic\-lattice gate of Theorem 4 \(max deviation1\.5×10−131\.5\\times 10^\{\-13\}\), a further120120real\-geometry instances re\-confirm exact agreement, matching exhaustive enumeration tomax⁡\|DP−brute\|=2\.2×10−15\\max\|\\text\{DP\}\-\\text\{brute\}\|=2\.2\\times 10^\{\-15\}\(floating\-point round\-off\)\. Second, utility on real classification geometry: on a soft\-label mislabel\-detection task the extension attains a55\-seed mean AUC of0\.9360\.936onbreast\_cancer\(range\[0\.809,0\.990\]\[0\.809,0\.990\]\) and0\.9370\.937onwine\(range\[0\.889,0\.985\]\[0\.889,0\.985\]\), against a random baseline of≈0\.50\\approx\\\!0\.50; we present these as a sanity check, not a benchmark, confirming the weighted soft\-label values carry the same detection signal as the regression arm while remaining exactly computable\.

### V\-GReproducibility

All experiments run on a single laptop CPU with no paid compute\. Every driver is seeded and writes resumable sidecar checkpoints, so any table or figure can be regenerated or extended without a full rerun\. The exact DP is validated against an independent exhaustive\-enumeration oracle \(0\-mismatch\), and the FPTAS certificate is checked per value against that oracle\. Data loaders pin public OpenML/scikit\-learn identifiers\[[39](https://arxiv.org/html/2607.11956#bib.bib39),[40](https://arxiv.org/html/2607.11956#bib.bib40)\]; the code, seeds, and thestats\_report\.jsonbacking every reported number are released with the paper and expose a pyDVL\-compatible interface\[[15](https://arxiv.org/html/2607.11956#bib.bib15),[16](https://arxiv.org/html/2607.11956#bib.bib16)\]\.

## VIDiscussion

The results support a single, narrow reading of what KNNR\-SHAP contributes\. It does not win the downstream detection benchmark, and we do not claim that it should \(Section[VII](https://arxiv.org/html/2607.11956#S7)\)\. What it provides is the first*exact*and*certified*Data Shapley computation for a weighted regression model class, together with a quantified account of what that exactness buys over the Monte\-Carlo estimators that practitioners use today\. We discuss the three constituencies this serves\.

### VI\-AExact ground truth for auditing Monte\-Carlo estimators

Data Shapley forkkNN is the estimator that data\-valuation toolkits actually ship: pyDVL exposes a KNN\-Shapley routine and OpenDataVal benchmarks against one, both restricted to the classification \(or unweighted\) case\[[15](https://arxiv.org/html/2607.11956#bib.bib15),[16](https://arxiv.org/html/2607.11956#bib.bib16)\]\. For weighted regression there was, prior to this work, no way to obtain the exact value at all, so a Monte\-Carlo estimate could only ever be compared against another Monte\-Carlo estimate\. Theorem 1 \([1](https://arxiv.org/html/2607.11956#Thmtheorem1)\) removes that circularity: on lattice inputs it returns the deterministic exact values, and the continuous corollary and FPTAS \([2](https://arxiv.org/html/2607.11956#Thmtheorem2)\) extend this to arbitrary weights with a per\-value certificate\.

The practical consequence is measured in E4 \(Fig\.[3](https://arxiv.org/html/2607.11956#S5.F3)\)\. Permutation Monte\-Carlo\[[9](https://arxiv.org/html/2607.11956#bib.bib9),[1](https://arxiv.org/html/2607.11956#bib.bib1)\]using the identical utility function was run at budgets from1010to3,0003\{,\}000permutations per test point across the4040dataset×\\timesseed cells\. At no budget did it reproduce the exact top\-10%10\\%ranking on*any*cell \(fraction of cells matched to Kendall\-τ≥0\.95\\tau\\geq 0\.95and top\-10%10\\%Jaccard≥0\.9\\geq 0\.9was0\.00\.0throughout;0/400/40cells,0/8000/800replicate\-runs, Clopper–Pearson95%95\\%upper bound0\.00370\.0037\)\. The largest budget consumed on average1,284,1951\{,\}284\{,\}195utility evaluations per test point and still left, on average,2\.82\.8of the top\-10%10\\%points flipped relative to the exact ranking; the count falls monotonically from22\.222\.2flips at1010permutations to2\.82\.8at3,0003\{,\}000, but it does not reach zero\. This is the E4 “cost\-to\-match” finding: within1\.28×1061\.28\\times 10^\{6\}utility evaluations per test point, Monte\-Carlo does not reproduce the exact ranking\. The exact values thus function as ground truth against which any sampling\-based valuation pipeline can be calibrated or audited, which is a role no stochastic estimator can fill for itself\.

### VI\-BDeterminism and certification

Two properties distinguish the exact values beyond accuracy\. First,*determinism*: the value of a training point is a function of the data alone, not of a random seed\. In a data market or an audit, a valuation that changes between runs is difficult to defend; the run\-to\-run ranking flips in E4 are a direct measure of that instability at practical budgets\. Second,*certification*: for continuous weights the FPTAS attaches a machine\-checkable boundεi\\varepsilon\_\{i\}to each value with\|φ^i−φi\|≤εi\|\\hat\{\\varphi\}\_\{i\}\-\\varphi\_\{i\}\|\\leq\\varepsilon\_\{i\}\. Over86,40086\{,\}400point checks we observed0certificate violations \(Clopper–Pearson95%95\\%upper bound on the violation rate3\.47×10−53\.47\\times 10^\{\-5\}\), and the realized error ran≈28\\approx 28–44×44\\timesinside the certified maximum\. Wang et al\.\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]discretize weights and report an empirical deviation, but provide no certified bound; to our knowledge the certificate of Theorem 2 is the first for any weightedkkNN Shapley computation\.

### VI\-CWho uses this

The named consumers are concrete\. Maintainers of pyDVL and OpenDataVal gain an exact reference implementation for the regression setting their libraries do not currently cover\[[15](https://arxiv.org/html/2607.11956#bib.bib15),[16](https://arxiv.org/html/2607.11956#bib.bib16)\]\. Benchmarkers gain a ground\-truth oracle for evaluating faster approximate valuators\. Data\-market and data\-pricing engineers, who must attach a defensible and reproducible price to individual regression rows, gain a deterministic, certified value in place of a seed\-dependent estimate\[[5](https://arxiv.org/html/2607.11956#bib.bib5),[6](https://arxiv.org/html/2607.11956#bib.bib6)\]\. In each case the contribution is not a higher number on a detection benchmark but the availability of an exact, auditable quantity where previously only a noisy one existed\.

### VI\-DThe complexity landscape as guidance, not obstruction

Theorem 3 \([3](https://arxiv.org/html/2607.11956#Thmtheorem3)\) is easy to mis\-read as a negative result; we read it as a map of where the exact algorithm’s cost is intrinsic rather than an artifact of our particular construction\. The precision\-driven cost of Theorem 1 is provably necessary: the exact value’s reduced representation can occupyΩ​\(Dw\)\\Omega\(D\_\{w\}\)bits unconditionally \(Theorem 3a\), so no algorithm of any running time can emit it in polynomially many bits, and Theorem 1’s pseudo\-polynomial dependence on the weight precisionDwD\_\{w\}is optimal up to polynomial factors*for algorithms that output the value explicitly*\. The contrast with Deng and Papadimitriou’s \#P\-completeness for weighted majority games\[[22](https://arxiv.org/html/2607.11956#bib.bib22)\]is instructive: there the count sits in the*magnitude*of the value because the utility is a threshold; here the regression utility is a smooth rational kernel of the coalition weight\-sum, so the hard \#P content sits in the arithmetic fine structure of the exact value \(which prime powers divide its denominator\) and not in its magnitude\. That is precisely why coarse approximation is easy while exact arithmetic access is hard, and it is why the FPTAS and the hardness result coexist without tension\.

## VIILimitations

We state the boundaries of the contribution; several are shared by the entire KNN\-Shapley line and one is a scoping of the hardness claim\.

#### Exact computation is practical for small\-to\-moderateKK

The exact DP is fast for theKKvalues that dominate practice but its cost grows steeply inKK\. On the E1 scaling grid \(Fig\.[1](https://arxiv.org/html/2607.11956#S5.F1)\) the wall\-clock time follows an empirical exponent of aboutn2\.45n^\{2\.45\}atK=1K\{=\}1andn2\.55n^\{2\.55\}atK=3K\{=\}3, consistent with the proven complexity; at fixed lattice resolution andn=1000n\{=\}1000, moving fromK=1K\{=\}1toK=3K\{=\}3raises the per\-test cost from4\.94\.9s to242242s, roughly a50×50\\timesincrease, because the reachable joint state count grows withKK\. We therefore recommend the exact DP forKKsmall\-to\-moderate \(sayK≤5K\\leq 5\) andnnon the order of10210^\{2\}to10310^\{3\}per test point, matching the operating range of the prior exact weighted work\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\]\. Continuous weights and largerKKare served by the FPTAS with a coarser lattice, trading the certifiedε\\varepsilonagainst runtime; because the FPTAS is Theorem 1 on a rounded lattice it inherits the same≈N2\.5\\approx\\\!N^\{2\.5\}dependence onNN, so it extends precision and kernel generality rather than the reachableNN\.

#### Values are for the weighted\-kkNN surrogate

Like every result in this line\[[14](https://arxiv.org/html/2607.11956#bib.bib14),[20](https://arxiv.org/html/2607.11956#bib.bib20),[21](https://arxiv.org/html/2607.11956#bib.bib21)\], KNNR\-SHAP values data with respect to a \(lattice\-\)weightedkkNN*surrogate*model rather than the practitioner’s final estimator\. This is the standard framing of KNN\-Shapley and it inherits the standard critique: the surrogate may not be the deployed model\. We defend the framing on two grounds that hold here specifically\. First, the downstream validation of E3 shows the exact values detect corrupted training points about as well as the estimators built on the same surrogate\. Second, and unique to exactness, the values serve as the ground truth against which surrogate\-based approximations are audited \(E4\), a role that does not depend on the surrogate matching the final model\.

#### Detection is at parity, not state of the art

This was pre\-registered as the expected outcome and it is what we observe\. On88regression datasets over55seeds, the exact values reach a mean corrupted\- point detection AUC of0\.9640\.964\(95% CI\[0\.952,0\.977\]\[0\.952,0\.977\]\), statistically indistinguishable from permutation Monte\-Carlo at0\.9650\.965; a paired Wilcoxon test givesp=0\.74p=0\.74and a TOST within a±0\.02\\pm 0\.02AUC band certifies equivalence \(pTOST=1\.6×10−5p\_\{\\mathrm\{TOST\}\}=1\.6\\times 10^\{\-5\}, dataset level,n=8n=8\)\. We do*not*claim detection superiority\. In fact a strong baseline, Data\-OOB\[[11](https://arxiv.org/html/2607.11956#bib.bib11)\], scores higher on this task \(0\.9860\.986mean AUC; exact vs\. OOB paired Wilcoxonp=0\.008p=0\.008\)\. Data\-OOB is itself a stochastic ensemble estimate that provides neither an exact value nor a certificate, so its edge on the detection metric does not substitute for exactness; but we report it in full\. The contribution of this paper is exactness, determinism, certification, and the quantified cost\-to\-match, not a new detection record\. The soft\-label arm \(Theorem 4\) behaves the same way: exact to machine precision against exhaustive enumeration \(maximum deviation1\.5×10−131\.5\\times 10^\{\-13\}over5,1125\{,\}112synthetic\-lattice instances\) with detection AUCs of0\.9360\.936\(breast cancer\) and0\.9370\.937\(wine\) that we present as a sanity check, not as a benchmark result\.

#### The hardness result is scoped to exact\-access models

Theorem 3 must be read with its qualifier attached; the unqualified statement “exact Data Shapley is \#P\-hard” would be an over\-claim in a paper that also supplies a poly\-time FPTAS\. What we prove is: an unconditionalΩ​\(Dw\)\\Omega\(D\_\{w\}\)\-bit output lower bound \(3a\); NP\-hardness of deciding the dyadic precision the exact value requires \(3b, by a deterministic many\-one reduction fromSubset\-Sum\); and \#P\-hardness of exact evaluation under a 2\-adic digit\-access model \(3c, a Turing reduction from \#Subset\-Sum\[[34](https://arxiv.org/html/2607.11956#bib.bib34)\]\)\. These are hardness\-of\-*access*statements, forced by 3a because the raw “compute the exact value” question is vacuous for output\-size reasons\. The natural decision version \(decidingφi≥q\\varphi\_\{i\}\\geq q, equivalently computingφi\\varphi\_\{i\}to*real*additive error2−poly2^\{\-\\mathrm\{poly\}\}\) remainsopen, and we say so; the obstruction is the smooth\-kernel structure noted above, which blocks the reductions we tried in that direction\. We likewise do not claim hardness for the soft\-label setting: the algebra transfers formally, but the empty\-coalition convention differs and we leave that transfer unverified rather than assert it\. The complexity claims are machine\-verified in exact rational arithmetic against the enumeration oracle and have passed an adversarial internal review; the open decision version is stated as such throughout\. Finally, the hardness is established forK=Θ​\(N\)K=\\Theta\(N\); for constantKKthe problem is polynomial\-time \(continuous corollary\), so it does not contradict the small\-KKpractical recommendation\.

## VIIIConclusion

We closed a problem that the KNN\-Shapley literature had twice flagged as open: exact Data Shapley for*weighted*kk\-nearest\-neighbor regression, and its soft\-label extension\. The obstruction identified by prior work \(the coalition\-dependent normalization denominator that turns the utility into a loss of a*ratio*of two sums\) is exactly what breaks the three known polynomial routes \([1](https://arxiv.org/html/2607.11956#Thmlemma1)\), and it is what our joint\(∑w,∑w​y\)\(\\sum w,\\sum wy\)counting DP resolves\. The result is a pseudo\-polynomial exact algorithm \(Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)\), a certified FPTAS for continuous weights and targets \(Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\), a matching complexity landscape that locates the intrinsic cost in the weight precisionDwD\_\{w\}\(Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\), and a soft\-label multi\-class extension \(Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)\)\. All four are verified by0\-mismatch against exhaustive enumeration over12,00012\{,\}000adversarial instances, and the FPTAS certificate held on every one of86,40086\{,\}400checks\.

Empirically the exact values match Monte\-Carlo Data Shapley on downstream corrupted\-point detection \(TOST\-certified equivalence\) while providing what Monte\-Carlo cannot: determinism, a per\-value error certificate, and an exact ground truth\. The E4 cost\-to\-match measurement quantifies the gap concretely: more than a million utility evaluations per test point did not reproduce the exact top\-10%10\\%ranking on any tested cell\. We see two open directions\. The first is the decision\-version complexity question left open by Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(real\-additive\-error hardness ofφi≥q\\varphi\_\{i\}\\geq q\)\. The second is engineering: pushing the exact regime pastK=5K\{=\}5andn∼103n\\sim 10^\{3\}without falling back to the FPTAS, for which the state\-space growth inKKis the operative bottleneck\. The KNNR\-SHAP library is released for integration into pyDVL and OpenDataVal\.

## Appendix AFull Proof of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)

This appendix supplies the complete proof of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1), expanding the proof sketch of Section[IV\-B](https://arxiv.org/html/2607.11956#S4.SS2)\. We keep the notation of Sections[III](https://arxiv.org/html/2607.11956#S3)–[IV\-A](https://arxiv.org/html/2607.11956#S4.SS1)verbatim: training points are indexed1,…,N1,\\dots,Nin increasing distance to the fixed queryx0x\_\{0\}, so indexrris the rank\-rr\(i\.e\.rr\-th nearest\) point, carrying integer lattice datawr=ar​δww\_\{r\}=a\_\{r\}\\delta\_\{w\}\(ar∈ℤ\>0a\_\{r\}\\in\\mathbb\{Z\}\_\{\>0\}\) andyr=br​δyy\_\{r\}=b\_\{r\}\\delta\_\{y\}\(br∈ℤb\_\{r\}\\in\\mathbb\{Z\}\);topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)is the set ofmin⁡\(K,\|S\|\)\\min\(K,\|S\|\)smallest\-rank members ofSS; the prediction isy^​\(S\)=\(∑j∈topK​\(S\)wj​yj\)/\(∑j∈topK​\(S\)wj\)\\hat\{y\}\(S\)=\\big\(\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}y\_\{j\}\\big\)/\\big\(\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\\big\)withy^​\(∅\)=ydef\\hat\{y\}\(\\varnothing\)=y\_\{\\mathrm\{def\}\}; the utility isU​\(S\)=−ℓ​\(y^​\(S\),y0\)U\(S\)=\-\\ell\(\\hat\{y\}\(S\),y\_\{0\}\)withℓ∈\{\(⋅\)2,\|⋅\|\}\\ell\\in\\\{\(\\cdot\)^\{2\},\|\\cdot\|\\\}; and

ϕi=∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)​\(U​\(S∪\{i\}\)−U​\(S\)\),\\phi\_\{i\}=\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}c\_\{N\}\(\|S\|\)\\,\\big\(U\(S\\cup\\\{i\\\}\)\-U\(S\)\\big\),\(12\)wherecN​\(s\)=s\!​\(N−1−s\)\!/N\!c\_\{N\}\(s\)=s\!\\,\(N\-1\-s\)\!/N\!, with the conventioncN​\(s\)=0c\_\{N\}\(s\)=0fors<0s<0ors\>N−1s\>N\-1\(no coalition of that size exists among theN−1N\-1points other thanii\)\. For a setX⊆\[N\]X\\subseteq\[N\]write its two integer aggregates

W​\(X\)=∑j∈Xaj,M​\(X\)=∑j∈Xaj​bj\.W\(X\)=\\sum\_\{j\\in X\}a\_\{j\},\\qquad M\(X\)=\\sum\_\{j\\in X\}a\_\{j\}b\_\{j\}\.\(13\)Throughout, a*rank*is a strict total order: distance ties are broken by the point index, sotopK\\mathrm\{top\}\_\{K\}, and the partition of the other points into those closer and those farther than a given point, are always unambiguous \(cf\. the boundary bookkeeping of §[A\-F](https://arxiv.org/html/2607.11956#A1.SS6)\)\. We treat the marginalΔi​\(S\):=U​\(S∪\{i\}\)−U​\(S\)\\Delta\_\{i\}\(S\):=U\(S\\cup\\\{i\\\}\)\-U\(S\)as the summand of \([12](https://arxiv.org/html/2607.11956#A1.E12)\) and computeϕi\\phi\_\{i\}for one arbitrary but fixed target pointii\.

### A\-AState reduction: the utility is a function of\(W,M\)\(W,M\)alone

###### Lemma 2\(Exact state reduction\)\.

Defineu:ℤ\>0×ℤ→ℝu:\\mathbb\{Z\}\_\{\>0\}\\times\\mathbb\{Z\}\\to\\mathbb\{R\}and the scalaru∅u\_\{\\varnothing\}by

u​\(W,M\)=−ℓ​\(δy​MW,y0\),u∅=−ℓ​\(ydef,y0\)\.u\(W,M\)=\-\\ell\\\!\\Big\(\\delta\_\{y\}\\tfrac\{M\}\{W\},\\,y\_\{0\}\\Big\),\\qquad u\_\{\\varnothing\}=\-\\ell\\big\(y\_\{\\mathrm\{def\}\},\\,y\_\{0\}\\big\)\.\(14\)Then for every coalitionSS,

U​\(S\)=\{u∅,S=∅,u​\(W​\(topK​S\),M​\(topK​S\)\),S≠∅\.U\(S\)=\\begin\{cases\}u\_\{\\varnothing\},&S=\\varnothing,\\\\\[2\.0pt\] u\\big\(W\(\\mathrm\{top\}\_\{K\}S\),\\,M\(\\mathrm\{top\}\_\{K\}S\)\\big\),&S\\neq\\varnothing\.\\end\{cases\}\(15\)In particular, any two nonempty coalitionsS,S′S,S^\{\\prime\}withW​\(topK​S\)=W​\(topK​S′\)W\(\\mathrm\{top\}\_\{K\}S\)=W\(\\mathrm\{top\}\_\{K\}S^\{\\prime\}\)andM​\(topK​S\)=M​\(topK​S′\)M\(\\mathrm\{top\}\_\{K\}S\)=M\(\\mathrm\{top\}\_\{K\}S^\{\\prime\}\)satisfyU​\(S\)=U​\(S′\)U\(S\)=U\(S^\{\\prime\}\), with*zero*arithmetic error, for both the squared and the absolute loss\.

###### Proof\.

FixS≠∅S\\neq\\varnothingand abbreviateτ=topK​\(S\)\\tau=\\mathrm\{top\}\_\{K\}\(S\), which is nonempty\. Usingwj=aj​δww\_\{j\}=a\_\{j\}\\delta\_\{w\}andyj=bj​δyy\_\{j\}=b\_\{j\}\\delta\_\{y\},

y^​\(S\)=∑j∈τwj​yj∑j∈τwj=δw​δy​∑j∈τaj​bjδw​∑j∈τaj=δy​M​\(τ\)W​\(τ\),\\hat\{y\}\(S\)=\\frac\{\\sum\_\{j\\in\\tau\}w\_\{j\}y\_\{j\}\}\{\\sum\_\{j\\in\\tau\}w\_\{j\}\}=\\frac\{\\delta\_\{w\}\\delta\_\{y\}\\sum\_\{j\\in\\tau\}a\_\{j\}b\_\{j\}\}\{\\delta\_\{w\}\\sum\_\{j\\in\\tau\}a\_\{j\}\}=\\delta\_\{y\}\\,\\frac\{M\(\\tau\)\}\{W\(\\tau\)\},\(16\)so the weight scaleδw\\delta\_\{w\}cancels identically\. Because everyaj≥1a\_\{j\}\\geq 1andτ≠∅\\tau\\neq\\varnothing, the denominatorW​\(τ\)=∑j∈τaj≥1\>0W\(\\tau\)=\\sum\_\{j\\in\\tau\}a\_\{j\}\\geq 1\>0, so the right\-hand side of \([16](https://arxiv.org/html/2607.11956#A1.E16)\) is a well\-defined rational number andu​\(W​\(τ\),M​\(τ\)\)=−ℓ​\(y^​\(S\),y0\)=U​\(S\)u\(W\(\\tau\),M\(\\tau\)\)=\-\\ell\(\\hat\{y\}\(S\),y\_\{0\}\)=U\(S\); the empty case is the definitiony^​\(∅\)=ydef\\hat\{y\}\(\\varnothing\)=y\_\{\\mathrm\{def\}\}\. The value in \([16](https://arxiv.org/html/2607.11956#A1.E16)\) depends onτ\\tauonly through the integer pair\(W​\(τ\),M​\(τ\)\)\(W\(\\tau\),M\(\\tau\)\), and integer sums are represented exactly, so equal pairs give the identical rationaly^\\hat\{y\}and hence the identical loss under eitherℓ\\ell\. There is no rounding: the discretization error is0on lattice inputs, which is precisely the claim of Section[IV\-A](https://arxiv.org/html/2607.11956#S4.SS1)\. ∎

Lemma[2](https://arxiv.org/html/2607.11956#Thmlemma2)is the source of all speed: a coalition influences the Shapley sum only through the pair\(W,M\)\(W,M\)of its top\-KKwindow \(plus the flagS=∅S=\\varnothing\), so coalitions may be aggregated by that pair\. Note also that the two losses enter only through the fixed mapuuin \([14](https://arxiv.org/html/2607.11956#A1.E14)\); every step below is written in terms ofuuand therefore proves the squared\- and absolute\-loss cases simultaneously \(§[A\-E](https://arxiv.org/html/2607.11956#A1.SS5)\)\.

### A\-BAn exhaustive, disjoint case split of the marginal

Fix the target pointiiand partition the remaining points by rank relative toii:

L\\displaystyle L=\{1,…,i−1\}\(closer than​i\),\\displaystyle=\\\{1,\\dots,i\-1\\\}\\ \\ \(\\text\{closer than \}i\),\(17\)R\\displaystyle R=\{i\+1,…,N\}\(farther than​i\)\.\\displaystyle=\\\{i\+1,\\dots,N\\\}\\ \\ \(\\text\{farther than \}i\)\.ForS⊆\[N\]∖\{i\}=L∪RS\\subseteq\[N\]\\setminus\\\{i\\\}=L\\cup RwriteA=S∩LA=S\\cap L,B=S∩RB=S\\cap R, anda=\|A\|a=\|A\|\. Every member ofAAis nearer tox0x\_\{0\}thanii, andiiis nearer than every member ofBB\.

###### Lemma 3\(Null marginal when the window is saturated by closer points\)\.

Ifa≥Ka\\geq KthenΔi​\(S\)=0\\Delta\_\{i\}\(S\)=0\.

###### Proof\.

Ifa≥Ka\\geq K, theKKsmallest\-rank members ofSSall lie inAA\(thea≥Ka\\geq Kpoints ofAAare all closer than every point ofBB\), sotopK​\(S\)=topK​\(A\)\\mathrm\{top\}\_\{K\}\(S\)=\\mathrm\{top\}\_\{K\}\(A\)\. Adjoiningiiinserts a point strictly farther than all ofAA; sinceAAalready contributes≥K\\geq Kmembers nearer thanii, pointiiis not among theKKnearest ofS∪\{i\}S\\cup\\\{i\\\}, whencetopK​\(S∪\{i\}\)=topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=\\mathrm\{top\}\_\{K\}\(S\)\. Equal windows give equal utility by Lemma[2](https://arxiv.org/html/2607.11956#Thmlemma2), soΔi​\(S\)=0\\Delta\_\{i\}\(S\)=0\. ∎

By Lemma[3](https://arxiv.org/html/2607.11956#Thmlemma3)only coalitions witha≤K−1a\\leq K\-1contribute, and we split those by total size:

- •NO\-DROP:\|S\|≤K−1\|S\|\\leq K\-1;
- •DROP:\|S\|≥K\|S\|\\geq K\(anda≤K−1a\\leq K\-1\)\.

###### Lemma 4\(The split is exhaustive and disjoint\)\.

EveryS⊆\[N\]∖\{i\}S\\subseteq\[N\]\\setminus\\\{i\\\}lies in exactly one of the three classes\{\|S\|≤K−1\}\\\{\|S\|\\leq K\-1\\\},\{\|S\|≥K,a≤K−1\}\\\{\|S\|\\geq K,\\ a\\leq K\-1\\\},\{\|S\|≥K,a≥K\}\\\{\|S\|\\geq K,\\ a\\geq K\\\}, andΔi​\(S\)=0\\Delta\_\{i\}\(S\)=0on the third\. Consequently

ϕi=∑S:\|S\|≤K−1cN​\(\|S\|\)​Δi​\(S\)⏟NO\-DROP\+∑S:\|S\|≥K,a≤K−1cN​\(\|S\|\)​Δi​\(S\)⏟DROP,\\phi\_\{i\}=\\underbrace\{\\sum\_\{\\begin\{subarray\}\{c\}S:\\ \|S\|\\leq K\-1\\end\{subarray\}\}c\_\{N\}\(\|S\|\)\\,\\Delta\_\{i\}\(S\)\}\_\{\\textup\{NO\-DROP\}\}\\\\ \+\\;\\underbrace\{\\sum\_\{\\begin\{subarray\}\{c\}S:\\ \|S\|\\geq K,\\ a\\leq K\-1\\end\{subarray\}\}c\_\{N\}\(\|S\|\)\\,\\Delta\_\{i\}\(S\)\}\_\{\\textup\{DROP\}\},\(18\)and each coalition is counted in at most one branch\.

###### Proof\.

The three conditions on the pair\(\|S\|,a\)\(\|S\|,a\)are mutually exclusive and their union is\{\(\|S\|,a\):0≤a≤\|S\|≤N−1\}\\\{\(\|S\|,a\):0\\leq a\\leq\|S\|\\leq N\-1\\\}, i\.e\. all admissible coalitions \(the first fixes\|S\|≤K−1\|S\|\\leq K\-1; the remaining\|S\|≥K\|S\|\\geq Kis split bya≤K−1a\\leq K\-1vs\.a≥Ka\\geq K, anda≤\|S\|a\\leq\|S\|always\)\. On the third class Lemma[3](https://arxiv.org/html/2607.11956#Thmlemma3)givesΔi​\(S\)=0\\Delta\_\{i\}\(S\)=0, so dropping it from \([12](https://arxiv.org/html/2607.11956#A1.E12)\) leaves \([18](https://arxiv.org/html/2607.11956#A1.E18)\)\. Since the NO\-DROP and DROP index sets are disjoint \(one has\|S\|≤K−1\|S\|\\leq K\-1, the other\|S\|≥K\|S\|\\geq K\), no coalition is double counted\. ∎

### A\-CThe NO\-DROP branch

###### Lemma 5\(NO\-DROP reduces to a size\-indexed\(W,M\)\(W,M\)\-count\)\.

When\|S\|≤K−1\|S\|\\leq K\-1,

topK​\(S\)=SandtopK​\(S∪\{i\}\)=S∪\{i\},\\mathrm\{top\}\_\{K\}\(S\)=S\\quad\\text\{and\}\\quad\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=S\\cup\\\{i\\\},\(19\)so the marginal depends onSSonly through the pair\(W​\(S\),M​\(S\)\)\(W\(S\),M\(S\)\)and the flagS=∅S=\\varnothing:

Δi​\(S\)=\\displaystyle\\Delta\_\{i\}\(S\)=\{\}u​\(W​\(S\)\+ai,M​\(S\)\+ai​bi\)\\displaystyle u\\big\(W\(S\)\+a\_\{i\},\\,M\(S\)\+a\_\{i\}b\_\{i\}\\big\)\(20\)−\{u∅,S=∅,u​\(W​\(S\),M​\(S\)\),S≠∅\.\\displaystyle\{\}\-Letcnt0​\[s\]​\(W,M\)\\mathrm\{cnt\}\_\{0\}\[s\]\(W,M\)be the number ofss\-subsets of\[N\]∖\{i\}\[N\]\\setminus\\\{i\\\}with aggregatesW​\(⋅\)=WW\(\\cdot\)=W,M​\(⋅\)=MM\(\\cdot\)=M\. Then

NO\-DROP=∑s=0K−1cN​\(s\)​∑\(W,M\)cnt0​\[s\]​\(W,M\)×\(u​\(W\+ai,M\+ai​bi\)−us​\(W,M\)\),\\textup\{NO\-DROP\}=\\sum\_\{s=0\}^\{K\-1\}c\_\{N\}\(s\)\\sum\_\{\(W,M\)\}\\mathrm\{cnt\}\_\{0\}\[s\]\(W,M\)\\\\ \\times\\Big\(u\(W\{\+\}a\_\{i\},M\{\+\}a\_\{i\}b\_\{i\}\)\-u\_\{s\}\(W,M\)\\Big\),\(21\)whereu0​\(W,M\):=u∅u\_\{0\}\(W,M\):=u\_\{\\varnothing\}\(attained only at the unique empty subset,\(W,M\)=\(0,0\)\(W,M\)=\(0,0\)\) andus:=uu\_\{s\}:=ufors≥1s\\geq 1\.

###### Proof\.

If\|S\|≤K−1<K\|S\|\\leq K\-1<Kthenmin⁡\(K,\|S\|\)=\|S\|\\min\(K,\|S\|\)=\|S\|, sotopK​\(S\)=S\\mathrm\{top\}\_\{K\}\(S\)=S; and\|S∪\{i\}\|≤K\|S\\cup\\\{i\\\}\|\\leq K, sotopK​\(S∪\{i\}\)=S∪\{i\}\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=S\\cup\\\{i\\\}, proving \([19](https://arxiv.org/html/2607.11956#A1.E19)\)\. Substituting these windows into \([15](https://arxiv.org/html/2607.11956#A1.E15)\) and usingW​\(S∪\{i\}\)=W​\(S\)\+aiW\(S\\cup\\\{i\\\}\)=W\(S\)\+a\_\{i\},M​\(S∪\{i\}\)=M​\(S\)\+ai​biM\(S\\cup\\\{i\\\}\)=M\(S\)\+a\_\{i\}b\_\{i\}\(asi∉Si\\notin S\) yields \([20](https://arxiv.org/html/2607.11956#A1.E20)\): the marginal is a function of\(W​\(S\),M​\(S\)\)\(W\(S\),M\(S\)\)alone, independent of howSSsplits acrossLLandRRand of the ranks of its members\. Grouping the sum∑\|S\|≤K−1cN​\(\|S\|\)​Δi​\(S\)\\sum\_\{\|S\|\\leq K\-1\}c\_\{N\}\(\|S\|\)\\Delta\_\{i\}\(S\)first bys=\|S\|s=\|S\|and then by the common value\(W​\(S\),M​\(S\)\)\(W\(S\),M\(S\)\)replaces the enumeration of subsets by their multiplicitycnt0​\[s\]​\(W,M\)\\mathrm\{cnt\}\_\{0\}\[s\]\(W,M\), giving \([21](https://arxiv.org/html/2607.11956#A1.E21)\)\. The only empty coalition has\(W,M\)=\(0,0\)\(W,M\)=\(0,0\)ands=0s=0, which is why the subtracted term isu∅u\_\{\\varnothing\}exactly there anduuotherwise\. ∎

The tablecnt0\\mathrm\{cnt\}\_\{0\}is produced by one knapsack\-style counting DP over theN−1N\-1items\{\(ar,ar​br\):r≠i\}\\\{\(a\_\{r\},a\_\{r\}b\_\{r\}\):r\\neq i\\\}, adding one item at a time and, for each current size layers≤K−1s\\leq K\-1, shifting the\(W,M\)\(W,M\)\-histogram by\(ar,ar​br\)\(a\_\{r\},a\_\{r\}b\_\{r\}\); this is the standard0/10/1subset\-sum count carried on the two\-dimensional key\(W,M\)\(W,M\)\(the routine\_add\_pointin the reference implementation\)\.

### A\-DThe DROP branch and the tail\-weight identity

FixSSwith\|S\|≥K\|S\|\\geq Kanda≤K−1a\\leq K\-1\. ThentopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)has exactlyKKmembers: allaapoints ofAA\(each closer than every point ofBB\) together with theK−aK\-asmallest\-rank points ofBB\. Define the*boundary point*

e:=the​\(K−a\)​\-th nearest member of​B,e:=\\text\{the \}\(K\-a\)\\text\{\-th nearest member of \}B,\(22\)i\.e\. the currentKK\-th nearest member ofSS; it is well defined because\|B\|=\|S\|−a≥K−a≥1\|B\|=\|S\|\-a\\geq K\-a\\geq 1, ande∈Re\\in R\. Let

T:=\{j∈B:j<e\}T:=\\\{\\,j\\in B:j<e\\,\\\}\(23\)be theK−a−1K\-a\-1members ofBBnearer thanee\. Adjoiningii\(which is nearer than every member ofBB, hence nearer thaneeand than every point ofTT\) makesiithe\(a\+1\)\(a\{\+\}1\)\-th nearest ofS∪\{i\}S\\cup\\\{i\\\}, witha\+1≤Ka\+1\\leq K, soiienters the window and displaces its previous last memberee:

topK​\(S\)=A∪T∪\{e\},topK​\(S∪\{i\}\)=A∪T∪\{i\}\.\\mathrm\{top\}\_\{K\}\(S\)=A\\cup T\\cup\\\{e\\\},\\qquad\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=A\\cup T\\cup\\\{i\\\}\.\(24\)Both windows haveKKmembers and differ only in the swape↔ie\\leftrightarrow i\. WritingW0=W​\(A∪T\)W\_\{0\}=W\(A\\cup T\),M0=M​\(A∪T\)M\_\{0\}=M\(A\\cup T\)for the shared*window content*, Lemma[2](https://arxiv.org/html/2607.11956#Thmlemma2)gives the marginal

Δi​\(S\)=u​\(W0\+ai,M0\+ai​bi\)−u​\(W0\+ae,M0\+ae​be\),\\Delta\_\{i\}\(S\)=u\\big\(W\_\{0\}\+a\_\{i\},\\,M\_\{0\}\+a\_\{i\}b\_\{i\}\\big\)\-u\\big\(W\_\{0\}\+a\_\{e\},\\,M\_\{0\}\+a\_\{e\}b\_\{e\}\\big\),\(25\)which depends onSSonly through\(W0,M0\)\(W\_\{0\},M\_\{0\}\)and the boundary pointee\.

#### Free farther points\.

The points strictly farther thanee,

Fe:=\{e\+1,…,N\},ge:=\|Fe\|=N−e,F\_\{e\}:=\\\{e\+1,\\dots,N\\\},\\qquad g\_\{e\}:=\|F\_\{e\}\|=N\-e,\(26\)play no role in either window in \([24](https://arxiv.org/html/2607.11956#A1.E24)\): they are farther thanee, and both windows are already filled by theKKpointsA∪T∪\{e\}A\\cup T\\cup\\\{e\\\}resp\.A∪T∪\{i\}A\\cup T\\cup\\\{i\\\}, all of rank≤max⁡\(rank​in​A∪T,e\)<\\leq\\max\(\\mathrm\{rank\}\\text\{ in \}A\\cup T,\\,e\)<any point ofFeF\_\{e\}\. Hence membership of the points ofFeF\_\{e\}inSSchanges neithertopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)nortopK​\(S∪\{i\}\)\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\), and therefore leavesΔi​\(S\)\\Delta\_\{i\}\(S\)in \([25](https://arxiv.org/html/2607.11956#A1.E25)\) unchanged; it changes only\|S\|\|S\|, hence the Shapley coefficientcN​\(\|S\|\)c\_\{N\}\(\|S\|\)\.

###### Lemma 6\(Unique decomposition of DROP coalitions\)\.

The mapS↦\(A,T,e,Z\)S\\mapsto\(A,T,e,Z\)withA=S∩LA=S\\cap L,eethe boundary point \([22](https://arxiv.org/html/2607.11956#A1.E22)\),T=\{j∈S∩R:j<e\}T=\\\{j\\in S\\cap R:j<e\\\}, andZ=S∩FeZ=S\\cap F\_\{e\}is a bijection between the DROP coalitions and the tuples withA⊆LA\\subseteq L,e∈Re\\in R,T⊆\{i\+1,…,e−1\}T\\subseteq\\\{i\+1,\\dots,e\-1\\\}with\|T\|=K−\|A\|−1≥0\|T\|=K\-\|A\|\-1\\geq 0, andZ⊆FeZ\\subseteq F\_\{e\}arbitrary\. Its inverse is

S=A∪T∪\{e\}∪Z\.S=A\\cup T\\cup\\\{e\\\}\\cup Z\.\(27\)

###### Proof\.

Given a DROP coalitionSS, the four parts are determined by the definitions above, and they are pairwise disjoint:A⊆LA\\subseteq L;e∈Re\\in R;TTandZZare the members ofS∩RS\\cap Rnearer thaneeresp\. farther thanee; ande∉T∪Ze\\notin T\\cup Z\. Their union isA∪\(S∩R\)=SA\\cup\(S\\cap R\)=S, giving \([27](https://arxiv.org/html/2607.11956#A1.E27)\)\. The constraints are exactly those listed:\|A\|=a≤K−1\|A\|=a\\leq K\-1,T⊆\{i\+1,…,e−1\}T\\subseteq\\\{i\+1,\\dots,e\-1\\\}\(the members ofRRnearer thanee\) with\|T\|=K−a−1≥0\|T\|=K\-a\-1\\geq 0, andZ⊆FeZ\\subseteq F\_\{e\}unrestricted\. Conversely, any tuple obeying the constraints reconstructs, via \([27](https://arxiv.org/html/2607.11956#A1.E27)\), a coalitionSSwithS∩L=AS\\cap L=A\(soa=\|A\|a=\|A\|\), with the\(K−a\)\(K\-a\)\-th nearest member ofS∩R=T∪\{e\}∪ZS\\cap R=T\\cup\\\{e\\\}\\cup Zequal toee\(itsK−a−1K\-a\-1nearer members are exactlyTT\), and with\|S\|=a\+\(K−a−1\)\+1\+\|Z\|=K\+\|Z\|≥K\|S\|=a\+\(K\-a\-1\)\+1\+\|Z\|=K\+\|Z\|\\geq K; henceSSis a DROP coalition whose associated tuple is the original one\. The two maps are mutual inverses\. ∎

###### Lemma 7\(Tail\-weight closed form\)\.

For a fixed window\(A,T,e\)\(A,T,e\), summing the Shapley coefficient over all admissible completionsZ⊆FeZ\\subseteq F\_\{e\}gives

∑Z⊆FecN​\(\|A∪T∪\{e\}∪Z\|\)=∑Z⊆FecN​\(K\+\|Z\|\)=∑j=0ge\(gej\)cN\(K\+j\)=:TS\(ge\)\.\\sum\_\{Z\\subseteq F\_\{e\}\}c\_\{N\}\\big\(\|A\\cup T\\cup\\\{e\\\}\\cup Z\|\\big\)=\\sum\_\{Z\\subseteq F\_\{e\}\}c\_\{N\}\\big\(K\+\|Z\|\\big\)\\\\ =\\sum\_\{j=0\}^\{g\_\{e\}\}\\binom\{g\_\{e\}\}\{j\}\\,c\_\{N\}\(K\+j\)=:\\mathrm\{TS\}\(g\_\{e\}\)\.\(28\)

###### Proof\.

By Lemma[6](https://arxiv.org/html/2607.11956#Thmlemma6)the coalitions sharing the window\(A,T,e\)\(A,T,e\)are exactly\{A∪T∪\{e\}∪Z:Z⊆Fe\}\\\{A\\cup T\\cup\\\{e\\\}\\cup Z:Z\\subseteq F\_\{e\}\\\}, and each has size\|A\|\+\|T\|\+1\+\|Z\|=a\+\(K−a−1\)\+1\+\|Z\|=K\+\|Z\|\|A\|\+\|T\|\+1\+\|Z\|=a\+\(K\-a\-1\)\+1\+\|Z\|=K\+\|Z\|, independent ofaa\. Grouping the2ge2^\{g\_\{e\}\}subsetsZZby their cardinalityj=\|Z\|j=\|Z\|\(there are\(gej\)\\binom\{g\_\{e\}\}\{j\}of sizejj\) yields the middle and right expressions\. Terms withK\+j\>N−1K\+j\>N\-1vanish under the conventioncN​\(⋅\)=0c\_\{N\}\(\\cdot\)=0there; equivalently, suchZZwould force\|S\|=K\+j\>N−1\|S\|=K\+j\>N\-1, which is impossible forS⊆\[N\]∖\{i\}S\\subseteq\[N\]\\setminus\\\{i\\\}, so these terms are correctly absent\. ThusTS​\(ge\)\\mathrm\{TS\}\(g\_\{e\}\)is exactly the total Shapley weight of all completions of a fixed window, as claimed\. ∎

###### Lemma 8\(Closed form of the DROP branch\)\.

LetcntL​\[a\]​\(W1,M1\)\\mathrm\{cnt\}\_\{L\}\[a\]\(W\_\{1\},M\_\{1\}\)count theaa\-subsets ofLLwith aggregates\(W1,M1\)\(W\_\{1\},M\_\{1\}\), and letcnt<e​\[t\]​\(W2,M2\)\\mathrm\{cnt\}\_\{<e\}\[t\]\(W\_\{2\},M\_\{2\}\)count thett\-subsets of\{i\+1,…,e−1\}\\\{i\+1,\\dots,e\-1\\\}\(the members ofRRnearer thanee\) with aggregates\(W2,M2\)\(W\_\{2\},M\_\{2\}\)\. Then

DROP=∑e∈RTS​\(ge\)​∑a=0K−1∑\(W1,M1\)∑\(W2,M2\)cntL​\[a\]​\(W1,M1\)​cnt<e​\[K−a−1\]​\(W2,M2\)×δi,e​\(W1\+W2,M1\+M2\),\\textup\{DROP\}=\\sum\_\{e\\in R\}\\mathrm\{TS\}\(g\_\{e\}\)\\sum\_\{a=0\}^\{K\-1\}\\sum\_\{\(W\_\{1\},M\_\{1\}\)\}\\sum\_\{\(W\_\{2\},M\_\{2\}\)\}\\\\ \\mathrm\{cnt\}\_\{L\}\[a\]\(W\_\{1\},M\_\{1\}\)\\,\\mathrm\{cnt\}\_\{<e\}\[K\{\-\}a\{\-\}1\]\(W\_\{2\},M\_\{2\}\)\\\\ \\times\\,\\delta\_\{i,e\}\(W\_\{1\}\{\+\}W\_\{2\},\\,M\_\{1\}\{\+\}M\_\{2\}\),\(29\)where, for a window aggregate\(W0,M0\)=\(W1\+W2,M1\+M2\)\(W\_\{0\},M\_\{0\}\)=\(W\_\{1\}\{\+\}W\_\{2\},M\_\{1\}\{\+\}M\_\{2\}\),

δi,e​\(W0,M0\)=u​\(W0\+ai,M0\+ai​bi\)−u​\(W0\+ae,M0\+ae​be\)\.\\delta\_\{i,e\}\(W\_\{0\},M\_\{0\}\)=u\\big\(W\_\{0\}\+a\_\{i\},\\,M\_\{0\}\+a\_\{i\}b\_\{i\}\\big\)\-u\\big\(W\_\{0\}\+a\_\{e\},\\,M\_\{0\}\+a\_\{e\}b\_\{e\}\\big\)\.\(30\)

###### Proof\.

Start from the DROP sum in \([18](https://arxiv.org/html/2607.11956#A1.E18)\) and reindex it by the bijection of Lemma[6](https://arxiv.org/html/2607.11956#Thmlemma6), so each coalition is written asA∪T∪\{e\}∪ZA\\cup T\\cup\\\{e\\\}\\cup Z\. Since the marginal \([25](https://arxiv.org/html/2607.11956#A1.E25)\) is independent ofZZ, factor the sum overZZ: by Lemma[7](https://arxiv.org/html/2607.11956#Thmlemma7)it contributes the constantTS​\(ge\)\\mathrm\{TS\}\(g\_\{e\}\)per window\(A,T,e\)\(A,T,e\)\. It remains to sumΔi​\(S\)=δi,e​\(W​\(A∪T\),M​\(A∪T\)\)\\Delta\_\{i\}\(S\)=\\delta\_\{i,e\}\(W\(A\\cup T\),M\(A\\cup T\)\)over all admissible\(A,T,e\)\(A,T,e\), i\.e\. overe∈Re\\in R,a∈\{0,…,K−1\}a\\in\\\{0,\\dots,K\-1\\\},A⊆LA\\subseteq Lwith\|A\|=a\|A\|=a, andT⊆\{i\+1,…,e−1\}T\\subseteq\\\{i\+1,\\dots,e\-1\\\}with\|T\|=K−a−1\|T\|=K\-a\-1\. BecauseA⊆LA\\subseteq LandT⊆\{i\+1,…,e−1\}T\\subseteq\\\{i\+1,\\dots,e\-1\\\}are disjoint, the window aggregate is additive,W​\(A∪T\)=W​\(A\)\+W​\(T\)W\(A\\cup T\)=W\(A\)\+W\(T\)andM​\(A∪T\)=M​\(A\)\+M​\(T\)M\(A\\cup T\)=M\(A\)\+M\(T\), so groupingAAby\(W1,M1\)=\(W​\(A\),M​\(A\)\)\(W\_\{1\},M\_\{1\}\)=\(W\(A\),M\(A\)\)andTTby\(W2,M2\)=\(W​\(T\),M​\(T\)\)\(W\_\{2\},M\_\{2\}\)=\(W\(T\),M\(T\)\)replaces the enumeration by the multiplicitiescntL​\[a\]\\mathrm\{cnt\}\_\{L\}\[a\]andcnt<e​\[K−a−1\]\\mathrm\{cnt\}\_\{<e\}\[K\{\-\}a\{\-\}1\]and turns the joint sum into the discrete convolution over\(W1,M1\)\+\(W2,M2\)\(W\_\{1\},M\_\{1\}\)\+\(W\_\{2\},M\_\{2\}\)appearing in \([29](https://arxiv.org/html/2607.11956#A1.E29)\); integer aggregates add exactly, so the summed key\(W1\+W2,M1\+M2\)\(W\_\{1\}\{\+\}W\_\{2\},M\_\{1\}\{\+\}M\_\{2\}\)is the exact window aggregate and no state collision loses information\. This is \([29](https://arxiv.org/html/2607.11956#A1.E29)\)\. ∎

Equations \([21](https://arxiv.org/html/2607.11956#A1.E21)\) and \([29](https://arxiv.org/html/2607.11956#A1.E29)\), added per Lemma[4](https://arxiv.org/html/2607.11956#Thmlemma4), computeϕi\\phi\_\{i\}exactly; rangingiiover1,…,N1,\\dots,Nproduces allNNvalues\. This establishes the correctness half of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)\.

### A\-EThe absolute\-loss variant

Nothing above used the form ofℓ\\ell: the state reduction \(Lemma[2](https://arxiv.org/html/2607.11956#Thmlemma2)\) only requires thatU​\(S\)U\(S\)be a function of the window aggregate\(W,M\)\(W,M\)throughy^=δy​M/W\\hat\{y\}=\\delta\_\{y\}M/W, and both losses satisfyU​\(S\)=u​\(W,M\)U\(S\)=u\(W,M\)with the single mapu​\(W,M\)=−ℓ​\(δy​M/W,y0\)u\(W,M\)=\-\\ell\(\\delta\_\{y\}M/W,y\_\{0\}\)of \([14](https://arxiv.org/html/2607.11956#A1.E14)\)\. The case split \(§[A\-B](https://arxiv.org/html/2607.11956#A1.SS2)\), the NO\-DROP identity \(§[A\-C](https://arxiv.org/html/2607.11956#A1.SS3)\), and the DROP decomposition and tail weight \(§[A\-D](https://arxiv.org/html/2607.11956#A1.SS4)\) are all stated in terms ofuuand of window*sets*, never of the loss\. Hence replacingℓ​\(⋅\)=\(⋅\)2\\ell\(\\cdot\)=\(\\cdot\)^\{2\}byℓ\(⋅\)=\|⋅\|\\ell\(\\cdot\)=\|\\cdot\|changes only the numerical valuesu​\(W,M\)=−\|δy​M/W−y0\|u\(W,M\)=\-\|\\delta\_\{y\}M/W\-y\_\{0\}\|plugged into \([21](https://arxiv.org/html/2607.11956#A1.E21)\) and \([30](https://arxiv.org/html/2607.11956#A1.E30)\); the entire combinatorial derivation, and therefore Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1), holds verbatim for the absolute loss\.

### A\-FBoundary bookkeeping

We record the corner cases that the derivation silently assumes\.

*Ties in rank\.*The argument uses only that “rank” is a strict total order on\[N\]\[N\], so thatL,\{i\},RL,\\\{i\\\},Rpartition\[N\]\[N\]and the “\(K−a\)\(K\-a\)\-th nearest member ofBB” in \([22](https://arxiv.org/html/2607.11956#A1.E22)\) is unique\. Equal distances are broken by point index, which yields such a strict order; the result is invariant to the tie\-break rule as long as one fixed strict order is used consistently fortopK\\mathrm\{top\}\_\{K\}throughout\.

*The empty coalition\.*The termS=∅S=\\varnothingoccurs once, in NO\-DROP ats=0s=0, and contributescN​\(0\)​\(u​\(ai,ai​bi\)−u∅\)c\_\{N\}\(0\)\\big\(u\(a\_\{i\},a\_\{i\}b\_\{i\}\)\-u\_\{\\varnothing\}\\big\)withcN​\(0\)=\(N−1\)\!/N\!=1/Nc\_\{N\}\(0\)=\(N\-1\)\!/N\!=1/Nandu∅=−ℓ​\(ydef,y0\)u\_\{\\varnothing\}=\-\\ell\(y\_\{\\mathrm\{def\}\},y\_\{0\}\)\. This is exactly thes=0s=0,\(W,M\)=\(0,0\)\(W,M\)=\(0,0\)entry of \([21](https://arxiv.org/html/2607.11956#A1.E21)\) with theu0=u∅u\_\{0\}=u\_\{\\varnothing\}special case; it is the only place the default predictionydefy\_\{\\mathrm\{def\}\}enters, and it is handled without exception elsewhere because every non\-empty window hasW≥1\>0W\\geq 1\>0\.

*Feasibility guards\.*Ifa\>\|L\|a\>\|L\|orK−a−1\>e−i−1K\-a\-1\>e\-i\-1the corresponding count table is empty and the inner sum vanishes, so infeasible windows contribute0automatically; likewise the null\-marginal regimea≥Ka\\geq Knever appears because both branches rangea≤K−1a\\leq K\-1\(NO\-DROP through\|S\|≤K−1\|S\|\\leq K\-1, DROP explicitly\)\. WhenN<KN<Kno coalition ever reaches sizeKK, DROP is empty, andϕi\\phi\_\{i\}reduces to its NO\-DROP part; the statement holds for everyK≤NK\\leq N\.

*Boundary targety0y\_\{0\}\.*No step constrainsy0y\_\{0\}; the valuey0y\_\{0\}\(includingy0y\_\{0\}equal to someyry\_\{r\}, or to a window prediction\) enters only through the fixed scalarsu​\(W,M\)u\(W,M\)andu∅u\_\{\\varnothing\}, so boundary values ofy0y\_\{0\}require no special handling\.

### A\-GComplexity

LetPPdenote a bound on the number of reachable lattice states in any single size layer\. SinceW=∑jajW=\\sum\_\{j\}a\_\{j\}ranges over\{0,1,…,∑rar\}\\\{0,1,\\dots,\\sum\_\{r\}a\_\{r\}\\\}, at mostDw=1\+∑rarD\_\{w\}=1\+\\sum\_\{r\}a\_\{r\}values, andMMranges over an integer interval of lengthDyD\_\{y\}\(the spread of∑rar​br\\sum\_\{r\}a\_\{r\}b\_\{r\}\), we have

P≤Dw​Dy\.P\\leq D\_\{w\}D\_\{y\}\.\(31\)
#### Time\.

Fix a targetii\.

- •Buildingcnt0\\mathrm\{cnt\}\_\{0\}over theN−1N\-1items, up to sizeK−1K\-1: each item insertion updatesO​\(K\)O\(K\)size layers ofO​\(P\)O\(P\)states, soO​\(N​K​P\)O\(NKP\)\.
- •The NO\-DROP scan \([21](https://arxiv.org/html/2607.11956#A1.E21)\) visitsO​\(K\)O\(K\)layers ofO​\(P\)O\(P\)states:O​\(K​P\)O\(KP\)\.
- •BuildingcntL\\mathrm\{cnt\}\_\{L\}overLL:O​\(\|L\|​K​P\)=O​\(N​K​P\)O\(\|L\|KP\)=O\(NKP\)\.
- •The countscnt<e\\mathrm\{cnt\}\_\{<e\}for all boundarieseeare obtained by a single incremental DP that sweepsRRin ascending rank, admitting one new point per boundary; totalO​\(\|R\|​K​P\)=O​\(N​K​P\)O\(\|R\|KP\)=O\(NKP\)across allee\.
- •The DROP combine \([29](https://arxiv.org/html/2607.11956#A1.E29)\): for each boundaryee\(O​\(N\)O\(N\)of them\) and eacha≤K−1a\\leq K\-1\(O​\(K\)O\(K\)\), it convolves two state tables of sizeO​\(P\)O\(P\), costingO​\(P2\)O\(P^\{2\}\)per pair; totalO​\(N​K​P2\)O\(NKP^\{2\}\)\.

The per\-iicost is dominated by the convolution termO​\(N​K​P2\)O\(NKP^\{2\}\)\. Summing over theNNtarget points gives

O​\(N2​K​P2\)=O​\(N2​K​Dw2​Dy2\),O\\\!\\big\(N^\{2\}KP^\{2\}\\big\)=O\\\!\\big\(N^\{2\}KD\_\{w\}^\{2\}D\_\{y\}^\{2\}\\big\),\(32\)polynomial inNNandKKand pseudo\-polynomial in the lattice sizesDw,DyD\_\{w\},D\_\{y\}, as claimed\. \(The continuous enumeration corollary, which skips the\(W,M\)\(W,M\)\-lattice and instead ranges over theO​\(NK\)O\(N^\{K\}\)possible top\-KKwindows directly, costsO​\(K​NK\+1\)O\(KN^\{K\+1\}\)\(polynomial inNN, exponential inKK\), matching the order of Jia et al\.’s route\.\)

#### Space\.

At any moment the algorithm holds a constant number of size\-indexed count tables \(cnt0\\mathrm\{cnt\}\_\{0\},cntL\\mathrm\{cnt\}\_\{L\}, the runningcnt<e\\mathrm\{cnt\}\_\{<e\}\), each ofO​\(K\)O\(K\)layers overO​\(P\)O\(P\)states, i\.e\.O​\(K​P\)=O​\(K​Dw​Dy\)O\(KP\)=O\(KD\_\{w\}D\_\{y\}\)working memory, plus theO​\(N\)O\(N\)precomputed coefficientscN​\(s\)c\_\{N\}\(s\)and tail weightsTS​\(g\)\\mathrm\{TS\}\(g\)and the output vector\. Retaining per\-boundary snapshots \(a batched variant\) or bounding conservatively gives the reportedO​\(N​K​Dw​Dy\)O\\\!\\big\(NKD\_\{w\}D\_\{y\}\\big\)space\.

### A\-HMachine verification

The algorithm of §§[A\-C](https://arxiv.org/html/2607.11956#A1.SS3)–[A\-D](https://arxiv.org/html/2607.11956#A1.SS4)\(Algorithm[1](https://arxiv.org/html/2607.11956#alg1)\) was validated against an independent exhaustive\-enumeration oracle that evaluates \([12](https://arxiv.org/html/2607.11956#A1.E12)\) directly over all2N−12^\{N\-1\}coalitions, on12,71612\{,\}716random and adversarial instances \(N≤18N\\leq 18,K∈\{1,2,3,4,5,7\}K\\in\\\{1,2,3,4,5,7\\\}, both losses, and including tied ranks and weights, duplicate and negative targets, extreme weight ratios, degenerate all\-equal predictions, the empty\-window default term, and theN<KN<Kregime\)\. Every instance matched with*zero*mismatches; the maximum absolute deviation was2\.3×10−112\.3\\times 10^\{\-11\}, attributable solely to the floating\-point readout of the otherwise exact integer computation of \([16](https://arxiv.org/html/2607.11956#A1.E16)\)\. Instances small enough for the continuous route \(N≤11N\\leq 11,K≤3K\\leq 3\) were additionally cross\-checked against the independent enumeration oracle of the corollary, again with zero mismatches\. The hand instancew=\(2,1,1\)w=\(2,1,1\),y=\(10,0,4\)y=\(10,0,4\),K=2K=2,y0=5y\_\{0\}=5reproduces the closed\-form valueϕ1=40/9\\phi\_\{1\}=40/9to machine precision\. This certifies the correctness argument above\.

## Appendix BFull Derivation of the Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)Certificate

This appendix supplies the complete proof of Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2), expanding the sketch of Section[IV\-C](https://arxiv.org/html/2607.11956#S4.SS3)\. We work in the notation of Section[IV](https://arxiv.org/html/2607.11956#S4): theNNtraining points are fixed in increasing distance to the queryx0x\_\{0\}\(rank11nearest\), each pointrrcarries a strictly positive weightwr\>0w\_\{r\}\>0and a targetyry\_\{r\}, and for a coalitionS⊆\[N\]S\\subseteq\[N\]the settopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)consists of themin⁡\(K,\|S\|\)\\min\(K,\|S\|\)smallest\-rank members ofSS\. The prediction is the ratio \([7](https://arxiv.org/html/2607.11956#S4.E7)\), the utility isU​\(S\)=−ℓ​\(y^​\(S\),y0\)U\(S\)=\-\\ell\(\\hat\{y\}\(S\),y\_\{0\}\), and the Shapley value is \([8](https://arxiv.org/html/2607.11956#S4.E8)\)\.

Given a target toleranceε\>0\\varepsilon\>0, the scheme of Section[IV\-C](https://arxiv.org/html/2607.11956#S4.SS3)selects a lattice resolution\(δw,δy\)\(\\delta\_\{w\},\\delta\_\{y\}\)and rounds each input to

wr′\\displaystyle w^\{\\prime\}\_\{r\}=arδw,ar=max\(⌊wr/δw⌉,1\)∈ℤ\>0,\\displaystyle=a\_\{r\}\\,\\delta\_\{w\},\\quad a\_\{r\}=\\max\\\!\\big\(\\lfloor w\_\{r\}/\\delta\_\{w\}\\rceil,1\\big\)\\in\\mathbb\{Z\}\_\{\>0\},\(33\)yr′\\displaystyle y^\{\\prime\}\_\{r\}=brδy,br=⌊yr/δy⌉∈ℤ,\\displaystyle=b\_\{r\}\\,\\delta\_\{y\},\\quad b\_\{r\}=\\lfloor y\_\{r\}/\\delta\_\{y\}\\rceil\\in\\mathbb\{Z\},where⌊⋅⌉\\lfloor\\cdot\\rceilis rounding to the nearest integer\. It then runs the exact lattice algorithm of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)on\(ar,br\)\(a\_\{r\},b\_\{r\}\), which returnsϕ^i\\hat\{\\phi\}\_\{i\}: the*exact*Shapley value of the rounded instance\(wr′,yr′\)\(w^\{\\prime\}\_\{r\},y^\{\\prime\}\_\{r\}\)\. We prove thatϕ^i\\hat\{\\phi\}\_\{i\}approximates the exact Shapley valueϕi\\phi\_\{i\}of the*true continuous*instance\(wr,yr\)\(w\_\{r\},y\_\{r\}\)to a machine\-checkable additive error, and that the resolution needed to force this error belowε\\varepsilonkeeps the algorithm polynomial in the stated parameters\.

Throughout, a prime denotes a quantity of the rounded instance\. For a fixed coalitionSSwrite the numerator and denominator sums of \([7](https://arxiv.org/html/2607.11956#S4.E7)\) as

𝒩=∑j∈topK​\(S\)wj​yj,𝒟=∑j∈topK​\(S\)wj,y^​\(S\)=𝒩/𝒟,\\mathcal\{N\}=\\\!\\\!\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}\\\!\\\!w\_\{j\}y\_\{j\},\\qquad\\mathcal\{D\}=\\\!\\\!\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}\\\!\\\!w\_\{j\},\\qquad\\hat\{y\}\(S\)=\\mathcal\{N\}/\\mathcal\{D\},\(34\)with𝒩′,𝒟′,y^′​\(S\)\\mathcal\{N\}^\{\\prime\},\\mathcal\{D\}^\{\\prime\},\\hat\{y\}^\{\\prime\}\(S\)the corresponding rounded sums, and setΔ​𝒩=𝒩′−𝒩\\Delta\\mathcal\{N\}=\\mathcal\{N\}^\{\\prime\}\-\\mathcal\{N\},Δ​𝒟=𝒟′−𝒟\\Delta\\mathcal\{D\}=\\mathcal\{D\}^\{\\prime\}\-\\mathcal\{D\},Δ​y^=y^′​\(S\)−y^​\(S\)\\Delta\\hat\{y\}=\\hat\{y\}^\{\\prime\}\(S\)\-\\hat\{y\}\(S\)\. Define the realized rounding errors

ew=maxr⁡\|wr′−wr\|,ey=maxr⁡\|yr′−yr\|,e\_\{w\}=\\max\_\{r\}\|w^\{\\prime\}\_\{r\}\-w\_\{r\}\|,\\qquad e\_\{y\}=\\max\_\{r\}\|y^\{\\prime\}\_\{r\}\-y\_\{r\}\|,\(35\)and the instance constants

wmax\\displaystyle w\_\{\\max\}=maxr⁡max⁡\(wr,wr′\),\\displaystyle=\\max\_\{r\}\\max\(w\_\{r\},w^\{\\prime\}\_\{r\}\),\(36\)yabsmax\\displaystyle y\_\{\\mathrm\{absmax\}\}=maxr⁡max⁡\(\|yr\|,\|yr′\|\),\\displaystyle=\\max\_\{r\}\\max\(\|y\_\{r\}\|,\|y^\{\\prime\}\_\{r\}\|\),Dmin\\displaystyle D\_\{\\min\}=minr⁡min⁡\(wr,wr′\)\>0\.\\displaystyle=\\min\_\{r\}\\min\(w\_\{r\},w^\{\\prime\}\_\{r\}\)\>0\.The rounded and true minima agree up to a factor22: with no clip active,wr′≥wr−δw/2≥wr/2w^\{\\prime\}\_\{r\}\\geq w\_\{r\}\-\\delta\_\{w\}/2\\geq w\_\{r\}/2, sominr⁡wr′≥12​minr⁡wr\\min\_\{r\}w^\{\\prime\}\_\{r\}\\geq\\tfrac\{1\}\{2\}\\min\_\{r\}w\_\{r\}; the runtime’s\(∑rwr\)/Dmin\(\\sum\_\{r\}w\_\{r\}\)/D\_\{\\min\}factor is thus the same order under either convention\. Becausear≥1a\_\{r\}\\geq 1andbrb\_\{r\}round to the nearest integer, and becausechoose\_scalescapsδw≤minr⁡wr\\delta\_\{w\}\\leq\\min\_\{r\}w\_\{r\}so that the clip in \([33](https://arxiv.org/html/2607.11956#A2.E33)\) is never active \(eachwr/δw≥1w\_\{r\}/\\delta\_\{w\}\\geq 1already rounds to an integer≥1\\geq 1\), the errors are the exact nearest\-rounding half\-steps

ew≤δw/2,ey≤δy/2\.e\_\{w\}\\leq\\delta\_\{w\}/2,\\qquad e\_\{y\}\\leq\\delta\_\{y\}/2\.\(37\)The certificate below uses the*realized*ew,eye\_\{w\},e\_\{y\}\(which are known numbers, no larger than the half\-steps\), so it is both valid and tighter than the worst case\.

### B\-ARounding fixes the top\-KKmembership

###### Lemma 9\.

For every coalitionS⊆\[N\]S\\subseteq\[N\]the rounded and true predictions average over the*same*index set:topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)computed from\(wr′,yr′\)\(w^\{\\prime\}\_\{r\},y^\{\\prime\}\_\{r\}\)equalstopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)computed from\(wr,yr\)\(w\_\{r\},y\_\{r\}\)\.

###### Proof\.

By definition \(Section[IV](https://arxiv.org/html/2607.11956#S4)\)topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)is the set of themin⁡\(K,\|S\|\)\\min\(K,\|S\|\)*smallest\-rank*members ofSS\. The rank of a point is fixed by its distance tox0x\_\{0\}, which is a property of the geometry alone and does not depend on the kernel weight or the target; ties in distance are broken by the fixed index\. Rounding \([33](https://arxiv.org/html/2607.11956#A2.E33)\) alters only the numerical valueswr↦wr′w\_\{r\}\\mapsto w^\{\\prime\}\_\{r\}andyr↦yr′y\_\{r\}\\mapsto y^\{\\prime\}\_\{r\}, never the distances or the ranks\. Hence the ordered membership oftopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)is identical for the two instances\. ∎

Lemma[9](https://arxiv.org/html/2607.11956#Thmlemma9)is the structural fact that makes a certificate possible: for weighted\-kkNN*regression*the selection of neighbours is a comparison problem in the distances and is decoupled from the weight*values*being rounded\. Consequently, for eachSSthe sums𝒩,𝒟\\mathcal\{N\},\\mathcal\{D\}and𝒩′,𝒟′\\mathcal\{N\}^\{\\prime\},\\mathcal\{D\}^\{\\prime\}range over one common setJ:=topK​\(S\)J:=\\mathrm\{top\}\_\{K\}\(S\)with\|J\|=min⁡\(K,\|S\|\)≤K\|J\|=\\min\(K,\|S\|\)\\leq K, and the perturbation is a term\-by\-term comparison overJJ\. \(ForS=∅S=\\varnothingboth predictions equalydefy\_\{\\mathrm\{def\}\}, soΔ​y^=0\\Delta\\hat\{y\}=0and that coalition contributes nothing to any error; all bounds below therefore concern nonemptyJJ\.\)

### B\-BFirst\-order perturbation of numerator and denominator

###### Lemma 10\.

For every coalition with member setJ=topK​\(S\)J=\\mathrm\{top\}\_\{K\}\(S\),\|J\|≤K\|J\|\\leq K,

\|Δ​𝒩\|\\displaystyle\|\\Delta\\mathcal\{N\}\|≤K​\(yabsmax​ew\+wmax​ey\+ew​ey\),\\displaystyle\\;\\leq\\;K\\big\(y\_\{\\mathrm\{absmax\}\}\\,e\_\{w\}\+w\_\{\\max\}\\,e\_\{y\}\+e\_\{w\}e\_\{y\}\\big\),\(38\)\|Δ​𝒟\|\\displaystyle\|\\Delta\\mathcal\{D\}\|≤K​ew\.\\displaystyle\\;\\leq\\;K\\,e\_\{w\}\.

###### Proof\.

By Lemma[9](https://arxiv.org/html/2607.11956#Thmlemma9)both instances sum over the sameJJ\. For a singlej∈Jj\\in Jwritewj′=wj\+ηjw^\{\\prime\}\_\{j\}=w\_\{j\}\+\\eta\_\{j\},yj′=yj\+θjy^\{\\prime\}\_\{j\}=y\_\{j\}\+\\theta\_\{j\}with\|ηj\|≤ew\|\\eta\_\{j\}\|\\leq e\_\{w\},\|θj\|≤ey\|\\theta\_\{j\}\|\\leq e\_\{y\}\. Then

wj′​yj′−wj​yj=\(wj\+ηj\)​\(yj\+θj\)−wj​yj=wj​θj\+yj​ηj\+ηj​θj,w^\{\\prime\}\_\{j\}y^\{\\prime\}\_\{j\}\-w\_\{j\}y\_\{j\}=\(w\_\{j\}\+\\eta\_\{j\}\)\(y\_\{j\}\+\\theta\_\{j\}\)\-w\_\{j\}y\_\{j\}=w\_\{j\}\\theta\_\{j\}\+y\_\{j\}\\eta\_\{j\}\+\\eta\_\{j\}\\theta\_\{j\},\(39\)so, using\|wj\|≤wmax\|w\_\{j\}\|\\leq w\_\{\\max\}and\|yj\|≤yabsmax\|y\_\{j\}\|\\leq y\_\{\\mathrm\{absmax\}\},

\|wj′​yj′−wj​yj\|≤wmax​ey\+yabsmax​ew\+ew​ey\.\|w^\{\\prime\}\_\{j\}y^\{\\prime\}\_\{j\}\-w\_\{j\}y\_\{j\}\|\\leq w\_\{\\max\}e\_\{y\}\+y\_\{\\mathrm\{absmax\}\}e\_\{w\}\+e\_\{w\}e\_\{y\}\.\(40\)Summing the identityΔ​𝒩=∑j∈J\(wj′​yj′−wj​yj\)\\Delta\\mathcal\{N\}=\\sum\_\{j\\in J\}\(w^\{\\prime\}\_\{j\}y^\{\\prime\}\_\{j\}\-w\_\{j\}y\_\{j\}\)over the\|J\|≤K\|J\|\\leq Kmembers gives the first inequality\. LikewiseΔ​𝒟=∑j∈Jηj\\Delta\\mathcal\{D\}=\\sum\_\{j\\in J\}\\eta\_\{j\}with\|ηj\|≤ew\|\\eta\_\{j\}\|\\leq e\_\{w\}yields\|Δ​𝒟\|≤K​ew\|\\Delta\\mathcal\{D\}\|\\leq Ke\_\{w\}\. ∎

### B\-CError of the ratio

###### Lemma 11\.

For every nonempty coalition,

\|Δ​y^\|\\displaystyle\|\\Delta\\hat\{y\}\|=\|𝒩′𝒟′−𝒩𝒟\|≤\|Δ​𝒩\|\+\|y^​\(S\)\|​\|Δ​𝒟\|Dmin\\displaystyle=\\Big\|\\tfrac\{\\mathcal\{N\}^\{\\prime\}\}\{\\mathcal\{D\}^\{\\prime\}\}\-\\tfrac\{\\mathcal\{N\}\}\{\\mathcal\{D\}\}\\Big\|\\;\\leq\\;\\frac\{\|\\Delta\\mathcal\{N\}\|\+\|\\hat\{y\}\(S\)\|\\,\|\\Delta\\mathcal\{D\}\|\}\{D\_\{\\min\}\}\(41\)≤\|Δ​𝒩\|\+yabsmax​\|Δ​𝒟\|Dmin=:mdp\.\\displaystyle\\;\\leq\\;\\frac\{\|\\Delta\\mathcal\{N\}\|\+y\_\{\\mathrm\{absmax\}\}\\,\|\\Delta\\mathcal\{D\}\|\}\{D\_\{\\min\}\}\\;=:\\;\\mathrm\{mdp\}\.

###### Proof\.

Put the two ratios over a common denominator\. The exact algebra is

𝒩′​𝒟−𝒩​𝒟′=\(𝒩\+Δ​𝒩\)​𝒟−𝒩​\(𝒟\+Δ​𝒟\)=Δ​𝒩​𝒟−𝒩​Δ​𝒟,\\mathcal\{N\}^\{\\prime\}\\mathcal\{D\}\-\\mathcal\{N\}\\mathcal\{D\}^\{\\prime\}=\(\\mathcal\{N\}\+\\Delta\\mathcal\{N\}\)\\mathcal\{D\}\-\\mathcal\{N\}\(\\mathcal\{D\}\+\\Delta\\mathcal\{D\}\)=\\Delta\\mathcal\{N\}\\,\\mathcal\{D\}\-\\mathcal\{N\}\\,\\Delta\\mathcal\{D\},\(42\)hence

Δ​y^\\displaystyle\\Delta\\hat\{y\}=𝒩′𝒟′−𝒩𝒟=𝒩′​𝒟−𝒩​𝒟′𝒟​𝒟′\\displaystyle=\\frac\{\\mathcal\{N\}^\{\\prime\}\}\{\\mathcal\{D\}^\{\\prime\}\}\-\\frac\{\\mathcal\{N\}\}\{\\mathcal\{D\}\}=\\frac\{\\mathcal\{N\}^\{\\prime\}\\mathcal\{D\}\-\\mathcal\{N\}\\mathcal\{D\}^\{\\prime\}\}\{\\mathcal\{D\}\\,\\mathcal\{D\}^\{\\prime\}\}\(43\)=Δ​𝒩​𝒟−𝒩​Δ​𝒟𝒟​𝒟′=Δ​𝒩𝒟′−𝒩𝒟⋅Δ​𝒟𝒟′\.\\displaystyle=\\frac\{\\Delta\\mathcal\{N\}\\,\\mathcal\{D\}\-\\mathcal\{N\}\\,\\Delta\\mathcal\{D\}\}\{\\mathcal\{D\}\\,\\mathcal\{D\}^\{\\prime\}\}=\\frac\{\\Delta\\mathcal\{N\}\}\{\\mathcal\{D\}^\{\\prime\}\}\-\\frac\{\\mathcal\{N\}\}\{\\mathcal\{D\}\}\\cdot\\frac\{\\Delta\\mathcal\{D\}\}\{\\mathcal\{D\}^\{\\prime\}\}\.Recognizing𝒩/𝒟=y^​\(S\)\\mathcal\{N\}/\\mathcal\{D\}=\\hat\{y\}\(S\)and taking absolute values,

\|Δ​y^\|≤\|Δ​𝒩\|\+\|y^​\(S\)\|​\|Δ​𝒟\|𝒟′\.\|\\Delta\\hat\{y\}\|\\leq\\frac\{\|\\Delta\\mathcal\{N\}\|\+\|\\hat\{y\}\(S\)\|\\,\|\\Delta\\mathcal\{D\}\|\}\{\\mathcal\{D\}^\{\\prime\}\}\.\(44\)Every nonemptytopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)contains at least one point, so both𝒟=∑j∈Jwj≥minr⁡wr\\mathcal\{D\}=\\sum\_\{j\\in J\}w\_\{j\}\\geq\\min\_\{r\}w\_\{r\}and𝒟′=∑j∈Jwj′≥minr⁡wr′\\mathcal\{D\}^\{\\prime\}=\\sum\_\{j\\in J\}w^\{\\prime\}\_\{j\}\\geq\\min\_\{r\}w^\{\\prime\}\_\{r\}are at least the smallest single weight; by \([36](https://arxiv.org/html/2607.11956#A2.E36)\),𝒟′≥Dmin\>0\\mathcal\{D\}^\{\\prime\}\\geq D\_\{\\min\}\>0, which gives the first inequality of \([41](https://arxiv.org/html/2607.11956#A2.E41)\)\. Finallyy^​\(S\)\\hat\{y\}\(S\)is a convex combination \(weightswj/𝒟≥0w\_\{j\}/\\mathcal\{D\}\\geq 0summing to11\) of the member targetsyjy\_\{j\}, so\|y^​\(S\)\|≤maxj∈J⁡\|yj\|≤yabsmax\|\\hat\{y\}\(S\)\|\\leq\\max\_\{j\\in J\}\|y\_\{j\}\|\\leq y\_\{\\mathrm\{absmax\}\}, giving the second inequality and the definition ofmdp\\mathrm\{mdp\}\. ∎

The quantitymdp\\mathrm\{mdp\}\(“maxΔ\\Deltaprediction”\) is a single instance constant: substituting \([38](https://arxiv.org/html/2607.11956#A2.E38)\) into \([41](https://arxiv.org/html/2607.11956#A2.E41)\),

mdp\\displaystyle\\mathrm\{mdp\}≤K​\(yabsmax​ew\+wmax​ey\+ew​ey\)\+yabsmax​K​ewDmin\\displaystyle\\;\\leq\\;\\frac\{K\\big\(y\_\{\\mathrm\{absmax\}\}e\_\{w\}\+w\_\{\\max\}e\_\{y\}\+e\_\{w\}e\_\{y\}\\big\)\+y\_\{\\mathrm\{absmax\}\}\\,Ke\_\{w\}\}\{D\_\{\\min\}\}\(45\)=K​\(2​yabsmax​ew\+wmax​ey\+ew​ey\)Dmin,\\displaystyle=\\frac\{K\\big\(2\\,y\_\{\\mathrm\{absmax\}\}e\_\{w\}\+w\_\{\\max\}e\_\{y\}\+e\_\{w\}e\_\{y\}\\big\)\}\{D\_\{\\min\}\},and by Lemma[9](https://arxiv.org/html/2607.11956#Thmlemma9)it bounds\|Δ​y^\|\|\\Delta\\hat\{y\}\|for*every*coalitionSSsimultaneously, i\.e\.maxS⁡\|Δ​y^\|≤mdp\\max\_\{S\}\|\\Delta\\hat\{y\}\|\\leq\\mathrm\{mdp\}\.

### B\-DLipschitz utility and the marginal

LetB=yabsmax\+\|y0\|B=y\_\{\\mathrm\{absmax\}\}\+\|y\_\{0\}\|\. Sincey^​\(S\)\\hat\{y\}\(S\)andy^′​\(S\)\\hat\{y\}^\{\\prime\}\(S\)are convex combinations of member targets, both lie in\[−yabsmax,yabsmax\]⊆\[−B,B\]\[\-y\_\{\\mathrm\{absmax\}\},y\_\{\\mathrm\{absmax\}\}\]\\subseteq\[\-B,B\], andydefy\_\{\\mathrm\{def\}\}is a fixed constant common to both instances\.

###### Lemma 12\.

For the squared lossℓ​\(y^,y0\)=\(y^−y0\)2\\ell\(\\hat\{y\},y\_\{0\}\)=\(\\hat\{y\}\-y\_\{0\}\)^\{2\}, for every coalition

\|Δ​U​\(S\)\|:=\|U′​\(S\)−U​\(S\)\|≤2​B​\|Δ​y^\|≤2​B​mdp,\|\\Delta U\(S\)\|:=\|U^\{\\prime\}\(S\)\-U\(S\)\|\\leq 2B\\,\|\\Delta\\hat\{y\}\|\\leq 2B\\,\\mathrm\{mdp\},\(46\)whereU′​\(S\)=−ℓ​\(y^′​\(S\),y0\)U^\{\\prime\}\(S\)=\-\\ell\(\\hat\{y\}^\{\\prime\}\(S\),y\_\{0\}\)\. For the absolute lossℓ​\(y^,y0\)=\|y^−y0\|\\ell\(\\hat\{y\},y\_\{0\}\)=\|\\hat\{y\}\-y\_\{0\}\|,\|Δ​U​\(S\)\|≤\|Δ​y^\|≤mdp\|\\Delta U\(S\)\|\\leq\|\\Delta\\hat\{y\}\|\\leq\\mathrm\{mdp\}\.

###### Proof\.

For a query pointt↦\(t−y0\)2t\\mapsto\(t\-y\_\{0\}\)^\{2\}ont∈\[−B,B\]t\\in\[\-B,B\]the derivative is2​\(t−y0\)2\(t\-y\_\{0\}\), and\|t−y0\|≤\|t\|\+\|y0\|≤yabsmax\+\|y0\|=B\|t\-y\_\{0\}\|\\leq\|t\|\+\|y\_\{0\}\|\\leq y\_\{\\mathrm\{absmax\}\}\+\|y\_\{0\}\|=B, so the map is2​B2B\-Lipschitz there\. Asy^​\(S\),y^′​\(S\)∈\[−B,B\]\\hat\{y\}\(S\),\\hat\{y\}^\{\\prime\}\(S\)\\in\[\-B,B\],

\|U′​\(S\)−U​\(S\)\|\\displaystyle\|U^\{\\prime\}\(S\)\-U\(S\)\|=\|\(y^′​\(S\)−y0\)2−\(y^​\(S\)−y0\)2\|\\displaystyle=\\big\|\(\\hat\{y\}^\{\\prime\}\(S\)\-y\_\{0\}\)^\{2\}\-\(\\hat\{y\}\(S\)\-y\_\{0\}\)^\{2\}\\big\|\(47\)≤2​B​\|y^′​\(S\)−y^​\(S\)\|=2​B​\|Δ​y^\|\.\\displaystyle\\leq 2B\\,\|\\hat\{y\}^\{\\prime\}\(S\)\-\\hat\{y\}\(S\)\|=2B\|\\Delta\\hat\{y\}\|\.The absolute\-loss case follows from\|\|u\|−\|v\|\|≤\|u−v\|\\big\|\|u\|\-\|v\|\\big\|\\leq\|u\-v\|withu=y^′​\(S\)−y0u=\\hat\{y\}^\{\\prime\}\(S\)\-y\_\{0\},v=y^​\(S\)−y0v=\\hat\{y\}\(S\)\-y\_\{0\}\. The final inequality in each case is\|Δ​y^\|≤mdp\|\\Delta\\hat\{y\}\|\\leq\\mathrm\{mdp\}from Lemma[11](https://arxiv.org/html/2607.11956#Thmlemma11)\. ∎

The marginal contribution ofiito a coalitionS⊆\[N\]∖\{i\}S\\subseteq\[N\]\\setminus\\\{i\\\}isΔi​\(S\)=U​\(S∪\{i\}\)−U​\(S\)\\Delta\_\{i\}\(S\)=U\(S\\cup\\\{i\\\}\)\-U\(S\)in the true instance andΔ^i​\(S\)=U′​\(S∪\{i\}\)−U′​\(S\)\\hat\{\\Delta\}\_\{i\}\(S\)=U^\{\\prime\}\(S\\cup\\\{i\\\}\)\-U^\{\\prime\}\(S\)in the rounded one\. Their discrepancy is controlled by two applications of Lemma[12](https://arxiv.org/html/2607.11956#Thmlemma12):

\|Δ^i​\(S\)−Δi​\(S\)\|\\displaystyle\\big\|\\hat\{\\Delta\}\_\{i\}\(S\)\-\\Delta\_\{i\}\(S\)\\big\|=\|\[U′​\(S∪i\)−U​\(S∪i\)\]−\[U′​\(S\)−U​\(S\)\]\|\\displaystyle=\\big\|\[U^\{\\prime\}\(S\{\\cup\}i\)\-U\(S\{\\cup\}i\)\]\-\[U^\{\\prime\}\(S\)\-U\(S\)\]\\big\|\(48\)≤\|Δ​U​\(S∪i\)\|\+\|Δ​U​\(S\)\|\\displaystyle\\leq\|\\Delta U\(S\{\\cup\}i\)\|\+\|\\Delta U\(S\)\|≤2⋅2​B​mdp=4​B​mdp\.\\displaystyle\\leq 2\\cdot 2B\\,\\mathrm\{mdp\}=4B\\,\\mathrm\{mdp\}\.

### B\-EShapley is a convex combination: the per\-value certificate

###### Lemma 13\.

The Shapley coefficients form a probability distribution over the subsetsS⊆\[N\]∖\{i\}S\\subseteq\[N\]\\setminus\\\{i\\\}:

cN​\(\|S\|\)≥0and∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)=1\.c\_\{N\}\(\|S\|\)\\geq 0\\quad\\text\{and\}\\quad\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}c\_\{N\}\(\|S\|\)=1\.\(49\)

###### Proof\.

Non\-negativity is immediate fromcN​\(s\)=s\!​\(N−1−s\)\!/N\!≥0c\_\{N\}\(s\)=s\!\\,\(N\-1\-s\)\!/N\!\\geq 0\. There are\(N−1s\)\\binom\{N\-1\}\{s\}subsets of\[N\]∖\{i\}\[N\]\\setminus\\\{i\\\}of sizess, andssranges over0,…,N−10,\\dots,N\-1, so

∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)\\displaystyle\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}c\_\{N\}\(\|S\|\)=∑s=0N−1\(N−1s\)​s\!​\(N−1−s\)\!N\!\\displaystyle=\\sum\_\{s=0\}^\{N\-1\}\\binom\{N\-1\}\{s\}\\,\\frac\{s\!\\,\(N\-1\-s\)\!\}\{N\!\}\(50\)=∑s=0N−1\(N−1\)\!s\!​\(N−1−s\)\!⋅s\!​\(N−1−s\)\!N\!\\displaystyle=\\sum\_\{s=0\}^\{N\-1\}\\frac\{\(N\-1\)\!\}\{s\!\\,\(N\-1\-s\)\!\}\\cdot\\frac\{s\!\\,\(N\-1\-s\)\!\}\{N\!\}=∑s=0N−11N=1\.\\displaystyle=\\sum\_\{s=0\}^\{N\-1\}\\frac\{1\}\{N\}=1\.∎

###### Proposition 1\(Per\-value certificate\)\.

Letϕ^i\\hat\{\\phi\}\_\{i\}be the exact Shapley value of the rounded instance andϕi\\phi\_\{i\}that of the true instance\. Then for everyii,

\|ϕ^i−ϕi\|≤4Bmdp=:εi\(squared loss\),\|\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}\|\\;\\leq\\;4B\\,\\mathrm\{mdp\}\\;=:\\;\\varepsilon\_\{i\}\\qquad\(\\text\{squared loss\}\),\(51\)and\|ϕ^i−ϕi\|≤2​mdp\|\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}\|\\leq 2\\,\\mathrm\{mdp\}for the absolute loss\.

###### Proof\.

Writing both Shapley values with the same coefficients \([8](https://arxiv.org/html/2607.11956#S4.E8)\),

ϕ^i−ϕi=∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)​\(Δ^i​\(S\)−Δi​\(S\)\)\.\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}=\\\!\\\!\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}\\\!\\\!c\_\{N\}\(\|S\|\)\\,\\big\(\\hat\{\\Delta\}\_\{i\}\(S\)\-\\Delta\_\{i\}\(S\)\\big\)\.\(52\)By the triangle inequality, the non\-negativity and normalization of Lemma[13](https://arxiv.org/html/2607.11956#Thmlemma13), and the uniform marginal bound \([48](https://arxiv.org/html/2607.11956#A2.E48)\),

\|ϕ^i−ϕi\|\\displaystyle\|\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}\|≤∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)​\|Δ^i​\(S\)−Δi​\(S\)\|\\displaystyle\\leq\\\!\\\!\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}\\\!\\\!c\_\{N\}\(\|S\|\)\\,\\big\|\\hat\{\\Delta\}\_\{i\}\(S\)\-\\Delta\_\{i\}\(S\)\\big\|\(53\)≤\(∑ScN​\(\|S\|\)\)⋅maxS⁡\|Δ^i​\(S\)−Δi​\(S\)\|\\displaystyle\\leq\\Big\(\\\!\\\!\\sum\_\{S\}\\\!c\_\{N\}\(\|S\|\)\\Big\)\\cdot\\max\_\{S\}\\big\|\\hat\{\\Delta\}\_\{i\}\(S\)\-\\Delta\_\{i\}\(S\)\\big\|≤1⋅4​B​mdp\.\\displaystyle\\leq 1\\cdot 4B\\,\\mathrm\{mdp\}\.Thusϕi\\phi\_\{i\}is a convex average of marginals whose per\-coalition error never exceeds4​B​mdp4B\\,\\mathrm\{mdp\}, so the average inherits that bound\. The absolute\-loss constant2​mdp2\\,\\mathrm\{mdp\}follows identically from the second half of Lemma[12](https://arxiv.org/html/2607.11956#Thmlemma12)\(marginal error≤2​mdp\\leq 2\\,\\mathrm\{mdp\}\)\. ∎

Every quantity inεi=4​B​mdp\\varepsilon\_\{i\}=4B\\,\\mathrm\{mdp\}\(ew,ey,wmax,yabsmax,Dmin,B,Ke\_\{w\},e\_\{y\},w\_\{\\max\},y\_\{\\mathrm\{absmax\}\},D\_\{\\min\},B,K\) is computed directly from the inputs and the chosen scales after rounding, soεi\\varepsilon\_\{i\}is a*machine\-checkable*number attached to each returned value; this is the certificateεi\\varepsilon\_\{i\}of Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\. Becausemdp\\mathrm\{mdp\}is an instance constant, the bound is uniform inii; it is reported per point so that each value carries its own guaranteed error\.

### B\-FLattice resolution and the FPTAS runtime

It remains to show that forcingmaxi⁡εi≤ε\\max\_\{i\}\\varepsilon\_\{i\}\\leq\\varepsilonrequires only a polynomial lattice\.choose\_scalesbalances the two resolutions so that the weight\- and target\-rounding contributions toΔ​𝒩\\Delta\\mathcal\{N\}are comparable, taking

δy=δw​yabsmaxwmax\.\\delta\_\{y\}=\\delta\_\{w\}\\,\\frac\{y\_\{\\mathrm\{absmax\}\}\}\{w\_\{\\max\}\}\.\(54\)Substituting the half\-steps \([37](https://arxiv.org/html/2607.11956#A2.E37)\) and \([54](https://arxiv.org/html/2607.11956#A2.E54)\) into \([45](https://arxiv.org/html/2607.11956#A2.E45)\),

mdp\\displaystyle\\mathrm\{mdp\}≤KDmin​\(2​yabsmax​δw2\+wmax​δy2\+δw​δy4\)\\displaystyle\\leq\\frac\{K\}\{D\_\{\\min\}\}\\Big\(2y\_\{\\mathrm\{absmax\}\}\\tfrac\{\\delta\_\{w\}\}\{2\}\+w\_\{\\max\}\\tfrac\{\\delta\_\{y\}\}\{2\}\+\\tfrac\{\\delta\_\{w\}\\delta\_\{y\}\}\{4\}\\Big\)\(55\)=KDmin​\(32​yabsmax​δw\+yabsmax4​wmax​δw2⏟second order\)\\displaystyle=\\frac\{K\}\{D\_\{\\min\}\}\\Big\(\\tfrac\{3\}\{2\}\\,y\_\{\\mathrm\{absmax\}\}\\,\\delta\_\{w\}\+\\underbrace\{\\tfrac\{y\_\{\\mathrm\{absmax\}\}\}\{4w\_\{\\max\}\}\\delta\_\{w\}^\{2\}\}\_\{\\text\{second order\}\}\\Big\)=3​K​yabsmax2​Dmin​δw\+O​\(δw2\),\\displaystyle=\\frac\{3K\\,y\_\{\\mathrm\{absmax\}\}\}\{2D\_\{\\min\}\}\\,\\delta\_\{w\}\+O\(\\delta\_\{w\}^\{2\}\),so, usingεi=4​B​mdp\\varepsilon\_\{i\}=4B\\,\\mathrm\{mdp\}, the certificate is linear inδw\\delta\_\{w\}to leading order:εi≤6​B​K​yabsmaxDmin​δw\+O​\(δw2\)\\varepsilon\_\{i\}\\leq\\dfrac\{6\\,B\\,K\\,y\_\{\\mathrm\{absmax\}\}\}\{D\_\{\\min\}\}\\,\\delta\_\{w\}\+O\(\\delta\_\{w\}^\{2\}\)\. Hence it suffices to take

δw=Θ​\(ε​DminB​K​yabsmax\)\\delta\_\{w\}=\\Theta\\\!\\Big\(\\frac\{\\varepsilon\\,D\_\{\\min\}\}\{B\\,K\\,y\_\{\\mathrm\{absmax\}\}\}\\Big\)\(56\)\(theO​\(δw2\)O\(\\delta\_\{w\}^\{2\}\)term only tightens the bound, and the geometric halving ofchoose\_scalescertifiably drivesεi\\varepsilon\_\{i\}below any target inO​\(log⁡\(1/ε\)\)O\(\\log\(1/\\varepsilon\)\)steps\)\. The lattice range required by Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)is then, sincear=⌊wr/δw⌉≤wr/δw\+12a\_\{r\}=\\lfloor w\_\{r\}/\\delta\_\{w\}\\rceil\\leq w\_\{r\}/\\delta\_\{w\}\+\\tfrac\{1\}\{2\}and no clip is active,

Dw=1\+∑r=1Nar\\displaystyle D\_\{w\}=1\+\\sum\_\{r=1\}^\{N\}a\_\{r\}≤1\+N2\+∑rwrδw=O​\(∑rwrδw\)\\displaystyle\\leq 1\+\\frac\{N\}\{2\}\+\\frac\{\\sum\_\{r\}w\_\{r\}\}\{\\delta\_\{w\}\}=O\\\!\\Big\(\\frac\{\\sum\_\{r\}w\_\{r\}\}\{\\delta\_\{w\}\}\\Big\)\(57\)=O​\(\(∑rwr\)​K​B​yabsmaxε​Dmin\)\.\\displaystyle=O\\\!\\Big\(\\frac\{\(\\sum\_\{r\}w\_\{r\}\)\\,K\\,B\\,y\_\{\\mathrm\{absmax\}\}\}\{\\varepsilon\\,D\_\{\\min\}\}\\Big\)\.The target scaleyabsmax≤By\_\{\\mathrm\{absmax\}\}\\leq Bis a fixed magnitude constant of the instance; folding it into the output magnitudeBBgives the compact form of Section[IV\-C](https://arxiv.org/html/2607.11956#S4.SS3),

Dw=O​\(\(∑rwr\)​K​B2ε​Dmin\),D\_\{w\}=O\\\!\\Big\(\\frac\{\(\\sum\_\{r\}w\_\{r\}\)\\,K\\,B^\{2\}\}\{\\varepsilon\\,D\_\{\\min\}\}\\Big\),\(58\)and either wayDwD\_\{w\}is polynomial inN,K,1/εN,K,1/\\varepsilon, the weight ratio\(∑rwr\)/Dmin\(\\sum\_\{r\}w\_\{r\}\)/D\_\{\\min\}, and the magnitudeBB\. The target\-lattice spread obeys the same scaling: by \([33](https://arxiv.org/html/2607.11956#A2.E33)\) and \([54](https://arxiv.org/html/2607.11956#A2.E54)\),\|br\|≤yabsmax/δy\+12=wmax/δw\+12\|b\_\{r\}\|\\leq y\_\{\\mathrm\{absmax\}\}/\\delta\_\{y\}\+\\tfrac\{1\}\{2\}=w\_\{\\max\}/\\delta\_\{w\}\+\\tfrac\{1\}\{2\}, soDyD\_\{y\}\(the spread ofM=∑topKar​brM=\\sum\_\{\\mathrm\{top\}\_\{K\}\}a\_\{r\}b\_\{r\}over≤K\\leq Ktracked members\) isO​\(K​maxr⁡\|ar\|​maxr⁡\|br\|\)=poly​\(1/δw\)O\\\!\\big\(K\\max\_\{r\}\|a\_\{r\}\|\\max\_\{r\}\|b\_\{r\}\|\\big\)=\\mathrm\{poly\}\(1/\\delta\_\{w\}\), polynomial in the same parameters\.

FeedingDw,DyD\_\{w\},D\_\{y\}into the exact complexityO​\(N2​K​Dw2​Dy2\)O\(N^\{2\}KD\_\{w\}^\{2\}D\_\{y\}^\{2\}\)of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1), the total running time is

O​\(N2​K​Dw2​Dy2\)=poly​\(N,K,1ε,∑rwrDmin,B\),O\\\!\\big\(N^\{2\}\\,K\\,D\_\{w\}^\{2\}\\,D\_\{y\}^\{2\}\\big\)=\\mathrm\{poly\}\\\!\\Big\(N,\\;K,\\;\\tfrac\{1\}\{\\varepsilon\},\\;\\tfrac\{\\sum\_\{r\}w\_\{r\}\}\{D\_\{\\min\}\},\\;B\\Big\),\(59\)never exponential in1/ε1/\\varepsilon\. This establishes Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\.

#### Scope\.

The construction is a genuine FPTAS precisely for kernel families whose weight ratio\(∑rwr\)/Dmin\(\\sum\_\{r\}w\_\{r\}\)/D\_\{\\min\}is polynomially bounded, so thatDwD\_\{w\}above is polynomial\. This is exactly the conditionDmin\>0D\_\{\\min\}\>0with a controlled weight spread, i\.e\. a kernel that is*bounded below*\. Two standard families qualify on a bounded domain: the Gaussian kernelw=exp⁡\(−d2/h\)\>0w=\\exp\(\-d^\{2\}/h\)\>0, and the clipped inverse\-distance kernelw=min⁡\(1/\(d\+δ\),wcap\)w=\\min\(1/\(d\+\\delta\),w\_\{\\mathrm\{cap\}\}\)withδ\>0\\delta\>0; for both,wmax/Dminw\_\{\\max\}/D\_\{\\min\}is bounded and\(∑rwr\)/Dmin≤N​wmax/Dmin=O​\(N\)\(\\sum\_\{r\}w\_\{r\}\)/D\_\{\\min\}\\leq N\\,w\_\{\\max\}/D\_\{\\min\}=O\(N\)\. The only degeneracy is plain inverse\-distance1/d1/d, which is unbounded on coincident points \(Dmin→0D\_\{\\min\}\\to 0\) and is excluded by the clip; this is the pre\-registered scope stated in the body\.

### B\-GMachine verification

The certificate was validated as reported in Section[IV\-C](https://arxiv.org/html/2607.11956#S4.SS3): across86,40086\{,\}400point\-level checks on real\-data geometry with a bounded\-below kernel at tolerancesε∈\{0\.1,0\.01,0\.001\}\\varepsilon\\in\\\{0\.1,0\.01,0\.001\\\}, the realized error\|ϕ^i−ϕi\|\|\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}\|\(measured against the continuous ground\-truth oracle of the Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)corollary\) never exceeded its certificateεi\\varepsilon\_\{i\}:0violations, a Clopper–Pearson95%95\\%upper bound of3\.47×10−53\.47\\times 10^\{\-5\}on the violation rate\. The certificate is conservative but not vacuous \(a realized\-to\-certified margin of≈28\\approx 28–44×44\\timesacross the three tolerances\), consistent with the term\-by\-term slack in Lemmas[10](https://arxiv.org/html/2607.11956#Thmlemma10)–[11](https://arxiv.org/html/2607.11956#Thmlemma11)and the worst\-case marginal bound \([48](https://arxiv.org/html/2607.11956#A2.E48)\)\. This confirms the guarantee\|ϕ^i−ϕi\|≤εi\|\\hat\{\\phi\}\_\{i\}\-\\phi\_\{i\}\|\\leq\\varepsilon\_\{i\}withmaxi⁡εi≤ε\\max\_\{i\}\\varepsilon\_\{i\}\\leq\\varepsilonof Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)\.

## Appendix CFull Proofs for Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)

This appendix proves parts \(a\), \(b\), \(c\) of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)in full, together with the auxiliary lemmas they use: the gadget family and its three basic lemmas \(Appendix[C\-B](https://arxiv.org/html/2607.11956#A3.SS2)\), the unconditional output\-size bound \(Appendix[C\-C](https://arxiv.org/html/2607.11956#A3.SS3)\), the NP\-hardness of the precision decision \(Appendix[C\-D](https://arxiv.org/html/2607.11956#A3.SS4)\), a self\-contained parsimonious reduction establishing the \#P\-completeness of \#Subset\-Sum\(Appendix[C\-E](https://arxiv.org/html/2607.11956#A3.SS5)\), the \#P\-hardness of22\-adic digit access \(Appendix[C\-F](https://arxiv.org/html/2607.11956#A3.SS6)\), and the extension fromK=NK=Nto theK=Θ​\(N\)K=\\Theta\(N\)regime \(Appendix[C\-G](https://arxiv.org/html/2607.11956#A3.SS7)\)\. Appendix[C\-H](https://arxiv.org/html/2607.11956#A3.SS8)states precisely which steps are machine\-verified byexperiments/verify\_theorem3\.py, and Appendix[C\-I](https://arxiv.org/html/2607.11956#A3.SS9)states precisely what remains open\. The proofs are self\-contained given the body and do*not*rely on the machine checks; the checks certify that every algebraic step below is implemented\-as\-proved in exact rational arithmetic\.

### C\-AConventions

All hardness instances below are lattice instances at unit scale,δw=δy=1\\delta\_\{w\}=\\delta\_\{y\}=1: weightswr=ar∈ℤ\>0w\_\{r\}=a\_\{r\}\\in\\mathbb\{Z\}\_\{\>0\}given in binary, targetsyr=br∈ℤy\_\{r\}=b\_\{r\}\\in\\mathbb\{Z\}, squared lossℓ=\(⋅\)2\\ell=\(\\cdot\)^\{2\}, and rationaly0,ydefy\_\{0\},y\_\{\\mathrm\{def\}\}\. \(Scales are without loss of generality:δw\\delta\_\{w\}cancels in the ratio \([3](https://arxiv.org/html/2607.11956#S3.E3)\), and our gadgets use targets in\{0,1\}\\\{0,1\\\}, soδy=1\\delta\_\{y\}=1suffices\.\) The input length isΘ​\(∑rlog⁡ar\)=O​\(N​log⁡Dw\)\\Theta\(\\sum\_\{r\}\\log a\_\{r\}\)=O\(N\\log D\_\{w\}\)bits, whileDw=1\+∑rarD\_\{w\}=1\+\\sum\_\{r\}a\_\{r\}itself may be2Θ​\(input length\)2^\{\\Theta\(\\text\{input length\}\)\}; this gap between the encoding length andDwD\_\{w\}is exactly what parts \(a\)–\(c\) interrogate\.

For a primeppand a nonzero rationalx=a/bx=a/b,valp⁡\(x\)=valp⁡\(a\)−valp⁡\(b\)\\operatorname\{val\}\_\{p\}\(x\)=\\operatorname\{val\}\_\{p\}\(a\)\-\\operatorname\{val\}\_\{p\}\(b\)denotes thepp\-adic valuation; “denominator” always means the denominatordenom⁡\(x\)\\operatorname\{denom\}\(x\)of the fraction in lowest terms, and for nonzeroxx,

valp⁡\(denom⁡\(x\)\)=max⁡\(0,−valp⁡\(x\)\)\.\\operatorname\{val\}\_\{p\}\\\!\\big\(\\operatorname\{denom\}\(x\)\\big\)=\\max\\big\(0,\\,\-\\operatorname\{val\}\_\{p\}\(x\)\\big\)\.\(60\)We use two standard ultrametric facts: for nonzero rationalsx1,…,xkx\_\{1\},\\dots,x\_\{k\},

valp⁡\(∑jxj\)≥minj⁡valp⁡\(xj\),\\operatorname\{val\}\_\{p\}\\Big\(\\sum\_\{j\}x\_\{j\}\\Big\)\\;\\geq\\;\\min\_\{j\}\\operatorname\{val\}\_\{p\}\(x\_\{j\}\),\(61\)with equality if the minimum is attained by exactly onejj\(“ultrametric strictness” refers to the equality case\)\.

A remark on the shape of the statements\. Part \(a\) shows that the exact valueϕi\\phi\_\{i\}can occupy exponentially many bits in reduced form, so the raw statement “computeϕi\\phi\_\{i\}exactly in polynomial time” is vacuously impossible for output\-size reasons, and any non\-vacuous hardness claim must fix an*access model*for the exact value\. Parts \(b\) and \(c\) prove hardness in the two natural access models \(predicting the precision the value requires; modular/digit access to the value\); the threshold/real\-approximation decision version is open \(Appendix[C\-I](https://arxiv.org/html/2607.11956#A3.SS9)\)\.

### C\-BThe gadget family and its basic lemmas

#### The familyG​\(a,T;m,v\)G\(a,T;m,v\)\.

Given positive integersa1,…,ana\_\{1\},\\dots,a\_\{n\}\(“items”\), a targetTTwith1≤T≤A:=∑j=1naj1\\leq T\\leq A:=\\sum\_\{j=1\}^\{n\}a\_\{j\}, a dummy countm≥0m\\geq 0, and a special weightv∈ℤ\>0v\\in\\mathbb\{Z\}\_\{\>0\}, the instanceG​\(a,T;m,v\)G\(a,T;m,v\)hasN′=n\+m\+1N^\{\\prime\}=n\+m\+1training points:

- •*items*j=1,…,nj=1,\\dots,n: weightaja\_\{j\}, targetbj=0b\_\{j\}=0;
- •*dummies*d=1,…,md=1,\\dots,m: weightQ:=A\+T\+1Q:=A\+T\+1, target0;
- •the*special point*ii: weightvv, targetbi=1b\_\{i\}=1;

withy0=ydef=0y\_\{0\}=y\_\{\\mathrm\{def\}\}=0, squared loss, andK=N′K=N^\{\\prime\}unless stated otherwise \(Appendix[C\-G](https://arxiv.org/html/2607.11956#A3.SS7)treatsK<N′K<N^\{\\prime\}; atK=N′K=N^\{\\prime\}the distance ranks are irrelevant\)\. WriteP=\[N′\]P=\[N^\{\\prime\}\]for the point set and, forS⊆P∖\{i\}S\\subseteq P\\setminus\\\{i\\\},W​\(S\)=∑j∈SwjW\(S\)=\\sum\_\{j\\in S\}w\_\{j\}; sinceK=N′K=N^\{\\prime\}this agrees with the body’s aggregateWWovertopK\\mathrm\{top\}\_\{K\}\. Let

n​\(s,W\):=\#​\{S⊆P∖\{i\}:\|S\|=s,W​\(S\)=W\}\.n\(s,W\)\\;:=\\;\\\#\\\{\\,S\\subseteq P\\setminus\\\{i\\\}\\ :\\ \|S\|=s,\\ W\(S\)=W\\,\\\}\.\(62\)
###### Lemma 14\(Gadget value\)\.

InG​\(a,T;m,v\)G\(a,T;m,v\)withK=N′K=N^\{\\prime\},

ϕi\\displaystyle\\phi\_\{i\}=−v2​∑S⊆P∖\{i\}cN′​\(\|S\|\)​1\(v\+W​\(S\)\)2\\displaystyle\\;=\\;\-\\,v^\{2\}\\\!\\\!\\sum\_\{S\\subseteq P\\setminus\\\{i\\\}\}\\\!\\\!c\_\{N^\{\\prime\}\}\(\|S\|\)\\,\\frac\{1\}\{\\big\(v\+W\(S\)\\big\)^\{2\}\}\(63\)=−v2N′\!​∑s=0N′−1∑Ws\!​\(N′−1−s\)\!​n​\(s,W\)\(v\+W\)2\.\\displaystyle\\;=\\;\-\\,\\frac\{v^\{2\}\}\{N^\{\\prime\}\!\}\\sum\_\{s=0\}^\{N^\{\\prime\}\-1\}\\ \\sum\_\{W\}s\!\\,\(N^\{\\prime\}\-1\-s\)\!\\ \\frac\{n\(s,W\)\}\{\(v\+W\)^\{2\}\}\.

###### Proof\.

ForS∌iS\\not\\ni i: ifS=∅S=\\varnothingtheny^​\(S\)=ydef=0\\hat\{y\}\(S\)=y\_\{\\mathrm\{def\}\}=0; otherwisetopK​\(S\)=S\\mathrm\{top\}\_\{K\}\(S\)=S\(asK=N′K=N^\{\\prime\}\) and, since every non\-iitarget is0,y^​\(S\)=0/W​\(S\)=0\\hat\{y\}\(S\)=0/W\(S\)=0\. In either caseU​\(S\)=−\(y^​\(S\)−y0\)2=0U\(S\)=\-\\big\(\\hat\{y\}\(S\)\-y\_\{0\}\\big\)^\{2\}=0\. ForS∪\{i\}S\\cup\\\{i\\\}:K=N′K=N^\{\\prime\}means every present point is in the window, soy^​\(S∪\{i\}\)=v⋅1/\(v\+W​\(S\)\)\\hat\{y\}\(S\\cup\\\{i\\\}\)=v\\cdot 1/\\big\(v\+W\(S\)\\big\), a formula that is also correct atS=∅S=\\varnothing\(where it givesy^​\(\{i\}\)=1\\hat\{y\}\(\\\{i\\\}\)=1\)\. Hence

U​\(S∪\{i\}\)−U​\(S\)=−v2\(v\+W​\(S\)\)2for every​S⊆P∖\{i\},U\(S\\cup\\\{i\\\}\)\-U\(S\)\\;=\\;\-\\,\\frac\{v^\{2\}\}\{\(v\+W\(S\)\)^\{2\}\}\\qquad\\text\{for every \}S\\subseteq P\\setminus\\\{i\\\},and inserting this into the Shapley sum \([5](https://arxiv.org/html/2607.11956#S3.E5)\) \(withN′N^\{\\prime\}in place ofNN\) and grouping coalitions by the pair\(\|S\|,W​\(S\)\)\(\|S\|,W\(S\)\)gives \([63](https://arxiv.org/html/2607.11956#A3.E63)\)\. Note that the empty coalition is covered by the same formula becauseydef=y0=0y\_\{\\mathrm\{def\}\}=y\_\{0\}=0; no convention adjustment is needed\. \(Under a differentU​\(∅\)U\(\\varnothing\)convention theS=∅S=\\varnothingterm shifts by the known constantcN′​\(0\)​U​\(∅\)c\_\{N^\{\\prime\}\}\(0\)\\,U\(\\varnothing\), which the reductions below can subtract; nothing else changes\.\) ∎

###### Lemma 15\(Odd\-target normalization\)\.

ForSubset\-Sumand \#Subset\-Sumone may assume the target is odd: given\(a1,…,an;T\)\(a\_\{1\},\\dots,a\_\{n\};T\)with1≤T≤A1\\leq T\\leq A, seta0′:=1a^\{\\prime\}\_\{0\}:=1,aj′:=2​aja^\{\\prime\}\_\{j\}:=2a\_\{j\}\(j=1,…,n\)\(j=1,\\dots,n\),T′:=2​T\+1T^\{\\prime\}:=2T\+1\. ThenS′↦S′∖\{0\}S^\{\\prime\}\\mapsto S^\{\\prime\}\\setminus\\\{0\\\}is a bijection from the subsets of the new instance summing toT′T^\{\\prime\}onto the subsets of the original instance summing toTT, and it decreases every solution’s cardinality by exactly11\. In particular1≤T′≤A′:=2​A\+11\\leq T^\{\\prime\}\\leq A^\{\\prime\}:=2A\+1, decision and size\-stratified solution counts transfer with an index shift of\+1\+1, and the total count is preserved exactly\.

###### Proof\.

Everyaj′a^\{\\prime\}\_\{j\}withj≥1j\\geq 1is even anda0′=1a^\{\\prime\}\_\{0\}=1is the only odd number, so a subset of the new instance has odd sum iff it contains item0\. SinceT′T^\{\\prime\}is odd, any solutionS′S^\{\\prime\}contains item0, and∑j∈S′∖\{0\}2​aj=2​T\\sum\_\{j\\in S^\{\\prime\}\\setminus\\\{0\\\}\}2a\_\{j\}=2T, i\.e\. the original items indexed byS′∖\{0\}S^\{\\prime\}\\setminus\\\{0\\\}sum toTT\. Conversely each original solutionSSyields the solution\{0\}∪\{2​aj:j∈S\}\\\{0\\\}\\cup\\\{2a\_\{j\}:j\\in S\\\}; the two maps are mutually inverse, and\|S′\|=\|S\|\+1\|S^\{\\prime\}\|=\|S\|\+1\. FinallyT≥1T\\geq 1givesT′≥3≥1T^\{\\prime\}\\geq 3\\geq 1andT≤AT\\leq AgivesT′≤2​A\+1=A′T^\{\\prime\}\\leq 2A\+1=A^\{\\prime\}\. ∎

###### Lemma 16\(Dummy inertness\)\.

InG​\(a,T;m,v\)G\(a,T;m,v\), a coalitionS⊆P∖\{i\}S\\subseteq P\\setminus\\\{i\\\}hasW​\(S\)=TW\(S\)=TiffSScontains no dummy and its items sum toTT\. Consequentlyn​\(s,T\)n\(s,T\)equals the number of size\-ss*item*subsets summing toTT\(the same quantity for everymm\) andn​\(s,T\)=0n\(s,T\)=0fors\>ns\>n\.

###### Proof\.

Item sums lie in\[0,A\]\[0,A\]andT≤AT\\leq A; any dummy contributesQ=A\+T\+1\>TQ=A\+T\+1\>T, so a dummy\-containing coalition hasW​\(S\)≥Q\>TW\(S\)\\geq Q\>T\. HenceW​\(S\)=TW\(S\)=TforcesSSto be dummy\-free, and thenW​\(S\)W\(S\)is an item sum\. The count of suchSSof sizessdoes not involve the dummies at all, so it is independent ofmm, and it vanishes fors\>ns\>nsince there are onlynnitems\. ∎

### C\-CTheorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(a\): unconditional output\-size lower bound

###### Lemma 17\(Precise form of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(a\)\)\.

For everyn≥3n\\geq 3, the gadget instanceInI\_\{n\}with itemsaj=2j−1a\_\{j\}=2^\{\\,j\-1\}\(j=1,…,n\)\(j=1,\\dots,n\), no dummies \(m=0m=0; the targetTTplays no role\), andv=1v=1\(i\.e\.N=n\+1N=n\+1points, weights\{20,…,2n−1,1\}\\\{2^\{0\},\\dots,2^\{n\-1\},1\\\}, targetsbj=0b\_\{j\}=0for the items andbi=1b\_\{i\}=1,y0=ydef=0y\_\{0\}=y\_\{\\mathrm\{def\}\}=0,K=NK=N, encoded inO​\(n2\)O\(n^\{2\}\)bits\) satisfies: for*every*primep∈\(2n−1,2n\]p\\in\(2^\{n\-1\},2^\{n\}\],p2p^\{2\}divides the reduced denominator ofϕi\\phi\_\{i\}exactly \(i\.e\.valp⁡\(ϕi\)=−2\\operatorname\{val\}\_\{p\}\(\\phi\_\{i\}\)=\-2\)\. Consequently there are absolute constantsc\>0c\>0andn0n\_\{0\}\(one may takec=12c=\\tfrac\{1\}\{2\},n0=18n\_\{0\}=18\) such that for alln≥n0n\\geq n\_\{0\}the reduced denominator ofϕi\\phi\_\{i\}has bit\-length at leastc⋅2n=Ω​\(Dw\)c\\cdot 2^\{n\}=\\Omega\(D\_\{w\}\), whileDw=2n\+1D\_\{w\}=2^\{n\}\+1andDy=O​\(1\)D\_\{y\}=O\(1\)\.

###### Proof\.

By Lemma[14](https://arxiv.org/html/2607.11956#Thmlemma14)withm=0m=0,v=1v=1,N′=N=n\+1N^\{\\prime\}=N=n\+1,

ϕi=−∑S⊆\[N\]∖\{i\}cN​\(\|S\|\)\(1\+W​\(S\)\)2\.\\phi\_\{i\}\\;=\\;\-\\sum\_\{S\\subseteq\[N\]\\setminus\\\{i\\\}\}\\frac\{c\_\{N\}\(\|S\|\)\}\{\\big\(1\+W\(S\)\\big\)^\{2\}\}\.\(64\)Since the item weights are20,…,2n−12^\{0\},\\dots,2^\{n\-1\}, the mapS↦W​\(S\)S\\mapsto W\(S\)is a*bijection*from the2n2^\{n\}item subsets onto\{0,1,…,2n−1\}\\\{0,1,\\dots,2^\{n\}\-1\\\}\(binary representation\), so the values1\+W​\(S\)1\+W\(S\)run bijectively over\{1,…,2n\}\\\{1,\\dots,2^\{n\}\\\}and every summand in \([64](https://arxiv.org/html/2607.11956#A3.E64)\) is nonzero\.

Fix any primep∈\(2n−1,2n\]p\\in\(2^\{n\-1\},2^\{n\}\]\(one exists for everyn≥1n\\geq 1by Bertrand’s postulate\)\. Then:

- •exactly one coalitionSpS\_\{p\}has1\+W​\(Sp\)=p1\+W\(S\_\{p\}\)=p\(the binary representation ofp−1p\-1\), and no coalition has1\+W​\(S\)1\+W\(S\)equal to a higher multiple ofpp, because1\+W​\(S\)≤2n<2​p1\+W\(S\)\\leq 2^\{n\}<2p;
- •valp⁡\(cN​\(s\)\)=0\\operatorname\{val\}\_\{p\}\\big\(c\_\{N\}\(s\)\\big\)=0for everyss: indeedcN​\(s\)=s\!​\(n−s\)\!/\(n\+1\)\!c\_\{N\}\(s\)=s\!\\,\(n\-s\)\!/\(n\+1\)\!and every factor appearing in these factorials is at mostn\+1≤2n−1<pn\+1\\leq 2^\{n\-1\}<p\(the inequalityn\+1≤2n−1n\+1\\leq 2^\{n\-1\}holds for alln≥3n\\geq 3\)\.

Hence theSpS\_\{p\}summand of \([64](https://arxiv.org/html/2607.11956#A3.E64)\) hasvalp=−2\\operatorname\{val\}\_\{p\}=\-2and every other summand hasvalp=0\\operatorname\{val\}\_\{p\}=0\. By ultrametric strictness \([61](https://arxiv.org/html/2607.11956#A3.E61)\),valp⁡\(ϕi\)=−2\\operatorname\{val\}\_\{p\}\(\\phi\_\{i\}\)=\-2, i\.e\.p2p^\{2\}divides the reduced denominator ofϕi\\phi\_\{i\}exactly, by \([60](https://arxiv.org/html/2607.11956#A3.E60)\)\.

Distinct primes contribute coprime factors, sodenom⁡\(ϕi\)≥∏p∈\(2n−1,2n\]p2\\operatorname\{denom\}\(\\phi\_\{i\}\)\\ \\geq\\prod\_\{p\\in\(2^\{n\-1\},2^\{n\}\]\}p^\{2\}and its bit\-length is at least

2​∑p∈\(2n−1,2n\]log2⁡p≥2​\(n−1\)⋅\(π​\(2n\)−π​\(2n−1\)\)\.2\\\!\\\!\\sum\_\{p\\in\(2^\{n\-1\},2^\{n\}\]\}\\\!\\\!\\log\_\{2\}p\\;\\geq\\;2\\,\(n\-1\)\\cdot\\big\(\\pi\(2^\{n\}\)\-\\pi\(2^\{n\-1\}\)\\big\)\.Explicit Chebyshev\-type bounds \(Rosser and Schoenfeld,*Illinois J\. Math\.*6, 1962:π​\(x\)≥x/ln⁡x\\pi\(x\)\\geq x/\\ln xforx≥17x\\geq 17andπ​\(x\)≤1\.25506​x/ln⁡x\\pi\(x\)\\leq 1\.25506\\,x/\\ln xforx\>1x\>1\) give, for alln≥18n\\geq 18,

π​\(2n\)−π​\(2n−1\)\\displaystyle\\pi\(2^\{n\}\)\-\\pi\(2^\{n\-1\}\)≥2nn​ln⁡2−1\.25506⋅2n−1\(n−1\)​ln⁡2\\displaystyle\\;\\geq\\;\\frac\{2^\{n\}\}\{n\\ln 2\}\-\\frac\{1\.25506\\cdot 2^\{n\-1\}\}\{\(n\-1\)\\ln 2\}=2nn​ln⁡2​\(1−0\.62753​nn−1\)\\displaystyle\\;=\\;\\frac\{2^\{n\}\}\{n\\ln 2\}\\Big\(1\-62753\\,\\tfrac\{n\}\{n\-1\}\\Big\)≥2n3​n,\\displaystyle\\;\\geq\\;\\frac\{2^\{n\}\}\{3n\},so the bit\-length is at least2​\(n−1\)⋅2n/\(3​n\)≥12⋅2n2\(n\-1\)\\cdot 2^\{n\}/\(3n\)\\geq\\tfrac\{1\}\{2\}\\cdot 2^\{n\}forn≥18n\\geq 18\. For this familyDw=1\+∑rar=1\+\(2n−1\)\+1=2n\+1D\_\{w\}=1\+\\sum\_\{r\}a\_\{r\}=1\+\(2^\{n\}\-1\)\+1=2^\{n\}\+1, so the bound isΩ​\(Dw\)\\Omega\(D\_\{w\}\)\. The input isn\+1n\+1weights of at mostnnbits each plusO​\(1\)O\(1\)rationals, i\.e\.O​\(n2\)O\(n^\{2\}\)bits\. FinallyDy=O​\(1\)D\_\{y\}=O\(1\): only pointiihas a nonzero target, withai​bi=1a\_\{i\}b\_\{i\}=1, so the aggregateM=∑aj​bjM=\\sum a\_\{j\}b\_\{j\}over any window lies in\{0,1\}\\\{0,1\\\}\(spread22\)\. ∎

###### Proof of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(a\)\.

Immediate from Lemma[17](https://arxiv.org/html/2607.11956#Thmlemma17)\. Two consequences, with their exact scope:

1. 1\.No algorithm, of*any*running time, can output the exact Shapley value ofInI\_\{n\}as a reduced fraction, or in any representation whose length is polynomially related to the positional/fraction form \(e\.g\. an unreduced fraction with polynomially bounded blowup\), usingpoly​\(input length\)\\mathrm\{poly\}\(\\text\{input length\}\)bits: the output alone occupiesΩ​\(Dw\)=2Ω​\(input length\)\\Omega\(D\_\{w\}\)=2^\{\\Omega\(\\sqrt\{\\text\{input length\}\}\)\}bits\. Exact output is inherently pseudo\-polynomially long\. \(The restriction to fraction\-like representations is necessary and deliberate: trivially the instance itself is a poly\-bit*description*ofϕi\\phi\_\{i\}\. Succinct representations are excluded*conditionally*by part \(c\)\.\)
2. 2\.Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)isDwD\_\{w\}\-optimal up to polynomial factors among algorithms that emit the value in explicit \(fraction\-like\) form: on this familyDy=O​\(1\)D\_\{y\}=O\(1\)and the output alone occupiesΩ​\(Dw\)\\Omega\(D\_\{w\}\)bits, while Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)spendsO~​\(Dw2\)\\widetilde\{O\}\(D\_\{w\}^\{2\}\)time\. The pseudo\-polynomial dependence on weight precision is therefore unavoidable in the strongest \(information\-theoretic\) sense, with no complexity\-theoretic assumption\.

∎

#### Machine verification\.

verify\_theorem3\.py,part A: atn=8n=8, all2323primes in\(27,28\]\(2^\{7\},2^\{8\}\]divide the reduced denominator exactly twice; the denominator has733733bits on a3636\-bit weight encoding\. An independent adversarial re\-check atn=9n=9confirmed all4343primes in\(28,29\]\(2^\{8\},2^\{9\}\]squared in the denominator, none dividing the numerator \(a reduced\-ness double check\), with a14951495\-bit denominator againstDw=513D\_\{w\}=513on a4545\-bit encoding\.

#### Why this reframes the hardness question\.

Because the exact answer does not fit in polynomially many bits, “computeϕi\\phi\_\{i\}exactly in poly time” is impossible for trivial reasons, and a \#P\-hardness claim about that raw statement would be vacuous\. The meaningful questions are: \(i\) can the*precision demand*of the exact value be predicted in polynomial time? \(Part \(b\): no, unlessP=NP\\mathrm\{P\}=\\mathrm\{NP\}\.\) \(ii\) Can any succinct exact representation support standard modular arithmetic access in polynomial time? \(Part \(c\): no, unlessFP=\#​P\\mathrm\{FP\}=\\\#\\mathrm\{P\}\.\) \(iii\) Can polynomially many*leading real bits*be computed in polynomial time? \(Open; Appendix[C\-I](https://arxiv.org/html/2607.11956#A3.SS9)\.\)

### C\-DTheorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(b\): NP\-hardness of the precision decision

#### Problem \(Denom\-Precision\)\.

Given a weighted\-kkNN\-regression Shapley instance \(integer weights in binary, integer targets,KK, rationaly0,ydefy\_\{0\},y\_\{\\mathrm\{def\}\}, designated pointii\) andt∈ℕt\\in\\mathbb\{N\}in binary: decide whether2t∣denom⁡\(ϕi\)2^\{t\}\\mid\\operatorname\{denom\}\(\\phi\_\{i\}\)\.

We prove:Denom\-Precisionis NP\-hard under deterministic polynomial\-time many\-one reductions, already forK=NK=N, targets in\{0,1\}\\\{0,1\\\},y0=ydef=0y\_\{0\}=y\_\{\\mathrm\{def\}\}=0, squared loss\. Equivalently: unlessP=NP\\mathrm\{P\}=\\mathrm\{NP\}, no polynomial\-time algorithm can decide how many dyadic digits the exact Shapley value requires\.

###### Proof of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(b\)\.

We reduce fromSubset\-Sum: given positive integersa1,…,ana\_\{1\},\\dots,a\_\{n\}and a targetTT, decide whether some subset sums toTT\.

*Degenerate inputs\.*The gadget requires1≤T≤A:=∑jaj1\\leq T\\leq A:=\\sum\_\{j\}a\_\{j\}\. IfT=0T=0the instance is trivially solvable \(the empty set\); output the fixed YES pair\(I⋆,0\)\(I^\{\\star\},0\)for any instanceI⋆I^\{\\star\}\(as20=12^\{0\}=1divides every denominator\)\. IfT\>AT\>Athe instance is trivially unsolvable; output the pair built below from the unsolvable instance\(\[2,4\],T=3\)\(\[2,4\],\\,T=3\), which the analysis below shows is a NO instance\. From now on1≤T≤A1\\leq T\\leq A\.

*Normalization\.*By Lemma[15](https://arxiv.org/html/2607.11956#Thmlemma15)we may assumeTTis odd \(renamingnnto include the extra item; the transformation is polynomial\-time and preserves solvability\)\. BuildG​\(a,T;0,v\)G\(a,T;0,v\)withm=0m=0,N′=n\+1N^\{\\prime\}=n\+1, and set

L\\displaystyle L:=bit\-length of​A\\displaystyle=\\text\{bit\-length of \}A\(65\)\(soA<2L, andval2\(x\)≤L\\displaystyle\\quad\(\\text\{so \}A<2^\{L\}\\text\{, and \}\\operatorname\{val\}\_\{2\}\(x\)\\leq Lfor every integer0<\|x\|≤A\),\\displaystyle\\quad\\text\{ for every integer \}0<\|x\|\\leq A\),V\\displaystyle V:=⌈log2⁡\(\(N′−1\)\!\)⌉\+n\+1,\\displaystyle=\\big\\lceil\\log\_\{2\}\\\!\\big\(\(N^\{\\prime\}\-1\)\!\\big\)\\big\\rceil\+n\+1,t\\displaystyle t:=V\+2​L\+4,v:=2t−T\.\\displaystyle=V\+2L\+4,\\qquad v=2^\{t\}\-T\.Thenvvis odd \(TTodd\), positive \(T≤A<2L≤2t−1T\\leq A<2^\{L\}\\leq 2^\{t\-1\}\), and has exactlyttbits \(v\>2t−2L≥2t−1v\>2^\{t\}\-2^\{L\}\\geq 2^\{t\-1\}\); all ofL,V,t,vL,V,t,vare computed deterministically in time polynomial in the input, and forbb\-bit itemst=O​\(n​log⁡n\+b\)t=O\(n\\log n\+b\)\. The reduction outputs the pair\(G​\(a,T;0,v\),t\)\\big\(G\(a,T;0,v\),\\,t\\big\)\.

*Value decomposition\.*By Lemma[14](https://arxiv.org/html/2607.11956#Thmlemma14),

ϕi=−v2N′\!​\(AT⋅2−2​t\+R\),\\phi\_\{i\}=\-\\frac\{v^\{2\}\}\{N^\{\\prime\}\!\}\\Big\(A\_\{T\}\\cdot 2^\{\-2t\}\+R\\Big\),\(66\)wherev\+T=2tv\+T=2^\{t\}exactly and

AT\\displaystyle A\_\{T\}:=∑s=0N′−1s\!​\(N′−1−s\)\!​n​\(s,T\)∈ℤ≥0,\\displaystyle=\\sum\_\{s=0\}^\{N^\{\\prime\}\-1\}s\!\\,\(N^\{\\prime\}\-1\-s\)\!\\;n\(s,T\)\\ \\in\\mathbb\{Z\}\_\{\\geq 0\},\(67\)R\\displaystyle R:=∑W≠T∑ss\!​\(N′−1−s\)\!​n​\(s,W\)\(v\+W\)2\.\\displaystyle=\\sum\_\{W\\neq T\}\\ \\frac\{\\sum\_\{s\}s\!\\,\(N^\{\\prime\}\-1\-s\)\!\\;n\(s,W\)\}\{\(v\+W\)^\{2\}\}\.
*22\-adic separation\.*ForW≠TW\\neq T\(with0≤W≤A0\\leq W\\leq A\):v\+W=2t\+\(W−T\)v\+W=2^\{t\}\+\(W\-T\)with0<\|W−T\|≤A<2L≤2t−10<\|W\-T\|\\leq A<2^\{L\}\\leq 2^\{t\-1\}, henceval2⁡\(W−T\)≤L<t\\operatorname\{val\}\_\{2\}\(W\-T\)\\leq L<tand, by the ultrametric equality \([61](https://arxiv.org/html/2607.11956#A3.E61)\),val2⁡\(v\+W\)=val2⁡\(W−T\)≤L\\operatorname\{val\}\_\{2\}\(v\+W\)=\\operatorname\{val\}\_\{2\}\(W\-T\)\\leq L\. Every summand ofRRis a nonnegative rational \(integer numerator, positive denominator\) withval2≥−2​L\\operatorname\{val\}\_\{2\}\\geq\-2L; theW=0W=0summand is present and positive \(it equals\(N′−1\)\!/v2\(N^\{\\prime\}\-1\)\!/v^\{2\}\), soR\>0R\>0and

val2⁡\(R\)≥−2​L\.\\operatorname\{val\}\_\{2\}\(R\)\\;\\geq\\;\-2L\.\(68\)Also, by Lemma[16](https://arxiv.org/html/2607.11956#Thmlemma16)at most2n2^\{n\}coalitions haveW​\(S\)=TW\(S\)=Tand each Shapley coefficient satisfiess\!​\(N′−1−s\)\!≤\(N′−1\)\!s\!\\,\(N^\{\\prime\}\-1\-s\)\!\\leq\(N^\{\\prime\}\-1\)\!, so

AT≤\(N′−1\)\!⋅2n<2V\.A\_\{T\}\\;\\leq\\;\(N^\{\\prime\}\-1\)\!\\cdot 2^\{n\}\\;<\\;2^\{V\}\.\(69\)
*Dichotomy\.*Letν:=val2⁡\(N′\!\)\\nu:=\\operatorname\{val\}\_\{2\}\(N^\{\\prime\}\!\); by Legendre’s formulaν≤N′−1\\nu\\leq N^\{\\prime\}\-1, and sincek\!≥2k−1k\!\\geq 2^\{k\-1\}for allk≥1k\\geq 1we getN′−1≤⌈log2⁡\(\(N′−1\)\!\)⌉\+1≤VN^\{\\prime\}\-1\\leq\\lceil\\log\_\{2\}\(\(N^\{\\prime\}\-1\)\!\)\\rceil\+1\\leq V, henceν≤V\\nu\\leq V\. Recallvvis odd andϕi<0\\phi\_\{i\}<0\(every marginal in \([63](https://arxiv.org/html/2607.11956#A3.E63)\) is strictly negative\), soϕi≠0\\phi\_\{i\}\\neq 0and its reduced denominator is well\-defined\.

- •IfSubset\-Sumis unsolvable:AT=0A\_\{T\}=0, soϕi=−\(v2/N′\!\)​R\\phi\_\{i\}=\-\(v^\{2\}/N^\{\\prime\}\!\)\\,Rand, by \([68](https://arxiv.org/html/2607.11956#A3.E68)\),val2⁡\(ϕi\)≥−ν−2​L\\operatorname\{val\}\_\{2\}\(\\phi\_\{i\}\)\\ \\geq\\ \-\\nu\-2L\. By \([60](https://arxiv.org/html/2607.11956#A3.E60)\), val2⁡\(denom⁡\(ϕi\)\)≤ν\+2​L≤V\+2​L=t−4<t,\\operatorname\{val\}\_\{2\}\\\!\\big\(\\operatorname\{denom\}\(\\phi\_\{i\}\)\\big\)\\;\\leq\\;\\nu\+2L\\;\\leq\\;V\+2L\\;=\\;t\-4\\;<\\;t,so2t∤denom⁡\(ϕi\)2^\{t\}\\nmid\\operatorname\{denom\}\(\\phi\_\{i\}\)\.
- •If solvable:1≤AT<2V1\\leq A\_\{T\}<2^\{V\}givesval2⁡\(AT⋅2−2​t\)=val2⁡\(AT\)−2​t≤\(V−1\)−2​t\\operatorname\{val\}\_\{2\}\\\!\\big\(A\_\{T\}\\cdot 2^\{\-2t\}\\big\)=\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)\-2t\\leq\(V\-1\)\-2t, and \(V−1\)−2​t=−V−4​L−9<−2​L≤val2⁡\(R\),\(V\-1\)\-2t\\;=\\;\-V\-4L\-9\\;<\\;\-2L\\;\\leq\\;\\operatorname\{val\}\_\{2\}\(R\),a strict inequality, so by ultrametric strictness \([61](https://arxiv.org/html/2607.11956#A3.E61)\),val2⁡\(AT​2−2​t\+R\)=val2⁡\(AT\)−2​t\\operatorname\{val\}\_\{2\}\\\!\\big\(A\_\{T\}2^\{\-2t\}\+R\\big\)=\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)\-2tand val2⁡\(ϕi\)\\displaystyle\\operatorname\{val\}\_\{2\}\(\\phi\_\{i\}\)=val2⁡\(AT\)−2​t−ν,\\displaystyle=\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)\-2t\-\\nu,val2⁡\(denom⁡\(ϕi\)\)\\displaystyle\\operatorname\{val\}\_\{2\}\\\!\\big\(\\operatorname\{denom\}\(\\phi\_\{i\}\)\\big\)=2​t\+ν−val2⁡\(AT\)\\displaystyle=2t\+\\nu\-\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)≥2​t−\(V−1\)=t\+2​L\+5\>t,\\displaystyle\\geq 2t\-\(V\-1\)\\;=\\;t\+2L\+5\\;\>\\;t,so2t∣denom⁡\(ϕi\)2^\{t\}\\mid\\operatorname\{denom\}\(\\phi\_\{i\}\)\.

ThusSubset\-Sum\(a,T\)\(a,T\)is solvable iff2t∣denom⁡\(ϕi\)2^\{t\}\\mid\\operatorname\{denom\}\(\\phi\_\{i\}\), and the reduction is deterministic polynomial\-time many\-one\. Both branches clear the threshold with at least four bits of slack\. ∎

#### Machine verification\.

verify\_theorem3\.py,part B: on the solvable instances\(\[1,2,3,4,5\],T=5\)\(\[1,2,3,4,5\],T\{=\}5\)and\(\[1,1,2,3,5\],T=5\)\(\[1,1,2,3,5\],T\{=\}5\)the computedval2⁡\(denom\)=50\\operatorname\{val\}\_\{2\}\(\\operatorname\{denom\}\)=50exceeds the thresholdt=25t=25; on the unsolvable instance\(\[2,4,6,8\],T=7\)\(\[2,4,6,8\],T\{=\}7\),val2⁡\(denom\)=0\\operatorname\{val\}\_\{2\}\(\\operatorname\{denom\}\)=0againstt=24t=24;part Basserts only this dichotomy\. The exact predicted identity2​t\+ν−val2⁡\(AT\)=50\+4−4=502t\+\\nu\-\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)=50\+4\-4=50, and its extension to extremal multisets \(up to2020solutions concentrated at one size, whereval2⁡\(AT\)\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)is largest\), are checked by the adversarial suiteverify\_theorem3\_adversarial\.py, which also exercised Lemma[15](https://arxiv.org/html/2607.11956#Thmlemma15)end\-to\-end on even\-TTinstances \(the shippedpart B/Cinstances all have oddTT\): counts transfer with the exact\+1\+1index shift and the threshold decides correctly\.

#### Remark \(no primes needed\)\.

App\-adic variant withv\+T=pv\+T=pa large prime also works, but requires generating a large prime \(randomized, or deterministic only under standard conjectures\); the dyadic gadgetv=2t−Tv=2^\{t\}\-Tabove is fully deterministic, which is why the reduction is stated22\-adically\.

### C\-EA parsimonious reduction for \#Subset\-Sum

Part \(c\) counts solutions, so it needs the \#P\-*completeness*of \#Subset\-Sumunder a*parsimonious*chain\. We make this self\-contained, because the textbook route is not parsimonious as written: in Sipser’s digit\-gadget reduction \(Thm\. 7\.56\) each clause receives two*identical*slack items of value11in the clause digit with clause target33, so a clause with exactly two true literals admits*two*slack completions\. Concretely, for the single clause\(x1∨x2∨x3\)\(x\_\{1\}\\vee x\_\{2\}\\vee x\_\{3\}\)that construction yields1010subset\-sum solutions against77satisfying assignments \(machine\-checked\)\. The following variant \(slack values\{1,2\}\\\{1,2\\\}with clause target44\) restores a unique completion\.

###### Lemma 18\(Parsimonious \#3SAT→\\to\#Subset\-Sum\)\.

There is a deterministic polynomial\-time reduction mapping a 3\-CNF formulaφ\\varphiwithℓ\\ellvariables andkkclauses to aSubset\-Suminstance with2​ℓ\+2​k2\\ell\+2kpositive integers and targetTφT\_\{\\varphi\}, under which the satisfying assignments ofφ\\varphicorrespond*bijectively*to the subsets summing toTφT\_\{\\varphi\}\. Consequently \#Subset\-Sumis \#P\-complete\(with \#3SAT \#P\-complete under parsimonious reductions\[[34](https://arxiv.org/html/2607.11956#bib.bib34)\]\)\.

###### Proof\.

Remove tautological clauses \(those containing a variable and its negation\); they are satisfied by every assignment, so removal preserves the count exactly\. Write all numbers in base1010withℓ\+k\\ell\+kdigit positions: variable digits1,…,ℓ1,\\dots,\\elland clause digits1,…,k1,\\dots,k\.

- •For each variablexpx\_\{p\}, two numbersupu\_\{p\}andu¯p\\bar\{u\}\_\{p\}: both have digit11in variable positionpp; in clause positionjj,upu\_\{p\}carries the number of occurrences of the literalxpx\_\{p\}in clausecjc\_\{j\}, andu¯p\\bar\{u\}\_\{p\}the number of occurrences of¬xp\\lnot x\_\{p\}\(each in\{0,1,2,3\}\\\{0,1,2,3\\\}\)\.
- •For each clausecjc\_\{j\}, two slack numberssj,1,sj,2s\_\{j,1\},s\_\{j,2\}with values11and22respectively in clause positionjjand0elsewhere\.
- •TargetTφT\_\{\\varphi\}: digit11in every variable position, digit44in every clause position\.

*No carries\.*Over all2​ℓ\+2​k2\\ell\+2knumbers, each variable column sums to22and each clause column sums to at most3\+1\+2=6<103\+1\+2=6<10; hence addition of any sub\-collection is carry\-free, and a subset sums toTφT\_\{\\varphi\}iff it matchesTφT\_\{\\varphi\}digit\-by\-digit\.

*Bijection\.*Variable digitpphas value11in exactlyupu\_\{p\}andu¯p\\bar\{u\}\_\{p\}; matching the target digit11forces*exactly one*of them into the subset, so subsets matching the variable digits correspond exactly to truth assignmentsα\\alpha\. Fix such anα\\alphaand a clausecjc\_\{j\}; the chosen variable numbers contributekj∈\{0,1,2,3\}k\_\{j\}\\in\\\{0,1,2,3\\\}to clause digitjj, wherekjk\_\{j\}is the number of true literal occurrences ofcjc\_\{j\}underα\\alpha\. The slack contribution isσj∈\{0,1,2,3\}\\sigma\_\{j\}\\in\\\{0,1,2,3\\\}, and each value ofσj\\sigma\_\{j\}is realized by exactly one sub\-collection of\{sj,1,sj,2\}\\\{s\_\{j,1\},s\_\{j,2\}\\\}\(0=∅0=\\varnothing,1=\{sj,1\}1=\\\{s\_\{j,1\}\\\},2=\{sj,2\}2=\\\{s\_\{j,2\}\\\},3=\{sj,1,sj,2\}3=\\\{s\_\{j,1\},s\_\{j,2\}\\\}\)\. Matching the clause target requiresσj=4−kj\\sigma\_\{j\}=4\-k\_\{j\}\. Ifcjc\_\{j\}is unsatisfied \(kj=0k\_\{j\}=0\) thenσj=4\\sigma\_\{j\}=4is unachievable andα\\alphaextends to no solution; ifkj∈\{1,2,3\}k\_\{j\}\\in\\\{1,2,3\\\}thenσj=4−kj∈\{1,2,3\}\\sigma\_\{j\}=4\-k\_\{j\}\\in\\\{1,2,3\\\}is achieved by exactly one slack choice\. Hence every satisfying assignment extends to exactly one solution and every solution restricts to a satisfying assignment: the correspondence is a bijection\. All numbers haveℓ\+k\\ell\+kdecimal digits, so the reduction is polynomial\-time\. Membership of \#Subset\-Sumin \#P is immediate \(count the accepting certificates of the natural verifier\)\. ∎

#### Machine verification\.

The non\-parsimony of the Sipser gadget \(1010solutions vs77satisfying assignments on a single clause\) and the exactness of the\{1,2\}\\\{1,2\\\}/target\-44variant \(exactly77\) were both checked by exhaustive enumeration\.

### C\-FTheorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(c\): \#P\-hardness of22\-adic digit access

#### Access model\.

For a nonzero rationalxxwithα=val2⁡\(x\)\\alpha=\\operatorname\{val\}\_\{2\}\(x\), writex=2α​ux=2^\{\\alpha\}uwithuua22\-adic unit \(concretely: the reduced fraction ofuuhas odd numerator and odd denominator, andumod2mu\\bmod 2^\{m\}denotes the unique residue in\{0,…,2m−1\}\\\{0,\\dots,2^\{m\}\-1\\\}congruent to\(numerator\)⋅\(denominator\)−1\(\\text\{numerator\}\)\\cdot\(\\text\{denominator\}\)^\{\-1\}modulo2m2^\{m\}\)\. The*22\-adic digit access*function is

Dig​\(I,i,m\):=\(val2⁡\(ϕi\),umod2m\),\\textsc\{Dig\}\(I,i,m\)\\;:=\\;\\big\(\\operatorname\{val\}\_\{2\}\(\\phi\_\{i\}\),\\ u\\bmod 2^\{m\}\\big\),\(70\)withmmin unary \(or in binary withm≤polym\\leq\\mathrm\{poly\}; the output hasO​\(m\+log⁡\|α\|\)O\(m\+\\log\|\\alpha\|\)bits either way, and on every instance\|α\|≤val2\|\\alpha\|\\leq\\operatorname\{val\}\_\{2\}of the unreduced numerator or denominator ofϕi\\phi\_\{i\}, whose bit\-lengths are at most exponential in the input, solog⁡\|α\|\\log\|\\alpha\|is polynomial\)\. Ifϕi=0\\phi\_\{i\}=0,Digreturns a distinguished symbol; this never occurs on gadget instances, whereϕi<0\\phi\_\{i\}<0\.Digis exactly the information any representation of the exact value supports if it admits polynomial\-time exact arithmetic modulo powers of two: e\.g\. a reduced or unreduced fraction supportsDigin time polynomial in the representation length plusmm\(strip the22\-power, then invert the odd denominator mod2m2^\{m\}by the extended Euclidean algorithm or Hensel lifting\)\.

We prove: \#Subset\-SumTuring\-reduces toDigunder a deterministic polynomial\-time reduction makingn\+2n\+2oracle calls on annn\-item instance \(all calls on gadget instancesG​\(a,T;m,⋅\)G\(a,T;m,\\cdot\)with varying dummy countmm, after the Lemma[15](https://arxiv.org/html/2607.11956#Thmlemma15)shift\)\. Consequently, unlessFP=\#​P\\mathrm\{FP\}=\\\#\\mathrm\{P\}, no polynomial\-time computable representation of the exact Shapley value, however succinct, supports polynomial\-time22\-adic digit access; in this precise sense \(hardness of*access*to the exact value\), exact weighted\-kkNN regression Data Shapley with binary weights is \#P\-hard\.

We first isolate the linear\-algebra step\.

###### Lemma 19\(Coefficient\-matrix invertibility\)\.

Fixn≥0n\\geq 0and distinct nonnegative integersm0<m1<⋯<mnm\_\{0\}<m\_\{1\}<\\dots<m\_\{n\}\. The\(n\+1\)×\(n\+1\)\(n\{\+\}1\)\\times\(n\{\+\}1\)matrixBBwith entriesBj,s=s\!​\(n\+mj−s\)\!B\_\{j,s\}=s\!\\,\(n\+m\_\{j\}\-s\)\!,s=0,…,ns=0,\\dots,n, is invertible overℚ\\mathbb\{Q\}\.

###### Proof\.

Divide rowjjby\(n\+mj\+1\)\!≠0\(n\+m\_\{j\}\+1\)\!\\neq 0; by the Beta integral,

s\!​\(n\+mj−s\)\!\(n\+mj\+1\)\!=B​\(s\+1,n\+mj−s\+1\)=∫01us​\(1−u\)n\+mj−s​𝑑u\.\\frac\{s\!\\,\(n\+m\_\{j\}\-s\)\!\}\{\(n\+m\_\{j\}\+1\)\!\}=\\mathrm\{B\}\(s\+1,\\ n\+m\_\{j\}\-s\+1\)=\\int\_\{0\}^\{1\}u^\{s\}\(1\-u\)^\{\\,n\+m\_\{j\}\-s\}\\,du\.Supposex=\(x0,…,xn\)x=\(x\_\{0\},\\dots,x\_\{n\}\)lies in the kernel\. Settingg​\(u\):=∑s=0nxs​us​\(1−u\)n−sg\(u\):=\\sum\_\{s=0\}^\{n\}x\_\{s\}\\,u^\{s\}\(1\-u\)^\{\\,n\-s\}\(a polynomial of degree≤n\\leq n\), the kernel conditions read

∫01g​\(u\)​\(1−u\)mj​𝑑u=0,j=0,…,n\.\\int\_\{0\}^\{1\}g\(u\)\\,\(1\-u\)^\{m\_\{j\}\}\\,du=0,\\qquad j=0,\\dots,n\.\(71\)*Consecutive case*\(mj=jm\_\{j\}=j\):\{\(1−u\)m\}m=0n\\\{\(1\-u\)^\{m\}\\\}\_\{m=0\}^\{n\}is a basis of the polynomials of degree≤n\\leq n, so \([71](https://arxiv.org/html/2607.11956#A3.E71)\) makesggorthogonal inL2​\(0,1\)L^\{2\}\(0,1\)to all of them, in particular to itself:∫01g2=0\\int\_\{0\}^\{1\}g^\{2\}=0, henceg≡0g\\equiv 0\.*General case:*expandg​\(u\)=∑r=0nγr​\(1−u\)rg\(u\)=\\sum\_\{r=0\}^\{n\}\\gamma\_\{r\}\(1\-u\)^\{r\}\(a change of basis on degree\-≤n\\leq npolynomials\); then \([71](https://arxiv.org/html/2607.11956#A3.E71)\) becomes∑r=0nγr/\(mj\+r\+1\)=0\\sum\_\{r=0\}^\{n\}\\gamma\_\{r\}/\(m\_\{j\}\+r\+1\)=0for alljj\. The matrix\[1/\(mj\+r\+1\)\]j,r\\big\[1/\(m\_\{j\}\+r\+1\)\\big\]\_\{j,r\}is a Cauchy matrix \(1/\(xj\+yr\)1/\(x\_\{j\}\+y\_\{r\}\)withxj=mjx\_\{j\}=m\_\{j\}pairwise distinct,yr=r\+1y\_\{r\}=r\+1pairwise distinct, allxj\+yr\>0x\_\{j\}\+y\_\{r\}\>0\), hence invertible, soγ=0\\gamma=0andg≡0g\\equiv 0\. In either caseg≡0g\\equiv 0forcesx=0x=0, because\{us​\(1−u\)n−s\}s=0n\\\{u^\{s\}\(1\-u\)^\{n\-s\}\\\}\_\{s=0\}^\{n\}is the Bernstein basis of degreenn\(linearly independent\)\. HenceBBis invertible\. ∎

###### Proof of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(c\)\.

Let annn\-item \#Subset\-Suminstance\(a1,…,an;T\)\(a\_\{1\},\\dots,a\_\{n\};T\)with1≤T≤A1\\leq T\\leq Abe given \(degenerate targets are handled as in Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(b\); forT=0T=0the count is11, forT\>AT\>Ait is0\)\. By Lemma[15](https://arxiv.org/html/2607.11956#Thmlemma15)we may assumeTTodd; the shift adds one item and preserves the total count exactly, and we rename so that the instance hasnnitems and oddTT\(the stated call countn\+2n\+2refers to the original instance:n\+1n\+1calls on the shifted instance, which hasn\+1n\+1items, is\(norig\+1\)\+1\(n\_\{\\mathrm\{orig\}\}\+1\)\+1\)\.

*Step 1 \(per\-call extraction\)\.*For eachm∈\{0,1,…,n\}m\\in\\\{0,1,\\dots,n\\\}build the callGm:=G​\(a,T;m,vm\)G\_\{m\}:=G\(a,T;m,v\_\{m\}\)withN′=n\+m\+1N^\{\\prime\}=n\+m\+1,Q=A\+T\+1Q=A\+T\+1,Wmax:=A\+m​QW\_\{\\max\}:=A\+mQ, and, as in \([65](https://arxiv.org/html/2607.11956#A3.E65)\) but with the larger weight range,

Lm\\displaystyle L\_\{m\}:=bit\-length of​Wmax,\\displaystyle=\\text\{bit\-length of \}W\_\{\\max\},Vm\\displaystyle V\_\{m\}:=⌈log2⁡\(\(N′−1\)\!\)⌉\+n\+1,\\displaystyle=\\big\\lceil\\log\_\{2\}\\\!\\big\(\(N^\{\\prime\}\-1\)\!\\big\)\\big\\rceil\+n\+1,tm\\displaystyle t\_\{m\}:=Vm\+2​Lm\+4,vm:=2tm−T\.\\displaystyle=V\_\{m\}\+2L\_\{m\}\+4,\\qquad v\_\{m\}=2^\{t\_\{m\}\}\-T\.By Lemma[14](https://arxiv.org/html/2607.11956#Thmlemma14)and the separation argument of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(b\), now with\|W−T\|≤Wmax<2Lm\|W\-T\|\\leq W\_\{\\max\}<2^\{L\_\{m\}\}for all achievableW≠TW\\neq T, including dummy\-containing coalitions,

ϕi\(m\)\\displaystyle\\phi\_\{i\}^\{\(m\)\}=−vm2N′\!​\(AT\(m\)​2−2​tm\+Rm\),\\displaystyle=\-\\frac\{v\_\{m\}^\{2\}\}\{N^\{\\prime\}\!\}\\Big\(A\_\{T\}^\{\(m\)\}2^\{\-2t\_\{m\}\}\+R\_\{m\}\\Big\),\(72\)AT\(m\)\\displaystyle A\_\{T\}^\{\(m\)\}=∑s=0ns\!​\(n\+m−s\)\!​n​\(s,T\),\\displaystyle=\\\!\\sum\_\{s=0\}^\{n\}\\\!s\!\\,\(n\+m\-s\)\!\\,n\(s,T\),where the unknown countsn​\(s,T\)n\(s,T\)are the*same for every*mmand vanish fors\>ns\>n\(Lemma[16](https://arxiv.org/html/2607.11956#Thmlemma16)\),0≤AT\(m\)<2Vm0\\leq A\_\{T\}^\{\(m\)\}<2^\{V\_\{m\}\}as in \([69](https://arxiv.org/html/2607.11956#A3.E69)\), and each summand ofRmR\_\{m\}hasval2≥−2​Lm\\operatorname\{val\}\_\{2\}\\geq\-2L\_\{m\}\. Define

Xm:=−N′\!​22​tmvm2​ϕi\(m\)=AT\(m\)\+22​tm​Rm\.X\_\{m\}:=\-\\,\\frac\{N^\{\\prime\}\!\\;2^\{2t\_\{m\}\}\}\{v\_\{m\}^\{2\}\}\\;\\phi\_\{i\}^\{\(m\)\}\\;=\\;A\_\{T\}^\{\(m\)\}\+2^\{2t\_\{m\}\}R\_\{m\}\.Each term of22​tm​Rm2^\{2t\_\{m\}\}R\_\{m\}equals22​tm−2​eW⋅κ​\(W\)/\(odd\)22^\{\\,2t\_\{m\}\-2e\_\{W\}\}\\cdot\\kappa\(W\)/\(\\mathrm\{odd\}\)^\{2\}witheW=val2⁡\(W−T\)≤Lme\_\{W\}=\\operatorname\{val\}\_\{2\}\(W\-T\)\\leq L\_\{m\}andκ​\(W\)∈ℤ≥0\\kappa\(W\)\\in\\mathbb\{Z\}\_\{\\geq 0\}, so it is a22\-adic integer of valuation at leastMm:=2​tm−2​Lm=2​Vm\+2​Lm\+8\>VmM\_\{m\}:=2t\_\{m\}\-2L\_\{m\}=2V\_\{m\}\+2L\_\{m\}\+8\>V\_\{m\}\. HenceXmX\_\{m\}is a22\-adic integer with

Xm≡AT\(m\)\(mod2Mm\),0≤AT\(m\)<2Vm<2Mm,X\_\{m\}\\equiv A\_\{T\}^\{\(m\)\}\\pmod\{2^\{M\_\{m\}\}\},\\qquad 0\\leq A\_\{T\}^\{\(m\)\}<2^\{V\_\{m\}\}<2^\{M\_\{m\}\},\(73\)so the integerAT\(m\)A\_\{T\}^\{\(m\)\}is recovered exactly from the residueXmmod2MmX\_\{m\}\\bmod 2^\{M\_\{m\}\}\.

That residue is computable from one oracle callDig​\(Gm,i,Mm\)=\(α,umod2Mm\)\\textsc\{Dig\}\(G\_\{m\},i,M\_\{m\}\)=\(\\alpha,\\,u\\bmod 2^\{M\_\{m\}\}\): writeN′\!=2νm​ηmN^\{\\prime\}\!=2^\{\\nu\_\{m\}\}\\eta\_\{m\}withηm\\eta\_\{m\}odd \(Legendre’s formula\), so,vmv\_\{m\}being odd,

Xm=2βm​wm,βm:=2​tm\+νm\+α=val2⁡\(Xm\)≥0,\\displaystyle X\_\{m\}=2^\{\\,\\beta\_\{m\}\}\\,w\_\{m\},\\qquad\\beta\_\{m\}=2t\_\{m\}\+\\nu\_\{m\}\+\\alpha=\\operatorname\{val\}\_\{2\}\(X\_\{m\}\)\\ \\geq 0,wm≡−ηm​u​\(vm2\)−1\(mod​2Mm\),\\displaystyle w\_\{m\}\\equiv\-\\,\\eta\_\{m\}\\,u\\,\(v\_\{m\}^\{2\}\)^\{\-1\}\\ \\ \(\\mathrm\{mod\}2^\{M\_\{m\}\}\),withwmw\_\{m\}a22\-adic unit whose residue is computable from the oracle output by modular multiplication and one odd inversion \(extended Euclid\), all onO​\(Mm\)O\(M\_\{m\}\)\-bit residues\. Ifβm≥Mm\\beta\_\{m\}\\geq M\_\{m\}thenXm≡0\(mod2Mm\)X\_\{m\}\\equiv 0\\pmod\{2^\{M\_\{m\}\}\}and \([73](https://arxiv.org/html/2607.11956#A3.E73)\) certifiesAT\(m\)=0A\_\{T\}^\{\(m\)\}=0\(this is the branch where no coalition hitsTT\); otherwiseXmmod2Mm=2βm​wmmod2MmX\_\{m\}\\bmod 2^\{M\_\{m\}\}=2^\{\\beta\_\{m\}\}w\_\{m\}\\bmod 2^\{M\_\{m\}\}\. All quantities involved \(tm,Mm,Vm,νm,ηmmod2Mmt\_\{m\},M\_\{m\},V\_\{m\},\\nu\_\{m\},\\eta\_\{m\}\\bmod 2^\{M\_\{m\}\}, andα\\alphaitself\) havepoly​\(n,log⁡A\)\\mathrm\{poly\}\(n,\\log A\)bit\-length, so Step 1 runs in deterministic polynomial time per call\.

*Step 2 \(untangling the size\-dependent Shapley coefficients\)\.*After then\+1n\+1callsm=0,…,nm=0,\\dots,n, the recovered integers satisfy the linear system

∑s=0ns\!​\(n\+m−s\)\!​xs=AT\(m\),m=0,1,…,n,\\sum\_\{s=0\}^\{n\}s\!\\,\(n\+m\-s\)\!\\;x\_\{s\}\\;=\\;A\_\{T\}^\{\(m\)\},\\qquad m=0,1,\\dots,n,\(74\)in the unknownsxs=n​\(s,T\)x\_\{s\}=n\(s,T\)\. By Lemma[19](https://arxiv.org/html/2607.11956#Thmlemma19)\(consecutive case\) the coefficient matrix is invertible, so \([74](https://arxiv.org/html/2607.11956#A3.E74)\) has the unique solutionxs=n​\(s,T\)x\_\{s\}=n\(s,T\), and it is found exactly overℚ\\mathbb\{Q\}by fraction\-free Gaussian elimination: the entries are factorials of integers≤2​n\\leq 2n\(henceO​\(n​log⁡n\)O\(n\\log n\)bits\), the right\-hand sides are<2Vm<2^\{V\_\{m\}\}\(poly\-bit\), and exact elimination on an\(n\+1\)\(n\{\+\}1\)\-square system with poly\-bit entries runs in polynomial time \(Cramer\-bounded intermediate sizes / Bareiss\)\. Finally

\#​Subset\-Sum​\(a,T\)=∑s=0nn​\(s,T\),\\\#\\textsc\{Subset\-Sum\}\(a,T\)\\;=\\;\\sum\_\{s=0\}^\{n\}n\(s,T\),and, when Lemma[15](https://arxiv.org/html/2607.11956#Thmlemma15)was applied, the bijection of that lemma transfers the total count to the original instance unchanged\. The whole reduction is deterministic polynomial time withn\+2n\+2Digcalls on the original instance\. By Lemma[18](https://arxiv.org/html/2607.11956#Thmlemma18), \#Subset\-Sumis \#P\-complete, so a polynomial\-timeDigalgorithm would giveFP=\#​P\\mathrm\{FP\}=\\\#\\mathrm\{P\}\.

*Consequence for representations\.*Suppose some algorithm computes, in polynomial time,*any*representationρ​\(I\)\\rho\(I\)of the exact valueϕi\\phi\_\{i\}from whichDigqueries can be answered in polynomial time\. Composing the two putsDiginFP\\mathrm\{FP\}, henceFP=\#​P\\mathrm\{FP\}=\\\#\\mathrm\{P\}\. This excludes, conditionally, every “succinct exact” scheme with polynomial\-time modular arithmetic: closed forms, CRT/residue systems, and exact\-fraction maintenance alike\. ∎

#### Machine verification\.

verify\_theorem3\.py,part C: the full pipeline \(n\+1n\+1exact Shapley values,22\-adic window extraction \([73](https://arxiv.org/html/2607.11956#A3.E73)\), exact linear solve of \([74](https://arxiv.org/html/2607.11956#A3.E74)\)\) recovers the exact size\-stratified counts on four instances: counts\(1,2\)\(1,2\)across two sizes \(total33\);\(1,1,1\)\(1,1,1\)on a multiset \(total33\); all\-zero \(unsolvable, total0\); and\(6,1\)\(6,1\)\(a multiset with multiplicity66at one size, total77\)\. Adversarial extensions verified the scattered dummy setm∈\{2,3,5,7,8,11\}m\\in\\\{2,3,5,7,8,11\\\}\(the Cauchy case of Lemma[19](https://arxiv.org/html/2607.11956#Thmlemma19)\) with exact recovery\.

#### Remark \(relation to Deng–Papadimitriou\[[22](https://arxiv.org/html/2607.11956#bib.bib22)\]\)\.

For weighted*majority*games, Deng and Papadimitriou prove \#P\-completeness of the Shapley value directly, because the threshold utility makesϕ\\phiitself a weighted count, a poly\-length number carrying the \#P quantity in its*magnitude*\. Here the regression utility is real\-analytic in the weights: every coalition contributes a nonzero smooth amount whether or not it hitsTT, so the count cannot sit in the magnitude; it sits in the arithmetic fine structure of the exact value \(which prime powers divide the denominator\)\. That is why the exact value is exponentially long \(part \(a\)\) and why hardness is correctly stated as hardness of*access*\(parts \(b\), \(c\)\)\. The dummy\-point device for inverting the size coefficientscN′​\(\|S\|\)c\_\{N^\{\\prime\}\}\(\|S\|\)parallels the technique originating with Deng–Papadimitriou\.

### C\-GTheK=Θ​\(N\)K=\\Theta\(N\)regime: truncated extraction

Parts \(b\) and \(c\) were proved atK=NK=N\. They hold throughout theK=Θ​\(N\)K=\\Theta\(N\)regime \(a genuinek<Nk<Nnearest\-neighbour setting, e\.g\.K≈N/2K\\approx N/2\) via the following truncation\.

###### Lemma 20\(Truncated gadget value\)\.

InG​\(a,T;m,v\)G\(a,T;m,v\), place the special pointiiat the*farthest*rankN′N^\{\\prime\}\(items and dummies occupy ranks1,…,N′−11,\\dots,N^\{\\prime\}\-1in any order\) and takeK<N′K<N^\{\\prime\}\. Then

ϕi=−v2​∑s=0K−1cN′​\(s\)​∑Wn​\(s,W\)\(v\+W\)2\.\\phi\_\{i\}\\;=\\;\-\\,v^\{2\}\\sum\_\{s=0\}^\{K\-1\}c\_\{N^\{\\prime\}\}\(s\)\\sum\_\{W\}\\frac\{n\(s,W\)\}\{\(v\+W\)^\{2\}\}\.\(75\)

###### Proof\.

For\|S\|≥K\|S\|\\geq Kthe window is full andiiis the farthest point, sotopK​\(S∪\{i\}\)=topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=\\mathrm\{top\}\_\{K\}\(S\): addingiichanges nothing and the marginal is0\. \(Both utilities are0anyway:topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)consists of non\-iipoints with target0\.\) For\|S\|≤K−1\|S\|\\leq K\-1we have\|S∪\{i\}\|≤K\|S\\cup\\\{i\\\}\|\\leq K, sotopK​\(S∪\{i\}\)=S∪\{i\}\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=S\\cup\\\{i\\\}andtopK​\(S\)=S\\mathrm\{top\}\_\{K\}\(S\)=S; exactly as in Lemma[14](https://arxiv.org/html/2607.11956#Thmlemma14),U​\(S\)=0U\(S\)=0andU​\(S∪\{i\}\)=−v2/\(v\+W​\(S\)\)2U\(S\\cup\\\{i\\\}\)=\-v^\{2\}/\(v\+W\(S\)\)^\{2\}\. Grouping by\(\|S\|,W​\(S\)\)\(\|S\|,W\(S\)\)gives \([75](https://arxiv.org/html/2607.11956#A3.E75)\)\. ∎

#### Parts \(b\) and \(c\) atK=Θ​\(N\)K=\\Theta\(N\)\.

SetK:=n\+1K:=n\+1and use dummy countsm∈\{1,…,n\+1\}m\\in\\\{1,\\dots,n\+1\\\}, so thatN′=n\+m\+1∈\[n\+2,2​n\+2\]N^\{\\prime\}=n\+m\+1\\in\[n\+2,\\,2n\+2\]and*every*call satisfiesK<N′K<N^\{\\prime\}strictly \(the ratioK/N′K/N^\{\\prime\}ranges over\[12,n\+1n\+2\]\[\\tfrac\{1\}\{2\},\\tfrac\{n\+1\}\{n\+2\}\]; atm=n\+1m=n\+1the regime isK≈N′/2K\\approx N^\{\\prime\}/2\)\. The choicem≥1m\\geq 1matters: the boundary callm=0m=0would haveK=n\+1=N′K=n\+1=N^\{\\prime\}and would fall outside the advertisedk<Nk<Nregime\. By Lemma[20](https://arxiv.org/html/2607.11956#Thmlemma20)and Lemma[16](https://arxiv.org/html/2607.11956#Thmlemma16)\(n​\(s,T\)=0n\(s,T\)=0fors\>n=K−1s\>n=K\-1, so the truncation loses noTT\-information\), the per\-call extraction of Appendix[C\-F](https://arxiv.org/html/2607.11956#A3.SS6)\(whose22\-adic bounds used onlyW≤WmaxW\\leq W\_\{\\max\}and coefficient bounds by\(N′−1\)\!\(N^\{\\prime\}\-1\)\!, both unchanged\) returns exactly

AT\(m\)=∑s=0K−1s\!​\(N′−1−s\)\!​n​\(s,T\)=∑s=0ns\!​\(n\+m−s\)\!​n​\(s,T\),A\_\{T\}^\{\(m\)\}=\\sum\_\{s=0\}^\{K\-1\}s\!\\,\(N^\{\\prime\}\-1\-s\)\!\\;n\(s,T\)=\\sum\_\{s=0\}^\{n\}s\!\\,\(n\+m\-s\)\!\\;n\(s,T\),the same left\-hand sides as \([74](https://arxiv.org/html/2607.11956#A3.E74)\), now form=1,…,n\+1m=1,\\dots,n\+1\. By Lemma[19](https://arxiv.org/html/2607.11956#Thmlemma19)\(general case, distinct dummy countsmj=j\+1m\_\{j\}=j\+1\) the\(n\+1\)×\(n\+1\)\(n\{\+\}1\)\\times\(n\{\+\}1\)system is again invertible, so Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(c\) holds verbatim withK=n\+1=Θ​\(N′\)K=n\+1=\\Theta\(N^\{\\prime\}\)andn\+2n\+2oracle calls\. For Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(b\) a*single*callm=1m=1suffices: the valuation dichotomy of Appendix[C\-D](https://arxiv.org/html/2607.11956#A3.SS4)applies verbatim toAT\(1\)A\_\{T\}^\{\(1\)\}, whose vanishing is still equivalent to the unsolvability ofSubset\-Sum\. This proves qualification \(i\) in the “Scope of the hardness” paragraph of Section[IV\-D](https://arxiv.org/html/2607.11956#S4.SS4)\.

#### Machine verification\.

verify\_theorem3\.py,part D: atK=3<N′=6K=3<N^\{\\prime\}=6withiiranked farthest, only the\|S\|<K\|S\|<Kcoalitions contribute; the restricted closed form \([75](https://arxiv.org/html/2607.11956#A3.E75)\) equals the brute\-force value and the truncated extraction is exact\. Adversarial extensions ran the strictK<N′K<N^\{\\prime\}pipeline end\-to\-end at fixedK=6K=6withm∈\{1,…,6\}m\\in\\\{1,\\dots,6\\\}\(N′=7,…,12N^\{\\prime\}=7,\\dots,12,K<N′K<N^\{\\prime\}in every call\) and with the scattered setm∈\{2,3,5,7,8,11\}m\\in\\\{2,3,5,7,8,11\\\}: exact recovery of the counts in both\.

#### Small and intermediateKK\.

For constantKKthe problem is polynomial\-time even with continuous weights, by theO​\(K​NK\+1\)O\(K\\,N^\{K\+1\}\)enumeration corollary of Section[IV\-B](https://arxiv.org/html/2607.11956#S4.SS2)\(each coalition’s utility depends only on its top\-KKset, of which there areO​\(NK\)O\(N^\{K\}\)\); the hardness of parts \(b\), \(c\) therefore genuinely requiresKKgrowing withNN\. The intermediate regime \(e\.g\.K=polylog​NK=\\mathrm\{polylog\}\\,N\) is open; the natural route is the truncated extraction above combined with cardinality\-bounded \#Subset\-Sum, which we have not carried out \(Appendix[C\-I](https://arxiv.org/html/2607.11956#A3.SS9)\)\.

### C\-HMachine verification: exact scope

experiments/verify\_theorem3\.pyruns end\-to\-end in exact rational arithmetic \(fractions\.Fraction\) and exits0only if every assert passes \(run 2026\-07\-09: all checks passed\)\. Its exact\-rational Shapley oracle is anchored to the project’s enumeration oraclebrute\.py\(subset formula\) on3030random dyadic instances \(max abs\. diff\.3\.55×10−153\.55\\times 10^\{\-15\}, attributable to the float readout of the anchor\)\. The parts:part A\(Lemma[17](https://arxiv.org/html/2607.11956#Thmlemma17)atn=8n=8\),part B\(the Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(b\) dichotomy and its associated valuation*inequalities*\),part C\(the full Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(c\) pipeline on four instances, including multisets and an unsolvable case\), andpart D\(Lemma[20](https://arxiv.org/html/2607.11956#Thmlemma20)against brute force and the truncated extraction\)\. The shipped adversarial suiteverify\_theorem3\_adversarial\.pyadditionally verified: Lemma[15](https://arxiv.org/html/2607.11956#Thmlemma15)end\-to\-end on even\-TTinstances \(including a multiset and an unsolvable case\); the strictK<N′K<N^\{\\prime\}truncated\-extraction call setsm∈\{1,…,6\}m\\in\\\{1,\\dots,6\\\}andm∈\{2,3,5,7,8,11\}m\\in\\\{2,3,5,7,8,11\\\}\(the Cauchy case of Lemma[19](https://arxiv.org/html/2607.11956#Thmlemma19)\); the exact valuation identityval2⁡\(denom\)=2​t\+ν−val2⁡\(AT\)\\operatorname\{val\}\_\{2\}\(\\operatorname\{denom\}\)=2t\+\\nu\-\\operatorname\{val\}\_\{2\}\(A\_\{T\}\)on extremal multisets; Lemma[17](https://arxiv.org/html/2607.11956#Thmlemma17)atn=9n=9; and the parsimony counterexample and fix of Appendix[C\-E](https://arxiv.org/html/2607.11956#A3.SS5)\.

Honest caveats: the verified instances are small \(N′≤12N^\{\\prime\}\\leq 12\), because the ground truth is exhaustive enumeration; the proofs above do not rely on the experiments; the experiments certify that every algebraic step \(the value formulas \([63](https://arxiv.org/html/2607.11956#A3.E63)\) and \([75](https://arxiv.org/html/2607.11956#A3.E75)\), the22\-adic separation, the window extraction \([73](https://arxiv.org/html/2607.11956#A3.E73)\), and the system inversion \([74](https://arxiv.org/html/2607.11956#A3.E74)\)\) is implemented exactly as proved\.

### C\-IWhat remains open

#### Open 1 \(threshold/sign/comparison; real approximation\)\.

Given an instance and a rationalqqof polynomially many bits, is decidingϕi≥q\\phi\_\{i\}\\geq qNP\-hard? This \(equivalently the sign or pairwise\-comparison question\) isopen, in both directions\. The relation to real approximation is*one\-directional*: computingϕi\\phi\_\{i\}to additive error2−poly2^\{\-\\mathrm\{poly\}\}Turing\-reduces to the threshold decision by binary search over the \(polynomially bounded\) magnitude range; the converse fails, because part \(a\) permits reduced denominators of bit\-lengthΩ​\(Dw\)=2Ω​\(input\)\\Omega\(D\_\{w\}\)=2^\{\\Omega\(\\sqrt\{\\text\{input\}\}\)\}, soϕi−q\\phi\_\{i\}\-qcan be as small as2−exp2^\{\-\\exp\}, which no2−poly2^\{\-\\mathrm\{poly\}\}oracle can resolve\. Exactly where our techniques stop:

1. 1\.*No spike is expressible\.*All coalition information enters through the kernelsW↦v2/\(v\+W\)2W\\mapsto v^\{2\}/\(v\+W\)^\{2\}\(smooth, monotone rational functions of the weight\-sum with poles only atW=−v<0W=\-v<0\), while achievable sums lie in\[0,A\]\[0,A\]\. Detecting “some coalition hitsTTexactly” at the*magnitude*level would need a function≈0\\approx 0on all achievable sums except a spike atTT; a fixed polynomial\-size family of such kernels is a rational function of polynomial degree with all poles off\[0,A\]\[0,A\], and a nonzero rational function of degreeddhas at mostddreal zeros, so it cannot vanish on exponentially many lattice points while spiking at one\. Quantitatively \(Zolotarev\-type rational\-approximation bounds\), localizing a width\-11spike inside\[0,A\]\[0,A\]with poles bounded away from the interval costs degree polynomial inAA, not inlog⁡A\\log A\.
2. 2\.*Leading real bits carry only smooth aggregates\.*In thev≫Av\\gg Aregime,v2/\(v\+W\)2=∑k≥0\(k\+1\)​\(−W/v\)kv^\{2\}/\(v\+W\)^\{2\}=\\sum\_\{k\\geq 0\}\(k\+1\)\(\-W/v\)^\{k\}shows that the leadingO​\(poly\)O\(\\mathrm\{poly\}\)real bits ofϕi\\phi\_\{i\}encode the size\-weighted power sums∑ScN′​\(\|S\|\)​W​\(S\)k\\sum\_\{S\}c\_\{N^\{\\prime\}\}\(\|S\|\)\\,W\(S\)^\{k\}up tok=polyk=\\mathrm\{poly\}; polynomially many power sums do not determine the count of coalitions at one target sum when the support has exponentially many points \(moment indeterminacy\)\. In thev≈Av\\approx Aregime no term is separated at all\.
3. 3\.*22\-adic digits are not real binary digits\.*The \#P\-carrying information of part \(c\) sits at22\-adic positions≈2​t\\approx 2tbelow the valuation, an algebraic locality\. In the*real*expansion, theTT\-block−v2​AT/\(N′\!​22​t\)\-v^\{2\}A\_\{T\}/\(N^\{\\prime\}\!\\,2^\{2t\}\)and the smooth rest are interleavedΘ​\(1\)\\Theta\(1\)\-magnitude real numbers: real\-approximatingϕi\\phi\_\{i\}to2−poly2^\{\-\\mathrm\{poly\}\}neither yields the22\-adic digits nor is implied by them\. Our extraction fundamentally uses exact arithmetic access\.
4. 4\.*Coarse approximation is genuinely easy*, so any hardness of the threshold version must hide at exponentially fine scales: utilities are bounded, so permutation sampling gives additive1/poly1/\\mathrm\{poly\}approximation in polynomial time \(w\.h\.p\.\), and Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)gives certified additiveε\\varepsiloninpoly​\(1/ε\)\\mathrm\{poly\}\(1/\\varepsilon\)\. Hardness could therefore only occur on instances engineered so thatϕi\\phi\_\{i\}is2−poly2^\{\-\\mathrm\{poly\}\}\-close toqq\(consistent with, but not provable by, the machinery here\)\.

Honest reading: we*conjecture*the threshold version is hard \(the count is information\-theoretically present in the exact value\), but the smooth\-kernel obstruction blocks every route we tried: single\-size gadgets, coefficient\-cancelling multi\-point gadgets, large\-vvmoment readouts, and multi\-call interpolation \(polynomially many calls determine a rational function with polynomially many poles, butϕi​\(v\)\\phi\_\{i\}\(v\)as a function ofvvhas one pole per achievable subset\-sum, i\.e\. exponentially many\)\.

#### Open 2 \(small growingKK\)\.

Hardness forK=No​\(1\)K=N^\{o\(1\)\}\(e\.g\. polylogarithmicKK\), expected via the truncated extraction of Appendix[C\-G](https://arxiv.org/html/2607.11956#A3.SS7)combined with cardinality\-bounded \#Subset\-Sum; not carried out\.

#### Open 3 \(upper bounds for \(b\), \(c\)\)\.

We claim only hardness\. Membership \(e\.g\. ofDenom\-Precisionin NP, or ofDiginFP\#​P\\mathrm\{FP\}^\{\\\#\\mathrm\{P\}\}\) is unclear, because natural witnesses concern an exponentially long value\. The only upper bound we assert is Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)’s pseudo\-polynomial computation, which produces the full reduced fraction \(pseudo\-polynomial output\) and hence answers both queries in pseudo\-polynomial time, consistent with \(b\), \(c\), since a pseudo\-polynomial DP also solves \(\#\)Subset\-Sumoutright\.

## Appendix DFull Proof of Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)

This appendix supplies the complete proof of Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4), expanding the sketch of Section[IV\-E](https://arxiv.org/html/2607.11956#S4.SS5)\. We work in the notation of Section[IV](https://arxiv.org/html/2607.11956#S4): theNNtraining points are fixed in increasing distance to the queryx0x\_\{0\}\(rank11nearest\), each pointrrcarries a strictly positive lattice weightwr=ar​δww\_\{r\}=a\_\{r\}\\,\\delta\_\{w\}withar∈ℤ\>0a\_\{r\}\\in\\mathbb\{Z\}\_\{\>0\}, and for a coalitionS⊆\[N\]S\\subseteq\[N\]the settopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)consists of themin⁡\(K,\|S\|\)\\min\(K,\|S\|\)smallest\-rank members ofSS\. The Shapley value is \([8](https://arxiv.org/html/2607.11956#S4.E8)\) with coefficientscN​\(s\)=s\!​\(N−1−s\)\!/N\!c\_\{N\}\(s\)=s\!\\,\(N\-1\-s\)\!/N\!, and we adopt the conventioncN​\(s\)=0c\_\{N\}\(s\)=0fors<0s<0ors\>N−1s\>N\-1\.

The soft\-label model differs from the regression model of Section[IV](https://arxiv.org/html/2607.11956#S4)only in the target: instead of a scalaryr=br​δyy\_\{r\}=b\_\{r\}\\delta\_\{y\}, pointrrnow carries a*hard class label*yr∈\{1,…,C\}y\_\{r\}\\in\\\{1,\\dots,C\\\}, identified with the one\-hot vectoronehot​\(yr\)=eyr∈\{0,1\}C\\mathrm\{onehot\}\(y\_\{r\}\)=e\_\{y\_\{r\}\}\\in\\\{0,1\\\}^\{C\}\(ece\_\{c\}thecc\-th standard basis vector\)\. The query point has a true classy0∈\{1,…,C\}y\_\{0\}\\in\\\{1,\\dots,C\\\}\. Write the integer*class increment*of pointrras

vr:=ar​eyr∈ℤ≥0C,v\_\{r\}\\;:=\\;a\_\{r\}\\,e\_\{y\_\{r\}\}\\;\\in\\;\\mathbb\{Z\}\_\{\\geq 0\}^\{C\},\(76\)i\.e\. the vector that isara\_\{r\}in coordinateyry\_\{r\}and0elsewhere\. The soft prediction is the probability vector

p​\(S\)=∑j∈topK​\(S\)wj​eyj∑j∈topK​\(S\)wj∈ΔC−1,p​\(∅\)=pdef,p\(S\)\\;=\\;\\frac\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\\,e\_\{y\_\{j\}\}\}\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\}\\;\\in\\;\\Delta^\{C\-1\},\\qquad p\(\\varnothing\)=p\_\{\\mathrm\{def\}\},\(77\)withpdefp\_\{\\mathrm\{def\}\}a fixed default distribution \(uniform1/C1/Cunless stated\)\. We prove the four claims of Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4): \(D\.1\) exactness on the lattice through the same scale cancellation as Section[IV\-A](https://arxiv.org/html/2607.11956#S4.SS1); \(D\.2\) that the Brier and hard\-0/10/1utilities are deterministic functions of an integer moment*vector*; \(D\.3\) that substituting this vector for the scalarMMreruns the Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)no\-drop/droprecursion verbatim and exactly; \(D\.4\) the complexity, which grows by a factorO​\(DwC−1\)O\(D\_\{w\}^\{\\,C\-1\}\)and is hence exponential inCC; and \(D\.5\) the position against the unweighted soft\-label result\.

### D\-AD\.1: The class\-count vector and scale cancellation

For a coalitionSSdefine the*class\-count vector*

μ​\(S\)\\displaystyle\\mu\(S\)=\(M1​\(S\),…,MC​\(S\)\),\\displaystyle\\;=\\;\\big\(M\_\{1\}\(S\),\\dots,M\_\{C\}\(S\)\\big\),\(78\)Mc​\(S\)\\displaystyle M\_\{c\}\(S\)=∑j∈topK​\(S\)yj=caj∈ℤ≥0,\\displaystyle\\;=\\\!\\\!\\sum\_\{\\begin\{subarray\}\{c\}j\\in\\mathrm\{top\}\_\{K\}\(S\)\\\\ y\_\{j\}=c\\end\{subarray\}\}\\\!\\\!a\_\{j\}\\;\\in\\;\\mathbb\{Z\}\_\{\\geq 0\},so thatμ​\(S\)=∑j∈topK​\(S\)vj\\mu\(S\)=\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}v\_\{j\}is the sum of the class increments \([76](https://arxiv.org/html/2607.11956#A4.E76)\) of the top\-KKmembers, and let

W​\(S\)=∑j∈topK​\(S\)aj=∑c=1CMc​\(S\)\.W\(S\)\\;=\\;\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}a\_\{j\}\\;=\\;\\sum\_\{c=1\}^\{C\}M\_\{c\}\(S\)\.\(79\)
###### Lemma 21\(Lattice exactness of the soft prediction\)\.

For every coalitionSSwithtopK​\(S\)≠∅\\mathrm\{top\}\_\{K\}\(S\)\\neq\\varnothing,

p​\(S\)=1W​\(S\)​μ​\(S\)=\(M1​\(S\)W​\(S\),…,MC​\(S\)W​\(S\)\),p\(S\)\\;=\\;\\frac\{1\}\{W\(S\)\}\\,\\mu\(S\)\\;=\\;\\Big\(\\tfrac\{M\_\{1\}\(S\)\}\{W\(S\)\},\\dots,\\tfrac\{M\_\{C\}\(S\)\}\{W\(S\)\}\\Big\),\(80\)and in particularp​\(S\)p\(S\)depends onSSonly through the integer vectorμ​\(S\)\\mu\(S\); the weight scaleδw\\delta\_\{w\}cancels exactly\.

###### Proof\.

Every weight factors aswj=aj​δww\_\{j\}=a\_\{j\}\\delta\_\{w\}\. Substituting into \([77](https://arxiv.org/html/2607.11956#A4.E77)\) and reading off thecc\-th coordinate,

p​\(S\)c\\displaystyle p\(S\)\_\{c\}=∑j∈topK​\(S\)wj​\(eyj\)c∑j∈topK​\(S\)wj\\displaystyle=\\frac\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\\,\(e\_\{y\_\{j\}\}\)\_\{c\}\}\{\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}w\_\{j\}\}\(81\)=δw​∑j∈topK​\(S\),yj=cajδw​∑j∈topK​\(S\)aj=Mc​\(S\)W​\(S\),\\displaystyle=\\frac\{\\delta\_\{w\}\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\),\\,y\_\{j\}=c\}a\_\{j\}\}\{\\delta\_\{w\}\\sum\_\{j\\in\\mathrm\{top\}\_\{K\}\(S\)\}a\_\{j\}\}=\\frac\{M\_\{c\}\(S\)\}\{W\(S\)\},using\(eyj\)c=𝟏​\[yj=c\]\(e\_\{y\_\{j\}\}\)\_\{c\}=\\mathbf\{1\}\[y\_\{j\}=c\]andtopK​\(S\)≠∅⇒W​\(S\)≥1\\mathrm\{top\}\_\{K\}\(S\)\\neq\\varnothing\\Rightarrow W\(S\)\\geq 1\. The common factorδw\\delta\_\{w\}cancels between numerator and denominator, so \([80](https://arxiv.org/html/2607.11956#A4.E80)\) holds and the right\-hand side is a function of the integer vectorμ​\(S\)\\mu\(S\)alone \(withW​\(S\)=∑cMc​\(S\)W\(S\)=\\sum\_\{c\}M\_\{c\}\(S\)read off from it\)\. ∎

Equation \([80](https://arxiv.org/html/2607.11956#A4.E80)\) is exactly the vector analogue of the scalar cancellationy^​\(S\)=δy​M/W\\hat\{y\}\(S\)=\\delta\_\{y\}M/Wof Section[IV\-A](https://arxiv.org/html/2607.11956#S4.SS1): the shared normalization denominator∑topKwj=W​δw\\sum\_\{\\mathrm\{top\}\_\{K\}\}w\_\{j\}=W\\delta\_\{w\}is the same term as in the regression ratio \([7](https://arxiv.org/html/2607.11956#S4.E7)\)\. Becausep​\(S\)p\(S\)is recovered from the integer stateμ​\(S\)\\mu\(S\)with*no*rounding, the counting DP below is exact rather than merely discretized\. Note also thatμ​\(S\)\\mu\(S\)carries one redundant coordinate: givenM1​\(S\),…,MC−1​\(S\)M\_\{1\}\(S\),\\dots,M\_\{C\-1\}\(S\)andW​\(S\)W\(S\), the last count isMC​\(S\)=W​\(S\)−∑c<CMc​\(S\)M\_\{C\}\(S\)=W\(S\)\-\\sum\_\{c<C\}M\_\{c\}\(S\), so the state hasC−1C\-1free class coordinates at each weight\-totalWW\.

### D\-BD\.2: The utility is a deterministic function ofμ​\(S\)\\mu\(S\)

Define a single utility functionu:ℤ≥0C→ℝu:\\mathbb\{Z\}\_\{\\geq 0\}^\{C\}\\to\\mathbb\{R\}on the integer state, so thatU​\(S\)=u​\(μ​\(S\)\)U\(S\)=u\\big\(\\mu\(S\)\\big\)with the empty\-window conventionμ​\(∅\)=𝟎\\mu\(\\varnothing\)=\\mathbf\{0\}\. WritingW=∑cμcW=\\sum\_\{c\}\\mu\_\{c\}, set

*Brier utility\.*

uBr​\(μ\)=\{−∑c=1C\(μcW−𝟏​\[c=y0\]\)2,W≥1,−∑c=1C\(pdef,c−𝟏​\[c=y0\]\)2,W=0,u\_\{\\mathrm\{Br\}\}\(\\mu\)=\\begin\{cases\}\-\\displaystyle\\sum\_\{c=1\}^\{C\}\\Big\(\\frac\{\\mu\_\{c\}\}\{W\}\-\\mathbf\{1\}\[c=y\_\{0\}\]\\Big\)^\{2\},&W\\geq 1,\\\\\[6\.02773pt\] \-\\displaystyle\\sum\_\{c=1\}^\{C\}\\big\(p\_\{\\mathrm\{def\},c\}\-\\mathbf\{1\}\[c=y\_\{0\}\]\\big\)^\{2\},&W=0,\\end\{cases\}\(82\)which isU​\(S\)=−‖p​\(S\)−ey0‖22U\(S\)=\-\\\|p\(S\)\-e\_\{y\_\{0\}\}\\\|\_\{2\}^\{2\}by Lemma[21](https://arxiv.org/html/2607.11956#Thmlemma21)\.

*Hard0/10/1utility\.*

uhd​\(μ\)=\{𝟏​\[argmaxc↓⁡μc=y0\],W≥1,𝟏​\[argmaxc↓⁡pdef,c=y0\],W=0,u\_\{\\mathrm\{hd\}\}\(\\mu\)=\\begin\{cases\}\\mathbf\{1\}\\big\[\\,\\operatorname\{argmax\}^\{\\downarrow\}\_\{c\}\\ \\mu\_\{c\}=y\_\{0\}\\,\\big\],&W\\geq 1,\\\\\[2\.58334pt\] \\mathbf\{1\}\\big\[\\,\\operatorname\{argmax\}^\{\\downarrow\}\_\{c\}\\ p\_\{\\mathrm\{def\},c\}=y\_\{0\}\\,\\big\],&W=0,\\end\{cases\}\(83\)whereargmax↓\\operatorname\{argmax\}^\{\\downarrow\}breaks ties by*lowest index*\.

###### Lemma 22\(Well\-definedness and integer decidability of the hard utility\)\.

ForW​\(S\)≥1W\(S\)\\geq 1,argmaxc↓⁡p​\(S\)c=argmaxc↓⁡Mc​\(S\)\\operatorname\{argmax\}^\{\\downarrow\}\_\{c\}\\,p\(S\)\_\{c\}=\\operatorname\{argmax\}^\{\\downarrow\}\_\{c\}\\,M\_\{c\}\(S\); henceuhdu\_\{\\mathrm\{hd\}\}in \([83](https://arxiv.org/html/2607.11956#A4.E83)\) equals𝟏​\[argmaxc↓⁡p​\(S\)c=y0\]\\mathbf\{1\}\[\\operatorname\{argmax\}^\{\\downarrow\}\_\{c\}p\(S\)\_\{c\}=y\_\{0\}\], is well\-defined on every coalition, and is decided by comparisons of*integers*only\.

###### Proof\.

By Lemma[21](https://arxiv.org/html/2607.11956#Thmlemma21),p​\(S\)c=Mc​\(S\)/W​\(S\)p\(S\)\_\{c\}=M\_\{c\}\(S\)/W\(S\)with the*same*strictly positive denominatorW​\(S\)W\(S\)for allcc\. Multiplying byW​\(S\)\>0W\(S\)\>0preserves the order of the coordinates and preserves equalities, sop​\(S\)b≥p​\(S\)c⇔Mb​\(S\)≥Mc​\(S\)p\(S\)\_\{b\}\\geq p\(S\)\_\{c\}\\iff M\_\{b\}\(S\)\\geq M\_\{c\}\(S\)andp​\(S\)b=p​\(S\)c⇔Mb​\(S\)=Mc​\(S\)p\(S\)\_\{b\}=p\(S\)\_\{c\}\\iff M\_\{b\}\(S\)=M\_\{c\}\(S\)\. Therefore the ordering, including the set of maximizers, coincides forp​\(S\)p\(S\)andμ​\(S\)\\mu\(S\), and the lowest\-index tie\-break selects the same class\. The comparison is between the integersMc​\(S\)M\_\{c\}\(S\), so no floating\-point threshold is involved and the value is unambiguous\. ∎

Thus for both losses,U​\(S\)=u​\(μ​\(S\)\)U\(S\)=u\(\\mu\(S\)\)for a fixed deterministicuuthat is invariant toδw\\delta\_\{w\}\(it sees onlyμ\\mu\)\. This is the precise soft\-label analogue of the regression factU​\(S\)=−ℓ​\(δy​M​\(S\)/W​\(S\),y0\)U\(S\)=\-\\ell\(\\delta\_\{y\}M\(S\)/W\(S\),y\_\{0\}\), with the scalar momentMMreplaced by the vectorμ\\mu\. Everything the Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)recursion uses about the utility is \(i\)U​\(S\)U\(S\)depends onSSonly through a finite integer state, \(ii\) that state is additive over the members oftopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\), and \(iii\)δw\\delta\_\{w\}cancels\. Lemmas[21](https://arxiv.org/html/2607.11956#Thmlemma21)–[22](https://arxiv.org/html/2607.11956#Thmlemma22)establish all three for the vector state, so the recursion transfers unchanged; we now spell it out\.

### D\-CD\.3: The vector\-stateno\-drop/droprecursion

Fix the pointiiwhose value we compute\. We prove

ϕi=ΦiND\+ΦiDR\\phi\_\{i\}=\\Phi^\{\\mathrm\{ND\}\}\_\{i\}\+\\Phi^\{\\mathrm\{DR\}\}\_\{i\}\(84\)by partitioning the coalitionsS⊆\[N\]∖\{i\}S\\subseteq\[N\]\\setminus\\\{i\\\}of \([8](https://arxiv.org/html/2607.11956#S4.E8)\) into\|S\|≤K−1\|S\|\\leq K\-1\(no\-drop\) and\|S\|≥K\|S\|\\geq K\(drop\), and evaluating each part by a size\-indexed counting DP whose only change from Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)is that the additive scalar key\(W,M\)\(W,M\)is replaced by the additive vector keyμ∈ℤ≥0C\\mu\\in\\mathbb\{Z\}\_\{\\geq 0\}^\{C\}\(incrementvrv\_\{r\}per point\)\. Adding a pointrrof classyry\_\{r\}and weight\-unitara\_\{r\}addsvr=ar​eyrv\_\{r\}=a\_\{r\}e\_\{y\_\{r\}\}to the key, exactly mirroring the scalar update\(W,M\)↦\(W\+ar,M\+ar​br\)\(W,M\)\\mapsto\(W\+a\_\{r\},\\,M\+a\_\{r\}b\_\{r\}\)\.

#### no\-dropbranch \(\|S\|≤K−1\|S\|\\leq K\-1\)\.

Here\|S∪\{i\}\|≤K\|S\\cup\\\{i\\\}\|\\leq K, sotopK​\(S\)=S\\mathrm\{top\}\_\{K\}\(S\)=SandtopK​\(S∪\{i\}\)=S∪\{i\}\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=S\\cup\\\{i\\\}, whenceμ​\(S\)=∑j∈Svj\\mu\(S\)=\\sum\_\{j\\in S\}v\_\{j\}andμ​\(S∪\{i\}\)=μ​\(S\)\+vi\\mu\(S\\cup\\\{i\\\}\)=\\mu\(S\)\+v\_\{i\}\. The marginal

U​\(S∪\{i\}\)−U​\(S\)=u​\(μ​\(S\)\+vi\)−u​\(μ​\(S\)\)U\(S\\cup\\\{i\\\}\)\-U\(S\)=u\\big\(\\mu\(S\)\+v\_\{i\}\\big\)\-u\\big\(\\mu\(S\)\\big\)\(85\)depends onSSonly through the size\|S\|=s\|S\|=s\(fixing the coefficientcN​\(s\)c\_\{N\}\(s\)\) and the vectorμ​\(S\)\\mu\(S\)\. Grouping coalitions by these two quantities, define the size\-indexed count

N0​\[s\]​\[k\]=\#​\{S⊆\[N\]∖\{i\}:\|S\|=s,∑j∈Svj=k\},0≤s≤K−1,\\begin\{split\}N\_\{0\}\[s\]\[k\]=\{\}&\\\#\\Big\\\{S\\subseteq\[N\]\\setminus\\\{i\\\}:\\ \|S\|=s,\\ \\textstyle\\sum\_\{j\\in S\}v\_\{j\}=k\\Big\\\},\\\\ &0\\leq s\\leq K\-1,\\end\{split\}\(86\)computed by one knapsack DP that inserts each pointj≠ij\\neq iand addsvjv\_\{j\}to the vector key\. Then

ΦiND=∑s=0K−1cN​\(s\)​∑kN0​\[s\]​\[k\]​\(u​\(k\+vi\)−u​\(k\)\),\\Phi^\{\\mathrm\{ND\}\}\_\{i\}=\\sum\_\{s=0\}^\{K\-1\}c\_\{N\}\(s\)\\sum\_\{k\}N\_\{0\}\[s\]\[k\]\\,\\Big\(u\(k\+v\_\{i\}\)\-u\(k\)\\Big\),\(87\)where thes=0s=0term is the single empty coalition \(k=𝟎k=\\mathbf\{0\},u​\(𝟎\)=U​\(∅\)u\(\\mathbf\{0\}\)=U\(\\varnothing\)frompdefp\_\{\\mathrm\{def\}\}\)\. Equation \([87](https://arxiv.org/html/2607.11956#A4.E87)\) is term\-for\-term theno\-dropsum of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)with\(W,M\)\(W,M\)replaced bykk\.

#### dropbranch \(\|S\|≥K\|S\|\\geq K\)\.

NowtopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\)has exactlyKKmembers\. Addingiichanges the prediction only ifiienterstopK​\(S∪\{i\}\)\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\), i\.e\. iff fewer thanKKmembers ofSSare nearer thanii\. Let

A=S∩\{1,…,i−1\},a=\|A\|\.A=S\\cap\\\{1,\\dots,i\-1\\\},\\qquad a=\|A\|\.\(88\)Ifa≥Ka\\geq KthentopK​\(S∪\{i\}\)=topK​\(S\)\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=\\mathrm\{top\}\_\{K\}\(S\)and the marginal is0; such coalitions contribute nothing and may be dropped\. So assumea≤K−1a\\leq K\-1\. Because ranks are fixed andiiis nearer than every point of rank\>i\>i, the two windows are

topK​\(S∪\{i\}\)\\displaystyle\\mathrm\{top\}\_\{K\}\(S\\cup\\\{i\\\}\)=A∪\{i\}∪B,\\displaystyle=A\\ \\cup\\ \\\{i\\\}\\ \\cup\\ B,\(89\)topK​\(S\)\\displaystyle\\mathrm\{top\}\_\{K\}\(S\)=A∪B∪\{e\},\\displaystyle=A\\ \\cup\\ B\\ \\cup\\ \\\{e\\\},\(90\)whereBBis the set of theK−1−aK\-1\-anearest members ofSSwith rank\>i\>i, andeeis the next one, the\(K−a\)\(K\-a\)\-th nearest member ofSSbeyondii, the*boundary point*thatiidisplaces\. Writing the shared base statebase=μ​\(A\)\+∑j∈Bvj\\mathrm\{base\}=\\mu\(A\)\+\\sum\_\{j\\in B\}v\_\{j\}\(a sum ofK−1K\-1increments, so\|A∪B\|=K−1<K\|A\\cup B\|=K\-1<Kand its top\-KKis itself\), the marginal is

U​\(S∪\{i\}\)−U​\(S\)=u​\(base\+vi\)−u​\(base\+ve\),U\(S\\cup\\\{i\\\}\)\-U\(S\)=u\\big\(\\mathrm\{base\}\+v\_\{i\}\\big\)\-u\\big\(\\mathrm\{base\}\+v\_\{e\}\\big\),\(91\)which depends only onAA,BB,eeandii, not on any member ofSSof rank\>e\>e\. Indeed, every point ofSSsplits uniquely as

S=A⊔B⊔\{e\}⊔F,F=S∩\{e\+1,…,N\},S\\;=\\;A\\ \\sqcup\\ B\\ \\sqcup\\ \\\{e\\\}\\ \\sqcup\\ F,\\qquad F=S\\cap\\\{e\+1,\\dots,N\\\},\(92\)whereA⊆\{1,…,i−1\}A\\subseteq\\\{1,\\dots,i\-1\\\}\(\|A\|=a\|A\|=a\),B=S∩\{i\+1,…,e−1\}B=S\\cap\\\{i\+1,\\dots,e\-1\\\}with\|B\|=K−1−a\|B\|=K\-1\-a\(all members ofSSstrictly betweeniiandeelie intopK\\mathrm\{top\}\_\{K\}\),eeis present, andFFis an*arbitrary*subset of thege:=N−eg\_\{e\}:=N\-eranks farther thanee\. This decomposition is a bijection between entering coalitionsSS\(with\|S\|≥K\|S\|\\geq K\) and tuples\(A,B,e,F\)\(A,B,e,F\): givenSS,AAandaaare determined,eeis the farthest member oftopK​\(S\)\\mathrm\{top\}\_\{K\}\(S\),B=topK​\(S\)∖\(A∪\{e\}\)B=\\mathrm\{top\}\_\{K\}\(S\)\\setminus\(A\\cup\\\{e\\\}\), andF=S∖topK​\(S\)F=S\\setminus\\mathrm\{top\}\_\{K\}\(S\)\. Hence each coalition is counted exactly once, and jointly with theno\-dropbranch everyS⊆\[N\]∖\{i\}S\\subseteq\[N\]\\setminus\\\{i\\\}is counted once, establishing \([84](https://arxiv.org/html/2607.11956#A4.E84)\) without double counting\.

The coalition size is\|S\|=a\+\(K−1−a\)\+1\+\|F\|=K\+\|F\|\|S\|=a\+\(K\-1\-a\)\+1\+\|F\|=K\+\|F\|, so its Shapley coefficient iscN​\(K\+\|F\|\)c\_\{N\}\(K\+\|F\|\)and depends onFFonly through\|F\|\|F\|\. Since the marginal \([91](https://arxiv.org/html/2607.11956#A4.E91)\) is independent ofFF, summing over allF⊆\{e\+1,…,N\}F\\subseteq\\\{e\+1,\\dots,N\\\}factors out the tail weight

TS​\(ge\)=∑j=0ge\(gej\)​cN​\(K\+j\),ge=N−e,\\mathrm\{TS\}\(g\_\{e\}\)\\;=\\;\\sum\_\{j=0\}^\{g\_\{e\}\}\\binom\{g\_\{e\}\}\{j\}\\,c\_\{N\}\(K\+j\),\\qquad g\_\{e\}=N\-e,\(93\)identical to the tail weight of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)\(onlyK\+j≤N−1K\+j\\leq N\-1contribute, ascNc\_\{N\}vanishes otherwise\)\. Grouping the closer setAAand the between setBBby their vector states through the counts

La​\[k1\]\\displaystyle L\_\{a\}\[k\_\{1\}\]=\#​\{A⊆\{1,…,i−1\}:\|A\|=a,∑j∈Avj=k1\},\\displaystyle=\\\#\\\{A\\subseteq\\\{1,\\dots,i\-1\\\}:\|A\|=a,\\ \\textstyle\\sum\_\{j\\in A\}v\_\{j\}=k\_\{1\}\\\},\(94\)Ri,et​\[k2\]\\displaystyle R^\{\\,t\}\_\{i,e\}\[k\_\{2\}\]=\#\{B⊆\{i\+1,…,e−1\}:\\displaystyle=\\\#\\\{B\\subseteq\\\{i\+1,\\dots,e\-1\\\}:\|B\|=t,∑j∈Bvj=k2\},\\displaystyle\\hphantom\{\{\}=\\\#\\\{\}\|B\|=t,\\ \\textstyle\\sum\_\{j\\in B\}v\_\{j\}=k\_\{2\}\\\},\(95\)gives

ΦiDR=\\displaystyle\\Phi^\{\\mathrm\{DR\}\}\_\{i\}=\{\}∑e=i\+1NTS​\(ge\)​∑a=0K−1∑k1,k2La​\[k1\]​Ri,eK−1−a​\[k2\]\\displaystyle\\sum\_\{e=i\+1\}^\{N\}\\mathrm\{TS\}\(g\_\{e\}\)\\sum\_\{a=0\}^\{K\-1\}\\sum\_\{k\_\{1\},k\_\{2\}\}L\_\{a\}\[k\_\{1\}\]\\,R^\{\\,K\-1\-a\}\_\{i,e\}\[k\_\{2\}\]\(96\)×\(u​\(k1\+k2\+vi\)−u​\(k1\+k2\+ve\)\)\.\\displaystyle\\times\\Big\(u\(k\_\{1\}\{\+\}k\_\{2\}\{\+\}v\_\{i\}\)\-u\(k\_\{1\}\{\+\}k\_\{2\}\{\+\}v\_\{e\}\)\\Big\)\.The countsLaL\_\{a\}are built once by a knapsack over ranks<i<i; the countsRi,etR^\{t\}\_\{i,e\}are accumulated incrementally by adding one incrementvev\_\{e\}after each boundaryeeis processed, so that at boundaryeethey range over ranks in\(i,e\)\(i,e\)\. This is exactly the DROP recursion of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)with the scalar convolution replaced by the vector convolutionLa∗Ri,eK−1−aL\_\{a\}\\\!\*\\\!R^\{K\-1\-a\}\_\{i,e\}over class\-count keys\. Finally, formingBBrequiresK−1K\-1members from ranks<e<e\(excludingii\), which exist only whene−2≥K−1e\-2\\geq K\-1, i\.e\.e≥K\+1e\\geq K\+1; fore≤Ke\\leq Kthe countsRi,eK−1−aR^\{K\-1\-a\}\_\{i,e\}are empty and the term vanishes automatically\. ConsequentlyK\+\|F\|≤N−1K\+\|F\|\\leq N\-1always holds, so every coefficientcN​\(K\+\|F\|\)c\_\{N\}\(K\+\|F\|\)invoked in \([93](https://arxiv.org/html/2607.11956#A4.E93)\) is a genuine \(nonzero\-range\) Shapley weight\.

###### Proposition 2\(Exactness\)\.

For every pointii,ϕi=ΦiND\+ΦiDR\\phi\_\{i\}=\\Phi^\{\\mathrm\{ND\}\}\_\{i\}\+\\Phi^\{\\mathrm\{DR\}\}\_\{i\}withΦiND,ΦiDR\\Phi^\{\\mathrm\{ND\}\}\_\{i\},\\Phi^\{\\mathrm\{DR\}\}\_\{i\}given by \([87](https://arxiv.org/html/2607.11956#A4.E87)\) and \([96](https://arxiv.org/html/2607.11956#A4.E96)\), and the computation is exact on the lattice for both the Brier and hard\-0/10/1utilities\.

###### Proof\.

Theno\-drop/dropsplit partitions\{S⊆\[N\]∖\{i\}\}\\\{S\\subseteq\[N\]\\setminus\\\{i\\\}\\\}by\|S\|≶K\|S\|\\lessgtr K, and withindropthe non\-entering coalitions \(a≥Ka\\geq K\) have zero marginal\. By \([92](https://arxiv.org/html/2607.11956#A4.E92)\) the entering coalitions are in bijection with\(A,B,e,F\)\(A,B,e,F\), each counted once, so summing \([85](https://arxiv.org/html/2607.11956#A4.E85)\) and \([91](https://arxiv.org/html/2607.11956#A4.E91)\) weighted bycN​\(\|S\|\)c\_\{N\}\(\|S\|\)reproduces \([8](https://arxiv.org/html/2607.11956#S4.E8)\) exactly; the reorganizations \([87](https://arxiv.org/html/2607.11956#A4.E87)\), \([96](https://arxiv.org/html/2607.11956#A4.E96)\) only regroup identical terms by the vector state and factor theFF\-sum intoTS\\mathrm\{TS\}\. Exactness on the lattice is Lemma[21](https://arxiv.org/html/2607.11956#Thmlemma21)\(the stateμ\\mureproducesp​\(S\)p\(S\)withδw\\delta\_\{w\}cancelled\) together with the fact thatuuin \([82](https://arxiv.org/html/2607.11956#A4.E82)\)–\([83](https://arxiv.org/html/2607.11956#A4.E83)\) is evaluated on integer vectors: for the hard loss the value is integer\-decided \(Lemma[22](https://arxiv.org/html/2607.11956#Thmlemma22)\), and for the Brier loss the only inexactness is the final floating\-point evaluation of the rationaluBr​\(μ\)u\_\{\\mathrm\{Br\}\}\(\\mu\), which is the same arithmetic the exhaustive oracle performs\. ∎

Proposition[2](https://arxiv.org/html/2607.11956#Thmproposition2)is the promised statement that the scalar\-MMrecursion of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)*reruns identically*onceMMis replaced by the class\-count vectorμ\\mu: the branch structure, the boundary bookkeeping, and the tail weightTS\\mathrm\{TS\}are literally unchanged, and only the key type \(scalar→\\tovector\) and the utility readout \(y^=δy​M/W→p=μ/W\\hat\{y\}=\\delta\_\{y\}M/W\\to p=\\mu/W\) differ\.

### D\-DD\.4: Complexity, theO​\(DwC−1\)O\(D\_\{w\}^\{\\,C\-1\}\)blow\-up inCC

LetDw=1\+∑rarD\_\{w\}=1\+\\sum\_\{r\}a\_\{r\}as in Section[IV\-A](https://arxiv.org/html/2607.11956#S4.SS1)\. Every reachable stateμ=\(M1,…,MC\)\\mu=\(M\_\{1\},\\dots,M\_\{C\}\)satisfiesMc≥0M\_\{c\}\\geq 0and∑cMc=W≤∑rar<Dw\\sum\_\{c\}M\_\{c\}=W\\leq\\sum\_\{r\}a\_\{r\}<D\_\{w\}, so the states lie in the truncated simplex

𝒢\\displaystyle\\mathcal\{G\}=\{μ∈ℤ≥0C:∑cMc≤Dw\},\\displaystyle=\\big\\\{\\mu\\in\\mathbb\{Z\}\_\{\\geq 0\}^\{C\}:\\ \\textstyle\\sum\_\{c\}M\_\{c\}\\leq D\_\{w\}\\big\\\},\(97\)\|𝒢\|\\displaystyle\|\\mathcal\{G\}\|=\(Dw\+CC\)=Θ​\(DwCC\!\)\.\\displaystyle=\\binom\{D\_\{w\}\+C\}\{C\}=\\Theta\\\!\\Big\(\\tfrac\{D\_\{w\}^\{\\,C\}\}\{C\!\}\\Big\)\.Equivalently: for each of theO​\(Dw\)O\(D\_\{w\}\)weight\-totalsWW\(the sole quantity a scalar weight\-count would track\), the compositions ofWWintoCCnonnegative class counts number\(W\+C−1C−1\)=O​\(DwC−1\)\\binom\{W\+C\-1\}\{C\-1\}=O\(D\_\{w\}^\{\\,C\-1\}\)\. The class refinement therefore enlarges the state grid by a multiplicative factorO​\(DwC−1\)O\(D\_\{w\}^\{\\,C\-1\}\)over the single weight\-count, which is the exact source of the exponential dependence onCC\. \(There is no separate target\-spread factorDyD\_\{y\}: the labels are categorical, andDyD\_\{y\}of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)is subsumed into the class axes\.\)

Substituting\|𝒢\|=O​\(DwC\)\|\\mathcal\{G\}\|=O\(D\_\{w\}^\{\\,C\}\)for theO​\(Dw​Dy\)O\(D\_\{w\}D\_\{y\}\)grid of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)throughout its analysis \(O​\(N​K\)O\(NK\)knapsack layers each over𝒢\\mathcal\{G\}, and anO​\(\|𝒢\|\)O\(\|\\mathcal\{G\}\|\)\-size convolution at each of theO​\(N\)O\(N\)boundaries\) yields

time​O​\(N2​K​Dw2​C\),space​O​\(N​K​DwC\),\\text\{time \}\\ O\\\!\\big\(N^\{2\}\\,K\\,D\_\{w\}^\{\\,2C\}\\big\),\\qquad\\text\{space \}\\ O\\\!\\big\(N\\,K\\,D\_\{w\}^\{\\,C\}\\big\),\(98\)the Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)bound with the two\-dimensional factor\(Dw​Dy\)\(D\_\{w\}D\_\{y\}\)replaced by theCC\-dimensional gridDwCD\_\{w\}^\{\\,C\}\. This is pseudo\-polynomial inDwD\_\{w\}and polynomial inNNandKK, but exponential in the number of classesCC; Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)is therefore scoped to smallCC\. ForC=2C=2the free part of the state is a single count \(one class fixes the other viaWW\), recovering a scalar\-grid DP of the same order as Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1); the cost grows by one extraDwD\_\{w\}factor per additional class\.

### D\-ED\.5: Position against the unweighted soft\-label result

In the*unweighted*soft\-labelkkNN of\[[17](https://arxiv.org/html/2607.11956#bib.bib17)\]\(arXiv:2304\.04258\), every top\-KKneighbor contributes an equal1/K1/Kto the class histogram, so for\|S\|≥K\|S\|\\geq Kthe denominator is the constant countW=KW=Kandp​\(S\)c=1K​\#​\{j∈topK​\(S\):yj=c\}p\(S\)\_\{c\}=\\frac\{1\}\{K\}\\\#\\\{j\\in\\mathrm\{top\}\_\{K\}\(S\):y\_\{j\}=c\\\}\. The prediction is then*additive*over neighbors \(each present neighbor independently adds1/K1/Kto one class coordinate\) and Jia et al\.’s additiveO​\(N​log⁡N\)O\(N\\log N\)recursion\[[14](https://arxiv.org/html/2607.11956#bib.bib14)\]applies verbatim to each class channel\. The weighting destroys this additivity for exactly the reason isolated in the Positioning Lemma[1](https://arxiv.org/html/2607.11956#Thmlemma1): withwj=aj​δww\_\{j\}=a\_\{j\}\\delta\_\{w\}, a present neighbor contributeswj/∑topKwj=aj/Ww\_\{j\}/\\\!\\sum\_\{\\mathrm\{top\}\_\{K\}\}w\_\{j\}=a\_\{j\}/W, and the denominatorWWis now a*coalition\-dependent*weighted sum that couples all top\-KKmembers\. Two coalitions with equal per\-class weight\-sumsMcM\_\{c\}but different totalsWWreceive different predictionsp=μ/Wp=\\mu/W, so no single one\-dimensional count \(of any class channel, or ofWWalone\) determinesp​\(S\)p\(S\); the joint vector stateμ=\(M1,…,MC\)\\mu=\(M\_\{1\},\\dots,M\_\{C\}\)must be tracked\. This is the same normalization obstruction that blocks the threshold/additive routes for regression \(Section[III](https://arxiv.org/html/2607.11956#S3)\), and it is precisely what the vector\-MMDP of §[D\-C](https://arxiv.org/html/2607.11956#A4.SS3)removes\. The denominator, absent in the unweighted case and in hard\-label weighted classification\[[20](https://arxiv.org/html/2607.11956#bib.bib20)\], is the new obstruction that Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)overcomes\.

### D\-FD\.6: Verification

The vector\-state DP \(§[D\-C](https://arxiv.org/html/2607.11956#A4.SS3)\) was checked against an independent exhaustive soft\-label oracle that evaluates \([8](https://arxiv.org/html/2607.11956#S4.E8)\) directly over all2N−12^\{N\-1\}coalitions; the oracle is itself cross\-validated by an independent permutation\-formula implementation and by the efficiency axiom∑iϕi=U​\(\[N\]\)−U​\(∅\)\\sum\_\{i\}\\phi\_\{i\}=U\(\[N\]\)\-U\(\\varnothing\), and both are anchored on a hand\-checkablen=3,K=2,C=2n=3,K=2,C=2Brier instance\. Over5,1125\{,\}112synthetic\-lattice soft\-label instances withC∈\{2,3\}C\\in\\\{2,3\\\},K∈\{1,2,3,5\}K\\in\\\{1,2,3,5\\\}, both losses, and adversarial regimes \(equal weights, extreme weight ratios, one dominant class,\|S\|<K\|S\|<Kwindows, and argmax ties\), the DP matched the oracle to a maximum absolute deviation of1\.5×10−131\.5\\times 10^\{\-13\}, a0\-mismatch pass at machine precision, consistent with Proposition[2](https://arxiv.org/html/2607.11956#Thmproposition2)\(the residual is the floating\-point readout of the Brier utility; the hard\-0/10/1values, decided on integers by Lemma[22](https://arxiv.org/html/2607.11956#Thmlemma22), agree exactly\)\. This matches the exact\-lattice guarantee claimed for Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)in Section[IV\-E](https://arxiv.org/html/2607.11956#S4.SS5)\.

## Appendix EPre\-Registration Summary

The protocol below was registered before any experiment in the main paper was run, and before the manuscript was drafted\. We reproduce it here in condensed form so that a reviewer can check the paper’s compliance and identify deviations\. Every hypothesis carries a pre\-registered null branch; every claimed null in the paper is earned by the equivalence procedure of Appendix[E](https://arxiv.org/html/2607.11956#A5)rather than asserted from a failure to reject\.

### E\-AResearch questions and hypotheses

We registered five research questions, each paired with a directional hypothesis and an explicit null branch that fixes, in advance, what we would conclude and how we would report if the hypothesis did not hold\.

RQ1 / H1 \(exactness, gate\)\.Exact Shapley for weightedkk\-NN regression, with utilityU​\(S\)=−ℓ​\(y^​\(S\),y0\)U\(S\)=\-\\ell\(\\hat\{y\}\(S\),y\_\{0\}\)andy^​\(S\)=δy​M/W\\hat\{y\}\(S\)=\\delta\_\{y\}M/Wover the joint integer state\(W,M\)\(W,M\), is computable in \(pseudo\-\)polynomial time on lattice inputs \(wr=ar​δww\_\{r\}=a\_\{r\}\\delta\_\{w\},yr=br​δyy\_\{r\}=b\_\{r\}\\delta\_\{y\},ar∈ℤ\>0a\_\{r\}\\in\\mathbb\{Z\}\_\{\>0\},br∈ℤb\_\{r\}\\in\\mathbb\{Z\}\)\.*Gate:*the counting DP of Theorem[1](https://arxiv.org/html/2607.11956#Thmtheorem1)matches exhaustive enumeration with0mismatches over≥10,000\\geq 10\{,\}000random and adversarial instances atN≤20N\\leq 20\.*Null:*an unrepairable flaw in the DP is discovered within the time\-boxed repair window; the topic is abandoned at Stage 0 and no null result is published \(see kill criterion K1\)\.

RQ2 / H2 \(FPTAS\)\.For continuous weights and targets, lattice rounding yields a poly\(N,K,1/ε\)\(N,K,1/\\varepsilon\)algorithm whose per\-value additive\-ε\\varepsiloncertificate is never violated empirically\.*Null:*the denominator lower bound required by the certificate fails for unbounded kernels; Theorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)is rescoped, in the paper’s own wording, to bounded\-below kernels \(Gaussian, truncated/clipped inverse\-distance\)\.

RQ3 / H3 \(complexity, branch\)\.Exact Shapley under continuous weights is \#P\-hard\.*Null:*neither the hardness proof nor its refutation lands within the time box; we publish an explicit conjecture together with an obstruction analysis rather than a claimed theorem \(Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)is stated as a branch and is never load\-bearing for the paper’s main claim\)\.

RQ4 / H4 \(downstream detection\)\.Exact values match or beat Monte\-Carlo Data Shapley and Data\-OOB on mislabel / noisy\-point detection AUC at matched utility\-evaluation budgets\.*Null \(pre\-registered as the likely and acceptable outcome\):*detection parity\. In that case we do*not*claim a detection improvement; we claim exact, certified, deterministic values obtained at a fraction of the Monte\-Carlo budget needed to stabilize the same ranking, and we support the parity claim with the equivalence test below\.

RQ5 / H5 \(Monte\-Carlo price\)\.Permutation\-sampling Monte\-Carlo requires at least10×10\\timesthe DP’s utility\-evaluation budget to recover the exact top\-10%10\\%ranking \(Kendall\-τ≥0\.95\\tau\\geq 0\.95and top\-kkJaccard≥0\.9\\geq 0\.9\) with probability0\.90\.9\.*Null:*Monte\-Carlo is cheaper than forecast; we report the measured budget\-to\-threshold price curve as found and sell exactness on determinism and auditability alone\.

### E\-BEquivalence testing and the AUC band

The primary downstream contrast \(RQ4\) is registered as a single pre\-planned comparison; all remaining detection comparisons are labeled exploratory\. Because the pre\-registered expectation for RQ4 is parity, a claimed null must be*earned*by two one\-sided tests \(TOST\) rather than inferred from a non\-significant difference\. The equivalence margin is fixed in advance at±0\.02\\pm 0\.02AUC: exact KNNR\-SHAP is declared practically equivalent to a baseline when the90%90\\%confidence interval for the paired AUC difference lies entirely within\[−0\.02,\+0\.02\]\[\-0\.02,\+0\.02\]\. The band, the primary contrast, and the direction of the test are frozen at registration and may not be adjusted after seeing results \(see K6\)\.

### E\-CPre\-registered outcome interpretations

The mapping from results to conclusions was written before the results existed\.

A\.H1 passes and the H3 hardness proof lands: the open problem is closed with a full complexity landscape \(pseudo\-polynomial exact algorithm, FPTAS, and \#P\-hardness\)\. This is the strongest reported outcome\. The realized outcome is the calibrated access\-model hardness of Theorem[3](https://arxiv.org/html/2607.11956#Thmtheorem3)\(parts \(a\)–\(c\)\), with the threshold/comparison version left open\.

B\.H1 passes and H3 resists: the contribution stands on the pseudo\-polynomial exact algorithm plus the FPTAS plus an explicit conjecture\. This is the pre\-registered floor and remains a complete paper\.

C\.E3 yields detection parity \(the expected case\): report TOST\-earned equivalence and sell exactness on deterministic, auditable pricing, certified error control, and the first exact regression ground truth; the cost\-to\-match budget number is the operative deliverable\.

D\.E4 shows Monte\-Carlo is cheap: report the price curve as measured and sell determinism and auditability; the theory package is unaffected\.

E\.H1 fails at the gate: the topic is abandoned before drafting; there is no salvage and no null publication\.

### E\-DKill criteria

Six kill criteria were armed at registration\. K1–K5 are conditions under which the topic dies or a specific theorem is rescoped; K6 is a standing integrity constraint\.

K1\.The DP cannot reach0\-mismatch after the time\-boxed repair window⇒\\Rightarrowthe topic is abandoned\.

K2\.The pre\-lock literature sweep finds any exact or certified\-approximation Shapley algorithm for weighted*or*unweightedkk\-NN regression⇒\\Rightarrowabandon or rescope\. This sweep is re\-run at draft lock\.

K3\.The positioning claim fails, i\.e\. one of the three prior polynomial routes is shown to solve the ratio utility after all⇒\\Rightarrowabandon\.

K4\.The DP exceeds1010s per test point atN=5000N=5000even after a compiled hot loop⇒\\Rightarrowrescope the exact\-scale claim toN≤2000N\\leq 2000and defer largerNNto the FPTAS; infeasible atN=1000N=1000⇒\\Rightarrowabandon\.

K5\.No practical bounded\-below kernel satisfies the denominator condition⇒\\RightarrowTheorem[2](https://arxiv.org/html/2607.11956#Thmtheorem2)is withdrawn\.

K6\.*\(Integrity, always on\.\)*Any post\-hoc weakening of the TOST band, the0\-mismatch gate, or the pre\-registered primary contrast reverts the paper to the more conservative interpretation registered here\. No result may be reinterpreted, and no threshold may be relaxed, after the data are seen\.

### E\-EDatasets and statistics plan

#### Datasets\.

All data are public, load at zero cost, and run on CPU\. Downstream detection \(E3\) uses at least eight real regression collections drawn from California Housing, Diabetes, Wine Quality, Concrete, Energy Efficiency, Airfoil Self\-Noise, Abalone, Bike Sharing, Ames Housing, cpu\_small / kin8nm, with Superconductivity reserved for large\-scale FPTAS evaluation\. The soft\-label arm \(Theorem[4](https://arxiv.org/html/2607.11956#Thmtheorem4)\) uses two to three classification collections with a weighted soft\-label utility\. Synthetic lattice instances are used only for the correctness gate and the scaling study and never for a headline claim\.

#### Statistics\.

Theorem correctness is enumeration\-gated:0mismatches over≥10,000\\geq 10\{,\}000random and adversarial instances, spanning tied ranks and weights, duplicate targets, boundary targets, extreme weight ratios,K∈\{1,3,5\}K\\in\\\{1,3,5\\\}, squared and absolute loss, and\|S\|<K\|S\|<Kregimes, with the verifier itself checked against a hand\-computed toy\. Downstream detection uses a paired design over≥10\\geq 10seeds per dataset, per\-dataset Wilson confidence intervals, a cross\-dataset paired Wilcoxon test, and the TOST procedure above for the parity claim\. FPTAS certificate violations \(E2\) are bounded by a Clopper\-Pearson95%95\\%upper interval \(target rate0\)\. Monte\-Carlo budget\-to\-threshold measurements \(E4\) carry bootstrap95%95\\%confidence intervals over2020replicates per budget\. Exactly one primary contrast is declared; every other comparison is reported as exploratory\.

## Declaration of Generative AI and AI\-Assisted Technologies

In the interest of transparency, the author discloses the use of a generative AI system in the preparation of this work\. Anthropic’s Claude was used to assist with drafting and editing prose, with implementing and testing portions of the KNNR\-SHAP codebase, and with orchestrating the experimental runs\. All research design decisions, the pre\-registration of hypotheses and their null branches, the mathematical statements and proofs, and the verification of every claim against independent ground\-truth oracles were directed and owned by the author, who takes full responsibility for the content of the paper, including any errors\. In particular, the correctness of the theorems rests on machine verification \(exhaustive enumeration oracles and exact rational\-arithmetic checks\) that the author designed and inspected, not on any assertion by the AI system\. The AI tool did not originate the research questions, the pre\-registration, or the results, and it is not credited as an author\.

## References

- \[1\]A\. Ghorbani and J\. Zou, “Data Shapley: Equitable valuation of data for machine learning,” in*Proceedings of the 36th International Conference on Machine Learning \(ICML\)*, ser\. PMLR, vol\. 97, 2019, pp\. 2242–2251\.
- \[2\]R\. Jia, D\. Dao, B\. Wang, F\. A\. Hubis, N\. Hynes, N\. M\. Gürel, B\. Li, C\. Zhang, D\. Song, and C\. J\. Spanos, “Towards efficient data valuation based on the Shapley value,” in*Proceedings of the 22nd International Conference on Artificial Intelligence and Statistics \(AISTATS\)*, ser\. PMLR, vol\. 89, 2019, pp\. 1167–1176\.
- \[3\]L\. S\. Shapley, “A value fornn\-person games,” in*Contributions to the Theory of Games \(AM\-28\), Volume II*, H\. W\. Kuhn and A\. W\. Tucker, Eds\. Princeton University Press, 1953, pp\. 307–317\.
- \[4\]P\. Dubey, “On the uniqueness of the Shapley value,”*International Journal of Game Theory*, vol\. 4, no\. 3, pp\. 131–139, 1975\.
- \[5\]A\. Agarwal, M\. Dahleh, and T\. Sarkar, “A marketplace for data: An algorithmic solution,” in*Proceedings of the 2019 ACM Conference on Economics and Computation \(EC\)*, 2019, pp\. 701–726\.
- \[6\]J\. Pei, “A survey on data pricing: From economics to data science,”*IEEE Transactions on Knowledge and Data Engineering*, vol\. 34, no\. 10, pp\. 4586–4608, 2022\.
- \[7\]B\. Rozemberczki, L\. Watson, P\. Bayer, H\.\-T\. Yang, O\. Kiss, S\. Nilsson, and R\. Sarkar, “The Shapley value in machine learning,” in*Proceedings of the 31st International Joint Conference on Artificial Intelligence \(IJCAI\)*, 2022\.
- \[8\]R\. H\. L\. Sim, X\. Xu, and B\. K\. H\. Low, “Data valuation in machine learning: “ingredients”, strategies, and open challenges,” in*Proceedings of the 31st International Joint Conference on Artificial Intelligence \(IJCAI\)*, 2022, pp\. 5607–5614\.
- \[9\]J\. Castro, D\. Gómez, and J\. Tejada, “Polynomial calculation of the Shapley value based on sampling,”*Computers & Operations Research*, vol\. 36, no\. 5, pp\. 1726–1730, 2009\.
- \[10\]S\. Maleki, L\. Tran\-Thanh, G\. Hines, T\. Rahwan, and A\. Rogers, “Bounding the estimation error of sampling\-based Shapley value approximation,” 2013, preprint; related work presented at AAMAS 2013\.
- \[11\]Y\. Kwon and J\. Zou, “Data\-OOB: Out\-of\-bag estimate as a simple and efficient data value,” in*Proceedings of the 40th International Conference on Machine Learning \(ICML\)*, ser\. PMLR, vol\. 202, 2023, pp\. 18 135–18 152\.
- \[12\]P\. W\. Koh and P\. Liang, “Understanding black\-box predictions via influence functions,” in*Proceedings of the 34th International Conference on Machine Learning \(ICML\)*, ser\. PMLR, vol\. 70, 2017, pp\. 1885–1894\.
- \[13\]J\. Yoon, S\. Ö\. Arik, and T\. Pfister, “Data valuation using reinforcement learning,” in*Proceedings of the 37th International Conference on Machine Learning \(ICML\)*, ser\. PMLR, vol\. 119, 2020, pp\. 10 842–10 851\.
- \[14\]R\. Jia, D\. Dao, B\. Wang, F\. A\. Hubis, N\. M\. Gurel, B\. Li, C\. Zhang, C\. J\. Spanos, and D\. Song, “Efficient task\-specific data valuation for nearest neighbor algorithms,”*Proceedings of the VLDB Endowment*, vol\. 12, no\. 11, pp\. 1610–1623, 2019\.
- \[15\]TransferLab, appliedAI Institute gGmbH, “pyDVL: A library for data valuation and influence functions,” Software, version 0\.10\.0,[https://pydvl\.org](https://pydvl.org/), 2025\.
- \[16\]K\. F\. Jiang, W\. Liang, J\. Zou, and Y\. Kwon, “OpenDataVal: A unified benchmark for data valuation,” in*Advances in Neural Information Processing Systems \(NeurIPS\), Datasets and Benchmarks Track*, vol\. 36, 2023\.
- \[17\]J\. T\. Wang and R\. Jia, “A note on “efficient task\-specific data valuation for nearest neighbor algorithms”,” 2023\.
- \[18\]J\. T\. Wang, Y\. Zhu, Y\.\-X\. Wang, R\. Jia, and P\. Mittal, “Threshold KNN\-Shapley: A linear\-time and privacy\-friendly approach to data valuation,” in*Advances in Neural Information Processing Systems \(NeurIPS\)*, vol\. 36, 2023\.
- \[19\]Z\. Yang, H\. Yue, J\. Chen, and H\. Liu, “On the inflation of KNN\-Shapley value,” 2024\.
- \[20\]J\. T\. Wang, P\. Mittal, and R\. Jia, “Efficient data Shapley for weighted nearest neighbor algorithms,” in*Proceedings of the 27th International Conference on Artificial Intelligence and Statistics \(AISTATS\)*, ser\. PMLR, vol\. 238, 2024\.
- \[21\]G\. Zhang, Q\. Liu, and A\. Gionis, “Shapley\-based data valuation for weightedkk\-nearest neighbors,” in*Advances in Neural Information Processing Systems \(NeurIPS\)*, vol\. 38, 2025, openReview forum id KXOn2Z6bEI; NeurIPS 2025 poster\.
- \[22\]X\. Deng and C\. H\. Papadimitriou, “On the complexity of cooperative solution concepts,”*Mathematics of Operations Research*, vol\. 19, no\. 2, pp\. 257–266, 1994\.
- \[23\]R\. Jia, F\. Wu, X\. Sun, J\. Xu, D\. Dao, B\. Kailkhura, C\. Zhang, B\. Li, and D\. Song, “Scalability vs\. utility: Do we have to sacrifice one for the other in data importance quantification?” in*Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition \(CVPR\)*, 2021, pp\. 8239–8247\.
- \[24\]J\. T\. Wang, P\. Mittal, D\. Song, and R\. Jia, “Data Shapley in one training run,” in*The Thirteenth International Conference on Learning Representations \(ICLR\)*, 2025\.
- \[25\]Y\. Kwon and J\. Zou, “Beta Shapley: A unified and noise\-reduced data valuation framework for machine learning,” in*Proceedings of the 25th International Conference on Artificial Intelligence and Statistics \(AISTATS\)*, ser\. PMLR, vol\. 151, 2022, pp\. 8780–8802\.
- \[26\]J\. T\. Wang and R\. Jia, “Data Banzhaf: A robust data valuation framework for machine learning,” in*Proceedings of the 26th International Conference on Artificial Intelligence and Statistics \(AISTATS\)*, ser\. PMLR, vol\. 206, 2023, pp\. 6388–6421\.
- \[27\]S\. Schoch, H\. Xu, and Y\. Ji, “CS\-Shapley: Class\-wise Shapley values for data valuation in classification,” in*Advances in Neural Information Processing Systems \(NeurIPS\)*, vol\. 35, 2022\.
- \[28\]A\. Ghorbani, M\. P\. Kim, and J\. Zou, “A distributional framework for data valuation,” in*Proceedings of the 37th International Conference on Machine Learning \(ICML\)*, ser\. PMLR, vol\. 119, 2020, pp\. 3535–3544\.
- \[29\]Y\. Kwon, M\. A\. Rivas, and J\. Zou, “Efficient computation and analysis of distributional Shapley values,” in*Proceedings of the 24th International Conference on Artificial Intelligence and Statistics \(AISTATS\)*, ser\. PMLR, vol\. 130, 2021, pp\. 793–801\.
- \[30\]S\. M\. Lundberg and S\.\-I\. Lee, “A unified approach to interpreting model predictions,” in*Advances in Neural Information Processing Systems \(NeurIPS\)*, vol\. 30, 2017\.
- \[31\]T\. M\. Cover and P\. E\. Hart, “Nearest neighbor pattern classification,”*IEEE Transactions on Information Theory*, vol\. 13, no\. 1, pp\. 21–27, 1967\.
- \[32\]E\. Fix and J\. L\. Hodges, “Discriminatory analysis\. nonparametric discrimination: Consistency properties,”*International Statistical Review / Revue Internationale de Statistique*, vol\. 57, no\. 3, pp\. 238–247, 1989, reprint of the 1951 USAF School of Aviation Medicine technical report\.
- \[33\]G\. Zhang, L\. Oettershagen, L\. Wang, and A\. Gionis, “Efficient Banzhaf\-based data valuation forkk\-nearest neighbors classification,” 2026\.
- \[34\]L\. G\. Valiant, “The complexity of enumeration and reliability problems,”*SIAM Journal on Computing*, vol\. 8, no\. 3, pp\. 410–421, 1979\.
- \[35\]——, “The complexity of computing the permanent,”*Theoretical Computer Science*, vol\. 8, no\. 2, pp\. 189–201, 1979\.
- \[36\]O\. H\. Ibarra and C\. E\. Kim, “Fast approximation algorithms for the knapsack and sum of subset problems,”*Journal of the ACM*, vol\. 22, no\. 4, pp\. 463–468, 1975\.
- \[37\]M\. R\. Garey and D\. S\. Johnson,*Computers and Intractability: A Guide to the Theory of NP\-Completeness*\. San Francisco: W\. H\. Freeman and Company, 1979\.
- \[38\]V\. V\. Vazirani,*Approximation Algorithms*\. Springer, 2003\.
- \[39\]J\. Vanschoren, J\. N\. van Rijn, B\. Bischl, and L\. Torgo, “OpenML: Networked science in machine learning,”*ACM SIGKDD Explorations Newsletter*, vol\. 15, no\. 2, pp\. 49–60, 2014\.
- \[40\]F\. Pedregosa, G\. Varoquaux, A\. Gramfort, V\. Michel, B\. Thirion, O\. Grisel, M\. Blondel, P\. Prettenhofer, R\. Weiss, V\. Dubourg, J\. Vanderplas, A\. Passos, D\. Cournapeau, M\. Brucher, M\. Perrot, and É\. Duchesnay, “Scikit\-learn: Machine learning in Python,”*Journal of Machine Learning Research*, vol\. 12, pp\. 2825–2830, 2011\.

Similar Articles

RelShap: Relationally Consistent Shapley Explanations

arXiv cs.LG

This paper proposes RelShap, a framework that incorporates relational constraints and data provenance into Shapley value computation, making explanations more faithful to the data-generating process. It is estimator-agnostic and composes with existing SHAP estimators while exploiting functional dependencies to reduce runtime.