In Lean we make definitions and formulate theorems about the things we have defined. Seemingly, to each definition there exists several simple theorems. Let's go to MeasureTheory/Function/SimpleFunc.lean
because I think it's a decent example and because I've been mucking around here recently. In this file we define a structure SimpleFunc
and then we start giving easy theorems about it: coe_injective
, ext
, finite_range
, measurableSet_fiber
, apply_mk
, etc. When you write a file like this, how do you go about adding these small theorems? It would make sense that they're just added as we realize we need them, but also that experienced coders just carry a mental checklist with them generated by their goal in context. How should I think about this?
Note: This question may apply beyond the scope of "easy theorems", and any more-general commentary is certainly appreciated by me.