Zulip Chat Archive
Stream: maths
Topic: complex.has_scalar
Yury G. Kudryashov (Dec 08 2021 at 05:27):
I've just noticed that any type that acts on automatically acts on , thanks to docs#complex.has_scalar. Do we actually use it for ?
Yury G. Kudryashov (Dec 08 2021 at 06:24):
One day we might want to add the action of (a type synonym for) multiplicative (zmod 2)
or equiv.perm (fin 2)
on is_R_or_C k
by conj
(or should I say star
?). Then we'll have a diamond.
Yaël Dillies (Dec 08 2021 at 07:02):
Does that not create a problem with nsmul
already?
Yury G. Kudryashov (Dec 08 2021 at 07:19):
Probably, it creates a non-defeq diamond for nsmul
. The example above creates a diamond with no propositional equality.
Sebastien Gouezel (Dec 08 2021 at 07:58):
Isn't it defeq by design for nsmul
?
Eric Wieser (Dec 08 2021 at 08:36):
It's useful for the action by nnreal I imagine
Yury G. Kudryashov (Dec 08 2021 at 09:07):
Sebastien Gouezel said:
Isn't it defeq by design for
nsmul
?
No, it is defeq by design for has_scalar ℝ ℂ
. For has_scalar ℕ ℂ
, one instance results in 1 • z = z + 0
while the other results in (1 : ℝ) • z
.
Yury G. Kudryashov (Dec 08 2021 at 09:08):
Eric Wieser said:
It's useful for the action by nnreal I imagine
Eric Wieser (Dec 08 2021 at 09:10):
Are you sure your claim about nsmul is true? I assume src#complex.comm_ring is where the implementation is
Eric Wieser (Dec 08 2021 at 09:12):
Indeed the implementation is
nsmul := λ n z, ⟨n • z.re - 0 * z.im, n • z.im + 0 * z.re⟩,
Isn't that the same as src#complex.has_scalar?
Yury G. Kudryashov (Dec 08 2021 at 09:12):
You're right.
Eric Wieser (Dec 08 2021 at 09:14):
I think you end up with a diamond in general if you true to make a star action as you suggest though
Eric Wieser (Dec 08 2021 at 09:15):
Consider the action on complex matrices, where one path to the diamond transposes but the other doesn't
Yury G. Kudryashov (Dec 08 2021 at 09:15):
@Sebastien Gouezel Do we ever need this transitive instance?
Eric Wieser (Dec 08 2021 at 09:16):
One way to solve this might be a allow_transitive_smul
typeclass, which has to be present to enable transitivity; it would be skipped for the conj action you mention
Eric Wieser (Dec 08 2021 at 09:16):
I think I'm actually the one responsible for that transitive instance
Yury G. Kudryashov (Dec 08 2021 at 09:19):
I think that before discussing workarounds we should figure out whether we need it.
Eric Wieser (Dec 08 2021 at 09:23):
My point with my comment above is that the instance you're proposing causes problems elsewhere too, not just on the complex numbers. So I'd argue that complex.has_scalar
is not really the problem, the problem is the new instance you propose.
Yury G. Kudryashov (Dec 08 2021 at 09:25):
Could you please elaborate? What action on matrices are you talking about?
Eric Wieser (Dec 08 2021 at 09:26):
The same one by multiplicative (zmod 2)
as you mention, presumably where of_add 1 • M
is conj M
/ star M
and of_add 0 • M = M
Eric Wieser (Dec 08 2021 at 09:27):
(assuming I read your message correctly)
Eric Wieser (Dec 08 2021 at 09:45):
Which isn't to say I think your instance is a bad idea in isolation, but that complex.has_scalar
forming a diamond with it is a symptom of a bigger problem with actions as a whole.
Sebastien Gouezel (Dec 08 2021 at 10:14):
Yury G. Kudryashov said:
Sebastien Gouezel Do we ever need this transitive instance?
Personally I never needed it, no, and I agree I don't really see in which situation it would be useful.
Eric Wieser (Dec 08 2021 at 10:19):
I think the case I was thinking of was cases when R
is nothing concrete, and instead of requiring separate actions on R and C that agree ([has_scalar R ℝ] [has_scalar R ℂ] [is_scalar_tower R ℝ ℂ]
), you can just assume [has_scalar R ℝ]
and get the other action for free.
Eric Wieser (Dec 08 2021 at 10:20):
In the same way that instead of writing [has_scalar R ℝ] [has_scalar R (ι → ℝ)] [is_scalar_tower R ℝ (ι → ℝ)]
we can currently write [has_scalar R ℝ]
and get the pi
action for free.
Sebastien Gouezel (Dec 08 2021 at 10:32):
But is there a situation where it is useful to state or prove a genuine theorem? There are many actions that we could declare, but that we probably shouldn't declare globally if they are not useful enough. I am wondering if we are in this situation, or if there is a convincing example that it is a good idea to have it.
Yury G. Kudryashov (Dec 08 2021 at 10:52):
And we possibly have a diamond because of docs#rat.algebra_rat
Eric Wieser (Dec 08 2021 at 10:55):
That diamond is all over the place though, so I don't think is really relevant to this discussion
Eric Wieser (Dec 08 2021 at 10:56):
Sebastien Gouezel said:
But is there a situation where it is useful to state or prove a genuine theorem? There are many actions that we could declare, but that we probably shouldn't declare globally if they are not useful enough. I am wondering if we are in this situation, or if there is a convincing example that it is a good idea to have it.
I'm not really opposed to changing it to a def
that's locally an instance for the few lemmas about it today; that way if we need it back again, it's easy to re-enable without rebuilding everything
Yury G. Kudryashov (Dec 08 2021 at 11:27):
Eric Wieser said:
That diamond is all over the place though, so I don't think is really relevant to this discussion
Is it? Do we have lots of instances that result in a different -action?
Eric Wieser (Dec 08 2021 at 11:45):
Hmm, maybe you're right. I guess there aren't many fields that are constructed directly out of smaller fields
Eric Wieser (Dec 08 2021 at 11:46):
Maybe the action on subfields also has such a diamond? I haven't checked.
Last updated: Dec 20 2023 at 11:08 UTC