Zulip Chat Archive
Stream: Is there code for X?
Topic: Diagonal from a function
Chase Fleming (Jul 07 2022 at 17:42):
Hi, I see that there is the general definition of a diagonal in in set.prod, however, is there an existing definition for the set
def function_diagonal (f: α → β): set (α × α) := {p | f p.1 = f p.2}
Yaël Dillies (Jul 07 2022 at 17:47):
This is prod.map f f ⁻¹' diagonal β
.
Chase Fleming (Jul 07 2022 at 17:49):
Thank you so much!
Last updated: Dec 20 2023 at 11:08 UTC