Zulip Chat Archive
Stream: new members
Topic: proving a goal already instantiated by `use` variables?
rzeta0 (Sep 13 2024 at 12:53):
I've hit an unusual challenge - the goal I'm proving is already instantiated by the choices made by use
.
Note: I'm new to constructor
and use
.
Context
I'm doing ex 2.5.9-9 from The Mechanics of Proof:
Let be real numbers, and suppose that , and . Show that there exist nonnegative real numbers such that , and .
"Show there exist" means I simply have to find an example that works. Here satisfies the constraints.
To be explicit, means , and the requirements are met: three times.
Lean Code
The exercise gives us a head start:
example {a b c : ℝ} (ha : a ≤ b + c) (hb : b ≤ a + c) (hc : c ≤ a + b) :
∃ x y z, x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0 ∧ a = y + z ∧ b = x + z ∧ c = x + y := by
sorry
I started developing the proof as follows:
example {a b c : ℝ} (ha : a ≤ b + c) (hb : b ≤ a + c) (hc : c ≤ a + b) :
∃ x y z, x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0 ∧ a = y + z ∧ b = x + z ∧ c = x + y := by
use 0, 0, 0
constructor -- 0 ≥ 0
· norm_num
constructor -- 0 ≥ 0
· norm_num
constructor -- 0 ≥ 0
· norm_num
The satisfies the first three goals of the conjunction x ≥ 0
then y ≥ 0
and then z ≥ 0
.
I continued...
constructor -- a = 0+0
· -- TODO
The info view confirms what the current dot-focussed goal is
a b c : ℝ
ha : a ≤ b + c
hb : b ≤ a + c
hc : c ≤ a + b
⊢ a = 0 + 0
Question: How do I show a = 0 + 0
? Why is it even asking me to? I find this confusing.
My Attempt at Thinking
My beginner brain is telling me I need to show that the chosen example confirms to both the hypotheses and the "such that" conjunction.
A simpler example is "show there exists a natural number such that . I can chose and then show . If there was an additional hypothesis " is even". Then I could choose and show both "12 is even" and .
Following this simpler example, I can't see why Lean is asking me to use the chosen to prove .
Yes, I am confused, sorry.
Edward van de Meent (Sep 13 2024 at 13:01):
rzeta0 said:
"Show there exist" means I simply have to find an example that works. Here x=y=z=0 satisfies the constraints.
this doesn't satisfy the constraints, and this is exactly what lean is trying to tell you!
you get to say what and are; you need to prove that these and exist for all possible combinations of and . in particular, (obviously) doesn't work for .
Edward van de Meent (Sep 13 2024 at 13:03):
a rephrasing of the question might be: "Prove that for all real , if , and , there exist nonnegative such that ..."
Edward van de Meent (Sep 13 2024 at 13:07):
it seems your idea of the question was "Prove that there exist such that ...", but that is a distinctly different question.
rzeta0 (Sep 13 2024 at 13:22):
@Edward van de Meent
Do you mean "you get to say what x, yand z are" .. not "you get to say what a,b and c are" ?
I need to read your reply a few times to get my brain to understand. I will reply later this afternoon.
Edward van de Meent (Sep 13 2024 at 13:32):
indeed: you get to say what x,y and z are, but not what a,b and c are.
Ruben Van de Velde (Sep 13 2024 at 13:34):
use
is a "dangerous" tactic, in the sense that you go from proving "there is some value I haven't found yet that satisfies some constraints" to "this value, this is the one that satisfies the constraints, which I'll prove now". In your case, you asserted that zero was this value, but you're now noticing that it isn't
Ruben Van de Velde (Sep 13 2024 at 13:35):
So you need to go back to before the point where you wrote use
, and think what better values would be
Edward van de Meent (Sep 13 2024 at 13:38):
there are quite some more tactics which can be dangerous in this way; apply
, left
and right
can give similar issues.
rzeta0 (Sep 13 2024 at 22:15):
After a couple of hours trying to understand this I'm afraid I can't.
Here is my thinking in detail so we can spot the error:
-
The purpose of the proof is to choose which satisfy the constraints.
-
We can try .
-
The exercise defines
a=y+z
,b=x+z
,c=x+y
. This gives us . -
The hypotheses are satisfied.
ha: a ≤ b + c
becomes0 ≤ 0 + 0
, which is true. Similar forhb
andhc
.
Where in these 4 steps is my error?
I appreciate your patience with my mathematical immaturity.
Yakov Pechersky (Sep 13 2024 at 22:43):
On the contrary, you are not free to assign a = b = c = 0
. You need to find, for any assignment of a, b, c
such that a ≤ b + c
etc, the x, y, z
. For example, a = b = c = 1
satisfies the inequalities. In that instance, what could x, y, z
be?
Yakov Pechersky (Sep 13 2024 at 22:44):
Said differently, you proved something of assigned x y z => assigned a b c
but you are asked to prove (handwavily) assigned a b c => assigned x y z
.
rzeta0 (Sep 13 2024 at 23:21):
Yakov - thanks for trying to help.
When I inevitably use use
in the code, it will be for x
, y
and z
.
That is correct?
Dan Velleman (Sep 14 2024 at 15:42):
rzeta0 said:
Here is my thinking in detail so we can spot the error:
...
- The exercise defines
a=y+z
,b=x+z
,c=x+y
. This gives us .
This is your mistake. The exercise does not define a
, b
, and c
by these equations. Rather, these equations are part of what you have to prove. You have to prove that there are numbers x
, y
, and z
that satisfy six conditions, and these three equations are the last three of those six conditions.
It might be helpful to think of a
, b
, and c
as being chosen by someone else before the proof starts. Someone has chosen three numbers a
, b
, and c
, written them down on a piece of paper, and sealed that piece of paper in an envelope. Those are the values of a
, b
, and c
in this proof. You don't get to change them. You know that they satisfy the hypotheses ha
, hb
, and hc
, but you don't know anything else about them. The values of x
, y
, and z
are going to depend on a
, b
, and c
. In other words, in your use
steps, you won't be choosing particular numbers for x
, y
, and z
, you'll be choosing formulas involving a
, b
, and c
.
rzeta0 (Sep 14 2024 at 19:35):
Thanks everyone for the replies.
Together with this thread, and the other one, I think I understand the root cause now.
I should be thinking of this as a "for any a,b,c, show there exist x, y,z such that ..."
Last updated: May 02 2025 at 03:31 UTC