coq-club AT inria.fr
Subject: The Coq mailing list
List archive
[Coq-Club] Proving a multi-part theorem where later parts are a consequence of others
Chronological Thread
- From: Agnishom Chattopadhyay <agnishom AT cmi.ac.in>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others
- Date: Tue, 24 Mar 2020 11:09:23 -0500
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=agnishom AT cmi.ac.in; spf=Pass smtp.mailfrom=agnishom AT cmi.ac.in; spf=None smtp.helo=postmaster AT mail.cmi.ac.in
- Ironport-phdr: 9a23:ui5glBevlvfLJHR7CTqCcSWTlGMj4u6mDksu8pMizoh2WeGdxc28YB7h7PlgxGXEQZ/co6odzbGJ4+a9ASQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpW1aJhKqPg1sY+/xB4T6jsKt1un09YeATR9PgW+UbrVzNxWxqE36tsAKnYx6I6ox2xLY6i9BdOJX3mNvIHqYmhe678z2/Zg1oHcYgO4o68MVCfayRK8/V7ENVG13YVBw39XisFz4dSXK43IdVmsMlR8RWlrO6RC8V5y3sy2o77MhihnfBtX/SPUPYRrn971iEUa6gyIGcTcytmDR2JQp0fBr5Sm5rhk6+Lb6JYGYMP0nIPHYdNIeA2FEX4BYXGpABNHkYg==
Often it is customary to phrase a theorem in a way that has multiple parts and each of the parts depend on the others and they may additionally introduce new variables.
For example,
For all sequences s of real numbers,
s is increasing ->
for all real number b, s is bounded above by b ->
exists real number l,
l = sup(s)
/\ s converges to l
/\ s is a cauchy sequence.
One might prove "s is a cauchy sequence" by appealing to some "s converges to l" (and some other theorem which says convergent sequences are Cauchy) but when they switch to the last conjunct, the previous conjuncts are not directly accessible.
How does one get around this issue?
One way might be to write two different lemmas: One talking about the first two conjuncts, and the second talking about just the third. However, this is ugly because in the second lemma one has to repeat a lot of boilerplate in order to even define what l is.
Is there a cleaner way to do this? Any tactics or patterns to make coq remember older conjuncts?
For reference, my actual theorem looks like this:
Lemma monSlider_state {A : Type} : forall mon buf sc l,
length l > 0 ->
length buf > 0 ->
forall bs mon', (eval4 mon l) = (bs, mon') ->
forall slb' slmon', (eval2 (monSlider mon buf sc) l) = (slb', slmon') ->
exists buf', buf' = firstn (length buf) (bs ++ buf)
/\ slmon' = @monSlider A mon' buf' sc
/\ length buf' = length buf
/\ slb' = sc buf'.
length l > 0 ->
length buf > 0 ->
forall bs mon', (eval4 mon l) = (bs, mon') ->
forall slb' slmon', (eval2 (monSlider mon buf sc) l) = (slb', slmon') ->
exists buf', buf' = firstn (length buf) (bs ++ buf)
/\ slmon' = @monSlider A mon' buf' sc
/\ length buf' = length buf
/\ slb' = sc buf'.
The proof of `slb' = sc buf'` depends on the fact that `slmon' = @monSlider A mon' buf' sc` but this fact is not accessible when I am proving the last conjunct.
--Agnishom
- [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Agnishom Chattopadhyay, 03/24/2020
- Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Laurent Thery, 03/24/2020
- Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Théo Winterhalter, 03/24/2020
- Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Roger Witte, 03/24/2020
- Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Jason -Zhong Sheng- Hu, 03/24/2020
- Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Roger Witte, 03/24/2020
- Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others, Jan Bessai, 03/24/2020
Archive powered by MHonArc 2.6.18.