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: Laurent Thery <Laurent.Thery AT inria.fr>
- 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:17:45 +0100
- Autocrypt: addr=thery AT sophia.inria.fr; prefer-encrypt=mutual; keydata= mQENBE3a3V8BCADTeORKU7I7UmBBcs4VhSCq1IgKD8vdmdrGAlF3IJSFng7Fk8+MgS2gWYcS Ukf5t+rjNM3Z6brfYXc1naZlf2JPGHvAGiz8+TkXL+/ZA6+gAoIKy/iKyD+hCD8m92WH3rPH vCX6EJ44FEI7gUJ37GlTjvuP0I55vaFcwEg8nDgkALaCJvrSHtePuPKR1Q+9q2dgR7fTObal HYGMAsgT6k6n2ofe4Q6VFRLJhruU02qAfV5zgIoa3xgrTwSr4RRDILHttAw7EN6aLG6JycJ7 sPsPsiQzrd/tFsNbiHYeojJCkU2pDSQ3pBtXAJL/z2pMWTeTXvA60l9w0sDO7M3mkC3vABEB AAG0J0xhdXJlbnQgVGjDqXJ5IDxMYXVyZW50LlRoZXJ5QGlucmlhLmZyPokBOAQTAQIAIgUC TdrdXwIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQHHaWvRTi0tpIgggAnSUYcU2N uchXkGGwmPuLmvSUMiLkyFPs9GF2YF1ONOuJtpnQMcpsseCkcmIjESz0h5OpknpyraUXvbh0 ZdFqaLC2E+GyV8/YQi71wSsTPgWP450u0XUt0ysjwkKW6aIxIhSzrtgNp4E6w5KzXVJxA/yM V5RNFHg/5uifgfv4b7xaGHV8L93NbSvedk1O7yje5Hqgfab0t6J5Kf0M3sG+pB3gEkDVK9B7 +0fhe7/5u1Nj5HoLWid8UNZfFzJzb18Xe2ckzNye0KdDtQFac8qGUzhLbEYt3ScYjRYTq9/d V4Cin39j7Oo64Nk71iiLBISyuk0Q9D+Jq7nwwcQr/R8s1rkBDQRN2t1fAQgA7H6aX6BfdO/X Vlf4EGEoyFQ5u/JDe+giIHWSS34YWDWVUYyp320CrAYAkh9lQ1Nvh1tsmgiUh5xnY7wY0tOi wJSm94XlYAmHrddmWVNXRn09GvZJhfI2LdVBg3oxPfc8+bV+Hz83z/5BMPLOogxB22QMPJ6e iD2EsUMPNsuCVQ8WNo6ZmueuuYe7vEUXLYdRXNumJJgekEuG/q1BD4xgfzWpWfUODm6WygWZ oov50DomcDcAHW03bgnHlqnYu20Qg00GqgR3FKlORTvnOxD5TMCXe+eLUxkQfvnjbIPhtrnJ hgJMKVkRBEoaQ/XA4FdvxloInYPbqxNZ72yd09BbewARAQABiQEfBBgBAgAJBQJN2t1fAhsM AAoJEBx2lr0U4tLaWNQH/2/fIaF9ngbKPBJbDxYa7glJuCfamJgy3R8mJ//VYsS4RbdroSX3 29EgWlTx2reu1b4C5n5k7l4KpLgsRIc3bLUasGv15nf8BqmKIMulidzsxJv86S2imY/0870Q NOiO9SElHE7/2q4J1m2ew77SegiqGVWHl6Zs+4ROfOILTy24o26BQMAZhPX7jEs04Atv6yjw OUIPbzFO+XRuKqkBwHn9S8+GQelT0Gh84Dc5D2jIF0+kWY7uHqe2O+2LPfgO2CYhqmVfr/Ym mZv2xUyhJ7gui2hYaggncQ96cM2KhnKlgMw8nStY0GTqVXLEjPYblz8mqtF8aBPRSk/DjjrF QeI=
Hi,
you can do this by hand
after your exists, you first assert :
assert (H : s is a cauchy sequence)
then do your split so the assumpition appears in every subgoal.
or you can prove the general lemmas
Lemma and_r (A B : Prop) : B -> (B -> A) -> (A /\ B).
Lemma and_l (A B : Prop) : A -> (A -> B) -> (A /\ B).
and use them instead of the tactic split
--
Laurent
On 3/24/20 5:09 PM, 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.