Zulip Chat Archive
Stream: lean4
Topic: Naming convention: f (k + 1) <= f k + 1
Siddharth Bhat (Apr 30 2025 at 16:37):
Consider the theorem:
theorem foo {k : Nat} {f : Nat → Nat} : f (k + 1) ≤ f k + 1 := sorry
What's the name of this theorem supposed to be? As far as I can tell, the "naming algorithm" says f_succ_le_f_succ, which is a bit nonsensical :)
Floris van Doorn (Apr 30 2025 at 16:55):
I assume you're asking this in the case that f is a specific function/declaration? Yes, our naming convention would indeed prescribe the name you suggest, but there is some flexibility. It would be easier if there is a mathematical term for this behavior "f - id is non-increasing", and then just use that term (in the same way, add_comm is not called add_eq_add).
Sabbir Rahman (Apr 30 2025 at 16:55):
That will probably be named f_succ_le_succ_f since in rhs, the succ happens after applying f.
Ruben Van de Velde (Apr 30 2025 at 18:11):
Sounds more like f_add_one_le_f_add_one
Kim Morrison (May 06 2025 at 07:30):
Yes, despite their persistence in names, I'd encourage everyone to avoid using succ to mean plus one. Only use it when you are really talking about the inductive definition of Nat.
Martin Dvořák (May 06 2025 at 11:34):
You mean use add_one instead of succ in the names of constants? Or avoid calling .succ in the code?
Ruben Van de Velde (May 06 2025 at 11:51):
Why not both :)
Yury G. Kudryashov (May 06 2025 at 14:51):
Kim meant "use succ in the name only if you use Nat.succ in the code". But the normal form is n + 1.
Last updated: Dec 20 2025 at 21:32 UTC