Zulip Chat Archive
Stream: mathlib4
Topic: Ordinal exponentiation problems
Violeta Hernández (Feb 03 2026 at 04:57):
Working with nimbers I came across a really annoying simp failure:
import Mathlib.SetTheory.Ordinal.Exponential
example : (2 : Ordinal) ^ (2 ^ n : ℕ) = 2 ^ (2 : Ordinal) ^ (n : ℕ) := by
-- simp -- fails
-- norm_cast -- fails too
simp [← Ordinal.opow_natCast]
There's clearly a missing lemma or tag, but I don't really know which one it'd be. Any ideas?
Dexin Zhang (Feb 03 2026 at 07:12):
It seems to be Nat.cast_pow?
Dexin Zhang (Feb 03 2026 at 07:14):
This works
@[norm_cast]
lemma cast_pow (m : ℕ) : ∀ n : ℕ, ↑(m ^ n) = (m ^ n : Ordinal) := by
simp [Ordinal.opow_natCast]
example : (2 : Ordinal) ^ (2 ^ n : ℕ) = 2 ^ (2 : Ordinal) ^ (n : ℕ) := by
norm_cast
Yury G. Kudryashov (Feb 03 2026 at 08:57):
If you want a simp lemma to work with numeral literals, you need to add ofNat(n) versions.
Violeta Hernández (Feb 03 2026 at 12:45):
Oh, I think I see the issue. docs#Ordinal.natCast_opow, besides being named wrong, doesn't have a simp-normal RHS.
Violeta Hernández (Feb 03 2026 at 12:49):
Yury G. Kudryashov said:
If you want a simp lemma to work with numeral literals, you need to add
ofNat(n)versions.
There are two natural numbers here, does that mean I need two ofNat versions, one for each?
Violeta Hernández (Feb 03 2026 at 14:09):
This should get fixed by #34662
Last updated: Feb 28 2026 at 14:05 UTC