Zulip Chat Archive

Stream: maths

Topic: alternatives to tactic.omega


Jakub Kądziołka (Mar 13 2022 at 00:32):

I have the following goal, which is easily solved by omega:

example (n k : ) (h1 : n  k + 2) (h2 : n  k + 2) (h3 : n  k + 1) : n  k := by omega

However, as the CI has made me aware, this tactic is being phased out (btw, where can I read more about the rationale for this?). What is the best way of proving this goal without omega?

Bhavik Mehta (Mar 13 2022 at 00:34):

You can use docs#lt_of_le_of_ne and docs#nat.lt_add_one_iff

Yaël Dillies (Mar 13 2022 at 00:36):

Actually, there's better

Yaël Dillies (Mar 13 2022 at 00:37):

The hands on approach is to do cases on h1

Yaël Dillies (Mar 13 2022 at 00:39):

The higher powered approach is to use docs#succ_order.le_succ_iff_lt_or_eq (yes, it's misnamed). Unfortunately, we don't seem to have the specialization to but you can use docs#nat.lt_succ_iff followed by docs#nat.lt_succ_iff_lt_or_eq

Scott Morrison (Mar 13 2022 at 00:40):

The rationale for phasing out omega is that is was written by someone who has not subsequently contributed, and the existing code base for omega is considered unmaintainable. (We would love to have a replacement, but it should be written for Lean4, not Lean3, so the problem wouldn't go away immediately in any case.)

Chris B (Mar 13 2022 at 01:02):

Jakub Kądziołka said:

where can I read more about the rationale for this?

Users figured out that omega was producing very large proofs which were ~30-100 times the size of other large declarations. For whatever revision of mathlib I was using to run the numbers pre-ban, the raw proof term for the largest item using omega took ~7.5 seconds to check, while average for other large declarations was ~120 milliseconds.

There's some background and stats in this thread:
https://leanprover.zulipchat.com/#narrow/stream/236449-Program-verification/topic/Arena.20allocation.20for.20ITPs/near/206635753

Chris B (Mar 13 2022 at 01:09):

You can see the dovetail into Scott's point at the end of the thread.

Chris B (Mar 13 2022 at 01:13):

Fwiw Coq is apparently ditching omega altogether : https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Multiplication.20on.20int.20is.20well-defined/near/202302824


Last updated: Dec 20 2023 at 11:08 UTC