OK, I've been wondering for months about patterns of recursion (different folds ...

@TaliaRinger@mathstodon.xyz

OK, I've been wondering for months about patterns of recursion (different folds for different traversal orders) versus patterns of induction (including large elimination), and why this analogue is rarely mentioned. Five minutes of coffee with @andrejbauer and I feel like I get it.

When you move between patterns of recursion, like left and right folds for lists, you can always do this but will need an accumulator or helper function.

When you move between patterns of induction, like the standard list eliminator and the reversed list eliminator, you can always do this but will need to generalize your induction principle or use a helper lemma.

Having both left and right list folds is a convenience. Likewise for left and right induction. If I am proving something about reversed lists, it can be painful to use the standard list eliminator; I may want a reverse list eliminator directly.

This is why people talk about there being "one" fold or eliminator for a given type, even though really there are as many as there are traversals, which depends on the shape of the inductive type.

Missing in this, I think, is what (mathematically) makes it "nicer" to compute or prove with one fold or eliminator relative to another, for a given function one is trying to write or theorem one is trying to prove. How do I know which eliminator is most natural for my goal, in that it minimizes the need to generalize the induction principle?