Zulip Chat Archive

Stream: new members

Topic: synthesize metavariables of function type


nnarek (Aug 30 2025 at 15:40):

I see that lean able to synthesize metavariables inside this term
#check ∀ (x : Nat) (f : Nat → ?B), f x = 1

but unable for this one
#check ∀ (x : Nat) (f : ?A → ?B), f x = 1
it throws the following error, from which I can conclude that Lean successfully unified ?A with Nat, but instead of synthsizing ?A, it throws error

Application type mismatch: The argument
  x
has type
  Nat
but is expected to have type
  ?A
in the application
  f x

I do not understand why it happens and are there an option which will allow to do such synthesis

Aaron Liu (Aug 30 2025 at 15:42):

?A generates a synthetic opaque metavariable which is usually not allowed to be assigned by unification

Kyle Miller (Aug 30 2025 at 15:42):

#check  (x : Nat) (f : _  ?B), f x = 1

The ? metavariables cannot be assigned by unification (except by tactics).


Last updated: Dec 20 2025 at 21:32 UTC