Zulip Chat Archive

Stream: Is there code for X?

Topic: Composition of algebras


Calvin Lee (Nov 11 2022 at 07:37):

I recently had to write

instance : algebra A C := ring_hom.to_algebra $ ring_hom.comp (algebra_map B C) (algebra_map A B)

in order to "compose" two algebras algebra A B and algebra B C

this really wasn't that much work, but I'm wondering if there's a cleaner way to do it
thanks!
relevant code is here https://github.com/jjgarzella/adjunction_formula/blob/k%C3%A4hler/src/kaehler.lean#L29

Andrew Yang (Nov 11 2022 at 07:40):

The mathlib-correct way to set it up is [algebra A B] [algebra B C] [algebra A C] [is_scalar_tower A B C].

Andrew Yang (Nov 11 2022 at 07:51):

So the correct way to set up the whole file should be

variables {A B Aₛ Bₛ : Type*} [comm_ring A] [comm_ring B] [comm_ring Aₛ] [comm_ring Bₛ]
variables [algebra A B] [algebra A Aₛ] [algebra A Bₛ] [algebra Aₛ Bₛ] [algebra B Bₛ]
variables [is_scalar_tower A B Bₛ] [is_scalar_tower A Aₛ Bₛ]
variables {S : submonoid B} [is_localization S Bₛ]
variables [is_localization (algebra.algebra_map_submonoid A S) Aₛ]

Andrew Yang (Nov 11 2022 at 07:54):

By the way, I'm not sure if the statement stated is correct. I think it should be ΩBT/AT\Omega_{B_T/A_T} with TAT \subseteq A instead of ΩBS/Af1(S)\Omega_{B_S/A_{f^{-1}(S)}} with SBS \subseteq B.

Andrew Yang (Nov 11 2022 at 07:56):

And I think the correct way to get that goal is to use #17198 and show that localizations are base changes.


Last updated: Dec 20 2023 at 11:08 UTC