Zulip Chat Archive

Stream: lean4

Topic: behavior of `(arg := sorry)` syntax


Jireh Loreaux (Feb 16 2024 at 16:29):

Guess which of the following succeeds. I find this behavior extremely counterintuitive.

theorem foo (n m : Nat) (h : m = n) : m = n := h

example (n m : Nat) (h' : m = n) : m = n :=
  foo (h := h')

example (n m : Nat) (h' : m = n) : m = n :=
  foo _ _ (h := h')

example (n m : Nat) (h' : m = n) : m = n :=
  foo _ _ h'

Jireh Loreaux (Feb 16 2024 at 16:33):

This behavior means that supplying arguments with the (arg := sorry) syntax makes the user think / guess which prior arguments can be inferred from the value of arg!

Kyle Miller (Feb 16 2024 at 16:38):

This seems related to issue lean4#1867, and I added your example. I'm not sure whether it's working as intended or not, but it feels like a bug to me.

Jireh Loreaux (Feb 16 2024 at 16:44):

Indeed, that appears to be the same thing. Thanks!


Last updated: May 02 2025 at 03:31 UTC