Skip to content

feat(GRewrite): equality congruence - #44952

Draft
JovanGerb wants to merge 2 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-grw-congr
Draft

JovanGerb wants to merge 2 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-grw-congr

Conversation

@JovanGerb

Copy link
Copy Markdown
Contributor

This PR extends the grw tactic to use equality congruence. This uses the same congruence as simp. This gives us two benefits

  • When rewriting with a symmetric relation like _ ≡ _ [ZMOD n], you can now rewrite even if this relation appears in an arbitrary subexpression of the goal.
  • Now, grw -useRewrite can be used as a rw tactic that can rewrite terms with bound variables.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

PR summary aeeccc3070

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ Relation
+ Relation.instantiateMVars
+ congr
+ funextLemma
+ instance : Hashable Relation
+ instance : ToMessageData Relation

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean -- pending)

Computed after the build finishes.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit aeeccc3070
Reference commit fbc1661a32

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py 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).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant