Zulip Chat Archive

Stream: Is there code for X?

Topic: computable operations for rational numbers


Adam Topaz (Mar 01 2022 at 18:32):

Is there any way to make the following work?

example : (0 : ) + 1 = 1 := dec_trivial

Adam Topaz (Mar 01 2022 at 18:33):

I would like to do some (formally verified) linear algebra over the rationals, but I don't want to work too hard...

Gabriel Ebner (Mar 01 2022 at 18:36):

(deleted)

Yakov Pechersky (Mar 01 2022 at 18:40):

Does by norm_num work?

Adam Topaz (Mar 01 2022 at 18:41):

I guess so, but let me try a more realistic example...

Adam Topaz (Mar 01 2022 at 18:41):

Ah nice,

example : ![(0 : ),1,2] + ![1,2,3] = ![1,3,5] := by norm_num

works just fine!

Adam Topaz (Mar 01 2022 at 18:42):

But it's not perfect...

I was dumb.... this works:

example : (1/2 : )  ![(0 : ),1,0] = ![0,1/2,0] := by norm_num

Eric Rodriguez (Mar 01 2022 at 18:44):

yeah, you were using nat-div


Last updated: Dec 20 2023 at 11:08 UTC