Skip to content

[Merged by Bors] - refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures#20740

Closed
Thmoas-Guan wants to merge 19 commits intomasterfrom
refactor-morphisms-in-profiniteGrp
Closed

[Merged by Bors] - refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures#20740
Thmoas-Guan wants to merge 19 commits intomasterfrom
refactor-morphisms-in-profiniteGrp

Conversation

@Thmoas-Guan
Copy link
Copy Markdown
Collaborator

@Thmoas-Guan Thmoas-Guan commented Jan 14, 2025

Refactor morphisms in ProfiniteGrp into one-field structure.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 14, 2025

messageFile.md

@github-actions github-actions bot added the t-topology Topological spaces, uniform spaces, metric spaces, filters label Jan 14, 2025
@Thmoas-Guan Thmoas-Guan added the WIP Work in progress label Jan 14, 2025
@chrisflav
Copy link
Copy Markdown
Member

Could you please add a test file in MathlibTest, similar to the one for AlgebraCat?

Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Thank you for taking this on! I'm happy to see the amount of required changes was much less than for some of the other concrete categories. :)

A few small remarks.

@Vierkantor
Copy link
Copy Markdown
Contributor

I think this is pretty much good to go. I am less convinced we need that extra test file, since we do exactly the same as for AlgebraCat/ModuleCat/RingCat, so there should not be any surprises. But those tests are quite helpful for my follow-up work on the concrete category class. So I certainly wouldn't oppose more test files :)

@Thmoas-Guan
Copy link
Copy Markdown
Collaborator Author

I think this is pretty much good to go. I am less convinced we need that extra test file, since we do exactly the same as for AlgebraCat/ModuleCat/RingCat, so there should not be any surprises. But those tests are quite helpful for my follow-up work on the concrete category class. So I certainly wouldn't oppose more test files :)

So which one do you prefer? Adding test file right in this PR or in another one?

@Vierkantor
Copy link
Copy Markdown
Contributor

We should add it in this PR definitely. (Assuming you want to add it at all: having thought about it a bit more, I'm in favour of having the test file, but will not insist if you are not.)

@Thmoas-Guan
Copy link
Copy Markdown
Collaborator Author

Thmoas-Guan commented Jan 16, 2025

We should add it in this PR definitely. (Assuming you want to add it at all: having thought about it a bit more, I'm in favour of having the test file, but will not insist if you are not.)

Currently, 9 out of 14 failed.... I may need some time to fix.
Probably because of ContinuousMonoidHom is missing API every where....

and add missing API of ContinuousMonoidHom
@github-actions
Copy link
Copy Markdown

messageFile.md

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 16, 2025
@chrisflav
Copy link
Copy Markdown
Member

We should add it in this PR definitely. (Assuming you want to add it at all: having thought about it a bit more, I'm in favour of having the test file, but will not insist if you are not.)

Currently, 9 out of 14 failed.... I may need some time to fix. Probably because of ContinuousMonoidHom is missing API every where....

This is why I wanted the test file :) Thanks!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 17, 2025

PR summary 022323a991

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ ProfiniteAddGrp.Hom
+ ProfiniteGrp.Hom
+ ProfiniteGrp.coe_of
+ ProfiniteGrp.of
+ ProfiniteGrp.ofHom
+ coe_comp
+ coe_id
+ comp_apply
+ hom_comp
+ hom_ext
+ hom_id
+ hom_inv_apply
+ hom_ofHom
+ id_apply
+ instance : (forget₂ ProfiniteGrp Profinite).Faithful := {
+ instance : Group (Profinite.limitCone (F ⋙ (forget₂ ProfiniteGrp Profinite))).pt
+ instance : HasForget₂ ProfiniteGrp Profinite
+ instance : Limits.PreservesLimits (forget₂ ProfiniteGrp Profinite)
+ instance : TopologicalGroup (Profinite.limitCone (F ⋙ (forget₂ ProfiniteGrp Profinite))).pt
+ instance {M N : ProfiniteGrp.{u}} : CoeFun (M ⟶ N) (fun _ ↦ M → N)
+ inv_hom_apply
+ ofHom_apply
+ ofHom_comp
+ ofHom_hom
+ ofHom_id
- coe_of
- instance (G H : ProfiniteGrp) : ContinuousMapClass (G ⟶ H) G H
- instance (G H : ProfiniteGrp) : FunLike (G ⟶ H) G H
- instance (G H : ProfiniteGrp) : MonoidHomClass (G ⟶ H) G H
- instance : Group (Profinite.limitCone (F ⋙ profiniteGrpToProfinite.{max v u})).pt
- instance : Limits.PreservesLimits profiniteGrpToProfinite.{u}
- instance : TopologicalGroup (Profinite.limitCone (F ⋙ profiniteGrpToProfinite.{max v u})).pt
- instance : profiniteGrpToProfinite.Faithful := {
- of
- profiniteGrpToProfinite

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

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

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


No changes to technical debt.

You can run this locally as

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

@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 17, 2025
@Thmoas-Guan Thmoas-Guan removed the WIP Work in progress label Jan 17, 2025
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 17, 2025
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 19, 2025
Copy link
Copy Markdown
Member

@chrisflav chrisflav left a comment

Choose a reason for hiding this comment

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

Modulo the comment above and the merge conflict, this looks good, thanks!

@chrisflav chrisflav added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 30, 2025
@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 Jan 30, 2025
and fix to_additive attribute
@Thmoas-Guan
Copy link
Copy Markdown
Collaborator Author

Do anyone know why lint failed here? Sorry that I have no idea about it.

@chrisflav
Copy link
Copy Markdown
Member

Do anyone know why lint failed here? Sorry that I have no idea about it.

I think github is having issues right now, I don't think there is anything wrong with your PR.

2 similar comments
@chrisflav
Copy link
Copy Markdown
Member

Do anyone know why lint failed here? Sorry that I have no idea about it.

I think github is having issues right now, I don't think there is anything wrong with your PR.

@chrisflav
Copy link
Copy Markdown
Member

Do anyone know why lint failed here? Sorry that I have no idea about it.

I think github is having issues right now, I don't think there is anything wrong with your PR.

@chrisflav
Copy link
Copy Markdown
Member

Thanks!

maintainer merge

@github-actions
Copy link
Copy Markdown

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

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jan 30, 2025
@chrisflav chrisflav changed the title feat(Topology/Group): Refactor morphisms in ProfiniteGrp refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures Jan 30, 2025
@chrisflav chrisflav removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 30, 2025
@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Jan 30, 2025

@Vierkantor, could you do the final review/merge?

Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Looks good with some minor fixes, thanks! I think it should be easy enough to turn this into a new-style ConcreteCategory afterwards.

bors d+

forget₂.map f := Grp.ofHom f.hom.toMonoidHom

/-- A closed subgroup of a profinite group is profinite. -/
def ofClosedSubgroup {G : ProfiniteGrp} (H : ClosedSubgroup G) : ProfiniteGrp :=
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.

All of the declarations starting here are missing @[to_additive]. Or is there a reason for that?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, it is only because previously to_additive some how failed and many things are missing API for the add version, I should add it now.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

however is this a bug for to_additive ?
图片
it somehow didn't transport the Group instance.

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.

Hmm, that's weird. And if I make the instance manually and add @[to_additive existing] then @[to_additive] on the TopologicalGroup doesn't work either... Don't know how to fix that, and it feels like we're getting off the purpose of this PR. So if we can't fix it now it's fine to leave this as a TODO.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Almost everything broke after limitConePtAux, need to fix using attribute @[to_additive] which I think isn't a good idea, I'll leave a TODO then.

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 31, 2025

✌️ Thmoas-Guan can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Jan 31, 2025
@Thmoas-Guan
Copy link
Copy Markdown
Collaborator Author

Is this OK for now?

Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

bors r+

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jan 31, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jan 31, 2025
…ld structures (#20740)

Refactor morphisms in ProfiniteGrp into one-field structure.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 31, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures [Merged by Bors] - refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures Jan 31, 2025
@mathlib-bors mathlib-bors bot closed this Jan 31, 2025
@mathlib-bors mathlib-bors bot deleted the refactor-morphisms-in-profiniteGrp branch January 31, 2025 12:11
Julian added a commit that referenced this pull request Feb 2, 2025
* factorial-dvd-int: (143 commits)
  Apply suggestions from code review
  feat(Factorial): k! divides the product of any k successive integers
  feat(CategoryTheory): creation of finite limits (#21320)
  chore: update Mathlib dependencies 2025-02-01 (#21328)
  chore(GroupTheory/SpecificGroups/Alternating.lean): follow last minute review of JX (#21314)
  feat: `‖x‖ₑ.toNNReal = ‖x‖₊` (#21306)
  chore: cleanup imports in Archive/IfNormalization (#21318)
  doc: fix several typos (#21315)
  feat(CategoryTheory): transfer being iso along an iso in the arrow category (#21310)
  chore: delete declarations deprecated between 2024-01 and 2024-07 (#21271)
  feat(Analysis/Normed/Module/Dual): polar in a normed space as a submodule (#20084)
  chore(Data/ZMod/Basic): split `ZMod.valMinAbs` off (#21308)
  feat(GroupTheory/Perm/Centralizer): study the centralizer of a permutation (#17522)
  feat(RingTheory/LocalRing): `IsLocalRing` for subrings (#21168)
  chore: update Mathlib dependencies 2025-02-01 (#21312)
  chore: update Mathlib dependencies 2025-01-31 (#21311)
  feat: generalize `mem_dite` to `Membership α β` (#21262)
  feat: Lemmas for some monomial orders (#16177)
  feat(CategoryTheory): the localized category is monoidal (#12728)
  feat: add function log⁺ (=positive part of the logarithm) and prove standard estimates (#21289)
  feat(RingTheory/WittVector): ring of Witt vectors is p-adically complete (#21295)
  feat(GroupTheory/GroupAction/Blocks): more on blocks (#21284)
  fix(FieldTheory/KrullTopology): make `krullTopology_discreteTopology_of_finiteDimensional` universe polymorphic (#21299)
  feat(RingTheory/Artinian): integral non-zero-divisors are units over artinian rings (#21199)
  refactor(Topology/Gluing): simplify definition of `TopCat.GlueData.Rel` (#20653)
  feat(RingTheory/PowerSeries): binomial series (#20192)
  chore(Mathlib/RingTheory/MvPolynomial): rename MonomiaOrder.lCoeff to MonomialOrder.leadingCoeff  (#21290)
  chore (RingTheory/HahnSeries): fix names that use coeff (#21279)
  feat: let `notation3` distinguish `Prop` vs `Type _ ` vs `Sort _` (#21233)
  chore(MeasureTheory/Function/StronglyMeasurable): split Basic into Basic and AEStronglyMeasurable (#21273)
  feat(CategoryTheory): the monoidal category structure on a localization (#20951)
  feat(Analysis/Complex/Hadamard): generalize Hadamard's three lines theorem (#15009)
  feat(Order/CompleteBooleanAlgebra): Himp in terms of sSup (#20328)
  feat(ENNReal/Basic): add `ofNat_ne_top` and `top_ne_ofNat` (#14486)
  feat: Function.const as a PartialEquiv (#21137)
  chore(NonZeroDivisors): don't import rings (#20871)
  feat(Data/Set/Lattice): insert distributivity with iUnion/iInter (#21267)
  feat(GroupTheory/SpecificGroups/AlternatingGroup): subgroups of index 2 of Equiv.Perm (#21190)
  feat(GroupTheory/GroupAction/Transitive): basic results on transitive actions (#21285)
  perf(MeasureTheory/Function/LpSpace.lean): speed up (#21179)
  feat(Order): order isomorphisms from `Fin n` for small `n` (#21120)
  refactor(Topology/Group): turn morphisms in ProfiniteGrp into one field structures (#20740)
  feat: Sylow's first theorem for elementary `p`-groups (#21072)
  chore(Submonoid/Membership): don't import `MonoidWithZero` (#20748)
  refactor(Algebra/Algebra/Pi): cleanup and renaming (#21213)
  feat(GroupTheory/IndexNormal): subgroups of small index are normal (#21186)
  feat(Algebra/Group/Action): add definition of equidecomposition (#16936)
  feat(CategoryTheory/Subpresheaf): equalizer (#21096)
  feat: add lemmas about products of `Matrix.stdBasisMatrix` (#21204)
  chore: update Mathlib dependencies 2025-01-31 (#21282)
  ...
jt496 pushed a commit that referenced this pull request Feb 3, 2025
…ld structures (#20740)

Refactor morphisms in ProfiniteGrp into one-field structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-topology Topological spaces, uniform spaces, metric spaces, filters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants