Zulip Chat Archive

Stream: Is there code for X?

Topic: mul_left_cancel on reals


Colin Jones ⚛️ (Sep 18 2023 at 01:44):

Is there a lemma like mul_left_cancel but for real numbers? When I use this lemma for real numbers, it doesn't seem to work for some reason and keeps giving an error : "failed to synthesize instance IsLeftCancelMul ℝ". Could someone give me a fix or an alternative?

Below is my code:
Why_wont_mul_left_cancel_work.lean

Scott Morrison (Sep 18 2023 at 01:49):

Please post code as code blocks, with complete imports. See #mwe!

Damiano Testa (Sep 18 2023 at 01:50):

Does docs#mul_left_cancel₀ help?

Riccardo Brasca (Sep 18 2023 at 06:19):

Damiano's answer is the correct one, docs#mul_left_cancel doesn't work for real numbers because it is false! 0*0=0*1. In general we add a little to the name of a lemma for the version that says "if a ≠ 0 then ...".

Colin Jones ⚛️ (Sep 18 2023 at 17:18):

Thanks Riccardo! My code works perfectly now


Last updated: Dec 20 2023 at 11:08 UTC