Zulip Chat Archive

Stream: mathlib4

Topic: spelling convention for "nonzero"


Alex Meiburg (Feb 18 2026 at 17:20):

I'm aware of theorems spelling it as "nonzero", "nonZero", "non_zero", "neZero", and "ne_zero". The second option is mostly confined to the NeZero structure, but not entirely, e.g. LinearEquiv.smulOfNeZero and unitsEquivNeZero

examples:

I also found Algebra.discr_not_zero_of_basis but I think that one is just objectively a wrong name. :)

The pos/neg/nonneg/nonpos convention fixes this for other relations, but maybe it would be good to fix this for nonequality?

Yaël Dillies (Feb 18 2026 at 17:21):

Just use ne_zero please (except for uses of NeZero which should become neZero by the convention)

Alex Meiburg (Feb 18 2026 at 17:30):

https://github.com/leanprover-community/leanprover-community.github.io/pull/789, then?

Ruben Van de Velde (Feb 18 2026 at 18:59):

(And fooNeZero / neZeroFoo are correct for defs)

Andrew Yang (Feb 18 2026 at 21:33):

Do we really want to mention every non-exception in the style guide?

Alex Meiburg (Feb 18 2026 at 21:37):

There was enough instances of "nonzero" in Mathlib that I was genuinely not sure what the standard was...

Yaël Dillies (Feb 19 2026 at 17:05):

Yeah, let's not complicate the naming convention but simply fix the names in mathlib


Last updated: Feb 28 2026 at 14:05 UTC