Skip to content

feat(GroupTheory/Divisible): Add rational SMul and Module#25190

Closed
wwylele wants to merge 1 commit intomasterfrom
wwylele-hahn-divisible
Closed

feat(GroupTheory/Divisible): Add rational SMul and Module#25190
wwylele wants to merge 1 commit intomasterfrom
wwylele-hahn-divisible

Conversation

@wwylele
Copy link
Copy Markdown
Collaborator

@wwylele wwylele commented May 25, 2025

This is part of #25140. A torsion-free ℕ-divisible commutative group is a ℚ-module.

This new instance could collide with existing instances such as ℚ-module on ℝ that comes from Algebra. I don't know how much an issue this is. I set the new instance with low priority so hopefully it won't interfere existing instances.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

PR summary ab7ba7e5ea

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ RootableBy.mul_qpow
+ RootableBy.one_qpow
+ RootableBy.one_root
+ RootableBy.qpow_add
+ RootableBy.qpow_eq
+ RootableBy.qpow_mul
+ RootableBy.qpow_one
+ RootableBy.qpow_zero
+ RootableBy.root_inv
+ RootableBy.root_one
+ den_mul_den_eq_den_mul_gcd
+ instance (priority := 100) DivisibleBy.instModule (M : Type*) [AddCommGroup M] [DivisibleBy M ℕ]
+ instance (priority := 100) DivisibleBy.instMulAction (M : Type*) [AddGroup M] [DivisibleBy M ℕ]
+ instance (priority := 100) DivisibleBy.instSMul (M : Type*) [AddGroup M] [DivisibleBy M ℕ] :
+ instance (priority := 100) RootableBy.instPow (M : Type*) [Group M] [RootableBy M ℕ] :
+ num_mul_num_eq_num_mul_gcd

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

@wwylele wwylele mentioned this pull request May 25, 2025
7 tasks
@eric-wieser
Copy link
Copy Markdown
Member

This new instance could collide with existing instances such as ℚ-module on ℝ that comes from Algebra. I don't know how much an issue this is.

This seems like a big enough deal to me that this should not be a (global) instance at all. I think it would be better to add theorems saying that if an instance exists, then smul can be expressed in terms of divisibility.

I set the new instance with low priority so hopefully it won't interfere existing instances.

Unfortunately instance priorities are not an effective tool for dealing with typeclass diamonds. At best, they are good for performance optimization.

@eric-wieser eric-wieser added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 8, 2025
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Jun 17, 2025

This PR has been migrated to a fork-based workflow: #26059

@wwylele wwylele closed this Jun 17, 2025
@YaelDillies YaelDillies deleted the wwylele-hahn-divisible branch August 18, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. migrated-to-fork

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants