Formalization of Harder-Narasimhan theory
The Harder-Narasimhan theory provides a canonical filtration of a vector bundle on a projective curve whose successive quotients are semistable with strictly decreasing slopes. In this article, we present a formalization of Harder-Narasimhan theory in the proof assistant Lean 4 with Mathlib. The formalization is based on a recent approach to Harder-Narasimhan theory by Chen and Jeannin, which reinterprets the theory in order-theoretic terms and avoids the classical dependence on algebraic geometry. As an application, we formalize the uniqueness of the coprimary filtration of a nontrivial finitely generated module over a Noetherian ring, as well as the existence of a Jordan-Hölder filtration for a semistable Harder-Narasimhan game.