Hallucination is not a bug -- it's a theorem.
A three-paper trilogy establishing the Hallucination--Homotopy Correspondence (HHC): a complete, functorial classification of LLM hallucination types via homotopy type theory and algebraic topology.
Website: hott-hallucination-research.vercel.app
A Homotopy-Theoretic Classification of LLM Failure Modes
Proves five cases of the HHC, mapping each hallucination type to a topological invariant:
| Hallucination Type | Invariant | Obstruction |
|---|---|---|
| Unjustified inference | pi_0 | Disconnection |
| Circular reasoning | pi_1 != 0 | Non-contractible loop |
| Inconsistent justifications | pi_2 != 0 | Incoherent 2-cell |
| Fabricated entity chain | H_n != 0 | Homological hole |
| Compositional drift | Holonomy | Transport anomaly |
Hallucination-Free Language Generation via Dependent Type Theory
Five generation principles replacing statistical sampling with proof search:
- Generation as type inhabitation --
arg min C(a)subject toGamma |- a : A - Certified derivations -- every term comes with a checkable proof
- Abstention on empty types -- return bottom when no valid claim exists
- Context as fibration -- dependent telescope, not flat sequence
- Attention as limit -- weighted limit in Sem, not weighted sum in Vect
A Unified Theory of Semantic Correctness for Language Models via Homotopy Type Theory
Unifies detection and generation via:
-
Detection-Generation Adjunction -- Generate -| Detect as adjoint functors
-
Semantic Monad -- T = Detect . Generate with unit, multiplication, monad laws
-
Completeness Theorem -- every hallucination is detected; generation never produces undetected hallucinations
-
POC Architecture -- Generate-Check-Abstain loop with persistent homology monitoring
- 21 theorems proven across 75 pages
- 5x5 duality: each hallucination type pairs precisely with one generation principle (emergent property visible only across the trilogy)
- Fundamental Obstruction Theorem: any language model with a contractible representation space will necessarily hallucinate
- Completeness Theorem: the HHC + type-theoretic generation system is sound and complete
Three standalone modules, verified clean under ghc -Wall -Wextra -Werror:
# Run any module
runghc code/topological-detection/TopologicalDetection.hs
runghc code/type-theoretic-gen/TypeTheoreticGen.hs
runghc code/hott-synthesis/HoTTSynthesis.hsDependencies: base only (GHC boot libraries). No cabal/stack required.
papers/
topological-hallucination-detection/ # Paper 1: detection via homotopy invariants
type-theoretic-generation/ # Paper 2: generation via type inhabitation
hott-synthesis/ # Paper 3: unified framework
synthesis.md # Cross-paper analysis
code/
topological-detection/ # Haskell: 5 obstruction detectors
type-theoretic-gen/ # Haskell: type inhabitation + derivations
hott-synthesis/ # Haskell: full HoTT-LM POC
sources/ # Original source papers
images/og/ # Open Graph images (1200x630)
website/ # Next.js site (deployed to Vercel)
social-posts.md # Posts for Twitter/X, LinkedIn, Facebook, Bluesky
Matthew Long YonedaAI Research Collective | Magneton Labs LLC Chicago, IL | matthew@yonedaai.com
Copyright 2026 Magneton Labs LLC. All rights reserved.