Skip to content

chore(RepresentationTheory/Homological/ContCohomology): refactor functoriality - #41539

Open
rmhi wants to merge 53 commits into
leanprover-community:masterfrom
rmhi:rh_functoriality
Open

rmhi wants to merge 53 commits into
leanprover-community:masterfrom
rmhi:rh_functoriality

Conversation

@rmhi

@rmhi rmhi commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Currently, functoriality of continuous cohomology is given by ContCohomology.map, which takes
a continuous group homomorphism \phi and an intertwining map f: res \phi X \to Y and returns a map from the
continuous cohomology of X to the continuous cohomology of Y.
The problem with this is that ContCohomology.map does not have a natural type such as Functor or NatTrans.

In this PR, we split ContCohomology.map as a composition of (continuousCohomologyFunctor _ _ _).map and a restriction map in continuous cohomology, which is defined as a natural transformation resNatTrans.

co-authored-by: Edison Xie @Whysoserioushah


Open in Gitpod

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

PR summary db6894e2dc

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ _root_.TopRep.resolutionXRes
+ _root_.TopRep.resolutionXRes_comp
+ _root_.TopRep.resolutionXRes_comp_d
+ _root_.TopRep.resolutionXRes_id
+ _root_.TopRep.resolutionXRes_naturality
+ _root_.TopRep.resolutionXRes_succ
+ _root_.TopRep.resolutionXRes_zero
+ _root_.continuousCohomologyFunctor
+ cochainsMap_comp_assoc
+ cochainsMap_f
+ cochainsMap_f_hom
+ cochainsResMap
+ cochainsResMap_comp
+ cochainsResMap_f
+ cochainsResMap_f_hom
+ cochainsResMap_id
+ cocyclesMap_comp_assoc
+ cocyclesResMap
+ cocyclesResMap_comp
+ cocyclesResMap_id
+ continuousCohomologyFunctor_obj
+ homogeneousCochainsFunctor
+ homogeneousCochainsFunctor_obj
+ homogeneousCochainsResNatTrans
+ homogeneousCochainsResNatTrans_app_f
+ homogeneousCochainsResNatTrans_comp_app
+ homogeneousCochainsResNatTrans_id_app
+ homogeneousCochainsXRes
+ homogeneousCochainsXRes_succ
+ homogeneousCochainsXRes_zero
+ instance {H : Type*} [Monoid H] (φ : H →* G) : (resFunctor (k := k) φ).Additive
+ invariantsRes
+ invariantsResMap_eq
+ invariantsResMap_id
+ invariantsResNatTrans
+ map_comp_assoc
+ ofHom_comp
+ resMap
+ resMap_comp
+ resMap_eq
+ resMap_id
+ resNatTrans
+ resNatTrans_app
+ resNatTrans_comp_app
+ resNatTrans_id_app
+ resolution'Functor
+ resolution'Res
+ resolution'ResNatTrans
+ resolution'ResNatTrans_app_f
+ π_map_assoc
+ π_resMap

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

  • +55 new declarations
  • −0 removed declarations
+ContinuousCohomology.cochainsResMap
+ContinuousCohomology.cochainsResMap_comp
+ContinuousCohomology.cochainsResMap_comp_assoc
+ContinuousCohomology.cochainsResMap_f
+ContinuousCohomology.cochainsResMap_f_hom
+ContinuousCohomology.cochainsResMap_id
+ContinuousCohomology.cocyclesResMap
+ContinuousCohomology.cocyclesResMap_comp
+ContinuousCohomology.cocyclesResMap_comp_assoc
+ContinuousCohomology.cocyclesResMap_id
+ContinuousCohomology.continuousCohomologyFunctor_obj
+ContinuousCohomology.homogeneousCochainsFunctor
+ContinuousCohomology.homogeneousCochainsFunctor_obj
+ContinuousCohomology.homogeneousCochainsResNatTrans
+ContinuousCohomology.homogeneousCochainsResNatTrans_app_f
+ContinuousCohomology.homogeneousCochainsResNatTrans_comp_app
+ContinuousCohomology.homogeneousCochainsResNatTrans_comp_app_assoc
+ContinuousCohomology.homogeneousCochainsResNatTrans_id_app
+ContinuousCohomology.homogeneousCochainsXRes
+ContinuousCohomology.homogeneousCochainsXRes_succ
+ContinuousCohomology.homogeneousCochainsXRes_zero
+ContinuousCohomology.resMap
+ContinuousCohomology.resMap_comp
+ContinuousCohomology.resMap_comp_assoc
+ContinuousCohomology.resMap_eq
+ContinuousCohomology.resMap_id
+ContinuousCohomology.resNatTrans
+ContinuousCohomology.resNatTrans_app
+ContinuousCohomology.resNatTrans_comp_app
+ContinuousCohomology.resNatTrans_comp_app_assoc
+ContinuousCohomology.resNatTrans_id_app
+ContinuousCohomology.resolution'Functor
+ContinuousCohomology.resolution'Functor_map_f
+ContinuousCohomology.resolution'Functor_obj
+ContinuousCohomology.resolution'Res
+ContinuousCohomology.resolution'ResNatTrans
+ContinuousCohomology.resolution'ResNatTrans_app_f
+ContinuousCohomology.termHₜ
+ContinuousCohomology.termHₜFunct
+ContinuousCohomology.π_resMap
+ContinuousCohomology.π_resMap_assoc
+TopRep.instAdditiveResFunctor
+TopRep.invariantsRes
+TopRep.invariantsResMap_eq
+TopRep.invariantsResMap_id
+TopRep.invariantsResNatTrans
+TopRep.ofHom_comp
+TopRep.resolutionXRes
+TopRep.resolutionXRes_comp
+TopRep.resolutionXRes_comp_d
+TopRep.resolutionXRes_id
+TopRep.resolutionXRes_naturality
+TopRep.resolutionXRes_succ
+TopRep.resolutionXRes_zero
+continuousCohomologyFunctor

Decrease in strong tech debt: (relative, absolute) = (2.00, 0.00)
Current number Change Type (strong)
1959 -2 backward.isDefEq.respectTransparency.types
No changes to weak technical debt.

Current commit db6894e2dc
Reference commit 2ee37b8e8a

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

@JX-Mo

JX-Mo commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

This isn't directly related to your PR, but the docstring of coind₁ looks suspicious. I am not aware a proof of the claim is isomorphic to the continuous coinduction of the trivial representation of the trivial subgroup. Without topologies, this would be true and the intertwining map would be f ↦ (x ↦ π x f(x⁻¹)). But this intertwining map may not send continuous functions to continuous functions, because the continuity of π is not assumed, right?

The coind₁Equivcoind we actually have suggests something different:

/-- The equivalence between `coind₁` and `coind` of the trivial representation of trivial
  subgroup of `G`. -/
def coind₁Equivcoind : (coind₁ (.trivial R (⊥ : Subgroup G) V)).Equiv
  (coind 1 (.trivial R G V)) := .mk (Submodule.topContEquiv.symm.trans <|
    ContinuousLinearEquiv.ofEq _ _ (by simp [SetLike.ext_iff])) <| fun g ↦ by
    simp [Subsingleton.elim g 1, ContinuousLinearMap.one_def]

Here 1 means 1 : G →ₜ* ↥⊥. What the docstring of coind₁ claims is that coind₁ π is isomorphic to coind 1 (trivial k ⊥ V) where 1 mean 1 : ↥⊥ →ₜ* G

@rmhi

rmhi commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you for the comment. You're correct, the isomorphism in the docstring is not the same as coind₁Equivcoind, and it does require a stronger continuity assumption than the definition of coind₁. I will put that right.

@JX-Mo

JX-Mo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thank you for the comment. You're correct, the isomorphism in the docstring is not the same as coind₁Equivcoind, and it does require a stronger continuity assumption than the definition of coind₁. I will put that right.

Do you seriously want to maintain coind? It is not used elsewhere apart from coind₁Equivcoind, whose content seems to be useless.

@rmhi

rmhi commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you for the comment. You're correct, the isomorphism in the docstring is not the same as coind₁Equivcoind, and it does require a stronger continuity assumption than the definition of coind₁. I will put that right.

Do you seriously want to maintain coind? It is not used elsewhere apart from coind₁Equivcoind, whose content seems to be useless.

coind isn't a special case of coind_1. It takes a representation of a group H together with a homomorphism H \to* G and returns a representation of G. I think it's probably useful, for example when stating something like Shapiro's lemma.

@JX-Mo

JX-Mo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thank you for the comment. You're correct, the isomorphism in the docstring is not the same as coind₁Equivcoind, and it does require a stronger continuity assumption than the definition of coind₁. I will put that right.

Do you seriously want to maintain coind? It is not used elsewhere apart from coind₁Equivcoind, whose content seems to be useless.

coind isn't a special case of coind_1. It takes a representation of a group H together with a homomorphism H \to* G and returns a representation of G. I think it's probably useful, for example when stating something like Shapiro's lemma.

That morally makes sense, but it seems mathematically non-trivial to figure out what your coind should be because I guess you would need some substitute of coind₁Equivcoind under certain conditions

@rmhi

rmhi commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

I don't know where to put these comments, apology if here is not the correct place.

The docstring of at the begining of the file also seems misleading to me. The core player is coind₁, which is used as the role of functorial "injective" resolution. Technically, what I pointed out is that possibly coind has not been used at all. So the reason to introduce ContRepresentation should not be The reason for this more general definition is that it allows us to define the coinduced representation of a continuous representation as also a continuous representation without any restriction on the topology on G, because the coinduced representation coind is not the player while coind₁ does not deserve the name "coinduced", which does not even make use of MonoidHom H\->G as an argument. It seems that a more suitable name for coind₁ could be preresolution.

Can you tell me which docstring we are talking about?
Just from memory, I think this is a discussion of what kind of continuity conditions the category TopRep should have. The most obvious condition would be to assume that the representation is continuous as a function G x V \to V. However this condition is not preserved by coind_1 unless the group is locally compact. It turns out that the much weaker condition imposed in TopRep is preserved by coind_1.

Regarding the name, I think coind_1 is better than the previous name I, but I don't object to preresolution. It's a stretch to call it coinduction unless the representation is continuous in a stronger sense than is assumed here. I don't think this definition is part of this PR.

@rmhi rmhi added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 21, 2026
@rmhi

rmhi commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

I don't know where to put these comments, apology if here is not the correct place.
The docstring of at the begining of the file also seems misleading to me. The core player is coind₁, which is used as the role of functorial "injective" resolution. Technically, what I pointed out is that possibly coind has not been used at all. So the reason to introduce ContRepresentation should not be The reason for this more general definition is that it allows us to define the coinduced representation of a continuous representation as also a continuous representation without any restriction on the topology on G, because the coinduced representation coind is not the player while coind₁ does not deserve the name "coinduced", which does not even make use of MonoidHom H\->G as an argument. It seems that a more suitable name for coind₁ could be preresolution.

Can you tell me which docstring we are talking about? Just from memory, I think this is a discussion of what kind of continuity conditions the category TopRep should have. The most obvious condition would be to assume that the representation is continuous as a function G x V \to V. However this condition is not preserved by coind_1 unless the group is locally compact. It turns out that the much weaker condition imposed in TopRep is preserved by coind_1.

Regarding the name, I think coind_1 is better than the previous name I, but I don't object to preresolution. It's a stretch to call it coinduction unless the representation is continuous in a stronger sense than is assumed here. I don't think this definition is part of this PR.

I agree that the docstring is misleading. I'll change this and also insert the correct isomorphism in place of coind_1Equivcoind. This might take a day or two.

@JX-Mo

JX-Mo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Thanks a lot for your fixing and patient answer and sorry for spamming comments here! Just a reminder, I launched a parallel discussion on Zulip https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Understanding.20ContCohomology.20and.20TopRep/with/611890095 where a refactor of TopRep were seriously discussed. Please let me know if my judgement and concerns are not fair there. My initial point was trying to understand your PR and then review, but unfortunately I think the issue I encountered along the way isn't as simple as fixing docstrings.

@rmhi rmhi removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 27, 2026
@riccardobrasca

Copy link
Copy Markdown
Member

I think we need to decide something about TopRep before moving on. I've thought a little bit about the possible refactor, and it seems reasonable to me. The main issue is that C(G, V) will not be in the category, right? It would be only for locally compact groups?

@rmhi

rmhi commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

I think we need to decide something about TopRep before moving on. I've thought a little bit about the possible refactor, and it seems reasonable to me. The main issue is that C(G, V) will not be in the category, right? It would be only for locally compact groups?

That's correct. We have a choice. If we allow groups which are not locally compact then we need to allow the more general representations in TopRep (the current definition). If we restrict to locally compact groups then we can also restrict to the category of representation in which the map G \times V \to V is continuous.

@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 Sep 26, 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 Nov 19, 2026
@Whysoserioushah

Copy link
Copy Markdown
Collaborator

Can you resolve the conflict? Concerning deprecations, I think you need (list generated by Claude)

@[deprecated (since := "2026-11-19")] alias cocyclesMap := cocyclesResMap
@[deprecated (since := "2026-11-19")] alias cocyclesMap_id := cocyclesResMap_id
@[deprecated (since := "2026-11-19")] alias cocyclesMap_comp := cocyclesResMap_comp
@[deprecated (since := "2026-11-19")] alias cocyclesMap_comp_assoc := cocyclesResMap_comp_assoc
@[deprecated (since := "2026-11-19")] alias map := resMap
@[deprecated (since := "2026-11-19")] alias π_map := π_resMap
@[deprecated (since := "2026-11-19")] alias π_map_assoc := π_resMap_assoc
@[deprecated (since := "2026-11-19")] alias map_id := resMap_id
@[deprecated (since := "2026-11-19")] alias map_comp := resMap_comp
@[deprecated (since := "2026-11-19")] alias map_comp_assoc := resMap_comp_assoc

thanks, done!

Whysoserioushah added a commit to rmhi/mathlib4 that referenced this pull request Nov 20, 2026
…inflation

Conflict in Mathlib/Topology/Algebra/Group/Quotient.lean resolved by keeping master's demoted imports (leanprover-community#43918) and adding the public import of Mathlib.Topology.Algebra.ContinuousMonoidHom needed by QuotientTopGroup.mk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the increases-technical-debt Automatically added label for PRs which increase "strong" technical debts label Nov 29, 2026
@rmhi

rmhi commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

What do you think about defining cont cohomology and resNatTrans from the existing map, map_id, etc? I mean as groupCohomology.functor and groupCohomology.resNatTrans do.

The thing about groupCohomology is that groupCohomology.functor.map and groupCohomology.map is really not the same thing, note that groupCohomology.functor.map φ := groupCohomology.map (MonoidHom.id _) φ n changes only rep where groupCohomology.map changes both the group and reps, the point of this PR is to "split" these two I think @rmhi probably has better explanation?

What I am not sure I understand is why resMap φ f n is not defined as (resNatTrans k φ n).app X ≫ (HₜFunct k H n).map f (isn't this the description?).

I agree. I've changed the file to make this the definition of resMap. I'm sorry about the delay.

@riccardobrasca

Copy link
Copy Markdown
Member

I am afraid something weird happened with the git history: for example all deprecations are gone.

@rmhi

rmhi commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

I am afraid something weird happened with the git history: for example all deprecations are gone.

oh, sorry about that. I'll sort it out and then get back to you.

@riccardobrasca riccardobrasca added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 30, 2026
@rmhi

rmhi commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

I've restored four of the deprecations. I can't restore the others because changing the definition of resMap removed the need for those definitions. resMap is now defined only as a map on cohomology, not a map on cochains/resolutions, etc.

I've also restored one comment which I'd accidentally removed.

@github-actions github-actions Bot added tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip and removed increases-technical-debt Automatically added label for PRs which increase "strong" technical debts labels Dec 1, 2026

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

awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. t-algebra Algebra (groups, rings, fields, etc) tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants