Zulip Chat Archive

Stream: new members

Topic: omega and casting


Sorrachai Yingchareonthawornchai (May 23 2025 at 10:05):

Do you know why omega/ring cannot solve this?

theorem le_t_extend {t : } [inst : NeZero t] : 1  2 * (t : ) - 1 := by sorry

Kyle Miller (May 23 2025 at 10:24):

ring doesn't prove inequalities, and omega doesn't know about NeZero or the extended naturals.

import Mathlib

theorem le_t_extend {t : } [inst : NeZero t] : 1  2 * (t : ) - 1 := by
  have := inst.ne
  norm_cast
  omega

Vasilii Nesterov (May 25 2025 at 12:36):

While norm_cast is the right tactic here, we also have enat_to_nat, which was specifically created to allow using omega with extended naturals. For example:

import Mathlib

theorem le_t_extend {t : } [inst : NeZero t] : 1  2 * t - 1 := by
  have := inst.ne
  enat_to_nat
  omega

Last updated: Dec 20 2025 at 21:32 UTC