Commit 2026-05-21 01:59 89d44072

View on Github →

feat(Data/FunLike): introduce typeclasses for algebraic properties of FunLike (#37779) These typeclasses remove the need for each function space that has, e.g., a linear structure to define add_apply, smul_apply, etc. Instead after defining the the Add instance one also defines a FunLikeAdd instance (with a proof usually being rfl). Allows removing some boilerplate as theorems like sum_apply are currently proved in various files: after this PR, they can be proved in an abstract way. Moreover, we provide abbreviations for further structure (such as `Semigroup``) in the concrete function spaces. The usage of these typeclasses were prototyped in #33477 and will be merged in a separate PR. The docstrings were generated with AI (and heavily edited afterwards), everything else is handwritten.

Estimated changes

added theorem FunLike.coe_div
added theorem FunLike.coe_intCast
added theorem FunLike.coe_inv
added theorem FunLike.coe_mul
added theorem FunLike.coe_natCast
added theorem FunLike.coe_one
added theorem FunLike.coe_one_eq_id
added theorem FunLike.coe_pow
added theorem FunLike.coe_smul