Zulip Chat Archive

Stream: Is there code for X?

Topic: make an argument implicit


Felix Weilacher (Jan 18 2023 at 17:29):

Let's say I have a hypothesis h : ∀ x : α, p x. Is there a quick way to replace this with h : ∀ {x : α}, p x?

A not quick way is to just introduce this new version with have and prove it using the old version, but I'd like to avoid typing out p again in cases where it's complicated.

Riccardo Brasca (Jan 18 2023 at 17:32):

Not exactly an answer, but if the problem is that x is a very long expression that can be inferred you can write h _ and Lean will do the magic.

Felix Weilacher (Jan 18 2023 at 17:36):

yeah, this is what I've been doing. My reason for wanting to avoid it is that I actually have many arguments, so it becomes h _ _ _ _ etc. Still maybe it is the best solution.

Kevin Buzzard (Jan 18 2023 at 17:54):

change  {x : α}, _ at h,

Felix Weilacher (Jan 18 2023 at 22:37):

That works well, thanks!


Last updated: Dec 20 2023 at 11:08 UTC