Skip to content

Commit aa881f5

Browse files
committed
feat(Algebra/Order/Ring/WithTop): add generalised and specialised power of top (#14019)
- [x] Add generalised version of `top_pow` in `Algebra/Order/Ring/WithTop` - [x] Add specialised version of `top_pow` in `Data/ENat/Basic.lean` - [x] Add specialised version of `top_pow` in `Data/ENNReal/Operations.lean` Co-authored by @D-Thomine.
1 parent 454f409 commit aa881f5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Mathlib/Algebra/Order/Ring/WithTop.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ instance instMonoidWithZero : MonoidWithZero (WithTop α) where
167167

168168
@[simp, norm_cast] lemma coe_pow (a : α) (n : ℕ) : (↑(a ^ n) : WithTop α) = a ^ n := rfl
169169

170+
theorem top_pow {n : ℕ} (n_pos : 0 < n) : (⊤ : WithTop α) ^ n = ⊤ :=
171+
Nat.le_induction (pow_one _) (fun m _ hm => by rw [pow_succ, hm, top_mul_top]) _
172+
(Nat.succ_le_of_lt n_pos)
173+
170174
end MonoidWithZero
171175

172176
instance instCommMonoidWithZero [CommMonoidWithZero α] [NoZeroDivisors α] [Nontrivial α] :

Mathlib/Data/ENNReal/Operations.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ theorem top_mul_top : ∞ * ∞ = ∞ := WithTop.top_mul_top
219219
#align ennreal.top_mul_top ENNReal.top_mul_top
220220

221221
-- Porting note (#11215): TODO: assume `n ≠ 0` instead of `0 < n`
222-
-- Porting note (#11215): TODO: generalize to `WithTop`
223-
theorem top_pow {n : ℕ} (h : 0 < n) : ∞ ^ n = ∞ :=
224-
Nat.le_induction (pow_one _) (fun m _ hm => by rw [pow_succ, hm, top_mul_top]) _
225-
(Nat.succ_le_of_lt h)
222+
theorem top_pow {n : ℕ} (n_pos : 0 < n) : (∞ : ℝ≥0∞) ^ n = ∞ := WithTop.top_pow n_pos
226223
#align ennreal.top_pow ENNReal.top_pow
227224

228225
theorem mul_eq_top : a * b = ∞ ↔ a ≠ 0 ∧ b = ∞ ∨ a = ∞ ∧ b ≠ 0 :=

Mathlib/Data/ENat/Basic.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ theorem coe_sub (m n : ℕ) : ↑(m - n) = (m - n : ℕ∞) :=
8989
@[simp] theorem mul_top (hm : m ≠ 0) : m * ⊤ = ⊤ := WithTop.mul_top hm
9090
@[simp] theorem top_mul (hm : m ≠ 0) : ⊤ * m = ⊤ := WithTop.top_mul hm
9191

92+
theorem top_pow {n : ℕ} (n_pos : 0 < n) : (⊤ : ℕ∞) ^ n = ⊤ := WithTop.top_pow n_pos
93+
9294
instance canLift : CanLift ℕ∞ ℕ (↑) (· ≠ ⊤) := WithTop.canLift
9395
#align enat.can_lift ENat.canLift
9496

0 commit comments

Comments
 (0)