Skip to content

Conversation

@nomeata
Copy link

@nomeata nomeata commented Nov 15, 2023

This is well known, but but without further protection against the
prelude command, one can easily prove unsound things, as this test
demonstrates.

Until the kernel itself is guarded against this (tracked at
leanprover/lean4#188), I wonder if lean4checker should have
a defense, and warn if prelude is used, or something along these lines?

I had to restructure the tests into their own library with a glob, as
importing this file from another file that also imports the normal
prelude seems to fail with

./././Lean4CheckerTests.lean:1:0: error: import Lean4CheckerTests.OverridenPrelude failed, environment already contains 'Eq.refl' from Init.Prelude

@kim-em
Copy link
Collaborator

kim-em commented Nov 16, 2023

Thanks, @nomeata. This PR has revealed that CI wasn't set up properly for PRs from forks. I've pulled out your changes to the file layout, and fixed CI, and then rebased your PR back onto master.

All that remains here is the failing test.

Probably not unexpected but without further protection against the
`prelude` command, one can easily prove unsound things, as this test
demonstrates.

It seems that either `lean4checker` should somehow ensure that only an
official prelude is used, or else the kernel (which implements `Nat.add`
differently) should check that the definition is indeed as expected.

I had to restructure the tests into their own library with a `glob`, as
_importing_ this file from another file that also imports the normal
prelude seems to fail with
```
./././Lean4CheckerTests.lean:1:0: error: import Lean4CheckerTests.OverridenPrelude failed, environment already contains 'Eq.refl' from Init.Prelude
```
@kim-em kim-em added the wip label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants