leanprover-community / mathlib

  • Home
  • Zulip archive
  • API documentation
  • Lean web editor
  • Links

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: May 02 2025 at 03:31 UTC

Theme Simple by wildflame © 2016 Powered by jekyll