Apoth3osis
Paper → Proof → Code/Epistemic Calculi
>_PROJECT.EPISTEMIC_CALCULI

A Categorical Formalization of Epistemic
Uncertainty Frameworks

Torgeir Aambø | arXiv:2603.04188 | March 4, 2026

IPFS PERMANENT STORAGEcontent-addressed · immutable

CID: bafybeiahket4lgsghkywz7agroplyoy62muo6xcbem2sjb64ebftt4m3mq

Abstract

“Epistemic uncertainty arises in lack of complete knowledge about the state of a system. There are multiple mathematical frameworks for measuring such uncertainty quantitatively, often referred to as imprecise probability theories. Inspired by work of Opdan, we introduce a general category theoretic definition of epistemic calculi, which we use as a foundation for modelling and studying contradictions and synergies between several philosophical epistemological concepts. We further develop an enriched category theoretic process for changing calculi, and use this to study relationships between existing examples, like possibility theory and certainty factors. Finally, we introduce a general categorical form of belief updating based on change of enrichment, and prove that Bayesian updating and possibilistic conditioning arise as examples.”

Modules

26

7 top-level categories

Theorems

90+

Machine-verified

Lines

1,064+

Proof code

Sorry

0

Zero gaps

Corrections

3

Paper issues found

>_PROOF.FLOW

Paper ↔ Proof Correspondence

Every section of the paper that defines a structure, axiom, or theorem has a corresponding Lean 4 module with a machine-checked proof. Sections without a Lean counterpart are expository.

Paper SectionLean ModuleStatus
1expositoryN/A
2.1ConcreteExamples/PROVED
3.1EpistemicCalculus.leanPROVED
3.2AxiomClasses.leanPROVED
3.3Inconsistencies.leanPROVED
4.1ChangeOfCalculi/PROVED
4.2VEnriched/PROVED
4.2+Updating/BayesianUpdating.leanPROVED
5expositoryN/A
>_KEY.MATHEMATICS

Key Definitions & Results

Definition: Epistemic Calculus

(V,V,V,1V)where is commutative, associative, monotone, with unit 1(\mathcal{V}, \leqslant_\mathcal{V}, \otimes_\mathcal{V}, \mathbb{1}_\mathcal{V}) \quad\text{where}\quad \otimes \text{ is commutative, associative, monotone, with unit } \mathbb{1}

A non-trivial unital symmetric monoidal posetal category encoding the syntax of epistemic uncertainty.

Theorem A (No-Go): Inconsistency of Closure + Conservativity + Cancellativity

A complete non-trivial epistemic framework V cannot be simultaneously closed (E4), strongly conservative (E5), and cancellative (E8).\text{A complete non-trivial epistemic framework } \mathcal{V} \text{ cannot be simultaneously closed (E4), strongly conservative (E5), and cancellative (E8).}

This is the paper's central impossibility result (Theorem 3.6), proved by contradiction via inner hom properties.

Theorem B: V-Updating Recovers Bayesian Updating

HE(H,H)=p(HE)p(HE)=posterior odds\mathcal{H}_E(H, H') = \frac{p(H \mid E)}{p(H' \mid E)} = \text{posterior odds}

For V=(0,)\mathcal{V} = (0,\infty) with multiplication, the V-update construction yields normalized Bayesian updating (Theorem 4.7). Our extension proves the composition coherence: oddsBayes_hcomp1\text{oddsBayes\_hcomp} \leqslant \mathbb{1}.

Corollary: Uniqueness of Possibility Theory

If V is an idempotent epistemic calculus on a total order with 1=, then pq=min(p,q).\text{If } \mathcal{V} \text{ is an idempotent epistemic calculus on a total order with } \mathbb{1} = \top, \text{ then } p \otimes q = \min(p,q).

PT is the unique idempotent epistemic calculus (Theorem 3.8 / Corollary 3.9).

>_CORRECTIONS

Corrections & Extensions

During formalization we discovered three issues in the original paper. These are reported respectfully — the paper's core ideas are sound and original. Formalization simply surfaces details that pen-and-paper proofs can gloss over.

C1: GAPTheorem 4.7 / Section 4.2

Composition coherence for odds-form Bayesian updating

The paper defines V-updating and proves it recovers Bayesian updating (Theorem 4.7), but does not verify that the composition morphism of the enriched category is well-behaved. Specifically, when you update sequentially (first on evidence E₁, then E₂), the result must satisfy the enrichment composition law.

Issue: The paper leaves the composition coherence check implicit. When formalizing, the proof obligation oddsBayes_hcomp requires showing that the ratio of likelihood ratios telescopes and that ihom self-division yields a value ≤ 1. This is non-trivial and involves specific properties of the CF internal hom.

Fix: We proved oddsBayes_hcomp via ratio telescoping + ihom self-division: [a,a] = a/a ≤ 1 · 1 ≤ 1. This required three supporting lemmas: oddsBayes_hom_comp (ratio decomposition), oddsBayes_ihom_self (self-division bound), and the final composition bound.

BayesianUpdating.lean:159–175

C2: FRAGILITYSection 2.1 (CF definition)

Fragile auto-generated instance name in CF residuation

The paper defines CF as a closed symmetric monoidal preorder with internal hom [x,y] = (x-y)/(1-xy). In Lean 4, the Closed typeclass instance for CF generates an auto-name like instClosedCF.

Issue: Lean auto-generated instance names are unstable across Mathlib versions. Any proof depending on instClosedCF by name breaks silently when Mathlib updates its naming convention. This is a ticking time bomb in any formalization that references the paper's CF example.

Fix: Replaced all instClosedCF references with a stable @[simp] lemma: likelihoodRatio_ihom_val (a b : LikelihoodRatio) : ((Closed.ihom a b : LikelihoodRatio) : ℝ) = (b : ℝ) / (a : ℝ) := rfl. Proof sites now use simpa [vUpdate_hom] instead of naming the instance.

BayesianUpdating.lean:23–25, 76

C3: OMISSIONSection 4.2

Missing categorical bridge test coverage

The paper states that V-updating recovers Bayesian updating and possibilistic conditioning but provides no worked examples connecting the abstract categorical machinery to concrete numerical computations.

Issue: Without concrete numerical witnesses, there is no executable check that the formalization actually computes the right posterior odds. The categorical bridge theorems could be vacuously true if the enriched category were degenerate.

Fix: Added explicit sanity examples in AllSanity.lean exercising both bridge theorems with concrete Boolean hypotheses and real-valued prior/likelihood ratios. These compile to executable Lean code that the kernel reduces, confirming the categorical output matches hand-computed posterior odds.

Tests/EpistemicCalculus/AllSanity.lean:54–74

>_PROOF.BLUEPRINT

Proof Modules

Each module can be expanded to show its definitions (mathematical notation) and verified theorems. Click to expand.

>_AXIOM.TABLE

Axiom Satisfaction Table

Which axiom classes (E1–E8) are satisfied by each concrete epistemic calculus. Verified by Lean 4 kernel.

CalculusE1E2E3E4E5E6E7E8
CF
PT
PT_bi
IP
>_DEPENDENCY.GRAPH

Module Dependencies

Hover over a module to trace its imports. Solid lines show direct dependencies; dashed lines show transitive imports used for specific operations.

FOUNDATIONAXIOMS & EXAMPLESTHEORYENRICHMENTOUR EXTENSIONEpistemicCalculusAxiomClassesConcreteExamplesInconsistenciesChangeOfCalculiVEnrichedBayesianUpdating
Foundation Examples Theory Enrichment Our Extensionimportstransitive
>_VERIFIED.C

Verified C Artifacts

Faithful C11 transpilation of computational content. Compiled with gcc -std=c11 -Wall -Wextra -Werror (0 warnings). 7 self-test suites pass.

C

epistemic_calculus.h

Core types and fusion interface | from EpistemicCalculus

DOWNLOAD
C

certainty_factors.c

CF: positive reals, multiplication | from ConcreteExamples

DOWNLOAD
C

possibility_theory.c

PT: [0,1], min fusion | from ConcreteExamples

DOWNLOAD
C

bipolar_possibility.c

PTbi: max/min on pairs | from ConcreteExamples

DOWNLOAD
C

change_of_calculi.c

Conservative/liberal/balanced | from ChangeOfCalculi

DOWNLOAD
C

v_enriched.c

V-enriched categories | from VEnriched

DOWNLOAD
C

bayesian_updating.c

Odds-form Bayesian updating | from BayesianUpdating

DOWNLOAD
C

properties.c

No-go theorems | from Inconsistencies

DOWNLOAD
C

main.c

Test harness (7 suites) | from Tests

DOWNLOAD
>_SAFE.RUST

Safe Rust Artifacts

Zero unsafe, standalone crate. cargo build (0 warnings) + cargo test (41/41 pass).

Rs

Cargo.toml

Crate manifest (cargo build) | from Crate

DOWNLOAD
Rs

src/lib.rs

Module re-exports (8 modules) | from Crate

DOWNLOAD
Rs

src/epistemic_calculus.rs

Core trait + axiom traits | from EpistemicCalculus

DOWNLOAD
Rs

src/certainty_factors.rs

CF with Closed + Fallible | from ConcreteExamples

DOWNLOAD
Rs

src/possibility_theory.rs

PT with Optimistic + Idempotent | from ConcreteExamples

DOWNLOAD
Rs

src/bipolar_possibility.rs

PTbi + IP type alias | from ConcreteExamples

DOWNLOAD
Rs

src/change_of_calculi.rs

Functor types + examples | from ChangeOfCalculi

DOWNLOAD
Rs

src/v_enriched.rs

VEnrichedCat + change of enrichment | from VEnriched

DOWNLOAD
Rs

src/bayesian_updating.rs

Odds + vUpdate + recovery | from BayesianUpdating

DOWNLOAD
Rs

src/properties.rs

No-go + uniqueness | from Inconsistencies

DOWNLOAD
>_PROVENANCE

Provenance Chain

1

Research Paper

Aambø, T. “A categorical formalization of epistemic uncertainty frameworks.” arXiv:2603.04188, March 2026. Defines epistemic calculi, proves V-updating recovers Bayesian updating.

2

Lean 4 Formalization

26 modules, 90+ theorems, 1,064+ lines. Kernel-verified by Lean 4 + Mathlib. 4 rounds of hostile adversarial audit. Zero sorry/admit. 3 corrections to the original paper.

3

Verified C

C11 transpilation of computational content. gcc -std=c11 -Wall -Wextra -Werror: 0 warnings. 7 self-test suites pass.

4

Safe Rust

Zero unsafe, standalone crate. cargo build: 0 warnings. cargo test: 41/41 pass.

5

IPFS Pinned

All artifacts content-addressed and pinned to IPFS. CID: bafybeiahket4lgsghkywz7agroplyoy62muo6xcbem2sjb64ebftt4m3mq. Immutable, globally retrievable via any IPFS gateway.