{"id":13992955,"url":"https://github.com/leanprover/lean4checker","last_synced_at":"2026-03-02T22:38:39.489Z","repository":{"id":196440718,"uuid":"696113412","full_name":"leanprover/lean4checker","owner":"leanprover","description":"Replay the `Environment` for a given Lean module, ensuring that all declarations are accepted by the kernel.","archived":false,"fork":false,"pushed_at":"2025-06-30T00:41:06.000Z","size":109,"stargazers_count":25,"open_issues_count":1,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-30T01:30:51.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leanprover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-25T05:42:19.000Z","updated_at":"2025-06-30T00:41:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"93c60ce9-701e-49b7-865b-fa544adca6b7","html_url":"https://github.com/leanprover/lean4checker","commit_stats":null,"previous_names":["leanprover/redeclare","leanprover/lean4checker"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/leanprover/lean4checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean4checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean4checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean4checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean4checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/lean4checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flean4checker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266187670,"owners_count":23890012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T14:02:11.245Z","updated_at":"2026-03-02T22:38:39.477Z","avatar_url":"https://github.com/leanprover.png","language":"Lean","funding_links":[],"categories":["Lean"],"sub_categories":[],"readme":"# Recheck a compiled Lean `olean` file using the Lean kernel.\n\n`lake exe lean4checker \u003cmodule\u003e` will replay the environment in `\u003cmodule\u003e`,\nstarting from the environment provided by its imports,\nensuring that the kernel accepts all declarations.\n\n`lake exe lean4checker` without an argument will run `lean4checker` in parallel on every `.olean`\nfile on the search path (note that this include Lean 4 and all dependencies of your project).\n\nYou can also use `lake exe lean4checker --fresh Mathlib.Data.Nat.Basic` to replay all the constants\n(both imported and defined in that file) into a fresh environment.\nThis is single threaded, and may be much slower.\n\nThis is not an external verifier, as it uses the Lean kernel itself.\nHowever it is useful as a tool to detect \"environment hacking\",\ni.e. using metaprogramming facilities to build an inconsistent Lean `Environment`.\n\n## Usage\n\nTo run this in another Lean project, use:\n```\nlake env path/to/lean4checker\n```\nor\n```\nlake env path/to/lean4checker Mathlib.Data.Nat.Basic\n```\nto check a single file.\n\n\n## Caveats\n\nDespite `.olean` files being \"fairly cross-platform\",\n`lean4checker` will reject `.olean`s that were compiled on a system\nthat  does not use the same bignum library as your system,\nso it advisable to not rely on cached `.olean`s.\n\n## Testing\n\nRun `lake test` to run the test suite. This checks that `lean4checker` accepts its own codebase\nand correctly rejects test cases with known problems.\n\nTo add a new test case:\n1. Create a `.lean` file in `Lean4CheckerTests/` that produces an invalid environment\n2. Create a matching `.expected.out` file with the expected error output\n3. For tests requiring `--fresh` mode, use `.fresh.expected.out` instead\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Flean4checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2Flean4checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Flean4checker/lists"}