coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others
Chronological Thread
- From: Jan Bessai <jan.bessai AT tu-dortmund.de>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Proving a multi-part theorem where later parts are a consequence of others
- Date: Tue, 24 Mar 2020 17:21:07 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jan.bessai AT tu-dortmund.de; spf=Pass smtp.mailfrom=jan.bessai AT tu-dortmund.de; spf=None smtp.helo=postmaster AT unimail.uni-dortmund.de
- Ironport-phdr: 9a23:qro9/RdenmWFZ4BbL94L1rAqlGMj4u6mDksu8pMizoh2WeGdxcu8YR7h7PlgxGXEQZ/co6odzbaP7+a5BDVLvMvJmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3wOgVvO+v6BJPZgdip2OCu4Z3TZBhDiCagbb9oIxi6sArcutMLjYZiN6o9xRvEr3tVcOlK2G1kIk6ekBn76sqs5pBo7j5eu+gm985OUKX6e7o3QLlFBzk4MG47+dPmuwDbQQSA+nUTXGMWkgFVAwfe9xH1Qo3xsirhueVj3iSRIND7Qqo1WTSm6KdrVQPohSIaPDM37G3blsp9h79drRm8pRJw3pTUbZmbOvR+YK3TYNAURWROUclNSiNOAJixb5cTA+cbIepUs5Xxq0UIoBCjBQesHuTvyjpQi3Hyx6I61fkqHBzY0ww7BNIBqnXUp8jyOacQS++1yrPEwi7dYPNNwjfy8onIfws9ofGRRL5/bM3RyVMzFwPAk1WQr5HqMymI2esTqmWW6fdrW+G3i2M/tg19vDyiyt0yhoXUhI8Z0E3I+Tt6zYovJdC0VVZ3bN2kHZdKqS2WKZF6Tt08T21ypio3yr0LtJimdyYQ0psn3QTQa/mffoiI/B3jUOGRLC9lhHJjebK/ggy98UmkyuHmS8m01ldKojNYndnLrHANyxnT6tWBSvRg5EuuxCiA2xjS6uFCP080ibLWJ4M/zrM0jJYfr1nPEy3slEnrkqObdV8o9+i15+j/Z7XpvJ6cN4t6igHkNaQun9SyAeYiPQgIRWSU4vqz1Kb4/ULjQbVHleE2krTAvJ/HIsQbvLK5AwpI0oYl9hmzFSqp38oAkXkdMF1FYA6Hj5TuO1zWPP/4Cu6/j02wnzdv2vDJJabsAo7NL3jGiLfuZ6xx609ayAopzNBQ/YhYCr8bIKG7Zkikv9vBSxQ9LgacwuD9Cdw72JlNd3iIB/q7OaWam1KT/esua72ObYlTsjvmMPEkz+LzyHM+g0MYYK+lm5caPiPrVs96KlmUNCK/yuwKFn0H61JnEL7azWaaWDsWXE6cGrom72hlWp67SIvEXJyonbqNmiu2TMUPOzJ2T2uUGHKtTL2qHvcBbCXIf518lD0BXLmlDZIn1FSisxXmzqdhIqzY939A7MOx5J1O/+TW0CoK23lxBsWZ3XuKSjgqzH8VAjMxxrx6vEpxjFuOg/F1
Would it be possible for you to prove several lemmas without boilerplate
by collecting your premisses as the variables of a Section?
Section IncreasingReals.
Variable s : RealSequence.
Hypothesis increasing: s is increasing.
Variable b: Real.
Hypothesis sBounded: s is bounded above by b.
Lemma sup_s_real: IsReal (sup(s)).
Lemma s_converges: s converges to sup(s).
Lemma s_cauchy: s is a cauchy sequence.
End Section.
On Tue, Mar 24, 2020 at 11:09:23AM -0500, Agnishom Chattopadhyay wrote:
> 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'.
>
> 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.