Skip to content

chore(Data/Finsupp): make mapDomain_congr congr#39575

Open
YaelDillies wants to merge 3 commits into
leanprover-community:masterfrom
YaelDillies:map_domain_congr
Open

chore(Data/Finsupp): make mapDomain_congr congr#39575
YaelDillies wants to merge 3 commits into
leanprover-community:masterfrom
YaelDillies:map_domain_congr

Conversation

@YaelDillies

Copy link
Copy Markdown
Contributor

This makes simp stronger. It particular, it breaks some proofs that relied on simp being weak.

From MeanFourier


Open in Gitpod

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

PR summary 70ae40eade

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ coe_id
+ mapDomain_fun_comp

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)

Lean-aware diff — post-build, computed from the Lean environment (commit 70ae40e).

  • +3 new declarations
  • −0 removed declarations
+Finsupp.mapDomain_fun_comp
+Finsupp.mapDomain_fun_id
+Representation.IntertwiningMap.coe_id

Increase in strong tech debt: (relative, absolute) = (1.00, 0.04)
Current number Change Type (strong)
25 1 disabled simpNF lints
No changes to weak technical debt.

Current commit 70ae40eade
Reference commit ae861491c1

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.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).

@github-actions github-actions Bot added the t-convex-geometry Affine geometry, cones, simplices label May 19, 2026
@YaelDillies
YaelDillies force-pushed the map_domain_congr branch 4 times, most recently from 8867e7c to 3899098 Compare May 21, 2026 10:54
@YaelDillies YaelDillies added t-data Data (lists, quotients, numbers, etc) and removed t-convex-geometry Affine geometry, cones, simplices labels Jun 27, 2026
@YaelDillies
YaelDillies requested a review from eric-wieser June 28, 2026 12:04
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 4, 2026
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 4, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 8, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 9, 2026
Comment thread Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean Outdated

@[simp]
theorem repr_reindex : (b.reindex e).repr x = (b.repr x).mapDomain e :=
theorem repr_reindex : (b.reindex e).repr x = (b.repr x).equivMapDomain e :=

@eric-wieser eric-wieser Jul 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivated this?

@YaelDillies YaelDillies Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the simp set more confluent. Otherwise simp fails to prove reindexFinsetRange_repr because the new congr lemma allows it to simplify the inside of the expression further earlier

Comment on lines +291 to +292
-- The linter complains that `mapDomain_id` can be proved from `mapDomain_fun_id` and `id_eq`
-- but this isn't true (at least within most of mathlib)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this true? It looks to me like the congr lemma would eta-expand id, which leads to that chain.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I wonder if simp high would be more appropriate to silence the linter)

@YaelDillies YaelDillies Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already tried simp high and simp\d a while ago and neither worked to silence the linter.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on "this isn't true (at least within most of mathlib)"?

@YaelDillies YaelDillies Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@[to_fun mapDomain_fun_id]
lemma mapDomain_id : mapDomain id v = v := sum_single _

/--
info: -- Found 0 errors in 41 declarations (plus 22 automatically generated ones) in the current file with 15 linters


-- All linting checks passed!
-/
#guard_msgs in
#lint

but if I do it with import Mathlib, then it complains. I tried bisecting quickly and I seem to be able to import most of mathlib without complaining

Comment thread Mathlib/RepresentationTheory/Intertwining.lean Outdated

@joneugster joneugster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

maintainer merge

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by joneugster.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants