Zulip Chat Archive

Stream: mathlib4

Topic: Naming: ne_zero vs nonzero


Jovan Gerbscheid (Sep 02 2025 at 21:47):

Both ne_zero and nonzero are used as spellings for _ ≠ 0. Is this a problem, and do we have a preferred option?

Etienne Marion (Sep 02 2025 at 21:48):

I think ne_zero is better.

Ruben Van de Velde (Sep 03 2025 at 08:12):

Found 323 declarations whose name contains "nonzero". :scream:

Ruben Van de Velde (Sep 03 2025 at 08:12):

Though a fair number of false positives

Ruben Van de Velde (Sep 03 2025 at 08:13):

Most of them, even

Robin Arnez (Sep 03 2025 at 08:13):

I think
@loogle "ne_zero", _ ≠ 0

loogle (Sep 03 2025 at 08:13):

:search: Nat.succ_ne_zero, Nat.one_ne_zero, and 1488 more

Damiano Testa (Sep 03 2025 at 08:14):

$ (git grep "\(theorem\|lemma\|inductive\|structure\|def\|class\|instance\|alias\|abbrev\) [^ ]*nonzero" *) | wc
     91    1252   11655

Robin Arnez (Sep 03 2025 at 08:14):

is clearly more popular than
@loogle "nonzero", _ ≠ 0

loogle (Sep 03 2025 at 08:14):

:search: Int.natAbs_sign_of_nonzero, Int.sign_ofNat_of_nonzero, and 137 more

Ruben Van de Velde (Sep 03 2025 at 08:16):

I'll fix the three Int ones now

Ruben Van de Velde (Sep 03 2025 at 08:19):

Oh, the first two are in core. I'll fix the one

Damiano Testa (Sep 03 2025 at 08:19):

I didn't know that docs#List.nonzeroMinimum existed.

Markus Himmel (Sep 03 2025 at 08:21):

This seems to be an implementation detail of the omega tactic, it should be moved out of the List namespace.

Kim Morrison (Sep 04 2025 at 06:26):

lean#10243


Last updated: Dec 20 2025 at 21:32 UTC