Zulip Chat Archive

Stream: Is there code for X?

Topic: power of difference


Jakob von Raumer (Feb 29 2024 at 12:04):

Do we have this inequality?

example {a b : } (n : ) (hn : 0 < n) (hb : 0 < b) (ha : b < a) : a ^ n - b ^ n  n * a ^ (n - 1) * (a - b) := sorry

Ruben Van de Velde (Feb 29 2024 at 12:06):

It's definitely false for n = 0

Jakob von Raumer (Feb 29 2024 at 12:07):

Ah right, 0 < n is missing, but that should be it

Jakob von Raumer (Feb 29 2024 at 12:08):

Ah no, I made another typo above :man_facepalming:

Geoffrey Irving (Feb 29 2024 at 14:19):

Why is it false for n = 0?

Damiano Testa (Feb 29 2024 at 14:22):

Also, when a ≤ b, the LHS vanishes, so the inequality should still hold. I thought a b : ℕ!

Jakob von Raumer (Feb 29 2024 at 14:23):

I fixed the above snippet after @Ruben Van de Velde 's comment :sweat_smile:

Jakob von Raumer (Feb 29 2024 at 16:50):

Does anyone have a slick way to prove it? I found it here but the proofs don't seem minimal to me

Kevin Buzzard (Feb 29 2024 at 19:42):

That's the maths proof I was thinking of; you could do this very nicely with a calc block in Lean I think.

Geoffrey Irving (Feb 29 2024 at 20:46):

Here's the n = 0 case, by the way. Unless I've misread?

import Mathlib

example {a b : } : a^0 - b^0  0 * a ^ (0 - 1) * (a - b) := by
  simp

Ruben Van de Velde (Feb 29 2024 at 20:49):

It was (a - b) ^ 0 when I commented

Kevin Buzzard (Feb 29 2024 at 20:59):

You can see edit history of any post on a desktop app by clicking on "edited"

Jakob von Raumer (Mar 01 2024 at 09:49):

Kevin Buzzard said:

That's the maths proof I was thinking of; you could do this very nicely with a calc block in Lean I think.

Will try and PR if successful

Riccardo Brasca (Mar 01 2024 at 10:00):

Note that the proof using the intermediate value theorem has the advantage to work for (positive) real exponent.

Kevin Buzzard (Mar 01 2024 at 10:18):

Why do we want this inequality? And if we do want it, should we consider replacing n by m + 1 and removing the n>0 hypothesis and the horrible n - 1, which we can easily avoid in this case?

Jakob von Raumer (Mar 01 2024 at 10:34):

Agree to removing n > 0. Well I need it for some error estimates in fixed point arithmetics, and I've certainly seen it before in numerical maths.

Kevin Buzzard (Mar 01 2024 at 11:31):

If you have an application, then that's a fine response to "why do we want this".

Jakob von Raumer (Mar 01 2024 at 12:14):

The geometric series proof generalises nicely to StrictOrderedCommRing:

theorem pow_sub_pow_le {R : Type u} [StrictOrderedCommRing R]
    {a b : R} (n : ) (hb : 0  b) (ha : b  a) :
    a ^ n - b ^ n  n * a ^ (n - 1) * (a - b) := by
  rw [ geom_sum₂_mul]
  apply mul_le_mul_of_nonneg_right _ (sub_nonneg.mpr ha)
  rw [ @geom_sum₂_self]
  apply sum_le_sum
  intros
  apply mul_le_mul_of_nonneg_left _ (pow_nonneg (le_trans hb ha) _)
  apply pow_le_pow_of_le_left hb ha

Jakob von Raumer (Mar 01 2024 at 12:15):

As for the n - 1, should I bring one a it to the other side for mathlib even if I need it in the form above?


Last updated: May 02 2025 at 03:31 UTC