Zulip Chat Archive

Stream: mathlib4

Topic: isEmpty_subtype


Violeta Hernández (Dec 02 2024 at 23:07):

docs#isEmpty_subtype makes it so that for s : Set α, IsEmpty s simplifies to ∀ x, x ∉ s instead of the expected s = Ø.

Violeta Hernández (Dec 02 2024 at 23:08):

Is this desirable? Or should the simp set be tweaked?

Kevin Buzzard (Dec 03 2024 at 00:17):

That's a 404 for me, but I guess you could add the lemma saying that the forall statement is true iff s is empty, tag it simp, stick it on a branch, make a PR, mark it draft, get the green tick and then benchmark it to see if it makes things better or worse

Violeta Hernández (Dec 03 2024 at 01:52):

Had the theorem name wrong, fixed

Kyle Miller (Dec 03 2024 at 01:58):

Yeah, that seems like a problematic simp lemma. (Do I have it right that there's nonconfluence? If the simp set is nonconfluent, then it ought to be fixed on way or another.)

Maybe it would be better to have IsEmpty (Subtype p) <-> SetOf p = Ø as a simp lemma, which would match up with docs#Set.isEmpty_coe_sort, if it should be a simp lemma at all. Note that Set.isEmpty_coe_sort is not a simp lemma.

A version of isEmpty_subtype that could definitely be a simp lemma would be a conditional version, namely ∀ (x : α), ¬p x -> IsEmpty (Subtype p). This seems like it could be useful, at a bit of cost of having simp trying to discharge this hypothesis.

Violeta Hernández (Dec 12 2024 at 14:49):

The reason for isEmpty_coe_sort not being simp is that it competes with isEmpty_subtype.

Violeta Hernández (Dec 12 2024 at 14:50):

I'll try making the former simp and the latter not simp to see what happens

Violeta Hernández (Dec 12 2024 at 14:51):

#19918

Violeta Hernández (Dec 12 2024 at 16:47):

The PR now builds. There was barely any breakage, and in fact I was able to make two simp sets smaller.

Yuyang Zhao (Dec 29 2024 at 06:23):

It took me some time to figure out why #5901 build failed.

Violeta Hernández (Dec 29 2024 at 17:55):

What happened? Is this a bad simp lemma after all?


Last updated: May 02 2025 at 03:31 UTC