Zulip Chat Archive

Stream: mathlib4

Topic: Algebra.Field.Defs mathlib4#668


Ruben Van de Velde (Nov 30 2022 at 20:26):

Algebra.Field.Defs starts with

/-- The default definition of the coercion `(↑(a : ℚ) : K)` for a division ring `K`
is defined as `(a / b : K) = (a : K) * (b : K)⁻¹`.
Use `coe` instead of `rat.cast_rec` for better definitional behaviour.
-/
def Rat.castRec [HasLiftT  K] [HasLiftT  K] [Mul K] [Inv K] :   K
  | a, b, _, _ => a * (b)⁻¹

and I don't have a clue what the HasLiftT bits should be now. Is that something that needs to be imported from lean3port or do we need something else entirely?

Scott Morrison (Nov 30 2022 at 20:42):

No, this is waiting on the lift tactic, which Yury has been porting in https://github.com/leanprover-community/mathlib4/pull/723

Scott Morrison (Nov 30 2022 at 20:42):

He says that the code is working there, but I don't know what he's been testing it on as there are no tests in the PR.

Eric Wieser (Nov 30 2022 at 20:46):

docs#has_lift_t is nothing to do with tactic#lift, is it?

Eric Wieser (Nov 30 2022 at 20:46):

Are you thinking of docs#can_lift?

Scott Morrison (Nov 30 2022 at 20:46):

Oh, my mistake.

Scott Morrison (Nov 30 2022 at 20:51):

Can we just replace these with CoeT (or Coe)?

Scott Morrison (Nov 30 2022 at 20:58):

CoeTail seems to be right answer here.

Scott Morrison (Nov 30 2022 at 21:03):

Okay, I've almost finished with porting this file.

Ruben Van de Velde (Nov 30 2022 at 22:40):

Thanks! Looks like it wasn't too bad once you got past the coercions. One question though: shouldn't ratCastMk be ratCast_mk?

Scott Morrison (Nov 30 2022 at 22:47):

Ah, yes, you're right.

Scott Morrison (Nov 30 2022 at 23:55):

Fixed in mathlib4#808.


Last updated: Dec 20 2023 at 11:08 UTC