Skip to content

draft: gsimp tactic - #35591

Closed
JovanGerb wants to merge 9 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-gsimp
Closed

JovanGerb wants to merge 9 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-gsimp

Conversation

@JovanGerb

Copy link
Copy Markdown
Contributor

This is a draft PR for exploring a potential gsimp tactic. It would be able to do some things that the current grw tactic cannot do.


Open in Gitpod

@JovanGerb
JovanGerb marked this pull request as draft February 20, 2026 23:39
@mathlib-bors

mathlib-bors Bot commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in draft mode. No active bors state needed cleanup.

While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like bors r+ or bors try.

@github-actions

Copy link
Copy Markdown

🚨 PR Title Needs Formatting

Please update the title to match our commit style conventions.

Errors from script:

error: the PR title should be of the form
  abbrev: main title
or
  abbrev(scope): main title
Details on the required title format

The title should fit the following format:

<kind>(<optional-scope>): <subject>

<kind> is:

  • feat (feature)
  • fix (bug fix)
  • doc (documentation)
  • style (formatting, missing semicolons, ...)
  • refactor
  • test (when adding missing tests)
  • chore (maintain)
  • perf (performance improvement, optimization, ...)
  • ci (changes to continuous integration, repo automation, ...)

<optional-scope> is a name of module or a directory which contains changed modules.
This is not necessary to include, but may be useful if the <subject> is insufficient.
The Mathlib directory prefix is always omitted.
For instance, it could be

  • Data/Nat/Basic
  • Algebra/Group/Defs
  • Topology/Constructions

<subject> has the following constraints:

  • do not capitalize the first letter
  • no dot(.) at the end
  • use imperative, present tense: "change" not "changed" nor "changes"

@github-actions github-actions Bot added the t-meta Tactics, attributes or user commands label Feb 20, 2026
@github-actions

github-actions Bot commented Feb 20, 2026 •

Copy link
Copy Markdown

PR summary 5a2fd49571

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Tactic.GSimp.GSimpTheorems (new file) 82
Mathlib.Tactic.GSimp.Types (new file) 83
Mathlib.Tactic.GSimp.Rewrite (new file) 84
Mathlib.Tactic.GSimp.Core (new file) 85
Mathlib.Tactic.GSimp.Elab (new file) 86

Declarations diff

+ Cache
+ Cache.insert
+ CacheEntry
+ CacheEntry.find?
+ CacheEntry.insert
+ CacheIndex
+ Config
+ Context
+ Discharge
+ DischargeWrapper
+ DischargeWrapper.with
+ GSimpM
+ GSimpM.run
+ GSimpTheorem
+ GSimpTheorem.getValue
+ GSimpTheoremKey
+ GSimpTheoremTree
+ GSimpTheorems
+ GSimpTheorems.addGSimpTheorem
+ GSimpTheorems.unerase
+ GSimproc
+ Methods
+ MethodsRef
+ Result
+ Result.getProof
+ Result.mkTrans
+ State
+ Step
+ _root_.Lean.MVarId.replaceTargetImp
+ applyGSimpResult
+ applyGSimpResultToTarget
+ biSup_inf_le
+ defaultDischarger
+ double
+ elabGSimpArg
+ elabGSimpArgs
+ elabGSimpTheorem
+ eraseFwdIfBwd
+ eraseIfExists
+ evalGSimp
+ getCacheEntry
+ getConfig
+ getContext
+ getGCongrTheorems
+ getMethods
+ getRel
+ getRelName
+ getRelType
+ getRfl
+ getTrans
+ grewrite?
+ gsimpCore
+ gsimpGoal
+ gsimpLocation
+ gsimpTarget
+ gsimpTargetCore
+ imp_rfl
+ imp_trans
+ instance : BEq GSimpTheorem
+ instance : Nonempty MethodsRef
+ isInv
+ mainCore
+ mkDischargeWrapper
+ mkGSimpContext
+ mkGSimpTheoremCore
+ mkGSimpTheoremFromConst
+ mkGSimpTheoremFromExpr
+ mkGSimpTheoremKeys
+ mkMethods
+ mkSymm
+ modifyCacheEntry
+ post
+ ppGSimpTheorem
+ pre
+ resolveGSimpIdTheorem?
+ rewritePost
+ rewritePre
+ synthesizeArgs
+ tacticToDischarge
+ tryTheorem?
+ tryTheoremCore
+ withContra
+ withFreshCache
+ withRel

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

YaelDillies added a commit to YaelDillies/mathlib4 that referenced this pull request Apr 10, 2026
…ates

Relation predicates used to be `def`s over a `forall`, which was optimal for usability in fields of other structures.
This changed in leanprover-community#35591 and leanprover-community#35192 as a byproduct of reducing apparent code duplication. Unfortunately, the usability issue was overlooked.

This PR restores usability by dropping the use of those relation classes that are `structure`s, ie `Std.Irrefl` and `Std.Transitive`.
It also uses more widely the `simp` auto-param on `SimpleGraph.loopless`.
YaelDillies added a commit to YaelDillies/mathlib4 that referenced this pull request Jun 4, 2026
…ates

Relation predicates used to be `def`s over a `forall`, which was optimal for usability in fields of other structures.
This changed in leanprover-community#35591 and leanprover-community#35192 as a byproduct of reducing apparent code duplication. Unfortunately, the usability issue was overlooked.

This PR restores usability by dropping the use of those relation classes that are `structure`s, ie `Std.Irrefl` and `Std.Transitive`.
It also uses more widely the `simp` auto-param on `SimpleGraph.loopless`.
YaelDillies added a commit to YaelDillies/mathlib4 that referenced this pull request Jun 13, 2026
…ates

Relation predicates used to be `def`s over a `forall`, which was optimal for usability in fields of other structures.
This changed in leanprover-community#35591 and leanprover-community#35192 as a byproduct of reducing apparent code duplication. Unfortunately, the usability issue was overlooked.

This PR restores usability by dropping the use of those relation classes that are `structure`s, ie `Std.Irrefl` and `Std.Transitive`.
It also uses more widely the `simp` auto-param on `SimpleGraph.loopless`.
@JovanGerb

Copy link
Copy Markdown
Contributor Author

Since the grw tactic has been improved recently, there is now less need for a gsimp tactic in mathlib. gsimp could still be useful in place of grw in certain specific scenarios, but it's probably not worth it to add to mathlib any time soon.

@JovanGerb JovanGerb closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant