-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sect. 8.5: incorrect error messages and solutions in Lean 4.11 #165
Comments
Thanks! This is an artifact of the book using a slightly old version of Lean. I plan to update it to a new version later this year. All error messages in the book are machine-checked, so this will definitely get fixed then. |
OK! I understand. Sounds good. (And I probably learned more by finding the discrepancy. 😄 ) |
I think I'm running this code with Lean 4.1.0 now, but the error messages is the same except for a syntactic variation.: ▶ expected type (59:34-59:35)
α : Type u_1
n k : Nat
x : α
xs : Vect α n
ys : Vect α k
⊢ Vect α (Nat.plusL n k + 1)
▶ 59:3-59:61: error:
type mismatch
?m.14985
has type
Vect α (Nat.plusL n k + 1) : Type ?u.14775
but is expected to have type
Vect α (Nat.plusL (n + 1) k) : Type ?u.14775 My lean-toolchain in the root of the project contains
and |
I now think I did something wrong in my code--I modified something from FPIL after I copied it, or typed it in by hand incorrectly. Just copying the bare minimum of definitions directly from the book produces no unexepcted errors in v. 4.13.0-rc3, nor in v. 4.1.0 (as you'd expect). Maybe there was something weird about 4.11, but I suspect that the problem was solely due to something in my code. Sorry to make a mess. |
Please quote the text that is incorrect:
In what way is this incorrect?
In Lean (version 4.11.0, x86_64-apple-darwin22.6.0, commit ec3042d94bd1, Release), the error on the last line of this version of
appendL
is:This is not similar to the error reported in the text. The solved versions below that point have similar errors--i.e. the solution doesn't work. The first variant (with the recursive call, but retaining
n
andk
parameters) has this error:The second solution--without the indexes as parameters--has essentially the same error, but with daggers.
(Is this a bug in Lean 4.11 rather than the book?)
The text was updated successfully, but these errors were encountered: