Zulip Chat Archive
Stream: mathlib4
Topic: Confusion about `Order.isSuccLimitRecOn`
Aaron Liu (Jul 14 2025 at 16:59):
I am trying to define something on ordinals by induction. I decided to use docs#Order.isSuccLimitRecOn. I quickly noticed that this theorem doesn't give me access to any induction hypotheses, and what I was actually looking for was docs#SuccOrder.limitRecOn. Should Order.isSuccLimitRecOn be renamed to Order.isSuccLimitCasesOn, to reflect that it doesn't give you access to any induction hypotheses?
Kenny Lau (Jul 14 2025 at 17:37):
@Aaron Liu according to @Violeta Hernández , using the rec is a beginner's trap, and you should use decreasing_by recursion instead
Aaron Liu (Jul 14 2025 at 17:37):
why is it a beginner's trap
Aaron Liu (Jul 14 2025 at 17:37):
is this bad
Kenny Lau (Jul 14 2025 at 17:37):
but actually the Ordinal rec you want is Ordinal.limitRecOn
Kenny Lau (Jul 14 2025 at 17:38):
because most of the time you actually don't need the base cases for limitRecOn
Aaron Liu (Jul 14 2025 at 17:38):
this time I do need the zero base case
Aaron Liu (Jul 14 2025 at 17:39):
I could rewrite it to not use that but
Aaron Liu (Jul 14 2025 at 17:40):
Kenny Lau said:
but actually the Ordinal rec you want is Ordinal.limitRecOn
I'm actually using NatOrdinal from CombinatorialGames (which was downstreamed from the docs#NatOrdinal in mathlib)
Violeta Hernández (Jul 14 2025 at 18:38):
a) I didn't say docs#SuccOrder.limitRecOn was a noob trap, I said that the technique of limit induction itself is; at least in most cases I've seen, you can replace constructions through limit induction or recursion by simpler constructions using only well-founded induction. But most doesn't mean all!
b) I agree it's weird for the namespaces to be distinct, I think that should be changed.
c) You should probably create NatOrdinal.limitRecOn for what you're doing; it would be def-eq to the ordinal theorem but of course be stated in terms of the type alias.
Last updated: Dec 20 2025 at 21:32 UTC