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

feat: add Algebra.compHom and related lemma #18404

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

yhtq
Copy link
Collaborator

@yhtq yhtq commented Oct 29, 2024

Add some simple definition and lemmas to construct Algebra structure from Algebra on another equivalent ring.

As preparation for the following result: If K and K' are fraction rings of A, and L and L' are fraction rings of B, then IsGalois K L implies IsGalois K' L'.


Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Oct 29, 2024
@yhtq yhtq added the t-algebra Algebra (groups, rings, fields, etc) label Oct 29, 2024
Copy link

github-actions bot commented Oct 29, 2024

PR summary 988c3ce9ea

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ RingHom.algebraMap_toAlgebra'
+ RingHom.smul_toAlgebra'
+ compHom:
+ compHom_algebraMap_apply
+ compHom_algebraMap_eq
+ compHom_smul_def
+ compHom_toRingHom_apply
+ compHom_toRingHom_eq
+ ofRingEquiv_compHom

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.

@erdOne
Copy link
Member

erdOne commented Oct 29, 2024

Can you explain where this will be used?
And ofAlgOnEquivRing R' B e is basically just ((algebraMap R' B).comp e.toRingHom).toAlgebra

Edit: Or ((algebraMap R' B).comp e.toRingHom).toAlgebra' sorry if you want non-commutative algebras.

@yhtq
Copy link
Collaborator Author

yhtq commented Oct 30, 2024

Can you explain where this will be used? And ofAlgOnEquivRing R' B e is basically just ((algebraMap R' B).comp e.toRingHom).toAlgebra

Edit: Or ((algebraMap R' B).comp e.toRingHom).toAlgebra' sorry if you want non-commutative algebras.

of_equiv_on_equiv_ring is a little more important for me which is convenient in a commutative diagram. I will rewrite them to homomorphism version.

@yhtq yhtq changed the title feat: add TransAlgStruct.lean feat: add Algebra.compHom and related lemma Oct 30, 2024
@yhtq yhtq requested a review from eric-wieser October 30, 2024 09:03
@@ -175,6 +175,18 @@ def RingHom.toAlgebra' {R S} [CommSemiring R] [Semiring S] (i : R →+* S)
smul_def' _ _ := rfl
toRingHom := i

/---/
Copy link
Member

Choose a reason for hiding this comment

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

@grunweg, can we have a linter that bans this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, that is easy to do (having a linter for doc comments with, say, only whitespace or containing just the string "TODO"). I'll bump it on my list of ideas!

@yhtq yhtq requested a review from eric-wieser October 31, 2024 09:20
Comment on lines +332 to +334
/--
Compose a Algebra with a RingHom, with action f s • m.
-/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/--
Compose a Algebra with a RingHom, with action f s • m.
-/
/--
Compose an `Algebra` with a `RingHom`, with action `f s • m`.
This is the algebra version of `Module.compHom`.
-/

/--
Compose a Algebra with a RingHom, with action f s • m.
-/
abbrev compHom: Algebra S A where
Copy link
Member

Choose a reason for hiding this comment

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

style nit:

Suggested change
abbrev compHom: Algebra S A where
abbrev compHom : Algebra S A where

Generally, there should always be spaces around colons; can you go through the PR and fix these throughout?

Comment on lines +341 to +362
theorem compHom_smul_def (s : S) (x : A):
letI := compHom A f
s • x = f s • x := by
letI := compHom A f
rw [Algebra.smul_def]
exact Eq.symm (smul_def (f s) x)

theorem compHom_algebraMap_eq :
letI := compHom A f
algebraMap S A = (algebraMap R A).comp f := rfl

theorem compHom_algebraMap_apply (s : S) :
letI := compHom A f
algebraMap S A s = (algebraMap R A) (f s) := rfl

theorem compHom_toRingHom_eq :
letI := compHom A f
(compHom A f).toRingHom = (algebraMap R A).comp f := rfl

theorem compHom_toRingHom_apply (s : S) :
letI := compHom A f
(compHom A f).toRingHom s = (algebraMap R A) (f s) := rfl
Copy link
Member

Choose a reason for hiding this comment

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

My inclination would be to drop these lemmas; I think since you're using abbrev above, lean will unfold them with dsimp only.

Comment on lines +836 to +844
letI := Algebra.compHom A₂ f
{
equiv with
toFun := equiv,
invFun := equiv.symm,
commutes' := by
simp only [Algebra.compHom_algebraMap_eq, RingHom.coe_comp, Function.comp_apply]
exact (fun x => (commute x).symm)
}
Copy link
Member

Choose a reason for hiding this comment

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

style nit: This should be indented two spaces not six.

Comment on lines +819 to +824
Define an equivalence of algebras in the following commutative diagram:
A₁ <------> A₂
/\ /\
| |
| |
S --------> R
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain the relation to Algebra.compHom here? Using non-canonical instances like compHom is quite unusual, so it's important to draw attention to it when it happens; especially since the docs wont show the letIs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-algebra Algebra (groups, rings, fields, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants