-
Notifications
You must be signed in to change notification settings - Fork 331
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
base: master
Are you sure you want to change the base?
Changes from all commits
f26d639
9803b15
a57db8b
4c2add7
0676cc5
1885ef6
57db866
91ca521
0835abb
c5c8fe5
b7f9f13
988c3ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -175,6 +175,19 @@ def RingHom.toAlgebra' {R S} [CommSemiring R] [Semiring S] (i : R →+* S) | |||||
smul_def' _ _ := rfl | ||||||
toRingHom := i | ||||||
|
||||||
-- just simple lemmas for a declaration that is itself primed, no need for docstrings | ||||||
set_option linter.docPrime false in | ||||||
theorem RingHom.smul_toAlgebra' {R S} [CommSemiring R] [Semiring S] (i : R →+* S) | ||||||
(h : ∀ c x, i c * x = x * i c) (r: R) (s: S) : | ||||||
let _ := RingHom.toAlgebra' i h | ||||||
r • s = i r * s := rfl | ||||||
|
||||||
set_option linter.docPrime false in | ||||||
theorem RingHom.algebraMap_toAlgebra' {R S} [CommSemiring R] [Semiring S] (i : R →+* S) | ||||||
(h : ∀ c x, i c * x = x * i c) : | ||||||
@algebraMap R S _ _ (i.toAlgebra' h) = i := | ||||||
rfl | ||||||
|
||||||
/-- Creating an algebra from a morphism to a commutative semiring. -/ | ||||||
def RingHom.toAlgebra {R S} [CommSemiring R] [CommSemiring S] (i : R →+* S) : Algebra R S := | ||||||
i.toAlgebra' fun _ => mul_comm _ | ||||||
|
@@ -311,6 +324,45 @@ section | |||||
|
||||||
end | ||||||
|
||||||
section compHom | ||||||
variable {R : Type u} {S : Type v} (A : Type w) | ||||||
[CommSemiring R] [Semiring A] [Algebra R A] [CommSemiring S] | ||||||
(f : S →+* R) | ||||||
|
||||||
/-- | ||||||
Compose a Algebra with a RingHom, with action f s • m. | ||||||
-/ | ||||||
abbrev compHom: Algebra S A where | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style nit:
Suggested change
Generally, there should always be spaces around colons; can you go through the PR and fix these throughout? |
||||||
smul s a := f s • a | ||||||
toRingHom := (algebraMap R A).comp f | ||||||
commutes' _ _ := Algebra.commutes _ _ | ||||||
smul_def' _ _ := Algebra.smul_def _ _ | ||||||
|
||||||
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 | ||||||
Comment on lines
+341
to
+362
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
|
||||||
end compHom | ||||||
|
||||||
variable (R A) | ||||||
|
||||||
/-- The canonical ring homomorphism `algebraMap R A : R →+* A` for any `R`-algebra `A`, | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -812,3 +812,36 @@ def toAlgAut : G →* A ≃ₐ[R] A where | |
end | ||
|
||
end MulSemiringAction | ||
|
||
namespace AlgEquiv | ||
section CompHom | ||
/-- | ||
Define an equivalence of algebras in the following commutative diagram: | ||
A₁ <------> A₂ | ||
/\ /\ | ||
| | | ||
| | | ||
S --------> R | ||
Comment on lines
+819
to
+824
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain the relation to |
||
-/ | ||
@[simps apply symm_apply toEquiv] | ||
def ofRingEquiv_compHom | ||
{A₁: Type u} {A₂: Type v} {S: Type w} {R: Type u₁} | ||
[Semiring A₁] [Semiring A₂] | ||
[CommSemiring R] [CommSemiring S] | ||
[Algebra R A₂] [Algebra S A₁] | ||
(f: S →+* R) {equiv : A₁ ≃+* A₂} | ||
(commute: ∀ x, (algebraMap R A₂) (f x) = equiv (algebraMap S A₁ x)) : | ||
letI := Algebra.compHom A₂ f | ||
A₁ ≃ₐ[S] A₂ := | ||
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) | ||
} | ||
Comment on lines
+836
to
+844
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style nit: This should be indented two spaces not six. |
||
|
||
end CompHom | ||
end AlgEquiv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.