Skip to content

[Merged by Bors] - feat: port Algebra.Group.WithOne.Defs - #841

Closed
kbuzzard wants to merge 10 commits into
masterfrom
kbuzzard-port-algebra-group-with-one-defs
Closed

kbuzzard wants to merge 10 commits into
masterfrom
kbuzzard-port-algebra-group-with-one-defs

Conversation

@kbuzzard

@kbuzzard kbuzzard commented Dec 3, 2022

Copy link
Copy Markdown
Member

mathlib3 commit hash e574b1a4e891376b0ef974b926da39e05da12a06

@kbuzzard kbuzzard added the WIP Work in progress label Dec 3, 2022
@kbuzzard kbuzzard mentioned this pull request Dec 3, 2022
2 tasks done
@kbuzzard

kbuzzard commented Dec 3, 2022

Copy link
Copy Markdown
Member Author

Things of note here:

  1. Like WithBot, we add coe : α → WithOne α and tag it @[coe] for compatibility with Lean 4's coercion mechanism
  2. Neither @[coe, to_additive] nor @[to_additive, coe] seems to tag the additivised definition with coe; same for @[norm_cast, to_additive] (which used to work in Lean 3). I've had to manually tag some to-additivised declarations as a consequence.
  3. I had to comment out a CanLift instance, and also rewrite a proof, because there is still no lift tactic.
  4. There are some shows which might not be needed; I asked at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/_proof_1/near/313734606 because I don't know how to test this.
  5. WithZero.zero_mul with WithZero.mul_zero used to be tagged @[simp] but a linter told me that simp only [zero_mul] proves it, so I removed the tags. This makes sense: WithZero alpha is an instance of MulZeroClass. I'm slightly surprised that the linter in mathlib3 doesn't flag this.

@kbuzzard kbuzzard added awaiting-review mathlib-port This is a port of a theory file from mathlib. and removed WIP Work in progress labels Dec 3, 2022
@kbuzzard kbuzzard changed the title feat: port Algebra.Group/WithOne.Defs feat: port Algebra.Group.WithOne.Defs Dec 3, 2022
Comment thread Mathlib/Algebra/Group/WithOne/Defs.lean Outdated
Comment on lines +177 to +180
-- example [Semigroup α] :
-- @Monoid.toMulOneClass _ (@instMonoidWithOne α _) = @instMulOneClassWithOne α _ :=
-- rfl

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.

Delete?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@kim-em

kim-em commented Dec 4, 2022

Copy link
Copy Markdown
Contributor

If you can remember it, could you add a porting note to the proof you had to rewrite for lack of simp? It would be good, even if only as a test, to restore this when lift arrives, hopefully soon.

@kim-em

kim-em commented Dec 4, 2022

Copy link
Copy Markdown
Contributor

bors d+

Please update the wiki page when you merge.

@bors

bors Bot commented Dec 4, 2022

Copy link
Copy Markdown

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

@github-actions github-actions Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Dec 4, 2022
Comment thread Mathlib/Algebra/Group/WithOne/Defs.lean Outdated
Comment on lines +121 to +125
-- porting note: in Lean 4 this is a syntactic tautology
-- @[to_additive]
-- theorem some_eq_coe {a : α} : (some a : WithOne α) = ↑a :=
-- rfl
-- #align with_one.some_eq_coe WithOne.some_eq_coe

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.

Suggested change
-- porting note: in Lean 4 this is a syntactic tautology
-- @[to_additive]
-- theorem some_eq_coe {a : α} : (some a : WithOne α) = ↑a :=
-- rfl
-- #align with_one.some_eq_coe WithOne.some_eq_coe
#noalign with_one.some_eq_coe

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

And with_zero.some_eq_coe too!

Comment thread Mathlib/Algebra/Group/WithOne/Defs.lean Resolved
@kbuzzard

kbuzzard commented Dec 4, 2022

Copy link
Copy Markdown
Member Author

OK I just realised that every @[to_additive] followed by an #align needs to have a second #align added for the additivised definition. I've just added these but don't want to hit merge until the branch compiles and unfortunately it's time for bed.

@kbuzzard

kbuzzard commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

Oh nice, it doesn't take hours to compile like mathlib3 :-)

@kbuzzard

kbuzzard commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

bors r+

@kim-em

kim-em commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

bors merge

bors Bot pushed a commit that referenced this pull request Dec 6, 2022
mathlib3 commit hash e574b1a4e891376b0ef974b926da39e05da12a06
@bors

bors Bot commented Dec 6, 2022

Copy link
Copy Markdown

Build failed (retrying...):

bors Bot pushed a commit that referenced this pull request Dec 6, 2022
mathlib3 commit hash e574b1a4e891376b0ef974b926da39e05da12a06
@bors

bors Bot commented Dec 6, 2022

Copy link
Copy Markdown

Build failed (retrying...):

  • Build

bors Bot pushed a commit that referenced this pull request Dec 6, 2022
mathlib3 commit hash e574b1a4e891376b0ef974b926da39e05da12a06
@bors

bors Bot commented Dec 6, 2022

Copy link
Copy Markdown

Build failed:

Comment thread Mathlib/Algebra/Group/WithOne/Defs.lean Resolved
@kim-em

kim-em commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

bors merge

bors Bot pushed a commit that referenced this pull request Dec 6, 2022
mathlib3 commit hash e574b1a4e891376b0ef974b926da39e05da12a06

Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
@bors

bors Bot commented Dec 6, 2022

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded:

@bors bors Bot changed the title feat: port Algebra.Group.WithOne.Defs [Merged by Bors] - feat: port Algebra.Group.WithOne.Defs Dec 6, 2022
@bors bors Bot closed this Dec 6, 2022
@bors
bors Bot deleted the kbuzzard-port-algebra-group-with-one-defs branch December 6, 2022 04:00
bors Bot pushed a commit to leanprover-community/mathlib3 that referenced this pull request Dec 6, 2022
Regenerated from the [port status wiki page](https://github.com/leanprover-community/mathlib/wiki/mathlib4-port-status).
Relates to the following PRs:
* `algebra.divisibility.basic`: leanprover-community/mathlib4#833
* `algebra.group.with_one.defs`: leanprover-community/mathlib4#841
* `algebra.hom.commute`: leanprover-community/mathlib4#831
* `algebra.hom.group`: leanprover-community/mathlib4#659
* `algebra.hom.units`: leanprover-community/mathlib4#745
* `algebra.ring.basic`: leanprover-community/mathlib4#830
* `category_theory.natural_isomorphism`: leanprover-community/mathlib4#820
* `combinatorics.quiver.connected_component`: leanprover-community/mathlib4#836
* `combinatorics.quiver.subquiver`: leanprover-community/mathlib4#828



Co-authored-by: Johan Commelin <[email protected]>
bors Bot pushed a commit that referenced this pull request Dec 6, 2022
mathlib3 SHA: dad7ecf9a1feae63e6e49f07619b7087403fb8d4

Ports Algebra.Order.Monoid.WithZero.[Defs, Basic].

- [x] depends on #841
- [x] depends on leanprover-community/mathlib3#17820

I'm planning to wait until leanprover-community/mathlib3#17820 is approved before doing a final refactor to move lemmas where they're needed.

Co-authored-by: thirdsgames <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: zeramorphic <[email protected]>
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). 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.

4 participants