Zulip Chat Archive
Stream: FLT
Topic: diamond in adele set-up
Kevin Buzzard (Aug 04 2025 at 08:50):
When reviewing FLT#682 I ran into a diamond in FLT.
Mathematically the issue is this. If is a number field then there's a ring called the adeles of , which is a product of two other rings called the finite adeles of and the infinite adeles of . All of these constructions are functorial; if is another number field and is a -algebra then the adeles of are naturally an algebra for the adeles of etc.
Right now in FLT this fact (if is a -algebra then is an -algebra) is an instance, constructed in FLT.NumberField.AdeleRing using docs#RingHom.toAlgebra and the ring homomorphism constructed using docs#RingHom.prod and docs#RingHom.fst and docs#RingHom.snd (recall that the adeles are a product of the finite adeles and the infinite adeles).
So now when we have the following diamond:
import FLT.NumberField.AdeleRing
open NumberField AdeleRing
variable (K L : Type) [Field K] [Field L] [NumberField K] [NumberField L] [Algebra K L]
#synth Algebra (AdeleRing (𝓞 K) K) (AdeleRing (𝓞 K) K) -- Algebra.id (AdeleRing (𝓞 K) K)
#synth Algebra (AdeleRing (𝓞 K) K) (AdeleRing (𝓞 L) L) -- instAlgebraRingOfIntegers_fLT_1 K L
example : Algebra.id (AdeleRing (𝓞 K) K) = instAlgebraRingOfIntegers_fLT_1 K K := by
ext
simp
-- still not rfl
sorry
I can see several ways to proceed, e.g. remove an instance and then keep adding it locally when required thus accruing technical debt, muck about with instance priorities and get some technical debt that way, try hard to get rid of the diamond by removing the RingHom.fst and RingHom.prod dance etc etc. Does anyone have any advice?
Kenny Lau (Aug 04 2025 at 09:04):
the map AK -> AL is noncomputable right
Yaël Dillies (Aug 04 2025 at 09:20):
I don't understand, RingHom.prod, .fst and .snd commute definitionally. Are you sure nothing else is involved in the diamond?
Yaël Dillies (Aug 04 2025 at 09:21):
Can you show us the definition of instAlgebraRingOfIntegers_fLT_1?
Kenny Lau (Aug 04 2025 at 09:24):
@Yaël Dillies well the algebra contains a smul too, apart from that issue
Kenny Lau (Aug 04 2025 at 09:24):
and with my suspicion that AK_fin -> AL_fin is noncomputable, this makes the problem even harder
Kenny Lau (Aug 04 2025 at 09:25):
given a prime p of K, and x : K_p, you need to collect the primes p' above p, and then send completion to completion
Yaël Dillies (Aug 04 2025 at 09:26):
How is the smul defined here? If it's defined correctly, then everything should commute still
Yaël Dillies (Aug 04 2025 at 09:27):
Oh, are you claiming the diamond comes from under the "taking products" part?
Kenny Lau (Aug 04 2025 at 09:27):
@Yaël Dillies Kevin's post above saays that the Algebra instance is constructed using RingHom.toAlgebra, i.e. there was no smul defined
Kenny Lau (Aug 04 2025 at 09:28):
Yaël Dillies said:
Oh, are you claiming the diamond comes from under the "taking products" part?
i'm claiming both
Matthew Jasper (Aug 04 2025 at 12:12):
The reason these aren't def-eq is that the ring hom is not def-eq to the identity for , because UniformSpace.Completion.map blocks def-eq.
Matthew Jasper (Aug 04 2025 at 12:13):
I haven't checked the infinite adele side, so there might be a problem there as well
Yakov Pechersky (Aug 04 2025 at 12:28):
This is going to be very difficult to resolve similarly to the reason that docs#FractionRing.liftAlgebra can't be global
Kevin Buzzard (Aug 04 2025 at 12:31):
How about resolving it by ensuring that the priority of the algebra instance is strictly less than that of Algebra.id?
Yaël Dillies (Aug 04 2025 at 12:45):
Sadly tweaking priorities is a hack and it will eventually blow to your face
Kevin Buzzard (Aug 04 2025 at 12:47):
yeah that was my initial instinct but how can it possibly go wrong?
Yaël Dillies (Aug 04 2025 at 12:49):
Typical place where it could blow up: Assume you have and prove something about ; then you can't specialise to prove the analogous result for
Kenny Lau (Aug 04 2025 at 12:51):
isn't that what IsScalarTower is meant to solve
Kenny Lau (Aug 04 2025 at 12:51):
actually can IsScalarTower solve this one?
Kenny Lau (Aug 04 2025 at 12:52):
instead of requiring the two instances of Algebra A_K A_K to be equal, can we have a predicate saying that two algebras are equal?
Kenny Lau (Aug 04 2025 at 12:52):
i mean this feels like something like SMulCommClass
Last updated: Dec 20 2025 at 21:32 UTC