'Coq, true datatype
So I have this problem:
In environment n : nat The term "true" has type "Datatypes.bool" while it is expected to have type "bool".
I have no idea what does it mean. trying to prove: Theorem eqb_0_l : forall n:nat, 0 =? n = true -> n = 0.
Solution 1:[1]
I guess you are working with Software Foundations - which has at least in the introductory chapters its own definition of bool. If you Require modules from both, Software Foundations and the Coq standard library, you easily end up with multiple definitions of bool, nat, ... .
The solution is to not Require anything from the Coq standard library in the introductory chapters from Software Foundations. Only Require modules which come with SF.
SF does this so because it explains how to define nat and bool and how to prove basic lemmas about these taypes. This can't be done without actually defining them, which leads to the mentioned problems.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | M Soegtrop |
