JetBrains / Arend

The Arend Proof Assistant
https://arend-lang.github.io/
Apache License 2.0
694 stars 33 forks source link

Auto-implicits in \where block stops working under function defined as a full pat mat #337

Closed Odomontois closed 1 year ago

Odomontois commented 1 year ago

E.g. this code

\func DepPath {X : \Type} {x x' : X} {Y : X -> \Type} (p : x = x') (y : Y x) (y' : Y x'): \Type
  | idp, y, y' => y = y' \where {

  \func pe (p : x = x') (y : Y x) (y' : Y x'): Path (\lam i => Y (p @ i)) y y' = DepPath p y y' \elim p
    | idp => idp
}

reports erros in pe definition on multiple "cannot resolve reference" while this works

\func DepPath {X : \Type} {x x' : X} {Y : X -> \Type} (p : x = x') (y : Y x) (y' : Y x'): \Type \elim p
  | idp => y = y' \where {

  \func pe (p : x = x') (y : Y x) (y' : Y x'): Path (\lam i => Y (p @ i)) y y' = DepPath p y y' \elim p
    | idp => idp
}
Odomontois commented 1 year ago

As discussed, eliminated parameters could not be seen from the subdefinitions.