Zulip Chat Archive
Stream: general
Topic: computable min (real)
Kenny Lau (Mar 14 2018 at 12:08):
Do we have a computable function that gives the minimum of two real numbers?
Chris Hughes (Mar 14 2018 at 13:19):
I don't think so. Why not write one?
Andrew Ashworth (Mar 14 2018 at 13:33):
the way reals are defined, how could you decide if any two arbitrary reals are smaller than another
Andrew Ashworth (Mar 14 2018 at 13:33):
two cauchy sequences could differ only in the eleventy billionth term
Chris Hughes (Mar 14 2018 at 13:34):
I'm pretty sure it's not possible. Although if reals were implemented differently it might be, so long as they weren't equal.
Kevin Buzzard (Mar 14 2018 at 14:26):
If the reals were given as actual Cauchy sequences (as some are I guess) then you could just take the min of the Cauchy sequences I guess. But if you just had the equivalence class then what can you do?
Andrew Ashworth (Mar 14 2018 at 17:39):
turns out i am mistaken, btw, earlier i mentioned it being hard to compute with cauchy sequences
Andrew Ashworth (Mar 14 2018 at 17:40):
actually i'm watching a presentation on how somebody did exactly that
Andrew Ashworth (Mar 14 2018 at 17:40):
http://videolectures.net/aug09_spitters_oconnor_cvia/
Andrew Ashworth (Mar 14 2018 at 17:41):
unfortunately it looks like producing that library was enough work that it was somebody's PhD dissertation
Andrew Ashworth (Mar 14 2018 at 17:46):
Bishop would be proud
Chris Hughes (Mar 14 2018 at 20:05):
@Kevin Buzzard quotients are computed as the objects they were quotiented from, so lean has access to the actual cauchy sequences. But how do you find the min of two cauchy sequences in general?
Kevin Buzzard (Mar 14 2018 at 20:08):
If you have two real numbers represented as Cauchy sequences of rationals then you can just take the termwise min and this will be Cauchy and tend to the min (this is a good exercise ;-) ) ; equality is decidable on the rationals so this shouldn't be a problem I guess. Or am I missing something?
Chris Hughes (Mar 14 2018 at 20:23):
No, I didn't think of that.
Kenny Lau (Mar 14 2018 at 21:48):
that's actually exactly the point of this thread. Real inequality is undecidable, but the min function is computable.
Mario Carneiro (Mar 14 2018 at 21:48):
As Kevin says, given two cauchy sequences and a continuous function of two reals (extending a function on rat) that you want to compute, you can get a cauchy sequence by applying the function pointwise. At no point do you need to decide inequality
Kenny Lau (Mar 14 2018 at 21:51):
is it easy to do in Lean?
Mario Carneiro (Mar 14 2018 at 21:58):
Sure, you would just need to show that min
is uniformly continuous, which isn't so hard (i.e. |min x y - min z w| <= |x - z| + |y - w|
)
Kenny Lau (Mar 14 2018 at 22:03):
which theorem should I use, after showing that it is uniformly continuous?
Chris Hughes (Mar 14 2018 at 22:08):
def rmin : cau_seq ℚ abs → cau_seq ℚ abs → cau_seq ℚ abs :=
λ ⟨x, hx⟩ ⟨y, hy⟩, ⟨λ n, min (x n) (y n), λ ε ε0, begin end⟩
Chris Hughes (Mar 14 2018 at 22:08):
and then lift to R
Kenny Lau (Mar 14 2018 at 22:09):
and then one would have to prove that the lift is well-defined
Mario Carneiro (Mar 14 2018 at 22:10):
That will be the major part of showing that the sequence min (f n) (g n)
is cauchy. Then you have to prove that when two cauchy sequences are near their output is also near, so that this lifts to a function on reals. Finally, you prove that it is in fact the min: it is clearly le than reals x
and y
, and if z <= x
and z <= y
then z <= min x y
.
Kenny Lau (Mar 14 2018 at 22:10):
right
Last updated: Dec 20 2023 at 11:08 UTC