Zulip Chat Archive

Stream: new members

Topic: Need help on Casting proof in Exponents


Colin Jones ⚛️ (Mar 05 2025 at 20:55):

Can someone help me prove this:

example (x : ℝ) : 1 / x ^ 10 = x ^ (-(10:ℝ)) := by
  ring_nf
  simp only [inv_pow]
  sorry

A proof I have has the numbers exactly like this as a part of it, but I am unable to translate the 10 from the naturals to the reals.

Aaron Liu (Mar 05 2025 at 21:00):

@loogle "rpow", OfNat.ofNat

loogle (Mar 05 2025 at 21:00):

:search: ExteriorAlgebra.exteriorPower, ExteriorAlgebra.exteriorPower.eq_1, and 767 more

Aaron Liu (Mar 05 2025 at 21:01):

@loogle "rpow", Int.cast

loogle (Mar 05 2025 at 21:01):

:search: Real.rpow_intCast, Real.rpow_intCast_mul, and 19 more

Yakov Pechersky (Mar 05 2025 at 21:02):

import Mathlib

example (x : ℝ) : 1 / x ^ 10 = x ^ (-(10:ℝ)) := by
  ring_nf
  have : (-10 : ℝ) = (-10 : ℤ) := by norm_num
  rw [this, Real.rpow_intCast, inv_pow, ← zpow_natCast, ← zpow_neg]
  norm_cast

Colin Jones ⚛️ (Mar 05 2025 at 21:02):

Thank you!

Yakov Pechersky (Mar 05 2025 at 21:04):

Seems like there are some simp lemmas that might be in a different direction for reals than for ints. Because norm_num wasn't being very helpful.

Colin Jones ⚛️ (Mar 05 2025 at 21:05):

When I tried using simp? and rw? I had difficulty in finding good lemmas because they just wanted to convert the -10 into a fraction.

Ilmārs Cīrulis (Mar 05 2025 at 23:48):

Am I missing something?

import Mathlib

example (x : ℝ) : 1 / x ^ 10 = x ^ (-(10:ℝ)) := by
  ring_nf
  simp only [inv_pow]
  norm_cast

Yakov Pechersky (Mar 06 2025 at 02:13):

Might as well then do this:

import Mathlib

example (x : ℝ) : 1 / x ^ 10 = x ^ (-(10:ℝ)) := by
  simp; norm_cast

Eric Wieser (Mar 06 2025 at 02:54):

These are probably worth having:

theorem Real.rpow_ofNat (x : ℝ) (n : ℕ) [n.AtLeastTwo] : x ^ (ofNat(n) : ℝ) = x ^ ofNat(n) :=
  Real.rpow_natCast _ _


theorem Real.rpow_neg_ofNat (x : ℝ) (n : ℕ) [n.AtLeastTwo] : x ^ (-ofNat(n) : ℝ) = x ^ (-ofNat(n) : ℤ) := by
  rw [← Real.rpow_intCast, Int.cast_neg, Int.cast_ofNat]

Eric Wieser (Mar 06 2025 at 02:55):

not sure of the best RHS for that second one


Last updated: Feb 28 2026 at 14:05 UTC