The Topologies of Formal Deduction: A Directed Flag Complex Audit of Lean 4 Mathlib & The Epistemic Morphospace
Year: 2026
Type: preprint
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.
Author: Bastiaanssen, Rolf
Institution: Bax & Willems
Language: English
Subfield: Computational Theory and Mathematics
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7225569913
