Zulip Chat Archive

Stream: Is there code for X?

Topic: IsROrC.ofReal = Complex.ofReal'


Ruben Van de Velde (Jan 12 2024 at 16:46):

Do we have any lemma to rewrite IsROrC.ofReal when applies to \C?

Jireh Loreaux (Jan 12 2024 at 18:49):

I think not, although I'm curious where it came up that you need it.

Jireh Loreaux (Jan 12 2024 at 18:51):

Putting it immediately after docs#Complex.instIsROrCComplex makes sense.

Yaël Dillies (Jan 12 2024 at 20:26):

I discussed this with @Eric Wieser and I argued that we should not even have to state this since all coercions between two types should syntactically be the same.

Yaël Dillies (Jan 12 2024 at 20:27):

Understand: Don't write the lemma! Fix mathlib so that the coercions are not even different in the first place.

Eric Rodriguez (Jan 12 2024 at 21:23):

Don't write the lemma! Spend hours and hours fixing stuff instead and encourage ugly workarounds because few people actually have the time!

Eric Wieser (Jan 13 2024 at 00:09):

In lean 3 the coercions were already the same

Jireh Loreaux (Jan 13 2024 at 04:54):

@Yaël Dillies, they're defeq, but in this case it's impossible for them to be exactly the same.

Jireh Loreaux (Jan 13 2024 at 04:55):

(unless you bring back coe)

Yaël Dillies (Jan 13 2024 at 09:03):

Why? You can just not define Complex.ofReal' and do everything in terms of IsROrC.ofReal.

Ruben Van de Velde (Jan 13 2024 at 10:02):

Hmm, does that work for the reals as well?

Eric Wieser (Jan 13 2024 at 10:03):

Or we eliminate both and use algebraMap everywhere

Yaël Dillies (Jan 13 2024 at 10:16):

Ruben Van de Velde said:

Hmm, does that work for the reals as well?

Technically, yes. It's the identity coercion. I wonder how it's not causing problems, actually. :thinking:


Last updated: May 02 2025 at 03:31 UTC