defplusTwoFailed to infer type of binder `x`Note: Because this declaration's type has been explicitly provided, all parameter types and holes (e.g., `_`) in its header are resolved before its body is processed; information from the declaration body cannot be used to infer what these values should bex:Nat:=x+2
Failed to infer type of binder `x`Note: Because this declaration's type has been explicitly provided, all parameter types and holes (e.g., `_`) in its header are resolved before its body is processed; information from the declaration body cannot be used to infer what these values should be
尽管在定义体中可以推断 x 的类型为 Nat,但精译 plusTwo 的类型时无法使用这一信息,因为定义的结果类型(Nat)已显式指定。
仅根据头部信息无法确定 x 的类型,于是产生所示错误。因此必须在
其绑定项中包含 x 的类型。
尝试为 example 声明命名
exampleFailed to infer type of binder `trivial_proof`Note: Examples do not have names. The identifier`trivial_proof`is being interpreted as a parameter`(trivial_proof : _)`.trivial_proof:True:=trivial
Failed to infer type of binder `trivial_proof`Note: Examples do not have names. The identifier`trivial_proof`is being interpreted as a parameter`(trivial_proof : _)`.
这段代码无效,因为它试图为 example 声明命名。示例不能命名;在其他声明形式中应出现名称的位置写入
标识符时,该标识符反而会被精译为绑定项,而其类型无法推断。如果声明必须命名,应使用支持命名的声明形式,
例如 def 或 theorem。
尝试一次定义多个不透明常量
opaquemFailed to infer type of binder `n`Note: Multiple constants cannot be declared in a single declaration. The identifier`n`is being interpreted as a parameter`(n : _)`.n:Nat
Failed to infer type of binder `n`Note: Multiple constants cannot be declared in a single declaration. The identifier`n`is being interpreted as a parameter`(n : _)`.