The Lean mathematical library mathlib features extensive use of the typeclass pattern for organising mathematical structures, based on Lean's mechanism of instance parameters. Related mechanisms for typeclasses are available in other provers including Agda, Coq and Isabelle with varying degrees of adoption. This paper analyses representative examples of design patterns involving instance parameters in the current Lean 3 version of mathlib, focussing on complications arising at scale and how the mathlib community deals with them.
翻译:利昂数学图书馆数学里程根据利昂实例参数机制,广泛使用类型类模式组织数学结构,在阿格达、科克和伊莎贝尔等不同程度采用的其他证明中可以找到与类型类相关的机制。本文分析了涉及当前利昂3版数学里程参数的设计模式的代表性实例,侧重于规模产生的复杂问题以及数学界如何处理这些复杂问题。