Zulip Chat Archive
Stream: Is there code for X?
Topic: DistribSMul instance for NonAssocNonUnitalRing
Scott Carnahan (Feb 01 2024 at 02:33):
Does something like:
instance instNameHere [NonUnitalNonAssocSemiring R] : DistribSMul R R where smul_add := mul_add
cause any problems?
If it's okay, is there a good place to put it? #find_home
only suggested the file I was working on.
Damiano Testa (Feb 01 2024 at 06:01):
You could try #find_home!
for a possibly better suggestion.
Damiano Testa (Feb 01 2024 at 06:02):
(I am not sure about the other questions that you asked.)
Eric Wieser (Feb 01 2024 at 07:45):
That instance looks fine to me
Eric Rodriguez (Feb 01 2024 at 09:38):
Can there ever be any problems with Prop instances? And yes, find_home currently doesn't work with things that create auxiliary declarations in the background
Yaël Dillies (Feb 01 2024 at 11:11):
This is not a Prop-valued instance, though
Eric Rodriguez (Feb 01 2024 at 11:25):
Ah, I forget it's not a mixin
Damiano Testa (Feb 01 2024 at 14:09):
Are you sure about find_home
? I thought that I fixed that with the #find_home!
syntax...
Eric Rodriguez (Feb 01 2024 at 14:17):
I wasn't aware of find_home!
Scott Carnahan (Feb 01 2024 at 14:18):
#find_home!
worked!
Scott Carnahan (Feb 01 2024 at 14:19):
Answer: Mathlib.Algebra.SMulWithZero
Damiano Testa (Feb 01 2024 at 14:22):
Great! What find_home!
should do is to compute the same sup of the imports, but removing the current file from the set of imports before the sup step. The sup could still be the current file, but in that case it should be meaningful!
Scott Carnahan (Feb 01 2024 at 14:27):
It's a bit surprising, since neither NonUnitalNonAssocSemiring
nor DistribSMul
appear in the file. I guess the Mathlib.Algebra.Ring.Opposite
import brings in the ring theory.
Damiano Testa (Feb 01 2024 at 14:29):
It is also possible that there are other bugs in find_home
...
Scott Carnahan (Feb 01 2024 at 16:07):
Thanks for your input!
#10162
Damiano Testa (Feb 01 2024 at 16:15):
I took the liberty of adding an extra white line to separate the text and the ---
from the PR description, for what I think is the intended formatting!
Scott Carnahan (Feb 01 2024 at 16:17):
Thank you! I was wondering how to get rid of the boldface type.
Damiano Testa (Feb 01 2024 at 16:21):
I think that it is a markdown "feature": text around ---
is subject to be interpreted as a header.
Last updated: May 02 2025 at 03:31 UTC