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] - refactor(Algebra/DualNumber): generalize the universal property to non-commutative rings #7934

Closed
wants to merge 21 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Oct 25, 2023

The current universal properties of TrivSqZeroExt and DualNumber work only when the underlying ring is commutative.
This is not the case for things like the dual quaternions.

This generalizes both sets of results to the non-commutative case.
Unfortunately the new TrivSqZeroExt version is rather involved, so this keeps the old statement as a special case.

The new DualNumber version is less bad, so I just discarded the commutative special case.

For dual numbers, the generalization is from R[ε] →ₐ[R] B to A[ε] →ₐ[R] B, where R is commutative but A may not be.
Some variable names had to be shuffled to make the new statement look nice.


Open in Gitpod

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR awaiting-CI t-algebra Algebra (groups, rings, fields etc) labels Oct 25, 2023
Mathlib/Algebra/DualNumber.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/TrivSqZeroExt.lean Outdated Show resolved Hide resolved
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Oct 25, 2023
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Oct 26, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

This PR/issue depends on:

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Oct 31, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Nov 2, 2023
theorem algHom_ext {A} [CommSemiring R] [Semiring A] [Algebra R A] ⦃f g : R[ε] →ₐ[R] A⦄
(h : f ε = g ε) : f = g :=
algHom_ext' <| LinearMap.ext_ring <| h
theorem algHom_ext {A} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]
Copy link
Member

Choose a reason for hiding this comment

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

I think there is value in keeping the old version of ext. It is a special case, but the side conditions are a lot simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

That seems fair, I've added it back. Ideally it would follow from ext <;> simp [*], but apparently some results needed to make that work are in un-imported files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, it now works with a similar proof!

Mathlib/Algebra/TrivSqZeroExt.lean Show resolved Hide resolved
Comment on lines +98 to +107
variable {A : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]

/-- For two `R`-algebra morphisms out of `A[ε]` to agree, it suffices for them to agree on the
elements of `A` and the `A`-multiples of `ε`. -/
@[ext 1100]
nonrec theorem algHom_ext' ⦃f g : A[ε] →ₐ[R] B⦄
(hinl : f.comp (inlAlgHom _ _ _) = g.comp (inlAlgHom _ _ _))
(hinr : f.toLinearMap ∘ₗ (LinearMap.toSpanSingleton A A[ε] ε).restrictScalars R =
g.toLinearMap ∘ₗ (LinearMap.toSpanSingleton A A[ε] ε).restrictScalars R) :
f = g :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I'm failing to understand what you generalised. What was assumed commutative before which is not anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

The generalization is from R[ε] →ₐ[R] B to A[ε] →ₐ[R] B, where A is not commutative

Copy link
Member Author

Choose a reason for hiding this comment

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

Added to the PR description

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah I see

Copy link
Collaborator

@YaelDillies YaelDillies 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!

maintainer merge

@eric-wieser
Copy link
Member Author

maintainer merge

Copy link

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-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 Nov 17, 2023
mathlib-bors bot pushed a commit that referenced this pull request Nov 17, 2023
…n-commutative rings (#7934)

The current universal properties of `TrivSqZeroExt` and `DualNumber` work only when the underlying ring is commutative.
This is not the case for things like the dual quaternions.

This generalizes both sets of results to the non-commutative case.
Unfortunately the new `TrivSqZeroExt` version is rather involved, so this keeps the old statement as a special case.

The new `DualNumber` version is less bad, so I just discarded the commutative special case.

For dual numbers, the generalization is from `R[ε] →ₐ[R] B` to `A[ε] →ₐ[R] B`, where `R` is commutative but `A` may not be.
Some variable names had to be shuffled to make the new statement look nice.
@mathlib-bors
Copy link

mathlib-bors bot commented Nov 17, 2023

Build failed:

@eric-wieser
Copy link
Member Author

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Nov 17, 2023
…n-commutative rings (#7934)

The current universal properties of `TrivSqZeroExt` and `DualNumber` work only when the underlying ring is commutative.
This is not the case for things like the dual quaternions.

This generalizes both sets of results to the non-commutative case.
Unfortunately the new `TrivSqZeroExt` version is rather involved, so this keeps the old statement as a special case.

The new `DualNumber` version is less bad, so I just discarded the commutative special case.

For dual numbers, the generalization is from `R[ε] →ₐ[R] B` to `A[ε] →ₐ[R] B`, where `R` is commutative but `A` may not be.
Some variable names had to be shuffled to make the new statement look nice.
mathlib-bors bot pushed a commit that referenced this pull request Nov 17, 2023
…n-commutative rings (#7934)

The current universal properties of `TrivSqZeroExt` and `DualNumber` work only when the underlying ring is commutative.
This is not the case for things like the dual quaternions.

This generalizes both sets of results to the non-commutative case.
Unfortunately the new `TrivSqZeroExt` version is rather involved, so this keeps the old statement as a special case.

The new `DualNumber` version is less bad, so I just discarded the commutative special case.

For dual numbers, the generalization is from `R[ε] →ₐ[R] B` to `A[ε] →ₐ[R] B`, where `R` is commutative but `A` may not be.
Some variable names had to be shuffled to make the new statement look nice.
@mathlib-bors
Copy link

mathlib-bors bot commented Nov 17, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(Algebra/DualNumber): generalize the universal property to non-commutative rings [Merged by Bors] - refactor(Algebra/DualNumber): generalize the universal property to non-commutative rings Nov 17, 2023
@mathlib-bors mathlib-bors bot closed this Nov 17, 2023
@mathlib-bors mathlib-bors bot deleted the eric-wieser/generalize-tsze branch November 17, 2023 14:04
alexkeizer pushed a commit that referenced this pull request Nov 21, 2023
…n-commutative rings (#7934)

The current universal properties of `TrivSqZeroExt` and `DualNumber` work only when the underlying ring is commutative.
This is not the case for things like the dual quaternions.

This generalizes both sets of results to the non-commutative case.
Unfortunately the new `TrivSqZeroExt` version is rather involved, so this keeps the old statement as a special case.

The new `DualNumber` version is less bad, so I just discarded the commutative special case.

For dual numbers, the generalization is from `R[ε] →ₐ[R] B` to `A[ε] →ₐ[R] B`, where `R` is commutative but `A` may not be.
Some variable names had to be shuffled to make the new statement look nice.
grunweg pushed a commit that referenced this pull request Dec 15, 2023
…n-commutative rings (#7934)

The current universal properties of `TrivSqZeroExt` and `DualNumber` work only when the underlying ring is commutative.
This is not the case for things like the dual quaternions.

This generalizes both sets of results to the non-commutative case.
Unfortunately the new `TrivSqZeroExt` version is rather involved, so this keeps the old statement as a special case.

The new `DualNumber` version is less bad, so I just discarded the commutative special case.

For dual numbers, the generalization is from `R[ε] →ₐ[R] B` to `A[ε] →ₐ[R] B`, where `R` is commutative but `A` may not be.
Some variable names had to be shuffled to make the new statement look nice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants