Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: port algebra.group.pi #1088

Closed
wants to merge 21 commits into from
Closed

Conversation

thorimur
Copy link
Collaborator

@thorimur thorimur commented Dec 16, 2022

mathlib3port tracking sha: b3f25363ae62cb169e72cd6b8b1ac97bacf21ca7

Porting notes

  • Moved AddMonoidWithOne and AddGroupWithOne here from their original files.
  • Corrected the name of Pi.Single to Pi.single in Data.Pi.Algebra, on which this depends. (Note: this change was only done in the final two commits, which can be split off into a subsequent PR for a good history if need be.)
  • Replaced explicit data fields by sourcing previously-defined instances where possible, as per this zulip discussion
  • Changed a name: update_eq_div_mulSingle => update_eq_div_mul_mulSingle, as it involves a multiplication of two mulSingles. (Note: the additive version in mathlib is update_eq_sub_add_single, and to_additive "agrees" that update_eq_div_mul_mulSingle is the right name in mathlib4.)

Review questions

  • Are we sure about using instances as sources where possible? Just want to double-check that it won't cause any problems.
  • If so, should the "highest-up" or "lowest-down" instances be used for sourcing when diamonds occur? E.g. Foo extends Bar0, Bar1, and both have relevant instances bar0, bar1. However, Bar1 extends Baz, and we also have a relevant instance baz which suffices for everything not in Bar0. Should the instance for Foo start { bar0, bar1 with ... } or { bar0, baz with ... }? Does it matter?
  • Should the data mul := (· * ·), zero := (0 : ∀ i, f i) remain explicit or be obtained by sourcing Pi.instMul, Pi.instZero respectively?

@thorimur thorimur added WIP Work in progress mathlib-port This is a port of a theory file from mathlib. labels Dec 16, 2022
@thorimur thorimur added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Dec 17, 2022
Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

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

I don't think we need all the rename_is and I'm slightly worried that they rely on the order that instances are generated. I've given a suggested workaround.

Mathlib/Data/Pi/Algebra.lean Show resolved Hide resolved
Mathlib/Algebra/Group/Pi.lean Outdated Show resolved Hide resolved
@semorrison
Copy link
Contributor

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Dec 18, 2022
bors bot pushed a commit that referenced this pull request Dec 18, 2022
mathlib3port tracking sha: `b3f25363ae62cb169e72cd6b8b1ac97bacf21ca7`

### Porting notes

* Moved `AddMonoidWithOne` and `AddGroupWithOne` here from their original files.
* Corrected the name of `Pi.Single` to `Pi.single` in `Data.Pi.Algebra`, on which this depends. (Note: this change was only done in the final two commits, which can be split off into a subsequent PR for a good history if need be.)
* Replaced explicit data fields by sourcing previously-defined instances where possible, as per [this zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/not.20porting.20pi_instance)
* Changed a name: `update_eq_div_mulSingle` => `update_eq_div_mul_mulSingle`, as it involves a multiplication of two `mulSingle`s. (Note: the additive version in mathlib is `update_eq_sub_add_single`, and `to_additive` "agrees" that `update_eq_div_mul_mulSingle` is the right name in mathlib4.)

### Review questions

* Are we sure about using instances as sources where possible? Just want to double-check that it won't cause any problems.
* If so, should the "highest-up" or "lowest-down" instances be used for sourcing when diamonds occur? E.g. `Foo` extends `Bar0`, `Bar1`, and both have relevant instances `bar0`, `bar1`. However, `Bar1` extends `Baz`, and we also have a relevant instance `baz` which suffices for everything not in `Bar0`. Should the instance for `Foo` start `{ bar0, bar1 with ... }` or `{ bar0, baz with ... }`? Does it matter?
* Should the data `mul := (· * ·)`, `zero := (0 : ∀ i, f i)` remain explicit or be obtained by sourcing `Pi.instMul`, `Pi.instZero` respectively?
@bors
Copy link

bors bot commented Dec 18, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: port algebra.group.pi [Merged by Bors] - feat: port algebra.group.pi Dec 18, 2022
@bors bors bot closed this Dec 18, 2022
@bors bors bot deleted the algebra.group.pi branch December 18, 2022 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mathlib-port This is a port of a theory file from mathlib. ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants