Zulip Chat Archive
Stream: Is there code for X?
Topic: Int.div_pow?
Edison Xie (Oct 24 2025 at 22:38):
import Mathlib
example (a b : ℤ) (n : ℕ) (hxy : a ∣ b) : (a / b) ^ n = a ^ n / b ^ n := by
sorry
Do we not have this already? I've only found Nat.div_pow :-(
Kenny Lau (Oct 24 2025 at 22:45):
your dvd is the wrong way
Kenny Lau (Oct 24 2025 at 22:46):
loogle didn't give anything
Bhavik Mehta (Oct 24 2025 at 22:57):
example (a b : ℤ) (n : ℕ) (hxy : b ∣ a) : (a / b) ^ n = a ^ n / b ^ n := by
obtain ⟨c, rfl⟩ := hxy
obtain rfl | hb := eq_or_ne b 0
· obtain rfl | hn := eq_or_ne n 0 <;> simp [*]
· simp [hb, mul_pow]
it does look like we don't have this...
Eric Wieser (Oct 24 2025 at 23:01):
A related result:
theorem Int.ediv_mul_ediv_comm {a b c d : ℤ} (hba : b ∣ a) (hdc : d ∣ c) :
(a / b) * (c / d) = (a * c) / (b * d) := by
obtain ⟨a, rfl⟩ := hba
obtain ⟨c, rfl⟩ := hdc
rw [mul_mul_mul_comm]
obtain rfl | hb := eq_or_ne b 0; · simp
obtain rfl | hd := eq_or_ne d 0; · simp
simp [hb, hd]
Edison Xie (Oct 24 2025 at 23:49):
Kenny Lau said:
your dvd is the wrong way
oops sorry
Edison Xie (Oct 24 2025 at 23:49):
Bhavik Mehta said:
example (a b : ℤ) (n : ℕ) (hxy : b ∣ a) : (a / b) ^ n = a ^ n / b ^ n := by obtain ⟨c, rfl⟩ := hxy obtain rfl | hb := eq_or_ne b 0 · obtain rfl | hn := eq_or_ne n 0 <;> simp [*] · simp [hb, mul_pow]it does look like we don't have this...
Do we want it? Looks useful to have :-)
Alex Meiburg (Oct 25 2025 at 00:24):
Is there some kind LawfulDiv stating that when b | a, then (a / b) * b= a? Then we could state this uniformly for Nat/Int/Field (incl. Lean.Grind.Field) all in one go, as well as some version for EuclideanDomain, and maybe also Fin... also Ordinal
Alex Meiburg (Oct 25 2025 at 00:29):
Actually maybe docs#EuclideanDomain is almost exactly what I want, except that it doesn't support semirings (nat). It has EuclideanDomain.instDiv
Alex Meiburg (Oct 25 2025 at 00:31):
EuclideanDomain gets you Polynomial for free, too
Aaron Liu (Oct 25 2025 at 01:22):
There's docs#FloorDiv and docs#CeilDiv for the left and right adjoints of multiplication by a constant
Edison Xie (Nov 05 2025 at 21:45):
Bhavik Mehta said:
example (a b : ℤ) (n : ℕ) (hxy : b ∣ a) : (a / b) ^ n = a ^ n / b ^ n := by obtain ⟨c, rfl⟩ := hxy obtain rfl | hb := eq_or_ne b 0 · obtain rfl | hn := eq_or_ne n 0 <;> simp [*] · simp [hb, mul_pow]it does look like we don't have this...
Last updated: Dec 20 2025 at 21:32 UTC