lean4-htt/tests
Kim Morrison cee149cc1f
feat: add #import_path, assert_not_exists, assert_not_imported commands (#11726)
This PR upstreams dependency-management commands from Mathlib:

- `#import_path Foo` prints the transitive import chain that brings
`Foo` into scope
- `assert_not_exists Foo` errors if declaration `Foo` exists (for
dependency management)
- `assert_not_imported Module` warns if `Module` is transitively
imported
- `#check_assertions` verifies all pending assertions are eventually
satisfied

These commands help maintain the independence of different parts of a
library by catching unintended transitive dependencies early.

### Example usage

```lean
-- Find out how Nat got into scope
#import_path Nat
-- Declaration Nat is imported via
-- Init.Prelude,
--   which is imported by Init.Coe,
--   which is imported by Init.Notation,
--   ...
--   which is imported by this file.

-- Assert that a declaration should not be in scope yet
assert_not_exists SomeAdvancedType

-- Assert that a module should not be imported
assert_not_imported Some.Heavy.Module

-- Verify all assertions are eventually satisfied
#check_assertions
```

Addresses
https://lean-fro.zulipchat.com/#narrow/channel/398861-general/topic/path.20of.20an.20import

🤖 Prepared with Claude Code

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-19 04:09:33 +00:00
..
bench refactor: remove IteratorCollect (#11706) 2025-12-17 23:02:33 +00:00
bench-radar
compiler
elabissues
ir
lake fix: lake: meta import transitivity (#11683) 2025-12-16 08:28:52 +00:00
lean feat: add #import_path, assert_not_exists, assert_not_imported commands (#11726) 2025-12-19 04:09:33 +00:00
pkg fix: ensure by uses expected instead of given type for modsys aux decl (#11673) 2025-12-14 17:44:38 +00:00
playground
plugin
simpperf
.gitignore
common.sh feat: module system is no longer experimental (#11637) 2025-12-12 21:20:26 +00:00
lakefile.toml feat: module system is no longer experimental (#11637) 2025-12-12 21:20:26 +00:00
lean-toolchain