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: May 02 2025 at 03:31 UTC