Zulip Chat Archive

Stream: general

Topic: Functions on Dependent Functions


Devon Tuma (Dec 11 2022 at 21:22):

Are there special rules for functions operating on dependent functions? I'm not sure why one of these works but the other doesn't:

def test₁ : (Π {i : unit}, )  (Π {i : unit}, ) :=
id -- works

def test₂ : (Π {i : unit}, )  (Π {i : unit}, ) :=
λ x, x -- fails

Yaël Dillies (Dec 11 2022 at 21:23):

This is because of the {} binders.

Reid Barton (Dec 11 2022 at 21:23):

It has to do with the implicitness of i. In the second argument, i gets filled in (somehow) and then you're left with a number, not a function.

Reid Barton (Dec 11 2022 at 21:26):

If you don't want i to get filled in automatically in this situation, you can use the {{ }} or \{{ \}} binders (e.g. docs#function.injective)


Last updated: Dec 20 2023 at 11:08 UTC