Skip to content

feat(Tactic/CategoryTheory): map attribute#37183

Open
dagurtomas wants to merge 8 commits intoleanprover-community:masterfrom
dagurtomas:functor-apply
Open

feat(Tactic/CategoryTheory): map attribute#37183
dagurtomas wants to merge 8 commits intoleanprover-community:masterfrom
dagurtomas:functor-apply

Conversation

@dagurtomas
Copy link
Copy Markdown
Contributor

@dagurtomas dagurtomas commented Mar 25, 2026

Adding @[map] to a lemma named H of shape ∀ .., f = g, where f and g are morphisms
in some category C, creates a new lemma named H_map of the form
∀ .. {D} (func : C ⥤ D), F.map f = F.map g and then applies
simp only [Functor.map_comp, Functor.map_id].


Open in Gitpod

@dagurtomas dagurtomas added WIP Work in progress LLM-generated PRs with substantial input from LLMs - review accordingly labels Mar 25, 2026
@github-actions github-actions bot added the t-meta Tactics, attributes or user commands label Mar 25, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

PR summary d4d96de5f1

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Tactic 3134 3136 +2 (+0.06%)
Import changes for all files
Files Import difference
Mathlib.Tactic 2
Mathlib.Tactic.CategoryTheory.Map (new file) 273

Declarations diff

+ comp_eq_id
+ comp_map
+ comp_map_reassoc
+ comp_map_simp
+ comp_map_to_dual
+ extractCatInstanceFromEq
+ hasSimpAttribute
+ mapCompSimp
+ mapExpr
+ mapExpr'
+ mapExprElab
+ mapExprHom
+ mapExprHomAux
+ mapExprMVars

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

@adamtopaz
Copy link
Copy Markdown
Contributor

Does this attribute work with reassoc? Could you add a test for this case?

@dagurtomas
Copy link
Copy Markdown
Contributor Author

I've added tests for interacting with reassoc and to_dual

@dagurtomas dagurtomas removed the WIP Work in progress label Mar 26, 2026
@joelriou
Copy link
Copy Markdown
Contributor

Is it possible to generate at least one of the existing lemmas by this attribute?

@dagurtomas
Copy link
Copy Markdown
Contributor Author

@joelriou see #37184 for a start

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

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly t-category-theory Category theory t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants