Zulip Chat Archive

Stream: new members

Topic: norm_cast needs extra help with inequalities


Rado Kirov (Sep 14 2025 at 06:02):

This was a bit surprising to me

import Mathlib

example {n: } (h: n > 1): (((n - 1): ): ) = (n: ) - (1:) := by norm_cast -- error
example {n: } (h: n  1): (((n - 1): ): ) = (n: ) - (1:) := by norm_cast -- ok

-- easy work around, but quite hard to make a lucky guess what would help norm_cast
example {n: } (h: n > 1): (((n - 1): ): ) = (n: ) - (1:) := by
  have := h.le
  norm_cast

Is this a bug or a reasonable feature request for norm_cast or WAE?

Kevin Buzzard (Sep 14 2025 at 11:22):

That looks like feature creep to me for norm_cast (its job is not to figure out side goals) but I agree that the current situation is not ideal. As a rule I avoid natural subtraction like the plague.

Kevin Buzzard (Sep 14 2025 at 11:22):

I guess it would not be unreasonable to have a norm_cast! which leaves n >= 1 as a new goal, and then linarith or omega could take it from there.

Robin Arnez (Sep 14 2025 at 14:50):

Or maybe allow providing a discharger?


Last updated: Dec 20 2025 at 21:32 UTC