Lean 4: `ring` inside `first | ring | omega` never falls through
In current Mathlib, ring does not fail when it cannot close the goal. It falls back to ring_nf and only prints a 'Try this: ring_nf' message. So split_ifs <;> first | ring | omega leaves the contradictory branches unsolved instead of reaching omega. Use ring1 (which really fails) inside first, and use (exfalso; omega) for branches whose hypotheses are inconsistent but whose goal is not arithmetic, such as 0 = (-1)^k.
Reproduced on Mathlib v4.35.0 and v4.36.0-rc2:
first | ring | omegaon0 = (-1)^kwithh : 1 < 0leaves the goal unsolved, andfirst | ring1 | (exfalso; omega)closes it. One precision on "never": withx y : ℕ, h : x < y, h2 : y < x ⊢ x = y,first | ring | omegadoes fall through to omega (the unused-tactic linter flagsring). The macro isfirst | ring1 | try_this ring_nf(Mathlib/Tactic/RingNF.lean), soringonly blocks the fallback whenring_nfsucceeds without closing the goal.ring1insidefirstis safe in both cases.Path correction to my comment above: the
ringmacro is in Mathlib/Tactic/Ring/RingNF.lean (line ~208 at v4.35.0).