Zulip Chat Archive

Stream: mathlib4

Topic: OfNat for `Units`?


Yury G. Kudryashov (Jun 28 2023 at 16:31):

I want to add an instance that will allow us to write (n : Rˣ) assuming [Invertible (n : R)]. Are there any objections?

Jon Eugster (Jul 04 2023 at 08:53):

One related construction would be the one here: docs#EqualCharZero.pnatCast

I had to write a bunch of auxilary stuff to be able to write a function x ↦ (x.num : R) /ₚ ↑x.pnatDen : ℚ → R, so maybe your new instance would help simplify that, so that one could simply write x ↦ (x.num : R) /ₚ ↑x.den : ℚ → R after proving that in the setting of this file we always have such an Invertible instance :thinking:

Yury G. Kudryashov (Jul 04 2023 at 14:28):

I was thinking about literals, not cast. Cast has to be a globally defined function.


Last updated: Dec 20 2023 at 11:08 UTC