coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Courtieu <pierre.courtieu AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] proving a lemma in a proof
- Date: Wed, 23 Jan 2019 12:00:13 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-it1-f169.google.com
- Ironport-phdr: 9a23:quUVUxxBz/HyHBjXCy+O+j09IxM/srCxBDY+r6Qd1OIRIJqq85mqBkHD//Il1AaPAd2Lraocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HQbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiScIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CSmVBUMReWSxPDI2/coUBEfYOM+lDoonhvlsDtweyCRWwCO7tzDJDm3/43bc90+QkCQzIxg0gEMwUsHTOstr+KbkfUeeozKnS0TXDbu1Z2Srg44XPahAhoO+DXahqccXP00UgCwTFjkiKqYz5PjOayPkNvnOU7+plT+2vimonpxttrTiow8chk4/EjZ8WxFDc7Sh13po5KNmiREN4YdOoCoZcuiCbOodsX88vQmVltSAnwbMco5G7ZjIFyJE/yh7fdfOHd4+I7wrmVOmLIDd4gGtpeLOjhxqv6ESgxPDwW8iw3VpQoSpFld7Mtn8J1xPN8MSIVvx9/kK51TaO0QDc9P1ELFgqmabHL5Mt2L09m5oJvUjeHyL7mV/6gLKXe0gg4uSo7v7oYrTipp+SLY90jQT+P7w2msy+H+s4KBIOUHaB9eug073j4Ff5QKlLjvIoj6nUq5/aJcEBqa64Bw9ZyJos6xG6Dzu+ytQXgWEHLE5ZeBKAl4XmJ1bOIOnhAfijh1SsjSxkyuvdPrzhB5XNNmLMnK3gfbZ78U5cyRA8wcpR55JOWfk9J6fYXVa5n9jFBFdtOAuthu3jFd9V14UEWGvJDLXPY43Itlrd3uMiOfOBLKQSpSzhKvU4r6r2jHIjg1Jbdq60x4cWZW2QEfFvIkHfan3p1IRSWVwWtxYzGbS5wGaJViReMjPrB/plt2MLTbm+BIKGfbiDxbmI3SO1BJpTPzkUBVWFEHOufIKBCa5VNHCiZ/R5mzlBboCPDpc73Ej35gD/wrtjaOHT/39A7M+x5J1O/+TW0CoK23l0AsCaiT/fSmh1miYJW2Zz0vkh8ApyzVCM1aU+iPtdR4Re
Hi,
ASFAIU a nested "Lemma" cannot and never will use the enclosing proof
context. Period. "assert" is made for that, it declares a subgoal
instead of a lemma which is the right thing to do if one wants to use
current proof context. I think there is no point in having anything
else for that.
The goal of a nested lemma is (and has always been) to insert a lemma
*before* the current lemma in the environment, and then keep proving
the current lemma in the new *updated* environment, without replaying
the beginning of its proof. This supposes of course that the side
effect of inserting a lemma in the environment will have no effect on
the beginning of the proof.
While this is very useful (mainly during proof development as said in
this thread), the two reasons why this is currently discouraged are to
my knowledge (please feel to add other ones):
1) It may not be the case that the insertion has no effect (although I
don't really see how this could happen, universes are checked at "Qed"
time anyway). It is therefore a bit "dangerous" for consistency to
have such side effects on the proof environment. However as a
temporary solution this is not a real problem imho. We could even
enforce the use of Admitted until the nested lemmas are removed.
2) The (very cool) feature of late coq versions allowing for editing a
proof without checking the proofs of previous lemmas (so called "async
edition", allowing to start working almost immediately after opening a
file) heavily relies on the ability to deduce the content of the
environment by only looking at previous lemma statements (+ "proof
using" annotations in sections). However I don't see any reason why we
could not read also the statement of nested lemmas during this
process.
It looks to me that this feature could be implemented cleanly if some
development power were dedicated to it. But there are a lot of cool
features to wish for and not an infinite manpower in the coq dev team.
It is very good news that some effort are currently dedicated to UI in
general.
P
Le mer. 23 janv. 2019 à 11:14, Gaëtan Gilbert
<gaetan.gilbert AT skyskimmer.net>
a écrit :
>
> Could you report this on github with enough info to reproduce? Thanks
>
> Gaëtan Gilbert
>
> On 22/01/2019 06:08, Jeremy Dawson wrote:
> >
> > Hi,
> >
> > I get the following errors:
> >
> > gen_moveL < apply midI3.
> > Toplevel input, characters 6-11:
> > > apply midI3.
> > > ^^^^^
> > Error: The reference midI3 was not found in the current environment.
> >
> > gen_moveL < Check midI3.
> > Toplevel input, characters 6-11:
> > > Check midI3.
> > > ^^^^^
> > Error: The reference midI3 was not found in the current environment.
> >
> > gen_moveL < Lemma midI3: forall T (a b c d : list T) (x y : T),
> > a = c -> b = d -> a ++ x :: b = c ++ x :: d.
> > gen_moveL < Toplevel input, characters 6-11:
> > > Lemma midI3: forall T (a b c d : list T) (x y : T),
> > > ^^^^^
> > Error: midI3 already exists.
> >
> > I'm in the middle of a long proof, in which I have previously proved a
> > useful lemma, called midI3.
> >
> > Presumably the lemma I've proved is considered (though not actually) to
> > depend somehow on the particular state of the proof at which I first
> > proved it. Would that be right?
> >
> > but it seems the system won't let me use it at the current point in my
> > proof, and won't let me prove it again.
> >
> > So my question is, having decided during a proof that a particular lemma
> > would be useful, how to I prove and use it?
> >
> > thanks
> >
> > Jeremy
> >
- RE: [Coq-Club] proving a lemma in a proof, (continued)
- RE: [Coq-Club] proving a lemma in a proof, Soegtrop, Michael, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Gaëtan Gilbert, 01/23/2019
- RE: [Coq-Club] proving a lemma in a proof, Soegtrop, Michael, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, James McKinna, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Christian Doczkal, 01/23/2019
- RE: [Coq-Club] proving a lemma in a proof, Soegtrop, Michael, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Gaëtan Gilbert, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Jeremy Dawson, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Laurent Thery, 01/22/2019
- Re: [Coq-Club] proving a lemma in a proof, Jan Bessai, 01/22/2019
- Re: [Coq-Club] proving a lemma in a proof, Gaëtan Gilbert, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Pierre Courtieu, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Adam Chlipala, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Théo Zimmermann, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Maxime Dénès, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Adam Chlipala, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Ralf Jung, 01/24/2019
- Re: [Coq-Club] proving a lemma in a proof, Théo Zimmermann, 01/24/2019
- Re: [Coq-Club] proving a lemma in a proof, Adam Chlipala, 01/24/2019
- Re: [Coq-Club] proving a lemma in a proof, Beta Ziliani, 01/24/2019
- Re: [Coq-Club] proving a lemma in a proof, Adam Chlipala, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Maxime Dénès, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Théo Zimmermann, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Adam Chlipala, 01/23/2019
- Re: [Coq-Club] proving a lemma in a proof, Pierre Courtieu, 01/23/2019
- RE: [Coq-Club] proving a lemma in a proof, Soegtrop, Michael, 01/23/2019
Archive powered by MHonArc 2.6.18.