Zulip Chat Archive

Stream: general

Topic: To Is or not to Is (convention on Props)


Fabrizio Montesi (Sep 06 2025 at 13:58):

Sometimes Prop definitions stating that a value 'is' or 'has' something start with the respective prefix (e.g., IsTop), sometimes they do not (e.g., Even). Is there an established convention for this?

The rule of thumb I'm currently following in CSlib so far is that if I have both a bundled and unbundled version of something, then I distinguish the latter by using the Is prefix or similar. But sometimes, when I don't have such two versions, I just drop the prefix for the Prop definition, like Bisimulation (https://cs-lean.github.io/Cslib/Foundations/Semantics/Lts/Bisimulation.html#Bisimulation).

Aaron Liu (Sep 06 2025 at 14:04):

my rule of thumb is if it's obviously a Prop then don't use an Is but if it seems like it could be confused for data then make it Is

Aaron Liu (Sep 06 2025 at 14:05):

of course, we also have stuff like docs#IsAdjoinRoot and docs#CategoryTheory.Limits.IsLimit which are data

Fabrizio Montesi (Sep 06 2025 at 14:07):

Right, but 'obviously' is not always obvious. Couldn't one think that Even is an even number (instead of the property of being even)?

Aaron Liu (Sep 06 2025 at 14:07):

good point

Luigi Massacci (Sep 06 2025 at 14:07):

If I remember correctly the mathlib naming guide had a paragraph about Is, though I have forgotten what it says entirely

Aaron Liu (Sep 06 2025 at 14:08):

maybe replace "obviously" with some synonym which has a weaker connotation

Etienne Marion (Sep 06 2025 at 14:08):

Here is what the naming convention says: https://leanprover-community.github.io/contribute/naming.html#prop-valued-classes

Fabrizio Montesi (Sep 06 2025 at 14:11):

Mmh that'd suggest IsBisimulation, right?
And then I could have a bundled version Bisimulation that contains the relation and the proof of IsBisimulation (although I see no use for it right now).

Tanner Duve (Sep 26 2025 at 17:06):

this is what i did for “Fact” and “isFact” in my LL phase semantics PR fwiw

Robert Maxton (Sep 27 2025 at 00:04):

Aaron Liu said:

of course, we also have stuff like docs#IsAdjoinRoot and docs#CategoryTheory.Limits.IsLimit which are data

For IsLimit, the argument is that it's "morally a subsingleton", in that for category theoretic purposes it's unique up to isomorphism which is all we ever care about, so you can usually throw away the data/save it to an opaque variable and get away with it


Last updated: Dec 20 2025 at 21:32 UTC