Zulip Chat Archive

Stream: mathlib4

Topic: Should `Set.diff_subset_iff`/`sdiff_le_iff` be `@[simp]`?


Jovan Gerbscheid (Dec 21 2025 at 22:35):

In #32983 I tried to unify the notion of with . But this got stuck because

diff_subset_iff {s t u : Set α} : s \ t  u  s  t  u

Is not a simp lemma, while

sdiff_le_iff : a \ b  c  a  b  c

Is a simp lemma. And changing wither of these two things will break some proofs.

Is it desirable to have this mismatch in simp lemmas, or just an accident?

Aaron Liu (Dec 21 2025 at 22:39):

how do we decide whether to make something a simp lemma

Aaron Liu (Dec 21 2025 at 22:39):

I noticed docs#Set.image_subset_iff is a simp lemma but docs#Set.subset_kernImage_iff is not

Kevin Buzzard (Dec 21 2025 at 22:44):

Aaron Liu said:

how do we decide whether to make something a simp lemma

First you decide what the simp normal form is and then you make your simp lemmas accordingly, I guess.

This had a weird consequence in group theory because if you said to a group theorist "what do you think of g/hg/h" they would say "what the heck is /, that is an ambiguous and unused symbol" but if you said "well what do you think of gh1gh^{-1} then they'd say "I see that everywhere". And then if you say to them "and what do you think of "a+(b)a + (-b)" they would say "what is that monstrosity, do you just mean aba-b?". Somehow the fact that additive groups are often commutative and multiplicative groups often are not means that the sensible form is different in the two domains.


Last updated: Feb 28 2026 at 14:05 UTC