Skip to content

feat: add interactive simp tactic for sym => mode#13039

Merged
leodemoura merged 1 commit intomasterfrom
lean-sym-interactive-6
Mar 22, 2026
Merged

feat: add interactive simp tactic for sym => mode#13039
leodemoura merged 1 commit intomasterfrom
lean-sym-interactive-6

Conversation

@leodemoura
Copy link
Copy Markdown
Member

This PR adds the simp tactic to the sym => interactive mode, completing
the Sym.simp interactive infrastructure.

The simp tactic supports:

  • simp — default variant with @[sym_simp] theorem set, simpControl >> simpArrowTelescope pre, evalGround >> thms.rewrite post
  • simp myVariant — named variant registered via register_sym_simp
  • simp [thm₁, thm₂] — default variant with extra rewrite theorems appended to post
  • simp myVariant [thm₁, thm₂] — named variant with extra theorems

Per-variant persistent caching: each unique (variant name, extra theorem list)
combination gets its own Sym.Simp.State cache, shared across invocations
within a sym => block. Test 10 verifies cache hits using trace.sym.simp.debug.cache.

This PR adds the `simp` tactic to the `sym =>` interactive mode, completing
the `Sym.simp` interactive infrastructure.

The `simp` tactic supports:
- `simp` — default (identity) variant
- `simp myVariant` — named variant registered via `register_sym_simp`
- `simp [thm₁, thm₂]` — default variant with extra rewrite theorems
- `simp myVariant [thm₁, thm₂]` — named variant with extra theorems

Extra theorems are composed into the variant's `post` chain via `>>`.

Per-variant persistent caching: each unique (variant name, extra theorem list)
combination gets its own `Sym.Simp.State` cache, shared across invocations
within a `sym =>` block. This avoids redundant simplification of identical
subterms when `simp` is called repeatedly (e.g., in branching proofs).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@leodemoura leodemoura added the changelog-tactics User facing tactics label Mar 22, 2026
@leodemoura leodemoura requested a review from kim-em as a code owner March 22, 2026 15:43
@leodemoura leodemoura enabled auto-merge March 22, 2026 15:43
@leodemoura leodemoura added this pull request to the merge queue Mar 22, 2026
Merged via the queue into master with commit 8f6411a Mar 22, 2026
21 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