Zulip Chat Archive

Stream: new members

Topic: omega failed in simple case


Zhang Qinchuan (Nov 05 2024 at 04:47):

omega failed in the following examle without the rw [mul_comm]. Is this expected/ by design?

import Mathlib

example (a b c : ) (ha : 1  a) (ha_sub_one : a - 1 = b * c) : c * b + 1 = a := by
  --rw [mul_comm]
  omega -- failed!

Bjørn Kjos-Hanssen (Nov 05 2024 at 05:46):

It doesn't seem to like "nonlinear" multiplication in general.

import Mathlib

example (b : ) : b * 57 = 57 * b  := by
  omega -- works

example (b c : ) : b * c = c * b  := by
  omega -- failed!

Johan Commelin (Nov 05 2024 at 06:35):

Yup, that's by design. Otherwise you take on yourself the burden of writing a tactic that can decide a^3 + b^3 = c^3. And such problems are pretty hard.

Kyle Miller (Nov 05 2024 at 16:58):

In this case, replacing the rw line with ring_nf at * works. Or you can have have := mul_comm b c to give omega an additional fact.


Last updated: May 02 2025 at 03:31 UTC