Zulip Chat Archive
Stream: mathlib4
Topic: norm_num on ENNReal
Floris van Doorn (Jul 31 2024 at 13:58):
It would be nice if norm_num
can deal with goals in ENNReal
, e.g. the following is currently quite painful
import Mathlib
open scoped ENNReal NNReal
example : ((2 : ℝ≥0∞) * 2 ^ (-4 : ℤ) + 2 ^ (- 2 : ℤ)) ≤ (2 : ℝ≥0∞) ^ (-1 : ℤ) := by
change ((2 : ℝ≥0) : ℝ≥0∞) * (2 : ℝ≥0) ^ (-4 : ℤ) + (2 : ℝ≥0) ^ (-2 : ℤ) ≤ (2 : ℝ≥0) ^ (-1 : ℤ)
repeat rw [← ENNReal.coe_zpow (show (2 : ℝ≥0) ≠ 0 by norm_num)]
rw_mod_cast [← NNReal.coe_le_coe]; norm_num
Yaël Dillies (Jul 31 2024 at 13:59):
This is due to norm_num
representing numerals as a Rat
. @Eric Wieser (and I, a bit) has thought about this issue
Eric Wieser (Jul 31 2024 at 14:14):
I have an open (incomplete) PR that adds support to norm_num for semifields like NNReal
, but even this wouldn't help on ENNReal
, which isn't a semifield
Floris van Doorn (Jul 31 2024 at 14:27):
The above proof uses norm_num
on NNReal
, presumably by immediately transferring it to Real
?
Eric Wieser (Jul 31 2024 at 14:59):
norm_num
works fine for the Semiring operations on NNReal (by transferring to Nat
), just not division (without my PR)
Last updated: May 02 2025 at 03:31 UTC