Multiple-Inheritance Hazards in Dependently-Typed Algebraic Hierarchies
Encoding abstract algebra's hierarchy of properties using dependently-typed typeclasses in Lean leads to multiple-inheritance hazards where the type of an outer typeclass depends on the resolution path, causing problems when paths are not judgmentally equal.
The authors provide concrete examples reduced from Lean's Mathlib showing how multiple inheritance in dependently-typed algebraic hierarchies produces type-level mismatches. They compare implementation approaches including flat structures, bundled typeclasses, and various encoding strategies. They outline solutions including kernel support for eta-reduction of structures.
The paper identifies specific failure modes in Mathlib's hierarchy encoding and proposes solutions, including changes to Lean's kernel for eta-reduction of structures, which would eliminate the class of problems identified.
