Here is a minimized version of the unification itself
importMathlibopenLeanMetaQqin#evalshowMetaMUnitfromdoletI?←mkFreshExprMVarQq(Type)letEI?←mkFreshExprMVarQq($I?→Type)letinst?←mkFreshExprMVarQq((i:$I?)→NormedAddCommGroup.{0}($EI?i))letlhs:=Expr.lam`iq(Fin10×Unit)(inst?.app(Expr.appq(Prod.snd:Fin10×Unit→Unit)(.bvar0)))defaultwithLocalDeclQ`Rdefaultq(Type)funR=>dowithLocalDeclQ`R.instImplicitq(RCLike$R)funinstR=>doletrhsBody:=q(inferInstance:NormedAddCommGroup$R)letrhs:=q(fun(i:Fin10×Unit)=>$rhsBody)-- I?.mvarId!.assignIfDefeq q(Unit)-- EI?.mvarId!.assignIfDefeq q(fun _ : Unit => $R)-- inst?.mvarId!.assignIfDefeq q(fun _ : Unit => $rhsBody)if←isDefEqlhsrhsthenIO.println"unification succeeded"elsethrowError"unification failed"
If you uncomment all the assignIfDefeq i.e. assign the metavariables manually then the final defeq test succeeds.
I would like this unification to succeed. How can I achieve that? Can I write an unification hint?
Ideally I would not run into this problem at all, but I'm unable to minimize the simp call :( I'm thinking that reordering the simp theorem arguments might cause different unification order. Any other tip would be welcome.