ほとんどのインスタンスでは Lean.Parser.Command.declaration : commandwhere 構文を使って各メソッドを定義します:
instance ::= ... |instance ((priority := prio))?`attrKind` matches `("scoped" <|> "local")?`, used before an attribute like `@[local simp]`.declId?`declId` matches `foo` or `foo.{u,v}`: an identifier possibly followed by a list of universe namesdeclSig where structInstField*`declSig` matches the signature of a declaration with required type: a list of binders and then `: type`
しかし、型クラスは帰納型であるため、インスタンスは適切な型を持つ任意の式を使って構築できます:
instance ::= ... |instance ((priority := prio))?`attrKind` matches `("scoped" <|> "local")?`, used before an attribute like `@[local simp]`.declId?`declId` matches `foo` or `foo.{u,v}`: an identifier possibly followed by a list of universe namesdeclSig := term`declSig` matches the signature of a declaration with required type: a list of binders and then `: type`Termination hints are `termination_by` and `decreasing_by`, in that order.
インスタンスはケースによって定義することもできます;しかし、 Decidable のインスタンス以外でこの機能が使われることはほとんどありません:
instance ::= ... |instance ((priority := prio))?`attrKind` matches `("scoped" <|> "local")?`, used before an attribute like `@[local simp]`.declId?`declId` matches `foo` or `foo.{u,v}`: an identifier possibly followed by a list of universe namesdeclSig (| term => term)*`declSig` matches the signature of a declaration with required type: a list of binders and then `: type`Termination hints are `termination_by` and `decreasing_by`, in that order.