Skip to content

feat: add Sym.simp theorem set attributes#13018

Merged
leodemoura merged 2 commits intomasterfrom
lean-sym-interactive-3
Mar 21, 2026
Merged

feat: add Sym.simp theorem set attributes#13018
leodemoura merged 2 commits intomasterfrom
lean-sym-interactive-3

Conversation

@leodemoura
Copy link
Copy Markdown
Member

@leodemoura leodemoura commented Mar 21, 2026

This PR adds named theorem sets for Sym.simp with associated attributes, following the same pattern as Meta.simp's register_simp_attr.

  • register_sym_simp_attr my_set creates a named set with its own PersistentEnvExtension and attribute
  • @[my_set] theorem ... adds a rewrite theorem
  • @[my_set] def ... adds equation theorems from the definition
  • builtin_initialize symSimpExtension registers a default @[sym_simp] set
  • getSymSimpTheorems / getSymSimpExtension? retrieve theorem sets at tactic time

New files:

  • Sym/Simp/Attr.lean: attribute logic (mkSymSimpAttr, registerSymSimpAttr)
  • Sym/Simp/RegisterCommand.lean: register_sym_simp_attr macro

Tests:

  • tests/pkg/sym_simp_attr/: package test with user-defined set (my_sym_simp)
  • tests/elab/sym_simp_set.lean: tests for the builtin @[sym_simp] set

Add `register_sym_simp_attr` command for creating named Sym.simp theorem
sets with associated attributes. Each set gets its own
`SymSimpExtension` (persistent environment extension).

When a proposition is tagged, it is added as a rewrite theorem.
When a definition is tagged, its equation theorems are added.

New files:
- `Sym/Simp/Attr.lean`: `mkSymSimpAttr`, `registerSymSimpAttr`
- `Sym/Simp/RegisterCommand.lean`: `register_sym_simp_attr` macro
- `tests/pkg/sym_simp_attr/`: package test exercising the attribute
@leodemoura leodemoura added changelog-language Language features and metaprograms changelog-tactics User facing tactics and removed changelog-language Language features and metaprograms labels Mar 21, 2026
@leodemoura leodemoura enabled auto-merge March 21, 2026 03:46
@leodemoura leodemoura added this pull request to the merge queue Mar 21, 2026
Merged via the queue into master with commit 973062e Mar 21, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-tactics User facing tactics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant