Probabilistic query evaluation is #P-hard
No public endorsements yet.
Loading review…
Sign in with ORCIDAbstract
Probabilistic query evaluation, from the descriptive-complexity library: the data complexity of computing the probability of a Boolean query over a database whose facts are independent. It builds on the NP core registered as lax-904597, the catalog of NP-complete problems lax-799700, the submissions on counting problems, #P, and FP (lax-366625), on the parsimoniously #P-complete problems (lax-280166), and on one-call and subtractive counting reductions (lax-859101), and the submissions they require on logarithmic space (lax-485149), polynomial time (lax-535992), and AC⁰ (lax-895169).
An instance carries certain and uncertain facts. With every uncertain fact present with probability 1/2, the k uncertain facts give 2^k equally likely possible worlds, and the probability of a query is the number of worlds in which it holds divided by 2^k. With weights in the instance, each uncertain fact is present with probability a/(a + c) for two weights written in binary, and the probability of every first-order query is a ratio of two numbers of #P: the weighted counts of the worlds of the query and of all worlds.
The query h₀ = ∃x y, R(x) ∧ S(x, y) ∧ T(y) is hard, after Dalvi and Suciu: counting its possible worlds is one-call #P-complete, by a parsimonious reduction from #PP2DNF, and so is the numerator of its probability with weights in the instance. On the same instances the hierarchical query ∃x y, R(x) ∧ S(x, y) is easy: the numerator of its probability is in FP. The weight of the worlds in which it fails is a product over the constants, and the weight of those in which it holds is computed the same way, without a subtraction, as a term of quantitative first-order logic. A concrete probabilistic database, with its computed count and total, is encoded as a weighted instance on which the probability of h₀ is their ratio.
The proofs are those of the library's development after version 1.2.2, on its Lean 4.33 branch, sliced to what these statements use; they assume the submission's own statements and those of the submissions it requires where they compose. The library and its documentation are at https://github.com/PierreSenellart/descriptive-complexity and https://pierresenellart.github.io/descriptive-complexity/DescriptiveComplexity.html. The Lean code was written with the assistance of several Claude models; the design and the statements are the author's.
Concepts
- thm✓
ExampleDatabaseProbability - thm✓
H0Complete - thm✓
HierarchicalQueryInFP - thm✓
ProbabilityRatio - thm✓
WorldCount - thm✓
WorldsInSharpP - lem✓
WorldsValues
- def
ExampleDatabase - def
PossibleWorlds - def
Queries - def
WeightedWorlds
- thm✓
Lax799700.NaeSat - thm✓
Lax799700.SetFamily - thm✓
Lax859101.BipartiteComplete - lem✓
Lax859101.BipartiteValues - def✓
Lax904597.Machines
- def
Lax366625.CountingClasses - def
Lax366625.CountingProblems - def
Lax366625.CountingSat - def
Lax366625.QuantitativeLogic - def
Lax366625.WitnessCounting - def
Lax485149.SecondOrderAtoms - def
Lax535992.HornFragment - def
Lax535992.LeastFixedPoint - def
Lax799700.Common - def
Lax799700.Problems - def
Lax859101.CountingAllSets - def
Lax859101.CountingBipartite - def
Lax859101.CountingDnf - def
Lax859101.CountingNaeSat - def
Lax859101.CountingRestrictedSat - def
Lax859101.OneCallReductions - def
Lax859101.SubtractiveReductions - def
Lax895169.BitPredicate - def
Lax904597.Classes - def
Lax904597.Interpretations - def
Lax904597.Problems - def
Lax904597.Relativized - def
Lax904597.Sat - def
Lax904597.SecondOrder
Concept map
Proofs
Proof networkview on GitHub
Proof list
-
⊢
Lax794877Proofs.Bridge.possibleWorlds_h0_sharpP_oneCallComplete -
⊢
Lax794877Proofs.Bridge.weightedWorlds_h0_sharpP_oneCallComplete
Lean sources for these proofs: proofs/ on GitHub
Proof code is not displayed; the archive records each proof's checked relationship between claims.
Related submissions
Submission map
Cite this
This is only the formalizers. The authors of the formalized results may be different (see References).
@misc{lax-794877,
author = {Pierre Senellart and Claude (Anthropic)},
title = {Probabilistic query evaluation is #P-hard},
year = {2026},
howpublished = {Lax Archive, lax-794877},
url = {https://laxarchive.org/lax-794877/},
note = {draft},
}
References
- Pierre Senellart. DescriptiveComplexity: Completeness by First-Order Reductions in Lean. 2026. doi:10.5281/zenodo.21678423 · github.com/PierreSenellart/descriptive-complexity
- Nilesh Dalvi and Dan Suciu. The dichotomy of probabilistic inference for unions of conjunctive queries. J. ACM 59(6):1–87, 2012. doi:10.1145/2395116.2395119
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments