Zulip Chat Archive

Stream: Is there code for X?

Topic: AM-GM


Yaël Dillies (Sep 03 2021 at 15:43):

Do we really not have the plain vanilla less-variables-becomes-trivial AM-GM?

lemma two_mul_sqrt_le_add {x y : } (h : 0  x + y) :
  2 * sqrt (x * y)  x + y :=

Kevin Buzzard (Sep 03 2021 at 15:44):

Is this OK for e.g. x=+1, y=-1? I don't know what Lean thinks real.sqrt(-1) is...

Yaël Dillies (Sep 03 2021 at 15:48):

I read the docstring before writing wrong stuff for once :upside_down: :
"The square root of a real number. This returns 0 for negative inputs."

Martin Dvořák (Sep 04 2021 at 14:43):

OT about the real.sqrt of negative numbers... We should never be able to prove (sqrt x = sqrt y) → (x = y) right?

Eric Wieser (Sep 04 2021 at 14:47):

We can for nnreal

Martin Dvořák (Sep 04 2021 at 14:51):

How lovely we can guarantee non-negativity by a TYPE.


Last updated: Dec 20 2023 at 11:08 UTC