Zulip Chat Archive

Stream: mathlib4

Topic: forall_swap etc for a `Type*` and a `Prop`


Yury G. Kudryashov (Jan 23 2024 at 19:12):

What do you think about making docs#forall_swap a simp in a special case α : Type* β : Prop? Same about iSup, iUnion, iInf etc.

Yury G. Kudryashov (Jan 23 2024 at 19:13):

See, e.g., this comment by @Yaël Dillies for motivation.

Yaël Dillies (Jan 23 2024 at 19:14):

So move all the types inward and all the props outward? Interesting...

Yury G. Kudryashov (Jan 23 2024 at 19:15):

Currently, docs#exists_and_left is a @[simp] lemma. IMHO, forall_imp_swap {α : Type*} {p : Prop} {q : α → p → Prop} := @forall_swap α p q is very similar.

Kyle Miller (Jan 23 2024 at 21:19):

This might be a good use for simprocs, where a simproc could do the transformation all at once rather than doing it as a bubble sort. I don't have any intuition though whether the transformation is a good idea or not in general.

Eric Wieser (Jan 23 2024 at 21:29):

I would guess that the number of binders is rarely above 6, so a bubble sort isn't really all that bad

Eric Wieser (Jan 23 2024 at 21:30):

Which is to say: let's try the lemma version and benchmark before expending effort on the simp proc

Mario Carneiro (Jan 23 2024 at 21:31):

I would be concerned about performance, I'm not sure how good the indexing is wrt universes


Last updated: May 02 2025 at 03:31 UTC