The Topologies of Formal Deduction: A Directed Flag Complex Audit of Lean 4 Mathlib & The Epistemic Morphospace

Quantifying the macro-structural topology of interactive theorem prover libraries requires distinguishing between routine modular instantiation (epistemic diversity) and the emergence of genuinely non-transitive deductive trajectories (epistemic disparity). Prior topological audits suffered from fundamental methodological artifacts: symmetrizing proof dependency graphs into undirected complexes destroys the causal arrow of deduction, while uncurated scraping conflates compiler-synthesized boilerplate with mathematical reasoning. In this study, we present a definitive static structural taxonomy of the Lean 4 Mathlib core by evaluating Directed Flag Complexes via native C++ flagser reduction. We define an Asymmetric Ancestor Cone Filtration Weight $w(u,v) \in [0.30, 1.00]$ that respects proof chronology and grounded filtration scales. Applying lexical identifier filtering over compiler conventions, we purge 43,299 compiler-synthesized declarations, isolating a purified core of 93,747 mathematical theorems and 303,977 directed proof dependencies. Evaluating the complete dependency subgraphs across Point-Set Topology, Continuous Analysis, Category Theory, and Discrete Algebra, we address the "Euler characteristic trap" through two complementary lenses: (1) normalizing 1-cavities against graph-theoretic cyclomatic cycle capacity, uncovering a universal library-wide invariant where every domain retains between 85.0% and 91.7% of its 1-skeleton cycles as non-contractible 1-cavities; and (2) benchmarking empirical transitive 2-simplices against poset-constrained degree-preserving directed configuration null models that strictly preserve a fixed topological sort $\tau(u) < \tau(v)$. Empirical transitive tournaments are enriched by 3.9x to 27.3x over degree-matched null models ($Z = +29.77$ to $+205.08, p < 10^{-190}$), proving that local simplicial closure is highly intentional. An audit of structural subtyping projections confirms that inheritance morphisms participate in at most 7.65% of algebraic cavities, proving that over 92.3% of 1-cavities represent authentic theorem proof confluence. Scale concentration is an intrinsic extreme-value property of deduction trees (median unshifted edge weight 0.8571), and the "lifetime inversion paradox" is resolved via the Axiom Bottleneck effect. Finally, we formulate the dual trivialization of confluence diamonds over $\mathbb{F}_2$, demonstrating that essential persistence (98.8%) quantifies the dual avoidance of artificial intermediate bridges and redundant ancestral citations.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-08
DOI
https://doi.org/10.5281/zenodo.24062602
Primary Topic
Topological and Geometric Data Analysis
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

The Topologies of Formal Deduction: A Directed Flag Complex Audit of Lean 4 Mathlib & The Epistemic Morphospace

Rolf Bastiaanssen
6 links
Zenodo (CERN European Organization for Nuclear Research)
Topological and Geometric Data Analysis
preprint

The Topologies of Formal Deduction: A Directed Flag Complex Audit of Lean 4 Mathlib & The Epistemic Morphospace

Rolf Bastiaanssen
preprint en

Abstract

Quantifying the macro-structural topology of interactive theorem prover libraries requires distinguishing between routine modular instantiation (epistemic diversity) and the emergence of genuinely non-transitive deductive trajectories (epistemic disparity). Prior topological audits suffered from fundamental methodological artifacts: symmetrizing proof dependency graphs into undirected complexes destroys the causal arrow of deduction, while uncurated scraping conflates compiler-synthesized boilerplate with mathematical reasoning. In this study, we present a definitive static structural taxonomy of the Lean 4 Mathlib core by evaluating Directed Flag Complexes via native C++ flagser reduction. We define an Asymmetric Ancestor Cone Filtration Weight $w(u,v) \in [0.30, 1.00]$ that respects proof chronology and grounded filtration scales. Applying lexical identifier filtering over compiler conventions, we purge 43,299 compiler-synthesized declarations, isolating a purified core of 93,747 mathematical theorems and 303,977 directed proof dependencies. Evaluating the complete dependency subgraphs across Point-Set Topology, Continuous Analysis, Category Theory, and Discrete Algebra, we address the "Euler characteristic trap" through two complementary lenses: (1) normalizing 1-cavities against graph-theoretic cyclomatic cycle capacity, uncovering a universal library-wide invariant where every domain retains between 85.0% and 91.7% of its 1-skeleton cycles as non-contractible 1-cavities; and (2) benchmarking empirical transitive 2-simplices against poset-constrained degree-preserving directed configuration null models that strictly preserve a fixed topological sort $\tau(u) < \tau(v)$. Empirical transitive tournaments are enriched by 3.9x to 27.3x over degree-matched null models ($Z = +29.77$ to $+205.08, p < 10^{-190}$), proving that local simplicial closure is highly intentional. An audit of structural subtyping projections confirms that inheritance morphisms participate in at most 7.65% of algebraic cavities, proving that over 92.3% of 1-cavities represent authentic theorem proof confluence. Scale concentration is an intrinsic extreme-value property of deduction trees (median unshifted edge weight 0.8571), and the "lifetime inversion paradox" is resolved via the Axiom Bottleneck effect. Finally, we formulate the dual trivialization of confluence diamonds over $\mathbb{F}_2$, demonstrating that essential persistence (98.8%) quantifies the dual avoidance of artificial intermediate bridges and redundant ancestral citations.

Zenodo (CERN European Organization for Nuclear Research)
Bax & Willems (ES)
Topological and Geometric Data Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon