Zulip Chat Archive

Stream: Is there code for X?

Topic: Cartesian product in finset


George Shakan (Mar 27 2022 at 21:46):

How would I write code that defines a function from X to Y where X and Y are both Cartesian product of finsets.

Yaël Dillies (Mar 27 2022 at 21:48):

Do you want docs#prod.map ?

George Shakan (Mar 27 2022 at 21:50):

hmm, I don't think so, suppose I just want to define f(x,y) = x+y. How would I go about this?

Kyle Miller (Mar 27 2022 at 21:53):

It would likely be helpful if you could write a #mwe showing some of what you want to define (you can put sorry where you need help)

Yaël Dillies (Mar 27 2022 at 21:54):

Ah, in that case you just want something like λ x : α × β, x.1 + x.2 (and maybe you can remove : α × β if Lean has enough context).

Eric Wieser (Mar 27 2022 at 22:07):

Is it possible you mean "finite types" instead of "finsets"?


Last updated: Dec 20 2023 at 11:08 UTC