Skip to content

feat: support local hypotheses in simp [h] for sym => mode#13042

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

feat: support local hypotheses in simp [h] for sym => mode#13042
leodemoura merged 1 commit intomasterfrom
lean-sym-interactive-9

Conversation

@leodemoura
Copy link
Copy Markdown
Member

This PR extends the simp tactic in sym => mode to support local
hypotheses in the extra theorem list.

simp myVariant [h] now resolves h against the local context first,
falling back to global constants. Local hypotheses are converted to
rewrite rules via mkTheoremFromExpr, which applies the eq_true/
eq_false/propext adapter from #13041.

  • Add ExtraTheorem inductive (.const / .fvar) for cache keying
  • Add resolveExtraTheorems that checks the local context before globals
  • Update addExtraTheorems, mkDefaultMethods, elabVariant signatures

The `simp` tactic in `sym =>` mode now resolves identifiers in the extra
theorem list against local hypotheses first, falling back to global
constants. Local hypotheses are adapted via `mkTheoremFromExpr` (using
the `eq_true`/`eq_false`/`propext` adapter from #13041).

- Add `ExtraTheorem` inductive (`.const` / `.fvar`) for cache keying
- Add `resolveExtraTheorem` that checks the local context before globals
- Update `addExtraTheorems`, `mkDefaultMethods`, `elabVariant` signatures

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