Manuscript Offprint

arXiv:2609.06127

PAGR: Proof-Carrying Algebraic-Geometric Retrieval: A Quiver-, Provenance-, and Sheaf-Theoretic Framework for Grounded LLM Retrieval

Xingting Wang, Min Wu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Retrieval-augmented generation (RAG) is usually formulated as a statistical information-retrieval problem: a query is embedded, nearby text is retrieved, and a language model is conditioned on the result. Graph-based RAG adds relational structure, but the mathematical status of that structure is often underspecified. In particular, three distinct questions are frequently conflated: which statements are certified as knowledge, which latent representations are useful for retrieval, and which multi-hop compositions are semantically admissible.

We propose a use-case-agnostic framework called Proof-Carrying Algebraic-Geometric Retrieval (PAGR), which separates and then couples these questions through four mathematical layers. The symbolic layer is a finite many-sorted relational theory generated by a typed quiver, path equations, and positive Horn inclusions. The algebraic representation layer maps the quiver into finite-dimensional inner-product spaces, so relation types act as linear operators and compositional constraints become operator identities or regularizers. The geometric layer equips entity types with metric or mixed-geometry representation spaces for semantic seeding and inductive retrieval. The sheaf layer encodes local compatibility and supplies a local-to-global consistency energy. A fifth, orthogonal mechanism—semiring provenance—attaches machine-checkable derivation certificates to symbolic inferences.

The central architectural constraint is an epistemic separation principle: learned geometry may rank, propose, and organize evidence, but it may not promote a hypothesis into certified ground truth. Certification is reserved for source-attested base facts and derivations admitted by a sound symbolic theory. We formalize this distinction and prove four results: a non-interference theorem stating that the certification boundary—the criterion by which a retrieved fact qualifies as certified—is invariant under arbitrary replacement of every learned component, even though which certified facts are retrieved is not, and from which soundness relative to an intended model follows as a corollary; a conditional completeness bound that characterizes exactly which certified facts geometric seeding can fail to reach; a gauge-invariance theorem identifying the isometry group—rather than the full base-change group—as the symmetry that retrieval scores actually respect; and a proposition showing that zero sheaf energy on a retrieved subgraph forces all declared path equations to hold along it, which couples the sheaf and representation layers instead of leaving them parallel. Three further groups of results sharpen and delimit the construction. Sheaf cohomology separates whether a particular retrieved configuration is consistent from whether any consistent configuration exists at all—the latter measured by the dimension of global sections, and assembled across overlapping neighborhoods by a Mayer–Vietoris gluing theorem. Bounded bisimulation yields a minimal index that decides admissible-path realizability exactly, while provenance decides which base facts are redundant. Finally, a scope theorem gives a structural criterion for when a schema leaves the finite and tame representation regimes, delimiting which classical tools the algebraic layer may legitimately invoke. We then define a hybrid retrieval operator combining metric seeding, admissible path expansion, provenance, representation residuals, sheaf consistency, and graph diffusion. The result is a mathematical blueprint for LLM retrieval systems in which geometry improves recall and organization while algebra and proof constrain what may be treated as ground truth.

1 Introduction

Large language models possess broad parametric knowledge but provide weak guarantees about factuality, attribution, freshness, or the provenance of individual claims. Retrieval-augmented generation [39] addresses this by conditioning generation on external evidence. Modern graph-based variants extend retrieval from isolated chunks to relational neighborhoods, subgraphs, and multi-hop structures [16, 27, 28, 32, 50]. This is a substantial improvement for questions whose answers depend on relational context. Yet it leaves a foundational issue unresolved: a graph edge can mean at least three different things.

First, an edge may be a certified assertion: a source explicitly states a relation. Second, an edge may be a logical consequence: it follows from certified assertions under a declared rule system. Third, an edge may be a statistical hypothesis: a learned model predicts that the relation is likely. These objects are useful for different purposes, but treating them as interchangeable makes the phrase “knowledge graph” mathematically ambiguous and makes “grounded generation” difficult to define.

The same ambiguity appears in geometry. Knowledge-graph embedding (KGE) methods associate entities and relations with vectors, rotations, projections, tensors, or transformations and can model symmetry, inversion, hierarchy, and composition [8, 40, 46, 48, 49]. These representations are extremely useful for retrieval and link prediction. But a small embedding distance is not a proof that a relation is true. Conversely, a symbolic graph with no geometry can be exact but brittle: it may fail to retrieve semantically relevant regions when the user's language does not match the graph's vocabulary.

This paper develops a mathematical framework in which symbolic and geometric knowledge coexist without being conflated. The framework is deliberately independent of any particular domain. It can represent scientific claims, software dependencies, corporate knowledge, legal authorities, biomedical facts, product catalogs, educational concepts, or any other corpus for which typed relations and source evidence exist.

Our proposal uses several established theories, but assigns each a sharply delimited role:

  1. Typed quivers and path algebras represent the grammar of relation composition.

  2. Positive Horn rules and relational fixed points define certified symbolic closure.

  3. Quiver representations assign vector spaces to types and linear maps to relation generators, making compositional geometry explicit.

  4. Metric and mixed-geometry embeddings support semantic seeding and inductive ranking.

  5. Cellular sheaves encode local compatibility and quantify whether local representations glue coherently.

  6. Semiring provenance records derivations independently of any one numerical confidence convention.

  7. Proof-carrying admission requires a checkable witness before an inferred statement may enter the certified retrieval context.

None of these ingredients is new in isolation. Quiver representations are classical, have been used to analyze neural architectures [4, 18], and admit geometric moduli-space formulations [33]. Cellular sheaves have recently been used to generalize graph neural networks and knowledge-graph embeddings [10, 22, 29]. Provenance semirings provide a general algebra of derivations [25, 26]. The contribution here is a unified epistemic architecture for retrieval: symbolic truth, learned geometry, relational algebra, local consistency, and generative synthesis are explicitly separated and connected by typed interfaces.

Core thesis. A mathematically trustworthy retrieval system should use geometry to answer where should we look?, algebra and logic to answer what compositions are admissible?, provenance to answer why is this conclusion present?, and a generator only to answer how should the certified context be communicated?

References (46)